From fa24acd68b754c5691c8c6186cce027bca7a3ae2 Mon Sep 17 00:00:00 2001 From: Jagan Elavarasan Date: Wed, 16 Jul 2025 18:53:57 +0530 Subject: [PATCH 01/95] feat(analytics): add support for analytics in DE --- Cargo.lock | 139 ++++++++- Cargo.toml | 3 + analytics/README.md | 303 ++++++++++++++++++++ analytics/migrations/001_routing_events.sql | 108 +++++++ analytics/run_migrations.sh | 20 ++ config/development.toml | 15 + config/docker-configuration.toml | 15 + docker-compose.yaml | 95 +++++- scripts/test_analytics.sh | 197 +++++++++++++ scripts/test_kafka_connection.sh | 19 ++ src/analytics/client.rs | 171 +++++++++++ src/analytics/events.rs | 279 ++++++++++++++++++ src/analytics/kafka_producer.rs | 224 +++++++++++++++ src/analytics/middleware.rs | 166 +++++++++++ src/analytics/mod.rs | 11 + src/analytics/types.rs | 113 ++++++++ src/app.rs | 50 +++- src/config.rs | 3 + src/lib.rs | 1 + 19 files changed, 1910 insertions(+), 22 deletions(-) create mode 100644 analytics/README.md create mode 100644 analytics/migrations/001_routing_events.sql create mode 100755 analytics/run_migrations.sh create mode 100755 scripts/test_analytics.sh create mode 100755 scripts/test_kafka_connection.sh create mode 100644 src/analytics/client.rs create mode 100644 src/analytics/events.rs create mode 100644 src/analytics/kafka_producer.rs create mode 100644 src/analytics/middleware.rs create mode 100644 src/analytics/mod.rs create mode 100644 src/analytics/types.rs diff --git a/Cargo.lock b/Cargo.lock index d7f0734f..997a4bc7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -999,6 +999,12 @@ dependencies = [ "half", ] +[[package]] +name = "cityhash-rs" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93a719913643003b84bd13022b4b7e703c09342cd03b679c4641c7d2e50dc34d" + [[package]] name = "clang-sys" version = "1.8.1" @@ -1035,6 +1041,45 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +[[package]] +name = "clickhouse" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3093f817c4f81c8bd174ed8dd30eac785821a8a7eef27a7dcb7f8cd0d0f6548" +dependencies = [ + "bstr", + "bytes", + "cityhash-rs", + "clickhouse-derive", + "futures", + "futures-channel", + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "lz4_flex", + "replace_with", + "sealed", + "serde", + "static_assertions", + "thiserror 1.0.69", + "time", + "tokio", + "url", + "uuid", +] + +[[package]] +name = "clickhouse-derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d70f3e2893f7d3e017eeacdc9a708fbc29a10488e3ebca21f9df6a5d2b616dbb" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.100", +] + [[package]] name = "cmake" version = "0.1.54" @@ -1256,6 +1301,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc16" version = "0.4.0" @@ -1646,7 +1706,7 @@ checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" dependencies = [ "darling 0.20.10", "either", - "heck", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.100", @@ -2089,6 +2149,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "heck" version = "0.5.0" @@ -2665,6 +2731,25 @@ dependencies = [ "serde", ] +[[package]] +name = "kafka" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2054ba4edcb4dcda4209e138c7e88caf26d4a325b3db76fbdb6ca5eecc23e426" +dependencies = [ + "byteorder", + "crc", + "flate2", + "fnv", + "openssl", + "openssl-sys", + "ref_slice", + "snap", + "thiserror 1.0.69", + "tracing", + "twox-hash", +] + [[package]] name = "keyed_priority_queue" version = "0.4.2" @@ -2787,6 +2872,12 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "lz4_flex" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08ab2867e3eeeca90e844d1940eab391c9dc5228783db2ed999acbc0a9ed375a" + [[package]] name = "masking" version = "0.1.0" @@ -3126,6 +3217,7 @@ dependencies = [ "bytes", "cargo_metadata", "chrono", + "clickhouse", "config", "console-subscriber", "cpu-time", @@ -3138,10 +3230,12 @@ dependencies = [ "futures", "gethostname", "hex", + "http-body-util", "hyper 1.6.0", "jemalloc-ctl", "jemallocator", "josekit", + "kafka", "lazy_static", "masking 0.1.0 (git+https://github.com/juspay/hyperswitch?tag=v1.111.1)", "mysqlclient-sys", @@ -3862,6 +3956,12 @@ dependencies = [ "bitflags 2.9.0", ] +[[package]] +name = "ref_slice" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4ed1d73fb92eba9b841ba2aef69533a060ccc0d3ec71c90aeda5996d4afb7a9" + [[package]] name = "regex" version = "1.11.1" @@ -3933,6 +4033,12 @@ dependencies = [ "bytecheck", ] +[[package]] +name = "replace_with" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51743d3e274e2b18df81c4dc6caf8a5b8e15dbe799e0dca05c7617380094e884" + [[package]] name = "reqwest" version = "0.11.27" @@ -4409,6 +4515,18 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sealed" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a8caec23b7800fb97971a1c6ae365b6239aaeddfb934d6265f8505e795699d" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -4474,6 +4592,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "serde_json" version = "1.0.140" @@ -4613,6 +4742,12 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + [[package]] name = "socket2" version = "0.5.8" @@ -4673,7 +4808,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", diff --git a/Cargo.toml b/Cargo.toml index 77bf6526..694664a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,6 +73,9 @@ hex = "0.4.3" time = { version = "0.3.36", features = ["serde"] } uuid = { version = "1.10.0", features = ["v4", "v7", "fast-rng"] } reqwest = { version = "0.12.7", features = ["json", "__rustls"] } +http-body-util = "0.1.3" +kafka = "0.10.0" +clickhouse = { version = "0.12.2", features = ["time", "uuid"] } nanoid = "0.4.0" mysqlclient-sys = { version = "0.4.2", features = ["buildtime_bindgen"] } diff --git a/analytics/README.md b/analytics/README.md new file mode 100644 index 00000000..966e12c9 --- /dev/null +++ b/analytics/README.md @@ -0,0 +1,303 @@ +# Decision Engine Analytics + +This directory contains the analytics infrastructure for the Decision Engine project, implementing real-time event tracking and analytics using ClickHouse and Kafka. + +## Architecture + +The analytics system follows the Hyperswitch analytics pattern with the following components: + +``` +┌─────────────────────┐ +│ Decision Engine │ +│ (Main Service) │ +└──────────┬──────────┘ + │ Events + ▼ +┌─────────────────────┐ +│ Kafka │ +│ (Event Stream) │ +└──────────┬──────────┘ + │ Real-time + ▼ +┌─────────────────────┐ +│ ClickHouse │ +│ ┌───────────────┐ │ +│ │ Kafka Engine │ │ +│ │ Tables │ │ +│ └───────┬───────┘ │ +│ │ │ +│ ▼ │ +│ ┌───────────────┐ │ +│ │ Materialized │ │ +│ │ Views │ │ +│ └───────┬───────┘ │ +│ │ │ +│ ▼ │ +│ ┌───────────────┐ │ +│ │ Storage │ │ +│ │ Tables │ │ +│ └───────────────┘ │ +└─────────────────────┘ +``` + +## Components + +### 1. Event Tracking +- **Endpoints Tracked**: `/routing/evaluate` and `/decide-gateway` +- **Event Data**: Request/response payloads, processing time, gateway selection, errors +- **Middleware**: Automatic event capture for tracked endpoints + +### 2. Data Storage +- **Kafka Topics**: `decision-engine-routing-events` +- **ClickHouse Tables**: + - `routing_events_queue` (Kafka engine for ingestion) + - `routing_events` (CollapsingMergeTree for storage) + - `routing_events_hourly` (Hourly aggregations) + - `routing_events_daily` (Daily aggregations) + +### 3. Real-time Processing +- **Kafka Producer**: Batched event publishing +- **Materialized Views**: Real-time data transformation +- **Aggregations**: Automatic hourly and daily rollups + +## Quick Start + +### 1. Start Analytics Infrastructure + +```bash +# Start with analytics profile +docker-compose --profile analytics up -d + +# This will start: +# - Zookeeper +# - Kafka +# - ClickHouse +# - Analytics migrator (runs schema setup) +``` + +### 2. Enable Analytics in Configuration + +Update your `config/development.toml`: + +```toml +[analytics] +enabled = true + +[analytics.kafka] +brokers = ["kafka:29092"] +topic_prefix = "decision-engine" +batch_size = 100 +batch_timeout_ms = 1000 + +[analytics.clickhouse] +host = "http://clickhouse:8123" +username = "analytics_user" +password = "analytics_pass" +database = "decision_engine_analytics" +``` + +### 3. Start Decision Engine + +```bash +# Start the main application +docker-compose up open-router-local +``` + +## Database Schema + +### Routing Events Table + +```sql +CREATE TABLE routing_events ( + event_id String, + merchant_id LowCardinality(String), + request_id String, + endpoint LowCardinality(String), + method LowCardinality(String), + request_payload String, + response_payload String, + status_code UInt16, + processing_time_ms UInt32, + gateway_selected LowCardinality(Nullable(String)), + routing_algorithm_id Nullable(String), + error_message Nullable(String), + user_agent Nullable(String), + ip_address Nullable(String), + created_at DateTime DEFAULT now(), + inserted_at DateTime DEFAULT now(), + sign_flag Int8 +) ENGINE = CollapsingMergeTree(sign_flag) +PARTITION BY toStartOfDay(created_at) +ORDER BY (created_at, merchant_id, request_id, event_id); +``` + +### Aggregated Views + +- **Hourly Aggregations**: Request counts, success/failure rates, performance metrics +- **Daily Aggregations**: Daily summaries with unique request tracking + +## Querying Analytics Data + +### Basic Queries + +```sql +-- Total requests by endpoint +SELECT + endpoint, + sum(sign_flag) as total_requests +FROM routing_events +WHERE created_at >= now() - INTERVAL 1 DAY +GROUP BY endpoint; + +-- Success rate by gateway +SELECT + gateway_selected, + sum(if(status_code < 400, sign_flag, 0)) as successful_requests, + sum(sign_flag) as total_requests, + (successful_requests / total_requests) * 100 as success_rate +FROM routing_events +WHERE created_at >= now() - INTERVAL 1 DAY + AND gateway_selected IS NOT NULL +GROUP BY gateway_selected; + +-- Performance metrics +SELECT + endpoint, + avg(processing_time_ms) as avg_processing_time, + quantile(0.95)(processing_time_ms) as p95_processing_time, + quantile(0.99)(processing_time_ms) as p99_processing_time +FROM routing_events +WHERE created_at >= now() - INTERVAL 1 DAY +GROUP BY endpoint; +``` + +### Using Aggregated Tables + +```sql +-- Hourly trends +SELECT + hour, + endpoint, + total_requests, + successful_requests, + (successful_requests / total_requests) * 100 as success_rate, + avg_processing_time_ms +FROM routing_events_hourly +WHERE hour >= now() - INTERVAL 24 HOUR +ORDER BY hour DESC; +``` + +## Configuration Options + +### Analytics Configuration + +```toml +[analytics] +enabled = true # Enable/disable analytics + +[analytics.kafka] +brokers = ["kafka:29092"] # Kafka broker addresses +topic_prefix = "decision-engine" # Topic prefix for events +batch_size = 100 # Events per batch +batch_timeout_ms = 1000 # Batch timeout in milliseconds + +[analytics.clickhouse] +host = "http://clickhouse:8123" # ClickHouse HTTP endpoint +username = "analytics_user" # ClickHouse username +password = "analytics_pass" # ClickHouse password +database = "decision_engine_analytics" # Database name +``` + +## Monitoring and Maintenance + +### Health Checks + +The analytics client provides health check functionality: + +```rust +// Check analytics connectivity +analytics_client.health_check().await?; +``` + +### Data Retention + +- **Raw Events**: 18 months (configurable via TTL) +- **Hourly Aggregations**: 12 months +- **Daily Aggregations**: 24 months + +### Performance Considerations + +1. **Batch Processing**: Events are batched for efficient Kafka publishing +2. **Async Processing**: Analytics don't block request processing +3. **Fallback Handling**: Graceful degradation when analytics are unavailable +4. **Partitioning**: Data partitioned by day for efficient queries + +## Troubleshooting + +### Common Issues + +1. **Kafka Connection Failed** + - Check Kafka broker connectivity + - Verify topic creation + - Check network configuration + +2. **ClickHouse Connection Failed** + - Verify ClickHouse is running + - Check credentials and database existence + - Verify network connectivity + +3. **Missing Events** + - Check analytics middleware is enabled + - Verify endpoint tracking configuration + - Check Kafka topic consumption + +### Debugging + +Enable debug logging for analytics: + +```toml +[log.console] +level = "DEBUG" +``` + +Check analytics client status: + +```bash +# Check if analytics is enabled +curl http://localhost:8080/health + +# Check Kafka topics +docker exec -it open-router-kafka kafka-topics --bootstrap-server localhost:9092 --list + +# Check ClickHouse tables +docker exec -it open-router-clickhouse clickhouse-client --query "SHOW TABLES FROM decision_engine_analytics" +``` + +## Development + +### Adding New Event Types + +1. Extend `RoutingEventData` struct in `src/analytics/types.rs` +2. Update ClickHouse schema in `analytics/migrations/` +3. Modify event extraction logic in middleware +4. Update aggregation queries if needed + +### Testing + +```bash +# Run analytics tests +cargo test analytics + +# Test with sample events +curl -X POST http://localhost:8080/routing/evaluate \ + -H "Content-Type: application/json" \ + -H "x-merchant-id: test-merchant" \ + -d '{"test": "data"}' +``` + +## Security Considerations + +1. **Data Privacy**: Ensure sensitive data is properly masked +2. **Access Control**: Restrict ClickHouse access to authorized users +3. **Network Security**: Use proper network isolation +4. **Data Retention**: Implement appropriate data retention policies diff --git a/analytics/migrations/001_routing_events.sql b/analytics/migrations/001_routing_events.sql new file mode 100644 index 00000000..27faa863 --- /dev/null +++ b/analytics/migrations/001_routing_events.sql @@ -0,0 +1,108 @@ +-- Merged SQL Migration File for Decision Engine Analytics +-- This file combines all migration steps into a single comprehensive migration +-- Created by merging: 001_routing_events.sql, 002_fix_datetime_parsing.sql, 002_fix_datetime_parsing_alternative.sql, 003_unix_timestamp_fix.sql + +-- ============================================================================= +-- STEP 1: Database Setup +-- ============================================================================= + +-- Create database if not exists +CREATE DATABASE IF NOT EXISTS decision_engine_analytics; + +-- Use the analytics database +USE decision_engine_analytics; + +-- ============================================================================= +-- STEP 2: Create Storage Tables (Final Schema) +-- ============================================================================= + +-- Create storage table with CollapsingMergeTree for routing events +CREATE TABLE IF NOT EXISTS routing_events ( + `event_id` String, + `merchant_id` LowCardinality(String), + `request_id` String, + `endpoint` LowCardinality(String), + `method` LowCardinality(String), + `request_payload` String, + `response_payload` String, + `status_code` UInt16, + `processing_time_ms` UInt32, + `gateway_selected` LowCardinality(Nullable(String)), + `routing_algorithm_id` Nullable(String), + `error_message` Nullable(String), + `user_agent` Nullable(String), + `ip_address` Nullable(String), + `created_at` DateTime DEFAULT now() CODEC(T64, LZ4), + `inserted_at` DateTime DEFAULT now() CODEC(T64, LZ4), + `sign_flag` Int8, + INDEX endpointIndex endpoint TYPE bloom_filter GRANULARITY 1, + INDEX gatewayIndex gateway_selected TYPE bloom_filter GRANULARITY 1, + INDEX statusIndex status_code TYPE bloom_filter GRANULARITY 1, + INDEX merchantIndex merchant_id TYPE bloom_filter GRANULARITY 1 +) ENGINE = CollapsingMergeTree(sign_flag) +PARTITION BY toStartOfDay(created_at) +ORDER BY (created_at, merchant_id, request_id, event_id) +TTL created_at + toIntervalMonth(18) +SETTINGS index_granularity = 8192; + +-- ============================================================================= +-- STEP 3: Create Kafka Integration (Final Version with Unix Timestamp Support) +-- ============================================================================= + +-- Drop existing views and tables if they exist (for clean migration) +DROP VIEW IF EXISTS routing_events_mv; +DROP TABLE IF EXISTS routing_events_queue; + +-- Create Kafka engine table with Unix timestamp handling (final version) +CREATE TABLE IF NOT EXISTS routing_events_queue ( + `event_id` String, + `merchant_id` String, + `request_id` String, + `endpoint` LowCardinality(String), + `method` LowCardinality(String), + `request_payload` String, + `response_payload` String, + `status_code` UInt16, + `processing_time_ms` UInt32, + `gateway_selected` LowCardinality(Nullable(String)), + `routing_algorithm_id` Nullable(String), + `error_message` Nullable(String), + `user_agent` Nullable(String), + `ip_address` Nullable(String), + `created_at` Int64, -- Unix timestamp (final fix) + `sign_flag` Int8 +) ENGINE = Kafka +SETTINGS + kafka_broker_list = 'open-router-kafka:29092', + kafka_topic_list = 'decision-engine-routing-events', + kafka_group_name = 'decision-engine-analytics', + kafka_format = 'JSONEachRow', + kafka_handle_error_mode = 'stream'; + +-- Create materialized view with Unix timestamp conversion (final version) +CREATE MATERIALIZED VIEW IF NOT EXISTS routing_events_mv TO routing_events AS +SELECT + event_id, + merchant_id, + request_id, + endpoint, + method, + request_payload, + response_payload, + status_code, + processing_time_ms, + gateway_selected, + routing_algorithm_id, + error_message, + user_agent, + ip_address, + -- Convert Unix timestamp to DateTime (final fix) + CASE + WHEN created_at > 0 + THEN toDateTime(created_at) + ELSE now() + END AS created_at, + now() AS inserted_at, + sign_flag +FROM routing_events_queue +WHERE length(_error) = 0; diff --git a/analytics/run_migrations.sh b/analytics/run_migrations.sh new file mode 100755 index 00000000..fa3a4e02 --- /dev/null +++ b/analytics/run_migrations.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +echo 'Waiting for ClickHouse to be ready...' +sleep 10 + +echo 'Running analytics migrations...' +for file in /analytics/migrations/*.sql; do + if [ -f "$file" ]; then + echo "Executing: $file" + clickhouse-client --host clickhouse --port 9000 --user analytics_user --password analytics_pass --multiquery --query "$(cat $file)" + if [ $? -eq 0 ]; then + echo "Successfully executed: $file" + else + echo "Failed to execute: $file" + exit 1 + fi + fi +done + +echo 'Analytics migrations completed!' diff --git a/config/development.toml b/config/development.toml index de3385c1..5f722b8c 100644 --- a/config/development.toml +++ b/config/development.toml @@ -49,6 +49,21 @@ max_feed_count = 200 tti = 7200 # i.e. 2 hours max_capacity = 5000 +[analytics] +enabled = true + +[analytics.kafka] +brokers = ["localhost:9092"] +topic_prefix = "decision-engine" +batch_size = 100 +batch_timeout_ms = 1000 + +[analytics.clickhouse] +host = "http://clickhouse:8123" +username = "analytics_user" +password = "analytics_pass" +database = "decision_engine_analytics" + [secrets] open_router_private_key = "" diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index 5f6d109c..1f19f0af 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -49,6 +49,21 @@ max_feed_count = 200 tti = 7200 # i.e. 2 hours max_capacity = 5000 +[analytics] +enabled = false + +[analytics.kafka] +brokers = ["kafka:29092"] +topic_prefix = "decision-engine" +batch_size = 100 +batch_timeout_ms = 1000 + +[analytics.clickhouse] +host = "http://clickhouse:8123" +username = "analytics_user" +password = "analytics_pass" +database = "decision_engine_analytics" + [secrets] open_router_private_key = "" diff --git a/docker-compose.yaml b/docker-compose.yaml index 993944fa..7f4ac086 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -36,7 +36,7 @@ services: - "com.docker.compose.watchfile=Cargo.lock" image: decision-engine-open-router-local:latest platform: linux/amd64 - container_name: open-router + container_name: open-router-local restart: unless-stopped ports: - "8080:8080" @@ -69,7 +69,7 @@ services: - "com.docker.compose.watchfile=Cargo.lock" image: decision-engine-open-router-local-pg:latest platform: linux/amd64 - container_name: open-router + container_name: open-router-local-pg restart: unless-stopped ports: - "8080:8080" @@ -138,7 +138,7 @@ services: - "com.docker.compose.watchfile=groovy.Dockerfile" - "com.docker.compose.watchfile=src/Runner.groovy" platform: linux/amd64 - container_name: groovy-runner + container_name: groovy-runner-local restart: unless-stopped ports: - "8085:8085" @@ -172,7 +172,7 @@ services: postgresql: image: postgres:latest - container_name: open-router-postgres + container_name: postgres-db restart: unless-stopped environment: - POSTGRES_USER=db_user @@ -220,7 +220,7 @@ services: db-migrator-postgres: image: rust:latest - container_name: db-migrator + container_name: db-migrator-postgres depends_on: postgresql: condition: service_healthy @@ -247,6 +247,90 @@ services: networks: - open-router-network + # Analytics Infrastructure + zookeeper: + image: confluentinc/cp-zookeeper:7.4.0 + platform: linux/amd64 + container_name: open-router-zookeeper + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + networks: + - open-router-network + profiles: + - analytics + + kafka: + image: confluentinc/cp-kafka:7.4.0 + platform: linux/amd64 + container_name: open-router-kafka + depends_on: + - zookeeper + ports: + - "9092:9092" + environment: + KAFKA_BROKER_ID: 1 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" + networks: + - open-router-network + profiles: + - analytics + healthcheck: + test: ["CMD", "kafka-topics", "--bootstrap-server", "localhost:9092", "--list"] + interval: 10s + timeout: 10s + retries: 5 + + clickhouse: + image: clickhouse/clickhouse-server:latest + platform: linux/amd64 + container_name: open-router-clickhouse + ports: + - "8123:8123" + - "9000:9000" + environment: + CLICKHOUSE_DB: decision_engine_analytics + CLICKHOUSE_USER: analytics_user + CLICKHOUSE_PASSWORD: analytics_pass + volumes: + - clickhouse-data:/var/lib/clickhouse + - ./analytics/clickhouse/init:/docker-entrypoint-initdb.d + networks: + - open-router-network + depends_on: + - kafka + - zookeeper + profiles: + - analytics + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8123/ping"] + interval: 10s + timeout: 5s + retries: 5 + + analytics-migrator: + image: clickhouse/clickhouse-server:latest + platform: linux/amd64 + container_name: analytics-migrator + depends_on: + clickhouse: + condition: service_healthy + kafka: + condition: service_healthy + volumes: + - ./analytics:/analytics + working_dir: /analytics + command: sh /analytics/run_migrations.sh + networks: + - open-router-network + profiles: + - analytics + networks: open-router-network: driver: bridge @@ -255,3 +339,4 @@ volumes: mysql-data: redis-data: postgres-data: + clickhouse-data: diff --git a/scripts/test_analytics.sh b/scripts/test_analytics.sh new file mode 100755 index 00000000..69b3facb --- /dev/null +++ b/scripts/test_analytics.sh @@ -0,0 +1,197 @@ +#!/bin/bash + +# Test script for Decision Engine Analytics +set -e + +echo "🚀 Testing Decision Engine Analytics Setup" +echo "==========================================" + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Function to print colored output +print_status() { + echo -e "${GREEN}✓${NC} $1" +} + +print_warning() { + echo -e "${YELLOW}⚠${NC} $1" +} + +print_error() { + echo -e "${RED}✗${NC} $1" +} + +# Check if Docker is running +if ! docker info > /dev/null 2>&1; then + print_error "Docker is not running. Please start Docker first." + exit 1 +fi + +print_status "Docker is running" + +# Check if docker-compose is available +if ! command -v docker-compose &> /dev/null; then + print_error "docker-compose is not installed" + exit 1 +fi + +print_status "docker-compose is available" + +echo "" +echo "🔧 Starting Analytics Infrastructure..." +echo "======================================" + +# Clean up any existing containers to avoid conflicts +print_status "Cleaning up existing containers..." +docker-compose --profile analytics down --remove-orphans 2>/dev/null || true + +# Start analytics infrastructure +print_status "Starting Zookeeper, Kafka, ClickHouse and Analytics Migrator..." +docker-compose up -d kafka zookeeper clickhouse analytics-migrator + +# Wait for services to be ready +echo "" +echo "⏳ Waiting for services to be ready..." +sleep 10 + +# Check Kafka +echo "" +echo "🔍 Checking Kafka..." +if docker exec open-router-kafka kafka-topics --bootstrap-server localhost:9092 --list > /dev/null 2>&1; then + print_status "Kafka is running" +else + print_error "Kafka is not responding" + exit 1 +fi + +# Check ClickHouse +echo "" +echo "🔍 Checking ClickHouse..." +if docker exec open-router-clickhouse clickhouse-client --query "SELECT 1" > /dev/null 2>&1; then + print_status "ClickHouse is running" +else + print_error "ClickHouse is not responding" + exit 1 +fi + +# Check if analytics database exists +echo "" +echo "🔍 Checking Analytics Database..." +if docker exec open-router-clickhouse clickhouse-client --query "SHOW DATABASES" | grep -q "decision_engine_analytics"; then + print_status "Analytics database exists" +else + print_warning "Analytics database not found, running migrations..." + + # Run migrations manually if needed + docker exec open-router-clickhouse clickhouse-client --multiquery < analytics/migrations/001_routing_events.sql + + if docker exec open-router-clickhouse clickhouse-client --query "SHOW DATABASES" | grep -q "decision_engine_analytics"; then + print_status "Analytics database created successfully" + else + print_error "Failed to create analytics database" + exit 1 + fi +fi + +# Check analytics tables +echo "" +echo "🔍 Checking Analytics Tables..." +TABLES=$(docker exec open-router-clickhouse clickhouse-client --query "SHOW TABLES FROM decision_engine_analytics") + +if echo "$TABLES" | grep -q "routing_events"; then + print_status "routing_events table exists" +else + print_error "routing_events table not found" + exit 1 +fi + +if echo "$TABLES" | grep -q "routing_events_queue"; then + print_status "routing_events_queue table exists" +else + print_error "routing_events_queue table not found" + exit 1 +fi + +# Test Kafka topic creation +echo "" +echo "🔍 Checking Kafka Topics..." +if docker exec open-router-kafka kafka-topics --bootstrap-server localhost:9092 --list | grep -q "decision-engine-routing-events"; then + print_status "Routing events topic exists" +else + print_warning "Creating routing events topic..." + docker exec open-router-kafka kafka-topics --bootstrap-server localhost:9092 --create --topic decision-engine-routing-events --partitions 3 --replication-factor 1 + print_status "Routing events topic created" +fi + +# Test sending a sample event to Kafka +echo "" +echo "🧪 Testing Event Publishing..." +SAMPLE_EVENT='{"event_id":"test-event-1","merchant_id":"test-merchant","request_id":"test-req-1","endpoint":"/routing/evaluate","method":"POST","request_payload":"{}","response_payload":"{}","status_code":200,"processing_time_ms":100,"gateway_selected":"stripe","routing_algorithm_id":"algo-1","error_message":null,"user_agent":"test-agent","ip_address":"127.0.0.1","created_at":"2024-01-01T12:00:00Z","sign_flag":1}' + +echo "$SAMPLE_EVENT" | docker exec -i open-router-kafka kafka-console-producer --bootstrap-server localhost:9092 --topic decision-engine-routing-events + +print_status "Sample event sent to Kafka" + +# Wait a moment for processing +sleep 5 + +# Check if event was processed by ClickHouse +echo "" +echo "🔍 Checking Event Processing..." +EVENT_COUNT=$(docker exec open-router-clickhouse clickhouse-client --query "SELECT count(*) FROM decision_engine_analytics.routing_events WHERE event_id = 'test-event-1'") + +if [ "$EVENT_COUNT" -gt 0 ]; then + print_status "Event successfully processed by ClickHouse" +else + print_warning "Event not yet processed (this might be normal for new setups)" +fi + +# Show sample queries +echo "" +echo "📊 Sample Analytics Queries" +echo "==========================" + +echo "" +echo "Total events in the last hour:" +docker exec open-router-clickhouse clickhouse-client --query " +SELECT count(*) as total_events +FROM decision_engine_analytics.routing_events +WHERE created_at >= now() - INTERVAL 1 HOUR +" + +echo "" +echo "Events by endpoint:" +docker exec open-router-clickhouse clickhouse-client --query " +SELECT + endpoint, + count(*) as event_count +FROM decision_engine_analytics.routing_events +GROUP BY endpoint +ORDER BY event_count DESC +" + +echo "" +echo "🎉 Analytics Setup Test Complete!" +echo "=================================" +print_status "All analytics components are running correctly" + +echo "" +echo "📝 Next Steps:" +echo "1. Enable analytics in your config: Set analytics.enabled = true" +echo "2. Start the decision engine: docker-compose up open-router-local" +echo "3. Send test requests to /routing/evaluate or /decide-gateway" +echo "4. Query analytics data using the sample queries above" + +echo "" +echo "🔗 Useful Commands:" +echo "- View ClickHouse logs: docker logs open-router-clickhouse" +echo "- View Kafka logs: docker logs open-router-kafka" +echo "- Connect to ClickHouse: docker exec -it open-router-clickhouse clickhouse-client" +echo "- List Kafka topics: docker exec open-router-kafka kafka-topics --bootstrap-server localhost:9092 --list" + +echo "" +echo "📚 For more information, see analytics/README.md" diff --git a/scripts/test_kafka_connection.sh b/scripts/test_kafka_connection.sh new file mode 100755 index 00000000..23ca2ea7 --- /dev/null +++ b/scripts/test_kafka_connection.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo "Testing Kafka connection from application container..." + +# Test 1: Check if the application can reach Kafka +echo "1. Testing network connectivity to Kafka..." +docker exec open-router-kafka sh -c "nc -z kafka 29092 && echo 'Kafka is reachable' || echo 'Kafka is NOT reachable'" + +# Test 2: Send a test message to the topic using kafka tools from within the kafka container +echo "2. Sending test message to decision-engine-routing-events topic..." +docker exec open-router-kafka kafka-console-producer --bootstrap-server localhost:9092 --topic decision-engine-routing-events <>, + event_sender: Option>, +} + +impl AnalyticsClient { + pub fn new(config: AnalyticsConfig) -> AnalyticsResult { + if !config.enabled { + info!("Analytics is disabled"); + return Ok(Self { + config, + kafka_producer: None, + event_sender: None, + }); + } + + // Initialize Kafka producer + let kafka_producer = Arc::new(KafkaProducer::new(config.kafka.clone())?); + + // Create event channel for batching + let (event_sender, event_receiver) = mpsc::channel::(1000); + + // Start batch processor + let _batch_processor = kafka_producer.start_batch_processor(event_receiver); + + info!("Analytics client initialized successfully"); + + Ok(Self { + config, + kafka_producer: Some(kafka_producer), + event_sender: Some(event_sender), + }) + } + + pub async fn track_routing_event(&self, event: RoutingEvent) -> AnalyticsResult<()> { + if !self.config.enabled { + return Ok(()); + } + + let event_data = event.to_event_data(); + + if let Some(sender) = &self.event_sender { + if let Err(e) = sender.try_send(event_data) { + match e { + mpsc::error::TrySendError::Full(_) => { + warn!("Analytics event queue is full, dropping event"); + } + mpsc::error::TrySendError::Closed(_) => { + error!("Analytics event channel is closed"); + return Err(AnalyticsError::Configuration( + "Event channel is closed".to_string(), + )); + } + } + } + } + + Ok(()) + } + + pub async fn track_routing_event_sync(&self, event: RoutingEvent) -> AnalyticsResult<()> { + if !self.config.enabled { + return Ok(()); + } + + let event_data = event.to_event_data(); + + if let Some(producer) = &self.kafka_producer { + producer.send_event(&event_data).await?; + } + + Ok(()) + } + + pub async fn flush_events(&self) -> AnalyticsResult<()> { + if !self.config.enabled { + return Ok(()); + } + + // Close the sender to trigger flush in batch processor + if let Some(sender) = &self.event_sender { + sender.closed().await; + } + + Ok(()) + } + + pub fn is_enabled(&self) -> bool { + self.config.enabled + } + + pub async fn health_check(&self) -> AnalyticsResult<()> { + if !self.config.enabled { + return Ok(()); + } + + // Test Kafka connectivity by sending a test event + if let Some(producer) = &self.kafka_producer { + let test_event = RoutingEventData { + event_id: "health-check".to_string(), + merchant_id: "health-check".to_string(), + request_id: "health-check".to_string(), + endpoint: "/health".to_string(), + method: "GET".to_string(), + request_payload: "{}".to_string(), + response_payload: r#"{"status": "ok"}"#.to_string(), + status_code: 200, + processing_time_ms: 1, + gateway_selected: None, + routing_algorithm_id: None, + error_message: None, + user_agent: Some("health-check".to_string()), + ip_address: Some("127.0.0.1".to_string()), + created_at: time::OffsetDateTime::now_utc(), + sign_flag: 1, + }; + + producer.send_event(&test_event).await?; + } + + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::analytics::{ClickhouseConfig, KafkaConfig}; + + #[tokio::test] + async fn test_analytics_client_disabled() { + let config = AnalyticsConfig { + enabled: false, + kafka: KafkaConfig::default(), + clickhouse: ClickhouseConfig::default(), + }; + + let client = AnalyticsClient::new(config).unwrap(); + assert!(!client.is_enabled()); + + let event = RoutingEvent::new( + "merchant-123".to_string(), + "req-456".to_string(), + "/routing/evaluate".to_string(), + "POST".to_string(), + ); + + // Should not error when disabled + let result = client.track_routing_event(event).await; + assert!(result.is_ok()); + } + + #[test] + fn test_analytics_config_default() { + let config = AnalyticsConfig::default(); + assert!(!config.enabled); + assert_eq!(config.kafka.brokers, vec!["localhost:9092"]); + assert_eq!(config.kafka.topic_prefix, "decision-engine"); + assert_eq!(config.clickhouse.host, "http://localhost:8123"); + assert_eq!(config.clickhouse.username, "analytics_user"); + } +} diff --git a/src/analytics/events.rs b/src/analytics/events.rs new file mode 100644 index 00000000..8b7650d4 --- /dev/null +++ b/src/analytics/events.rs @@ -0,0 +1,279 @@ +use crate::analytics::{AnalyticsResult, RoutingEventData}; +use axum::extract::Request; +use axum::response::Response; +use serde_json::Value; +use time::OffsetDateTime; +use uuid::Uuid; + +#[derive(Clone)] +pub struct RoutingEvent { + pub event_id: String, + pub merchant_id: String, + pub request_id: String, + pub endpoint: String, + pub method: String, + pub request_payload: String, + pub response_payload: String, + pub status_code: u16, + pub processing_time_ms: u32, + pub gateway_selected: Option, + pub routing_algorithm_id: Option, + pub error_message: Option, + pub user_agent: Option, + pub ip_address: Option, + pub created_at: OffsetDateTime, +} + +impl RoutingEvent { + pub fn new( + merchant_id: String, + request_id: String, + endpoint: String, + method: String, + ) -> Self { + Self { + event_id: Uuid::new_v4().to_string(), + merchant_id, + request_id, + endpoint, + method, + request_payload: String::new(), + response_payload: String::new(), + status_code: 0, + processing_time_ms: 0, + gateway_selected: None, + routing_algorithm_id: None, + error_message: None, + user_agent: None, + ip_address: None, + created_at: OffsetDateTime::now_utc(), + } + } + + pub fn from_request(request: &Request, merchant_id: String) -> Self { + let request_id = extract_request_id(request); + let endpoint = request.uri().path().to_string(); + let method = request.method().to_string(); + let user_agent = extract_user_agent(request); + let ip_address = extract_ip_address(request); + + Self { + event_id: Uuid::new_v4().to_string(), + merchant_id, + request_id, + endpoint, + method, + request_payload: String::new(), + response_payload: String::new(), + status_code: 0, + processing_time_ms: 0, + gateway_selected: None, + routing_algorithm_id: None, + error_message: None, + user_agent, + ip_address, + created_at: OffsetDateTime::now_utc(), + } + } + + pub fn with_request_payload(mut self, payload: &str) -> Self { + self.request_payload = payload.to_string(); + self + } + + pub fn with_response_payload(mut self, payload: &str) -> Self { + self.response_payload = payload.to_string(); + self + } + + pub fn with_status_code(mut self, status_code: u16) -> Self { + self.status_code = status_code; + self + } + + pub fn with_processing_time(mut self, processing_time_ms: u32) -> Self { + self.processing_time_ms = processing_time_ms; + self + } + + pub fn with_gateway_selected(mut self, gateway: Option) -> Self { + self.gateway_selected = gateway; + self + } + + pub fn with_routing_algorithm_id(mut self, algorithm_id: Option) -> Self { + self.routing_algorithm_id = algorithm_id; + self + } + + pub fn with_error_message(mut self, error: Option) -> Self { + self.error_message = error; + self + } + + pub fn to_event_data(&self) -> RoutingEventData { + RoutingEventData { + event_id: self.event_id.clone(), + merchant_id: self.merchant_id.clone(), + request_id: self.request_id.clone(), + endpoint: self.endpoint.clone(), + method: self.method.clone(), + request_payload: self.request_payload.clone(), + response_payload: self.response_payload.clone(), + status_code: self.status_code, + processing_time_ms: self.processing_time_ms, + gateway_selected: self.gateway_selected.clone(), + routing_algorithm_id: self.routing_algorithm_id.clone(), + error_message: self.error_message.clone(), + user_agent: self.user_agent.clone(), + ip_address: self.ip_address.clone(), + created_at: self.created_at, + sign_flag: 1, // Always 1 for new events + } + } + + /// Extract gateway information from response payload + pub fn extract_gateway_from_response(&mut self) -> AnalyticsResult<()> { + if !self.response_payload.is_empty() { + if let Ok(response_json) = serde_json::from_str::(&self.response_payload) { + // Try to extract gateway from various possible response structures + if let Some(gateway) = response_json.get("gateway") + .or_else(|| response_json.get("selected_gateway")) + .or_else(|| response_json.get("connector")) + .and_then(|v| v.as_str()) { + self.gateway_selected = Some(gateway.to_string()); + } + + // Try to extract routing algorithm ID + if let Some(algo_id) = response_json.get("routing_algorithm_id") + .or_else(|| response_json.get("algorithm_id")) + .and_then(|v| v.as_str()) { + self.routing_algorithm_id = Some(algo_id.to_string()); + } + } + } + Ok(()) + } + + /// Extract error information from response payload + pub fn extract_error_from_response(&mut self) -> AnalyticsResult<()> { + if self.status_code >= 400 && !self.response_payload.is_empty() { + if let Ok(response_json) = serde_json::from_str::(&self.response_payload) { + if let Some(error) = response_json.get("error") + .or_else(|| response_json.get("message")) + .or_else(|| response_json.get("error_message")) + .and_then(|v| v.as_str()) { + self.error_message = Some(error.to_string()); + } + } + } + Ok(()) + } +} + +fn extract_request_id(request: &Request) -> String { + request + .headers() + .get("x-request-id") + .or_else(|| request.headers().get("request-id")) + .and_then(|v| v.to_str().ok()) + .map(|s| s.to_string()) + .unwrap_or_else(|| Uuid::new_v4().to_string()) +} + +fn extract_user_agent(request: &Request) -> Option { + request + .headers() + .get("user-agent") + .and_then(|v| v.to_str().ok()) + .map(|s| s.to_string()) +} + +fn extract_ip_address(request: &Request) -> Option { + // Try various headers for IP address + request + .headers() + .get("x-forwarded-for") + .or_else(|| request.headers().get("x-real-ip")) + .or_else(|| request.headers().get("cf-connecting-ip")) + .and_then(|v| v.to_str().ok()) + .map(|s| { + // Take the first IP if there are multiple (comma-separated) + s.split(',').next().unwrap_or(s).trim().to_string() + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use axum::http::{HeaderMap, HeaderValue, Method, Uri}; + + #[test] + fn test_routing_event_creation() { + let event = RoutingEvent::new( + "merchant-123".to_string(), + "req-456".to_string(), + "/routing/evaluate".to_string(), + "POST".to_string(), + ); + + assert_eq!(event.merchant_id, "merchant-123"); + assert_eq!(event.request_id, "req-456"); + assert_eq!(event.endpoint, "/routing/evaluate"); + assert_eq!(event.method, "POST"); + assert!(!event.event_id.is_empty()); + } + + #[test] + fn test_event_builder_pattern() { + let event = RoutingEvent::new( + "merchant-123".to_string(), + "req-456".to_string(), + "/routing/evaluate".to_string(), + "POST".to_string(), + ) + .with_request_payload(r#"{"test": "data"}"#) + .with_response_payload(r#"{"gateway": "stripe"}"#) + .with_status_code(200) + .with_processing_time(150) + .with_gateway_selected(Some("stripe".to_string())); + + assert_eq!(event.request_payload, r#"{"test": "data"}"#); + assert_eq!(event.response_payload, r#"{"gateway": "stripe"}"#); + assert_eq!(event.status_code, 200); + assert_eq!(event.processing_time_ms, 150); + assert_eq!(event.gateway_selected, Some("stripe".to_string())); + } + + #[test] + fn test_extract_gateway_from_response() { + let mut event = RoutingEvent::new( + "merchant-123".to_string(), + "req-456".to_string(), + "/routing/evaluate".to_string(), + "POST".to_string(), + ) + .with_response_payload(r#"{"gateway": "stripe", "routing_algorithm_id": "algo-123"}"#); + + event.extract_gateway_from_response().unwrap(); + + assert_eq!(event.gateway_selected, Some("stripe".to_string())); + assert_eq!(event.routing_algorithm_id, Some("algo-123".to_string())); + } + + #[test] + fn test_extract_error_from_response() { + let mut event = RoutingEvent::new( + "merchant-123".to_string(), + "req-456".to_string(), + "/routing/evaluate".to_string(), + "POST".to_string(), + ) + .with_response_payload(r#"{"error": "Gateway not available"}"#) + .with_status_code(500); + + event.extract_error_from_response().unwrap(); + + assert_eq!(event.error_message, Some("Gateway not available".to_string())); + } +} diff --git a/src/analytics/kafka_producer.rs b/src/analytics/kafka_producer.rs new file mode 100644 index 00000000..01ffa3d8 --- /dev/null +++ b/src/analytics/kafka_producer.rs @@ -0,0 +1,224 @@ +use crate::analytics::{AnalyticsError, AnalyticsResult, KafkaConfig, RoutingEventData}; +use kafka::producer::{Producer, Record, RequiredAcks}; +use std::time::Duration; +use tokio::sync::mpsc; +use tracing::{error, info, warn, debug}; + +#[derive(Clone)] +pub struct KafkaProducer { + config: KafkaConfig, + topic: String, +} + +impl KafkaProducer { + pub fn new(config: KafkaConfig) -> AnalyticsResult { + let topic = format!("{}-routing-events", config.topic_prefix); + + // Validate broker configuration + if config.brokers.is_empty() { + return Err(AnalyticsError::Configuration( + "No Kafka brokers configured".to_string() + )); + } + + debug!("Initializing Kafka producer with brokers: {:?}", config.brokers); + + Ok(Self { config, topic }) + } + + /// Test Kafka connectivity + pub async fn test_connection(&self) -> AnalyticsResult<()> { + debug!("Testing Kafka connection to brokers: {:?}", self.config.brokers); + + let producer = Producer::from_hosts(self.config.brokers.clone()) + .with_ack_timeout(Duration::from_secs(5)) + .with_required_acks(RequiredAcks::One) + .create() + .map_err(|e| { + error!("Failed to create Kafka producer for connection test: {:?}", e); + AnalyticsError::Kafka(e) + })?; + + info!("Kafka connection test successful"); + Ok(()) + } + + pub async fn send_event(&self, event: &RoutingEventData) -> AnalyticsResult<()> { + let json_data = serde_json::to_string(event)?; + + // Create producer with configuration + let mut producer = Producer::from_hosts(self.config.brokers.clone()) + .with_ack_timeout(Duration::from_secs(1)) + .with_required_acks(RequiredAcks::One) + .create() + .map_err(AnalyticsError::Kafka)?; + + // Send the record + let record = Record::from_key_value(&self.topic, event.event_id.as_bytes(), json_data.as_bytes()); + + producer + .send(&record) + .map_err(AnalyticsError::Kafka)?; + + Ok(()) + } + + pub async fn send_events_batch(&self, events: &[RoutingEventData]) -> AnalyticsResult<()> { + if events.is_empty() { + return Ok(()); + } + + let mut producer = Producer::from_hosts(self.config.brokers.clone()) + .with_ack_timeout(Duration::from_secs(5)) + .with_required_acks(RequiredAcks::One) + .create() + .map_err(|e| { + error!("Failed to create Kafka producer for batch send: {:?}", e); + warn!("Kafka brokers configured: {:?}", self.config.brokers); + AnalyticsError::Kafka(e) + })?; + + for (index, event) in events.iter().enumerate() { + let json_data = serde_json::to_string(event)?; + let record = Record::from_key_value(&self.topic, event.event_id.as_bytes(), json_data.as_bytes()); + + if let Err(e) = producer.send(&record) { + error!("Failed to send event {} of {} to Kafka: {:?}", index + 1, events.len(), e); + return Err(AnalyticsError::Kafka(e)); + } + } + + info!("Successfully sent {} events to Kafka topic: {}", events.len(), self.topic); + Ok(()) + } + + /// Send events batch with graceful error handling + pub async fn send_events_batch_graceful(&self, events: &[RoutingEventData]) -> bool { + match self.send_events_batch(events).await { + Ok(()) => true, + Err(e) => { + warn!("Failed to send events batch to Kafka, continuing without analytics: {:?}", e); + false + } + } + } + + pub fn start_batch_processor( + &self, + mut receiver: mpsc::Receiver, + ) -> tokio::task::JoinHandle<()> { + let producer = self.clone(); + let batch_size = self.config.batch_size; + let batch_timeout = Duration::from_millis(self.config.batch_timeout_ms); + + tokio::spawn(async move { + let mut batch = Vec::with_capacity(batch_size); + let mut last_flush = tokio::time::Instant::now(); + let mut consecutive_failures = 0; + const MAX_CONSECUTIVE_FAILURES: u32 = 5; + + info!("Starting Kafka batch processor with batch_size: {}, timeout: {}ms", + batch_size, batch_timeout.as_millis()); + + loop { + tokio::select! { + // Receive new events + event = receiver.recv() => { + match event { + Some(event) => { + batch.push(event); + + // Flush if batch is full + if batch.len() >= batch_size { + let success = producer.send_events_batch_graceful(&batch).await; + if success { + consecutive_failures = 0; + } else { + consecutive_failures += 1; + if consecutive_failures >= MAX_CONSECUTIVE_FAILURES { + warn!("Too many consecutive Kafka failures ({}), continuing to collect events but not sending", + consecutive_failures); + } + } + batch.clear(); + last_flush = tokio::time::Instant::now(); + } + } + None => { + // Channel closed, flush remaining events and exit + if !batch.is_empty() { + info!("Channel closed, sending final batch of {} events", batch.len()); + producer.send_events_batch_graceful(&batch).await; + } + info!("Kafka batch processor shutting down"); + break; + } + } + } + + // Timeout-based flush + _ = tokio::time::sleep_until(last_flush + batch_timeout) => { + if !batch.is_empty() { + let success = producer.send_events_batch_graceful(&batch).await; + if success { + consecutive_failures = 0; + } else { + consecutive_failures += 1; + if consecutive_failures >= MAX_CONSECUTIVE_FAILURES { + warn!("Too many consecutive Kafka failures ({}), continuing to collect events but not sending", + consecutive_failures); + } + } + batch.clear(); + last_flush = tokio::time::Instant::now(); + } + } + } + } + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use time::OffsetDateTime; + + #[tokio::test] + async fn test_kafka_producer_creation() { + let config = KafkaConfig { + brokers: vec!["localhost:9092".to_string()], + topic_prefix: "test".to_string(), + batch_size: 10, + batch_timeout_ms: 1000, + }; + + let producer = KafkaProducer::new(config); + assert!(producer.is_ok()); + } + + #[test] + fn test_event_serialization() { + let event = RoutingEventData { + event_id: "test-event-1".to_string(), + merchant_id: "merchant-123".to_string(), + request_id: "req-456".to_string(), + endpoint: "/routing/evaluate".to_string(), + method: "POST".to_string(), + request_payload: r#"{"test": "data"}"#.to_string(), + response_payload: r#"{"result": "success"}"#.to_string(), + status_code: 200, + processing_time_ms: 150, + gateway_selected: Some("stripe".to_string()), + routing_algorithm_id: Some("algo-789".to_string()), + error_message: None, + user_agent: Some("test-agent".to_string()), + ip_address: Some("127.0.0.1".to_string()), + created_at: OffsetDateTime::now_utc(), + sign_flag: 1, + }; + + let json = serde_json::to_string(&event); + assert!(json.is_ok()); + } +} diff --git a/src/analytics/middleware.rs b/src/analytics/middleware.rs new file mode 100644 index 00000000..dba2fff3 --- /dev/null +++ b/src/analytics/middleware.rs @@ -0,0 +1,166 @@ +use crate::analytics::RoutingEvent; +use crate::tenant::GlobalAppState; +use axum::{ + body::Body, + extract::{Request, State}, + middleware::Next, + response::Response, +}; +use bytes::Bytes; +use http_body_util::BodyExt; +use std::{sync::Arc, time::Instant}; +use tracing::{error, warn}; + +/// Analytics middleware to track routing events for specific endpoints +pub async fn analytics_middleware( + State(global_app_state): State>, + request: Request, + next: Next, +) -> Response { + // Only track analytics for routing endpoints + let path = request.uri().path(); + if !should_track_endpoint(path) { + return next.run(request).await; + } + + let start_time = Instant::now(); + + // Extract request information + let method = request.method().to_string(); + let endpoint = path.to_string(); + + // Extract merchant ID from request headers or body (simplified for now) + let merchant_id = extract_merchant_id(&request).unwrap_or_else(|| "public".to_string()); + + // Get the tenant app state to access analytics client + let tenant_app_state = match global_app_state.get_app_state_of_tenant(&merchant_id).await { + Ok(state) => state, + Err(_) => { + // If tenant not found, try with default "public" tenant + match global_app_state.get_app_state_of_tenant("public").await { + Ok(state) => state, + Err(_) => { + // If analytics client is not available, just proceed without analytics + return next.run(request).await; + } + } + } + }; + + // Check if analytics is enabled + if !global_app_state.global_config.analytics.enabled { + return next.run(request).await; + } + + // Create routing event + let mut routing_event = RoutingEvent::from_request(&request, merchant_id.clone()); + + // Extract request body for logging + let (request_parts, body) = request.into_parts(); + let body_bytes = match body.collect().await { + Ok(collected) => collected.to_bytes(), + Err(_) => Bytes::new(), + }; + + let request_payload = String::from_utf8_lossy(&body_bytes).to_string(); + routing_event = routing_event.with_request_payload(&request_payload); + + // Reconstruct request with body + let request = Request::from_parts(request_parts, Body::from(body_bytes)); + + // Process the request + let response = next.run(request).await; + + // Calculate processing time + let processing_time = start_time.elapsed().as_millis() as u32; + + // Extract response information + let status_code = response.status().as_u16(); + + // Extract response body for logging (this is more complex in practice) + let (response_parts, body) = response.into_parts(); + let body_bytes = match body.collect().await { + Ok(collected) => collected.to_bytes(), + Err(_) => Bytes::new(), + }; + + let response_payload = String::from_utf8_lossy(&body_bytes).to_string(); + + // Complete the routing event + routing_event = routing_event + .with_response_payload(&response_payload) + .with_status_code(status_code) + .with_processing_time(processing_time); + + // Extract gateway information from response + if let Err(e) = routing_event.extract_gateway_from_response() { + warn!("Failed to extract gateway from response: {:?}", e); + } + + // Extract error information if status indicates failure + if let Err(e) = routing_event.extract_error_from_response() { + warn!("Failed to extract error from response: {:?}", e); + } + + // Send event to analytics (async, non-blocking) + if let Err(e) = tenant_app_state.analytics_client.track_routing_event(routing_event).await { + error!("Failed to track routing event: {:?}", e); + } + + // Reconstruct response + Response::from_parts(response_parts, Body::from(body_bytes)) +} + +/// Determine if an endpoint should be tracked for analytics +fn should_track_endpoint(path: &str) -> bool { + matches!(path, "/routing/evaluate" | "/decide-gateway") +} + +/// Extract merchant ID from request (simplified implementation) +fn extract_merchant_id(request: &Request) -> Option { + // Try to extract from headers first + if let Some(merchant_id) = request.headers().get("x-merchant-id") { + if let Ok(merchant_id_str) = merchant_id.to_str() { + return Some(merchant_id_str.to_string()); + } + } + + // Try x-tenant-id header as fallback + if let Some(tenant_id) = request.headers().get("x-tenant-id") { + if let Ok(tenant_id_str) = tenant_id.to_str() { + return Some(tenant_id_str.to_string()); + } + } + + // Default to "public" tenant + Some("public".to_string()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_should_track_endpoint() { + assert!(should_track_endpoint("/routing/evaluate")); + assert!(should_track_endpoint("/decide-gateway")); + assert!(!should_track_endpoint("/health")); + assert!(!should_track_endpoint("/rule/create")); + } + + #[test] + fn test_extract_merchant_id_from_header() { + use axum::http::{HeaderMap, HeaderValue}; + + let mut headers = HeaderMap::new(); + headers.insert("x-merchant-id", HeaderValue::from_static("merchant-123")); + + let request = Request::builder() + .uri("/routing/evaluate") + .body(Body::empty()) + .unwrap(); + + // Note: This test would need to be adjusted to work with the actual request structure + // For now, it's a placeholder to show the testing approach + } +} diff --git a/src/analytics/mod.rs b/src/analytics/mod.rs new file mode 100644 index 00000000..d26bd4b4 --- /dev/null +++ b/src/analytics/mod.rs @@ -0,0 +1,11 @@ +pub mod client; +pub mod events; +pub mod kafka_producer; +pub mod middleware; +pub mod types; + +pub use client::AnalyticsClient; +pub use events::RoutingEvent; +pub use kafka_producer::KafkaProducer; +pub use middleware::analytics_middleware; +pub use types::*; diff --git a/src/analytics/types.rs b/src/analytics/types.rs new file mode 100644 index 00000000..4d587ee8 --- /dev/null +++ b/src/analytics/types.rs @@ -0,0 +1,113 @@ +use serde::{Deserialize, Serialize}; +use time::OffsetDateTime; + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct AnalyticsConfig { + pub enabled: bool, + pub kafka: KafkaConfig, + pub clickhouse: ClickhouseConfig, +} + +#[derive(Clone, Debug, Default, Serialize, Deserialize)] +pub struct KafkaConfig { + pub brokers: Vec, + pub topic_prefix: String, + pub batch_size: usize, + pub batch_timeout_ms: u64, +} + +#[derive(Clone, Debug, Default, Serialize, Deserialize)] +pub struct ClickhouseConfig { + pub host: String, + pub username: String, + pub password: Option, + pub database: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct RoutingEventData { + pub event_id: String, + pub merchant_id: String, + pub request_id: String, + pub endpoint: String, + pub method: String, + pub request_payload: String, + pub response_payload: String, + pub status_code: u16, + pub processing_time_ms: u32, + pub gateway_selected: Option, + pub routing_algorithm_id: Option, + pub error_message: Option, + pub user_agent: Option, + pub ip_address: Option, + #[serde(with = "clickhouse_datetime")] + pub created_at: OffsetDateTime, + pub sign_flag: i8, +} + +impl Default for AnalyticsConfig { + fn default() -> Self { + Self { + enabled: false, + kafka: KafkaConfig { + brokers: vec!["localhost:9092".to_string()], + topic_prefix: "decision-engine".to_string(), + batch_size: 100, + batch_timeout_ms: 1000, + }, + clickhouse: ClickhouseConfig { + host: "http://localhost:8123".to_string(), + username: "analytics_user".to_string(), + password: Some("analytics_pass".to_string()), + database: "decision_engine_analytics".to_string(), + }, + } + } +} + +#[derive(Debug, thiserror::Error)] +pub enum AnalyticsError { + #[error("Kafka error: {0}")] + Kafka(#[from] kafka::Error), + #[error("ClickHouse error: {0}")] + ClickHouse(String), + #[error("Serialization error: {0}")] + Serialization(#[from] serde_json::Error), + #[error("Configuration error: {0}")] + Configuration(String), +} + +pub type AnalyticsResult = Result; + +// Custom datetime serialization for ClickHouse compatibility +mod clickhouse_datetime { + use serde::{self, Deserialize, Deserializer, Serializer}; + use time::OffsetDateTime; + use time::format_description::well_known::Rfc3339; + + pub fn serialize(date: &OffsetDateTime, serializer: S) -> Result + where + S: Serializer, + { + // Format as Unix timestamp for ClickHouse compatibility + let timestamp = date.unix_timestamp(); + serializer.serialize_i64(timestamp) + } + + pub fn deserialize<'de, D>(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + + // Try parsing as Unix timestamp first + if let Ok(timestamp) = s.parse::() { + return OffsetDateTime::from_unix_timestamp(timestamp) + .map_err(serde::de::Error::custom); + } + + // Fallback to RFC3339 parsing + OffsetDateTime::parse(&s, &Rfc3339) + .map_err(serde::de::Error::custom) + } +} diff --git a/src/app.rs b/src/app.rs index da215adf..f6265d6c 100644 --- a/src/app.rs +++ b/src/app.rs @@ -10,6 +10,7 @@ use tokio::signal::unix::{signal, SignalKind}; use tower_http::trace as tower_trace; use crate::{ + analytics::{analytics_middleware, AnalyticsClient}, api_client::ApiClient, config::{self, GlobalConfig, TenantConfig}, error, logger, routes, storage, @@ -43,6 +44,7 @@ pub struct TenantAppState { pub redis_conn: Arc, pub config: config::TenantConfig, pub api_client: ApiClient, + pub analytics_client: Arc, } #[allow(clippy::expect_used)] @@ -69,11 +71,24 @@ impl TenantAppState { .await .expect("Failed to create Redis connection Pool"); + // Initialize analytics client + let analytics_client = AnalyticsClient::new(global_config.analytics.clone()) + .map_err(|e| { + logger::warn!("Failed to initialize analytics client: {:?}", e); + e + }) + .unwrap_or_else(|_| { + // Fallback to disabled analytics client + let disabled_config = crate::analytics::AnalyticsConfig::default(); + AnalyticsClient::new(disabled_config).unwrap() + }); + Ok(Self { db, redis_conn: Arc::new(RedisConnectionWrapper::new(redis_conn)), api_client, config: tenant_config, + analytics_client: Arc::new(analytics_client), }) } } @@ -183,21 +198,26 @@ where post(routes::update_gateway_score::update_gateway_score), ); - let router = router.layer( - tower_trace::TraceLayer::new_for_http() - .make_span_with(|request: &Request<_>| utils::record_fields_from_header(request)) - .on_request(tower_trace::DefaultOnRequest::new().level(tracing::Level::INFO)) - .on_response( - tower_trace::DefaultOnResponse::new() - .level(tracing::Level::INFO) - .latency_unit(tower_http::LatencyUnit::Micros), - ) - .on_failure( - tower_trace::DefaultOnFailure::new() - .latency_unit(tower_http::LatencyUnit::Micros) - .level(tracing::Level::ERROR), - ), - ); + let router = router + .layer(axum::middleware::from_fn_with_state( + global_app_state.clone(), + analytics_middleware, + )) + .layer( + tower_trace::TraceLayer::new_for_http() + .make_span_with(|request: &Request<_>| utils::record_fields_from_header(request)) + .on_request(tower_trace::DefaultOnRequest::new().level(tracing::Level::INFO)) + .on_response( + tower_trace::DefaultOnResponse::new() + .level(tracing::Level::INFO) + .latency_unit(tower_http::LatencyUnit::Micros), + ) + .on_failure( + tower_trace::DefaultOnFailure::new() + .latency_unit(tower_http::LatencyUnit::Micros) + .level(tracing::Level::ERROR), + ), + ); let router = router .nest("/health", routes::health::serve()) diff --git a/src/config.rs b/src/config.rs index d49590f2..a659dbcb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,5 +1,6 @@ use crate::decider::network_decider; use crate::{ + analytics::AnalyticsConfig, api_client::ApiClientConfig, crypto::secrets_manager::{ secrets_interface::SecretManager, secrets_management::SecretsManagementConfig, @@ -41,6 +42,8 @@ pub struct GlobalConfig { pub routing_config: Option, #[serde(default)] pub debit_routing_config: network_decider::types::DebitRoutingConfig, + #[serde(default)] + pub analytics: AnalyticsConfig, } #[derive(Clone, Debug)] diff --git a/src/lib.rs b/src/lib.rs index 564b2735..47783c4c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +pub mod analytics; pub mod api_client; pub mod app; pub mod config; From d98649ac4c7b7ede7fd19dd81abd5ae68fb421f8 Mon Sep 17 00:00:00 2001 From: Jagan Elavarasan Date: Thu, 17 Jul 2025 18:42:04 +0530 Subject: [PATCH 02/95] feat(analytics): resolve comments --- config/development.toml | 1 + src/analytics/events.rs | 2 +- src/analytics/kafka_producer.rs | 12 ++++++------ src/analytics/middleware.rs | 11 +++-------- src/analytics/types.rs | 2 ++ 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/config/development.toml b/config/development.toml index 2af2bb23..612c1126 100644 --- a/config/development.toml +++ b/config/development.toml @@ -57,6 +57,7 @@ brokers = ["localhost:9092"] topic_prefix = "decision-engine" batch_size = 100 batch_timeout_ms = 1000 +max_consecutive_failures = 5 [analytics.clickhouse] host = "http://clickhouse:8123" diff --git a/src/analytics/events.rs b/src/analytics/events.rs index 8b7650d4..b71a5559 100644 --- a/src/analytics/events.rs +++ b/src/analytics/events.rs @@ -199,7 +199,7 @@ fn extract_ip_address(request: &Request) -> Option { .and_then(|v| v.to_str().ok()) .map(|s| { // Take the first IP if there are multiple (comma-separated) - s.split(',').next().unwrap_or(s).trim().to_string() + s.split(',').next().map(|ip| ip.trim().to_string()).unwrap_or_else(|| String::new()) }) } diff --git a/src/analytics/kafka_producer.rs b/src/analytics/kafka_producer.rs index 01ffa3d8..7507e35f 100644 --- a/src/analytics/kafka_producer.rs +++ b/src/analytics/kafka_producer.rs @@ -110,15 +110,14 @@ impl KafkaProducer { let producer = self.clone(); let batch_size = self.config.batch_size; let batch_timeout = Duration::from_millis(self.config.batch_timeout_ms); + let max_consecutive_failures = self.config.max_consecutive_failures; tokio::spawn(async move { let mut batch = Vec::with_capacity(batch_size); let mut last_flush = tokio::time::Instant::now(); let mut consecutive_failures = 0; - const MAX_CONSECUTIVE_FAILURES: u32 = 5; - - info!("Starting Kafka batch processor with batch_size: {}, timeout: {}ms", - batch_size, batch_timeout.as_millis()); + info!("Starting Kafka batch processor with batch_size: {}, timeout: {}ms, max_consecutive_failures: {}", + batch_size, batch_timeout.as_millis(), max_consecutive_failures); loop { tokio::select! { @@ -135,7 +134,7 @@ impl KafkaProducer { consecutive_failures = 0; } else { consecutive_failures += 1; - if consecutive_failures >= MAX_CONSECUTIVE_FAILURES { + if consecutive_failures >= max_consecutive_failures { warn!("Too many consecutive Kafka failures ({}), continuing to collect events but not sending", consecutive_failures); } @@ -164,7 +163,7 @@ impl KafkaProducer { consecutive_failures = 0; } else { consecutive_failures += 1; - if consecutive_failures >= MAX_CONSECUTIVE_FAILURES { + if consecutive_failures >= max_consecutive_failures { warn!("Too many consecutive Kafka failures ({}), continuing to collect events but not sending", consecutive_failures); } @@ -191,6 +190,7 @@ mod tests { topic_prefix: "test".to_string(), batch_size: 10, batch_timeout_ms: 1000, + max_consecutive_failures: 5, }; let producer = KafkaProducer::new(config); diff --git a/src/analytics/middleware.rs b/src/analytics/middleware.rs index dba2fff3..402f9bb8 100644 --- a/src/analytics/middleware.rs +++ b/src/analytics/middleware.rs @@ -19,7 +19,7 @@ pub async fn analytics_middleware( ) -> Response { // Only track analytics for routing endpoints let path = request.uri().path(); - if !should_track_endpoint(path) { + if !global_app_state.global_config.analytics.enabled || !should_track_endpoint(path) { return next.run(request).await; } @@ -30,7 +30,7 @@ pub async fn analytics_middleware( let endpoint = path.to_string(); // Extract merchant ID from request headers or body (simplified for now) - let merchant_id = extract_merchant_id(&request).unwrap_or_else(|| "public".to_string()); + let merchant_id = extract_merchant_id(&request).unwrap_or("public".to_string()); // Get the tenant app state to access analytics client let tenant_app_state = match global_app_state.get_app_state_of_tenant(&merchant_id).await { @@ -46,11 +46,6 @@ pub async fn analytics_middleware( } } }; - - // Check if analytics is enabled - if !global_app_state.global_config.analytics.enabled { - return next.run(request).await; - } // Create routing event let mut routing_event = RoutingEvent::from_request(&request, merchant_id.clone()); @@ -77,7 +72,7 @@ pub async fn analytics_middleware( // Extract response information let status_code = response.status().as_u16(); - // Extract response body for logging (this is more complex in practice) + // Extract response body for logging. Note: This operation can lead to high memory usage let (response_parts, body) = response.into_parts(); let body_bytes = match body.collect().await { Ok(collected) => collected.to_bytes(), diff --git a/src/analytics/types.rs b/src/analytics/types.rs index 4d587ee8..da60eff8 100644 --- a/src/analytics/types.rs +++ b/src/analytics/types.rs @@ -14,6 +14,7 @@ pub struct KafkaConfig { pub topic_prefix: String, pub batch_size: usize, pub batch_timeout_ms: u64, + pub max_consecutive_failures: u32, } #[derive(Clone, Debug, Default, Serialize, Deserialize)] @@ -54,6 +55,7 @@ impl Default for AnalyticsConfig { topic_prefix: "decision-engine".to_string(), batch_size: 100, batch_timeout_ms: 1000, + max_consecutive_failures: 5, }, clickhouse: ClickhouseConfig { host: "http://localhost:8123".to_string(), From 3a97c3ee29449b186c4bb0bde52d9dc5c4c47ee9 Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Fri, 18 Jul 2025 10:47:57 +0530 Subject: [PATCH 03/95] refactor: add fallback output check for evaluate request (#117) --- src/decider/gatewaydecider/flows.rs | 4 +++- src/euclid/handlers/routing_rules.rs | 33 +++++----------------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 26660fbe..edb341b2 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -657,7 +657,9 @@ pub async fn runDeciderFlow( is_scheduled_outage: decider_flow.writer.isScheduledOutage, is_dynamic_mga_enabled: decider_flow.writer.is_dynamic_mga_enabled, gateway_mga_id_map: Some(gatewayMgaIdMap), - is_rust_based_decider: deciderParams.dpShouldConsumeResult.unwrap_or(false), + is_rust_based_decider: deciderParams + .dpShouldConsumeResult + .unwrap_or(false), }), None => Err(( decider_flow.writer.debugFilterList.clone(), diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index 7c1e0fa6..31850f8c 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -154,31 +154,11 @@ pub async fn routing_evaluate( payload.created_by.clone() ); - // Check for the default_fallback config: - let configs = find_config_by_name(config_identifier) - .await - .change_context(EuclidErrors::StorageError)?; - - // In default state it should be false, and should only be made true, if the value is present - let mut check_default_fallback_present = false; - - // Not adding parsing error, as this value can only be written by application - configs.map(|config| { - config.value.map(|value| { - if let Ok(parsed_value) = value.parse::() { - check_default_fallback_present = parsed_value; - } - }) - }); - - if check_default_fallback_present - && payload - .fallback_output - .clone() - .is_none_or(|fallback| fallback.is_empty()) - { - return Err(EuclidErrors::DefaultFallbackNotFound(payload.created_by.clone()).into()); - } + // Check for the fallback_output in evaluate request: + let default_output_present = payload + .fallback_output + .as_ref() + .map_or(false, |output| !output.is_empty()); // fetch the active routing_algorithm of the merchant let active_routing_algorithm_id = match crate::generics::generic_find_one::< @@ -373,8 +353,7 @@ pub async fn routing_evaluate( }) { Ok(mut ir) => { // Check if fallback is enabled - if check_default_fallback_present && ir.output == program.default_selection - { + if default_output_present && ir.output == program.default_selection { logger::info!( "Default fallback triggered: Overriding with fallback connector" ); From d34b84b21486afe8a15e2d0eabca703acd5ccbbd Mon Sep 17 00:00:00 2001 From: Shankar Singh C <83439957+ShankarSinghC@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:05:04 +0530 Subject: [PATCH 04/95] feat(debit_routing): Add support for 6-digit BIN fallback if 8-digit lookup returns empty records (#118) --- .../network_decider/co_badged_card_info.rs | 130 ++++++++++-------- 1 file changed, 74 insertions(+), 56 deletions(-) diff --git a/src/decider/network_decider/co_badged_card_info.rs b/src/decider/network_decider/co_badged_card_info.rs index 1ce0d321..2617d660 100644 --- a/src/decider/network_decider/co_badged_card_info.rs +++ b/src/decider/network_decider/co_badged_card_info.rs @@ -2,6 +2,7 @@ use crate::app; use crate::{ decider::{gatewaydecider, network_decider::types, storage::utils::co_badged_card_info}, error, logger, + storage::types as storage_types, utils::CustomResult, }; use error_stack::ResultExt; @@ -127,75 +128,92 @@ impl CoBadgedCardInfoList { } } -pub async fn get_co_badged_cards_info( +async fn co_badged_cards_info_lookup( app_state: &app::TenantAppState, card_isin: String, -) -> CustomResult, error::ApiError> { - // Pad the card number to 19 digits to match the co-badged card bin length - let card_number_str = CoBadgedCardInfoList::pad_card_number_to_19_digit(card_isin); - - let parsed_number: i64 = card_number_str +) -> CustomResult, error::ApiError> { + let card_bin_string = CoBadgedCardInfoList::pad_card_number_to_19_digit(card_isin); + let parsed_number: i64 = card_bin_string .parse::() .change_context(error::ApiError::UnknownError) .attach_printable( "Failed to convert card number to integer in co-badged cards info flow", )?; - let co_badged_card_infos_record = - co_badged_card_info::find_co_badged_cards_info_by_card_bin(app_state, parsed_number).await; + co_badged_card_info::find_co_badged_cards_info_by_card_bin(app_state, parsed_number) + .await + .change_context(error::ApiError::UnknownError) + .attach_printable("Error while fetching co-badged card info record") +} - let filtered_co_badged_card_info_list_optional = match co_badged_card_infos_record { - Err(error) => { - logger::error!( - "Error while fetching co-badged card info record: {:?}", - error - ); - Err(error::ApiError::UnknownError) - .attach_printable("Error while fetching co-badged card info record") - } - Ok(co_badged_card_infos) => { - logger::debug!("Co-badged card info record retrieved successfully"); - - // Parse the co-badged card info records into domain data - let parsed_cards: Vec = co_badged_card_infos - .into_iter() - .filter_map(|raw_co_badged_card_info| { - match raw_co_badged_card_info.clone().try_into() { - Ok(parsed) => Some(parsed), - Err(error) => { - logger::warn!( - "Skipping co-badged card with card_network = {:?} due to error: {}", - raw_co_badged_card_info.card_network, - error - ); - None - } - } - }) - .collect(); - - let co_badged_card_infos_list = CoBadgedCardInfoList(parsed_cards); - - let filtered_list_optional = co_badged_card_infos_list - .is_valid_length() - .then(|| { - co_badged_card_infos_list - .is_only_one_global_network_present() - .then_some(co_badged_card_infos_list.filter_cards()) - }) - .flatten() - .and_then(|filtered_list| filtered_list.is_valid_length().then_some(filtered_list)); - - Ok(filtered_list_optional) +pub async fn get_co_badged_cards_info( + app_state: &app::TenantAppState, + card_isin: String, +) -> CustomResult, error::ApiError> { + let co_badged_card_infos = + match co_badged_cards_info_lookup(app_state, card_isin.clone()).await { + Ok(records) => { + if records.is_empty() && card_isin.len() == 8 { + logger::debug!( + "No co-badged card info found with 8-digit BIN. Retrying with 6-digit BIN." + ); + + co_badged_cards_info_lookup(app_state, card_isin[..6].to_string()).await + } else { + Ok(records) + } + } + Err(error) => { + logger::error!( + "Error while fetching co-badged card info record: {:?}", + error + ); + Err(error::ApiError::UnknownError) + .attach_printable("Error while fetching co-badged card info record")? + } } - }?; + .change_context(error::ApiError::UnknownError) + .attach_printable("Error while fetching co-badged card info record")?; + + logger::debug!( + "Co-badged card info records retrieved successfully records: {:?}", + co_badged_card_infos + ); - let co_badged_cards_info_response = filtered_co_badged_card_info_list_optional + // Parse the co-badged card info records into domain data + let parsed_cards: Vec = co_badged_card_infos + .into_iter() + .filter_map( + |raw_co_badged_card_info| match raw_co_badged_card_info.clone().try_into() { + Ok(parsed) => Some(parsed), + Err(error) => { + logger::warn!( + "Skipping co-badged card with card_network = {:?} due to error: {}", + raw_co_badged_card_info.card_network, + error + ); + None + } + }, + ) + .collect(); + + let co_badged_card_infos_list = CoBadgedCardInfoList(parsed_cards); + + let filtered_list_optional = co_badged_card_infos_list + .is_valid_length() + .then(|| { + co_badged_card_infos_list + .is_only_one_global_network_present() + .then_some(co_badged_card_infos_list.filter_cards()) + }) + .flatten() + .and_then(|filtered_list| filtered_list.is_valid_length().then_some(filtered_list)); + + filtered_list_optional .map(|filtered_list| filtered_list.get_co_badged_cards_info_response()) .transpose() - .attach_printable("Failed to construct co-badged card info response")?; - - Ok(co_badged_cards_info_response) + .attach_printable("Failed to construct co-badged card info response") } pub fn calculate_interchange_fee( From 78cb857ca2b1fd25c0e0c4b2eb963cbe1aff32c6 Mon Sep 17 00:00:00 2001 From: Jagan Elavarasan Date: Tue, 22 Jul 2025 15:39:20 +0530 Subject: [PATCH 05/95] feat(analytics): fix formatting issues --- src/analytics/events.rs | 35 ++++++++------ src/analytics/kafka_producer.rs | 74 +++++++++++++++++++---------- src/analytics/middleware.rs | 52 ++++++++++---------- src/analytics/types.rs | 9 ++-- src/decider/gatewaydecider/flows.rs | 4 +- 5 files changed, 105 insertions(+), 69 deletions(-) diff --git a/src/analytics/events.rs b/src/analytics/events.rs index b71a5559..8b575441 100644 --- a/src/analytics/events.rs +++ b/src/analytics/events.rs @@ -25,12 +25,7 @@ pub struct RoutingEvent { } impl RoutingEvent { - pub fn new( - merchant_id: String, - request_id: String, - endpoint: String, - method: String, - ) -> Self { + pub fn new(merchant_id: String, request_id: String, endpoint: String, method: String) -> Self { Self { event_id: Uuid::new_v4().to_string(), merchant_id, @@ -137,17 +132,21 @@ impl RoutingEvent { if !self.response_payload.is_empty() { if let Ok(response_json) = serde_json::from_str::(&self.response_payload) { // Try to extract gateway from various possible response structures - if let Some(gateway) = response_json.get("gateway") + if let Some(gateway) = response_json + .get("gateway") .or_else(|| response_json.get("selected_gateway")) .or_else(|| response_json.get("connector")) - .and_then(|v| v.as_str()) { + .and_then(|v| v.as_str()) + { self.gateway_selected = Some(gateway.to_string()); } // Try to extract routing algorithm ID - if let Some(algo_id) = response_json.get("routing_algorithm_id") + if let Some(algo_id) = response_json + .get("routing_algorithm_id") .or_else(|| response_json.get("algorithm_id")) - .and_then(|v| v.as_str()) { + .and_then(|v| v.as_str()) + { self.routing_algorithm_id = Some(algo_id.to_string()); } } @@ -159,10 +158,12 @@ impl RoutingEvent { pub fn extract_error_from_response(&mut self) -> AnalyticsResult<()> { if self.status_code >= 400 && !self.response_payload.is_empty() { if let Ok(response_json) = serde_json::from_str::(&self.response_payload) { - if let Some(error) = response_json.get("error") + if let Some(error) = response_json + .get("error") .or_else(|| response_json.get("message")) .or_else(|| response_json.get("error_message")) - .and_then(|v| v.as_str()) { + .and_then(|v| v.as_str()) + { self.error_message = Some(error.to_string()); } } @@ -199,7 +200,10 @@ fn extract_ip_address(request: &Request) -> Option { .and_then(|v| v.to_str().ok()) .map(|s| { // Take the first IP if there are multiple (comma-separated) - s.split(',').next().map(|ip| ip.trim().to_string()).unwrap_or_else(|| String::new()) + s.split(',') + .next() + .map(|ip| ip.trim().to_string()) + .unwrap_or_else(|| String::new()) }) } @@ -274,6 +278,9 @@ mod tests { event.extract_error_from_response().unwrap(); - assert_eq!(event.error_message, Some("Gateway not available".to_string())); + assert_eq!( + event.error_message, + Some("Gateway not available".to_string()) + ); } } diff --git a/src/analytics/kafka_producer.rs b/src/analytics/kafka_producer.rs index 7507e35f..78b8da94 100644 --- a/src/analytics/kafka_producer.rs +++ b/src/analytics/kafka_producer.rs @@ -2,7 +2,7 @@ use crate::analytics::{AnalyticsError, AnalyticsResult, KafkaConfig, RoutingEven use kafka::producer::{Producer, Record, RequiredAcks}; use std::time::Duration; use tokio::sync::mpsc; -use tracing::{error, info, warn, debug}; +use tracing::{debug, error, info, warn}; #[derive(Clone)] pub struct KafkaProducer { @@ -13,39 +13,48 @@ pub struct KafkaProducer { impl KafkaProducer { pub fn new(config: KafkaConfig) -> AnalyticsResult { let topic = format!("{}-routing-events", config.topic_prefix); - + // Validate broker configuration if config.brokers.is_empty() { return Err(AnalyticsError::Configuration( - "No Kafka brokers configured".to_string() + "No Kafka brokers configured".to_string(), )); } - - debug!("Initializing Kafka producer with brokers: {:?}", config.brokers); - + + debug!( + "Initializing Kafka producer with brokers: {:?}", + config.brokers + ); + Ok(Self { config, topic }) } /// Test Kafka connectivity pub async fn test_connection(&self) -> AnalyticsResult<()> { - debug!("Testing Kafka connection to brokers: {:?}", self.config.brokers); - + debug!( + "Testing Kafka connection to brokers: {:?}", + self.config.brokers + ); + let producer = Producer::from_hosts(self.config.brokers.clone()) .with_ack_timeout(Duration::from_secs(5)) .with_required_acks(RequiredAcks::One) .create() .map_err(|e| { - error!("Failed to create Kafka producer for connection test: {:?}", e); + error!( + "Failed to create Kafka producer for connection test: {:?}", + e + ); AnalyticsError::Kafka(e) })?; - + info!("Kafka connection test successful"); Ok(()) } pub async fn send_event(&self, event: &RoutingEventData) -> AnalyticsResult<()> { let json_data = serde_json::to_string(event)?; - + // Create producer with configuration let mut producer = Producer::from_hosts(self.config.brokers.clone()) .with_ack_timeout(Duration::from_secs(1)) @@ -54,11 +63,10 @@ impl KafkaProducer { .map_err(AnalyticsError::Kafka)?; // Send the record - let record = Record::from_key_value(&self.topic, event.event_id.as_bytes(), json_data.as_bytes()); - - producer - .send(&record) - .map_err(AnalyticsError::Kafka)?; + let record = + Record::from_key_value(&self.topic, event.event_id.as_bytes(), json_data.as_bytes()); + + producer.send(&record).map_err(AnalyticsError::Kafka)?; Ok(()) } @@ -80,15 +88,28 @@ impl KafkaProducer { for (index, event) in events.iter().enumerate() { let json_data = serde_json::to_string(event)?; - let record = Record::from_key_value(&self.topic, event.event_id.as_bytes(), json_data.as_bytes()); - + let record = Record::from_key_value( + &self.topic, + event.event_id.as_bytes(), + json_data.as_bytes(), + ); + if let Err(e) = producer.send(&record) { - error!("Failed to send event {} of {} to Kafka: {:?}", index + 1, events.len(), e); + error!( + "Failed to send event {} of {} to Kafka: {:?}", + index + 1, + events.len(), + e + ); return Err(AnalyticsError::Kafka(e)); } } - info!("Successfully sent {} events to Kafka topic: {}", events.len(), self.topic); + info!( + "Successfully sent {} events to Kafka topic: {}", + events.len(), + self.topic + ); Ok(()) } @@ -97,7 +118,10 @@ impl KafkaProducer { match self.send_events_batch(events).await { Ok(()) => true, Err(e) => { - warn!("Failed to send events batch to Kafka, continuing without analytics: {:?}", e); + warn!( + "Failed to send events batch to Kafka, continuing without analytics: {:?}", + e + ); false } } @@ -126,7 +150,7 @@ impl KafkaProducer { match event { Some(event) => { batch.push(event); - + // Flush if batch is full if batch.len() >= batch_size { let success = producer.send_events_batch_graceful(&batch).await; @@ -135,7 +159,7 @@ impl KafkaProducer { } else { consecutive_failures += 1; if consecutive_failures >= max_consecutive_failures { - warn!("Too many consecutive Kafka failures ({}), continuing to collect events but not sending", + warn!("Too many consecutive Kafka failures ({}), continuing to collect events but not sending", consecutive_failures); } } @@ -154,7 +178,7 @@ impl KafkaProducer { } } } - + // Timeout-based flush _ = tokio::time::sleep_until(last_flush + batch_timeout) => { if !batch.is_empty() { @@ -164,7 +188,7 @@ impl KafkaProducer { } else { consecutive_failures += 1; if consecutive_failures >= max_consecutive_failures { - warn!("Too many consecutive Kafka failures ({}), continuing to collect events but not sending", + warn!("Too many consecutive Kafka failures ({}), continuing to collect events but not sending", consecutive_failures); } } diff --git a/src/analytics/middleware.rs b/src/analytics/middleware.rs index 402f9bb8..a4372231 100644 --- a/src/analytics/middleware.rs +++ b/src/analytics/middleware.rs @@ -24,14 +24,14 @@ pub async fn analytics_middleware( } let start_time = Instant::now(); - + // Extract request information let method = request.method().to_string(); let endpoint = path.to_string(); - + // Extract merchant ID from request headers or body (simplified for now) let merchant_id = extract_merchant_id(&request).unwrap_or("public".to_string()); - + // Get the tenant app state to access analytics client let tenant_app_state = match global_app_state.get_app_state_of_tenant(&merchant_id).await { Ok(state) => state, @@ -46,62 +46,66 @@ pub async fn analytics_middleware( } } }; - + // Create routing event let mut routing_event = RoutingEvent::from_request(&request, merchant_id.clone()); - + // Extract request body for logging let (request_parts, body) = request.into_parts(); let body_bytes = match body.collect().await { Ok(collected) => collected.to_bytes(), Err(_) => Bytes::new(), }; - + let request_payload = String::from_utf8_lossy(&body_bytes).to_string(); routing_event = routing_event.with_request_payload(&request_payload); - + // Reconstruct request with body let request = Request::from_parts(request_parts, Body::from(body_bytes)); - + // Process the request let response = next.run(request).await; - + // Calculate processing time let processing_time = start_time.elapsed().as_millis() as u32; - + // Extract response information let status_code = response.status().as_u16(); - - // Extract response body for logging. Note: This operation can lead to high memory usage + + // Extract response body for logging. Note: This operation can lead to high memory usage let (response_parts, body) = response.into_parts(); let body_bytes = match body.collect().await { Ok(collected) => collected.to_bytes(), Err(_) => Bytes::new(), }; - + let response_payload = String::from_utf8_lossy(&body_bytes).to_string(); - + // Complete the routing event routing_event = routing_event .with_response_payload(&response_payload) .with_status_code(status_code) .with_processing_time(processing_time); - + // Extract gateway information from response if let Err(e) = routing_event.extract_gateway_from_response() { warn!("Failed to extract gateway from response: {:?}", e); } - + // Extract error information if status indicates failure if let Err(e) = routing_event.extract_error_from_response() { warn!("Failed to extract error from response: {:?}", e); } - + // Send event to analytics (async, non-blocking) - if let Err(e) = tenant_app_state.analytics_client.track_routing_event(routing_event).await { + if let Err(e) = tenant_app_state + .analytics_client + .track_routing_event(routing_event) + .await + { error!("Failed to track routing event: {:?}", e); } - + // Reconstruct response Response::from_parts(response_parts, Body::from(body_bytes)) } @@ -119,14 +123,14 @@ fn extract_merchant_id(request: &Request) -> Option { return Some(merchant_id_str.to_string()); } } - + // Try x-tenant-id header as fallback if let Some(tenant_id) = request.headers().get("x-tenant-id") { if let Ok(tenant_id_str) = tenant_id.to_str() { return Some(tenant_id_str.to_string()); } } - + // Default to "public" tenant Some("public".to_string()) } @@ -146,15 +150,15 @@ mod tests { #[test] fn test_extract_merchant_id_from_header() { use axum::http::{HeaderMap, HeaderValue}; - + let mut headers = HeaderMap::new(); headers.insert("x-merchant-id", HeaderValue::from_static("merchant-123")); - + let request = Request::builder() .uri("/routing/evaluate") .body(Body::empty()) .unwrap(); - + // Note: This test would need to be adjusted to work with the actual request structure // For now, it's a placeholder to show the testing approach } diff --git a/src/analytics/types.rs b/src/analytics/types.rs index da60eff8..df4bda6a 100644 --- a/src/analytics/types.rs +++ b/src/analytics/types.rs @@ -84,8 +84,8 @@ pub type AnalyticsResult = Result; // Custom datetime serialization for ClickHouse compatibility mod clickhouse_datetime { use serde::{self, Deserialize, Deserializer, Serializer}; - use time::OffsetDateTime; use time::format_description::well_known::Rfc3339; + use time::OffsetDateTime; pub fn serialize(date: &OffsetDateTime, serializer: S) -> Result where @@ -101,15 +101,14 @@ mod clickhouse_datetime { D: Deserializer<'de>, { let s = String::deserialize(deserializer)?; - + // Try parsing as Unix timestamp first if let Ok(timestamp) = s.parse::() { return OffsetDateTime::from_unix_timestamp(timestamp) .map_err(serde::de::Error::custom); } - + // Fallback to RFC3339 parsing - OffsetDateTime::parse(&s, &Rfc3339) - .map_err(serde::de::Error::custom) + OffsetDateTime::parse(&s, &Rfc3339).map_err(serde::de::Error::custom) } } diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 26660fbe..edb341b2 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -657,7 +657,9 @@ pub async fn runDeciderFlow( is_scheduled_outage: decider_flow.writer.isScheduledOutage, is_dynamic_mga_enabled: decider_flow.writer.is_dynamic_mga_enabled, gateway_mga_id_map: Some(gatewayMgaIdMap), - is_rust_based_decider: deciderParams.dpShouldConsumeResult.unwrap_or(false), + is_rust_based_decider: deciderParams + .dpShouldConsumeResult + .unwrap_or(false), }), None => Err(( decider_flow.writer.debugFilterList.clone(), From 2965a880f71f16dfc408215875e1d989571bf3e6 Mon Sep 17 00:00:00 2001 From: Abhinav0078 <95350965+Abhinav0078@users.noreply.github.com> Date: Wed, 23 Jul 2025 19:18:31 +0530 Subject: [PATCH 06/95] EUL-17895-reverted-brand-wise-mandate-gw-filtering (#95) Co-authored-by: shantanu.rathore --- src/decider/gatewaydecider/gw_filter.rs | 54 ++----------------------- 1 file changed, 3 insertions(+), 51 deletions(-) diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index 5095ff78..8ff88d24 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -1479,61 +1479,13 @@ pub async fn filterGatewaysForValidationType( // Handle Card Mandate transactions if Utils::is_mandate_transaction(&txn_detail) && Utils::is_card_transaction(&txn_card_info) { // Get excluded gateways from Redis - let uniqueGwLs: Vec = st.clone().into_iter().collect(); - let brand = txn_card_info - .cardSwitchProvider - .as_ref() - .map(|provider| provider.peek().to_string()) - .unwrap_or_else(|| "DEFAULT".to_string()); - let mPmEntryDB = ETP::get_by_name(brand).await; - - let updatedSt = if let Some(cardPaymentMethod) = mPmEntryDB { - let uniqueGwLs: Vec = st.into_iter().collect(); - let allGPMfEntries = GPMF::find_all_gpmf_by_gateway_payment_flow_payment_method( - uniqueGwLs.clone(), - cardPaymentMethod.id, - PaymentFlow::CVVLESS, - ) - .await; - let mgaList = Utils::get_mgas(this).unwrap_or_default(); - let gmpfGws: Vec = allGPMfEntries - .iter() - .map(|gpmf| gpmf.gateway.clone()) - .collect(); - let filteredMga: Vec = mgaList - .into_iter() - .filter(|mga| gmpfGws.contains(&mga.gateway)) - .collect(); - let mgaIds: Vec = filteredMga - .iter() - .map(|mga| mga.id.merchantGwAccId) - .collect(); - let gpmfIds: Vec = - allGPMfEntries.iter().map(|gpmf| gpmf.id.clone()).collect(); - let mgpmfEntries = MGPMF::get_all_mgpmf_by_mga_id_and_gpmf_ids(mgaIds, gpmfIds).await; - let filteredMgaList: Vec = mgpmfEntries - .iter() - .map(|mgpmf| mgpmf.merchantGatewayAccountId) - .collect(); - let finalFilteredMga: Vec = filteredMga - .into_iter() - .filter(|mga| filteredMgaList.contains(&mga.id.merchantGwAccId)) - .collect(); - Utils::set_mgas(this, finalFilteredMga.clone()); - finalFilteredMga - .into_iter() - .map(|mga| mga.gateway) - .collect() - } else { - Vec::new() - }; let card_mandate_bin_filter_excluded_gateways = findByNameFromRedis(C::CARD_MANDATE_BIN_FILTER_EXCLUDED_GATEWAYS.get_key()) .await .unwrap_or_else(Vec::new); let bin_wise_filter_excluded_gateways = - intersect(&card_mandate_bin_filter_excluded_gateways, &updatedSt); + intersect(&card_mandate_bin_filter_excluded_gateways, &st); let bin_list = Utils::get_bin_list(txn_card_info.card_isin.clone()); // Filter gateways based on card info @@ -1541,8 +1493,8 @@ pub async fn filterGatewaysForValidationType( this, macc.clone(), bin_list, - updatedSt, - txn_card_info.authType.clone(), + st, + None, Some(ETGCI::ValidationType::CardMandate), ) .await?; From 7e77e0b6415d58ac8559c0a0109f791ccae81e25 Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Thu, 24 Jul 2025 17:46:10 +0530 Subject: [PATCH 07/95] refactor(euclid): handle metadata keys in evaluate request (#123) --- src/euclid/ast.rs | 4 ++++ src/euclid/handlers/routing_rules.rs | 8 +++++--- src/euclid/interpreter.rs | 7 +++++-- src/euclid/types.rs | 3 ++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/euclid/ast.rs b/src/euclid/ast.rs index b75a9ff5..304a7c48 100644 --- a/src/euclid/ast.rs +++ b/src/euclid/ast.rs @@ -40,6 +40,10 @@ pub enum ValueType { } impl ValueType { + pub fn is_metadata(&self) -> bool { + matches!(self, Self::MetadataVariant(_)) + } + pub fn get_type(&self) -> DataType { match self { Self::Number(_) => DataType::Number, diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index 31850f8c..70a328cc 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -9,7 +9,7 @@ use crate::{ cgraph, interpreter::{evaluate_output, InterpreterBackend}, types::{ - ActivateRoutingConfigRequest, Context, JsonifiedRoutingAlgorithm, + ActivateRoutingConfigRequest, Context, DataType, JsonifiedRoutingAlgorithm, RoutingAlgorithmMapperNew, RoutingDictionaryRecord, RoutingEvaluateResponse, RoutingRequest, RoutingRule, StaticRoutingAlgorithm, }, @@ -201,8 +201,10 @@ pub async fn routing_evaluate( } }; - for (key, _) in ¶meters { - if !routing_config.keys.keys.contains_key(key) { + for (key, value) in ¶meters { + if !routing_config.keys.keys.contains_key(key) + && value.as_ref().is_some_and(|val| !val.is_metadata()) + { API_REQUEST_COUNTER .with_label_values(&["routing_evaluate", "failure"]) .inc(); diff --git a/src/euclid/interpreter.rs b/src/euclid/interpreter.rs index 0160205e..451907b9 100644 --- a/src/euclid/interpreter.rs +++ b/src/euclid/interpreter.rs @@ -1,4 +1,4 @@ -use crate::euclid::ast::{Output, VolumeSplit}; +use crate::euclid::ast::{Output, ValueType, VolumeSplit}; use crate::euclid::{ast, types}; use rand::distributions::WeightedIndex; use rand::prelude::*; @@ -41,7 +41,10 @@ impl InterpreterBackend { ) -> Result { use ast::{ComparisonType::*, ValueType::*}; - let ctx_value = ctx.get(&comparison.lhs); + let ctx_value = match &comparison.value { + ValueType::MetadataVariant(m) => ctx.get(&m.key), + _ => ctx.get(&comparison.lhs), + }; if ctx_value.is_none() { crate::logger::warn!( missing_context_key = %comparison.lhs, diff --git a/src/euclid/types.rs b/src/euclid/types.rs index 1816726d..ad03204a 100644 --- a/src/euclid/types.rs +++ b/src/euclid/types.rs @@ -16,7 +16,7 @@ use time::PrimitiveDateTime; pub type Metadata = HashMap; -#[derive(Debug, Clone, Serialize, strum::Display)] +#[derive(Debug, Clone, Serialize, strum::Display, PartialEq)] #[serde(rename_all = "snake_case")] #[strum(serialize_all = "snake_case")] pub enum DataType { @@ -238,6 +238,7 @@ impl fmt::Display for InterpreterError { } } +#[derive(Debug)] pub struct Context(HashMap>); impl Context { pub fn new(parameters: HashMap>) -> Self { From bb8acfe41b4d0a0353e61036c5d9d81264f1e6c8 Mon Sep 17 00:00:00 2001 From: Gaurav Rawat <104276743+GauravRawat369@users.noreply.github.com> Date: Mon, 28 Jul 2025 16:37:11 +0530 Subject: [PATCH 08/95] feat: adding more dimensional granularity for scoring (#106) --- src/app.rs | 4 + src/decider/gatewaydecider/flow_new.rs | 3 + src/decider/gatewaydecider/flows.rs | 4 +- src/decider/gatewaydecider/gw_scoring.rs | 131 +++- src/decider/gatewaydecider/types.rs | 28 + src/decider/gatewaydecider/utils.rs | 252 +++++++- src/decider/gatewaydecider/validators.rs | 6 + src/euclid/errors.rs | 13 + src/euclid/handlers/routing_rules.rs | 97 ++- src/euclid/types.rs | 13 + src/feedback/gateway_scoring_service.rs | 32 +- .../gateway_selection_scoring_v3/flow.rs | 25 +- src/feedback/utils.rs | 6 +- src/types/country/country_iso.rs | 567 +++++++++++++++--- src/types/txn_details/types.rs | 3 + 15 files changed, 1022 insertions(+), 162 deletions(-) diff --git a/src/app.rs b/src/app.rs index da215adf..e89f5cbb 100644 --- a/src/app.rs +++ b/src/app.rs @@ -172,6 +172,10 @@ where .route( "/merchant-account/:merchant-id", delete(routes::merchant_account_config::delete_merchant_config), + ) + .route( + "/config-sr-dimension", + axum::routing::post(crate::euclid::handlers::routing_rules::config_sr_dimentions), ); let router = router.route("/update-score", post(routes::update_score::update_score)); let router = router.route( diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 711b7616..93762a9c 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -129,6 +129,7 @@ pub async fn deciderFullPayloadHSFunction( decider_params, dreq_.clone().rankingAlgorithm, dreq_.clone().eliminationEnabled, + false, ) .await } @@ -146,6 +147,7 @@ pub async fn runDeciderFlow( deciderParams: T::DeciderParams, rankingAlgorithm: Option, eliminationEnabled: Option, + is_legacy_decider_flow: bool, ) -> Result<(T::DecidedGateway), T::ErrorResponse> { let txnCreationTime = deciderParams .dpTxnDetail @@ -517,6 +519,7 @@ pub async fn runDeciderFlow( let updated_gateway_scoring_data = T::GatewayScoringData { routingApproach: Some(decider_flow.writer.gwDeciderApproach.clone().to_string()), eliminationEnabled: eliminationEnabled.unwrap_or_default(), + is_legacy_decider_flow, ..decider_flow.writer.gateway_scoring_data.clone() }; let app_state = get_tenant_app_state().await; diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index edb341b2..a2dec563 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -202,7 +202,7 @@ pub async fn deciderFullPayloadHSFunction( dpEDCCApplied: dreq.isEdccApplied, dpShouldConsumeResult: dreq.shouldConsumeResult, }; - runDeciderFlow(decider_params).await + runDeciderFlow(decider_params, true).await } fn handleEnforcedGateway(gateway_list: Option>) -> Option> { @@ -314,6 +314,7 @@ fn handleEnforcedGateway(gateway_list: Option>) -> Option Result<(T::DecidedGateway, Vec<(String, Vec)>), T::ErrorResponse> { let txnCreationTime = deciderParams .dpTxnDetail @@ -682,6 +683,7 @@ pub async fn runDeciderFlow( .concat(); let updated_gateway_scoring_data = T::GatewayScoringData { routingApproach: Some(decider_flow.writer.gwDeciderApproach.clone().to_string()), + is_legacy_decider_flow, ..decider_flow.writer.gateway_scoring_data.clone() }; let app_state = get_tenant_app_state().await; diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 51ec6db2..8c608af1 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -4,7 +4,7 @@ use crate::app::get_tenant_app_state; use crate::decider::gatewaydecider::gw_filter::{getGws, setGws}; use crate::decider::gatewaydecider::types::{ toListOfGatewayScore, DeciderFlow, DeciderScoringName, GatewayDeciderApproach, GatewayScoreMap, - SRMetricLogData, + SRMetricLogData, SrRoutingDimensions, }; use crate::logger; use crate::merchant_config_util::{ @@ -25,6 +25,7 @@ use crate::types::tenant::tenant_config::ModuleName; use crate::types::transaction::id::TransactionId; use crate::utils::{generate_random_number, get_current_date_in_millis}; use diesel::dsl::update; +use masking::PeekInterface; use rand::prelude::*; use rand_distr::{Beta, Binomial, Distribution}; use serde::{Deserialize, Serialize}; @@ -267,16 +268,29 @@ pub async fn scoring_flow( default_sr_v3_input_config ); + let sr_routing_dimesions = SrRoutingDimensions { + card_network: txn_card_info + .cardSwitchProvider + .as_ref() + .map(|s| s.peek().to_string()), + card_isin: txn_card_info.card_isin.clone(), + currency: Some(decider_flow.get().dpOrder.currency.to_string()), + country: txn_detail.country.as_ref().map(|a| a.to_string()), + auth_type: txn_card_info.authType.as_ref().map(|a| a.to_string()), + }; + let hedging_percent = Utils::get_sr_v3_hedging_percent( merchant_sr_v3_input_config.clone(), &pmt_str, pm.clone().as_str(), + &sr_routing_dimesions, ) .or_else(|| { Utils::get_sr_v3_hedging_percent( default_sr_v3_input_config.clone(), &pmt_str, pm.clone().as_str(), + &sr_routing_dimesions, ) }) .unwrap_or(C::defaultSrV3BasedHedgingPercent); @@ -494,12 +508,40 @@ pub async fn get_cached_scores_based_on_srv3( ) .await; - let merchant_bucket_size = - Utils::get_sr_v3_bucket_size(merchant_srv3_input_config.clone(), &pmt_str, &pm) - .or_else(|| { - Utils::get_sr_v3_bucket_size(default_srv3_input_config.clone(), &pmt_str, &pm) - }) - .unwrap_or(C::DEFAULT_SR_V3_BASED_BUCKET_SIZE); + // Extract the new parameters from txn_card_info + let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); + + let sr_routing_dimesions = SrRoutingDimensions { + card_network: txn_card_info + .cardSwitchProvider + .as_ref() + .map(|s| s.peek().to_string()), + card_isin: txn_card_info.card_isin, + currency: Some(decider_flow.get().dpOrder.currency.to_string()), + country: decider_flow + .get() + .dpTxnDetail + .country + .as_ref() + .map(|a| a.to_string()), + auth_type: txn_card_info.authType.as_ref().map(|a| a.to_string()), + }; + + let merchant_bucket_size = Utils::get_sr_v3_bucket_size( + merchant_srv3_input_config.clone(), + &pmt_str, + &pm, + &sr_routing_dimesions, + ) + .or_else(|| { + Utils::get_sr_v3_bucket_size( + default_srv3_input_config.clone(), + &pmt_str, + &pm, + &sr_routing_dimesions, + ) + }) + .unwrap_or(C::DEFAULT_SR_V3_BASED_BUCKET_SIZE); logger::debug!( tag = "Sr_V3_Bucket_Size", @@ -544,26 +586,36 @@ pub async fn get_cached_scores_based_on_srv3( ) .await; let updated_score_map_after_reset = if is_srv3_reset_enabled { - let upper_reset_factor = - Utils::get_sr_v3_upper_reset_factor(merchant_srv3_input_config.clone(), &pmt_str, &pm) - .or_else(|| { - Utils::get_sr_v3_upper_reset_factor( - default_srv3_input_config.clone(), - &pmt_str, - &pm, - ) - }) - .unwrap_or(C::defaultSrV3BasedUpperResetFactor); - let lower_reset_factor = - Utils::get_sr_v3_lower_reset_factor(merchant_srv3_input_config.clone(), &pmt_str, &pm) - .or_else(|| { - Utils::get_sr_v3_lower_reset_factor( - default_srv3_input_config.clone(), - &pmt_str, - &pm, - ) - }) - .unwrap_or(C::defaultSrV3BasedLowerResetFactor); + let upper_reset_factor = Utils::get_sr_v3_upper_reset_factor( + merchant_srv3_input_config.clone(), + &pmt_str, + &pm, + &sr_routing_dimesions, + ) + .or_else(|| { + Utils::get_sr_v3_upper_reset_factor( + default_srv3_input_config.clone(), + &pmt_str, + &pm, + &sr_routing_dimesions, + ) + }) + .unwrap_or(C::defaultSrV3BasedUpperResetFactor); + let lower_reset_factor = Utils::get_sr_v3_lower_reset_factor( + merchant_srv3_input_config.clone(), + &pmt_str, + &pm, + &sr_routing_dimesions, + ) + .or_else(|| { + Utils::get_sr_v3_lower_reset_factor( + default_srv3_input_config.clone(), + &pmt_str, + &pm, + &sr_routing_dimesions, + ) + }) + .unwrap_or(C::defaultSrV3BasedLowerResetFactor); logger::debug!( tag = "Sr_V3_Upper_Reset_Factor", action = "Sr_V3_Upper_Reset_Factor", @@ -621,6 +673,7 @@ pub async fn get_cached_scores_based_on_srv3( pmt_str.to_string(), pm.clone(), gw.clone(), + sr_routing_dimesions.clone(), ); final_score_map.insert(gw, extra_score); } @@ -749,13 +802,25 @@ pub fn add_extra_score( pmt: String, pm: String, gw: String, + sr_routing_dimesions: SrRoutingDimensions, ) -> f64 { - let gateway_sigma_factor = - Utils::get_sr_v3_gateway_sigma_factor(merchant_sr_v3_input_config, &pmt, &pm, &gw) - .or_else(|| { - Utils::get_sr_v3_gateway_sigma_factor(default_sr_v3_input_config, &pmt, &pm, &gw) - }) - .unwrap_or(C::DEFAULT_SR_V3_BASED_GATEWAY_SIGMA_FACTOR); + let gateway_sigma_factor = Utils::get_sr_v3_gateway_sigma_factor( + merchant_sr_v3_input_config, + &pmt, + &pm, + &gw, + &sr_routing_dimesions, + ) + .or_else(|| { + Utils::get_sr_v3_gateway_sigma_factor( + default_sr_v3_input_config, + &pmt, + &pm, + &gw, + &sr_routing_dimesions, + ) + }) + .unwrap_or(C::DEFAULT_SR_V3_BASED_GATEWAY_SIGMA_FACTOR); logger::debug!( tag = "add_extra_score", action = "add_extra_score", diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 235353c8..eb53a146 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -1,5 +1,6 @@ use crate::app::{get_tenant_app_state, TenantAppState}; use crate::decider::network_decider; +use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; use crate::types::money::internal as ETMo; use crate::types::order::udfs::UDFs; @@ -529,6 +530,11 @@ pub fn initial_decider_state(date_created: String) -> DeciderState { routingApproach: None, dateCreated: OffsetDateTime::now_utc(), eliminationEnabled: false, + cardIsIn: None, + cardSwitchProvider: None, + currency: None, + country: None, + is_legacy_decider_flow: false, }, } } @@ -551,6 +557,11 @@ pub struct GatewayScoringData { pub routingApproach: Option, pub dateCreated: OffsetDateTime, pub eliminationEnabled: bool, + pub cardIsIn: Option, + pub cardSwitchProvider: Option>, + pub currency: Option, + pub country: Option, + pub is_legacy_decider_flow: bool, } #[derive(Debug)] @@ -754,6 +765,7 @@ pub struct ApiTxnDetail { pub sourceObject: Option, pub sourceObjectId: Option, pub currency: Option, + pub country: Option, pub netAmount: Option, pub surchargeAmount: Option, pub taxAmount: Option, @@ -902,6 +914,7 @@ pub struct PaymentInfo { paymentId: String, pub amount: f64, currency: Currency, + country: Option, customerId: Option, udfs: Option, preferredGateway: Option, @@ -980,6 +993,7 @@ impl DomainDeciderRequestForApiCallV2 { sourceObject: Some(self.paymentInfo.paymentMethod.clone()), sourceObjectId: None, currency: self.paymentInfo.currency.clone(), + country: self.paymentInfo.country.clone(), netAmount: ETMo::Money::from_double(self.paymentInfo.amount), surchargeAmount: None, taxAmount: None, @@ -1113,6 +1127,11 @@ pub struct SrV3InputConfig { pub struct SrV3SubLevelInputConfig { pub paymentMethodType: Option, pub paymentMethod: Option, + pub cardNetwork: Option, + pub cardIsIn: Option, + pub currency: Option, + pub country: Option, + pub authType: Option, pub latencyThreshold: Option, pub bucketSize: Option, pub hedgingPercent: Option, @@ -1838,3 +1857,12 @@ struct Reader { reader: T, tenant_state: TenantAppState, } + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SrRoutingDimensions { + pub card_network: Option, + pub card_isin: Option, + pub currency: Option, + pub country: Option, + pub auth_type: Option, +} diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 45c6451b..54aea2db 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -1,24 +1,32 @@ use crate::app::get_tenant_app_state; use crate::decider::gatewaydecider::types::{self, DeciderFlow}; +use crate::error; +use crate::euclid::errors::EuclidErrors; +use crate::euclid::types::SrDimensionConfig; use crate::feedback::gateway_elimination_scoring::flow::{ eliminationV2RewardFactor, getPenaltyFactor, }; use crate::redis::feature::isFeatureEnabled; use crate::redis::types::ServiceConfigKey; use crate::types::card::card_type::card_type_to_text; +use crate::types::country::country_iso::CountryISO2; +use crate::types::currency::Currency; use crate::types::merchant::id::{merchant_id_to_text, MerchantId}; use crate::types::merchant::merchant_gateway_account::MerchantGatewayAccount; use crate::types::money::internal::Money; use crate::types::payment::payment_method_type_const::*; use crate::types::payment_flow::{payment_flows_to_text, PaymentFlow}; +use crate::types::service_configuration::find_config_by_name; use crate::types::user_eligibility_info::{ get_eligibility_info, identifier_name_to_text, IdentifierName, }; use crate::utils::{generate_random_number, get_current_date_in_millis}; use crate::{decider, feedback, logger}; use diesel::Identifiable; +use error_stack::ResultExt; use fred::prelude::{KeysInterface, ListInterface}; use masking::PeekInterface; +use masking::Secret; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use serde_json::from_value; @@ -56,14 +64,15 @@ use crate::types::feature as ETF; use super::types::{ ConfigurableBlock, GatewayList, GatewayRedisKeyMap, GatewayScoreMap, GatewayScoringData, GatewayWiseExtraScore, InternalMetadata, MessageFormat, OptimizationRedisBlockData, - ScoreKeyType, SplitSettlementDetails, SrV3InputConfig, SrV3SubLevelInputConfig, + ScoreKeyType, SplitSettlementDetails, SrRoutingDimensions, SrV3InputConfig, + SrV3SubLevelInputConfig, }; use crate::types::merchant as ETM; use crate::types::merchant_gateway_card_info as ETMGCI; // // use types::merchant_gateway_card_info as ETMGCI; // // use types::merchant_gateway_payment_method as ETMGPM; // // use types::money as Money; -use crate::types::card::txn_card_info::{self as ETTCa, auth_type_to_text}; +use crate::types::card::txn_card_info::{self as ETTCa, auth_type_to_text, AuthType}; use crate::types::order as ETO; use crate::types::txn_details::types as ETTD; use crate::types::txn_offer as ETTO; @@ -1560,11 +1569,16 @@ pub fn get_sr_v3_latency_threshold( sr_v3_input_config: Option, pmt: &str, pm: &str, + sr_routing_dimesions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { - get_sr_v3_sub_level_input_config(&config.subLevelInputConfig, pmt, pm, |x| { - x.latencyThreshold.is_some() - }) + get_sr_v3_sub_level_input_config( + &config.subLevelInputConfig, + pmt, + pm, + sr_routing_dimesions, + |x| x.latencyThreshold.is_some(), + ) .and_then(|sub_config| sub_config.latencyThreshold) .or(config.defaultLatencyThreshold) }) @@ -1574,11 +1588,16 @@ pub fn get_sr_v3_bucket_size( sr_v3_input_config: Option, pmt: &str, pm: &str, + sr_routing_dimesions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { - get_sr_v3_sub_level_input_config(&config.subLevelInputConfig, pmt, pm, |x| { - x.bucketSize.is_some() - }) + get_sr_v3_sub_level_input_config( + &config.subLevelInputConfig, + pmt, + pm, + sr_routing_dimesions, + |x| x.bucketSize.is_some(), + ) .and_then(|sub_config| sub_config.bucketSize) .or(config.defaultBucketSize) .filter(|&size| size > 0) @@ -1589,11 +1608,16 @@ pub fn get_sr_v3_hedging_percent( sr_v3_input_config: Option, pmt: &str, pm: &str, + sr_routing_dimesions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { - get_sr_v3_sub_level_input_config(&config.subLevelInputConfig, pmt, pm, |x| { - x.hedgingPercent.is_some() - }) + get_sr_v3_sub_level_input_config( + &config.subLevelInputConfig, + pmt, + pm, + sr_routing_dimesions, + |x| x.hedgingPercent.is_some(), + ) .and_then(|sub_config| sub_config.hedgingPercent) .or(config.defaultHedgingPercent) .filter(|&percent| percent >= 0.0) @@ -1604,11 +1628,16 @@ pub fn get_sr_v3_lower_reset_factor( sr_v3_input_config: Option, pmt: &str, pm: &str, + sr_routing_dimesions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { - get_sr_v3_sub_level_input_config(&config.subLevelInputConfig, pmt, pm, |x| { - x.lowerResetFactor.is_some() - }) + get_sr_v3_sub_level_input_config( + &config.subLevelInputConfig, + pmt, + pm, + sr_routing_dimesions, + |x| x.lowerResetFactor.is_some(), + ) .and_then(|sub_config| sub_config.lowerResetFactor) .or(config.defaultLowerResetFactor) .filter(|&factor| factor >= 0.0) @@ -1619,11 +1648,16 @@ pub fn get_sr_v3_upper_reset_factor( sr_v3_input_config: Option, pmt: &str, pm: &str, + sr_routing_dimesions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { - get_sr_v3_sub_level_input_config(&config.subLevelInputConfig, pmt, pm, |x| { - x.upperResetFactor.is_some() - }) + get_sr_v3_sub_level_input_config( + &config.subLevelInputConfig, + pmt, + pm, + sr_routing_dimesions, + |x| x.upperResetFactor.is_some(), + ) .and_then(|sub_config| sub_config.upperResetFactor) .or(config.defaultUpperResetFactor) .filter(|&factor| factor >= 0.0) @@ -1635,13 +1669,20 @@ pub fn get_sr_v3_gateway_sigma_factor( pmt: &str, pm: &str, gw: &String, + sr_routing_dimesions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { - get_sr_v3_sub_level_input_config(&config.subLevelInputConfig, pmt, pm, |x| { - x.gatewayExtraScore - .as_ref() - .is_some_and(|scores| scores.iter().any(|score| score.gatewayName == *gw)) - }) + get_sr_v3_sub_level_input_config( + &config.subLevelInputConfig, + pmt, + pm, + sr_routing_dimesions, + |x| { + x.gatewayExtraScore + .as_ref() + .is_some_and(|scores| scores.iter().any(|score| score.gatewayName == *gw)) + }, + ) .and_then(|sub_config| find_gateway_sigma_factor(&sub_config.gatewayExtraScore, gw)) .or_else(|| find_gateway_sigma_factor(&config.defaultGatewayExtraScore, gw)) }) @@ -1663,6 +1704,7 @@ fn get_sr_v3_sub_level_input_config( sub_level_input_config: &Option>, pmt: &str, pm: &str, + sr_routing_dimesions: &SrRoutingDimensions, is_input_non_null: impl Fn(&SrV3SubLevelInputConfig) -> bool, ) -> Option { sub_level_input_config @@ -1671,20 +1713,55 @@ fn get_sr_v3_sub_level_input_config( configs .iter() .find(|config| { - config.paymentMethodType == Some(pmt.to_string()) - && config.paymentMethod == Some(pm.to_string()) - && is_input_non_null(config) + is_sr_v3_config_match( + config, + Some(pmt.to_string()), + Some(pm.to_string()), + &sr_routing_dimesions, + ) && is_input_non_null(config) }) .or_else(|| { configs.iter().find(|config| { - config.paymentMethodType == Some(pmt.to_string()) - && is_input_non_null(config) + is_sr_v3_config_match( + config, + Some(pmt.to_string()), + None, + &sr_routing_dimesions, + ) && is_input_non_null(config) }) }) }) .cloned() } +fn is_sr_v3_config_match( + config: &SrV3SubLevelInputConfig, + pmt: Option, + pm: Option, + sr_routing_dimesions: &SrRoutingDimensions, +) -> bool { + let pmt_matches = config.paymentMethodType == pmt; + let pm_matches = config.paymentMethod.is_none() || config.paymentMethod == pm; + let card_network_matches = + config.cardNetwork.is_none() || config.cardNetwork == sr_routing_dimesions.card_network; + let card_isin_matches = + config.cardIsIn.is_none() || config.cardIsIn == sr_routing_dimesions.card_isin; + let currency_matches = + config.currency.is_none() || config.currency == sr_routing_dimesions.currency; + let country_matches = + config.country.is_none() || config.country == sr_routing_dimesions.country; + let auth_type_matches = + config.authType.is_none() || config.authType == sr_routing_dimesions.auth_type; + + pmt_matches + && pm_matches + && card_network_matches + && card_isin_matches + && currency_matches + && auth_type_matches + && country_matches +} + pub fn filter_upto_pmt( sub_level_input_config: Vec, pmt: String, @@ -1864,6 +1941,11 @@ pub fn get_default_gateway_scoring_data( is_gri_enabled_for_elimination: bool, is_gri_enabled_for_sr_routing: bool, date_created: OffsetDateTime, + card_isin: Option, + card_switch_provider: Option>, + currency: Option, + country: Option, + auth_type: Option, ) -> GatewayScoringData { GatewayScoringData { merchantId: merchant_id, @@ -1872,7 +1954,7 @@ pub fn get_default_gateway_scoring_data( orderType: order_type, cardType: None, bankCode: None, - authType: None, + authType: auth_type, paymentSource: None, isPaymentSourceEnabledForSrRouting: false, isAuthLevelEnabledForSrRouting: false, @@ -1882,6 +1964,11 @@ pub fn get_default_gateway_scoring_data( routingApproach: None, dateCreated: date_created, eliminationEnabled: false, + cardIsIn: card_isin, + cardSwitchProvider: card_switch_provider, + currency: currency, + country: country, + is_legacy_decider_flow: false, } } @@ -1931,6 +2018,16 @@ pub async fn get_gateway_scoring_data( is_gri_enabled_for_elimination, is_gri_enabled_for_sr_routing, decider_flow.get().dpTxnDetail.dateCreated.clone(), + decider_flow.get().dpTxnCardInfo.card_isin.clone(), + decider_flow.get().dpTxnCardInfo.cardSwitchProvider.clone(), + Some(decider_flow.get().dpOrder.currency.clone()), + decider_flow.get().dpTxnDetail.country.clone(), + decider_flow + .get() + .dpTxnCardInfo + .authType + .as_ref() + .map(|a| a.to_string()), ); let updated_gateway_scoring_data = match txn_card_info.paymentMethodType.as_str() { UPI => { @@ -2296,6 +2393,105 @@ pub async fn get_unified_sr_key( gateway_scoring_data: &GatewayScoringData, is_sr_v3_metric_enabled: bool, enforce1d: bool, +) -> String { + let is_legacy_decider_flow = gateway_scoring_data.is_legacy_decider_flow; + if is_legacy_decider_flow { + return get_legacy_unified_sr_key(gateway_scoring_data, is_sr_v3_metric_enabled, enforce1d) + .await; + } + let merchant_id = gateway_scoring_data.merchantId.clone(); + let order_type = gateway_scoring_data.orderType.clone(); + let payment_method_type = gateway_scoring_data.paymentMethodType.clone(); + let payment_method = gateway_scoring_data.paymentMethod.clone(); + let card_network = gateway_scoring_data.cardSwitchProvider.clone(); + let card_isin = gateway_scoring_data.cardIsIn.clone(); + let currency = gateway_scoring_data + .currency + .as_ref() + .map(|c| c.to_string()); + let country = gateway_scoring_data.country.as_ref().map(|c| c.to_string()); + let auth_type = gateway_scoring_data.authType.clone(); + let key_prefix = if is_sr_v3_metric_enabled { + C::gateway_selection_v3_order_type_key_prefix.to_string() + } else { + C::gateway_selection_order_type_key_prefix.to_string() + }; + + // Base key components that are always present + let mut key_components = vec![ + key_prefix, + merchant_id.clone(), + order_type, + payment_method_type, + payment_method, + ]; + + let name = format!("SR_DIMENSION_CONFIG_{}", merchant_id); + + let service_config = find_config_by_name(name.clone()) + .await + .change_context(EuclidErrors::StorageError) + .and_then(|opt_config| { + opt_config.and_then(|config| config.value).ok_or_else(|| { + error_stack::report!(EuclidErrors::InvalidSrDimensionConfig( + "SR dimension config not found".to_string() + )) + }) + }) + .and_then(|config| { + serde_json::from_str::(&config).change_context( + EuclidErrors::InvalidSrDimensionConfig( + "Failed to parse SR dimension config".to_string(), + ), + ) + }); + + let fields = service_config + .map(|config| config.fields) + .unwrap_or_default(); + + for field in fields { + if let Some(suffix) = field.strip_prefix("paymentInfo.") { + match suffix { + "card_network" => { + if let Some(cn) = card_network.clone() { + key_components.push(cn.peek().to_string()); + } + } + "card_is_in" => { + if let Some(ci) = card_isin.clone() { + key_components.push(ci); + } + } + "currency" => { + if let Some(cu) = currency.clone() { + key_components.push(cu); + } + } + "country" => { + if let Some(co) = country.clone() { + key_components.push(co); + } + } + "auth_type" => { + if let Some(at) = auth_type.clone() { + key_components.push(at); + } + } + _ => { + // Unknown field under payment_info + } + } + } + } + + intercalate_without_empty_string("_", &key_components) +} + +async fn get_legacy_unified_sr_key( + gateway_scoring_data: &GatewayScoringData, + is_sr_v3_metric_enabled: bool, + enforce1d: bool, ) -> String { let merchant_id = gateway_scoring_data.merchantId.clone(); let order_type = gateway_scoring_data.orderType.clone(); diff --git a/src/decider/gatewaydecider/validators.rs b/src/decider/gatewaydecider/validators.rs index 66508a9e..5fc71869 100644 --- a/src/decider/gatewaydecider/validators.rs +++ b/src/decider/gatewaydecider/validators.rs @@ -28,6 +28,7 @@ use super::types as T; use crate::error; use crate::types::card::card_type as Ca; use crate::types::card::txn_card_info as ETCa; +use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; use crate::types::customer as ETC; use crate::types::gateway as ETG; @@ -233,6 +234,11 @@ pub fn parseFromApiTxnDetail(apiType: T::ApiTxnDetail) -> Option ( + hyper::StatusCode::BAD_REQUEST, + axum::Json(ApiErrorResponse::new( + error_codes::TE_04, + msg, + None, + )), + ) + .into_response(), } } } diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index 70a328cc..d40409d1 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -11,11 +11,12 @@ use crate::{ types::{ ActivateRoutingConfigRequest, Context, DataType, JsonifiedRoutingAlgorithm, RoutingAlgorithmMapperNew, RoutingDictionaryRecord, RoutingEvaluateResponse, - RoutingRequest, RoutingRule, StaticRoutingAlgorithm, + RoutingRequest, RoutingRule, SrDimensionConfig, StaticRoutingAlgorithm, + ELIGIBLE_DIMENSIONS, }, utils::{generate_random_id, is_valid_enum_value, validate_routing_rule}, }, - types::service_configuration::find_config_by_name, + types::service_configuration::{find_config_by_name, insert_config, update_config}, }; use crate::euclid::{ @@ -34,7 +35,99 @@ use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOT use serde_json::{json, Value}; const DEFAULT_FALLBACK_IDENTIFIER: &str = "default_fallback_enabled"; +pub async fn config_sr_dimentions( + Json(payload): Json, +) -> Result, ContainerError> { + let timer = metrics::API_LATENCY_HISTOGRAM + .with_label_values(&["config_sr_dimentions"]) + .start_timer(); + metrics::API_REQUEST_TOTAL_COUNTER + .with_label_values(&["config_sr_dimentions"]) + .inc(); + logger::debug!("Received SR Dimension config: {:?}", payload); + + // Validate dimensions against ELIGIBLE_DIMENSIONS + let invalid_dimensions: Vec<&String> = payload + .fields + .iter() + .filter(|field| !ELIGIBLE_DIMENSIONS.contains(&field.as_str())) + .collect(); + + if !invalid_dimensions.is_empty() { + metrics::API_REQUEST_COUNTER + .with_label_values(&["config_sr_dimentions", "failure"]) + .inc(); + timer.observe_duration(); + + let invalid_dims_str = invalid_dimensions + .iter() + .map(|d| format!("'{}'", d)) + .collect::>() + .join(", "); + + logger::error!( + "Invalid dimensions found for merchant {}: {}", + payload.merchant_id, + invalid_dims_str + ); + + return Err(EuclidErrors::InvalidSrDimensionConfig(format!( + "Invalid dimensions: {}. Valid dimensions are: {}", + invalid_dims_str, + ELIGIBLE_DIMENSIONS.join(", ") + )) + .into()); + } + + let mid = payload.merchant_id.clone(); + let config = serde_json::to_string(&payload) + .change_context(EuclidErrors::FailedToSerializeJsonToString)?; + let name = format!("SR_DIMENSION_CONFIG_{}", mid); + let service_config = find_config_by_name(name.clone()) + .await + .change_context(EuclidErrors::StorageError)?; + let result = match service_config { + Some(_) => { + logger::debug!( + "Updating existing SR Dimension config for merchant: {}", + mid + ); + update_config(name, Some(config)) + .await + .change_context(EuclidErrors::StorageError) + } + None => { + logger::debug!("Inserting new SR Dimension config for merchant: {}", mid); + insert_config(name, Some(config)) + .await + .change_context(EuclidErrors::StorageError) + } + }; + + if let Err(_) = result { + metrics::API_REQUEST_COUNTER + .with_label_values(&["config_sr_dimentions", "failure"]) + .inc(); + timer.observe_duration(); + logger::error!( + "Failed to insert or update SR Dimension config for merchant: {}", + mid + ); + return Err(ContainerError::from(EuclidErrors::StorageError)); + } + metrics::API_REQUEST_COUNTER + .with_label_values(&["config_sr_dimentions", "success"]) + .inc(); + timer.observe_duration(); + logger::info!( + "SR Dimension configuration updated successfully for merchant: {}", + mid + ); + Ok(Json( + "SR Dimension configuration updated successfully".to_string(), + )) +} pub async fn routing_create( Json(payload): Json, ) -> Result, ContainerError> { diff --git a/src/euclid/types.rs b/src/euclid/types.rs index ad03204a..efd43db7 100644 --- a/src/euclid/types.rs +++ b/src/euclid/types.rs @@ -100,6 +100,19 @@ impl RoutingDictionaryRecord { } } +#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] +pub struct SrDimensionConfig { + pub merchant_id: String, + pub fields: Vec, +} +pub const ELIGIBLE_DIMENSIONS: [&str; 5] = [ + "paymentInfo.currency", + "paymentInfo.country", + "paymentInfo.auth_type", + "paymentInfo.card_is_in", + "paymentInfo.card_network", +]; + #[derive(Debug, serde::Serialize)] pub struct RoutingEvaluateResponse { pub status: String, diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index db4443a5..302e9f49 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -3,6 +3,7 @@ use crate::redis::cache::findByNameFromRedis; use crate::redis::feature::isFeatureEnabled; +use masking::PeekInterface; // Converted imports // use gateway_decider::constants as c::{enable_elimination_v2, gateway_scoring_data, ENABLE_EXPLORE_AND_EXPLOIT_ON_SRV3, SR_V3_INPUT_CONFIG, GATEWAY_SCORE_FIRST_DIMENSION_SOFT_TTL}; // use feedback::constants as c; @@ -27,7 +28,7 @@ use crate::app::{get_tenant_app_state, APP_STATE}; use crate::decider::gatewaydecider::constants::{self as DC, srV3DefaultInputConfig}; use crate::decider::gatewaydecider::types as T; use crate::decider::gatewaydecider::types::GatewayScoringData; -use crate::decider::gatewaydecider::types::RoutingFlowType as RF; +use crate::decider::gatewaydecider::types::{RoutingFlowType as RF, SrRoutingDimensions}; use crate::decider::gatewaydecider::utils::{ self as GU, get_m_id, get_payment_method, get_sr_v3_latency_threshold, }; @@ -289,15 +290,36 @@ pub async fn getGatewayScoringType( txn_card_info.paymentMethod, txn_detail.sourceObject.unwrap_or_default(), ); - let maybe_latency_threshold = - get_sr_v3_latency_threshold(merchant_sr_v3_input_config, &pmt, &pm); + // Extract the new parameters from txn_card_info + + let sr_routing_dimesions = SrRoutingDimensions { + card_network: txn_card_info + .cardSwitchProvider + .as_ref() + .map(|s| s.peek().to_string()), + card_isin: txn_card_info.card_isin.clone(), + currency: Some(txn_detail.currency.to_string()), + country: txn_detail.country.as_ref().map(|c| c.to_string()), + auth_type: txn_card_info.authType.as_ref().map(|a| a.to_string()), + }; + + let maybe_latency_threshold = get_sr_v3_latency_threshold( + merchant_sr_v3_input_config, + &pmt, + &pm, + &sr_routing_dimesions, + ); let time_difference_threshold = match maybe_latency_threshold { None => { let default_sr_v3_input_config = findByNameFromRedis(srV3DefaultInputConfig.get_key()).await; - let maybe_default_latency_threshold = - get_sr_v3_latency_threshold(default_sr_v3_input_config, &pmt, &pm); + let maybe_default_latency_threshold = get_sr_v3_latency_threshold( + default_sr_v3_input_config, + &pmt, + &pm, + &sr_routing_dimesions, + ); maybe_default_latency_threshold.unwrap_or(defaultSrV3LatencyThresholdInSecs()) } Some(latency_threshold) => latency_threshold, diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index 7da495d8..994c365b 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -36,7 +36,7 @@ use crate::redis::cache::findByNameFromRedis; use crate::types::payment::payment_method_type_const::*; use crate::{ app, - decider::gatewaydecider::types::GatewayScoringData, + decider::gatewaydecider::types::{GatewayScoringData, SrRoutingDimensions}, decider::{ gatewaydecider::constants as DC, gatewaydecider::types::RoutingFlowType as RF, gatewaydecider::types::ScoreKeyType as SK, gatewaydecider::types::SrV3InputConfig, @@ -62,6 +62,7 @@ use crate::{ }, utils as U, }; +use masking::PeekInterface; // Converted functions // Original Haskell function: updateSrV3Score @@ -325,12 +326,30 @@ pub async fn getSrV3MerchantBucketSize(txn_detail: TxnDetail, txn_card_info: Txn txn_card_info.paymentMethod, txn_detail.sourceObject.unwrap_or_default(), ); - let maybe_bucket_size = GU::get_sr_v3_bucket_size(merchant_sr_v3_input_config, &pmt, &pm); + // Extract the new parameters from txn_card_info + + let sr_routing_dimesions = SrRoutingDimensions { + card_network: txn_card_info + .cardSwitchProvider + .as_ref() + .map(|s| s.peek().to_string()), + card_isin: txn_card_info.card_isin, + currency: Some(txn_detail.currency.to_string()), + country: txn_detail.country.as_ref().map(|c| c.to_string()), + auth_type: txn_card_info.authType.as_ref().map(|a| a.to_string()), + }; + + let maybe_bucket_size = GU::get_sr_v3_bucket_size( + merchant_sr_v3_input_config, + &pmt, + &pm, + &sr_routing_dimesions, + ); let merchant_bucket_size = match maybe_bucket_size { None => { let default_sr_v3_input_config: Option = findByNameFromRedis(DC::srV3DefaultInputConfig.get_key()).await; - GU::get_sr_v3_bucket_size(default_sr_v3_input_config, &pmt, &pm) + GU::get_sr_v3_bucket_size(default_sr_v3_input_config, &pmt, &pm, &sr_routing_dimesions) .unwrap_or(C::defaultSrV3BasedBucketSize) } Some(bucket_size) => bucket_size, diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 08f2afa8..76232ec2 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -185,7 +185,11 @@ pub fn getTxnDetailFromApiPayload( .unwrap_or_else(|| ETTD::TxnObjectType::OrderPayment), sourceObject: Some(gateway_scoring_data.paymentMethod.clone()), sourceObjectId: None, - currency: Currency::INR, + currency: gateway_scoring_data + .currency + .clone() + .expect("currency is mandatory"), + country: gateway_scoring_data.country.clone(), surchargeAmount: None, taxAmount: None, internalMetadata: Some( diff --git a/src/types/country/country_iso.rs b/src/types/country/country_iso.rs index d8f9911f..a29e98bb 100644 --- a/src/types/country/country_iso.rs +++ b/src/types/country/country_iso.rs @@ -4,12 +4,12 @@ use std::hash::Hash; use std::string::String; #[derive(Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Clone, Copy)] pub enum CountryISO { - AIA, AFG, - AGO, + AIA, ALA, ALB, AND, + AGO, ARE, ARG, ARM, @@ -207,218 +207,221 @@ pub fn country_iso_to_text(country_iso: CountryISO) -> String { pub fn text_db_to_country_iso(text: &str) -> Result { match text { - "AIA" => Ok(CountryISO::AIA), "AFG" => Ok(CountryISO::AFG), - "ASM" => Ok(CountryISO::ASM), - "ALB" => Ok(CountryISO::ALB), + "AIA" => Ok(CountryISO::AIA), "ALA" => Ok(CountryISO::ALA), - "DZA" => Ok(CountryISO::DZA), + "ALB" => Ok(CountryISO::ALB), "AND" => Ok(CountryISO::AND), "AGO" => Ok(CountryISO::AGO), + "ARE" => Ok(CountryISO::ARE), "ARG" => Ok(CountryISO::ARG), "ARM" => Ok(CountryISO::ARM), + "ASM" => Ok(CountryISO::ASM), + "ATG" => Ok(CountryISO::ATG), "AUS" => Ok(CountryISO::AUS), "AUT" => Ok(CountryISO::AUT), "AZE" => Ok(CountryISO::AZE), - "BHS" => Ok(CountryISO::BHS), - "BHR" => Ok(CountryISO::BHR), + "BDI" => Ok(CountryISO::BDI), + "BEL" => Ok(CountryISO::BEL), + "BEN" => Ok(CountryISO::BEN), + "BFA" => Ok(CountryISO::BFA), "BGD" => Ok(CountryISO::BGD), - "BRB" => Ok(CountryISO::BRB), + "BGR" => Ok(CountryISO::BGR), + "BHR" => Ok(CountryISO::BHR), + "BHS" => Ok(CountryISO::BHS), + "BIH" => Ok(CountryISO::BIH), "BLR" => Ok(CountryISO::BLR), - "BEL" => Ok(CountryISO::BEL), "BLZ" => Ok(CountryISO::BLZ), - "BEN" => Ok(CountryISO::BEN), - "BTN" => Ok(CountryISO::BTN), "BOL" => Ok(CountryISO::BOL), - "BIH" => Ok(CountryISO::BIH), - "BWA" => Ok(CountryISO::BWA), "BRA" => Ok(CountryISO::BRA), + "BRB" => Ok(CountryISO::BRB), "BRN" => Ok(CountryISO::BRN), - "BGR" => Ok(CountryISO::BGR), - "BFA" => Ok(CountryISO::BFA), - "BDI" => Ok(CountryISO::BDI), - "CPV" => Ok(CountryISO::CPV), - "KHM" => Ok(CountryISO::KHM), - "CMR" => Ok(CountryISO::CMR), - "CAN" => Ok(CountryISO::CAN), + "BTN" => Ok(CountryISO::BTN), + "BWA" => Ok(CountryISO::BWA), "CAF" => Ok(CountryISO::CAF), - "TCD" => Ok(CountryISO::TCD), + "CAN" => Ok(CountryISO::CAN), + "CHE" => Ok(CountryISO::CHE), "CHL" => Ok(CountryISO::CHL), "CHN" => Ok(CountryISO::CHN), + "CMR" => Ok(CountryISO::CMR), + "COD" => Ok(CountryISO::COD), + "COG" => Ok(CountryISO::COG), "COL" => Ok(CountryISO::COL), "COM" => Ok(CountryISO::COM), - "COG" => Ok(CountryISO::COG), + "CPV" => Ok(CountryISO::CPV), "CRI" => Ok(CountryISO::CRI), - "HRV" => Ok(CountryISO::HRV), "CUB" => Ok(CountryISO::CUB), "CYP" => Ok(CountryISO::CYP), "CZE" => Ok(CountryISO::CZE), - "COD" => Ok(CountryISO::COD), - "DNK" => Ok(CountryISO::DNK), + "DEU" => Ok(CountryISO::DEU), "DJI" => Ok(CountryISO::DJI), "DMA" => Ok(CountryISO::DMA), + "DNK" => Ok(CountryISO::DNK), "DOM" => Ok(CountryISO::DOM), + "DZA" => Ok(CountryISO::DZA), "ECU" => Ok(CountryISO::ECU), "EGY" => Ok(CountryISO::EGY), - "SLV" => Ok(CountryISO::SLV), - "GNQ" => Ok(CountryISO::GNQ), "ERI" => Ok(CountryISO::ERI), + "ESP" => Ok(CountryISO::ESP), "EST" => Ok(CountryISO::EST), - "SWZ" => Ok(CountryISO::SWZ), "ETH" => Ok(CountryISO::ETH), - "FJI" => Ok(CountryISO::FJI), "FIN" => Ok(CountryISO::FIN), + "FJI" => Ok(CountryISO::FJI), "FRA" => Ok(CountryISO::FRA), + "FSM" => Ok(CountryISO::FSM), "GAB" => Ok(CountryISO::GAB), - "GMB" => Ok(CountryISO::GMB), + "GBR" => Ok(CountryISO::GBR), "GEO" => Ok(CountryISO::GEO), - "DEU" => Ok(CountryISO::DEU), "GHA" => Ok(CountryISO::GHA), + "GIN" => Ok(CountryISO::GIN), + "GMB" => Ok(CountryISO::GMB), + "GNB" => Ok(CountryISO::GNB), + "GNQ" => Ok(CountryISO::GNQ), "GRC" => Ok(CountryISO::GRC), "GRD" => Ok(CountryISO::GRD), "GTM" => Ok(CountryISO::GTM), - "GIN" => Ok(CountryISO::GIN), - "GNB" => Ok(CountryISO::GNB), "GUY" => Ok(CountryISO::GUY), "HKG" => Ok(CountryISO::HKG), - "HTI" => Ok(CountryISO::HTI), "HND" => Ok(CountryISO::HND), + "HRV" => Ok(CountryISO::HRV), + "HTI" => Ok(CountryISO::HTI), "HUN" => Ok(CountryISO::HUN), - "ISL" => Ok(CountryISO::ISL), - "IND" => Ok(CountryISO::IND), "IDN" => Ok(CountryISO::IDN), + "IND" => Ok(CountryISO::IND), + "IRL" => Ok(CountryISO::IRL), "IRN" => Ok(CountryISO::IRN), "IRQ" => Ok(CountryISO::IRQ), - "IRL" => Ok(CountryISO::IRL), + "ISL" => Ok(CountryISO::ISL), "ISR" => Ok(CountryISO::ISR), "ITA" => Ok(CountryISO::ITA), "JAM" => Ok(CountryISO::JAM), - "JPN" => Ok(CountryISO::JPN), "JOR" => Ok(CountryISO::JOR), + "JPN" => Ok(CountryISO::JPN), "KAZ" => Ok(CountryISO::KAZ), "KEN" => Ok(CountryISO::KEN), + "KGZ" => Ok(CountryISO::KGZ), + "KHM" => Ok(CountryISO::KHM), "KIR" => Ok(CountryISO::KIR), + "KNA" => Ok(CountryISO::KNA), + "KOR" => Ok(CountryISO::KOR), "KWT" => Ok(CountryISO::KWT), - "KGZ" => Ok(CountryISO::KGZ), "LAO" => Ok(CountryISO::LAO), - "LVA" => Ok(CountryISO::LVA), "LBN" => Ok(CountryISO::LBN), - "LSO" => Ok(CountryISO::LSO), "LBR" => Ok(CountryISO::LBR), "LBY" => Ok(CountryISO::LBY), + "LCA" => Ok(CountryISO::LCA), "LIE" => Ok(CountryISO::LIE), + "LKA" => Ok(CountryISO::LKA), + "LSO" => Ok(CountryISO::LSO), "LTU" => Ok(CountryISO::LTU), "LUX" => Ok(CountryISO::LUX), + "LVA" => Ok(CountryISO::LVA), + "MAR" => Ok(CountryISO::MAR), + "MCO" => Ok(CountryISO::MCO), + "MDA" => Ok(CountryISO::MDA), "MDG" => Ok(CountryISO::MDG), - "MWI" => Ok(CountryISO::MWI), - "MYS" => Ok(CountryISO::MYS), "MDV" => Ok(CountryISO::MDV), + "MEX" => Ok(CountryISO::MEX), + "MHL" => Ok(CountryISO::MHL), + "MKD" => Ok(CountryISO::MKD), "MLI" => Ok(CountryISO::MLI), "MLT" => Ok(CountryISO::MLT), - "MHL" => Ok(CountryISO::MHL), - "MRT" => Ok(CountryISO::MRT), - "MUS" => Ok(CountryISO::MUS), - "MEX" => Ok(CountryISO::MEX), - "FSM" => Ok(CountryISO::FSM), - "MDA" => Ok(CountryISO::MDA), - "MCO" => Ok(CountryISO::MCO), + "MMR" => Ok(CountryISO::MMR), "MNG" => Ok(CountryISO::MNG), "MNE" => Ok(CountryISO::MNE), - "MAR" => Ok(CountryISO::MAR), "MOZ" => Ok(CountryISO::MOZ), - "MMR" => Ok(CountryISO::MMR), + "MRT" => Ok(CountryISO::MRT), + "MUS" => Ok(CountryISO::MUS), + "MWI" => Ok(CountryISO::MWI), + "MYS" => Ok(CountryISO::MYS), "NAM" => Ok(CountryISO::NAM), - "NRU" => Ok(CountryISO::NRU), - "NPL" => Ok(CountryISO::NPL), - "NLD" => Ok(CountryISO::NLD), - "NZL" => Ok(CountryISO::NZL), - "NIC" => Ok(CountryISO::NIC), "NER" => Ok(CountryISO::NER), "NGA" => Ok(CountryISO::NGA), - "MKD" => Ok(CountryISO::MKD), + "NIC" => Ok(CountryISO::NIC), + "NLD" => Ok(CountryISO::NLD), "NOR" => Ok(CountryISO::NOR), + "NPL" => Ok(CountryISO::NPL), + "NRU" => Ok(CountryISO::NRU), + "NZL" => Ok(CountryISO::NZL), "OMN" => Ok(CountryISO::OMN), "PAK" => Ok(CountryISO::PAK), - "PLW" => Ok(CountryISO::PLW), "PAN" => Ok(CountryISO::PAN), - "PNG" => Ok(CountryISO::PNG), - "PRY" => Ok(CountryISO::PRY), "PER" => Ok(CountryISO::PER), "PHL" => Ok(CountryISO::PHL), + "PLW" => Ok(CountryISO::PLW), + "PNG" => Ok(CountryISO::PNG), "POL" => Ok(CountryISO::POL), "PRT" => Ok(CountryISO::PRT), + "PRY" => Ok(CountryISO::PRY), "QAT" => Ok(CountryISO::QAT), - "KOR" => Ok(CountryISO::KOR), "ROU" => Ok(CountryISO::ROU), "RUS" => Ok(CountryISO::RUS), "RWA" => Ok(CountryISO::RWA), - "KNA" => Ok(CountryISO::KNA), - "LCA" => Ok(CountryISO::LCA), - "VCT" => Ok(CountryISO::VCT), - "WSM" => Ok(CountryISO::WSM), - "SMR" => Ok(CountryISO::SMR), - "STP" => Ok(CountryISO::STP), "SAU" => Ok(CountryISO::SAU), + "SDN" => Ok(CountryISO::SDN), "SEN" => Ok(CountryISO::SEN), - "SRB" => Ok(CountryISO::SRB), - "SYC" => Ok(CountryISO::SYC), - "SLE" => Ok(CountryISO::SLE), "SGP" => Ok(CountryISO::SGP), - "SVK" => Ok(CountryISO::SVK), - "SVN" => Ok(CountryISO::SVN), "SLB" => Ok(CountryISO::SLB), + "SLE" => Ok(CountryISO::SLE), + "SLV" => Ok(CountryISO::SLV), + "SMR" => Ok(CountryISO::SMR), "SOM" => Ok(CountryISO::SOM), - "ZAF" => Ok(CountryISO::ZAF), + "SRB" => Ok(CountryISO::SRB), "SSD" => Ok(CountryISO::SSD), - "ESP" => Ok(CountryISO::ESP), - "LKA" => Ok(CountryISO::LKA), - "SDN" => Ok(CountryISO::SDN), + "STP" => Ok(CountryISO::STP), "SUR" => Ok(CountryISO::SUR), + "SVK" => Ok(CountryISO::SVK), + "SVN" => Ok(CountryISO::SVN), "SWE" => Ok(CountryISO::SWE), - "CHE" => Ok(CountryISO::CHE), + "SWZ" => Ok(CountryISO::SWZ), + "SYC" => Ok(CountryISO::SYC), "SYR" => Ok(CountryISO::SYR), - "TJK" => Ok(CountryISO::TJK), - "TZA" => Ok(CountryISO::TZA), + "TCD" => Ok(CountryISO::TCD), + "TGO" => Ok(CountryISO::TGO), "THA" => Ok(CountryISO::THA), + "TJK" => Ok(CountryISO::TJK), + "TKM" => Ok(CountryISO::TKM), "TLS" => Ok(CountryISO::TLS), - "TGO" => Ok(CountryISO::TGO), "TON" => Ok(CountryISO::TON), "TTO" => Ok(CountryISO::TTO), "TUN" => Ok(CountryISO::TUN), "TUR" => Ok(CountryISO::TUR), - "TKM" => Ok(CountryISO::TKM), "TUV" => Ok(CountryISO::TUV), + "TZA" => Ok(CountryISO::TZA), "UGA" => Ok(CountryISO::UGA), "UKR" => Ok(CountryISO::UKR), - "ARE" => Ok(CountryISO::ARE), - "GBR" => Ok(CountryISO::GBR), - "USA" => Ok(CountryISO::USA), "URY" => Ok(CountryISO::URY), + "USA" => Ok(CountryISO::USA), "UZB" => Ok(CountryISO::UZB), - "VUT" => Ok(CountryISO::VUT), "VEN" => Ok(CountryISO::VEN), + "VCT" => Ok(CountryISO::VCT), "VNM" => Ok(CountryISO::VNM), + "VUT" => Ok(CountryISO::VUT), + "WSM" => Ok(CountryISO::WSM), "YEM" => Ok(CountryISO::YEM), + "ZAF" => Ok(CountryISO::ZAF), "ZMB" => Ok(CountryISO::ZMB), "ZWE" => Ok(CountryISO::ZWE), - "ATG" => Ok(CountryISO::ATG), _ => Err(ApiError::ParsingError("Invalid Country ISO")), } } -#[derive(Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Clone, strum::Display, Copy)] pub enum CountryISO2 { AD, AE, AF, + AG, AI, AL, AM, AO, + AQ, AR, AS, AT, AU, + AW, AX, AZ, BA, @@ -430,20 +433,26 @@ pub enum CountryISO2 { BH, BI, BJ, + BL, + BM, BN, BO, + BQ, BR, BS, BT, + BV, BW, BY, BZ, CA, + CC, CD, CF, CG, CH, CI, + CK, CL, CM, CN, @@ -451,6 +460,8 @@ pub enum CountryISO2 { CR, CU, CV, + CW, + CX, CY, CZ, DE, @@ -461,27 +472,38 @@ pub enum CountryISO2 { DZ, EC, EE, + EH, EG, ER, ES, ET, FI, FJ, + FK, FM, + FO, FR, GA, GB, GD, GE, + GF, + GG, GH, + GI, + GL, GM, GN, + GP, GQ, GR, + GS, GT, + GU, GW, GY, HK, + HM, HN, HR, HT, @@ -489,11 +511,14 @@ pub enum CountryISO2 { ID, IE, IL, + IM, IN, + IO, IQ, IR, IS, IT, + JE, JM, JO, JP, @@ -506,6 +531,7 @@ pub enum CountryISO2 { KP, KR, KW, + KY, KZ, LA, LB, @@ -522,6 +548,369 @@ pub enum CountryISO2 { MC, MD, ME, + MF, MG, MH, + MK, + ML, + MM, + MN, + MO, + MP, + MQ, + MR, + MS, + MT, + MU, + MV, + MW, + MX, + MY, + MZ, + NA, + NC, + NE, + NF, + NG, + NI, + NL, + NO, + NP, + NR, + NU, + NZ, + OM, + PA, + PE, + PF, + PG, + PH, + PK, + PL, + PM, + PN, + PR, + PS, + PT, + PW, + PY, + QA, + RE, + RO, + RS, + RU, + RW, + SA, + SB, + SC, + SD, + SE, + SG, + SH, + SI, + SJ, + SK, + SL, + SM, + SN, + SO, + SR, + SS, + ST, + SV, + SX, + SY, + SZ, + TC, + TD, + TF, + TG, + TH, + TJ, + TK, + TL, + TM, + TN, + TO, + TR, + TT, + TV, + TW, + TZ, + UA, + UG, + UM, + US, + UY, + UZ, + VA, + VC, + VE, + VG, + VI, + VN, + VU, + WF, + WS, + YE, + YT, + ZA, + ZM, + ZW, +} + +impl CountryISO2 { + pub fn text_to_country(text: &str) -> Result { + match text { + "AD" => Ok(CountryISO2::AD), + "AE" => Ok(CountryISO2::AE), + "AF" => Ok(CountryISO2::AF), + "AG" => Ok(CountryISO2::AG), + "AI" => Ok(CountryISO2::AI), + "AL" => Ok(CountryISO2::AL), + "AM" => Ok(CountryISO2::AM), + "AO" => Ok(CountryISO2::AO), + "AQ" => Ok(CountryISO2::AQ), + "AR" => Ok(CountryISO2::AR), + "AS" => Ok(CountryISO2::AS), + "AT" => Ok(CountryISO2::AT), + "AU" => Ok(CountryISO2::AU), + "AW" => Ok(CountryISO2::AW), + "AX" => Ok(CountryISO2::AX), + "AZ" => Ok(CountryISO2::AZ), + "BA" => Ok(CountryISO2::BA), + "BB" => Ok(CountryISO2::BB), + "BD" => Ok(CountryISO2::BD), + "BE" => Ok(CountryISO2::BE), + "BF" => Ok(CountryISO2::BF), + "BG" => Ok(CountryISO2::BG), + "BH" => Ok(CountryISO2::BH), + "BI" => Ok(CountryISO2::BI), + "BJ" => Ok(CountryISO2::BJ), + "BL" => Ok(CountryISO2::BL), + "BM" => Ok(CountryISO2::BM), + "BN" => Ok(CountryISO2::BN), + "BO" => Ok(CountryISO2::BO), + "BQ" => Ok(CountryISO2::BQ), + "BR" => Ok(CountryISO2::BR), + "BS" => Ok(CountryISO2::BS), + "BT" => Ok(CountryISO2::BT), + "BV" => Ok(CountryISO2::BV), + "BW" => Ok(CountryISO2::BW), + "BY" => Ok(CountryISO2::BY), + "BZ" => Ok(CountryISO2::BZ), + "CA" => Ok(CountryISO2::CA), + "CC" => Ok(CountryISO2::CC), + "CD" => Ok(CountryISO2::CD), + "CF" => Ok(CountryISO2::CF), + "CG" => Ok(CountryISO2::CG), + "CH" => Ok(CountryISO2::CH), + "CI" => Ok(CountryISO2::CI), + "CK" => Ok(CountryISO2::CK), + "CL" => Ok(CountryISO2::CL), + "CM" => Ok(CountryISO2::CM), + "CN" => Ok(CountryISO2::CN), + "CO" => Ok(CountryISO2::CO), + "CR" => Ok(CountryISO2::CR), + "CU" => Ok(CountryISO2::CU), + "CV" => Ok(CountryISO2::CV), + "CW" => Ok(CountryISO2::CW), + "CX" => Ok(CountryISO2::CX), + "CY" => Ok(CountryISO2::CY), + "CZ" => Ok(CountryISO2::CZ), + "DE" => Ok(CountryISO2::DE), + "DJ" => Ok(CountryISO2::DJ), + "DK" => Ok(CountryISO2::DK), + "DM" => Ok(CountryISO2::DM), + "DO" => Ok(CountryISO2::DO), + "DZ" => Ok(CountryISO2::DZ), + "EC" => Ok(CountryISO2::EC), + "EE" => Ok(CountryISO2::EE), + "EH" => Ok(CountryISO2::EH), + "EG" => Ok(CountryISO2::EG), + "ER" => Ok(CountryISO2::ER), + "ES" => Ok(CountryISO2::ES), + "ET" => Ok(CountryISO2::ET), + "FI" => Ok(CountryISO2::FI), + "FJ" => Ok(CountryISO2::FJ), + "FK" => Ok(CountryISO2::FK), + "FM" => Ok(CountryISO2::FM), + "FO" => Ok(CountryISO2::FO), + "FR" => Ok(CountryISO2::FR), + "GA" => Ok(CountryISO2::GA), + "GB" => Ok(CountryISO2::GB), + "GD" => Ok(CountryISO2::GD), + "GE" => Ok(CountryISO2::GE), + "GF" => Ok(CountryISO2::GF), + "GG" => Ok(CountryISO2::GG), + "GH" => Ok(CountryISO2::GH), + "GI" => Ok(CountryISO2::GI), + "GL" => Ok(CountryISO2::GL), + "GM" => Ok(CountryISO2::GM), + "GN" => Ok(CountryISO2::GN), + "GP" => Ok(CountryISO2::GP), + "GQ" => Ok(CountryISO2::GQ), + "GR" => Ok(CountryISO2::GR), + "GS" => Ok(CountryISO2::GS), + "GT" => Ok(CountryISO2::GT), + "GU" => Ok(CountryISO2::GU), + "GW" => Ok(CountryISO2::GW), + "GY" => Ok(CountryISO2::GY), + "HK" => Ok(CountryISO2::HK), + "HM" => Ok(CountryISO2::HM), + "HN" => Ok(CountryISO2::HN), + "HR" => Ok(CountryISO2::HR), + "HT" => Ok(CountryISO2::HT), + "HU" => Ok(CountryISO2::HU), + "ID" => Ok(CountryISO2::ID), + "IE" => Ok(CountryISO2::IE), + "IL" => Ok(CountryISO2::IL), + "IM" => Ok(CountryISO2::IM), + "IN" => Ok(CountryISO2::IN), + "IO" => Ok(CountryISO2::IO), + "IQ" => Ok(CountryISO2::IQ), + "IR" => Ok(CountryISO2::IR), + "IS" => Ok(CountryISO2::IS), + "IT" => Ok(CountryISO2::IT), + "JE" => Ok(CountryISO2::JE), + "JM" => Ok(CountryISO2::JM), + "JO" => Ok(CountryISO2::JO), + "JP" => Ok(CountryISO2::JP), + "KE" => Ok(CountryISO2::KE), + "KG" => Ok(CountryISO2::KG), + "KH" => Ok(CountryISO2::KH), + "KI" => Ok(CountryISO2::KI), + "KM" => Ok(CountryISO2::KM), + "KN" => Ok(CountryISO2::KN), + "KP" => Ok(CountryISO2::KP), + "KR" => Ok(CountryISO2::KR), + "KW" => Ok(CountryISO2::KW), + "KY" => Ok(CountryISO2::KY), + "KZ" => Ok(CountryISO2::KZ), + "LA" => Ok(CountryISO2::LA), + "LB" => Ok(CountryISO2::LB), + "LC" => Ok(CountryISO2::LC), + "LI" => Ok(CountryISO2::LI), + "LK" => Ok(CountryISO2::LK), + "LR" => Ok(CountryISO2::LR), + "LS" => Ok(CountryISO2::LS), + "LT" => Ok(CountryISO2::LT), + "LU" => Ok(CountryISO2::LU), + "LV" => Ok(CountryISO2::LV), + "LY" => Ok(CountryISO2::LY), + "MA" => Ok(CountryISO2::MA), + "MC" => Ok(CountryISO2::MC), + "MD" => Ok(CountryISO2::MD), + "ME" => Ok(CountryISO2::ME), + "MF" => Ok(CountryISO2::MF), + "MG" => Ok(CountryISO2::MG), + "MH" => Ok(CountryISO2::MH), + "MK" => Ok(CountryISO2::MK), + "ML" => Ok(CountryISO2::ML), + "MM" => Ok(CountryISO2::MM), + "MN" => Ok(CountryISO2::MN), + "MO" => Ok(CountryISO2::MO), + "MP" => Ok(CountryISO2::MP), + "MQ" => Ok(CountryISO2::MQ), + "MR" => Ok(CountryISO2::MR), + "MS" => Ok(CountryISO2::MS), + "MT" => Ok(CountryISO2::MT), + "MU" => Ok(CountryISO2::MU), + "MV" => Ok(CountryISO2::MV), + "MW" => Ok(CountryISO2::MW), + "MX" => Ok(CountryISO2::MX), + "MY" => Ok(CountryISO2::MY), + "MZ" => Ok(CountryISO2::MZ), + "NA" => Ok(CountryISO2::NA), + "NC" => Ok(CountryISO2::NC), + "NE" => Ok(CountryISO2::NE), + "NF" => Ok(CountryISO2::NF), + "NG" => Ok(CountryISO2::NG), + "NI" => Ok(CountryISO2::NI), + "NL" => Ok(CountryISO2::NL), + "NO" => Ok(CountryISO2::NO), + "NP" => Ok(CountryISO2::NP), + "NR" => Ok(CountryISO2::NR), + "NU" => Ok(CountryISO2::NU), + "NZ" => Ok(CountryISO2::NZ), + "OM" => Ok(CountryISO2::OM), + "PA" => Ok(CountryISO2::PA), + "PE" => Ok(CountryISO2::PE), + "PF" => Ok(CountryISO2::PF), + "PG" => Ok(CountryISO2::PG), + "PH" => Ok(CountryISO2::PH), + "PK" => Ok(CountryISO2::PK), + "PL" => Ok(CountryISO2::PL), + "PM" => Ok(CountryISO2::PM), + "PN" => Ok(CountryISO2::PN), + "PR" => Ok(CountryISO2::PR), + "PS" => Ok(CountryISO2::PS), + "PT" => Ok(CountryISO2::PT), + "PW" => Ok(CountryISO2::PW), + "PY" => Ok(CountryISO2::PY), + "QA" => Ok(CountryISO2::QA), + "RE" => Ok(CountryISO2::RE), + "RO" => Ok(CountryISO2::RO), + "RS" => Ok(CountryISO2::RS), + "RU" => Ok(CountryISO2::RU), + "RW" => Ok(CountryISO2::RW), + "SA" => Ok(CountryISO2::SA), + "SB" => Ok(CountryISO2::SB), + "SC" => Ok(CountryISO2::SC), + "SD" => Ok(CountryISO2::SD), + "SE" => Ok(CountryISO2::SE), + "SG" => Ok(CountryISO2::SG), + "SH" => Ok(CountryISO2::SH), + "SI" => Ok(CountryISO2::SI), + "SJ" => Ok(CountryISO2::SJ), + "SK" => Ok(CountryISO2::SK), + "SL" => Ok(CountryISO2::SL), + "SM" => Ok(CountryISO2::SM), + "SN" => Ok(CountryISO2::SN), + "SO" => Ok(CountryISO2::SO), + "SR" => Ok(CountryISO2::SR), + "SS" => Ok(CountryISO2::SS), + "ST" => Ok(CountryISO2::ST), + "SV" => Ok(CountryISO2::SV), + "SX" => Ok(CountryISO2::SX), + "SY" => Ok(CountryISO2::SY), + "SZ" => Ok(CountryISO2::SZ), + "TC" => Ok(CountryISO2::TC), + "TD" => Ok(CountryISO2::TD), + "TF" => Ok(CountryISO2::TF), + "TG" => Ok(CountryISO2::TG), + "TH" => Ok(CountryISO2::TH), + "TJ" => Ok(CountryISO2::TJ), + "TK" => Ok(CountryISO2::TK), + "TL" => Ok(CountryISO2::TL), + "TM" => Ok(CountryISO2::TM), + "TN" => Ok(CountryISO2::TN), + "TO" => Ok(CountryISO2::TO), + "TR" => Ok(CountryISO2::TR), + "TT" => Ok(CountryISO2::TT), + "TV" => Ok(CountryISO2::TV), + "TZ" => Ok(CountryISO2::TZ), + "UA" => Ok(CountryISO2::UA), + "UG" => Ok(CountryISO2::UG), + "UM" => Ok(CountryISO2::UM), + "US" => Ok(CountryISO2::US), + "UY" => Ok(CountryISO2::UY), + "UZ" => Ok(CountryISO2::UZ), + "VA" => Ok(CountryISO2::VA), + "VC" => Ok(CountryISO2::VC), + "VE" => Ok(CountryISO2::VE), + "VG" => Ok(CountryISO2::VG), + "VI" => Ok(CountryISO2::VI), + "VN" => Ok(CountryISO2::VN), + "VU" => Ok(CountryISO2::VU), + "WF" => Ok(CountryISO2::WF), + "WS" => Ok(CountryISO2::WS), + "YE" => Ok(CountryISO2::YE), + "YT" => Ok(CountryISO2::YT), + "ZA" => Ok(CountryISO2::ZA), + "ZM" => Ok(CountryISO2::ZM), + "ZW" => Ok(CountryISO2::ZW), + _ => Err(ApiError::ParsingError("Invalid Country ISO2")), + } + } } diff --git a/src/types/txn_details/types.rs b/src/types/txn_details/types.rs index a91674a4..ed95349b 100644 --- a/src/types/txn_details/types.rs +++ b/src/types/txn_details/types.rs @@ -13,6 +13,7 @@ use time::Time; // use db::mesh::internal; // use crate::storage::internal::primd_id_to_int; // use types::utils::dbconfig::get_euler_db_conf; +use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; use crate::types::merchant::id::MerchantId; use crate::types::merchant::merchant_gateway_account::MerchantGwAccId; @@ -530,6 +531,8 @@ pub struct TxnDetail { pub sourceObjectId: Option, #[serde(rename = "currency")] pub currency: Currency, + #[serde(rename = "country")] + pub country: Option, #[serde(rename = "surchargeAmount")] pub surchargeAmount: Option, #[serde(rename = "taxAmount")] From 52290e3b21fc495b6e1ee169d81d6c0fb152bab0 Mon Sep 17 00:00:00 2001 From: Prajwal Haniya <82883854+prajwalhaniya@users.noreply.github.com> Date: Tue, 29 Jul 2025 12:27:22 +0530 Subject: [PATCH 09/95] fix: makefile (#125) --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 43d893c9..4369ad32 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,13 @@ COMMIT_HASH := $(shell git rev-parse --short HEAD) TAG := ghcr.io/juspay/decision-engine:sha_$(COMMIT_HASH) docker-build: - docker build --platform=linux/amd64 -t $(TAG) . + docker build --platform=linux/amd64 -t $(TAG) . docker-run: - docker run --platform=linux/amd64 -v `pwd`/config/docker-configuration.toml:/local/config/development.toml -p 8080:8080 -d $(TAG) + docker run --platform=linux/amd64 -v `pwd`/config/docker-configuration.toml:/local/config/development.toml -p 8080:8080 -d $(TAG) docker-it-run: - docker run --platform=linux/amd64 -v `pwd`/config/docker-configuration.toml:/local/config/development.toml -it $(TAG) /bin/bash + docker run --platform=linux/amd64 -v `pwd`/config/docker-configuration.toml:/local/config/development.toml -it $(TAG) /bin/bash init: docker-compose run --rm db-migrator && docker-compose up open-router From 0348e63afa9cf70a73fa5a0101c2bbcde4ae3ee8 Mon Sep 17 00:00:00 2001 From: Sarthak Soni <76486416+Sarthak1799@users.noreply.github.com> Date: Thu, 31 Jul 2025 12:53:23 +0530 Subject: [PATCH 10/95] feat: Add local prometheus setup for metrics (#129) --- Makefile | 8 +++++++- config/development.toml | 2 +- config/docker-configuration.toml | 2 +- config/grafana-datasource.yaml | 8 ++++++++ config/prometheus.yaml | 30 ++++++++++++++++++++++++++++++ docker-compose.yaml | 31 ++++++++++++++++++++++++++++--- 6 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 config/grafana-datasource.yaml create mode 100644 config/prometheus.yaml diff --git a/Makefile b/Makefile index 4369ad32..b4d27525 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,13 @@ init-local: docker-compose run --rm db-migrator && docker-compose up --build open-router-local init-local-pg: - docker-compose run --rm db-migrator-postgres && docker-compose up --build open-router-local-pg + docker-compose run --rm db-migrator-postgres && docker-compose up --build open-router-local-pg + +init-local-pg-monitor: + docker-compose run --rm db-migrator-postgres && docker-compose up --build -d prometheus && docker-compose up --build -d grafana && docker-compose up --build open-router-local-pg + +init-pg-monitor: + docker-compose run --rm db-migrator-postgres && docker-compose up --build -d prometheus && docker-compose up --build -d grafana && docker-compose up --build open-router-pg run-local: docker-compose up open-router-local diff --git a/config/development.toml b/config/development.toml index 56b26693..61d7337b 100644 --- a/config/development.toml +++ b/config/development.toml @@ -9,7 +9,7 @@ port = 8080 [metrics] host = "127.0.0.1" -port = 9090 +port = 9094 [limit] request_count = 1 diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index 71a2d164..0215d5ab 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -9,7 +9,7 @@ port = 8080 [metrics] host = "0.0.0.0" -port = 9090 +port = 9094 [limit] request_count = 1 diff --git a/config/grafana-datasource.yaml b/config/grafana-datasource.yaml new file mode 100644 index 00000000..fbed2ef2 --- /dev/null +++ b/config/grafana-datasource.yaml @@ -0,0 +1,8 @@ +apiVersion: 1 + +datasources: + - name: Metrics + type: prometheus + access: proxy + url: http://prometheus:9090/ + editable: true diff --git a/config/prometheus.yaml b/config/prometheus.yaml new file mode 100644 index 00000000..587b77c7 --- /dev/null +++ b/config/prometheus.yaml @@ -0,0 +1,30 @@ +# my global config +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + +# alter manager if required +# Alertmanager configuration +# alerting: +# alertmanagers: +# - static_configs: +# - targets: +# - alertmanager:9093 + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=` to any timeseries scraped from this config. + - job_name: "open-router" + + metrics_path: /metrics + # scheme defaults to 'http'. + + static_configs: + - targets: ["open-router-pg:9094"] # this can be replaced by open-router-local-pg for local setup diff --git a/docker-compose.yaml b/docker-compose.yaml index 9639b552..cbf64535 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -73,7 +73,7 @@ services: restart: unless-stopped ports: - "8080:8080" - - "9090:9090" + - "9094:9094" depends_on: postgresql: condition: service_healthy @@ -89,14 +89,14 @@ services: - GROOVY_RUNNER_HOST=host.docker.internal:8085 open-router-pg: - image: ghcr.io/juspay/decision-engine/postgres:v1.2.0 + image: ghcr.io/juspay/decision-engine/postgres:v1.2.1 pull_policy: always platform: linux/amd64 container_name: open-router-pg restart: unless-stopped ports: - "8080:8080" - - "9090:9090" + - "9094:9094" depends_on: db-migrator-postgres: condition: service_completed_successfully @@ -109,6 +109,31 @@ services: environment: - GROOVY_RUNNER_HOST=host.docker.internal:8085 + prometheus: + image: prom/prometheus:latest + networks: + - open-router-network + volumes: + - ./config/prometheus.yaml:/etc/prometheus/prometheus.yml + ports: + - "9090:9090" + restart: unless-stopped + + grafana: + image: grafana/grafana:latest + ports: + - "3000:3000" + networks: + - open-router-network + restart: unless-stopped + environment: + - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_AUTH_BASIC_ENABLED=false + volumes: + # - ./config/grafana.ini:/etc/grafana/grafana.ini + - ./config/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yml + groovy-runner: image: ghcr.io/juspay/open-router/groovy-runner:main pull_policy: always From de2e6b47a737152a3d3a50ee2c17deb3f26b99fb Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Thu, 31 Jul 2025 14:51:57 +0530 Subject: [PATCH 11/95] fix(routing): Changes for tenant_config parse error (#127) Co-authored-by: Priyanshu Choudhary --- src/merchant_config_util.rs | 13 +++++++------ src/types/tenant/tenant_config.rs | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/merchant_config_util.rs b/src/merchant_config_util.rs index 12b47814..f0a09d1f 100644 --- a/src/merchant_config_util.rs +++ b/src/merchant_config_util.rs @@ -40,12 +40,14 @@ use crate::{ load_merchant_config_by_mpid_category_name_and_status, MerchantConfig, }, types::{ - config_category_to_text, config_status_to_text, to_config_status, ConfigCategory, + config_category_to_text, config_status_to_text, ConfigCategory, ConfigStatus, PfMcConfig, }, }, payment_flow::{payment_flows_to_text, PaymentFlow}, - tenant::tenant_config::{ConfigType, ModuleName}, + tenant::tenant_config::{ + ConfigType, ModuleName, TenantConfigStatus, TenantConfigValueType, + }, tenant_config::{ get_arr_active_tenant_config_by_tenant_id_module_name_module_key_and_arr_type, get_arr_active_tenant_config_by_tenant_id_module_name_module_key_and_arr_type_and_country, @@ -544,10 +546,9 @@ pub async fn isPaymentFlowEnabledWithHierarchyCheck( } fn checkIfEnabledByTenant(config_value: &str, error_tag: &str) -> bool { - let config_status = to_config_status(config_value); - match config_status { - Ok(ConfigStatus::ENABLED) => true, - Ok(ConfigStatus::DISABLED) => false, + let result: Result, _> = serde_json::from_str(config_value); + match result { + Ok(config) => config.status == TenantConfigStatus::ENABLED, Err(e) => { logger::error!(action = error_tag, tag = error_tag, "Error: {}", e); false diff --git a/src/types/tenant/tenant_config.rs b/src/types/tenant/tenant_config.rs index 3e5e9d45..639fbdf2 100644 --- a/src/types/tenant/tenant_config.rs +++ b/src/types/tenant/tenant_config.rs @@ -112,6 +112,22 @@ pub fn text_to_filter_dimension(filter_dimension: String) -> Result { + pub status: TenantConfigStatus, + #[serde(rename = "configValue")] + pub config_value: Option, +} + #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] pub enum ConfigStatus { #[serde(rename = "ACTIVE")] From 96ab15d050f396ed062988b407ec7418607a7a32 Mon Sep 17 00:00:00 2001 From: Jagan Date: Thu, 31 Jul 2025 19:51:22 +0530 Subject: [PATCH 12/95] feat(routing): add support to handle gateway latency during SR routing (#126) --- .gitignore | 6 +- cypress.config.js | 53 + cypress/README.md | 318 ++ .../gateway-latency-scoring.cy.js | 224 ++ .../routing-flows/success-rate-routing.cy.js | 244 ++ cypress/support/commands.js | 292 ++ cypress/support/e2e.js | 46 + cypress/support/test-data-factory.js | 220 ++ package-lock.json | 3152 +++++++++++++++++ package.json | 20 + src/decider/gatewaydecider/types.rs | 6 + src/feedback/gateway_scoring_service.rs | 58 +- src/feedback/types.rs | 11 +- src/feedback/utils.rs | 2 +- src/routes/rule_configuration.rs | 5 +- src/routes/update_score.rs | 5 +- src/types/gateway_routing_input.rs | 17 +- src/types/routing_configuration.rs | 8 + src/types/txn_details/types.rs | 7 + 19 files changed, 4675 insertions(+), 19 deletions(-) create mode 100644 cypress.config.js create mode 100644 cypress/README.md create mode 100644 cypress/e2e/routing-flows/gateway-latency-scoring.cy.js create mode 100644 cypress/e2e/routing-flows/success-rate-routing.cy.js create mode 100644 cypress/support/commands.js create mode 100644 cypress/support/e2e.js create mode 100644 cypress/support/test-data-factory.js create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 413afe45..fa207feb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ routing-config/venv routing-config/output.sql dump.rdb -.vscode \ No newline at end of file +.vscode +**/node_modules +cypress/screenshots +cypress/videos +cypress/fixtures diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 00000000..5d7ee8dc --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,53 @@ +const { defineConfig } = require('cypress') + +module.exports = defineConfig({ + e2e: { + baseUrl: 'http://localhost:8080', + supportFile: 'cypress/support/e2e.js', + specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}', + viewportWidth: 1280, + viewportHeight: 720, + video: false, + screenshotOnRunFailure: true, + defaultCommandTimeout: 10000, + requestTimeout: 10000, + responseTimeout: 10000, + env: { + // Default configuration - can be overridden via environment variables + API_BASE_URL: 'http://localhost:8080', + DEFAULT_MERCHANT_ID_PREFIX: 'merc_', + DEFAULT_PAYMENT_ID_PREFIX: 'PAY_', + DEFAULT_CUSTOMER_ID_PREFIX: 'CUST', + // Test data configuration + DEFAULT_GATEWAYS: ['GatewayA', 'GatewayB', 'GatewayC'], + DEFAULT_AMOUNT: 100.50, + DEFAULT_CURRENCY: 'USD', + // Routing algorithm types + ROUTING_ALGORITHMS: { + SUCCESS_RATE: 'SR_BASED_ROUTING', + PAYMENT_LATENCY: 'PL_BASED_ROUTING', + COST_BASED: 'COST_BASED_ROUTING' + }, + // Payment method types for testing + PAYMENT_METHODS: { + UPI: { + type: 'UPI', + method: 'UPI_PAY' + }, + UPI_COLLECT: { + type: 'upi', + method: 'upi_collect' + }, + CARD: { + type: 'CARD', + method: 'CARD_PAY' + } + } + }, + setupNodeEvents(on, config) { + // implement node event listeners here + require('@cypress/grep/src/plugin')(config) + return config + }, + }, +}) diff --git a/cypress/README.md b/cypress/README.md new file mode 100644 index 00000000..da51a9ac --- /dev/null +++ b/cypress/README.md @@ -0,0 +1,318 @@ +# Decision Engine Cypress Testing Framework + +This directory contains comprehensive end-to-end tests for the Decision Engine routing flows using Cypress. The testing framework is designed to be generic and easily extensible for testing different routing algorithms and scenarios. + +## 📁 Directory Structure + +``` +cypress/ +├── e2e/ +│ └── routing-flows/ +│ ├── gateway-latency-scoring.cy.js # Gateway latency scoring tests +│ ├── success-rate-routing.cy.js # Success rate routing tests +├── support/ +│ ├── commands.js # Custom Cypress commands +│ ├── e2e.js # Global test configuration +│ └── test-data-factory.js # Test data generation utilities +└── README.md # This file +``` + +## 🚀 Getting Started + +### Prerequisites + +1. **Node.js** (v16 or higher) +2. **Decision Engine Service** running on `http://localhost:8082` +3. **Database** (MySQL/PostgreSQL) properly configured +4. **Redis** instance running + +### Installation + +1. Install dependencies: +```bash +npm install +``` + +2. Verify Cypress installation: +```bash +npx cypress verify +``` + +### Running Tests + +#### Interactive Mode (Cypress Test Runner) +```bash +npm run cypress:open +``` + +#### Headless Mode (CI/CD) +```bash +npm run cypress:run +``` + +#### Specific Test Suites +```bash +# Gateway latency scoring tests +npm run test:gateway-latency + +# Success rate routing tests +npm run test:success-rate + +# All routing flow tests +npm run test +``` + +#### Running Tests with Tags +```bash +# Run only smoke tests +npx cypress run --env grepTags="@smoke" + +# Run only gateway latency tests +npx cypress run --env grepTags="@gateway-latency" + +# Run performance tests +npx cypress run --env grepTags="@performance" +``` + +## 🛠️ Custom Commands + +The framework provides several custom Cypress commands for easy test creation: + +### Merchant Management +```javascript +cy.createMerchantAccount(merchantId) +``` + +### Rule Configuration +```javascript +cy.createRoutingRule(merchantId, ruleConfig) +cy.createSuccessRateRule(merchantId, options) +cy.createPaymentLatencyRule(merchantId, options) +``` + +### Gateway Operations +```javascript +cy.decideGateway(decisionRequest) +cy.updateGatewayScore(scoreUpdate) +``` + +### Complete Flows +```javascript +cy.completeGatewayLatencyFlow(options) +``` + +### Utility Commands +```javascript +cy.waitForService() +cy.cleanupTestData(merchantId) +``` + +## 📊 Test Data Factory + +The `TestDataFactory` class provides utilities for generating test data: + +```javascript +const TestDataFactory = require('../support/test-data-factory') + +// Generate unique IDs +const merchantId = TestDataFactory.generateMerchantId() +const paymentId = TestDataFactory.generatePaymentId() + +// Get rule configurations +const srRule = TestDataFactory.getSuccessRateRuleConfig({ + successRate: 0.8, + latencyThreshold: 100 +}) + +// Get test scenarios +const latencyScenarios = TestDataFactory.getLatencyTestScenarios() +const paymentMethods = TestDataFactory.getPaymentMethodTestCases() +``` + +## ⚙️ Configuration + +### Environment Variables + +Configure the testing environment in `cypress.config.js`: + +```javascript +env: { + API_BASE_URL: 'http://localhost:8082', + DEFAULT_GATEWAYS: ['GatewayA', 'GatewayB', 'GatewayC'], + DEFAULT_AMOUNT: 100.50, + DEFAULT_CURRENCY: 'USD' +} +``` + +### Override via Command Line +```bash +npx cypress run --env API_BASE_URL=http://localhost:8080 +``` + +## 🏷️ Test Tags + +Tests are organized using tags for easy filtering: + +- `@smoke` - Critical path tests +- `@gateway-latency` - Gateway latency specific tests +- `@success-rate` - Success rate routing tests +- `@payment-latency` - Payment latency routing tests +- `@performance` - Performance related tests +- `@edge-cases` - Edge case scenarios +- `@routing` - General routing tests + +## 📝 Writing New Tests + +### 1. Basic Test Structure + +```javascript +describe('New Routing Flow', () => { + let testData = {} + + beforeEach(() => { + cy.waitForService() + testData = { + merchantId: `merc_new_${Date.now()}`, + paymentId: `PAY_new_${Date.now()}` + } + }) + + afterEach(() => { + cy.cleanupTestData(testData.merchantId) + }) + + it('should test new routing logic', { tags: ['@new-feature'] }, () => { + // Test implementation + }) +}) +``` + +### 2. Using Test Data Factory + +```javascript +const TestDataFactory = require('../support/test-data-factory') + +it('should test with generated data', () => { + const merchantId = TestDataFactory.generateMerchantId() + const ruleConfig = TestDataFactory.getSuccessRateRuleConfig({ + successRate: 0.9 + }) + + cy.createMerchantAccount(merchantId) + .then(() => cy.createRoutingRule(merchantId, ruleConfig)) + .then(() => { + // Continue test + }) +}) +``` + +### 3. Adding New Custom Commands + +In `cypress/support/commands.js`: + +```javascript +Cypress.Commands.add('newCustomCommand', (parameters) => { + return cy.request({ + method: 'POST', + url: `${getApiBaseUrl()}/new-endpoint`, + body: parameters + }).then((response) => { + expect(response.status).to.eq(200) + return cy.wrap(response.body) + }) +}) +``` + +## 🔧 Extending for New Routing Logic + +To add tests for a new routing algorithm: + +### 1. Create New Test File +```bash +touch cypress/e2e/routing-flows/new-algorithm-routing.cy.js +``` + +### 2. Add Rule Configuration Helper +In `cypress/support/commands.js`: +```javascript +Cypress.Commands.add('createNewAlgorithmRule', (merchantId, options = {}) => { + const ruleConfig = { + type: "newAlgorithm", + data: { + // Algorithm specific configuration + } + } + return cy.createRoutingRule(merchantId, ruleConfig) +}) +``` + +### 3. Add Test Data Factory Methods +In `cypress/support/test-data-factory.js`: +```javascript +static getNewAlgorithmRuleConfig(options = {}) { + return { + type: "newAlgorithm", + data: { + // Default configuration + } + } +} +``` + +### 4. Update Package.json Scripts +```json +{ + "scripts": { + "test:new-algorithm": "cypress run --spec 'cypress/e2e/routing-flows/new-algorithm-routing.cy.js'" + } +} +``` + +## 🐛 Debugging + +### 1. Enable Debug Logs +```bash +DEBUG=cypress:* npm run cypress:run +``` + +### 2. Screenshots and Videos +- Screenshots are automatically taken on test failures +- Videos can be enabled in `cypress.config.js` + +### 3. Browser DevTools +When running in interactive mode, use browser DevTools to inspect network requests and responses. + +## 📈 Performance Testing + +The framework includes utilities for performance testing: + +```javascript +const performanceConfig = TestDataFactory.getPerformanceTestConfig() +const loadTestData = TestDataFactory.generateLoadTestData(100) + +// Use in tests for load testing scenarios +``` + +## 🚨 Best Practices + +1. **Use unique test data** - Always generate unique merchant IDs and payment IDs +2. **Clean up after tests** - Use `afterEach` hooks to clean up test data +3. **Wait for service readiness** - Always call `cy.waitForService()` in `beforeEach` +4. **Use descriptive test names** - Make test purposes clear from the name +5. **Tag tests appropriately** - Use tags for easy test filtering +6. **Verify responses** - Always validate API response structure and data +7. **Log important data** - Use `cy.log()` for debugging information + +## 🤝 Contributing + +When adding new tests: + +1. Follow the existing file structure and naming conventions +2. Add appropriate tags to new tests +3. Update this README if adding new features +4. Ensure tests are independent and can run in any order +5. Add test data factory methods for reusable test data + +--- + +**Happy Testing! 🎉** diff --git a/cypress/e2e/routing-flows/gateway-latency-scoring.cy.js b/cypress/e2e/routing-flows/gateway-latency-scoring.cy.js new file mode 100644 index 00000000..c2bb36da --- /dev/null +++ b/cypress/e2e/routing-flows/gateway-latency-scoring.cy.js @@ -0,0 +1,224 @@ +describe('Gateway Latency Scoring Flow', () => { + let testData = {} + + beforeEach(() => { + // Wait for service to be ready + cy.waitForService() + + // Generate unique test data for each test + testData = { + merchantId: `merc_${Date.now()}`, + paymentId: `PAY_${Date.now()}`, + customerId: `CUST${Date.now()}` + } + }) + + afterEach(() => { + // Clean up test data if needed + cy.cleanupTestData(testData.merchantId) + }) + + it('should create merchant account successfully', { tags: ['@merchant'] }, () => { + cy.createMerchantAccount(testData.merchantId).then((result) => { + expect(result.merchantId).to.equal(testData.merchantId) + expect(result.response).to.exist + }) + }) + + it('should create success rate routing rule successfully', { tags: ['@routing-rule'] }, () => { + cy.createMerchantAccount(testData.merchantId).then(() => { + return cy.createSuccessRateRule(testData.merchantId, { + latencyThreshold: 90, + successRate: 0.5, + bucketSize: 200, + hedgingPercent: 5, + gatewayLatency: 5000 + }) + }).then((result) => { + expect(result.ruleConfig).to.have.property('type', 'successRate') + expect(result.ruleConfig.data).to.have.property('defaultLatencyThreshold', 90) + expect(result.ruleConfig.data).to.have.property('defaultSuccessRate', 0.5) + expect(result.response).to.exist + }) + }) + + it('should decide gateway successfully', { tags: ['@gateway-decision'] }, () => { + cy.createMerchantAccount(testData.merchantId).then(() => { + return cy.createSuccessRateRule(testData.merchantId) + }).then(() => { + return cy.decideGateway({ + merchantId: testData.merchantId, + eligibleGatewayList: ["GatewayA", "GatewayB", "GatewayC"], + rankingAlgorithm: "SR_BASED_ROUTING", + eliminationEnabled: true, + paymentInfo: { + paymentId: testData.paymentId, + amount: 100.50, + currency: "USD", + customerId: testData.customerId, + paymentMethodType: "UPI", + paymentMethod: "UPI_PAY" + } + }) + }).then((result) => { + expect(result.response).to.haveValidGatewayResponse() + expect(result.response.decided_gateway).to.be.oneOf(["GatewayA", "GatewayB", "GatewayC"]) + }) + }) + + it('should update gateway score successfully', { tags: ['@score-update'] }, () => { + let selectedGateway + + cy.createMerchantAccount(testData.merchantId).then(() => { + return cy.createSuccessRateRule(testData.merchantId) + }).then(() => { + return cy.decideGateway({ + merchantId: testData.merchantId, + paymentInfo: { + paymentId: testData.paymentId + } + }) + }).then((result) => { + selectedGateway = result.response.decided_gateway + return cy.updateGatewayScore({ + merchantId: testData.merchantId, + gateway: selectedGateway, + paymentId: testData.paymentId, + status: "AUTHORIZED", + txnLatency: { + gatewayLatency: 6000 + } + }) + }).then((result) => { + expect(result.response).to.haveValidScoreUpdate() + }) + }) + + it('should show different gateway selection after score update', { tags: ['@score-impact'] }, () => { + let initialGateway, updatedGateway, initialGatewayScore, initialGatewayCurrentScore + + cy.createMerchantAccount(testData.merchantId).then(() => { + return cy.createEliminationRule(testData.merchantId, { + gatewayLatency: 3000 // Lower threshold to make latency impact more visible + }) + }).then(() => { + // First gateway decision + return cy.decideGateway({ + merchantId: testData.merchantId, + paymentInfo: { + paymentId: testData.paymentId + } + }) + }).then((result) => { + initialGateway = result.response.decided_gateway + initialGatewayScore = result.response.gateway_priority_map[initialGateway] + + // Update score with high latency + return cy.updateGatewayScore({ + merchantId: testData.merchantId, + gateway: initialGateway, + paymentId: testData.paymentId, + status: "AUTHORIZED", + txnLatency: { + gatewayLatency: 8000 // High latency to impact scoring + } + }) + }).then(() => { + // Second gateway decision to see if scoring changed + return cy.decideGateway({ + merchantId: testData.merchantId, + eliminationEnabled: true, + paymentInfo: { + paymentId: `PAY_${Date.now()}_2` // Different payment ID + } + }) + }).then((result) => { + initialGatewayCurrentScore = result.response.gateway_priority_map[initialGateway] + updatedGateway = result.response.decided_gateway + + // Log both gateways for comparison + cy.log(`Initial Gateway: ${initialGateway}`) + cy.log(`Updated Gateway: ${updatedGateway}`) + + expect(updatedGateway).to.not.equal(initialGateway); + expect(initialGatewayCurrentScore).to.be.lessThan(initialGatewayScore); + }) + }) + + it('should handle different payment methods', { tags: ['@payment-methods'] }, () => { + const paymentMethods = [ + { type: "UPI", method: "UPI_PAY" }, + { type: "upi", method: "upi_collect" }, + { type: "CARD", method: "CARD_PAY" } + ] + + cy.createMerchantAccount(testData.merchantId).then(() => { + return cy.createSuccessRateRule(testData.merchantId) + }).then(() => { + // Test each payment method + paymentMethods.forEach((paymentMethod, index) => { + cy.decideGateway({ + merchantId: testData.merchantId, + paymentInfo: { + paymentId: `${testData.paymentId}_${index}`, + paymentMethodType: paymentMethod.type, + paymentMethod: paymentMethod.method + } + }).then((result) => { + expect(result.response).to.haveValidGatewayResponse() + cy.log(`Payment Method ${paymentMethod.type}/${paymentMethod.method}: Gateway ${result.response.decided_gateway}`) + }) + }) + }) + }) + + it('legacy api: should show different gateway selection after score update', { tags: ['@score-impact'] }, () => { + let initialGateway, updatedGateway, initialGatewayScore, initialGatewayCurrentScore + + cy.createMerchantAccount(testData.merchantId).then(() => { + return cy.createSuccessRateRule(testData.merchantId, { + gatewayLatency: 3000 // Lower threshold to make latency impact more visible + }) + }).then(() => { + // First gateway decision + return cy.decideGatewayLegacy({ + merchantId: testData.merchantId, + paymentInfo: { + paymentId: testData.paymentId + } + }) + }).then((result) => { + initialGateway = result.response.decided_gateway + initialGatewayScore = result.response.gateway_priority_map[initialGateway] + + // Update score with high latency + return cy.updateGatewayScore({ + merchantId: testData.merchantId, + gateway: initialGateway, + paymentId: testData.paymentId, + status: "AUTHORIZED", + txnLatency: { + gatewayLatency: 8000 // High latency to impact scoring + } + }) + }).then(() => { + // Second gateway decision to see if scoring changed + return cy.decideGateway({ + merchantId: testData.merchantId, + paymentInfo: { + paymentId: `PAY_${Date.now()}_2` // Different payment ID + } + }) + }).then((result) => { + initialGatewayCurrentScore = result.response.gateway_priority_map[initialGateway] + updatedGateway = result.response.decided_gateway + + // Log both gateways for comparison + cy.log(`Initial Gateway: ${initialGateway}`) + cy.log(`Updated Gateway: ${updatedGateway}`) + + expect(updatedGateway).to.not.equal(initialGateway); + expect(initialGatewayCurrentScore).to.be.lessThan(initialGatewayScore); + }) + }) +}) diff --git a/cypress/e2e/routing-flows/success-rate-routing.cy.js b/cypress/e2e/routing-flows/success-rate-routing.cy.js new file mode 100644 index 00000000..837bc698 --- /dev/null +++ b/cypress/e2e/routing-flows/success-rate-routing.cy.js @@ -0,0 +1,244 @@ +describe('Success Rate Routing Flow', () => { + let testData = {} + + beforeEach(() => { + cy.waitForService() + + testData = { + merchantId: `merc_sr_${Date.now()}`, + paymentId: `PAY_SR_${Date.now()}`, + customerId: `CUST_SR_${Date.now()}` + } + }) + + afterEach(() => { + cy.cleanupTestData(testData.merchantId) + }) + + it('should test success rate based routing', { tags: ['@success-rate', '@routing'] }, () => { + cy.createMerchantAccount(testData.merchantId).then(() => { + return cy.createSuccessRateRule(testData.merchantId, { + successRate: 0.8, + latencyThreshold: 100, + bucketSize: 300, + hedgingPercent: 10 + }) + }).then(() => { + // Define multiple transactions to simulate real-world scenario + const transactions = [ + { paymentId: `${testData.paymentId}_txn_1`, status: "AUTHORIZED", latency: 2000 }, + { paymentId: `${testData.paymentId}_txn_2`, status: "FAILURE", latency: 5000 }, + { paymentId: `${testData.paymentId}_txn_3`, status: "AUTHORIZED", latency: 1500 }, + { paymentId: `${testData.paymentId}_txn_4`, status: "AUTHORIZED", latency: 3000 }, + { paymentId: `${testData.paymentId}_txn_5`, status: "FAILURE", latency: 4500 }, + { paymentId: `${testData.paymentId}_txn_6`, status: "AUTHORIZED", latency: 2500 } + ] + + // Store gateway decisions for each transaction + const gatewayDecisions = [] + + // Process each transaction: decide gateway first, then update score + const processTransaction = (txn, index) => { + return cy.decideGateway({ + merchantId: testData.merchantId, + rankingAlgorithm: "SR_BASED_ROUTING", + paymentInfo: { + paymentId: txn.paymentId, + paymentMethodType: "UPI", + paymentMethod: "UPI_PAY", + customerId: `${testData.customerId}_${index}` + } + }).then((decisionResult) => { + expect(decisionResult.response).to.haveValidGatewayResponse() + + // Store the gateway decision + gatewayDecisions.push({ + paymentId: txn.paymentId, + gateway: decisionResult.response.decided_gateway, + gateway_priority_map: decisionResult.response.gateway_priority_map, + status: txn.status, + latency: txn.latency + }) + + cy.log(`Transaction ${index + 1}: Payment ${txn.paymentId} routed to ${decisionResult.response.decided_gateway}`) + + // Update gateway score only once per transaction + return cy.updateGatewayScore({ + merchantId: testData.merchantId, + gateway: decisionResult.response.decided_gateway, + paymentId: txn.paymentId, + status: txn.status, + txnLatency: { + gatewayLatency: txn.latency + } + }).then((updateResult) => { + expect(updateResult.response).to.haveValidScoreUpdate() + cy.log(`Score updated for ${txn.paymentId}: ${txn.status} with ${txn.latency}ms latency`) + return cy.wrap(decisionResult.response.decided_gateway) + }) + }) + } + + // Process transactions sequentially to ensure proper ordering + let chain = cy.wrap(null) + transactions.forEach((txn, index) => { + chain = chain.then(() => processTransaction(txn, index)) + }) + + return chain.then(() => { + // Verify that we have decisions for all transactions + expect(gatewayDecisions).to.have.length(transactions.length) + + // Log summary of gateway selections + const gatewaySummary = gatewayDecisions.reduce((acc, decision) => { + acc[decision.gateway] = (acc[decision.gateway] || 0) + 1 + return acc + }, {}) + cy.log('Gateway Decision', gatewayDecisions) + cy.log('Gateway Selection Summary:', gatewaySummary) + + // Test routing behavior after score updates by making additional decisions + return cy.decideGateway({ + merchantId: testData.merchantId, + rankingAlgorithm: "SR_BASED_ROUTING", + paymentInfo: { + paymentId: `${testData.paymentId}_final_test`, + paymentMethodType: "UPI", + paymentMethod: "UPI_PAY", + customerId: `${testData.customerId}_final` + } + }).then((finalResult) => { + expect(finalResult.response).to.haveValidGatewayResponse() + cy.log(`Final routing decision after score updates: ${finalResult.response.decided_gateway}`) + + // Verify that routing is influenced by the success rate data + // The gateway with better success rate should be preferred + const successfulGateways = gatewayDecisions + .filter(d => d.status === "AUTHORIZED") + .map(d => d.gateway) + + if (successfulGateways.length > 0) { + cy.log('Gateways with successful transactions:', [...new Set(successfulGateways)]) + } + }) + }) + }) + }) + + it('should handle multiple gateways with different success rates', { tags: ['@success-rate', '@multiple-gateways'] }, () => { + const merchantId = `${testData.merchantId}_multi_gw` + + cy.createMerchantAccount(merchantId).then(() => { + return cy.createSuccessRateRule(merchantId, { + successRate: 0.7, + latencyThreshold: 100, + bucketSize: 200, + hedgingPercent: 5 + }) + }).then(() => { + // Simulate transactions across multiple gateways with different success patterns + const gatewayTransactions = [ + // GatewayA - Good performance + { paymentId: `${testData.paymentId}_gwa_1`, gateway: 'GatewayA', status: "AUTHORIZED", latency: 1500 }, + { paymentId: `${testData.paymentId}_gwa_2`, gateway: 'GatewayA', status: "AUTHORIZED", latency: 1800 }, + { paymentId: `${testData.paymentId}_gwa_3`, gateway: 'GatewayA', status: "AUTHORIZED", latency: 1600 }, + + // GatewayB - Mixed performance + { paymentId: `${testData.paymentId}_gwb_1`, gateway: 'GatewayB', status: "AUTHORIZED", latency: 2500 }, + { paymentId: `${testData.paymentId}_gwb_2`, gateway: 'GatewayB', status: "FAILURE", latency: 4000 }, + { paymentId: `${testData.paymentId}_gwb_3`, gateway: 'GatewayB', status: "AUTHORIZED", latency: 2200 }, + + // GatewayC - Poor performance + { paymentId: `${testData.paymentId}_gwc_1`, gateway: 'GatewayC', status: "FAILURE", latency: 5000 }, + { paymentId: `${testData.paymentId}_gwc_2`, gateway: 'GatewayC', status: "FAILURE", latency: 4500 }, + { paymentId: `${testData.paymentId}_gwc_3`, gateway: 'GatewayC', status: "AUTHORIZED", latency: 3000 } + ] + + // Process each transaction: decide gateway first, then update score once + let chain = cy.wrap(null) + + gatewayTransactions.forEach((txn, index) => { + chain = chain.then(() => { + // First decide gateway for this transaction + return cy.decideGateway({ + merchantId: merchantId, + rankingAlgorithm: "SR_BASED_ROUTING", + eligibleGatewayList: ['GatewayA', 'GatewayB', 'GatewayC'], + paymentInfo: { + paymentId: txn.paymentId, + paymentMethodType: "UPI", + paymentMethod: "UPI_PAY", + customerId: `${testData.customerId}_multi_${index}` + } + }).then((decisionResult) => { + expect(decisionResult.response).to.haveValidGatewayResponse() + + const decidedGateway = decisionResult.response.decided_gateway + cy.log(`Transaction ${index + 1}: ${txn.paymentId} routed to ${decidedGateway}`) + + // Update score only once per transaction using the decided gateway + return cy.updateGatewayScore({ + merchantId: merchantId, + gateway: decidedGateway, + paymentId: txn.paymentId, + status: txn.status, + txnLatency: { + gatewayLatency: txn.latency + } + }).then((updateResult) => { + expect(updateResult.response).to.haveValidScoreUpdate() + cy.log(`Score updated for ${txn.paymentId}: ${txn.status} (${txn.latency}ms) on ${decidedGateway}`) + return cy.wrap({ decidedGateway, originalGateway: txn.gateway, status: txn.status }) + }) + }) + }) + }) + + return chain.then(() => { + // After all score updates, test final routing decisions + const finalTests = Array.from({ length: 3 }, (_, i) => ({ + paymentId: `${testData.paymentId}_final_${i}`, + customerId: `${testData.customerId}_final_${i}` + })) + + let finalChain = cy.wrap(null) + const finalDecisions = [] + + finalTests.forEach((test, index) => { + finalChain = finalChain.then(() => { + return cy.decideGateway({ + merchantId: merchantId, + rankingAlgorithm: "SR_BASED_ROUTING", + eligibleGatewayList: ['GatewayA', 'GatewayB', 'GatewayC'], + paymentInfo: { + paymentId: test.paymentId, + paymentMethodType: "UPI", + paymentMethod: "UPI_PAY", + customerId: test.customerId + } + }).then((finalResult) => { + expect(finalResult.response).to.haveValidGatewayResponse() + finalDecisions.push(finalResult.response.decided_gateway) + cy.log(`Final decision ${index + 1}: ${test.paymentId} → ${finalResult.response.decided_gateway}`) + return cy.wrap(finalResult.response.decided_gateway) + }) + }) + }) + + return finalChain.then(() => { + // Log summary of final routing decisions + const finalSummary = finalDecisions.reduce((acc, gateway) => { + acc[gateway] = (acc[gateway] || 0) + 1 + return acc + }, {}) + + cy.log('Final Routing Summary after score updates:', finalSummary) + + // Verify that routing is influenced by success rate data + expect(finalDecisions).to.have.length(3) + cy.log('All final routing decisions completed successfully') + }) + }) + }) + }) +}) diff --git a/cypress/support/commands.js b/cypress/support/commands.js new file mode 100644 index 00000000..f82b5117 --- /dev/null +++ b/cypress/support/commands.js @@ -0,0 +1,292 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** + +const { v4: uuidv4 } = require('uuid') + +// Helper function to generate unique IDs +function generateUniqueId(prefix = '') { + const timestamp = Date.now() + const random = Math.floor(Math.random() * 1000) + return `${prefix}${timestamp}${random}` +} + +// Helper function to get API base URL +function getApiBaseUrl() { + return Cypress.env('API_BASE_URL') || 'http://localhost:8082' +} + +/** + * Create a merchant account + * @param {string} merchantId - Optional merchant ID, will generate if not provided + */ +Cypress.Commands.add('createMerchantAccount', (merchantId = null) => { + const id = merchantId || generateUniqueId(Cypress.env('DEFAULT_MERCHANT_ID_PREFIX')) + + return cy.request({ + method: 'POST', + url: `${getApiBaseUrl()}/merchant-account/create`, + headers: { + 'Content-Type': 'application/json' + }, + body: { + merchant_id: id + } + }).then((response) => { + expect(response.status).to.eq(200) + return cy.wrap({ merchantId: id, response: response.body }) + }) +}) + +/** + * Create a routing rule + * @param {string} merchantId - Merchant ID + * @param {object} ruleConfig - Rule configuration object + */ +Cypress.Commands.add('createRoutingRule', (merchantId, ruleConfig) => { + const defaultConfig = { + type: "successRate", + data: { + defaultLatencyThreshold: 90, + defaultSuccessRate: 0.5, + defaultBucketSize: 200, + defaultHedgingPercent: 5, + txnLatency: { + gatewayLatency: 5000 + }, + subLevelInputConfig: [ + { + paymentMethodType: "upi", + paymentMethod: "upi_collect", + bucketSize: 250, + hedgingPercent: 1 + } + ] + } + } + + const config = { ...defaultConfig, ...ruleConfig } + + return cy.request({ + method: 'POST', + url: `${getApiBaseUrl()}/rule/create`, + headers: { + 'Content-Type': 'application/json' + }, + body: { + merchant_id: merchantId, + config: config + } + }).then((response) => { + expect(response.status).to.eq(200) + return cy.wrap({ ruleConfig: config, response: response.body }) + }) +}) + +/** + * Decide gateway for a payment + * @param {object} decisionRequest - Gateway decision request object + */ +Cypress.Commands.add('decideGateway', (decisionRequest) => { + const request = { + merchantId: decisionRequest.merchantId || generateUniqueId(Cypress.env('DEFAULT_MERCHANT_ID_PREFIX')), + eligibleGatewayList: decisionRequest.eligibleGatewayList || Cypress.env('DEFAULT_GATEWAYS'), + rankingAlgorithm: decisionRequest.rankingAlgorithm || Cypress.env('ROUTING_ALGORITHMS').SUCCESS_RATE, + eliminationEnabled: decisionRequest.eliminationEnabled || true, + paymentInfo: { + paymentId: decisionRequest.paymentInfo.paymentId || generateUniqueId(Cypress.env('DEFAULT_PAYMENT_ID_PREFIX')), + amount: decisionRequest.paymentInfo.amount || 100.50, + currency: decisionRequest.paymentInfo.currency || 'USD', + customerId: decisionRequest.paymentInfo.customerId || generateUniqueId(Cypress.env('DEFAULT_CUSTOMER_ID_PREFIX') || 'CUST'), + udfs: decisionRequest.paymentInfo.udfs || null, + preferredGateway: decisionRequest.paymentInfo.preferredGateway || null, + paymentType: decisionRequest.paymentInfo.paymentType || "ORDER_PAYMENT", + metadata: decisionRequest.paymentInfo.metadata || null, + internalMetadata: decisionRequest.paymentInfo.internalMetadata || null, + isEmi: decisionRequest.paymentInfo.isEmi || false, + emiBank: decisionRequest.paymentInfo.emiBank || null, + emiTenure: decisionRequest.paymentInfo.emiTenure || null, + paymentMethodType: decisionRequest.paymentInfo.paymentMethodType || Cypress.env('PAYMENT_METHODS').UPI.type, + paymentMethod: decisionRequest.paymentInfo.paymentMethod || Cypress.env('PAYMENT_METHODS').UPI.method, + paymentSource: decisionRequest.paymentInfo.paymentSource || null, + authType: decisionRequest.paymentInfo.authType || null, + cardIssuerBankName: decisionRequest.paymentInfo.cardIssuerBankName || null, + cardIsin: decisionRequest.paymentInfo.cardIsin || null, + cardType: decisionRequest.paymentInfo.cardType || null, + cardSwitchProvider: decisionRequest.paymentInfo.cardSwitchProvider || null + } + } + + return cy.request({ + method: 'POST', + url: `${getApiBaseUrl()}/decide-gateway`, + headers: { + 'Content-Type': 'application/json' + }, + body: request + }).then((response) => { + expect(response.status).to.eq(200) + return cy.wrap({ request, response: response.body }) + }) +}) + +/** + * Legacy Decide gateway for a payment + * @param {object} decisionRequest - Gateway decision request object + */ +Cypress.Commands.add('decideGatewayLegacy', (decisionRequest) => { + const request = { + merchantId: decisionRequest.merchantId || generateUniqueId(Cypress.env('DEFAULT_MERCHANT_ID_PREFIX')), + eligibleGatewayList: decisionRequest.eligibleGatewayList || Cypress.env('DEFAULT_GATEWAYS'), + rankingAlgorithm: decisionRequest.rankingAlgorithm || Cypress.env('ROUTING_ALGORITHMS').SUCCESS_RATE, + eliminationEnabled: decisionRequest.eliminationEnabled || true, + paymentInfo: { + paymentId: decisionRequest.paymentInfo.paymentId || generateUniqueId(Cypress.env('DEFAULT_PAYMENT_ID_PREFIX')), + amount: decisionRequest.paymentInfo.amount || 100.50, + currency: decisionRequest.paymentInfo.currency || 'USD', + customerId: decisionRequest.paymentInfo.customerId || generateUniqueId(Cypress.env('DEFAULT_CUSTOMER_ID_PREFIX') || 'CUST'), + udfs: decisionRequest.paymentInfo.udfs || null, + preferredGateway: decisionRequest.paymentInfo.preferredGateway || null, + paymentType: decisionRequest.paymentInfo.paymentType || "ORDER_PAYMENT", + metadata: decisionRequest.paymentInfo.metadata || null, + internalMetadata: decisionRequest.paymentInfo.internalMetadata || null, + isEmi: decisionRequest.paymentInfo.isEmi || false, + emiBank: decisionRequest.paymentInfo.emiBank || null, + emiTenure: decisionRequest.paymentInfo.emiTenure || null, + paymentMethodType: decisionRequest.paymentInfo.paymentMethodType || Cypress.env('PAYMENT_METHODS').UPI.type, + paymentMethod: decisionRequest.paymentInfo.paymentMethod || Cypress.env('PAYMENT_METHODS').UPI.method, + paymentSource: decisionRequest.paymentInfo.paymentSource || null, + authType: decisionRequest.paymentInfo.authType || null, + cardIssuerBankName: decisionRequest.paymentInfo.cardIssuerBankName || null, + cardIsin: decisionRequest.paymentInfo.cardIsin || null, + cardType: decisionRequest.paymentInfo.cardType || null, + cardSwitchProvider: decisionRequest.paymentInfo.cardSwitchProvider || null + } + } + + return cy.request({ + method: 'POST', + url: `${getApiBaseUrl()}/decision_gateway`, + headers: { + 'Content-Type': 'application/json' + }, + body: request + }).then((response) => { + expect(response.status).to.eq(200) + return cy.wrap({ request, response: response.body }) + }) +}) + +/** + * Update gateway score + * @param {object} scoreUpdate - Score update object + */ +Cypress.Commands.add('updateGatewayScore', (scoreUpdate) => { + const defaultUpdate = { + merchantId: scoreUpdate.merchantId || generateUniqueId(Cypress.env('DEFAULT_MERCHANT_ID_PREFIX')), + gateway: scoreUpdate.gateway || "GatewayC", + gatewayReferenceId: scoreUpdate.gatewayReferenceId || null, + status: scoreUpdate.status || "AUTHORIZED", + paymentId: scoreUpdate.paymentId || generateUniqueId(Cypress.env('DEFAULT_PAYMENT_ID_PREFIX')), + enforceDynamicRoutingFailure: null, + txnLatency: scoreUpdate.txnLatency.gatewayLatency || { + gatewayLatency: 6000 + } + } + + const update = { ...defaultUpdate, ...scoreUpdate } + + return cy.request({ + method: 'POST', + url: `${getApiBaseUrl()}/update-gateway-score`, + headers: { + 'Content-Type': 'application/json' + }, + body: update + }).then((response) => { + expect(response.status).to.eq(200) + return cy.wrap({ update, response: response.body }) + }) +}) + +/** + * Create a success rate routing rule + * @param {string} merchantId - Merchant ID + * @param {object} options - Configuration options + */ +Cypress.Commands.add('createSuccessRateRule', (merchantId, options = {}) => { + const ruleConfig = { + type: "successRate", + data: { + defaultLatencyThreshold: options.latencyThreshold || 90, + defaultSuccessRate: options.successRate || 0.5, + defaultBucketSize: options.bucketSize || 200, + defaultHedgingPercent: options.hedgingPercent || 5, + txnLatency: { + gatewayLatency: options.gatewayLatency || 5000 + }, + subLevelInputConfig: options.subLevelConfig || [ + { + paymentMethodType: "upi", + paymentMethod: "upi_collect", + bucketSize: 250, + hedgingPercent: 1 + } + ] + } + } + + return cy.createRoutingRule(merchantId, ruleConfig) +}) + +/** + * Create a elimination routing rule + * @param {string} merchantId - Merchant ID + * @param {object} options - Configuration options + */ +Cypress.Commands.add('createEliminationRule', (merchantId, options = {}) => { + const ruleConfig = { + type: "elimination", + data: { + threshold: 0.35, + txnLatency: { + gatewayLatency: options.gatewayLatency || 5000 + } + } + } + + return cy.createRoutingRule(merchantId, ruleConfig) +}) + +/** + * Wait for service to be ready + */ +Cypress.Commands.add('waitForService', () => { + return cy.request({ + method: 'GET', + url: `${getApiBaseUrl()}/health`, + failOnStatusCode: false, + timeout: 30000 + }).then((response) => { + if (response.status !== 200) { + cy.wait(2000) + cy.waitForService() + } + }) +}) + +/** + * Clean up test data (if cleanup endpoints exist) + * @param {string} merchantId - Merchant ID to clean up + */ +Cypress.Commands.add('cleanupTestData', (merchantId) => { + // This would depend on cleanup endpoints being available + // For now, just log the cleanup attempt + cy.log(`Cleaning up test data for merchant: ${merchantId}`) +}) diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js new file mode 100644 index 00000000..f6028f4c --- /dev/null +++ b/cypress/support/e2e.js @@ -0,0 +1,46 @@ +// *********************************************************** +// This example support/e2e.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' +import '@cypress/grep/src/support' + +// Alternatively you can use CommonJS syntax: +// require('./commands') + +// Global configuration +Cypress.on('uncaught:exception', (err, runnable) => { + // returning false here prevents Cypress from + // failing the test on uncaught exceptions + return false +}) + +// Add custom assertions +chai.use(function (chai, utils) { + chai.Assertion.addMethod('haveValidGatewayResponse', function () { + const obj = this._obj + + expect(obj).to.have.property('decided_gateway') + expect(obj).to.have.property('gateway_priority_map') + expect(obj.gateway_priority_map).to.be.an('object') + }) + + chai.Assertion.addMethod('haveValidScoreUpdate', function () { + const obj = this._obj + + expect(obj).to.have.property('message') + expect(obj.message).to.equal('Success') + }) +}) diff --git a/cypress/support/test-data-factory.js b/cypress/support/test-data-factory.js new file mode 100644 index 00000000..cd37486d --- /dev/null +++ b/cypress/support/test-data-factory.js @@ -0,0 +1,220 @@ +// Test Data Factory for Decision Engine Tests +// This file provides utilities to generate test data for different routing scenarios + +const { v4: uuidv4 } = require('uuid') + +class TestDataFactory { + static generateMerchantId(prefix = 'merc_test_') { + return `${prefix}${Date.now()}_${Math.floor(Math.random() * 1000)}` + } + + static generatePaymentId(prefix = 'PAY_test_') { + return `${prefix}${Date.now()}_${Math.floor(Math.random() * 1000)}` + } + + static generateCustomerId(prefix = 'CUST_test_') { + return `${prefix}${Date.now()}_${Math.floor(Math.random() * 1000)}` + } + + // Success Rate Rule Configurations + static getSuccessRateRuleConfig(options = {}) { + return { + type: "successRate", + data: { + defaultLatencyThreshold: options.latencyThreshold || 90, + defaultSuccessRate: options.successRate || 0.5, + defaultBucketSize: options.bucketSize || 200, + defaultHedgingPercent: options.hedgingPercent || 5, + txnLatency: { + gatewayLatency: options.gatewayLatency || 5000 + }, + subLevelInputConfig: options.subLevelConfig || [ + { + paymentMethodType: "upi", + paymentMethod: "upi_collect", + bucketSize: 250, + hedgingPercent: 1 + } + ] + } + } + } + + // Payment Latency Rule Configurations + static getPaymentLatencyRuleConfig(options = {}) { + return { + type: "paymentLatency", + data: { + defaultLatencyThreshold: options.latencyThreshold || 90, + defaultBucketSize: options.bucketSize || 200, + defaultHedgingPercent: options.hedgingPercent || 5, + txnLatency: { + gatewayLatency: options.gatewayLatency || 3000, + paymentLatency: options.paymentLatency || 5000 + }, + subLevelInputConfig: options.subLevelConfig || [] + } + } + } + + // Cost Based Rule Configurations (if supported) + static getCostBasedRuleConfig(options = {}) { + return { + type: "costBased", + data: { + defaultCostThreshold: options.costThreshold || 2.5, + defaultBucketSize: options.bucketSize || 200, + defaultHedgingPercent: options.hedgingPercent || 5, + costConfig: { + baseCost: options.baseCost || 1.0, + variableCost: options.variableCost || 0.5 + }, + subLevelInputConfig: options.subLevelConfig || [] + } + } + } + + // Payment Info Configurations + static getPaymentInfo(options = {}) { + return { + paymentId: options.paymentId || this.generatePaymentId(), + amount: options.amount || 100.50, + currency: options.currency || "USD", + customerId: options.customerId || this.generateCustomerId(), + udfs: options.udfs || null, + preferredGateway: options.preferredGateway || null, + paymentType: options.paymentType || "ORDER_PAYMENT", + metadata: options.metadata || null, + internalMetadata: options.internalMetadata || null, + isEmi: options.isEmi || false, + emiBank: options.emiBank || null, + emiTenure: options.emiTenure || null, + paymentMethodType: options.paymentMethodType || "UPI", + paymentMethod: options.paymentMethod || "UPI_PAY", + paymentSource: options.paymentSource || null, + authType: options.authType || null, + cardIssuerBankName: options.cardIssuerBankName || null, + cardIsin: options.cardIsin || null, + cardType: options.cardType || null, + cardSwitchProvider: options.cardSwitchProvider || null + } + } + + // Gateway Decision Request + static getGatewayDecisionRequest(options = {}) { + return { + merchantId: options.merchantId || this.generateMerchantId(), + eligibleGatewayList: options.eligibleGatewayList || ["GatewayA", "GatewayB", "GatewayC"], + rankingAlgorithm: options.rankingAlgorithm || "SR_BASED_ROUTING", + eliminationEnabled: options.eliminationEnabled !== undefined ? options.eliminationEnabled : true, + paymentInfo: this.getPaymentInfo(options.paymentInfo || {}) + } + } + + // Score Update Request + static getScoreUpdateRequest(options = {}) { + return { + merchantId: options.merchantId || this.generateMerchantId(), + gateway: options.gateway || "GatewayA", + gatewayReferenceId: options.gatewayReferenceId || null, + status: options.status || "AUTHORIZED", + paymentId: options.paymentId || this.generatePaymentId(), + enforceDynamicRoutingFailure: options.enforceDynamicRoutingFailure || null, + txnLatency: { + gatewayLatency: options.gatewayLatency || 3000, + paymentLatency: options.paymentLatency || 4000, + ...options.txnLatency + } + } + } + + // Test Scenarios + static getLatencyTestScenarios() { + return [ + { name: "Low Latency", gatewayLatency: 1000, paymentLatency: 1500, status: "AUTHORIZED" }, + { name: "Medium Latency", gatewayLatency: 3000, paymentLatency: 4000, status: "AUTHORIZED" }, + { name: "High Latency", gatewayLatency: 6000, paymentLatency: 8000, status: "AUTHORIZED" }, + { name: "Failed Transaction", gatewayLatency: 2000, paymentLatency: 3000, status: "FAILED" }, + { name: "Timeout", gatewayLatency: 10000, paymentLatency: 12000, status: "TIMEOUT" } + ] + } + + static getSuccessRateTestScenarios() { + return [ + { name: "High Success", transactions: Array(8).fill("AUTHORIZED").concat(Array(2).fill("FAILED")) }, + { name: "Medium Success", transactions: Array(6).fill("AUTHORIZED").concat(Array(4).fill("FAILED")) }, + { name: "Low Success", transactions: Array(3).fill("AUTHORIZED").concat(Array(7).fill("FAILED")) }, + { name: "All Success", transactions: Array(10).fill("AUTHORIZED") }, + { name: "All Failed", transactions: Array(10).fill("FAILED") } + ] + } + + static getPaymentMethodTestCases() { + return [ + { type: "UPI", method: "UPI_PAY", description: "UPI Payment" }, + { type: "upi", method: "upi_collect", description: "UPI Collect" }, + { type: "CARD", method: "CARD_PAY", description: "Card Payment" }, + { type: "NETBANKING", method: "NETBANKING_PAY", description: "Net Banking" }, + { type: "WALLET", method: "WALLET_PAY", description: "Wallet Payment" } + ] + } + + static getRoutingAlgorithmTestCases() { + return [ + { algorithm: "SR_BASED_ROUTING", description: "Success Rate Based Routing" }, + { algorithm: "PL_BASED_ROUTING", description: "Payment Latency Based Routing" }, + { algorithm: "COST_BASED_ROUTING", description: "Cost Based Routing" } + ] + } + + // Edge Case Scenarios + static getEdgeCaseScenarios() { + return { + extremeLatency: { + gatewayLatency: 30000, + paymentLatency: 45000, + status: "TIMEOUT" + }, + zeroLatency: { + gatewayLatency: 0, + paymentLatency: 0, + status: "AUTHORIZED" + }, + negativeAmount: { + amount: -100, + currency: "USD" + }, + largeAmount: { + amount: 999999.99, + currency: "USD" + }, + invalidCurrency: { + amount: 100, + currency: "INVALID" + } + } + } + + // Load Testing Data + static generateLoadTestData(count = 100) { + return Array.from({ length: count }, (_, index) => ({ + merchantId: this.generateMerchantId(`load_test_${index}_`), + paymentId: this.generatePaymentId(`load_pay_${index}_`), + customerId: this.generateCustomerId(`load_cust_${index}_`), + amount: Math.floor(Math.random() * 1000) + 1, + latency: Math.floor(Math.random() * 5000) + 500 + })) + } + + // Performance Test Configurations + static getPerformanceTestConfig() { + return { + concurrentUsers: [1, 5, 10, 20, 50], + requestsPerSecond: [1, 5, 10, 25, 50], + testDuration: [30, 60, 120, 300], // seconds + latencyThresholds: [1000, 2000, 3000, 5000] // milliseconds + } + } +} + +module.exports = TestDataFactory diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..e8dcadc4 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3152 @@ +{ + "name": "decision-engine-cypress-tests", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "decision-engine-cypress-tests", + "version": "1.0.0", + "dependencies": { + "uuid": "^9.0.1" + }, + "devDependencies": { + "@cypress/grep": "^4.0.1", + "cypress": "^13.6.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.0.tgz", + "integrity": "sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.0.tgz", + "integrity": "sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.0", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.27.3", + "@babel/helpers": "^7.27.6", + "@babel/parser": "^7.28.0", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.0", + "@babel/types": "^7.28.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.0.tgz", + "integrity": "sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.28.0", + "@babel/types": "^7.28.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz", + "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.27.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.2.tgz", + "integrity": "sha512-/V9771t+EgXz62aCcyofnQhGM8DQACbRhvzKFsXKC9QM+5MadF8ZmIm0crDMaz3+o0h0zXfJnd4EhbYbxsrcFw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.0.tgz", + "integrity": "sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", + "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.0.tgz", + "integrity": "sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.0", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.2.tgz", + "integrity": "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@cypress/grep": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cypress/grep/-/grep-4.1.0.tgz", + "integrity": "sha512-yUscMiUgM28VDPrNxL19/BhgHZOVrAPrzVsuEcy6mqPqDYt8H8fIaHeeGQPW4CbMu/ry9sehjH561WDDBIXOIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4", + "find-test-names": "^1.28.18", + "globby": "^11.0.4" + }, + "peerDependencies": { + "cypress": ">=10" + } + }, + "node_modules/@cypress/request": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.9.tgz", + "integrity": "sha512-I3l7FdGRXluAS44/0NguwWlO83J18p0vlr2FYHrJkWdNYhgVoiYo61IXPqaOsL+vNxU1ZqMACzItGK3/KKDsdw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~4.0.4", + "http-signature": "~1.4.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "performance-now": "^2.1.0", + "qs": "6.14.0", + "safe-buffer": "^5.1.2", + "tough-cookie": "^5.0.0", + "tunnel-agent": "^0.6.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@cypress/request/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@cypress/xvfb": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", + "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.1.0", + "lodash.once": "^4.1.1" + } + }, + "node_modules/@cypress/xvfb/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.12", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz", + "integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", + "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.29", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz", + "integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/node": { + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", + "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "undici-types": "~7.8.0" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", + "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/sizzle": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.9.tgz", + "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/arch": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/blob-util": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", + "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.25.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.1.tgz", + "integrity": "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001726", + "electron-to-chromium": "^1.5.173", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/cachedir": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", + "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001731", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz", + "integrity": "sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0", + "peer": true + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/check-more-types": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ci-info": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.0.tgz", + "integrity": "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/common-tags": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", + "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cypress": { + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.17.0.tgz", + "integrity": "sha512-5xWkaPurwkIljojFidhw8lFScyxhtiFHl/i/3zov+1Z5CmY4t9tjIdvSXfu82Y3w7wt0uR9KkucbhkVvJZLQSA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@cypress/request": "^3.0.6", + "@cypress/xvfb": "^1.2.4", + "@types/sinonjs__fake-timers": "8.1.1", + "@types/sizzle": "^2.3.2", + "arch": "^2.2.0", + "blob-util": "^2.0.2", + "bluebird": "^3.7.2", + "buffer": "^5.7.1", + "cachedir": "^2.3.0", + "chalk": "^4.1.0", + "check-more-types": "^2.24.0", + "ci-info": "^4.0.0", + "cli-cursor": "^3.1.0", + "cli-table3": "~0.6.1", + "commander": "^6.2.1", + "common-tags": "^1.8.0", + "dayjs": "^1.10.4", + "debug": "^4.3.4", + "enquirer": "^2.3.6", + "eventemitter2": "6.4.7", + "execa": "4.1.0", + "executable": "^4.1.1", + "extract-zip": "2.0.1", + "figures": "^3.2.0", + "fs-extra": "^9.1.0", + "getos": "^3.2.1", + "is-installed-globally": "~0.4.0", + "lazy-ass": "^1.6.0", + "listr2": "^3.8.3", + "lodash": "^4.17.21", + "log-symbols": "^4.0.0", + "minimist": "^1.2.8", + "ospath": "^1.2.2", + "pretty-bytes": "^5.6.0", + "process": "^0.11.10", + "proxy-from-env": "1.0.0", + "request-progress": "^3.0.0", + "semver": "^7.5.3", + "supports-color": "^8.1.1", + "tmp": "~0.2.3", + "tree-kill": "1.2.2", + "untildify": "^4.0.0", + "yauzl": "^2.10.0" + }, + "bin": { + "cypress": "bin/cypress" + }, + "engines": { + "node": "^16.0.0 || ^18.0.0 || >=20.0.0" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.192", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.192.tgz", + "integrity": "sha512-rP8Ez0w7UNw/9j5eSXCe10o1g/8B1P5SM90PCCMVkIRQn2R0LEHWz4Eh9RnxkniuDe1W0cTSOB3MLlkTGDcuCg==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eventemitter2": { + "version": "6.4.7", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", + "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", + "dev": true, + "license": "MIT" + }, + "node_modules/execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/executable": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", + "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-test-names": { + "version": "1.29.17", + "resolved": "https://registry.npmjs.org/find-test-names/-/find-test-names-1.29.17.tgz", + "integrity": "sha512-JyZJ1EqH6+3/eXtViY7A79BTggAmcKu0rmXu89oJPobwbk8MmFhVz06sF1L2r6TLT7477iVtCmftBQ0pl2K/kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.27.2", + "@babel/plugin-syntax-jsx": "^7.27.1", + "acorn-walk": "^8.2.0", + "debug": "^4.3.3", + "globby": "^11.0.4", + "simple-bin-help": "^1.8.0" + }, + "bin": { + "find-test-names": "bin/find-test-names.js", + "print-tests": "bin/print-tests.js", + "update-test-count": "bin/update-test-count.js" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/getos": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", + "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "async": "^3.2.0" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-dirs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-signature": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", + "integrity": "sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^2.0.2", + "sshpk": "^1.18.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8.12.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true, + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "license": "ISC" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsprim": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", + "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, + "node_modules/lazy-ass": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "> 0.8" + } + }, + "node_modules/listr2": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", + "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^2.1.0", + "colorette": "^2.0.16", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rfdc": "^1.3.0", + "rxjs": "^7.5.1", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + }, + "peerDependenciesMeta": { + "enquirer": { + "optional": true + } + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ospath": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", + "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pretty-bytes": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/proxy-from-env": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", + "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", + "dev": true, + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/request-progress": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", + "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "throttleit": "^1.0.0" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/simple-bin-help": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/simple-bin-help/-/simple-bin-help-1.8.0.tgz", + "integrity": "sha512-0LxHn+P1lF5r2WwVB/za3hLRIsYoLaNq1CXqjbrs3ZvLuvlWnRKrUjEWzV7umZL7hpQ7xULiQMV+0iXdRa5iFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/throttleit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", + "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "dev": true, + "license": "Unlicense" + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici-types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..f31aa140 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "decision-engine-cypress-tests", + "version": "1.0.0", + "description": "Cypress tests for Decision Engine routing flows", + "scripts": { + "cypress:open": "cypress open", + "cypress:run": "cypress run", + "cypress:run:headless": "cypress run --headless", + "test:gateway-latency": "cypress run --spec 'cypress/e2e/routing-flows/gateway-latency-scoring.cy.js'", + "test:success-rate": "cypress run --spec 'cypress/e2e/routing-flows/success-rate-routing.cy.js'", + "test": "cypress run --spec 'cypress/e2e/routing-flows/*.cy.js'" + }, + "devDependencies": { + "cypress": "^13.6.0", + "@cypress/grep": "^4.0.1" + }, + "dependencies": { + "uuid": "^9.0.1" + } +} diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index eb53a146..da8c7973 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -1146,6 +1146,12 @@ pub struct GatewayWiseExtraScore { pub gatewaySigmaFactor: f64, } +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct TransactionLatencyThreshold { + /// To have a hard threshold for latency, which is used to filter out gateways that exceed this threshold. + pub gatewayLatency: Option, +} + #[derive(Debug, Serialize, Deserialize)] pub struct UnifiedError { pub code: String, diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index 302e9f49..107b0d4f 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -39,6 +39,7 @@ use crate::feedback::utils::GatewayScoringType as GST; use crate::merchant_config_util as MerchantConfig; use crate::redis::{feature as Cutover, types::ServiceConfigKey}; use crate::types::card::txn_card_info::TxnCardInfo; +use crate::types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput; use crate::types::merchant::id as MID; use crate::types::merchant::merchant_account as MA; use crate::types::merchant::merchant_account::MerchantAccount; @@ -75,9 +76,7 @@ use crate::{ gateway_elimination_scoring::flow as GEF, utils::{isPennyMandateRegTxn, isRecurringTxn, GatewayScoringType}, }, - types::txn_details::types::TxnDetail, - types::txn_details::types::TxnStatus, - types::txn_details::types::TxnStatus as TS, + types::txn_details::types::{TransactionLatency, TxnDetail, TxnStatus, TxnStatus as TS}, }; use super::constants::{ @@ -268,6 +267,24 @@ pub fn isTransactionFailure(txn_status: TxnStatus) -> bool { txnFailureStates().contains(&txn_status) } +pub fn isGwLatencyWithinConfiguredThreshold( + txn_latency: Option, + merchant_latency_threshold: Option, +) -> bool { + logger::info!( + action = "txn_latency_within_threshold", + tag = "txn_latency_within_threshold", + "Latency & Threshold: {:?} {:?}", + txn_latency, + merchant_latency_threshold + ); + if let Some((latency, threshold)) = txn_latency.zip(merchant_latency_threshold) { + latency <= threshold + } else { + true + } +} + pub async fn getGatewayScoringType( txn_detail: TxnDetail, txn_card_info: TxnCardInfo, @@ -304,7 +321,7 @@ pub async fn getGatewayScoringType( }; let maybe_latency_threshold = get_sr_v3_latency_threshold( - merchant_sr_v3_input_config, + merchant_sr_v3_input_config.clone(), &pmt, &pm, &sr_routing_dimesions, @@ -328,8 +345,9 @@ pub async fn getGatewayScoringType( logger::info!( action = "sr_v3_latency_threshold", tag = "sr_v3_latency_threshold", - "Latency Threshold: {}", - time_difference_threshold + "Latency Threshold: {} Time Difference: {}", + time_difference_threshold, + time_difference ); if is_success { @@ -395,6 +413,7 @@ pub async fn check_and_update_gateway_score_( log_message, enforce_failure, apiPayload.gatewayReferenceId.clone(), + apiPayload.txnLatency.clone(), ) .await; @@ -430,10 +449,15 @@ pub async fn check_and_update_gateway_score( log_message: &str, enforce_failure: bool, gateway_reference_id: Option, + txn_latency: Option, ) -> () { // Get gateway scoring type - let gateway_scoring_type = - getGatewayScoringType(txn_detail.clone(), txn_card_info.clone(), enforce_failure).await; + let gateway_scoring_type = getGatewayScoringType( + txn_detail.clone(), + txn_card_info.clone(), + enforce_failure, + ) + .await; let gateway_in_string = txn_detail.gateway.clone().unwrap_or_default(); @@ -475,6 +499,7 @@ pub async fn check_and_update_gateway_score( txn_detail.clone(), txn_card_info.clone(), gateway_reference_id.clone(), + txn_latency.clone(), ) .await; } @@ -492,6 +517,7 @@ pub async fn check_and_update_gateway_score( txn_detail, txn_card_info.clone(), gateway_reference_id.clone(), + txn_latency.clone(), ) .await; } @@ -505,6 +531,7 @@ pub async fn updateGatewayScore( txn_detail: TxnDetail, txn_card_info: TxnCardInfo, gateway_reference_id: Option, + txn_latency: Option, ) -> () { let mer_acc: MerchantAccount = MA::load_merchant_by_merchant_id(MID::merchant_id_to_text(txn_detail.clone().merchantId)) @@ -540,6 +567,7 @@ pub async fn updateGatewayScore( txn_card_info.clone(), gateway_scoring_type.clone(), mer_acc.clone(), + txn_latency.clone(), ) .await; @@ -744,6 +772,7 @@ pub async fn isUpdateWithinLatencyWindow( txn_card_info: TxnCardInfo, gateway_scoring_type: GatewayScoringType, mer_acc: MerchantAccount, + txn_latency: Option, ) -> bool { match gateway_scoring_type { GatewayScoringType::PENALISE => true, @@ -762,6 +791,15 @@ pub async fn isUpdateWithinLatencyWindow( findByNameFromRedis(C::GATEWAY_SCORE_LATENCY_CHECK_IN_MINS.get_key()) .await .unwrap_or(C::defaultGatewayScoreLatencyCheckInMins()); + /// check if the transaction latency calculated by orchestration is within the configured threshold + let is_gw_latency_within_threshold = isGwLatencyWithinConfiguredThreshold( + txn_latency.and_then(|m| m.gatewayLatency), + GatewaySuccessRateBasedRoutingInput::from_str( + &mer_acc.gatewaySuccessRateBasedDeciderInput, + ) + .ok() + .and_then(|m| m.txnLatency.and_then(|l| l.gatewayLatency) ), + ); // Cutover::findByNameFromRedis(C.gatewayScoreLatencyCheckInMins) // .await // .unwrap_or(C.defaultGatewayScoreLatencyCheckInMins); @@ -780,7 +818,9 @@ pub async fn isUpdateWithinLatencyWindow( "gwLatencyCheckThreshold: {}", gw_latency_check_threshold ); - if gw_score_update_latency < gw_latency_check_threshold * 60000u128 { + if (gw_score_update_latency < gw_latency_check_threshold * 60000u128) + && is_gw_latency_within_threshold + { true } else { false diff --git a/src/feedback/types.rs b/src/feedback/types.rs index 905eeb5d..87c67892 100644 --- a/src/feedback/types.rs +++ b/src/feedback/types.rs @@ -8,7 +8,7 @@ use time::PrimitiveDateTime; // use database::beam as B; // use chrono::{Local, Utc}; use crate::types::gateway as ETG; -use crate::types::txn_details::types::{Offset, TxnStatus}; +use crate::types::txn_details::types::{Offset, TxnStatus, TransactionLatency}; use std::string::String; use time::OffsetDateTime; // use eulerhs::types::MeshError; @@ -241,6 +241,7 @@ pub struct UpdateScorePayload { pub status: TxnStatus, pub paymentId: String, pub enforceDynamicRoutingFailure: Option, + pub txnLatency: Option, } #[derive(Debug, Serialize, Deserialize, Clone)] @@ -260,6 +261,12 @@ pub struct InternalTrackingInfo { pub routing_approach: String, } +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct TransactionLatencyThreshold { + #[serde(rename = "gatewayLatency")] + pub gatewayLatency: Option, +} + // Original Haskell data type: Error // #[derive(Debug, Serialize, Deserialize, PartialEq)] // #[serde(tag = "type", content = "value")] @@ -509,7 +516,7 @@ pub struct SrV3DebugBlock { // Converted newtypes // Original Haskell newtype: Milliseconds -#[derive(Debug, Serialize, Deserialize, PartialEq, PartialOrd)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, PartialOrd)] pub struct Milliseconds { #[serde(rename = "milliseconds")] pub milliseconds: f64, diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 76232ec2..78706fcc 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -18,10 +18,10 @@ use crate::feedback::types::{ UpdateScorePayload, }; use crate::storage::types::TxnCardInfo; -use crate::types::currency::Currency; use crate::types::money::internal::Money; use crate::types::order as ETO; use crate::types::transaction::id as ETId; +use crate::types::{currency::Currency, txn_details::types::TransactionLatency}; use fred::prelude::{KeysInterface, ListInterface}; // use sequelize::{ModelMeta, OrderBy, Set, Where}; use crate::types::card as ETCa; diff --git a/src/routes/rule_configuration.rs b/src/routes/rule_configuration.rs index e558f574..51b1d9f1 100644 --- a/src/routes/rule_configuration.rs +++ b/src/routes/rule_configuration.rs @@ -72,7 +72,7 @@ pub async fn create_rule_config( } } types::routing_configuration::ConfigVariant::Elimination(config) => { - let db_config = types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput::from_elimination_threshold(config.threshold); + let db_config = types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput::from_elimination_threshold(config); let config = serde_json::to_string(&db_config) .map_err(|_| error::RuleConfigurationError::StorageError)?; @@ -208,6 +208,7 @@ pub async fn get_rule_config( .map_err(|_| error::RuleConfigurationError::DeserializationError) .map(|config| types::routing_configuration::EliminationData { threshold: config.defaultEliminationThreshold, + txnLatency: config.txnLatency, }) }); @@ -317,7 +318,7 @@ pub async fn update_rule_config( } } types::routing_configuration::ConfigVariant::Elimination(config) => { - let db_config = types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput::from_elimination_threshold(config.threshold); + let db_config = types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput::from_elimination_threshold(config); let config = serde_json::to_string(&db_config) .map_err(|_| error::RuleConfigurationError::StorageError)?; diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index e5137b0a..e371f1c3 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -2,7 +2,7 @@ use crate::decider::gatewaydecider::types::{ErrorResponse, UnifiedError}; use crate::feedback::gateway_scoring_service::check_and_update_gateway_score; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; use crate::types::card::txn_card_info::TxnCardInfo; -use crate::types::txn_details::types::TxnDetail; +use crate::types::txn_details::types::{TxnDetail, TransactionLatency}; use crate::{logger, metrics}; use axum::body::to_bytes; use cpu_time::ProcessTime; @@ -15,6 +15,7 @@ struct UpdateScoreRequest { log_message: String, enforce_dynaic_routing_failure: Option, gateway_reference_id: Option, + txn_latency: Option, } #[axum::debug_handler] @@ -160,6 +161,7 @@ pub async fn update_score( let log_message = payload.log_message; let enforce_failure = payload.enforce_dynaic_routing_failure.unwrap_or(false); let gateway_reference_id = payload.gateway_reference_id; + let txn_latency = payload.txn_latency; jemalloc_ctl::epoch::advance().unwrap(); let allocated_before = jemalloc_ctl::stats::allocated::read().unwrap_or(0); @@ -170,6 +172,7 @@ pub async fn update_score( log_message.as_str(), enforce_failure, gateway_reference_id, + txn_latency ) .await; diff --git a/src/types/gateway_routing_input.rs b/src/types/gateway_routing_input.rs index c8040ae2..accd1738 100644 --- a/src/types/gateway_routing_input.rs +++ b/src/types/gateway_routing_input.rs @@ -1,4 +1,6 @@ -use crate::types::merchant::id::MerchantId; +use crate::types::{merchant::id::MerchantId, routing_configuration}; +use crate::{error, logger}; +use error_stack::ResultExt; use serde::{Deserialize, Serialize}; use std::option::Option; use std::string::String; @@ -118,13 +120,15 @@ pub struct GatewaySuccessRateBasedRoutingInput { pub defaultGatewayLevelEliminationThreshold: Option, #[serde(rename = "defaultEliminationV2SuccessRate")] pub defaultEliminationV2SuccessRate: Option, + #[serde(rename = "txnLatency")] + pub txnLatency: Option, } impl GatewaySuccessRateBasedRoutingInput { - pub fn from_elimination_threshold(elimination_threshold: f64) -> Self { + pub fn from_elimination_threshold(config: routing_configuration::EliminationData) -> Self { Self { gatewayWiseInputs: None, - defaultEliminationThreshold: elimination_threshold, + defaultEliminationThreshold: config.threshold, defaultEliminationLevel: EliminationLevel::PAYMENT_METHOD, defaultSelectionLevel: None, enabledPaymentMethodTypes: vec![], @@ -138,8 +142,14 @@ impl GatewaySuccessRateBasedRoutingInput { defaultGlobalSoftTxnResetCount: None, defaultGatewayLevelEliminationThreshold: None, defaultEliminationV2SuccessRate: None, + txnLatency: config.txnLatency, } } + pub fn from_str(input: &str) -> error_stack::Result { + serde_json::from_str(input) + .change_context(error::RuleConfigurationError::DeserializationError) + .attach_printable_lazy(|| format!("Unable to parse Input from string: {:?}", input)) + } } impl Default for GatewaySuccessRateBasedRoutingInput { @@ -160,6 +170,7 @@ impl Default for GatewaySuccessRateBasedRoutingInput { defaultGlobalSoftTxnResetCount: None, defaultGatewayLevelEliminationThreshold: None, defaultEliminationV2SuccessRate: None, + txnLatency: None, } } } diff --git a/src/types/routing_configuration.rs b/src/types/routing_configuration.rs index fd1da63a..f465c0f6 100644 --- a/src/types/routing_configuration.rs +++ b/src/types/routing_configuration.rs @@ -65,6 +65,7 @@ pub struct GatewayWiseExtraScore { #[serde(rename_all = "camelCase")] pub struct EliminationData { pub threshold: f64, + pub txnLatency: Option, } #[derive(Debug, Serialize, Deserialize)] @@ -73,3 +74,10 @@ pub struct DebitRoutingData { pub merchant_category_code: String, pub acquirer_country: String, } + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TransactionLatencyThreshold { + /// To have a hard threshold for latency in millis, which is used to filter out gateways that exceed this threshold. + pub gatewayLatency: Option, +} diff --git a/src/types/txn_details/types.rs b/src/types/txn_details/types.rs index ed95349b..bc0c5a55 100644 --- a/src/types/txn_details/types.rs +++ b/src/types/txn_details/types.rs @@ -13,6 +13,7 @@ use time::Time; // use db::mesh::internal; // use crate::storage::internal::primd_id_to_int; // use types::utils::dbconfig::get_euler_db_conf; +use crate::feedback::types::Milliseconds; use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; use crate::types::merchant::id::MerchantId; @@ -611,3 +612,9 @@ pub enum ChargeName { ADD_ON, GATEWAY_ADJUSTMENT, } + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TransactionLatency { + #[serde(rename = "gatewayLatency")] + pub gatewayLatency: Option, +} \ No newline at end of file From 00750da15719825aaeaab1097ed2cf65e17ff78f Mon Sep 17 00:00:00 2001 From: Shankar Singh C <83439957+ShankarSinghC@users.noreply.github.com> Date: Wed, 20 Aug 2025 18:32:59 +0530 Subject: [PATCH 13/95] Debit routing/update config (#138) --- config/development.toml | 26 +++++++++++++------------- config/docker-configuration.toml | 27 ++++++++++++++------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/config/development.toml b/config/development.toml index 61d7337b..cce9479b 100644 --- a/config/development.toml +++ b/config/development.toml @@ -190,23 +190,23 @@ pred = 1 succ = 3 [debit_routing_config] -fraud_check_fee = 0.01 +fraud_check_fee = 1.0 [debit_routing_config.network_fee] -visa = { percentage = 0.1375, fixed_amount = 0.020 } -mastercard = { percentage = 0.15, fixed_amount = 0.040 } -accel = { percentage = 0.0, fixed_amount = 0.040 } -nyce = { percentage = 0.10, fixed_amount = 0.015 } -pulse = { percentage = 0.10, fixed_amount = 0.03 } -star = { percentage = 0.10, fixed_amount = 0.015 } +visa = { percentage = 0.1375, fixed_amount = 2.0 } +mastercard = { percentage = 0.15, fixed_amount = 4.0 } +accel = { percentage = 0.0, fixed_amount = 4.0 } +nyce = { percentage = 0.10, fixed_amount = 1.5 } +pulse = { percentage = 0.10, fixed_amount = 3.0 } +star = { percentage = 0.10, fixed_amount = 1.5 } [debit_routing_config.interchange_fee] regulated = { percentage = 0.05, fixed_amount = 0.21 } [debit_routing_config.interchange_fee.non_regulated] -merchant_category_code_0001.visa = { percentage = 1.65, fixed_amount = 0.15 } -merchant_category_code_0001.mastercard = { percentage = 1.65, fixed_amount = 0.15 } -merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 0.04 } -merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 0.213125 } -merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 0.15 } -merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 0.15 } +merchant_category_code_0001.visa = { percentage = 1.65, fixed_amount = 15.0 } +merchant_category_code_0001.mastercard = { percentage = 1.65, fixed_amount = 15.0 } +merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 4.0 } +merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 21.3125 } +merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 15.0 } +merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 15.0 } diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index 0215d5ab..31072b47 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -167,23 +167,24 @@ pred = 1 succ = 3 [debit_routing_config] -fraud_check_fee = 0.01 +fraud_check_fee = 1.0 [debit_routing_config.network_fee] -visa = { percentage = 0.1375, fixed_amount = 0.020 } -mastercard = { percentage = 0.15, fixed_amount = 0.040 } -accel = { percentage = 0.0, fixed_amount = 0.040 } -nyce = { percentage = 0.10, fixed_amount = 0.015 } -pulse = { percentage = 0.10, fixed_amount = 0.03 } -star = { percentage = 0.10, fixed_amount = 0.015 } +visa = { percentage = 0.1375, fixed_amount = 2.0 } +mastercard = { percentage = 0.15, fixed_amount = 4.0 } +accel = { percentage = 0.0, fixed_amount = 4.0 } +nyce = { percentage = 0.10, fixed_amount = 1.5 } +pulse = { percentage = 0.10, fixed_amount = 3.0 } +star = { percentage = 0.10, fixed_amount = 1.5 } [debit_routing_config.interchange_fee] regulated = { percentage = 0.05, fixed_amount = 0.21 } [debit_routing_config.interchange_fee.non_regulated] -merchant_category_code_0001.visa = { percentage = 1.65, fixed_amount = 0.15 } -merchant_category_code_0001.mastercard = { percentage = 1.65, fixed_amount = 0.15 } -merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 0.04 } -merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 0.213125 } -merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 0.15 } -merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 0.15 } +merchant_category_code_0001.visa = { percentage = 1.65, fixed_amount = 15.0 } +merchant_category_code_0001.mastercard = { percentage = 1.65, fixed_amount = 15.0 } +merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 4.0 } +merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 21.3125 } +merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 15.0 } +merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 15.0 } + From 65a9358a3033f433ce21af92b9e9423a1404a151 Mon Sep 17 00:00:00 2001 From: AnkitKmrGupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Wed, 20 Aug 2025 19:29:58 +0530 Subject: [PATCH 14/95] Crud response enhancement (#137) Co-authored-by: Ankit Gupta --- src/feedback/gateway_scoring_service.rs | 10 +- src/feedback/types.rs | 5 +- src/merchant_config_util.rs | 4 +- src/routes/merchant_account_config.rs | 42 ++++++- src/routes/rule_configuration.rs | 155 +++++++++++++++--------- src/routes/update_gateway_score.rs | 8 +- src/routes/update_score.rs | 4 +- src/types/routing_configuration.rs | 14 +-- src/types/txn_details/types.rs | 2 +- 9 files changed, 161 insertions(+), 83 deletions(-) diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index 107b0d4f..c6b7a929 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -452,12 +452,8 @@ pub async fn check_and_update_gateway_score( txn_latency: Option, ) -> () { // Get gateway scoring type - let gateway_scoring_type = getGatewayScoringType( - txn_detail.clone(), - txn_card_info.clone(), - enforce_failure, - ) - .await; + let gateway_scoring_type = + getGatewayScoringType(txn_detail.clone(), txn_card_info.clone(), enforce_failure).await; let gateway_in_string = txn_detail.gateway.clone().unwrap_or_default(); @@ -798,7 +794,7 @@ pub async fn isUpdateWithinLatencyWindow( &mer_acc.gatewaySuccessRateBasedDeciderInput, ) .ok() - .and_then(|m| m.txnLatency.and_then(|l| l.gatewayLatency) ), + .and_then(|m| m.txnLatency.and_then(|l| l.gatewayLatency)), ); // Cutover::findByNameFromRedis(C.gatewayScoreLatencyCheckInMins) // .await diff --git a/src/feedback/types.rs b/src/feedback/types.rs index 87c67892..397e42b1 100644 --- a/src/feedback/types.rs +++ b/src/feedback/types.rs @@ -8,7 +8,7 @@ use time::PrimitiveDateTime; // use database::beam as B; // use chrono::{Local, Utc}; use crate::types::gateway as ETG; -use crate::types::txn_details::types::{Offset, TxnStatus, TransactionLatency}; +use crate::types::txn_details::types::{Offset, TransactionLatency, TxnStatus}; use std::string::String; use time::OffsetDateTime; // use eulerhs::types::MeshError; @@ -247,6 +247,9 @@ pub struct UpdateScorePayload { #[derive(Debug, Serialize, Deserialize, Clone)] pub struct UpdateScoreResponse { pub message: String, + pub merchant_id: String, + pub gateway: String, + pub payment_id: String, } #[derive(Debug, Serialize, Deserialize)] diff --git a/src/merchant_config_util.rs b/src/merchant_config_util.rs index f0a09d1f..1d193e00 100644 --- a/src/merchant_config_util.rs +++ b/src/merchant_config_util.rs @@ -40,8 +40,8 @@ use crate::{ load_merchant_config_by_mpid_category_name_and_status, MerchantConfig, }, types::{ - config_category_to_text, config_status_to_text, ConfigCategory, - ConfigStatus, PfMcConfig, + config_category_to_text, config_status_to_text, ConfigCategory, ConfigStatus, + PfMcConfig, }, }, payment_flow::{payment_flows_to_text, PaymentFlow}, diff --git a/src/routes/merchant_account_config.rs b/src/routes/merchant_account_config.rs index af7aedf3..4bdc9962 100644 --- a/src/routes/merchant_account_config.rs +++ b/src/routes/merchant_account_config.rs @@ -3,6 +3,21 @@ use crate::types::merchant as ETM; use crate::{error, logger, metrics, types}; use axum::{extract::Path, Json}; use error_stack::ResultExt; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MerchantAccountCreateResponse { + pub message: String, + pub merchant_id: String, + pub gateway_success_rate_based_decider_input: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MerchantAccountDeleteResponse { + pub message: String, + pub merchant_id: String, +} + #[axum::debug_handler] pub async fn get_merchant_config( Path(merchant_id): Path, @@ -49,7 +64,10 @@ pub async fn get_merchant_config( #[axum::debug_handler] pub async fn create_merchant_config( Json(payload): Json, -) -> Result, error::ContainerError> { +) -> Result< + Json, + error::ContainerError, +> { // Record total request count and start timer API_REQUEST_TOTAL_COUNTER .with_label_values(&["merchant_account_create"]) @@ -63,6 +81,10 @@ pub async fn create_merchant_config( payload ); + let merchant_id = payload.merchant_id.clone(); + let gateway_success_rate_based_decider_input = + payload.gateway_success_rate_based_decider_input.clone(); + let merchant_account = ETM::merchant_account::load_merchant_by_merchant_id(payload.merchant_id.clone()).await; @@ -84,7 +106,11 @@ pub async fn create_merchant_config( API_REQUEST_COUNTER .with_label_values(&["merchant_account_create", "success"]) .inc(); - Ok(Json("Merchant account created successfully".to_string())) + Ok(Json(MerchantAccountCreateResponse { + message: "Merchant account created successfully".to_string(), + merchant_id, + gateway_success_rate_based_decider_input, + })) } Err(e) => { API_REQUEST_COUNTER @@ -101,7 +127,10 @@ pub async fn create_merchant_config( #[axum::debug_handler] pub async fn delete_merchant_config( Path(merchant_id): Path, -) -> Result, error::ContainerError> { +) -> Result< + Json, + error::ContainerError, +> { // Record total request count and start timer API_REQUEST_TOTAL_COUNTER .with_label_values(&["merchant_account_delete"]) @@ -115,7 +144,7 @@ pub async fn delete_merchant_config( merchant_id ); - let result = ETM::merchant_account::delete_merchant_account(merchant_id) + let result = ETM::merchant_account::delete_merchant_account(merchant_id.clone()) .await .change_context(error::MerchantAccountConfigurationError::MerchantDeletionFailed); @@ -124,7 +153,10 @@ pub async fn delete_merchant_config( API_REQUEST_COUNTER .with_label_values(&["merchant_account_delete", "success"]) .inc(); - Ok(Json("Merchant account deleted successfully".to_string())) + Ok(Json(MerchantAccountDeleteResponse { + message: "Merchant account deleted successfully".to_string(), + merchant_id, + })) } Err(e) => { API_REQUEST_COUNTER diff --git a/src/routes/rule_configuration.rs b/src/routes/rule_configuration.rs index 51b1d9f1..c1c783ff 100644 --- a/src/routes/rule_configuration.rs +++ b/src/routes/rule_configuration.rs @@ -3,11 +3,25 @@ use crate::types::merchant as ETM; use crate::{error, logger, types}; use axum::Json; use error_stack::ResultExt; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct RuleConfigResponse { + pub message: String, + pub merchant_id: String, + pub config: types::routing_configuration::ConfigVariant, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct RuleConfigDeleteResponse { + pub message: String, + pub merchant_id: String, +} #[axum::debug_handler] pub async fn create_rule_config( Json(payload): Json, -) -> Result, error::ContainerError> { +) -> Result, error::ContainerError> { let timer = API_LATENCY_HISTOGRAM .with_label_values(&["create_rule_config"]) .start_timer(); @@ -16,6 +30,9 @@ pub async fn create_rule_config( .inc(); logger::debug!("Received rule configuration: {:?}", payload); + let merchant_id = payload.merchant_id.clone(); + let config = payload.config.clone(); + let mid = payload.merchant_id.clone(); // Check if merchant exists @@ -31,9 +48,9 @@ pub async fn create_rule_config( } let result = match payload.config { - types::routing_configuration::ConfigVariant::SuccessRate(config) => { + types::routing_configuration::ConfigVariant::SuccessRate(success_config) => { let name = format!("SR_V3_INPUT_CONFIG_{}", mid); - let config = serde_json::to_string(&config) + let serialized_config = serde_json::to_string(&success_config) .map_err(|_| error::RuleConfigurationError::StorageError)?; // Check if config already exists @@ -49,7 +66,7 @@ pub async fn create_rule_config( Err(error::RuleConfigurationError::ConfigurationAlreadyExists.into()) } None => { - match types::service_configuration::insert_config(name, Some(config)) + match types::service_configuration::insert_config(name, Some(serialized_config)) .await .change_context(error::RuleConfigurationError::StorageError) { @@ -57,9 +74,12 @@ pub async fn create_rule_config( API_REQUEST_COUNTER .with_label_values(&["sr_create_rule_config", "success"]) .inc(); - Ok(Json( - "Success Rate Configuration created successfully".to_string(), - )) + Ok(Json(RuleConfigResponse { + message: "Success Rate Configuration created successfully" + .to_string(), + merchant_id, + config, + })) } Err(e) => { API_REQUEST_COUNTER @@ -71,24 +91,28 @@ pub async fn create_rule_config( } } } - types::routing_configuration::ConfigVariant::Elimination(config) => { - let db_config = types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput::from_elimination_threshold(config); - let config = serde_json::to_string(&db_config) + types::routing_configuration::ConfigVariant::Elimination(elimination_config) => { + let db_config = types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput::from_elimination_threshold(elimination_config); + let serialized_config = serde_json::to_string(&db_config) .map_err(|_| error::RuleConfigurationError::StorageError)?; - let result = - types::merchant::merchant_account::update_merchant_account(mid, Some(config)) - .await - .change_context(error::RuleConfigurationError::StorageError); + let result = types::merchant::merchant_account::update_merchant_account( + mid, + Some(serialized_config), + ) + .await + .change_context(error::RuleConfigurationError::StorageError); match result { Ok(_) => { API_REQUEST_COUNTER .with_label_values(&["elimination_create_rule_config", "success"]) .inc(); - Ok(Json( - "Elimination Configuration created successfully".to_string(), - )) + Ok(Json(RuleConfigResponse { + message: "Elimination Configuration created successfully".to_string(), + merchant_id, + config, + })) } Err(e) => { API_REQUEST_COUNTER @@ -98,9 +122,9 @@ pub async fn create_rule_config( } } } - types::routing_configuration::ConfigVariant::DebitRouting(config) => { + types::routing_configuration::ConfigVariant::DebitRouting(debit_config) => { let name = format!("DEBIT_ROUTING_CONFIG_{}", mid); - let config = serde_json::to_string(&config) + let serialized_config = serde_json::to_string(&debit_config) .map_err(|_| error::RuleConfigurationError::StorageError)?; // Check if config already exists @@ -116,7 +140,7 @@ pub async fn create_rule_config( Err(error::RuleConfigurationError::ConfigurationAlreadyExists.into()) } None => { - match types::service_configuration::insert_config(name, Some(config)) + match types::service_configuration::insert_config(name, Some(serialized_config)) .await .change_context(error::RuleConfigurationError::StorageError) { @@ -124,9 +148,12 @@ pub async fn create_rule_config( API_REQUEST_COUNTER .with_label_values(&["debit_routing_create_rule_config", "success"]) .inc(); - Ok(Json( - "Debit Routing Configuration created successfully".to_string(), - )) + Ok(Json(RuleConfigResponse { + message: "Debit Routing Configuration created successfully" + .to_string(), + merchant_id, + config, + })) } Err(e) => { API_REQUEST_COUNTER @@ -275,7 +302,7 @@ pub async fn get_rule_config( #[axum::debug_handler] pub async fn update_rule_config( Json(payload): Json, -) -> Result, error::ContainerError> { +) -> Result, error::ContainerError> { let timer = API_LATENCY_HISTOGRAM .with_label_values(&["update_rule_config"]) .start_timer(); @@ -284,6 +311,9 @@ pub async fn update_rule_config( .inc(); logger::debug!("Received rule update configuration: {:?}", payload); + let merchant_id = payload.merchant_id.clone(); + let config = payload.config.clone(); + let mid = payload.merchant_id.clone(); ETM::merchant_account::load_merchant_by_merchant_id(mid.clone()) .await @@ -291,12 +321,12 @@ pub async fn update_rule_config( // Update DB call for updating the rule configuration let result = match payload.config { - types::routing_configuration::ConfigVariant::SuccessRate(config) => { + types::routing_configuration::ConfigVariant::SuccessRate(success_config) => { let name = format!("SR_V3_INPUT_CONFIG_{}", mid); - let config = serde_json::to_string(&config) + let serialized_config = serde_json::to_string(&success_config) .map_err(|_| error::RuleConfigurationError::StorageError)?; - let result = types::service_configuration::update_config(name, Some(config)) + let result = types::service_configuration::update_config(name, Some(serialized_config)) .await .change_context(error::RuleConfigurationError::StorageError); @@ -305,9 +335,11 @@ pub async fn update_rule_config( API_REQUEST_COUNTER .with_label_values(&["sr_update_rule_config", "success"]) .inc(); - Ok(Json( - "Success Rate Configuration updated successfully".to_string(), - )) + Ok(Json(RuleConfigResponse { + message: "Success Rate Configuration updated successfully".to_string(), + merchant_id, + config, + })) } Err(e) => { API_REQUEST_COUNTER @@ -317,24 +349,28 @@ pub async fn update_rule_config( } } } - types::routing_configuration::ConfigVariant::Elimination(config) => { - let db_config = types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput::from_elimination_threshold(config); - let config = serde_json::to_string(&db_config) + types::routing_configuration::ConfigVariant::Elimination(elimination_config) => { + let db_config = types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput::from_elimination_threshold(elimination_config); + let serialized_config = serde_json::to_string(&db_config) .map_err(|_| error::RuleConfigurationError::StorageError)?; - let result = - types::merchant::merchant_account::update_merchant_account(mid, Some(config)) - .await - .change_context(error::RuleConfigurationError::StorageError); + let result = types::merchant::merchant_account::update_merchant_account( + mid, + Some(serialized_config), + ) + .await + .change_context(error::RuleConfigurationError::StorageError); match result { Ok(_) => { API_REQUEST_COUNTER .with_label_values(&["elimination_update_rule_config", "success"]) .inc(); - Ok(Json( - "Elimination Configuration created successfully".to_string(), - )) + Ok(Json(RuleConfigResponse { + message: "Elimination Configuration updated successfully".to_string(), + merchant_id, + config, + })) } Err(e) => { API_REQUEST_COUNTER @@ -344,12 +380,12 @@ pub async fn update_rule_config( } } } - types::routing_configuration::ConfigVariant::DebitRouting(config) => { + types::routing_configuration::ConfigVariant::DebitRouting(debit_config) => { let name = format!("DEBIT_ROUTING_CONFIG_{}", mid); - let config = serde_json::to_string(&config) + let serialized_config = serde_json::to_string(&debit_config) .map_err(|_| error::RuleConfigurationError::StorageError)?; - let result = types::service_configuration::update_config(name, Some(config)) + let result = types::service_configuration::update_config(name, Some(serialized_config)) .await .change_context(error::RuleConfigurationError::StorageError); @@ -358,9 +394,11 @@ pub async fn update_rule_config( API_REQUEST_COUNTER .with_label_values(&["debit_routing_update_rule_config", "success"]) .inc(); - Ok(Json( - "Debit Routing Configuration updated successfully".to_string(), - )) + Ok(Json(RuleConfigResponse { + message: "Debit Routing Configuration updated successfully".to_string(), + merchant_id, + config, + })) } Err(e) => { API_REQUEST_COUNTER @@ -378,7 +416,7 @@ pub async fn update_rule_config( #[axum::debug_handler] pub async fn delete_rule_config( Json(payload): Json, -) -> Result, error::ContainerError> { +) -> Result, error::ContainerError> { let timer = API_LATENCY_HISTOGRAM .with_label_values(&["delete_rule_config"]) .start_timer(); @@ -405,9 +443,10 @@ pub async fn delete_rule_config( API_REQUEST_COUNTER .with_label_values(&["sr_delete_rule_config", "success"]) .inc(); - Ok(Json( - "Success Rate Configuration deleted successfully".to_string(), - )) + Ok(Json(RuleConfigDeleteResponse { + message: "Success Rate Configuration deleted successfully".to_string(), + merchant_id: mid, + })) } Err(e) => { API_REQUEST_COUNTER @@ -419,7 +458,7 @@ pub async fn delete_rule_config( } types::routing_configuration::AlgorithmType::Elimination => { let result = types::merchant::merchant_account::update_merchant_account( - mid, + mid.clone(), Some("".to_string()), ) // update to empty string .await @@ -430,9 +469,10 @@ pub async fn delete_rule_config( API_REQUEST_COUNTER .with_label_values(&["elimination_delete_rule_config", "success"]) .inc(); - Ok(Json( - "Elimination Configuration deleted successfully".to_string(), - )) + Ok(Json(RuleConfigDeleteResponse { + message: "Elimination Configuration deleted successfully".to_string(), + merchant_id: mid, + })) } Err(e) => { API_REQUEST_COUNTER @@ -453,9 +493,10 @@ pub async fn delete_rule_config( API_REQUEST_COUNTER .with_label_values(&["debit_routing_delete_rule_config", "success"]) .inc(); - Ok(Json( - "Debit Routing Configuration deleted successfully".to_string(), - )) + Ok(Json(RuleConfigDeleteResponse { + message: "Debit Routing Configuration deleted successfully".to_string(), + merchant_id: mid, + })) } Err(e) => { API_REQUEST_COUNTER diff --git a/src/routes/update_gateway_score.rs b/src/routes/update_gateway_score.rs index b2405f62..214b4d43 100644 --- a/src/routes/update_gateway_score.rs +++ b/src/routes/update_gateway_score.rs @@ -75,6 +75,9 @@ pub async fn update_gateway_score( let update_score_request: Result = serde_json::from_slice(&body); match update_score_request { Ok(payload) => { + let merchant_id = payload.merchantId.clone(); + let gateway = payload.gateway.clone(); + let payment_id = payload.paymentId.clone(); let result = check_and_update_gateway_score_(payload).await; match result { Ok(success) => { @@ -83,7 +86,10 @@ pub async fn update_gateway_score( .inc(); timer.observe_duration(); Ok(Json(UpdateScoreResponse { - message: "Success".to_string(), + message: "Gateway score updated successfully".to_string(), + merchant_id, + gateway, + payment_id, })) } Err(e) => { diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index e371f1c3..dfa180e2 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -2,7 +2,7 @@ use crate::decider::gatewaydecider::types::{ErrorResponse, UnifiedError}; use crate::feedback::gateway_scoring_service::check_and_update_gateway_score; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; use crate::types::card::txn_card_info::TxnCardInfo; -use crate::types::txn_details::types::{TxnDetail, TransactionLatency}; +use crate::types::txn_details::types::{TransactionLatency, TxnDetail}; use crate::{logger, metrics}; use axum::body::to_bytes; use cpu_time::ProcessTime; @@ -172,7 +172,7 @@ pub async fn update_score( log_message.as_str(), enforce_failure, gateway_reference_id, - txn_latency + txn_latency, ) .await; diff --git a/src/types/routing_configuration.rs b/src/types/routing_configuration.rs index f465c0f6..45e71cb3 100644 --- a/src/types/routing_configuration.rs +++ b/src/types/routing_configuration.rs @@ -20,7 +20,7 @@ pub enum AlgorithmType { DebitRouting, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(tag = "type", content = "data")] #[serde(rename_all = "camelCase")] pub enum ConfigVariant { @@ -29,7 +29,7 @@ pub enum ConfigVariant { DebitRouting(DebitRoutingData), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SuccessRateData { pub default_latency_threshold: Option, @@ -41,7 +41,7 @@ pub struct SuccessRateData { pub sub_level_input_config: Option>, } -#[derive(Debug, Serialize, Deserialize, Clone)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SRSubLevelInputConfig { pub payment_method_type: Option, @@ -54,28 +54,28 @@ pub struct SRSubLevelInputConfig { pub gateway_extra_score: Option>, } -#[derive(Debug, Serialize, Deserialize, Clone)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct GatewayWiseExtraScore { pub gateway_name: String, pub gateway_sigma_factor: f64, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct EliminationData { pub threshold: f64, pub txnLatency: Option, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct DebitRoutingData { pub merchant_category_code: String, pub acquirer_country: String, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransactionLatencyThreshold { /// To have a hard threshold for latency in millis, which is used to filter out gateways that exceed this threshold. diff --git a/src/types/txn_details/types.rs b/src/types/txn_details/types.rs index bc0c5a55..e4b32a07 100644 --- a/src/types/txn_details/types.rs +++ b/src/types/txn_details/types.rs @@ -617,4 +617,4 @@ pub enum ChargeName { pub struct TransactionLatency { #[serde(rename = "gatewayLatency")] pub gatewayLatency: Option, -} \ No newline at end of file +} From c2070f33c1ae0cb873ef2dc052736184fbf652d7 Mon Sep 17 00:00:00 2001 From: Jagan Elavarasan Date: Fri, 22 Aug 2025 12:18:07 +0530 Subject: [PATCH 15/95] Added kafka config in docker compose --- config/docker-configuration.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index 5b5e5734..1eb682d7 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -57,6 +57,7 @@ brokers = ["kafka:29092"] topic_prefix = "decision-engine" batch_size = 100 batch_timeout_ms = 1000 +max_consecutive_failures = 5 [analytics.clickhouse] host = "http://clickhouse:8123" From 5a588c355d9606fa04ff1d1fab40adf0d0914b00 Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Mon, 1 Sep 2025 14:55:03 +0530 Subject: [PATCH 16/95] fix null value issue for udf_txn_uuid and txn_uuid (#132) Co-authored-by: Priyanshu Choudhary --- src/logger/formatter.rs | 1 + src/routes/decision_gateway.rs | 4 ++++ src/utils.rs | 1 + 3 files changed, 6 insertions(+) diff --git a/src/logger/formatter.rs b/src/logger/formatter.rs index e71d0b8b..7409a1b8 100644 --- a/src/logger/formatter.rs +++ b/src/logger/formatter.rs @@ -228,6 +228,7 @@ where "env", "@timestamp", "udf_txn_uuid", + "txn_uuid", "flow_guid", "action", "is_audit_trail_log", diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index 73eb8256..e89ff31b 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -130,6 +130,10 @@ where let merchant_id = payload.orderReference.merchantId.clone(); let merchant_id_txt = crate::types::merchant::id::merchant_id_to_text(merchant_id); tracing::Span::current().record("merchant_id", merchant_id_txt.clone()); + tracing::Span::current().record("udf_txn_uuid", payload.txnDetail.txnUuid.clone()); + tracing::Span::current().record("txn_uuid", payload.txnDetail.txnUuid.clone()); + tracing::Span::current() + .record("udf_order_id", payload.orderReference.orderId.0.as_str()); jemalloc_ctl::epoch::advance().unwrap(); let allocated_before = jemalloc_ctl::stats::allocated::read().unwrap_or(0); diff --git a/src/utils.rs b/src/utils.rs index edad49e0..9e48a2cb 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -35,6 +35,7 @@ pub fn record_fields_from_header(request: &Request) -> tracing::Span { udf_order_id = tracing::field::Empty, udf_customer_id = tracing::field::Empty, udf_txn_uuid = tracing::field::Empty, + txn_uuid = tracing::field::Empty, "x-request-id" = tracing::field::Empty, "x-global-request-id" = tracing::field::Empty, merchant_id = tracing::field::Empty, From c80437856918815cae97359fc26ff00220114ee3 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Mon, 8 Sep 2025 13:51:11 +0530 Subject: [PATCH 17/95] refactor: add closure for metrics (#139) --- src/euclid/handlers/routing_rules.rs | 87 ++++++++++++---------------- 1 file changed, 36 insertions(+), 51 deletions(-) diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index d40409d1..f33bf985 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -247,6 +247,12 @@ pub async fn routing_evaluate( payload.created_by.clone() ); + let update_failure_metrics = || { + API_REQUEST_COUNTER + .with_label_values(&["routing_evaluate", "failure"]) + .inc(); + }; + // Check for the fallback_output in evaluate request: let default_output_present = payload .fallback_output @@ -268,9 +274,7 @@ pub async fn routing_evaluate( )) { Ok(mapper) => mapper.routing_algorithm_id, Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -286,9 +290,7 @@ pub async fn routing_evaluate( { Ok(config) => config, Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -298,9 +300,7 @@ pub async fn routing_evaluate( if !routing_config.keys.keys.contains_key(key) && value.as_ref().is_some_and(|val| !val.is_metadata()) { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(EuclidErrors::InvalidRequestParameter(key.clone()).into()); } @@ -309,9 +309,7 @@ pub async fn routing_evaluate( if key_config.data_type == "enum" { if let Some(Some(ValueType::EnumVariant(value))) = parameters.get(key) { if !is_valid_enum_value(routing_config, key, value) { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(EuclidErrors::InvalidRequest(format!( "Invalid enum value '{}' for key '{}'", @@ -320,9 +318,7 @@ pub async fn routing_evaluate( .into()); } } else { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(EuclidErrors::InvalidRequest(format!( "Expected enum value for key '{}'", @@ -352,9 +348,7 @@ pub async fn routing_evaluate( { Ok(algo) => algo, Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -372,9 +366,7 @@ pub async fn routing_evaluate( }) { Ok(data) => data, Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -392,9 +384,7 @@ pub async fn routing_evaluate( }) { Ok((_, eval)) => (out_enum, eval, Some("straight_through_rule".into())), Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -411,9 +401,7 @@ pub async fn routing_evaluate( }) { Ok((_, eval)) => (out_enum, eval, Some("priority_rule".into())), Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -430,9 +418,7 @@ pub async fn routing_evaluate( }) { Ok((_, eval)) => (out_enum, eval, Some("volume_split_rule".into())), Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -464,9 +450,7 @@ pub async fn routing_evaluate( (ir.output, ir.evaluated_output, ir.rule_name) } Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["routing_evaluate", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -516,6 +500,12 @@ pub async fn activate_routing_rule( .with_label_values(&["activate_routing_rule"]) .inc(); + let update_failure_metrics = || { + API_REQUEST_COUNTER + .with_label_values(&["activate_routing_rule", "failure"]) + .inc(); + }; + let state = get_tenant_app_state().await; let conn = match state .db @@ -525,9 +515,7 @@ pub async fn activate_routing_rule( { Ok(connection) => connection, Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["activate_routing_rule", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -545,9 +533,7 @@ pub async fn activate_routing_rule( )) { Ok(algorithm) => algorithm.algorithm_for, Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["activate_routing_rule", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -595,9 +581,7 @@ pub async fn activate_routing_rule( return Ok(()); } Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["activate_routing_rule", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -629,9 +613,7 @@ pub async fn activate_routing_rule( Ok(()) } Err(e) => { - API_REQUEST_COUNTER - .with_label_values(&["activate_routing_rule", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); Err(e.into()) } @@ -685,6 +667,13 @@ pub async fn list_active_routing_algorithm( metrics::API_REQUEST_TOTAL_COUNTER .with_label_values(&["list_active_routing_algorithm"]) .inc(); + + let update_failure_metrics = || { + API_REQUEST_COUNTER + .with_label_values(&["list_active_routing_algorithm", "failure"]) + .inc(); + }; + let state = get_tenant_app_state().await; let active_mappings = match crate::generics::generic_find_all::< @@ -698,9 +687,7 @@ pub async fn list_active_routing_algorithm( )) { Ok(mappings) => mappings, Err(e) => { - metrics::API_REQUEST_COUNTER - .with_label_values(&["list_active_routing_algorithm", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } @@ -721,9 +708,7 @@ pub async fn list_active_routing_algorithm( { Ok(algos) => algos, Err(e) => { - metrics::API_REQUEST_COUNTER - .with_label_values(&["list_active_routing_algorithm", "failure"]) - .inc(); + update_failure_metrics(); timer.observe_duration(); return Err(e.into()); } From a3881b0cbd3aea88138af9f4369cfaee10639bca Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Mon, 15 Sep 2025 20:32:41 +0530 Subject: [PATCH 18/95] add:newTypes to support update-score via euler (#131) Co-authored-by: Priyanshu Choudhary --- src/decider/gatewaydecider/flows.rs | 4 +- src/decider/gatewaydecider/gw_filter.rs | 21 +-- src/decider/gatewaydecider/gw_scoring.rs | 4 +- src/decider/gatewaydecider/runner.rs | 10 +- src/decider/gatewaydecider/types.rs | 18 +-- src/decider/gatewaydecider/utils.rs | 39 ++--- src/decider/gatewaydecider/validators.rs | 20 +-- .../gateway_elimination_scoring/flow.rs | 2 +- src/feedback/gateway_scoring_service.rs | 33 ++++- src/feedback/utils.rs | 41 +++--- src/routes/update_score.rs | 31 +++- src/types/card/txn_card_info.rs | 56 ++++++++ src/types/order.rs | 4 + src/types/txn_details/types.rs | 136 ++++++++++++++++-- 14 files changed, 326 insertions(+), 93 deletions(-) diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index a2dec563..3c6d1156 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -1063,7 +1063,7 @@ pub async fn getFailureReasonWithFilter( .unwrap_or_else(|| "emi".to_string()) ); let emi_bank = format!("{} ", txn_detail.emiBank.clone().unwrap_or_default()); - if Utils::is_card_transaction(txn_card_info) && !txn_detail.isEmi { + if Utils::is_card_transaction(txn_card_info) && txn_detail.isEmi != Some(true) { "Gateways configured supports only emi transaction.".to_string() } else if Utils::is_card_transaction(txn_card_info) { let is_bin_eligible = Utils::check_if_bin_is_eligible_for_emi( @@ -1142,7 +1142,7 @@ pub async fn getFailureReasonWithFilter( }, "filterFunctionalGatewaysForTxnDetailType" => { format!( - "No functional gateways supporting {}transaction.", + "No functional gateways supporting {:?}transaction.", txn_detail.txnType ) } diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index 8ff88d24..f9e43953 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -287,7 +287,7 @@ pub async fn getFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList { Utils::set_payment_flow_list(this, payment_flow_list); let mgas_ = match ( - txn_detail.isEmi || Utils::is_reccuring_payment_transaction(&txn_detail), + txn_detail.isEmi.unwrap_or(false) || Utils::is_reccuring_payment_transaction(&txn_detail), &enforce_gateway_list, ) { (false, _) => enabled_gateway_accounts.clone(), @@ -385,7 +385,10 @@ pub async fn getFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList { isMgaEligible( mga, &txn_card_info, - txn_detail.txnObjectType.clone(), + txn_detail + .txnObjectType + .clone() + .unwrap_or(TxnObjectType::Unknown), &mga_eligible_seamless_gateways, &txn_detail, ) @@ -628,7 +631,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList let mInternalMeta: Option = txnDetail .internalMetadata .as_ref() - .and_then(|meta| serde_json::from_str(meta).ok()); + .and_then(|meta| serde_json::from_str(meta.peek()).ok()); Utils::set_internal_meta_data(this, mInternalMeta.clone()); @@ -1549,7 +1552,9 @@ pub async fn filterGatewaysForValidationType( } // Handle non-express checkout, non-token repeat transactions - if !txn_detail.expressCheckout && !Utils::is_token_repeat_txn(m_internal_meta) { + if !txn_detail.expressCheckout.unwrap_or(false) + && !Utils::is_token_repeat_txn(m_internal_meta) + { let m_mandate_guest_checkout_supported_gateways: Option> = findByNameFromRedis( C::getmandateGuestCheckoutKey(txn_card_info.cardSwitchProvider).get_key(), @@ -2121,7 +2126,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { txn_detail.isEmi ); - if txn_detail.isEmi { + if txn_detail.isEmi.unwrap_or(false) { let is_mandate_txn = Utils::is_mandate_transaction(&txn_detail); let si_on_emi_card_supported_gateways: HashSet = findByNameFromRedis::>(C::SI_ON_EMI_CARD_SUPPORTED_GATEWAYS.get_key()) @@ -2809,7 +2814,7 @@ pub fn filterForEMITenureSpecificMGAs(this: &mut DeciderFlow) -> Vec { let txn_detail = this.get().dpTxnDetail.clone(); // Only filter if transaction is EMI - if txn_detail.isEmi { + if txn_detail.isEmi.unwrap_or(false) { // Get current functional gateways let st = getGws(this); @@ -2832,7 +2837,7 @@ pub fn filterForEMITenureSpecificMGAs(this: &mut DeciderFlow) -> Vec { match serde_json::from_str::(acc_details) { Ok(emi_details) => { // Check if EMI details match transaction EMI requirements - get_emi(emi_details.isEmi) == txn_detail.isEmi + get_emi(emi_details.isEmi) == txn_detail.isEmi.unwrap_or(false) && get_tenure(emi_details.emiTenure) == txn_detail.emiTenure.unwrap_or(0) } @@ -3133,7 +3138,7 @@ pub fn filterGatewaysForUpiPayBasedOnSupportedFlow( pub async fn filterGatewaysForTxnDetailType(this: &mut DeciderFlow<'_>) -> Vec { let st = getGws(this); let m_txn_type = this.get().dpTxnDetail.txnType.clone(); - let txn_type: &str = m_txn_type.as_str(); + let txn_type: &str = m_txn_type.as_deref().unwrap_or(""); let txn_detail_type_restricted_gateways = findByNameFromRedis(C::TXN_DETAIL_TYPE_RESTRICTED_GATEWAYS.get_key()) .await diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 8c608af1..32f792bb 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1164,7 +1164,7 @@ fn check_scheduled_outage_metadata( Some(scheduled_outage_metadata) => { schedule_equal_to( |x, y| x == y, - Some(txn_detail.txnObjectType.clone()), + txn_detail.txnObjectType.clone(), scheduled_outage_metadata.txnObjectType.clone(), ) && schedule_equal_to( |x, y| x == y, @@ -1930,7 +1930,7 @@ pub async fn get_sr1_and_sr2_and_n( } else { Some(txn_card_info.paymentMethod.clone()) }; - let txn_obj_type = txn_detail.txnObjectType.to_string(); + let txn_obj_type = format!("{:?}", txn_detail.txnObjectType); filter_using_service_config(merchant_id, pmt.to_string(), pm, txn_obj_type, inputs) .await diff --git a/src/decider/gatewaydecider/runner.rs b/src/decider/gatewaydecider/runner.rs index ccf7dc2c..062b1a65 100644 --- a/src/decider/gatewaydecider/runner.rs +++ b/src/decider/gatewaydecider/runner.rs @@ -156,14 +156,14 @@ pub struct FilteredTxnInfo { pub fn filter_txn(detail: TxnDetail) -> FilteredTxnInfo { FilteredTxnInfo { - isEmi: detail.isEmi, + isEmi: detail.isEmi.unwrap_or(false), emiBank: detail.emiBank, emiTenure: detail.emiTenure, txnId: detail.txnId, - addToLocker: detail.addToLocker, - expressCheckout: detail.expressCheckout, + addToLocker: detail.addToLocker.unwrap_or(false), + expressCheckout: detail.expressCheckout.unwrap_or(false), sourceObject: detail.sourceObject, - txnObjectType: detail.txnObjectType, + txnObjectType: detail.txnObjectType.unwrap_or(TxnObjectType::Unknown), } } @@ -493,7 +493,7 @@ pub async fn execute_priority_logic( .txnDetail .internalMetadata .as_ref() - .and_then(|im| serde_json::from_str(im).ok()); + .and_then(|im| serde_json::from_str(im.peek()).ok()); let order_metadata = req.orderMetadata.metadata.clone(); // resolveBin <- case Utils.fetchExtendedCardBin req.txnCardInfo of // Just cardBin -> pure (Just cardBin) diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index da8c7973..fac1ec3e 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -977,28 +977,28 @@ impl DomainDeciderRequestForApiCallV2 { orderId: ETO::id::to_order_id(self.paymentInfo.paymentId.clone()), status: ETTD::TxnStatus::Started, txnId: ETId::to_transaction_id(self.paymentInfo.paymentId.clone()), - txnType: "NOT_DEFINED".to_string(), + txnType: Some("NOT_DEFINED".to_string()), dateCreated: OffsetDateTime::now_utc(), - addToLocker: false, + addToLocker: Some(false), merchantId: ETM::id::to_merchant_id(self.merchantId.clone()), gateway: None, - expressCheckout: false, - isEmi: self.paymentInfo.isEmi.clone().unwrap_or(false), + expressCheckout: Some(false), + isEmi: Some(self.paymentInfo.isEmi.clone().unwrap_or(false)), emiBank: self.paymentInfo.emiBank.clone(), emiTenure: self.paymentInfo.emiTenure.clone(), txnUuid: self.paymentInfo.paymentId.clone(), merchantGatewayAccountId: None, - txnAmount: ETMo::Money::from_double(self.paymentInfo.amount), - txnObjectType: self.paymentInfo.paymentType.clone(), + txnAmount: Some(ETMo::Money::from_double(self.paymentInfo.amount)), + txnObjectType: Some(self.paymentInfo.paymentType.clone()), sourceObject: Some(self.paymentInfo.paymentMethod.clone()), sourceObjectId: None, currency: self.paymentInfo.currency.clone(), country: self.paymentInfo.country.clone(), - netAmount: ETMo::Money::from_double(self.paymentInfo.amount), + netAmount: Some(ETMo::Money::from_double(self.paymentInfo.amount)), surchargeAmount: None, taxAmount: None, - internalMetadata: self.paymentInfo.internalMetadata.clone(), - metadata: self.paymentInfo.metadata.clone(), + internalMetadata: self.paymentInfo.internalMetadata.clone().map(Secret::new), + metadata: self.paymentInfo.metadata.clone().map(Secret::new), offerDeductionAmount: None, internalTrackingInfo: None, partitionKey: None, diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 54aea2db..15c7b277 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -204,36 +204,39 @@ pub fn is_emandate_supported_payment_method( pub fn is_emandate_transaction(txn_detail: &ETTD::TxnDetail) -> bool { matches!( txn_detail.txnObjectType, - ETTD::TxnObjectType::EmandateRegister - | ETTD::TxnObjectType::TpvEmandateRegister - | ETTD::TxnObjectType::EmandatePayment - | ETTD::TxnObjectType::TpvEmandatePayment + Some(ETTD::TxnObjectType::EmandateRegister) + | Some(ETTD::TxnObjectType::TpvEmandateRegister) + | Some(ETTD::TxnObjectType::EmandatePayment) + | Some(ETTD::TxnObjectType::TpvEmandatePayment) ) } pub fn is_emandate_payment_transaction(txn_detail: &ETTD::TxnDetail) -> bool { matches!( txn_detail.txnObjectType, - ETTD::TxnObjectType::EmandatePayment | ETTD::TxnObjectType::TpvEmandatePayment + Some(ETTD::TxnObjectType::EmandatePayment) | Some(ETTD::TxnObjectType::TpvEmandatePayment) ) } pub fn is_reccuring_payment_transaction(txn_detail: &ETTD::TxnDetail) -> bool { matches!( txn_detail.txnObjectType, - ETTD::TxnObjectType::EmandatePayment - | ETTD::TxnObjectType::TpvEmandatePayment - | ETTD::TxnObjectType::MandatePayment - | ETTD::TxnObjectType::TpvMandatePayment + Some(ETTD::TxnObjectType::EmandatePayment) + | Some(ETTD::TxnObjectType::TpvEmandatePayment) + | Some(ETTD::TxnObjectType::MandatePayment) + | Some(ETTD::TxnObjectType::TpvMandatePayment) ) } pub fn is_tpv_transaction(txn_detail: &ETTD::TxnDetail) -> bool { - txn_detail.txnObjectType == ETTD::TxnObjectType::TpvPayment + matches!( + txn_detail.txnObjectType, + Some(ETTD::TxnObjectType::TpvPayment) + ) } pub fn is_tpv_mandate_transaction(txn_detail: &ETTD::TxnDetail) -> bool { - txn_detail.txnObjectType == ETTD::TxnObjectType::TpvEmandateRegister + txn_detail.txnObjectType == Some(ETTD::TxnObjectType::TpvEmandateRegister) } pub fn get_merchant_wise_si_bin_key(gw: &String) -> String { @@ -254,7 +257,7 @@ fn get_merchant_gateway_card_info_feature_name( pub fn is_mandate_transaction(txn: &ETTD::TxnDetail) -> bool { matches!( txn.txnObjectType, - ETTD::TxnObjectType::MandateRegister | ETTD::TxnObjectType::MandatePayment + Some(ETTD::TxnObjectType::MandateRegister) | Some(ETTD::TxnObjectType::MandatePayment) ) } @@ -568,7 +571,7 @@ pub fn get_gateway_reference_id( pub async fn effective_amount_with_txn_amount(txn_detail: ETTD::TxnDetail) -> Money { let def_amount = Money::from_double(0.0); - let amount_txn = &txn_detail.txnAmount; + let amount_txn = txn_detail.txnAmount.as_ref().unwrap_or(&def_amount); let offers = ETTO::getOffers(&txn_detail.id).await; let discount_sum: Money = Money::from_double( offers @@ -616,7 +619,7 @@ pub fn is_emandate_amount_filter_needed( } pub fn is_emandate_register_transaction(txn_detail: &ETTD::TxnDetail) -> bool { - txn_detail.txnObjectType == ETTD::TxnObjectType::EmandateRegister + txn_detail.txnObjectType == Some(ETTD::TxnObjectType::EmandateRegister) } pub async fn get_card_brand(decider_flow: &mut DeciderFlow<'_>) -> Option { @@ -756,7 +759,7 @@ pub fn get_metric_log_format(decider_flow: &mut DeciderFlow<'_>, stage: &str) -> .and_then(|ps| last(split("@", ps))); MessageFormat { - model: txn_detail.txnObjectType.to_string(), + model: format!("{:?}", txn_detail.txnObjectType), log_type: "APP_EVENT".to_string(), payment_method: txn_card_info.paymentMethod.clone(), payment_method_type: txn_card_info.paymentMethodType.clone(), @@ -817,7 +820,7 @@ pub async fn log_gateway_decider_approach( "GATEWAY_DECIDER_APPROACH", "DECIDER", MessageFormat { - model: txn_detail.txnObjectType.to_string(), + model: format!("{:?}", txn_detail.txnObjectType), log_type: "APP_EVENT".to_string(), payment_method: txn_card_info.clone().paymentMethod, payment_method_type: txn_card_info.clone().paymentMethodType.to_string(), @@ -1360,7 +1363,7 @@ pub fn modify_gateway_decider_approach( pub fn get_juspay_bank_code_from_internal_metadata(txn_detail: &ETTD::TxnDetail) -> Option { txn_detail.internalMetadata.as_ref().and_then(|metadata| { - from_str::(metadata).ok().and_then(|json| { + from_str::(metadata.peek()).ok().and_then(|json| { json.get("juspayBankCode") .and_then(|v| v.as_str().map(|s| s.to_string())) }) @@ -1985,7 +1988,7 @@ pub async fn get_gateway_scoring_data( ) .await; let merchant_id = merchant_id_to_text(merchant.merchantId.clone()); - let order_type = txn_detail.txnObjectType.to_string(); + let order_type = format!("{:?}", txn_detail.txnObjectType); let payment_method_type = txn_card_info.paymentMethodType.to_uppercase(); let m_source_object = if txn_card_info.paymentMethod == UPI { txn_detail.sourceObject.clone().unwrap_or_default() diff --git a/src/decider/gatewaydecider/validators.rs b/src/decider/gatewaydecider/validators.rs index 5fc71869..2f53143c 100644 --- a/src/decider/gatewaydecider/validators.rs +++ b/src/decider/gatewaydecider/validators.rs @@ -210,23 +210,23 @@ pub fn parseFromApiTxnDetail(apiType: T::ApiTxnDetail) -> Option Option { - logger::info!("ELIMINATION_V2_VALUES_NOT_FOUND:ALPHA:PMT_PM_TXNOBJECTTYPE_SOURCEOBJECT {:?} {:?} {} {:?}", + logger::info!("ELIMINATION_V2_VALUES_NOT_FOUND:ALPHA:PMT_PM_TXNOBJECTTYPE_SOURCEOBJECT {:?} {:?} {:?} {:?}", txn_card_info.paymentMethodType, if txn_card_info.paymentMethod.is_empty() { "Nothing".to_string() } else { txn_card_info.paymentMethod.clone() }, txn_detail.txnObjectType, diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index c6b7a929..5018c624 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -380,6 +380,24 @@ pub fn updateGatewayScoreLock( } } +pub fn invalid_request_error(detail: &str, e: &impl std::fmt::Display) -> T::ErrorResponse { + T::ErrorResponse { + status: "400".to_string(), + error_code: "INVALID_REQUEST".to_string(), + error_message: format!("Failed to extract {}: {}", detail, e), + priority_logic_tag: None, + routing_approach: None, + filter_wise_gateways: None, + error_info: T::UnifiedError { + code: "INVALID_REQUEST".to_string(), + user_message: "Invalid request data provided".to_string(), + developer_message: format!("Error extracting {}: {}", detail, e), + }, + priority_logic_output: None, + is_dynamic_mga_enabled: false, + } +} + pub async fn check_and_update_gateway_score_( apiPayload: FT::UpdateScorePayload, ) -> Result { @@ -398,8 +416,15 @@ pub async fn check_and_update_gateway_score_( match m_gateway_scoring_data { Ok(gateway_scoring_data) => { // Extract transaction details and card info from the API payload - let txn_detail: TxnDetail = - Fbu::getTxnDetailFromApiPayload(apiPayload.clone(), gateway_scoring_data.clone()); + let txn_detail: TxnDetail = match Fbu::getTxnDetailFromApiPayload( + apiPayload.clone(), + gateway_scoring_data.clone(), + ) { + Ok(detail) => detail, + Err(e) => { + return Err(invalid_request_error("transaction details", &e)); + } + }; let txn_card_info: TxnCardInfo = Fbu::getTxnCardInfoFromApiPayload(apiPayload.clone(), gateway_scoring_data.clone()); @@ -735,7 +760,7 @@ pub fn getRoutingApproach(txnDetail: TxnDetail) -> Option { // Original Haskell function: getValueFromMetaData pub fn getValueFromMetaData(txn_detail: &TxnDetail) -> Option { let metadata = txn_detail.internalMetadata.clone()?; - serde_json::from_str(&metadata).ok() + serde_json::from_str(metadata.peek()).ok() } // Original Haskell function: isRoutingApproachInSRV2 @@ -827,7 +852,7 @@ pub async fn isUpdateWithinLatencyWindow( } async fn checkExemptIfMandateTxn(txn_detail: &TxnDetail, txn_card_info: &TxnCardInfo) -> bool { - let is_recurring = isRecurringTxn(Some(txn_detail.txnObjectType.clone())); + let is_recurring = isRecurringTxn(txn_detail.txnObjectType.clone()); let is_nb_pmt = txn_card_info.paymentMethodType == (NB); let is_penny_reg_txn = isPennyMandateRegTxn(txn_detail.clone()); is_recurring || (is_nb_pmt && is_penny_reg_txn) diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 78706fcc..4e399357 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -3,6 +3,7 @@ use crate::app::get_tenant_app_state; use crate::error::StorageError; +use masking::{PeekInterface, Secret}; // Converted imports // use eulerhs::prelude::*; // use eulerhs::language as L; @@ -163,51 +164,53 @@ pub fn convertSuccessResponseIdFlip(x: i32) -> ETTD::SuccessResponseId { pub fn getTxnDetailFromApiPayload( apiPayload: UpdateScorePayload, gateway_scoring_data: GatewayScoringData, -) -> ETTD::TxnDetail { +) -> Result { let txn_detail = ETTD::TxnDetail { id: ETTD::to_txn_detail_id(1), dateCreated: gateway_scoring_data.dateCreated, orderId: ETO::id::to_order_id(apiPayload.paymentId.clone()), status: apiPayload.status.clone(), txnId: ETId::to_transaction_id(apiPayload.paymentId.clone()), - txnType: "NOT_DEFINED".to_string(), - addToLocker: false, + txnType: Some("NOT_DEFINED".to_string()), + addToLocker: Some(false), merchantId: ETM::id::to_merchant_id(apiPayload.merchantId.clone()), gateway: Some(apiPayload.gateway), - expressCheckout: false, - isEmi: false, + expressCheckout: Some(false), + isEmi: Some(false), emiBank: None, emiTenure: None, txnUuid: apiPayload.paymentId.clone(), merchantGatewayAccountId: None, - txnAmount: ETMo::Money::from_double(0.0), - txnObjectType: ETTD::TxnObjectType::from_text(gateway_scoring_data.orderType.clone()) - .unwrap_or_else(|| ETTD::TxnObjectType::OrderPayment), + txnAmount: Some(ETMo::Money::from_double(0.0)), + txnObjectType: Some( + ETTD::TxnObjectType::from_text(gateway_scoring_data.orderType.clone()) + .unwrap_or_else(|| ETTD::TxnObjectType::OrderPayment), + ), sourceObject: Some(gateway_scoring_data.paymentMethod.clone()), sourceObjectId: None, currency: gateway_scoring_data .currency .clone() - .expect("currency is mandatory"), + .ok_or(crate::error::ApiError::MissingRequiredField("currency"))?, country: gateway_scoring_data.country.clone(), surchargeAmount: None, taxAmount: None, - internalMetadata: Some( + internalMetadata: Some(Secret::new( serde_json::to_string(&InternalMetadata { internal_tracking_info: InternalTrackingInfo { routing_approach: gateway_scoring_data.routingApproach.unwrap_or_default(), }, }) .unwrap(), - ), - netAmount: ETMo::Money::from_double(0.0), + )), + netAmount: Some(ETMo::Money::from_double(0.0)), metadata: None, offerDeductionAmount: None, internalTrackingInfo: None, partitionKey: None, txnAmountBreakup: None, }; - txn_detail + Ok(txn_detail) } pub fn getTxnCardInfoFromApiPayload( @@ -855,15 +858,19 @@ pub fn mandateRegisterTxnObjectTypes() -> Vec { } pub fn isPennyMandateRegTxn(txn_detail: TxnDetail) -> bool { - if isMandateRegTxn(txn_detail.clone().txnObjectType) { - isPennyTxnType(txn_detail.clone()) + if let Some(txn_object_type) = txn_detail.clone().txnObjectType { + if isMandateRegTxn(txn_object_type) { + isPennyTxnType(txn_detail.clone()) + } else { + false + } } else { false } } // Original Haskell function: getTxnTypeFromInternalMetadata -pub fn getTxnTypeFromInternalMetadata(internal_metadata: Option) -> MandateTxnType { +pub fn getTxnTypeFromInternalMetadata(internal_metadata: Option>) -> MandateTxnType { match internal_metadata { None => { logger::debug!( @@ -874,7 +881,7 @@ pub fn getTxnTypeFromInternalMetadata(internal_metadata: Option) -> Mand (MandateTxnType::DEFAULT) } Some(internal_metadata) => { - match serde_json::from_str::(&internal_metadata) { + match serde_json::from_str::(internal_metadata.peek()) { Ok(txn_info) => txn_info.mandateTxnInfo.txnType, Err(_) => MandateTxnType::DEFAULT, } diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index dfa180e2..662eb2cd 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -1,8 +1,14 @@ use crate::decider::gatewaydecider::types::{ErrorResponse, UnifiedError}; -use crate::feedback::gateway_scoring_service::check_and_update_gateway_score; +use crate::feedback::gateway_scoring_service::{ + check_and_update_gateway_score, invalid_request_error, +}; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; -use crate::types::card::txn_card_info::TxnCardInfo; -use crate::types::txn_details::types::{TransactionLatency, TxnDetail}; +use crate::types::card::txn_card_info::{ + convert_safe_to_txn_card_info, SafeTxnCardInfo, TxnCardInfo, +}; +use crate::types::txn_details::types::{ + convert_safe_txn_detail_to_txn_detail, SafeTxnDetail, TransactionLatency, +}; use crate::{logger, metrics}; use axum::body::to_bytes; use cpu_time::ProcessTime; @@ -10,8 +16,8 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, PartialEq)] struct UpdateScoreRequest { - txn_detail: TxnDetail, - txn_card_info: TxnCardInfo, + txn_detail: SafeTxnDetail, + txn_card_info: SafeTxnCardInfo, log_message: String, enforce_dynaic_routing_failure: Option, gateway_reference_id: Option, @@ -156,8 +162,19 @@ pub async fn update_score( } // Process the request - let txn_detail = payload.txn_detail; - let txn_card_info = payload.txn_card_info; + let txn_detail = match convert_safe_txn_detail_to_txn_detail(payload.txn_detail) { + Ok(detail) => detail, + Err(e) => { + return Err(invalid_request_error("transaction details", &e)); + } + }; + let txn_card_info = match convert_safe_to_txn_card_info(payload.txn_card_info) { + Ok(card_info) => card_info, + Err(e) => { + return Err(invalid_request_error("transaction Card Info", &e)); + } + }; + let log_message = payload.log_message; let enforce_failure = payload.enforce_dynaic_routing_failure.unwrap_or(false); let gateway_reference_id = payload.gateway_reference_id; diff --git a/src/types/card/txn_card_info.rs b/src/types/card/txn_card_info.rs index 951f7d9b..e5a580c7 100644 --- a/src/types/card/txn_card_info.rs +++ b/src/types/card/txn_card_info.rs @@ -172,3 +172,59 @@ pub struct TxnCardInfo { #[serde(deserialize_with = "deserialize_optional_primitive_datetime")] pub partitionKey: Option, } + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub struct SafeTxnCardInfo { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "cardIsin")] + pub card_isin: Option, + #[serde(rename = "cardIssuerBankName")] + pub cardIssuerBankName: Option, + #[serde(rename = "cardSwitchProvider")] + pub cardSwitchProvider: Option>, + #[serde(rename = "cardType")] + pub card_type: Option, + #[serde(rename = "nameOnCard")] + pub nameOnCard: Option>, + #[serde(with = "time::serde::iso8601")] + #[serde(rename = "dateCreated")] + pub dateCreated: OffsetDateTime, + #[serde(rename = "paymentMethodType")] + pub paymentMethodType: String, + #[serde(rename = "paymentMethod")] + pub paymentMethod: String, + #[serde(rename = "paymentSource")] + pub paymentSource: Option, + #[serde(rename = "authType")] + pub authType: Option, + #[serde(rename = "partitionKey")] + #[serde(deserialize_with = "deserialize_optional_primitive_datetime")] + pub partitionKey: Option, +} + +pub fn convert_safe_to_txn_card_info( + safe_info: SafeTxnCardInfo, +) -> Result { + let id_i64 = safe_info + .id + .parse::() + .map_err(|_| crate::error::ApiError::ParsingError("id"))?; + + Ok(TxnCardInfo { + id: TxnCardInfoPId(id_i64), + card_isin: safe_info.card_isin, + cardIssuerBankName: safe_info.cardIssuerBankName, + cardSwitchProvider: safe_info.cardSwitchProvider, + card_type: safe_info.card_type, + nameOnCard: safe_info.nameOnCard, + dateCreated: safe_info.dateCreated, + paymentMethodType: safe_info.paymentMethodType, + paymentMethod: safe_info.paymentMethod, + paymentSource: safe_info.paymentSource, + authType: safe_info + .authType + .and_then(|auth| text_to_auth_type(&auth).ok()), + partitionKey: safe_info.partitionKey, + }) +} diff --git a/src/types/order.rs b/src/types/order.rs index c1e6ed49..da2574e2 100644 --- a/src/types/order.rs +++ b/src/types/order.rs @@ -139,6 +139,8 @@ pub enum OrderType { VanPayment, #[serde(rename = "MOTO_PAYMENT")] MotoPayment, + #[serde(rename = "UNKNOWN")] + Unknown, } impl OrderType { @@ -153,6 +155,7 @@ impl OrderType { Self::TpvMandatePayment => "TPV_MANDATE_PAYMENT".to_string(), Self::VanPayment => "VAN_PAYMENT".to_string(), Self::MotoPayment => "MOTO_PAYMENT".to_string(), + Self::Unknown => "UNKNOWN".to_string(), } } @@ -186,6 +189,7 @@ impl OrderType { TxnObjectType::PartialVoid => Self::OrderPayment, TxnObjectType::VanPayment => Self::VanPayment, TxnObjectType::MotoPayment => Self::MotoPayment, + _ => Self::Unknown, } } } diff --git a/src/types/txn_details/types.rs b/src/types/txn_details/types.rs index e4b32a07..2af09466 100644 --- a/src/types/txn_details/types.rs +++ b/src/types/txn_details/types.rs @@ -21,7 +21,7 @@ use crate::types::merchant::merchant_gateway_account::MerchantGwAccId; use crate::types::money::internal::Money; use crate::types::order::id::OrderId; // use juspay::extra::parsing::{Parsed, ParsingErrorType, Step, around, defaulting, lift_either, lift_pure, mandated, non_empty_text, non_negative, parse_field, project, to_utc}; -use crate::types::source_object_id::SourceObjectId; +use crate::types::source_object_id::{to_source_object_id, SourceObjectId}; // use juspay::extra::nonemptytext::NonEmptyText; use crate::types::transaction::id::TransactionId; // use eulerhs::extra::combinators::to_domain_all; @@ -79,6 +79,8 @@ pub enum TxnObjectType { VanPayment, #[serde(rename = "MOTO_PAYMENT")] MotoPayment, + #[serde(rename = "UNKNOWN")] + Unknown, } impl fmt::Display for TxnObjectType { @@ -101,6 +103,7 @@ impl fmt::Display for TxnObjectType { Self::PartialVoid => "PARTIAL_VOID", Self::VanPayment => "VAN_PAYMENT", Self::MotoPayment => "MOTO_PAYMENT", + Self::Unknown => "UNKNOWN", } ) } @@ -123,6 +126,7 @@ impl TxnObjectType { "PARTIAL_VOID" => Some(Self::PartialVoid), "VAN_PAYMENT" => Some(Self::VanPayment), "MOTO_PAYMENT" => Some(Self::MotoPayment), + "UNKNOWN" => Some(Self::Unknown), _ => None, } } @@ -143,6 +147,7 @@ impl TxnObjectType { Self::PartialVoid => "PARTIAL_VOID", Self::VanPayment => "VAN_PAYMENT", Self::MotoPayment => "MOTO_PAYMENT", + Self::Unknown => "UNKNOWN", } } } @@ -487,6 +492,117 @@ where .transpose() } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct SafeTxnDetail { + #[serde(rename = "id")] + pub id: Option, + #[serde(rename = "orderId")] + pub orderId: OrderId, + pub status: String, + #[serde(rename = "txnId")] + pub txnId: TransactionId, + #[serde(rename = "type")] + pub txnType: String, + #[serde(with = "time::serde::iso8601::option", rename = "dateCreated")] + pub dateCreated: Option, + #[serde(rename = "addToLocker")] + pub addToLocker: Option, + #[serde(rename = "merchantId")] + pub merchantId: MerchantId, + pub gateway: Option, + #[serde(rename = "expressCheckout")] + pub expressCheckout: Option, + #[serde(rename = "isEmi")] + pub isEmi: Option, + #[serde(rename = "emiBank")] + pub emiBank: Option, + #[serde(rename = "emiTenure")] + pub emiTenure: Option, + #[serde(rename = "txnUuid")] + pub txnUuid: String, + #[serde(rename = "merchantGatewayAccountId")] + pub merchantGatewayAccountId: Option, + #[serde(rename = "txnAmount")] + pub txnAmount: Option, + #[serde(rename = "txnObjectType")] + pub txnObjectType: Option, + #[serde(rename = "sourceObject")] + pub sourceObject: Option, + #[serde(rename = "sourceObjectId")] + pub sourceObjectId: Option, + pub currency: Option, + #[serde(rename = "netAmount")] + pub netAmount: Option, + #[serde(rename = "surchargeAmount")] + pub surchargeAmount: Option, + #[serde(rename = "taxAmount")] + pub taxAmount: Option, + #[serde(rename = "offerDeductionAmount")] + pub offerDeductionAmount: Option, + pub metadata: Option>, + #[serde(rename = "internalMetadata")] + pub internalMetadata: Option>, + #[serde(rename = "internalTrackingInfo")] + pub internalTrackingInfo: Option, + #[serde( + deserialize_with = "deserialize_optional_primitive_datetime", + rename = "partitionKey" + )] + pub partitionKey: Option, + pub txnAmountBreakup: Option>, +} + +pub fn convert_safe_txn_detail_to_txn_detail( + safe_detail: SafeTxnDetail, +) -> Result { + Ok(TxnDetail { + id: safe_detail + .id + .and_then(|s| s.parse::().ok()) + .map(to_txn_detail_id) + .unwrap(), + dateCreated: safe_detail + .dateCreated + .unwrap_or_else(|| OffsetDateTime::now_utc()), + orderId: safe_detail.orderId, + status: TxnStatus::from_text(safe_detail.status).unwrap_or(TxnStatus::Failure), + txnId: safe_detail.txnId, + txnType: Some(safe_detail.txnType), + addToLocker: safe_detail.addToLocker, + merchantId: safe_detail.merchantId, + gateway: safe_detail.gateway, + expressCheckout: safe_detail.expressCheckout, + isEmi: safe_detail.isEmi, + emiBank: safe_detail.emiBank, + emiTenure: safe_detail.emiTenure.map(|t| t as i32), + txnUuid: safe_detail.txnUuid, + merchantGatewayAccountId: safe_detail + .merchantGatewayAccountId + .map(|id| MerchantGwAccId { + merchantGwAccId: id, + }), + netAmount: safe_detail.netAmount, + txnAmount: safe_detail.txnAmount, + txnObjectType: safe_detail + .txnObjectType + .and_then(|s| TxnObjectType::from_text(s)), + sourceObject: safe_detail.sourceObject, + sourceObjectId: safe_detail.sourceObjectId.map(to_source_object_id), + currency: safe_detail + .currency + .and_then(|s| Currency::text_to_curr(&s).ok()) + .ok_or(crate::error::ApiError::MissingRequiredField("currency"))?, + country: None, + surchargeAmount: safe_detail.surchargeAmount, + taxAmount: safe_detail.taxAmount, + internalMetadata: safe_detail.internalMetadata, + metadata: safe_detail.metadata, + offerDeductionAmount: safe_detail.offerDeductionAmount, + internalTrackingInfo: safe_detail.internalTrackingInfo, + partitionKey: safe_detail.partitionKey, + txnAmountBreakup: safe_detail.txnAmountBreakup, + }) +} #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct TxnDetail { #[serde(rename = "id")] @@ -501,17 +617,17 @@ pub struct TxnDetail { #[serde(rename = "txnId")] pub txnId: TransactionId, #[serde(rename = "txnType")] - pub txnType: String, + pub txnType: Option, #[serde(rename = "addToLocker")] - pub addToLocker: bool, + pub addToLocker: Option, #[serde(rename = "merchantId")] pub merchantId: MerchantId, #[serde(rename = "gateway")] pub gateway: Option, #[serde(rename = "expressCheckout")] - pub expressCheckout: bool, + pub expressCheckout: Option, #[serde(rename = "isEmi")] - pub isEmi: bool, + pub isEmi: Option, #[serde(rename = "emiBank")] pub emiBank: Option, #[serde(rename = "emiTenure")] @@ -521,11 +637,11 @@ pub struct TxnDetail { #[serde(rename = "merchantGatewayAccountId")] pub merchantGatewayAccountId: Option, #[serde(rename = "netAmount")] - pub netAmount: Money, + pub netAmount: Option, #[serde(rename = "txnAmount")] - pub txnAmount: Money, + pub txnAmount: Option, #[serde(rename = "txnObjectType")] - pub txnObjectType: TxnObjectType, + pub txnObjectType: Option, #[serde(rename = "sourceObject")] pub sourceObject: Option, #[serde(rename = "sourceObjectId")] @@ -539,9 +655,9 @@ pub struct TxnDetail { #[serde(rename = "taxAmount")] pub taxAmount: Option, #[serde(rename = "internalMetadata")] - pub internalMetadata: Option, + pub internalMetadata: Option>, #[serde(rename = "metadata")] - pub metadata: Option, + pub metadata: Option>, #[serde(rename = "offerDeductionAmount")] pub offerDeductionAmount: Option, #[serde(rename = "internalTrackingInfo")] From 27f930d2292ad4b064029d15f8dd36cd28f444e6 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Tue, 16 Sep 2025 18:25:06 +0530 Subject: [PATCH 19/95] env(euclid): add enum for cards (#153) --- config/development.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/development.toml b/config/development.toml index cce9479b..b861a62b 100644 --- a/config/development.toml +++ b/config/development.toml @@ -67,6 +67,7 @@ bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } customer_device_display_size = { type = "enum", values = "size320x568, size375x667, size390x844, size414x896, size428x926, size768x1024, size834x1112, size834x1194, size1024x1366, size1280x720, size1366x768, size1440x900, size1920x1080, size2560x1440, size3840x2160, size500x600, size600x400, size360x640, size412x915, size800x1280" } customer_device_type = { type = "enum", values = "mobile, tablet, desktop, gaming_console" } +card = { type = "enum", values = "credit, debit" } customer_device_platform = { type = "enum", values = "web, android, ios" } bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } crypto = { type = "enum", values = "crypto_currency" } From a55bdc6190df59a39a04f524f4022f564fdbb498 Mon Sep 17 00:00:00 2001 From: spritianeja03 <146620839+spritianeja03@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:41:17 +0530 Subject: [PATCH 20/95] refactor: Add latency field to decision-gateway response (#166) --- src/routes/decision_gateway.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index e89ff31b..d00e3742 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -36,6 +36,7 @@ impl IntoResponse for ErrorResponse { pub struct DecidedGatewayResponse { pub decided_gateway: DecidedGateway, pub filter_list: Vec<(String, Vec)>, + pub latency: Option, } #[axum::debug_handler] @@ -145,9 +146,11 @@ where let final_result = match result { Ok((decided_gateway, filter_list)) => { + let cpu_time = cpu_start.elapsed().as_millis() as u64; let response = DecidedGatewayResponse { decided_gateway, filter_list, + latency: Some(cpu_time), }; // Serialize response body and headers for logging From e993a20e8cbc45583804ab360fa67ac81e1610c6 Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Tue, 14 Oct 2025 14:13:46 +0530 Subject: [PATCH 21/95] fix/changes for audit-trail-log (#152) --- src/decider/gatewaydecider/gw_scoring.rs | 81 +++++++++++++++++++++++- src/decider/gatewaydecider/utils.rs | 15 ++++- src/routes/decision_gateway.rs | 4 ++ src/routes/update_score.rs | 2 +- src/utils.rs | 2 +- 5 files changed, 98 insertions(+), 6 deletions(-) diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 32f792bb..783c5da2 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1436,6 +1436,14 @@ pub async fn update_gateway_score_based_on_global_success_rate( }) .collect::>(); + logger::info!( + tag = "scoringFlow", + action = "scoringFlow", + "Gateway Success Rate Inputs for Global SR based elimination for {:?} : {:?}", + txn_detail.txnId, + gateway_success_rate_inputs + ); + let gateway_list = Utils::get_gateway_list(gateway_score.clone()); let gateway_redis_key_map = Utils::get_consumer_key( decider_flow, @@ -1446,6 +1454,14 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) .await; + logger::info!( + tag = "scoringFlow", + action = "scoringFlow", + "Gateway Redis Key Map for Global SR based elimination for {:?} : {:?}", + txn_detail.txnId, + gateway_redis_key_map + ); + let mut upd_gateway_success_rate_inputs = Vec::new(); let mut global_gateway_scores = Vec::new(); for gsri in gateway_success_rate_inputs { @@ -1454,22 +1470,57 @@ pub async fn update_gateway_score_based_on_global_success_rate( gsri.clone(), ) .await; + logger::info!( + tag = "scoringFlow", + action = "scoringFlow", + "Global Elimination Gateway Score for {:?} : {:?}", + txn_detail.txnId, + global_elimination_gateway_score + ); match global_elimination_gateway_score { Some((global_gateway_score, s)) => { + logger::info!(action = "global_gateway_score", "s-value : {:?}", s); + logger::info!( + action = "global_gateway_score", + "global_gateway_score{:?}", + global_gateway_score + ); let new_gsri = GatewayWiseSuccessRateBasedRoutingInput { currentScore: Some(s), ..gsri.clone() }; + logger::info!( + action = "global_gateway_score", + "Global Elimination Gateway Score for {:?} : {:?}", + txn_detail.txnId, + new_gsri + ); upd_gateway_success_rate_inputs.push(new_gsri); + logger::info!( + action = "global_gateway_score", + "upd_gateway_success_rate_inputs{:?}", + upd_gateway_success_rate_inputs + ); global_gateway_scores.extend(update_global_score_log( gsri.gateway.clone(), global_gateway_score, )); + logger::info!( + action = "update_global_score_log", + "global_gateway_scores{:?}", + global_gateway_scores + ); } None => {} } } + logger::info!( + action = "update_gateway_score_based_on_global_success_rate", + "upd_gateway_success_rate_inputs{:?}", + upd_gateway_success_rate_inputs + ); + let filtered_gateway_success_rate_inputs: Vec< GatewayWiseSuccessRateBasedRoutingInput, > = upd_gateway_success_rate_inputs @@ -1483,6 +1534,12 @@ pub async fn update_gateway_score_based_on_global_success_rate( }) .collect(); + logger::info!( + action = "filtered_gateway_success_rate_inputs", + "filtered_gateway_success_rate_inputs{:?}", + filtered_gateway_success_rate_inputs + ); + reset_metric_log_data(decider_flow); let init_metric_log_data = decider_flow.writer.srMetricLogData.clone(); let before_gwsm = get_gwsm(decider_flow); @@ -1930,7 +1987,10 @@ pub async fn get_sr1_and_sr2_and_n( } else { Some(txn_card_info.paymentMethod.clone()) }; - let txn_obj_type = format!("{:?}", txn_detail.txnObjectType); + let txn_obj_type = txn_detail + .txnObjectType + .map(|t| t.to_string()) + .unwrap_or_default(); filter_using_service_config(merchant_id, pmt.to_string(), pm, txn_obj_type, inputs) .await @@ -2308,6 +2368,17 @@ pub async fn update_gateway_score_based_on_success_rate( let (default_success_rate_based_routing_input, gateway_success_rate_merchant_input) = get_success_rate_routing_inputs(merchant_acc.clone()).await; + logger::info!( + action = "update_gateway_score_based_on_success_rate", + "Default SR based routing input: {:?}", + default_success_rate_based_routing_input + ); + logger::info!( + action = "update_gateway_score_based_on_success_rate", + "Merchant SR based routing input: {:?}", + gateway_success_rate_merchant_input + ); + let is_reset_score_enabled_for_merchant = isFeatureEnabled( C::GATEWAY_RESET_SCORE_ENABLED.get_key(), Utils::get_m_id(txn_detail.merchantId.clone()), @@ -2315,6 +2386,12 @@ pub async fn update_gateway_score_based_on_success_rate( ) .await; + logger::info!( + action = "update_gateway_score_based_on_success_rate", + "Is reset score enabled for merchant {:?}", + is_reset_score_enabled_for_merchant + ); + let payment_method_type = if Utils::is_card_transaction(&txn_card_info) { CARD } else { @@ -2326,6 +2403,8 @@ pub async fn update_gateway_score_based_on_success_rate( .map(|input| input.enabledPaymentMethodTypes.clone()) .unwrap_or_default(); + logger::info!(action = "update_gateway_score_based_on_success_rate","Enabled payment method types for merchant {:?} and Payment method type for transaction {:?}", enabled_payment_method_types, payment_method_type); + if !enabled_payment_method_types.is_empty() && !enabled_payment_method_types.contains(&payment_method_type.to_string()) { diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 15c7b277..04c853c2 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -759,7 +759,10 @@ pub fn get_metric_log_format(decider_flow: &mut DeciderFlow<'_>, stage: &str) -> .and_then(|ps| last(split("@", ps))); MessageFormat { - model: format!("{:?}", txn_detail.txnObjectType), + model: txn_detail + .txnObjectType + .map(|t| t.to_string()) + .unwrap_or_default(), log_type: "APP_EVENT".to_string(), payment_method: txn_card_info.paymentMethod.clone(), payment_method_type: txn_card_info.paymentMethodType.clone(), @@ -820,7 +823,10 @@ pub async fn log_gateway_decider_approach( "GATEWAY_DECIDER_APPROACH", "DECIDER", MessageFormat { - model: format!("{:?}", txn_detail.txnObjectType), + model: txn_detail + .txnObjectType + .map(|t| t.to_string()) + .unwrap_or_default(), log_type: "APP_EVENT".to_string(), payment_method: txn_card_info.clone().paymentMethod, payment_method_type: txn_card_info.clone().paymentMethodType.to_string(), @@ -1988,7 +1994,10 @@ pub async fn get_gateway_scoring_data( ) .await; let merchant_id = merchant_id_to_text(merchant.merchantId.clone()); - let order_type = format!("{:?}", txn_detail.txnObjectType); + let order_type = txn_detail + .txnObjectType + .map(|t| t.to_string()) + .unwrap_or_default(); let payment_method_type = txn_card_info.paymentMethodType.to_uppercase(); let m_source_object = if txn_card_info.paymentMethod == UPI { txn_detail.sourceObject.clone().unwrap_or_default() diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index d00e3742..af236784 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -135,6 +135,10 @@ where tracing::Span::current().record("txn_uuid", payload.txnDetail.txnUuid.clone()); tracing::Span::current() .record("udf_order_id", payload.orderReference.orderId.0.as_str()); + tracing::Span::current().record( + "is_audit_trail_log", + payload.shouldConsumeResult.unwrap_or(false), + ); jemalloc_ctl::epoch::advance().unwrap(); let allocated_before = jemalloc_ctl::stats::allocated::read().unwrap_or(0); diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index 662eb2cd..18ae46f9 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -49,7 +49,7 @@ pub async fn update_score( .format(&time::format_description::well_known::Rfc3339) .unwrap_or_else(|_| "unknown".to_string()); let query_params = original_url.splitn(2, '?').nth(1).unwrap_or("").to_string(); - + tracing::Span::current().record("is_audit_trail_log", "true"); // Buffer the body into memory let body_bytes = match to_bytes(req.into_body(), usize::MAX).await { Ok(bytes) => bytes, diff --git a/src/utils.rs b/src/utils.rs index 9e48a2cb..f727de2d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -69,7 +69,7 @@ pub fn record_fields_from_header(request: &Request) -> tracing::Span { record_field(consts::X_SESSION_ID, "sdk_session_span"); record_field(consts::X_CELL_SELECTOR, "cell_selector"); record_field(consts::X_ART_RECORDING, "is_art_enabled"); - span.record("is_audit_trail_log", "true"); + span.record("is_audit_trail_log", "false"); span.record("schema_version", "V2"); span.record("tenant_name", "JUSPAY"); span.record("tenant_id", "JUSPAY"); From 01a2d4d719ec42a410e17cc682f73ab24a473922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Decher?= Date: Tue, 21 Oct 2025 18:11:47 +0200 Subject: [PATCH 22/95] fix: all rustc warnings elided_lifetimes_in_path (#158) --- src/decider/gatewaydecider/gw_filter.rs | 18 +++++++++--------- src/decider/gatewaydecider/types.rs | 2 +- src/decider/network_decider/utils.rs | 4 +++- src/types/card/txn_card_info.rs | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index f9e43953..af7004ce 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -66,7 +66,7 @@ where v_mut } -pub fn getGws(this: &mut DeciderFlow) -> Vec { +pub fn getGws(this: &mut DeciderFlow<'_>) -> Vec { this.writer.functionalGateways.clone() } @@ -80,7 +80,7 @@ fn makeFirstLetterSmall(s: String) -> String { } pub fn returnGwListWithLog( - this: &mut DeciderFlow, + this: &mut DeciderFlow<'_>, fName: DeciderFilterName, doOrNot: bool, ) -> Vec { @@ -127,7 +127,7 @@ where } pub fn setGwsAndMgas( - this: &mut DeciderFlow, + this: &mut DeciderFlow<'_>, filteredMgas: Vec, ) { Utils::set_mgas(this, filteredMgas.clone()); @@ -136,7 +136,7 @@ pub fn setGwsAndMgas( } /// Sets the functional gateways in the DeciderFlow and updates related merchant gateway accounts -pub fn setGws(this: &mut DeciderFlow, gws: Vec) { +pub fn setGws(this: &mut DeciderFlow<'_>, gws: Vec) { // Get the merchant gateway accounts let m_mgas = Utils::get_mgas(this); @@ -406,7 +406,7 @@ pub async fn getFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList { } fn validateAndSetDynamicMGAFlag( - this: &mut DeciderFlow, + this: &mut DeciderFlow<'_>, proceed_with_all_mgas: bool, mgas: &Vec, ) { @@ -424,7 +424,7 @@ fn validateAndSetDynamicMGAFlag( } pub fn filterMGAsByEnforcedPaymentFlows( - this: &mut DeciderFlow, + this: &mut DeciderFlow<'_>, initial_mgas: Vec, ) -> Vec { // Extract unique gateways from the merchant gateway accounts @@ -1793,7 +1793,7 @@ where /// Determines if a merchant gateway account matches the provided gateway reference ID /// Used for gateway reference ID based routing pub fn predicate( - this: &mut DeciderFlow, + this: &mut DeciderFlow<'_>, mga: ETM::merchant_gateway_account::MerchantGatewayAccount, gw: String, metadata: HashMap, @@ -2809,7 +2809,7 @@ pub fn validate_only_one_mga( /// Filters gateways for EMI tenure-specific merchant gateway accounts /// Keeps only gateways that support the specific EMI tenure requested in the transaction -pub fn filterForEMITenureSpecificMGAs(this: &mut DeciderFlow) -> Vec { +pub fn filterForEMITenureSpecificMGAs(this: &mut DeciderFlow<'_>) -> Vec { // Get transaction details from context let txn_detail = this.get().dpTxnDetail.clone(); @@ -3082,7 +3082,7 @@ fn getTxnTypeSupportedGateways( /// Filters gateways and merchant gateway accounts based on UPI payment flow support /// Checks both V2 integration and UPI intent capabilities pub fn filterGatewaysForUpiPayBasedOnSupportedFlow( - this: &mut DeciderFlow, + this: &mut DeciderFlow<'_>, gws: Vec, mgas: Vec, v2_integration_not_supported_gateways: Vec, diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index fac1ec3e..53146a49 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -297,7 +297,7 @@ struct GatewayScoringTypeLogVisitor; impl<'de> serde::de::Visitor<'de> for GatewayScoringTypeLogVisitor { type Value = AValue; - fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct GatewayScoringTypeLog") } diff --git a/src/decider/network_decider/utils.rs b/src/decider/network_decider/utils.rs index 50781124..c0a0bd96 100644 --- a/src/decider/network_decider/utils.rs +++ b/src/decider/network_decider/utils.rs @@ -22,7 +22,9 @@ macro_rules! impl_to_sql_from_sql_text_mysql { impl ::diesel::deserialize::FromSql<::diesel::sql_types::Text, ::diesel::mysql::Mysql> for $type { - fn from_sql(value: ::diesel::mysql::MysqlValue) -> ::diesel::deserialize::Result { + fn from_sql( + value: ::diesel::mysql::MysqlValue<'_>, + ) -> ::diesel::deserialize::Result { use ::core::str::FromStr; let s = ::core::str::from_utf8(value.as_bytes())?; <$type>::from_str(s).map_err(|_| "Unrecognized enum variant".into()) diff --git a/src/types/card/txn_card_info.rs b/src/types/card/txn_card_info.rs index e5a580c7..8e230d21 100644 --- a/src/types/card/txn_card_info.rs +++ b/src/types/card/txn_card_info.rs @@ -39,7 +39,7 @@ pub enum AuthType { } impl std::fmt::Display for AuthType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::ATMPIN => write!(f, "ATMPIN"), Self::THREE_DS => write!(f, "THREE_DS"), From 8f33716b4e5975b353b8107b9785eec16cd2661e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Decher?= Date: Tue, 21 Oct 2025 18:42:24 +0200 Subject: [PATCH 23/95] fix: multiple bound declarations (#163) --- src/decider/gatewaydecider/gw_filter.rs | 5 +---- src/error/container.rs | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index af7004ce..5a20ac0d 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -117,10 +117,7 @@ pub fn catMaybes(options: &[Option]) -> Vec { options.iter().filter_map(|opt| opt.clone()).collect() } -pub fn intersect(a: &[T], b: &[T]) -> Vec -where - T: Clone, -{ +pub fn intersect(a: &[T], b: &[T]) -> Vec { let set_a: HashSet<_> = a.iter().collect(); let set_b: HashSet<_> = b.iter().collect(); set_a.intersection(&set_b).cloned().cloned().collect() diff --git a/src/error/container.rs b/src/error/container.rs index bb80d7dd..ab43d521 100644 --- a/src/error/container.rs +++ b/src/error/container.rs @@ -37,8 +37,7 @@ pub trait ErrorTransform {} impl From> for ContainerError where T: error_stack::Context, - U: error_stack::Context, - for<'a> U: From<&'a T> + Sync + Send, + for<'a> U: error_stack::Context + From<&'a T> + Sync + Send, Self: ErrorTransform>, { #[track_caller] From 4df1e67e6f19c7e9c010a1b52a9e93f6dbb0cc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Decher?= Date: Tue, 21 Oct 2025 18:43:05 +0200 Subject: [PATCH 24/95] fix: remove redundant condition (#162) --- src/decider/gatewaydecider/gw_scoring.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 783c5da2..bcfa88ed 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -3171,11 +3171,9 @@ pub fn route_random_traffic( .chain(head_gateways.iter()) .collect::>() ); - if is_sr_v3_metric_enabled { - set_decider_approach(decider_flow, GatewayDeciderApproach::SR_V3_HEDGING); - } else { - set_decider_approach(decider_flow, GatewayDeciderApproach::SR_V3_HEDGING); - } + + set_decider_approach(decider_flow, GatewayDeciderApproach::SR_V3_HEDGING); + remaining_gateways .into_iter() .map(|(gw, score)| (gw.clone(), score)) From f318020a4df3f914b3f6522a3f57939e5e873328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Decher?= Date: Tue, 21 Oct 2025 18:44:02 +0200 Subject: [PATCH 25/95] fix: remove all rustc dead_code warnings (#161) --- src/config.rs | 11 ---- src/decider/gatewaydecider/flow_new.rs | 33 +---------- src/decider/gatewaydecider/flows.rs | 33 ----------- src/decider/gatewaydecider/types.rs | 2 + src/decider/gatewaydecider/utils.rs | 58 ------------------- .../gateway_selection_scoring_v3/flow.rs | 22 ------- src/logger/formatter.rs | 2 +- src/storage.rs | 3 - 8 files changed, 4 insertions(+), 160 deletions(-) diff --git a/src/config.rs b/src/config.rs index 61f72496..cb76e67a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -111,17 +111,6 @@ pub struct TenantSecrets { pub schema: String, } -fn deserialize_hex<'de, D>(deserializer: D) -> Result, D::Error> -where - D: serde::Deserializer<'de>, -{ - let deserialized_str: String = serde::Deserialize::deserialize(deserializer)?; - - let deserialized_str = deserialized_str.into_bytes(); - - Ok(deserialized_str) -} - #[derive(serde::Deserialize, Debug, Clone)] pub struct TenantsSecrets(HashMap); diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 93762a9c..93aa9487 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -563,6 +563,7 @@ pub async fn runDeciderFlow( } } +#[allow(dead_code)] fn getGatewayToMGAIdMapF(allMgas: &Vec, gateways: &Vec) -> AValue { json!(gateways .iter() @@ -661,38 +662,6 @@ async fn filterFunctionalGatewaysWithEnforcment( // } // } -fn defaultDecidedGateway( - gw: String, - gpm: Option, - priorityLogicTag: Option, - finalDeciderApproach: T::GatewayDeciderApproach, - topGatewayBeforeSRDowntimeEvaluation: Option, - priorityLogicOutput: Option, - resetApproach: T::ResetApproach, - routingDimension: Option, - routingDimensionLevel: Option, - isScheduledOutage: bool, - isDynamicMGAEnabled: bool, -) -> T::DecidedGateway { - T::DecidedGateway { - decided_gateway: gw, - gateway_priority_map: gpm, - filter_wise_gateways: None, - priority_logic_tag: priorityLogicTag, - routing_approach: finalDeciderApproach, - gateway_before_evaluation: topGatewayBeforeSRDowntimeEvaluation, - priority_logic_output: priorityLogicOutput, - debit_routing_output: None, - reset_approach: resetApproach, - routing_dimension: routingDimension, - routing_dimension_level: routingDimensionLevel, - is_scheduled_outage: isScheduledOutage, - is_dynamic_mga_enabled: isDynamicMGAEnabled, - gateway_mga_id_map: None, - is_rust_based_decider: true, - } -} - // async fn addMetricsToStream( // decidedGateway: Option<&Gateway>, // finalDeciderApproach: T::RoutingApproach, diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 3c6d1156..38773228 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -840,39 +840,6 @@ async fn filterFunctionalGatewaysWithEnforcment( // } // } -fn defaultDecidedGateway( - gw: String, - gpm: Option, - priorityLogicTag: Option, - finalDeciderApproach: T::GatewayDeciderApproach, - topGatewayBeforeSRDowntimeEvaluation: Option, - priorityLogicOutput: Option, - resetApproach: T::ResetApproach, - routingDimension: Option, - routingDimensionLevel: Option, - isScheduledOutage: bool, - isDynamicMGAEnabled: bool, - gatewayMgaIdMap: Option, -) -> T::DecidedGateway { - T::DecidedGateway { - decided_gateway: gw, - gateway_priority_map: gpm, - filter_wise_gateways: None, - priority_logic_tag: priorityLogicTag, - routing_approach: finalDeciderApproach, - gateway_before_evaluation: topGatewayBeforeSRDowntimeEvaluation, - priority_logic_output: priorityLogicOutput, - debit_routing_output: None, - reset_approach: resetApproach, - routing_dimension: routingDimension, - routing_dimension_level: routingDimensionLevel, - is_scheduled_outage: isScheduledOutage, - is_dynamic_mga_enabled: isDynamicMGAEnabled, - gateway_mga_id_map: gatewayMgaIdMap, - is_rust_based_decider: true, - } -} - // async fn addMetricsToStream( // decidedGateway: Option<&Gateway>, // finalDeciderApproach: T::RoutingApproach, diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 53146a49..42785a47 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -565,9 +565,11 @@ pub struct GatewayScoringData { } #[derive(Debug)] +#[allow(dead_code)] pub struct MetricsStreamKeyShard(String, i32); #[derive(Debug)] +#[allow(dead_code)] pub struct MetricsStreamKey(String); // # TODO - Implement RedisKey for MetricsStreamKeyShard diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 04c853c2..23505f6f 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -474,24 +474,6 @@ pub fn get_value_from_text(key: &str, t: &Value) -> Option { } } -fn get_enabled_gateway_for_brand(brand: &str, enabled_gateways: Option<&Value>) -> Option { - enabled_gateways.and_then(|gateways| match gateways { - Value::Object(map) => map.get(brand).cloned(), - _ => None, - }) -} - -fn parse_aeson_string Deserialize<'de>>(value: &Value) -> Option { - match value { - Value::String(s) => from_str(s).ok(), - _ => None, - } -} - -fn result_to_maybe(result: Result) -> Option { - result.ok() -} - fn decode_metadata(text: &str) -> HashMap { from_str::>(text) .unwrap_or_default() @@ -1114,12 +1096,6 @@ async fn get_upi_handle_list() -> Vec { .unwrap_or_default() } -async fn get_upi_psp_list() -> Vec { - RService::findByNameFromRedis(C::V2_ROUTING_PSP_LIST.get_key()) - .await - .unwrap_or_default() -} - async fn get_routing_top_bank_list() -> Vec { RService::findByNameFromRedis(C::V2_ROUTING_TOP_BANK_LIST.get_key()) .await @@ -1147,27 +1123,6 @@ pub fn get_bin_list(card_bin: Option) -> Vec> { } } -async fn get_isin_routes_with_extended_bins( - card_bin: Option, - merchant_id: MerchantId, -) -> Option { - match get_true_string(card_bin) { - None => None, - Some(bin) => { - let bin_list = if bin.len() > 6 { - (6..=9).map(|len| bin[..len].to_string()).collect() - } else { - vec![bin] - }; - let mut isin_route_list = - ETIsinR::find_all_by_isin_and_merchant_id(bin_list, &merchant_id).await; - isin_route_list.sort_by(|x, y| y.isin.cmp(&x.isin)); - let reverse_list: Vec<_> = isin_route_list.into_iter().collect(); - reverse_list.first().cloned() - } - } -} - pub async fn get_card_info_by_bin(card_bin: Option) -> Option { logger::debug!("getCardInfoByBin cardBin: {:?}", card_bin); match get_true_string(card_bin) { @@ -1219,19 +1174,6 @@ pub fn get_payment_flow_list_from_txn_detail(txn_detail: &ETTD::TxnDetail) -> Ve use crate::decider::gatewaydecider::types::PaymentFlowInfoInInternalTrackingInfo; -fn get_payment_flow_list_from_txn_detail_(txn_detail: &ETTD::TxnDetail) -> Vec { - match txn_detail - .internalTrackingInfo - .as_ref() - .and_then(|info| either_decode_t(info).ok()) - { - Some(PaymentFlowInfoInInternalTrackingInfo { paymentFlowInfo }) => { - paymentFlowInfo.paymentFlows - } - None => vec![], - } -} - pub fn set_payment_flow_list(decider_flow: &mut DeciderFlow<'_>, payment_flow_list: Vec) { decider_flow.writer.paymentFlowList = payment_flow_list; } diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index 994c365b..00415fe9 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -292,28 +292,6 @@ pub async fn updateScoreAndQueue( } } -fn debugBlock( - txn_detail: TxnDetail, - current_time: String, - date_created: String, - value: String, -) -> SrV3DebugBlock { - SrV3DebugBlock { - txn_uuid: txn_detail.txnUuid, - order_id: txn_detail.orderId.0, - date_created, - current_time, - txn_status: value, - } -} - -fn getStatus(maybe_popped_status_block: Option, popped_status: String) -> String { - match maybe_popped_status_block { - Some(popped_status_block) => popped_status_block.txn_status.clone(), - None => popped_status, - } -} - //Original Haskell function: getSrV3MerchantBucketSize pub async fn getSrV3MerchantBucketSize(txn_detail: TxnDetail, txn_card_info: TxnCardInfo) -> i32 { let merchant_sr_v3_input_config: Option = findByNameFromRedis( diff --git a/src/logger/formatter.rs b/src/logger/formatter.rs index 7409a1b8..f9cd40e2 100644 --- a/src/logger/formatter.rs +++ b/src/logger/formatter.rs @@ -31,7 +31,6 @@ use tracing_subscriber::{ // Implicit keys -const MESSAGE: &str = "message"; const HOSTNAME: &str = "hostname"; const PID: &str = "pid"; const LEVEL: &str = "level"; @@ -91,6 +90,7 @@ impl fmt::Display for RecordType { /// `FormattingLayer` relies on the `tracing_bunyan_formatter::JsonStorageLayer` which is storage of entries. /// #[derive(Debug)] +#[allow(dead_code)] pub struct FormattingLayer where W: for<'a> MakeWriter<'a> + 'static, diff --git a/src/storage.rs b/src/storage.rs index 1770e559..eed890f6 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -71,9 +71,6 @@ pub type MysqlPool = bb8::Pool; #[cfg(feature = "postgres")] type DeadPoolConnType = Object; -#[cfg(feature = "mysql")] -type DeadPoolConnType = Object; - #[cfg(feature = "postgres")] impl Storage { /// Create a new storage interface from configuration From a58f8e108a90a6393b1e38c6852fa530746da372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Decher?= Date: Wed, 22 Oct 2025 10:31:21 +0200 Subject: [PATCH 26/95] fix: all rustc non upper case globals (#165) --- src/decider/gatewaydecider/Untitled-1 | 2 +- src/decider/gatewaydecider/constants.rs | 661 +++++++------- src/decider/gatewaydecider/flow_new.rs | 24 +- src/decider/gatewaydecider/flows.rs | 22 +- src/decider/gatewaydecider/gw_filter.rs | 144 +-- src/decider/gatewaydecider/gw_filter_new.rs | 128 +-- src/decider/gatewaydecider/gw_scoring.rs | 143 ++- src/decider/gatewaydecider/runner.rs | 36 +- src/decider/gatewaydecider/types.rs | 338 +++---- src/decider/gatewaydecider/utils.rs | 145 ++- src/decider/network_decider/debit_routing.rs | 6 +- src/feedback/constants.rs | 180 ++-- .../gateway_elimination_scoring/flow.rs | 89 +- src/feedback/gateway_scoring_service.rs | 56 +- .../gateway_selection_scoring_v3/flow.rs | 16 +- src/feedback/types.rs | 41 +- src/feedback/utils.rs | 82 +- src/merchant_config_util.rs | 30 +- src/redis/types.rs | 20 +- src/types/card/txn_card_info.rs | 110 +-- src/types/gateway.rs | 801 ++++++++-------- src/types/gateway_routing_input.rs | 25 +- src/types/merchant_config/types.rs | 17 +- .../merchant_gateway_account_sub_info.rs | 8 +- src/types/payment/payment_method.rs | 92 +- src/types/payment_flow.rs | 854 +++++++++--------- src/types/tenant/tenant_config.rs | 36 +- src/types/txn_details/types.rs | 13 +- src/types/txn_offer_info.rs | 10 +- 29 files changed, 2051 insertions(+), 2078 deletions(-) diff --git a/src/decider/gatewaydecider/Untitled-1 b/src/decider/gatewaydecider/Untitled-1 index e86f2aca..e3557aa5 100644 --- a/src/decider/gatewaydecider/Untitled-1 +++ b/src/decider/gatewaydecider/Untitled-1 @@ -89,7 +89,7 @@ Example :- fgws } -Use m_validation_type.map(|vt| vt == ValidationType::CARD_MANDATE).unwrap_or(false) this kind of syntaxes for equality on Options +Use m_validation_type.map(|vt| vt == ValidationType::CardMandate).unwrap_or(false) this kind of syntaxes for equality on Options Please generate it for the below function diff --git a/src/decider/gatewaydecider/constants.rs b/src/decider/gatewaydecider/constants.rs index 1a5ded74..de5ddd68 100644 --- a/src/decider/gatewaydecider/constants.rs +++ b/src/decider/gatewaydecider/constants.rs @@ -2,125 +2,125 @@ use masking::{PeekInterface, Secret}; use crate::redis::types as SC; -pub struct ENABLE_OPTIMIZATION_DURING_DOWNTIME; -impl SC::ServiceConfigKey for ENABLE_OPTIMIZATION_DURING_DOWNTIME { +pub struct EnableOptimizationDuringDowntime; +impl SC::ServiceConfigKey for EnableOptimizationDuringDowntime { fn get_key(&self) -> String { "enable_optimization_during_downtime".to_string() } } -pub const enableOptimizationDuringDowntime: ENABLE_OPTIMIZATION_DURING_DOWNTIME = - ENABLE_OPTIMIZATION_DURING_DOWNTIME; +pub const ENABLE_OPTIMIZATION_DURING_DOWNTIME: EnableOptimizationDuringDowntime = + EnableOptimizationDuringDowntime; -pub struct DEFAULT_SR_BASED_GATEWAY_ELIMINATION_INPUT; -impl SC::ServiceConfigKey for DEFAULT_SR_BASED_GATEWAY_ELIMINATION_INPUT { +pub struct DefaultSrBasedGatewayEliminationInput; +impl SC::ServiceConfigKey for DefaultSrBasedGatewayEliminationInput { fn get_key(&self) -> String { "DEFAULT_SR_BASED_GATEWAY_ELIMINATION_INPUT".to_string() } } -pub const defaultSRBasedGatewayEliminationInput: DEFAULT_SR_BASED_GATEWAY_ELIMINATION_INPUT = - DEFAULT_SR_BASED_GATEWAY_ELIMINATION_INPUT; +pub const DEFAULT_SRBASED_GATEWAY_ELIMINATION_INPUT: DefaultSrBasedGatewayEliminationInput = + DefaultSrBasedGatewayEliminationInput; //TODO : This is duplicate and is same key is already there in decider constants.rs -pub struct SR_V3_INPUT_CONFIG(String); -impl SC::ServiceConfigKey for SR_V3_INPUT_CONFIG { +pub struct SrV3InputConfig(String); +impl SC::ServiceConfigKey for SrV3InputConfig { fn get_key(&self) -> String { format!("SR_V3_INPUT_CONFIG_{}", self.0) } } -pub fn srV3InputConfig(mid: String) -> SR_V3_INPUT_CONFIG { - SR_V3_INPUT_CONFIG(mid) +pub fn srV3InputConfig(mid: String) -> SrV3InputConfig { + SrV3InputConfig(mid) } //TODO : This is duplicate and is same key is already there in decider constants.rs -pub struct SR_V3_INPUT_CONFIG_DEFAULT; -impl SC::ServiceConfigKey for SR_V3_INPUT_CONFIG_DEFAULT { +pub struct SrV3InputConfigDefault; +impl SC::ServiceConfigKey for SrV3InputConfigDefault { fn get_key(&self) -> String { "SR_V3_INPUT_CONFIG_DEFAULT".to_string() } } -pub const srV3DefaultInputConfig: SR_V3_INPUT_CONFIG_DEFAULT = SR_V3_INPUT_CONFIG_DEFAULT; +pub const SR_V3_DEFAULT_INPUT_CONFIG: SrV3InputConfigDefault = SrV3InputConfigDefault; pub const DEFAULT_SR_V3_BASED_BUCKET_SIZE: i32 = 125; -pub const defaultSrV3BasedUpperResetFactor: f64 = 3.0; -pub const defaultSrV3BasedLowerResetFactor: f64 = 3.0; -pub const defaultSrV3BasedHedgingPercent: f64 = 5.0; +pub const DEFAULT_SR_V3_BASED_UPPER_RESET_FACTOR: f64 = 3.0; +pub const DEFAULT_SR_V3_BASED_LOWER_RESET_FACTOR: f64 = 3.0; +pub const DEFAULT_SR_V3_BASED_HEDGING_PERCENT: f64 = 5.0; pub const DEFAULT_SR_V3_BASED_GATEWAY_SIGMA_FACTOR: f64 = 0.0; -pub struct ALT_ID_ENABLED_GATEWAY_FOR_EMIBANK; -impl SC::ServiceConfigKey for ALT_ID_ENABLED_GATEWAY_FOR_EMIBANK { +pub struct AltIdEnabledGatewayForEmibank; +impl SC::ServiceConfigKey for AltIdEnabledGatewayForEmibank { fn get_key(&self) -> String { "ALT_ID_ENABLED_GATEWAY_FOR_EMIBANK".to_string() } } -pub const altIdEnabledGatewayEmiBank: ALT_ID_ENABLED_GATEWAY_FOR_EMIBANK = - ALT_ID_ENABLED_GATEWAY_FOR_EMIBANK; +pub const ALT_ID_ENABLED_GATEWAY_EMI_BANK: AltIdEnabledGatewayForEmibank = + AltIdEnabledGatewayForEmibank; -pub struct SR_BASED_TRANSACTION_RESET_COUNT; -impl SC::ServiceConfigKey for SR_BASED_TRANSACTION_RESET_COUNT { +pub struct SrBasedTransactionResetCount; +impl SC::ServiceConfigKey for SrBasedTransactionResetCount { fn get_key(&self) -> String { "SR_BASED_TRANSACTION_RESET_COUNT".to_string() } } -pub const srBasedTxnResetCount: SR_BASED_TRANSACTION_RESET_COUNT = SR_BASED_TRANSACTION_RESET_COUNT; +pub const SR_BASED_TXN_RESET_COUNT: SrBasedTransactionResetCount = SrBasedTransactionResetCount; -pub struct SCHEDULED_OUTAGE_VALIDATION_DURATION; -impl SC::ServiceConfigKey for SCHEDULED_OUTAGE_VALIDATION_DURATION { +pub struct ScheduledOutageValidationDuration; +impl SC::ServiceConfigKey for ScheduledOutageValidationDuration { fn get_key(&self) -> String { "SCHEDULED_OUTAGE_VALIDATION_DURATION".to_string() } } -pub struct ENABLE_ELIMINATION_V2; -impl SC::ServiceConfigKey for ENABLE_ELIMINATION_V2 { +pub struct EnableEliminationV2; +impl SC::ServiceConfigKey for EnableEliminationV2 { fn get_key(&self) -> String { "ENABLE_ELIMINATION_V2".to_string() } } -pub const enableEliminationV2: ENABLE_ELIMINATION_V2 = ENABLE_ELIMINATION_V2; +pub const ENABLE_ELIMINATION_V2: EnableEliminationV2 = EnableEliminationV2; -pub struct ENABLE_OUTAGE_V2; -impl SC::ServiceConfigKey for ENABLE_OUTAGE_V2 { +pub struct EnableOutageV2; +impl SC::ServiceConfigKey for EnableOutageV2 { fn get_key(&self) -> String { "ENABLE_OUTAGE_V2".to_string() } } -pub const enableEliminationV2ForOutage: ENABLE_OUTAGE_V2 = ENABLE_OUTAGE_V2; +pub const ENABLE_ELIMINATION_V2_FOR_OUTAGE: EnableOutageV2 = EnableOutageV2; -pub const thresholdWeightSr1: &str = "THRESHOLD_WEIGHT_SR1"; -pub const thresholdWeightSr2: &str = "THRESHOLD_WEIGHT_SR2"; +pub const THRESHOLD_WEIGHT_SR1: &str = "THRESHOLD_WEIGHT_SR1"; +pub const THRESHOLD_WEIGHT_SR2: &str = "THRESHOLD_WEIGHT_SR2"; -pub struct DEFAULT_SR1(String); -impl SC::ServiceConfigKey for DEFAULT_SR1 { +pub struct DefaultSr1(String); +impl SC::ServiceConfigKey for DefaultSr1 { fn get_key(&self) -> String { format!("DEFAULT_SR1_{}", self.0) } } -pub fn defaultSr1SConfigPrefix(val: String) -> DEFAULT_SR1 { - DEFAULT_SR1(val) +pub fn defaultSr1SConfigPrefix(val: String) -> DefaultSr1 { + DefaultSr1(val) } -pub struct DEFAULT_N(String); -impl SC::ServiceConfigKey for DEFAULT_N { +pub struct DefaultN(String); +impl SC::ServiceConfigKey for DefaultN { fn get_key(&self) -> String { format!("DEFAULT_N_{}", self.0) } } -pub fn defaultNSConfigPrefix(val: String) -> DEFAULT_N { - DEFAULT_N(val) +pub fn defaultNSConfigPrefix(val: String) -> DefaultN { + DefaultN(val) } -pub struct INTERNAL_DEFAULT_ELIMINATION_V2_SUCCESS_RATE_1_AND_N(String); -impl SC::ServiceConfigKey for INTERNAL_DEFAULT_ELIMINATION_V2_SUCCESS_RATE_1_AND_N { +pub struct InternalDefaultEliminationV2SuccessRate1AndN(String); +impl SC::ServiceConfigKey for InternalDefaultEliminationV2SuccessRate1AndN { fn get_key(&self) -> String { format!( "INTERNAL_DEFAULT_ELIMINATION_V2_SUCCESS_RATE_1_AND_N_{}", @@ -131,48 +131,48 @@ impl SC::ServiceConfigKey for INTERNAL_DEFAULT_ELIMINATION_V2_SUCCESS_RATE_1_AND pub fn internalDefaultEliminationV2SuccessRate1AndNPrefix( val: String, -) -> INTERNAL_DEFAULT_ELIMINATION_V2_SUCCESS_RATE_1_AND_N { - INTERNAL_DEFAULT_ELIMINATION_V2_SUCCESS_RATE_1_AND_N(val) +) -> InternalDefaultEliminationV2SuccessRate1AndN { + InternalDefaultEliminationV2SuccessRate1AndN(val) } -pub const defaultFieldNameForSR1AndN: &str = "default"; -pub const sr1KeyPrefix: &str = "sr1_"; -pub const nKeyPrefix: &str = "n_"; +pub const DEFAULT_FIELD_NAME_FOR_SR1_AND_N: &str = "default"; +pub const SR1_KEY_PREFIX: &str = "sr1_"; +pub const N_KEY_PREFIX: &str = "n_"; -pub const gwDefaultTxnSoftResetCount: i64 = 10; -pub const defaultGlobalSelectionVolumeThreshold: i64 = 20; +pub const GW_DEFAULT_TXN_SOFT_RESET_COUNT: i64 = 10; +pub const DEFAULT_GLOBAL_SELECTION_VOLUME_THRESHOLD: i64 = 20; -pub struct GATEWAY_RESET_SCORE_ENABLED; -impl SC::ServiceConfigKey for GATEWAY_RESET_SCORE_ENABLED { +pub struct GatewayResetScoreEnabled; +impl SC::ServiceConfigKey for GatewayResetScoreEnabled { fn get_key(&self) -> String { "gateway_reset_score_enabled".to_string() } } -pub const gwResetScoreEnabled: GATEWAY_RESET_SCORE_ENABLED = GATEWAY_RESET_SCORE_ENABLED; +pub const GW_RESET_SCORE_ENABLED: GatewayResetScoreEnabled = GatewayResetScoreEnabled; -pub const defSRBasedGwLevelEliminationThreshold: f64 = 0.02; -pub const defaultGlobalSelectionMaxCountThreshold: i64 = 5; +pub const DEF_SRBASED_GW_LEVEL_ELIMINATION_THRESHOLD: f64 = 0.02; +pub const DEFAULT_GLOBAL_SELECTION_MAX_COUNT_THRESHOLD: i64 = 5; -pub struct GATEWAY_SCORE_FIRST_DIMENSION_SOFT_TTL; -impl SC::ServiceConfigKey for GATEWAY_SCORE_FIRST_DIMENSION_SOFT_TTL { +pub struct GatewayScoreFirstDimensionSoftTtl; +impl SC::ServiceConfigKey for GatewayScoreFirstDimensionSoftTtl { fn get_key(&self) -> String { "gateway_score_first_dimension_soft_ttl".to_string() } } -pub const gwScoreFirstDimensionTtl: GATEWAY_SCORE_FIRST_DIMENSION_SOFT_TTL = - GATEWAY_SCORE_FIRST_DIMENSION_SOFT_TTL; +pub const GW_SCORE_FIRST_DIMENSION_TTL: GatewayScoreFirstDimensionSoftTtl = + GatewayScoreFirstDimensionSoftTtl; -pub struct GATEWAY_SCORE_SECOND_DIMENSION_SOFT_TTL; -impl SC::ServiceConfigKey for GATEWAY_SCORE_SECOND_DIMENSION_SOFT_TTL { +pub struct GatewayScoreSecondDimensionSoftTtl; +impl SC::ServiceConfigKey for GatewayScoreSecondDimensionSoftTtl { fn get_key(&self) -> String { "gateway_score_second_dimension_soft_ttl".to_string() } } -pub const gwScoreSecondDimensionTtl: GATEWAY_SCORE_SECOND_DIMENSION_SOFT_TTL = - GATEWAY_SCORE_SECOND_DIMENSION_SOFT_TTL; +pub const GW_SCORE_SECOND_DIMENSION_TTL: GatewayScoreSecondDimensionSoftTtl = + GatewayScoreSecondDimensionSoftTtl; pub struct ShouldConsumeResultFromRouter; impl SC::ServiceConfigKey for ShouldConsumeResultFromRouter { @@ -184,271 +184,271 @@ impl SC::ServiceConfigKey for ShouldConsumeResultFromRouter { pub const SHOULD_CONSUME_RESULT_FROM_ROUTER: ShouldConsumeResultFromRouter = ShouldConsumeResultFromRouter; -pub struct GATEWAY_SCORE_THIRD_DIMENSION_SOFT_TTL; -impl SC::ServiceConfigKey for GATEWAY_SCORE_THIRD_DIMENSION_SOFT_TTL { +pub struct GatewayScoreThirdDimensionSoftTtl; +impl SC::ServiceConfigKey for GatewayScoreThirdDimensionSoftTtl { fn get_key(&self) -> String { "gateway_score_third_dimension_soft_ttl".to_string() } } -pub const gwScoreThirdDimensionTtl: GATEWAY_SCORE_THIRD_DIMENSION_SOFT_TTL = - GATEWAY_SCORE_THIRD_DIMENSION_SOFT_TTL; +pub const GW_SCORE_THIRD_DIMENSION_TTL: GatewayScoreThirdDimensionSoftTtl = + GatewayScoreThirdDimensionSoftTtl; -pub struct GATEWAY_SCORE_FOURTH_DIMENSION_SOFT_TTL; -impl SC::ServiceConfigKey for GATEWAY_SCORE_FOURTH_DIMENSION_SOFT_TTL { +pub struct GatewayScoreFourthDimensionSoftTtl; +impl SC::ServiceConfigKey for GatewayScoreFourthDimensionSoftTtl { fn get_key(&self) -> String { "gateway_score_fourth_dimension_soft_ttl".to_string() } } -pub const gwScoreFourthDimensionTtl: GATEWAY_SCORE_FOURTH_DIMENSION_SOFT_TTL = - GATEWAY_SCORE_FOURTH_DIMENSION_SOFT_TTL; +pub const GW_SCORE_FOURTH_DIMENSION_TTL: GatewayScoreFourthDimensionSoftTtl = + GatewayScoreFourthDimensionSoftTtl; -pub const defScoreKeysTtl: f64 = 900000.0; +pub const DEF_SCORE_KEYS_TTL: f64 = 900000.0; -pub struct IS_GBESV2_ENABLED; -impl SC::ServiceConfigKey for IS_GBESV2_ENABLED { +pub struct IsGbesv2Enabled; +impl SC::ServiceConfigKey for IsGbesv2Enabled { fn get_key(&self) -> String { "IS_GBESV2_ENABLED".to_string() } } -pub const gbesV2Enabled: IS_GBESV2_ENABLED = IS_GBESV2_ENABLED; +pub const GBES_V2_ENABLED: IsGbesv2Enabled = IsGbesv2Enabled; -pub struct ENABLE_GATEWAY_LEVEL_SR_ELIMINATION; -impl SC::ServiceConfigKey for ENABLE_GATEWAY_LEVEL_SR_ELIMINATION { +pub struct EnableGatewayLevelSrElimination; +impl SC::ServiceConfigKey for EnableGatewayLevelSrElimination { fn get_key(&self) -> String { "enable_gateway_level_sr_elimination".to_string() } } -pub const enableGwLevelSrElimination: ENABLE_GATEWAY_LEVEL_SR_ELIMINATION = - ENABLE_GATEWAY_LEVEL_SR_ELIMINATION; +pub const ENABLE_GW_LEVEL_SR_ELIMINATION: EnableGatewayLevelSrElimination = + EnableGatewayLevelSrElimination; -pub struct SR_BASED_GATEWAY_ELIMINATION_THRESHOLD; -impl SC::ServiceConfigKey for SR_BASED_GATEWAY_ELIMINATION_THRESHOLD { +pub struct SrBasedGatewayEliminationThreshold; +impl SC::ServiceConfigKey for SrBasedGatewayEliminationThreshold { fn get_key(&self) -> String { "SR_BASED_GATEWAY_ELIMINATION_THRESHOLD".to_string() } } -pub const srBasedGatewayEliminationThreshold: SR_BASED_GATEWAY_ELIMINATION_THRESHOLD = - SR_BASED_GATEWAY_ELIMINATION_THRESHOLD; +pub const SR_BASED_GATEWAY_ELIMINATION_THRESHOLD: SrBasedGatewayEliminationThreshold = + SrBasedGatewayEliminationThreshold; -pub const defaultSrBasedGatewayEliminationThreshold: f64 = 0.05; +pub const DEFAULT_SR_BASED_GATEWAY_ELIMINATION_THRESHOLD: f64 = 0.05; -pub struct OTP_CARD_INFO_RESTRICTED_GATEWAYS; -impl SC::ServiceConfigKey for OTP_CARD_INFO_RESTRICTED_GATEWAYS { +pub struct OtpCardInfoRestrictedGateways; +impl SC::ServiceConfigKey for OtpCardInfoRestrictedGateways { fn get_key(&self) -> String { "OTP_CARD_INFO_RESTRICTED_GATEWAYS".to_string() } } -pub struct AUTH_TYPE_RESTRICTED_GATEWAYS; -impl SC::ServiceConfigKey for AUTH_TYPE_RESTRICTED_GATEWAYS { +pub struct AuthTypeRestrictedGateways; +impl SC::ServiceConfigKey for AuthTypeRestrictedGateways { fn get_key(&self) -> String { "AUTH_TYPE_RESTRICTED_GATEWAYS".to_string() } } -pub struct CARD_EMI_EXPLICIT_GATEWAYS; -impl SC::ServiceConfigKey for CARD_EMI_EXPLICIT_GATEWAYS { +pub struct CardEmiExplicitGateways; +impl SC::ServiceConfigKey for CardEmiExplicitGateways { fn get_key(&self) -> String { "CARD_EMI_EXPLICIT_GATEWAYS".to_string() } } -pub struct CONSUMER_FINANCE_ONLY_GATEWAYS; -impl SC::ServiceConfigKey for CONSUMER_FINANCE_ONLY_GATEWAYS { +pub struct ConsumerFinanceOnlyGateways; +impl SC::ServiceConfigKey for ConsumerFinanceOnlyGateways { fn get_key(&self) -> String { "CONSUMER_FINANCE_ONLY_GATEWAYS".to_string() } } -pub struct CONSUMER_FINANCE_ALSO_GATEWAYS; -impl SC::ServiceConfigKey for CONSUMER_FINANCE_ALSO_GATEWAYS { +pub struct ConsumerFinanceAlsoGateways; +impl SC::ServiceConfigKey for ConsumerFinanceAlsoGateways { fn get_key(&self) -> String { "CONSUMER_FINANCE_ALSO_GATEWAYS".to_string() } } -pub struct MUTUAL_FUND_FLOW_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for MUTUAL_FUND_FLOW_SUPPORTED_GATEWAYS { +pub struct MutualFundFlowSupportedGateways; +impl SC::ServiceConfigKey for MutualFundFlowSupportedGateways { fn get_key(&self) -> String { "MUTUAL_FUND_FLOW_SUPPORTED_GATEWAYS".to_string() } } -pub struct CROSS_BORDER_FLOW_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for CROSS_BORDER_FLOW_SUPPORTED_GATEWAYS { +pub struct CrossBorderFlowSupportedGateways; +impl SC::ServiceConfigKey for CrossBorderFlowSupportedGateways { fn get_key(&self) -> String { "CROSS_BORDER_FLOW_SUPPORTED_GATEWAYS".to_string() } } -pub struct SBMD_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for SBMD_SUPPORTED_GATEWAYS { +pub struct SbmdSupportedGateways; +impl SC::ServiceConfigKey for SbmdSupportedGateways { fn get_key(&self) -> String { "SBMD_SUPPORTED_GATEWAYS".to_string() } } -pub struct SPLIT_SETTLEMENT_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for SPLIT_SETTLEMENT_SUPPORTED_GATEWAYS { +pub struct SplitSettlementSupportedGateways; +impl SC::ServiceConfigKey for SplitSettlementSupportedGateways { fn get_key(&self) -> String { "SPLIT_SETTLEMENT_SUPPORTED_GATEWAYS".to_string() } } -pub struct TPV_ONLY_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for TPV_ONLY_SUPPORTED_GATEWAYS { +pub struct TpvOnlySupportedGateways; +impl SC::ServiceConfigKey for TpvOnlySupportedGateways { fn get_key(&self) -> String { "TPV_ONLY_SUPPORTED_GATEWAYS".to_string() } } -pub struct NB_ONLY_GATEWAYS; -impl SC::ServiceConfigKey for NB_ONLY_GATEWAYS { +pub struct NbOnlyGateways; +impl SC::ServiceConfigKey for NbOnlyGateways { fn get_key(&self) -> String { "NB_ONLY_GATEWAYS".to_string() } } -pub struct UPI_ONLY_GATEWAYS; -impl SC::ServiceConfigKey for UPI_ONLY_GATEWAYS { +pub struct UpiOnlyGateways; +impl SC::ServiceConfigKey for UpiOnlyGateways { fn get_key(&self) -> String { "UPI_ONLY_GATEWAYS".to_string() } } -pub struct UPI_ALSO_GATEWAYS; -impl SC::ServiceConfigKey for UPI_ALSO_GATEWAYS { +pub struct UpiAlsoGateways; +impl SC::ServiceConfigKey for UpiAlsoGateways { fn get_key(&self) -> String { "UPI_ALSO_GATEWAYS".to_string() } } -pub struct WALLET_ONLY_GATEWAYS; -impl SC::ServiceConfigKey for WALLET_ONLY_GATEWAYS { +pub struct WalletOnlyGateways; +impl SC::ServiceConfigKey for WalletOnlyGateways { fn get_key(&self) -> String { "WALLET_ONLY_GATEWAYS".to_string() } } -pub struct WALLET_ALSO_GATEWAYS; -impl SC::ServiceConfigKey for WALLET_ALSO_GATEWAYS { +pub struct WalletAlsoGateways; +impl SC::ServiceConfigKey for WalletAlsoGateways { fn get_key(&self) -> String { "WALLET_ALSO_GATEWAYS".to_string() } } -pub struct NO_OR_LOW_COST_EMI_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for NO_OR_LOW_COST_EMI_SUPPORTED_GATEWAYS { +pub struct NoOrLowCostEmiSupportedGateways; +impl SC::ServiceConfigKey for NoOrLowCostEmiSupportedGateways { fn get_key(&self) -> String { "NO_OR_LOW_COST_EMI_SUPPORTED_GATEWAYS".to_string() } } -pub struct SI_ON_EMI_CARD_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for SI_ON_EMI_CARD_SUPPORTED_GATEWAYS { +pub struct SiOnEmiCardSupportedGateways; +impl SC::ServiceConfigKey for SiOnEmiCardSupportedGateways { fn get_key(&self) -> String { "SI_ON_EMI_CARD_SUPPORTED_GATEWAYS".to_string() } } -pub struct SI_ON_EMI_DISABLED_CARD_BRAND_GATEWAY_MAPPING; -impl SC::ServiceConfigKey for SI_ON_EMI_DISABLED_CARD_BRAND_GATEWAY_MAPPING { +pub struct SiOnEmiDisabledCardBrandGatewayMapping; +impl SC::ServiceConfigKey for SiOnEmiDisabledCardBrandGatewayMapping { fn get_key(&self) -> String { "SI_ON_EMI_DISABLED_CARD_BRAND_GATEWAY_MAPPING".to_string() } } -pub struct TOKEN_PROVIDER_GATEWAY_MAPPING; -impl SC::ServiceConfigKey for TOKEN_PROVIDER_GATEWAY_MAPPING { +pub struct TokenProviderGatewayMapping; +impl SC::ServiceConfigKey for TokenProviderGatewayMapping { fn get_key(&self) -> String { "TOKEN_PROVIDER_GATEWAY_MAPPING".to_string() } } -pub struct TXN_TYPE_GATEWAY_MAPPING; -impl SC::ServiceConfigKey for TXN_TYPE_GATEWAY_MAPPING { +pub struct TxnTypeGatewayMapping; +impl SC::ServiceConfigKey for TxnTypeGatewayMapping { fn get_key(&self) -> String { "TXN_TYPE_GATEWAY_MAPPING".to_string() } } -pub struct TXN_DETAIL_TYPE_RESTRICTED_GATEWAYS; -impl SC::ServiceConfigKey for TXN_DETAIL_TYPE_RESTRICTED_GATEWAYS { +pub struct TxnDetailTypeRestrictedGateways; +impl SC::ServiceConfigKey for TxnDetailTypeRestrictedGateways { fn get_key(&self) -> String { "TXN_DETAIL_TYPE_RESTRICTED_GATEWAYS".to_string() } } -pub struct REWARD_ONLY_GATEWAYS; -impl SC::ServiceConfigKey for REWARD_ONLY_GATEWAYS { +pub struct RewardOnlyGateways; +impl SC::ServiceConfigKey for RewardOnlyGateways { fn get_key(&self) -> String { "REWARD_ONLY_GATEWAYS".to_string() } } -pub struct REWARD_ALSO_GATEWAYS; -impl SC::ServiceConfigKey for REWARD_ALSO_GATEWAYS { +pub struct RewardAlsoGateways; +impl SC::ServiceConfigKey for RewardAlsoGateways { fn get_key(&self) -> String { "REWARD_ALSO_GATEWAYS".to_string() } } -pub struct SODEXO_ONLY_GATEWAYS; -impl SC::ServiceConfigKey for SODEXO_ONLY_GATEWAYS { +pub struct SodexoOnlyGateways; +impl SC::ServiceConfigKey for SodexoOnlyGateways { fn get_key(&self) -> String { "SODEXO_ONLY_GATEWAYS".to_string() } } -pub struct SODEXO_ALSO_GATEWAYS; -impl SC::ServiceConfigKey for SODEXO_ALSO_GATEWAYS { +pub struct SodexoAlsoGateways; +impl SC::ServiceConfigKey for SodexoAlsoGateways { fn get_key(&self) -> String { "SODEXO_ALSO_GATEWAYS".to_string() } } -pub struct CASH_ONLY_GATEWAYS; -impl SC::ServiceConfigKey for CASH_ONLY_GATEWAYS { +pub struct CashOnlyGateways; +impl SC::ServiceConfigKey for CashOnlyGateways { fn get_key(&self) -> String { "CASH_ONLY_GATEWAYS".to_string() } } -pub struct AMEX_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for AMEX_SUPPORTED_GATEWAYS { +pub struct AmexSupportedGateways; +impl SC::ServiceConfigKey for AmexSupportedGateways { fn get_key(&self) -> String { "AMEX_SUPPORTED_GATEWAYS".to_string() } } -pub struct CARD_BRAND_TO_CVVLESS_TXN_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for CARD_BRAND_TO_CVVLESS_TXN_SUPPORTED_GATEWAYS { +pub struct CardBrandToCvvlessTxnSupportedGateways; +impl SC::ServiceConfigKey for CardBrandToCvvlessTxnSupportedGateways { fn get_key(&self) -> String { "CARD_BRAND_TO_CVVLESS_TXN_SUPPORTED_GATEWAYS".to_string() } } -pub struct CVVLESS_TXN_SUPPORTED_COMMON_GATEWAYS; -impl SC::ServiceConfigKey for CVVLESS_TXN_SUPPORTED_COMMON_GATEWAYS { +pub struct CvvlessTxnSupportedCommonGateways; +impl SC::ServiceConfigKey for CvvlessTxnSupportedCommonGateways { fn get_key(&self) -> String { "CVVLESS_TXN_SUPPORTED_COMMON_GATEWAYS".to_string() } } -pub struct MERCHANT_CONTAINER_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for MERCHANT_CONTAINER_SUPPORTED_GATEWAYS { +pub struct MerchantContainerSupportedGateways; +impl SC::ServiceConfigKey for MerchantContainerSupportedGateways { fn get_key(&self) -> String { "MERCHANT_CONTAINER_SUPPORTED_GATEWAYS".to_string() } } -pub struct TOKEN_SUPPORTED_GATEWAYS(pub String, pub Option, pub String, pub String); -impl SC::ServiceConfigKey for TOKEN_SUPPORTED_GATEWAYS { +pub struct TokenSupportedGateways(pub String, pub Option, pub String, pub String); +impl SC::ServiceConfigKey for TokenSupportedGateways { fn get_key(&self) -> String { format!( "{}_{}_{}_{}_SUPPORTED_GATEWAYS", @@ -460,51 +460,51 @@ impl SC::ServiceConfigKey for TOKEN_SUPPORTED_GATEWAYS { } } -pub struct TOKEN_REPEAT_OTP_SUPPORTED_GATEWAYS(String); -impl SC::ServiceConfigKey for TOKEN_REPEAT_OTP_SUPPORTED_GATEWAYS { +pub struct TokenRepeatOtpSupportedGateways(String); +impl SC::ServiceConfigKey for TokenRepeatOtpSupportedGateways { fn get_key(&self) -> String { format!("{}_TOKEN_REPEAT_OTP_SUPPORTED_GATEWAYS", self.0) } } -pub fn getTokenRepeatOtpGatewayKey(val: String) -> TOKEN_REPEAT_OTP_SUPPORTED_GATEWAYS { - TOKEN_REPEAT_OTP_SUPPORTED_GATEWAYS(val) +pub fn getTokenRepeatOtpGatewayKey(val: String) -> TokenRepeatOtpSupportedGateways { + TokenRepeatOtpSupportedGateways(val) } -pub struct TOKEN_REPEAT_CVVLESS_SUPPORTED_GATEWAYS(String); -impl SC::ServiceConfigKey for TOKEN_REPEAT_CVVLESS_SUPPORTED_GATEWAYS { +pub struct TokenRepeatCvvlessSupportedGateways(String); +impl SC::ServiceConfigKey for TokenRepeatCvvlessSupportedGateways { fn get_key(&self) -> String { format!("{}_TOKEN_REPEAT_CVVLESS_SUPPORTED_GATEWAYS", self.0) } } -pub fn getTokenRepeatCvvLessGatewayKey(val: String) -> TOKEN_REPEAT_CVVLESS_SUPPORTED_GATEWAYS { - TOKEN_REPEAT_CVVLESS_SUPPORTED_GATEWAYS(val) +pub fn getTokenRepeatCvvLessGatewayKey(val: String) -> TokenRepeatCvvlessSupportedGateways { + TokenRepeatCvvlessSupportedGateways(val) } -pub struct TOKEN_REPEAT_MANDATE_SUPPORTED_GATEWAYS(String); -impl SC::ServiceConfigKey for TOKEN_REPEAT_MANDATE_SUPPORTED_GATEWAYS { +pub struct TokenRepeatMandateSupportedGateways(String); +impl SC::ServiceConfigKey for TokenRepeatMandateSupportedGateways { fn get_key(&self) -> String { format!("{}_TOKEN_REPEAT_MANDATE_SUPPORTED_GATEWAYS", self.0) } } -pub fn getTokenRepeatMandateGatewayKey(val: String) -> TOKEN_REPEAT_MANDATE_SUPPORTED_GATEWAYS { - TOKEN_REPEAT_MANDATE_SUPPORTED_GATEWAYS(val) +pub fn getTokenRepeatMandateGatewayKey(val: String) -> TokenRepeatMandateSupportedGateways { + TokenRepeatMandateSupportedGateways(val) } -pub struct TOKEN_REPEAT_SUPPORTED_GATEWAYS(String); -impl SC::ServiceConfigKey for TOKEN_REPEAT_SUPPORTED_GATEWAYS { +pub struct TokenRepeatSupportedGateways(String); +impl SC::ServiceConfigKey for TokenRepeatSupportedGateways { fn get_key(&self) -> String { format!("{}_TOKEN_REPEAT_SUPPORTED_GATEWAYS", self.0) } } -pub fn getTokenRepeatGatewayKey(val: String) -> TOKEN_REPEAT_SUPPORTED_GATEWAYS { - TOKEN_REPEAT_SUPPORTED_GATEWAYS(val) +pub fn getTokenRepeatGatewayKey(val: String) -> TokenRepeatSupportedGateways { + TokenRepeatSupportedGateways(val) } -pub struct MANDATE_GUEST_CHECKOUT_SUPPORTED_GATEWAYS(Option>); -impl SC::ServiceConfigKey for MANDATE_GUEST_CHECKOUT_SUPPORTED_GATEWAYS { +pub struct MandateGuestCheckoutSupportedGateways(Option>); +impl SC::ServiceConfigKey for MandateGuestCheckoutSupportedGateways { fn get_key(&self) -> String { format!( "{}_MANDATE_GUEST_CHECKOUT_SUPPORTED_GATEWAYS", @@ -517,12 +517,12 @@ impl SC::ServiceConfigKey for MANDATE_GUEST_CHECKOUT_SUPPORTED_GATEWAYS { pub fn getmandateGuestCheckoutKey( val: Option>, -) -> MANDATE_GUEST_CHECKOUT_SUPPORTED_GATEWAYS { - MANDATE_GUEST_CHECKOUT_SUPPORTED_GATEWAYS(val) +) -> MandateGuestCheckoutSupportedGateways { + MandateGuestCheckoutSupportedGateways(val) } -pub struct TOKEN_REPEAT_CVVLESS_SUPPORTED_BANKS(Option>); -impl SC::ServiceConfigKey for TOKEN_REPEAT_CVVLESS_SUPPORTED_BANKS { +pub struct TokenRepeatCvvlessSupportedBanks(Option>); +impl SC::ServiceConfigKey for TokenRepeatCvvlessSupportedBanks { fn get_key(&self) -> String { format!( "{}_TOKEN_REPEAT_CVVLESS_SUPPORTED_BANKS", @@ -535,125 +535,125 @@ impl SC::ServiceConfigKey for TOKEN_REPEAT_CVVLESS_SUPPORTED_BANKS { pub fn getTokenRepeatCvvLessBankCodeKey( val: Option>, -) -> TOKEN_REPEAT_CVVLESS_SUPPORTED_BANKS { - TOKEN_REPEAT_CVVLESS_SUPPORTED_BANKS(val) +) -> TokenRepeatCvvlessSupportedBanks { + TokenRepeatCvvlessSupportedBanks(val) } -pub struct EMI_BIN_VALIDATION_SUPPORTED_BANKS; -impl SC::ServiceConfigKey for EMI_BIN_VALIDATION_SUPPORTED_BANKS { +pub struct EmiBinValidationSupportedBanks; +impl SC::ServiceConfigKey for EmiBinValidationSupportedBanks { fn get_key(&self) -> String { "EMI_BIN_VALIDATION_SUPPORTED_BANKS".to_string() } } -pub const getEmiBinValidationSupportedBanksKey: EMI_BIN_VALIDATION_SUPPORTED_BANKS = - EMI_BIN_VALIDATION_SUPPORTED_BANKS; +pub const GET_EMI_BIN_VALIDATION_SUPPORTED_BANKS_KEY: EmiBinValidationSupportedBanks = + EmiBinValidationSupportedBanks; -pub struct METRIC_TRACKING_LOG; -impl SC::ServiceConfigKey for METRIC_TRACKING_LOG { +pub struct MetricTrackingLog; +impl SC::ServiceConfigKey for MetricTrackingLog { fn get_key(&self) -> String { "METRIC_TRACKING_LOG".to_string() } } -pub const metricTrackingLogDataKey: METRIC_TRACKING_LOG = METRIC_TRACKING_LOG; +pub const METRIC_TRACKING_LOG_DATA_KEY: MetricTrackingLog = MetricTrackingLog; -pub struct V2_ROUTING_HANDLE_LIST; -impl SC::ServiceConfigKey for V2_ROUTING_HANDLE_LIST { +pub struct V2RoutingHandleList; +impl SC::ServiceConfigKey for V2RoutingHandleList { fn get_key(&self) -> String { "V2_ROUTING_HANDLE_LIST".to_string() } } -pub const v2RoutingHandleList: V2_ROUTING_HANDLE_LIST = V2_ROUTING_HANDLE_LIST; +pub const V2_ROUTING_HANDLE_LIST: V2RoutingHandleList = V2RoutingHandleList; -pub struct V2_ROUTING_PSP_LIST; -impl SC::ServiceConfigKey for V2_ROUTING_PSP_LIST { +pub struct V2RoutingPspList; +impl SC::ServiceConfigKey for V2RoutingPspList { fn get_key(&self) -> String { "V2_ROUTING_PSP_LIST".to_string() } } -pub const v2RoutingPspList: V2_ROUTING_PSP_LIST = V2_ROUTING_PSP_LIST; +pub const V2_ROUTING_PSP_LIST: V2RoutingPspList = V2RoutingPspList; -pub struct V2_ROUTING_TOP_BANK_LIST; -impl SC::ServiceConfigKey for V2_ROUTING_TOP_BANK_LIST { +pub struct V2RoutingTopBankList; +impl SC::ServiceConfigKey for V2RoutingTopBankList { fn get_key(&self) -> String { "V2_ROUTING_TOP_BANK_LIST".to_string() } } -pub const v2RoutingTopBankList: V2_ROUTING_TOP_BANK_LIST = V2_ROUTING_TOP_BANK_LIST; +pub const V2_ROUTING_TOP_BANK_LIST: V2RoutingTopBankList = V2RoutingTopBankList; -pub struct V2_ROUTING_PSP_PACKAGE_LIST; -impl SC::ServiceConfigKey for V2_ROUTING_PSP_PACKAGE_LIST { +pub struct V2RoutingPspPackageList; +impl SC::ServiceConfigKey for V2RoutingPspPackageList { fn get_key(&self) -> String { "V2_ROUTING_PSP_PACKAGE_LIST".to_string() } } -pub const v2RoutingPspPackageList: V2_ROUTING_PSP_PACKAGE_LIST = V2_ROUTING_PSP_PACKAGE_LIST; +pub const V2_ROUTING_PSP_PACKAGE_LIST: V2RoutingPspPackageList = V2RoutingPspPackageList; -pub struct OPTIMIZATION_ROUTING_CONFIG(pub String); -impl SC::ServiceConfigKey for OPTIMIZATION_ROUTING_CONFIG { +pub struct OptimizationRoutingConfig(pub String); +impl SC::ServiceConfigKey for OptimizationRoutingConfig { fn get_key(&self) -> String { format!("{}_optimization_routing_config", self.0) } } -pub struct DEFAULT_OPTIMIZATION_ROUTING_CONFIG; -impl SC::ServiceConfigKey for DEFAULT_OPTIMIZATION_ROUTING_CONFIG { +pub struct DefaultOptimizationRoutingConfig; +impl SC::ServiceConfigKey for DefaultOptimizationRoutingConfig { fn get_key(&self) -> String { "default_optimization_routing_config".to_string() } } -pub struct ATM_PIN_CARD_INFO_RESTRICTED_GATEWAYS; -impl SC::ServiceConfigKey for ATM_PIN_CARD_INFO_RESTRICTED_GATEWAYS { +pub struct AtmPinCardInfoRestrictedGateways; +impl SC::ServiceConfigKey for AtmPinCardInfoRestrictedGateways { fn get_key(&self) -> String { "ATM_PIN_CARD_INFO_RESTRICTED_GATEWAYS".to_string() } } -pub struct OTP_CARD_INFO_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for OTP_CARD_INFO_SUPPORTED_GATEWAYS { +pub struct OtpCardInfoSupportedGateways; +impl SC::ServiceConfigKey for OtpCardInfoSupportedGateways { fn get_key(&self) -> String { "OTP_CARD_INFO_SUPPORTED_GATEWAYS".to_string() } } -pub struct MOTO_CARD_INFO_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for MOTO_CARD_INFO_SUPPORTED_GATEWAYS { +pub struct MotoCardInfoSupportedGateways; +impl SC::ServiceConfigKey for MotoCardInfoSupportedGateways { fn get_key(&self) -> String { "MOTO_CARD_INFO_SUPPORTED_GATEWAYS".to_string() } } -pub struct TA_OFFLINE_ENABLED_GATEWAYS; -impl SC::ServiceConfigKey for TA_OFFLINE_ENABLED_GATEWAYS { +pub struct TaOfflineEnabledGateways; +impl SC::ServiceConfigKey for TaOfflineEnabledGateways { fn get_key(&self) -> String { "TA_OFFLINE_ENABLED_GATEWAYS".to_string() } } -pub struct MERCHANT_WISE_MANDATE_BIN_ENFORCED_GATEWAYS; -impl SC::ServiceConfigKey for MERCHANT_WISE_MANDATE_BIN_ENFORCED_GATEWAYS { +pub struct MerchantWiseMandateBinEnforcedGateways; +impl SC::ServiceConfigKey for MerchantWiseMandateBinEnforcedGateways { fn get_key(&self) -> String { "MERCHANT_WISE_MANDATE_BIN_ENFORCED_GATEWAYS".to_string() } } -pub struct MERCHANT_WISE_AUTH_TYPE_BIN_ENFORCED_GATEWAYS; -impl SC::ServiceConfigKey for MERCHANT_WISE_AUTH_TYPE_BIN_ENFORCED_GATEWAYS { +pub struct MerchantWiseAuthTypeBinEnforcedGateways; +impl SC::ServiceConfigKey for MerchantWiseAuthTypeBinEnforcedGateways { fn get_key(&self) -> String { "MERCHANT_WISE_AUTH_TYPE_BIN_ENFORCED_GATEWAYS".to_string() } } -pub struct CARD_MANDATE_BIN_FILTER_EXCLUDED_GATEWAYS; -impl SC::ServiceConfigKey for CARD_MANDATE_BIN_FILTER_EXCLUDED_GATEWAYS { +pub struct CardMandateBinFilterExcludedGateways; +impl SC::ServiceConfigKey for CardMandateBinFilterExcludedGateways { fn get_key(&self) -> String { "CARD_MANDATE_BIN_FILTER_EXCLUDED_GATEWAYS".to_string() } } -pub struct ENABLE_GATEWAY_SELECTION_BASED_ON_OPTIMIZED_SR_INPUT(pub String); -impl SC::ServiceConfigKey for ENABLE_GATEWAY_SELECTION_BASED_ON_OPTIMIZED_SR_INPUT { +pub struct EnableGatewaySelectionBasedOnOptimizedSrInput(pub String); +impl SC::ServiceConfigKey for EnableGatewaySelectionBasedOnOptimizedSrInput { fn get_key(&self) -> String { format!( "ENABLE_GATEWAY_SELECTION_BASED_ON_OPTIMIZED_SR_INPUT_{}", @@ -663,73 +663,73 @@ impl SC::ServiceConfigKey for ENABLE_GATEWAY_SELECTION_BASED_ON_OPTIMIZED_SR_INP } pub fn enable_gateway_selection_based_on_optimized_sr_input( val: String, -) -> ENABLE_GATEWAY_SELECTION_BASED_ON_OPTIMIZED_SR_INPUT { - ENABLE_GATEWAY_SELECTION_BASED_ON_OPTIMIZED_SR_INPUT(val) +) -> EnableGatewaySelectionBasedOnOptimizedSrInput { + EnableGatewaySelectionBasedOnOptimizedSrInput(val) } -pub struct ENABLE_BETA_DISTRIBUTION_ON_SR_V3; -impl SC::ServiceConfigKey for ENABLE_BETA_DISTRIBUTION_ON_SR_V3 { +pub struct EnableBetaDistributionOnSrV3; +impl SC::ServiceConfigKey for EnableBetaDistributionOnSrV3 { fn get_key(&self) -> String { "ENABLE_BETA_DISTRIBUTION_ON_SR_V3".to_string() } } -pub const enable_beta_distribution_on_sr_v3: ENABLE_BETA_DISTRIBUTION_ON_SR_V3 = - ENABLE_BETA_DISTRIBUTION_ON_SR_V3; +pub const ENABLE_BETA_DISTRIBUTION_ON_SR_V3: EnableBetaDistributionOnSrV3 = + EnableBetaDistributionOnSrV3; -pub struct ENABLE_GATEWAY_SELECTION_BASED_ON_SR_V3_INPUT(pub String); -impl SC::ServiceConfigKey for ENABLE_GATEWAY_SELECTION_BASED_ON_SR_V3_INPUT { +pub struct EnableGatewaySelectionBasedOnSrV3Input(pub String); +impl SC::ServiceConfigKey for EnableGatewaySelectionBasedOnSrV3Input { fn get_key(&self) -> String { format!("ENABLE_GATEWAY_SELECTION_BASED_ON_SR_V3_INPUT_{}", self.0) } } pub fn enable_gateway_selection_based_on_sr_v3_input( val: String, -) -> ENABLE_GATEWAY_SELECTION_BASED_ON_SR_V3_INPUT { - ENABLE_GATEWAY_SELECTION_BASED_ON_SR_V3_INPUT(val) +) -> EnableGatewaySelectionBasedOnSrV3Input { + EnableGatewaySelectionBasedOnSrV3Input(val) } -pub struct ENABLE_BINOMIAL_DISTRIBUTION_ON_SR_V3; -impl SC::ServiceConfigKey for ENABLE_BINOMIAL_DISTRIBUTION_ON_SR_V3 { +pub struct EnableBinomialDistributionOnSrV3; +impl SC::ServiceConfigKey for EnableBinomialDistributionOnSrV3 { fn get_key(&self) -> String { "ENABLE_BINOMIAL_DISTRIBUTION_ON_SR_V3".to_string() } } -pub const enable_binomial_distribution_on_sr_v3: ENABLE_BINOMIAL_DISTRIBUTION_ON_SR_V3 = - ENABLE_BINOMIAL_DISTRIBUTION_ON_SR_V3; +pub const ENABLE_BINOMIAL_DISTRIBUTION_ON_SR_V3: EnableBinomialDistributionOnSrV3 = + EnableBinomialDistributionOnSrV3; -pub struct ENABLE_EXTRA_SCORE_ON_SR_V3; -impl SC::ServiceConfigKey for ENABLE_EXTRA_SCORE_ON_SR_V3 { +pub struct EnableExtraScoreOnSrV3; +impl SC::ServiceConfigKey for EnableExtraScoreOnSrV3 { fn get_key(&self) -> String { "ENABLE_EXTRA_SCORE_ON_SR_V3".to_string() } } -pub const enable_extra_score_on_sr_v3: ENABLE_EXTRA_SCORE_ON_SR_V3 = ENABLE_EXTRA_SCORE_ON_SR_V3; +pub const ENABLE_EXTRA_SCORE_ON_SR_V3: EnableExtraScoreOnSrV3 = EnableExtraScoreOnSrV3; -pub struct ENABLE_RESET_ON_SR_V3; -impl SC::ServiceConfigKey for ENABLE_RESET_ON_SR_V3 { +pub struct EnableResetOnSrV3; +impl SC::ServiceConfigKey for EnableResetOnSrV3 { fn get_key(&self) -> String { "ENABLE_RESET_ON_SR_V3".to_string() } } -pub const enable_reset_on_sr_v3: ENABLE_RESET_ON_SR_V3 = ENABLE_RESET_ON_SR_V3; +pub const ENABLE_RESET_ON_SR_V3: EnableResetOnSrV3 = EnableResetOnSrV3; -pub struct GATEWAY_REFERENCE_ID_ENABLED_MERCHANT; -impl SC::ServiceConfigKey for GATEWAY_REFERENCE_ID_ENABLED_MERCHANT { +pub struct GatewayReferenceIdEnabledMerchant; +impl SC::ServiceConfigKey for GatewayReferenceIdEnabledMerchant { fn get_key(&self) -> String { "gateway_reference_id_enabled_merchant".to_string() } } -pub const gatewayReferenceIdEnabledMerchant: GATEWAY_REFERENCE_ID_ENABLED_MERCHANT = - GATEWAY_REFERENCE_ID_ENABLED_MERCHANT; +pub const GATEWAY_REFERENCE_ID_ENABLED_MERCHANT: GatewayReferenceIdEnabledMerchant = + GatewayReferenceIdEnabledMerchant; -pub struct GATEWAYDECIDER_SCORINGFLOW; -impl SC::ServiceConfigKey for GATEWAYDECIDER_SCORINGFLOW { +pub struct GatewaydeciderScoringflow; +impl SC::ServiceConfigKey for GatewaydeciderScoringflow { fn get_key(&self) -> String { "GatewayDecider::scoringFlow".to_string() } } -pub const paymentFlowsRequiredForGwFiltering: [&str; 12] = [ +pub const PAYMENT_FLOWS_REQUIRED_FOR_GW_FILTERING: [&str; 12] = [ "DOTP", "CARD_MOTO", "MANDATE_REGISTER", @@ -744,220 +744,217 @@ pub const paymentFlowsRequiredForGwFiltering: [&str; 12] = [ "ONE_TIME_MANDATE", ]; -pub const getCardBrandCacheExpiry: i32 = 2 * 24 * 60 * 60; -pub const gatewayScoringData: &str = "gateway_scoring_data_"; -pub const globalLevelOutageKeyPrefix: &str = "gw_score_global_outage"; -pub const merchantLevelOutageKeyPrefix: &str = "gw_score_outage"; +pub const GET_CARD_BRAND_CACHE_EXPIRY: i32 = 2 * 24 * 60 * 60; +pub const GATEWAY_SCORING_DATA: &str = "gateway_scoring_data_"; +pub const GLOBAL_LEVEL_OUTAGE_KEY_PREFIX: &str = "gw_score_global_outage"; +pub const MERCHANT_LEVEL_OUTAGE_KEY_PREFIX: &str = "gw_score_outage"; -pub struct MERCHANTS_ENABLED_FOR_SCORE_KEYS_UNIFICATION; -impl SC::ServiceConfigKey for MERCHANTS_ENABLED_FOR_SCORE_KEYS_UNIFICATION { +pub struct MerchantsEnabledForScoreKeysUnification; +impl SC::ServiceConfigKey for MerchantsEnabledForScoreKeysUnification { fn get_key(&self) -> String { "merchants_enabled_for_score_keys_unification".to_string() } } -pub const merchantsEnabledForScoreKeysUnification: MERCHANTS_ENABLED_FOR_SCORE_KEYS_UNIFICATION = - MERCHANTS_ENABLED_FOR_SCORE_KEYS_UNIFICATION; +pub const MERCHANTS_ENABLED_FOR_SCORE_KEYS_UNIFICATION: MerchantsEnabledForScoreKeysUnification = + MerchantsEnabledForScoreKeysUnification; -pub const gateway_selection_order_type_key_prefix: &str = "gw_sr_score"; -pub const gateway_selection_v3_order_type_key_prefix: &str = "{gw_sr_v3_score"; -pub const gatewayScoreKeysTTL: i64 = 1800; -pub const elimination_based_routing_key_prefix: &str = "gw_score"; -pub const elimination_based_routing_global_key_prefix: &str = "gw_score_global"; +pub const GATEWAY_SELECTION_ORDER_TYPE_KEY_PREFIX: &str = "gw_sr_score"; +pub const GATEWAY_SELECTION_V3_ORDER_TYPE_KEY_PREFIX: &str = "{gw_sr_v3_score"; +pub const GATEWAY_SCORE_KEYS_TTL: i64 = 1800; +pub const ELIMINATION_BASED_ROUTING_KEY_PREFIX: &str = "gw_score"; +pub const ELIMINATION_BASED_ROUTING_GLOBAL_KEY_PREFIX: &str = "gw_score_global"; -pub struct GW_REF_ID_SELECTION_BASED_ENABLED_MERCHANT; -impl SC::ServiceConfigKey for GW_REF_ID_SELECTION_BASED_ENABLED_MERCHANT { +pub struct GwRefIdSelectionBasedEnabledMerchant; +impl SC::ServiceConfigKey for GwRefIdSelectionBasedEnabledMerchant { fn get_key(&self) -> String { "gw_ref_id_selection_based_enabled_merchant".to_string() } } -pub const gwRefIdSelectionBasedEnabledMerchant: GW_REF_ID_SELECTION_BASED_ENABLED_MERCHANT = - GW_REF_ID_SELECTION_BASED_ENABLED_MERCHANT; +pub const GW_REF_ID_SELECTION_BASED_ENABLED_MERCHANT: GwRefIdSelectionBasedEnabledMerchant = + GwRefIdSelectionBasedEnabledMerchant; -pub struct ENABLE_SELECTION_BASED_AUTH_TYPE_EVALUATION; -impl SC::ServiceConfigKey for ENABLE_SELECTION_BASED_AUTH_TYPE_EVALUATION { +pub struct EnableSelectionBasedAuthTypeEvaluation; +impl SC::ServiceConfigKey for EnableSelectionBasedAuthTypeEvaluation { fn get_key(&self) -> String { "ENABLE_SELECTION_BASED_AUTH_TYPE_EVALUATION".to_string() } } -pub const selectionBasedAuthTypeEnabledMerchant: ENABLE_SELECTION_BASED_AUTH_TYPE_EVALUATION = - ENABLE_SELECTION_BASED_AUTH_TYPE_EVALUATION; +pub const SELECTION_BASED_AUTH_TYPE_ENABLED_MERCHANT: EnableSelectionBasedAuthTypeEvaluation = + EnableSelectionBasedAuthTypeEvaluation; -pub struct ENABLE_SELECTION_BASED_BANK_LEVEL_EVALUATION; -impl SC::ServiceConfigKey for ENABLE_SELECTION_BASED_BANK_LEVEL_EVALUATION { +pub struct EnableSelectionBasedBankLevelEvaluation; +impl SC::ServiceConfigKey for EnableSelectionBasedBankLevelEvaluation { fn get_key(&self) -> String { "ENABLE_SELECTION_BASED_BANK_LEVEL_EVALUATION".to_string() } } -pub const selectionBasedBankLevelEnabledMerchant: ENABLE_SELECTION_BASED_BANK_LEVEL_EVALUATION = - ENABLE_SELECTION_BASED_BANK_LEVEL_EVALUATION; +pub const SELECTION_BASED_BANK_LEVEL_ENABLED_MERCHANT: EnableSelectionBasedBankLevelEvaluation = + EnableSelectionBasedBankLevelEvaluation; -pub struct PUSH_DATA_TO_ROUTING_ETL_STREAM; -impl SC::ServiceConfigKey for PUSH_DATA_TO_ROUTING_ETL_STREAM { +pub struct PushDataToRoutingEtlStream; +impl SC::ServiceConfigKey for PushDataToRoutingEtlStream { fn get_key(&self) -> String { "push_data_to_routing_ETL_stream".to_string() } } -pub const pushDataToRoutingETLStream: PUSH_DATA_TO_ROUTING_ETL_STREAM = - PUSH_DATA_TO_ROUTING_ETL_STREAM; +pub const PUSH_DATA_TO_ROUTING_ETLSTREAM: PushDataToRoutingEtlStream = PushDataToRoutingEtlStream; -pub struct SR_VOLUME_CHECK_ENABLED_MERCHANT; -impl SC::ServiceConfigKey for SR_VOLUME_CHECK_ENABLED_MERCHANT { +pub struct SrVolumeCheckEnabledMerchant; +impl SC::ServiceConfigKey for SrVolumeCheckEnabledMerchant { fn get_key(&self) -> String { "SR_VOLUME_CHECK_ENABLED_MERCHANT".to_string() } } -pub const isMerchantEnabledForVolumeCheck: SR_VOLUME_CHECK_ENABLED_MERCHANT = - SR_VOLUME_CHECK_ENABLED_MERCHANT; +pub const IS_MERCHANT_ENABLED_FOR_VOLUME_CHECK: SrVolumeCheckEnabledMerchant = + SrVolumeCheckEnabledMerchant; -pub const defaultSelectionBucketTxnVolumeThrehold: i64 = 5; +pub const DEFAULT_SELECTION_BUCKET_TXN_VOLUME_THREHOLD: i64 = 5; -pub struct SR_SELECTION_BUCKET_VOLUME_THRESHOLD; -impl SC::ServiceConfigKey for SR_SELECTION_BUCKET_VOLUME_THRESHOLD { +pub struct SrSelectionBucketVolumeThreshold; +impl SC::ServiceConfigKey for SrSelectionBucketVolumeThreshold { fn get_key(&self) -> String { "SR_SELECTION_BUCKET_VOLUME_THRESHOLD".to_string() } } -pub const selectionBucketTxnVolumeThreshold: SR_SELECTION_BUCKET_VOLUME_THRESHOLD = - SR_SELECTION_BUCKET_VOLUME_THRESHOLD; +pub const SELECTION_BUCKET_TXN_VOLUME_THRESHOLD: SrSelectionBucketVolumeThreshold = + SrSelectionBucketVolumeThreshold; -pub struct ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE; -impl SC::ServiceConfigKey for ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE { +pub struct EnableMerchantOnVolumeDistributionFeature; +impl SC::ServiceConfigKey for EnableMerchantOnVolumeDistributionFeature { fn get_key(&self) -> String { "ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE".to_string() } } -pub const routeRandomTrafficEnabledMerchant: ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE = - ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE; +pub const ROUTE_RANDOM_TRAFFIC_ENABLED_MERCHANT: EnableMerchantOnVolumeDistributionFeature = + EnableMerchantOnVolumeDistributionFeature; -pub struct ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE_SR_V3; -impl SC::ServiceConfigKey for ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE_SR_V3 { +pub struct EnableMerchantOnVolumeDistributionFeatureSrV3; +impl SC::ServiceConfigKey for EnableMerchantOnVolumeDistributionFeatureSrV3 { fn get_key(&self) -> String { "ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE_SR_V3".to_string() } } -pub const routeRandomTrafficSrV3EnabledMerchant: - ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE_SR_V3 = - ENABLE_MERCHANT_ON_VOLUME_DISTRIBUTION_FEATURE_SR_V3; +pub const ROUTE_RANDOM_TRAFFIC_SR_V3_ENABLED_MERCHANT: + EnableMerchantOnVolumeDistributionFeatureSrV3 = EnableMerchantOnVolumeDistributionFeatureSrV3; -pub struct ENABLE_EXPLORE_AND_EXPLOIT_ON_SRV3(pub String); -impl SC::ServiceConfigKey for ENABLE_EXPLORE_AND_EXPLOIT_ON_SRV3 { +pub struct EnableExploreAndExploitOnSrv3(pub String); +impl SC::ServiceConfigKey for EnableExploreAndExploitOnSrv3 { fn get_key(&self) -> String { format!("ENABLE_EXPLORE_AND_EXPLOIT_ON_SRV3_{}", self.0) } } -pub fn enableExploreAndExploitOnSrV3(val: String) -> ENABLE_EXPLORE_AND_EXPLOIT_ON_SRV3 { - ENABLE_EXPLORE_AND_EXPLOIT_ON_SRV3(val) +pub fn enableExploreAndExploitOnSrV3(val: String) -> EnableExploreAndExploitOnSrv3 { + EnableExploreAndExploitOnSrv3(val) } //TODO : This is duplicate and is same key is already there in decider constants.rs -pub struct ENABLE_DEBUG_MODE_ON_SR_V3; -impl SC::ServiceConfigKey for ENABLE_DEBUG_MODE_ON_SR_V3 { +pub struct EnableDebugModeOnSrV3; +impl SC::ServiceConfigKey for EnableDebugModeOnSrV3 { fn get_key(&self) -> String { "ENABLE_DEBUG_MODE_ON_SR_V3".to_string() } } -pub const enableDebugModeOnSrV3: ENABLE_DEBUG_MODE_ON_SR_V3 = ENABLE_DEBUG_MODE_ON_SR_V3; +pub const ENABLE_DEBUG_MODE_ON_SR_V3: EnableDebugModeOnSrV3 = EnableDebugModeOnSrV3; -pub const pendingTxnsKeyPrefix: &str = "PENDING_TXNS_"; +pub const PENDING_TXNS_KEY_PREFIX: &str = "PENDING_TXNS_"; -pub struct SR_ROUTING_RANDOM_DISTRIBUTION_PERCENTAGE; -impl SC::ServiceConfigKey for SR_ROUTING_RANDOM_DISTRIBUTION_PERCENTAGE { +pub struct SrRoutingRandomDistributionPercentage; +impl SC::ServiceConfigKey for SrRoutingRandomDistributionPercentage { fn get_key(&self) -> String { "SR_ROUTING_RANDOM_DISTRIBUTION_PERCENTAGE".to_string() } } -pub const srRoutingTrafficRandomDistribution: SR_ROUTING_RANDOM_DISTRIBUTION_PERCENTAGE = - SR_ROUTING_RANDOM_DISTRIBUTION_PERCENTAGE; +pub const SR_ROUTING_TRAFFIC_RANDOM_DISTRIBUTION: SrRoutingRandomDistributionPercentage = + SrRoutingRandomDistributionPercentage; -pub const defaultSrRoutingTrafficRandomDistribution: f64 = 10.0; +pub const DEFAULT_SR_ROUTING_TRAFFIC_RANDOM_DISTRIBUTION: f64 = 10.0; -pub struct WEIGHTED_BLOCK_SR_EVALUATION_ENABLED_MERCHANTS; -impl SC::ServiceConfigKey for WEIGHTED_BLOCK_SR_EVALUATION_ENABLED_MERCHANTS { +pub struct WeightedBlockSrEvaluationEnabledMerchants; +impl SC::ServiceConfigKey for WeightedBlockSrEvaluationEnabledMerchants { fn get_key(&self) -> String { "WEIGHTED_BLOCK_SR_EVALUATION_ENABLED_MERCHANTS".to_string() } } -pub const isWeightedSrEvaluationEnabledMerchant: WEIGHTED_BLOCK_SR_EVALUATION_ENABLED_MERCHANTS = - WEIGHTED_BLOCK_SR_EVALUATION_ENABLED_MERCHANTS; +pub const IS_WEIGHTED_SR_EVALUATION_ENABLED_MERCHANT: WeightedBlockSrEvaluationEnabledMerchants = + WeightedBlockSrEvaluationEnabledMerchants; -pub const defaultWeightsFactorForWeightedSrEvaluation: [(f64, i32); 4] = +pub const DEFAULT_WEIGHTS_FACTOR_FOR_WEIGHTED_SR_EVALUATION: [(f64, i32); 4] = [(1.0, 1), (0.98, 6), (0.92, 18), (0.85, 0)]; -pub struct SR_WEIGHT_FACTOR_FOR_WEIGHTED_EVALUATION; -impl SC::ServiceConfigKey for SR_WEIGHT_FACTOR_FOR_WEIGHTED_EVALUATION { +pub struct SrWeightFactorForWeightedEvaluation; +impl SC::ServiceConfigKey for SrWeightFactorForWeightedEvaluation { fn get_key(&self) -> String { "SR_WEIGHT_FACTOR_FOR_WEIGHTED_EVALUATION".to_string() } } -pub const selectionWeightsFactorForWeightedSrEvaluation: SR_WEIGHT_FACTOR_FOR_WEIGHTED_EVALUATION = - SR_WEIGHT_FACTOR_FOR_WEIGHTED_EVALUATION; +pub const SELECTION_WEIGHTS_FACTOR_FOR_WEIGHTED_SR_EVALUATION: SrWeightFactorForWeightedEvaluation = + SrWeightFactorForWeightedEvaluation; -pub struct MERCHANT_ENABLED_FOR_ROUTING_EXPERIMENT; -impl SC::ServiceConfigKey for MERCHANT_ENABLED_FOR_ROUTING_EXPERIMENT { +pub struct MerchantEnabledForRoutingExperiment; +impl SC::ServiceConfigKey for MerchantEnabledForRoutingExperiment { fn get_key(&self) -> String { "MERCHANT_ENABLED_FOR_ROUTING_EXPERIMENT".to_string() } } -pub const isPerformingExperiment: MERCHANT_ENABLED_FOR_ROUTING_EXPERIMENT = - MERCHANT_ENABLED_FOR_ROUTING_EXPERIMENT; +pub const IS_PERFORMING_EXPERIMENT: MerchantEnabledForRoutingExperiment = + MerchantEnabledForRoutingExperiment; -pub struct HANDLE_PACKAGE_BASED_ROUTING_CUTOVER; -impl SC::ServiceConfigKey for HANDLE_PACKAGE_BASED_ROUTING_CUTOVER { +pub struct HandlePackageBasedRoutingCutover; +impl SC::ServiceConfigKey for HandlePackageBasedRoutingCutover { fn get_key(&self) -> String { "HANDLE_PACKAGE_BASED_ROUTING_CUTOVER".to_string() } } -pub const handleAndPackageBasedRouting: HANDLE_PACKAGE_BASED_ROUTING_CUTOVER = - HANDLE_PACKAGE_BASED_ROUTING_CUTOVER; +pub const HANDLE_AND_PACKAGE_BASED_ROUTING: HandlePackageBasedRoutingCutover = + HandlePackageBasedRoutingCutover; -pub struct EDCC_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for EDCC_SUPPORTED_GATEWAYS { +pub struct EdccSupportedGateways; +impl SC::ServiceConfigKey for EdccSupportedGateways { fn get_key(&self) -> String { "EDCC_SUPPORTED_GATEWAYS".to_string() } } -pub struct MGA_ELIGIBLE_SEAMLESS_GATEWAYS; -impl SC::ServiceConfigKey for MGA_ELIGIBLE_SEAMLESS_GATEWAYS { +pub struct MgaEligibleSeamlessGateways; +impl SC::ServiceConfigKey for MgaEligibleSeamlessGateways { fn get_key(&self) -> String { "MGA_ELIGIBLE_SEAMLESS_GATEWAYS".to_string() } } -pub struct AMEX_NOT_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for AMEX_NOT_SUPPORTED_GATEWAYS { +pub struct AmexNotSupportedGateways; +impl SC::ServiceConfigKey for AmexNotSupportedGateways { fn get_key(&self) -> String { "AMEX_NOT_SUPPORTED_GATEWAYS".to_string() } } -pub struct V2_INTEGRATION_NOT_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for V2_INTEGRATION_NOT_SUPPORTED_GATEWAYS { +pub struct V2IntegrationNotSupportedGateways; +impl SC::ServiceConfigKey for V2IntegrationNotSupportedGateways { fn get_key(&self) -> String { "V2_INTEGRATION_NOT_SUPPORTED_GATEWAYS".to_string() } } -pub struct UPI_INTENT_NOT_SUPPORTED_GATEWAYS; -impl SC::ServiceConfigKey for UPI_INTENT_NOT_SUPPORTED_GATEWAYS { +pub struct UpiIntentNotSupportedGateways; +impl SC::ServiceConfigKey for UpiIntentNotSupportedGateways { fn get_key(&self) -> String { "UPI_INTENT_NOT_SUPPORTED_GATEWAYS".to_string() } } -pub struct ENABLED_CVVLESS_V2_ENABLED_MERCHANTS; -impl SC::ServiceConfigKey for ENABLED_CVVLESS_V2_ENABLED_MERCHANTS { +pub struct EnabledCvvlessV2EnabledMerchants; +impl SC::ServiceConfigKey for EnabledCvvlessV2EnabledMerchants { fn get_key(&self) -> String { "ENABLED_CVVLESS_V2_ENABLED_MERCHANTS".to_string() } } -pub const cvvLessV2Flow: ENABLED_CVVLESS_V2_ENABLED_MERCHANTS = - ENABLED_CVVLESS_V2_ENABLED_MERCHANTS; +pub const CVV_LESS_V2_FLOW: EnabledCvvlessV2EnabledMerchants = EnabledCvvlessV2EnabledMerchants; -pub const gatewaysWithTenureBasedCreds: [&str; 3] = ["HDFC", "HDFC_CC_EMI", "ICICI"]; +pub const GATEWAYS_WITH_TENURE_BASED_CREDS: [&str; 3] = ["HDFC", "HDFC_CC_EMI", "ICICI"]; -pub struct MERCHANT_CONFIG_ENTITY_LEVEL_LOOKUP_CUTOVER; -impl SC::ServiceConfigKey for MERCHANT_CONFIG_ENTITY_LEVEL_LOOKUP_CUTOVER { +pub struct MerchantConfigEntityLevelLookupCutover; +impl SC::ServiceConfigKey for MerchantConfigEntityLevelLookupCutover { fn get_key(&self) -> String { "MERCHANT_CONFIG_ENTITY_LEVEL_LOOKUP_CUTOVER".to_string() } diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 93aa9487..3af7cee6 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -120,7 +120,7 @@ pub async fn deciderFullPayloadHSFunction( dpShouldConsumeResult: dreq.shouldConsumeResult, }; - if dreq_.rankingAlgorithm == Some(RankingAlgorithm::NTW_BASED_ROUTING) { + if dreq_.rankingAlgorithm == Some(RankingAlgorithm::NtwBasedRouting) { logger::debug!("Performing debit routing"); network_decider::debit_routing::perform_debit_routing(dreq_).await } else { @@ -204,7 +204,7 @@ pub async fn runDeciderFlow( Some(pgw.clone()), None, Vec::new(), - T::GatewayDeciderApproach::MERCHANT_PREFERENCE, + T::GatewayDeciderApproach::MerchantPreference, None, functionalGateways, None, @@ -215,10 +215,10 @@ pub async fn runDeciderFlow( gateway_priority_map: Some(json!(HashMap::from([(pgw.to_string(), 1.0)]))), filter_wise_gateways: None, priority_logic_tag: None, - routing_approach: T::GatewayDeciderApproach::MERCHANT_PREFERENCE, + routing_approach: T::GatewayDeciderApproach::MerchantPreference, gateway_before_evaluation: Some(pgw.clone()), priority_logic_output: None, - reset_approach: T::ResetApproach::NO_RESET, + reset_approach: T::ResetApproach::NoReset, routing_dimension: None, routing_dimension_level: None, is_scheduled_outage: false, @@ -248,7 +248,7 @@ pub async fn runDeciderFlow( None, None, Vec::new(), - T::GatewayDeciderApproach::NONE, + T::GatewayDeciderApproach::None, None, functionalGateways, None, @@ -258,14 +258,14 @@ pub async fn runDeciderFlow( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), None, - T::GatewayDeciderApproach::NONE, + T::GatewayDeciderApproach::None, None, decider_flow.writer.is_dynamic_mga_enabled, )) } } _ => { - let gwPLogic = if rankingAlgorithm != Some(RankingAlgorithm::SR_BASED_ROUTING) { + let gwPLogic = if rankingAlgorithm != Some(RankingAlgorithm::SrBasedRouting) { match deciderParams.dpPriorityLogicOutput { Some(ref plOp) => plOp.clone(), None => { @@ -398,7 +398,7 @@ pub async fn runDeciderFlow( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), updatedPriorityLogicOutput.priorityLogicTag.clone(), - T::GatewayDeciderApproach::NONE, + T::GatewayDeciderApproach::None, Some(updatedPriorityLogicOutput), decider_flow.writer.is_dynamic_mga_enabled, )), @@ -512,7 +512,7 @@ pub async fn runDeciderFlow( } }; let key = [ - C::gatewayScoringData, + C::GATEWAY_SCORING_DATA, &deciderParams.dpTxnDetail.txnUuid.clone(), ] .concat(); @@ -530,7 +530,7 @@ pub async fn runDeciderFlow( serde_json::to_string(&updated_gateway_scoring_data.clone()) .unwrap_or_default() .as_str(), - C::gatewayScoreKeysTTL, + C::GATEWAY_SCORE_KEYS_TTL, ) .await .unwrap_or_default(); @@ -618,7 +618,7 @@ async fn filterFunctionalGatewaysWithEnforcment( decider_flow.writer.internalMetaData.clone(), decider_flow.get().dpOrderMetadata.metadata.clone(), plOp.clone(), - PriorityLogicFailure::NULL_AFTER_ENFORCE, + PriorityLogicFailure::NullAfterEnforce, ) .await; let fallBackGwPriority = @@ -639,7 +639,7 @@ async fn filterFunctionalGatewaysWithEnforcment( decider_flow.writer.internalMetaData.clone(), decider_flow.get().dpOrderMetadata.metadata.clone(), updatedPlOp, - PriorityLogicFailure::NULL_AFTER_ENFORCE, + PriorityLogicFailure::NullAfterEnforce, ) .await; (updatedEnforcedGateways, updatedPlOp) diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 38773228..247bcf52 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -375,7 +375,7 @@ pub async fn runDeciderFlow( Some(pgw.clone()), None, Vec::new(), - T::GatewayDeciderApproach::MERCHANT_PREFERENCE, + T::GatewayDeciderApproach::MerchantPreference, None, functionalGateways, None, @@ -386,10 +386,10 @@ pub async fn runDeciderFlow( gateway_priority_map: Some(json!(HashMap::from([(pgw.to_string(), 1.0)]))), filter_wise_gateways: None, priority_logic_tag: None, - routing_approach: T::GatewayDeciderApproach::MERCHANT_PREFERENCE, + routing_approach: T::GatewayDeciderApproach::MerchantPreference, gateway_before_evaluation: Some(pgw.clone()), priority_logic_output: None, - reset_approach: T::ResetApproach::NO_RESET, + reset_approach: T::ResetApproach::NoReset, routing_dimension: None, routing_dimension_level: None, is_scheduled_outage: false, @@ -420,7 +420,7 @@ pub async fn runDeciderFlow( None, None, Vec::new(), - T::GatewayDeciderApproach::NONE, + T::GatewayDeciderApproach::None, None, functionalGateways, None, @@ -430,7 +430,7 @@ pub async fn runDeciderFlow( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), None, - T::GatewayDeciderApproach::NONE, + T::GatewayDeciderApproach::None, None, decider_flow.writer.is_dynamic_mga_enabled, )) @@ -559,7 +559,7 @@ pub async fn runDeciderFlow( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), updatedPriorityLogicOutput.priorityLogicTag.clone(), - T::GatewayDeciderApproach::NONE, + T::GatewayDeciderApproach::None, Some(updatedPriorityLogicOutput), decider_flow.writer.is_dynamic_mga_enabled, )), @@ -677,7 +677,7 @@ pub async fn runDeciderFlow( }; let key = [ - C::gatewayScoringData, + C::GATEWAY_SCORING_DATA, &deciderParams.dpTxnDetail.txnUuid.clone(), ] .concat(); @@ -695,7 +695,7 @@ pub async fn runDeciderFlow( serde_json::to_string(&updated_gateway_scoring_data.clone()) .unwrap_or_default() .as_str(), - C::gatewayScoreKeysTTL, + C::GATEWAY_SCORE_KEYS_TTL, ) .await .unwrap_or_default(); @@ -796,7 +796,7 @@ async fn filterFunctionalGatewaysWithEnforcment( decider_flow.writer.internalMetaData.clone(), decider_flow.get().dpOrderMetadata.metadata.clone(), plOp.clone(), - PriorityLogicFailure::NULL_AFTER_ENFORCE, + PriorityLogicFailure::NullAfterEnforce, ) .await; let fallBackGwPriority = @@ -817,7 +817,7 @@ async fn filterFunctionalGatewaysWithEnforcment( decider_flow.writer.internalMetaData.clone(), decider_flow.get().dpOrderMetadata.metadata.clone(), updatedPlOp, - PriorityLogicFailure::NULL_AFTER_ENFORCE, + PriorityLogicFailure::NullAfterEnforce, ) .await; (updatedEnforcedGateways, updatedPlOp) @@ -1141,7 +1141,7 @@ pub async fn getFailureReasonWithFilter( .as_ref() .and_then(|meta| meta.isCvvLessTxn) .unwrap_or(false) - && txn_card_info.authType == Some(AuthType::MOTO) + && txn_card_info.authType == Some(AuthType::Moto) { format!( "No functional gateways supporting cvv less {}repeat moto transaction.", diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index 5a20ac0d..f6220471 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -1,4 +1,4 @@ -use crate::decider::gatewaydecider::constants::CASH_ONLY_GATEWAYS; +use crate::decider::gatewaydecider::constants::CashOnlyGateways; use crate::decider::gatewaydecider::types::*; use crate::decider::gatewaydecider::utils as Utils; use crate::decider::storage::utils::gateway_card_info as ETGCIS; @@ -200,7 +200,7 @@ pub async fn newGwFilters( None, None, vec![], - GatewayDeciderApproach::NONE, + GatewayDeciderApproach::None, None, vec![], None, @@ -319,7 +319,7 @@ pub async fn getFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList { let edcc_mgas = if txn_detail.currency != oref.currency && is_edcc_applied == Some(true) { let edcc_supported_gateways: Vec = - findByNameFromRedis(C::EDCC_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::EdccSupportedGateways.get_key()) .await .unwrap_or_else(Vec::new); @@ -373,7 +373,7 @@ pub async fn getFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList { rpd_filter_mgas } else { let mga_eligible_seamless_gateways = - findByNameFromRedis(C::MGA_ELIGIBLE_SEAMLESS_GATEWAYS.get_key()) + findByNameFromRedis(C::MgaEligibleSeamlessGateways.get_key()) .await .unwrap_or_else(std::vec::Vec::new); rpd_filter_mgas @@ -635,11 +635,11 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList // CVV Less Gateway Validations if Utils::is_card_transaction(&txnCardInfo) { if let Some(true) = mInternalMeta.as_ref().and_then(|meta| meta.isCvvLessTxn) { - if txnCardInfo.authType == Some(AuthType::MOTO) { + if txnCardInfo.authType == Some(AuthType::Moto) { let st = getGws(this); let authTypeRestrictedGateways = findByNameFromRedis::>>( - C::AUTH_TYPE_RESTRICTED_GATEWAYS.get_key(), + C::AuthTypeRestrictedGateways.get_key(), ) .await .unwrap_or_else(HashMap::new); @@ -667,7 +667,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList .map(|provider| provider.peek().to_string()) .unwrap_or_else(|| "DEFAULT".to_string()); let isMerchantEnabledForCvvLessV2Flow = isFeatureEnabled( - C::cvvLessV2Flow.get_key(), + C::CVV_LESS_V2_FLOW.get_key(), mAcc.merchantId.0, "kv_redis".to_string(), ) @@ -676,8 +676,8 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList let configResp = isPaymentFlowEnabledWithHierarchyCheck( mAcc.id.clone(), mAcc.tenantAccountId, - TC::MERCHANT_CONFIG, - PF::CVVLESS, + TC::MerchantConfig, + PF::Cvvless, crate::types::country::country_iso::text_db_to_country_iso( mAcc.country.as_deref().unwrap_or_default(), ) @@ -705,7 +705,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList GPMF::find_all_gpmf_by_gateway_payment_flow_payment_method( uniqueGwLs.clone(), cardPaymentMethod.id, - PaymentFlow::CVVLESS, + PaymentFlow::Cvvless, ) .await; let gmpfGws: Vec = allGPMfEntries @@ -791,11 +791,11 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList } } else { let cardBrandToCvvLessTxnSupportedGateways: HashMap> = - findByNameFromRedis(C::CARD_BRAND_TO_CVVLESS_TXN_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::CardBrandToCvvlessTxnSupportedGateways.get_key()) .await .unwrap_or_default(); let cvvLessTxnSupportedCommonGateways: Vec = - findByNameFromRedis(C::CVVLESS_TXN_SUPPORTED_COMMON_GATEWAYS.get_key()) + findByNameFromRedis(C::CvvlessTxnSupportedCommonGateways.get_key()) .await .unwrap_or_default(); let cvvLessTxnSupportedGateways = cvvLessTxnSupportedCommonGateways @@ -831,7 +831,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList if Utils::is_card_transaction(&txnCardInfo) && Utils::is_token_repeat_txn(mInternalMeta.clone()) { if let Some(secAuthType) = txnCardInfo.authType.clone() { - if secAuthType == AuthType::OTP { + if secAuthType == AuthType::Otp { let mTokenRepeatOtpSupportedGateways = Utils::get_token_supported_gateways( txnDetail.clone(), txnCardInfo.clone(), @@ -869,12 +869,12 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList } // Amex BTA Card based gateway filter - if Utils::is_card_transaction(&txnCardInfo) && txnCardInfo.authType == Some(AuthType::MOTO) { + if Utils::is_card_transaction(&txnCardInfo) && txnCardInfo.authType == Some(AuthType::Moto) { let paymentFlowList = Utils::get_payment_flow_list_from_txn_detail(&txnDetail); let st = getGws(this); if paymentFlowList.contains(&"TA_FILE".to_string()) { let taOfflineEnabledGateways: Vec = - findByNameFromRedis::>(C::TA_OFFLINE_ENABLED_GATEWAYS.get_key()) + findByNameFromRedis::>(C::TaOfflineEnabledGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -895,7 +895,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList txnDetail.txnId ); let merchantContainerSupportedGateways: Vec = - findByNameFromRedis(C::MERCHANT_CONTAINER_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::MerchantContainerSupportedGateways.get_key()) .await .unwrap_or_default(); let filtered_gateways: Vec = if txnCardInfo.paymentMethodType == MERCHANT_CONTAINER { @@ -970,28 +970,28 @@ pub async fn filterByCardBrand( card_brand: Option<&str>, ) -> Vec { let amex_supported_gateways: HashSet = - findByNameFromRedis(C::AMEX_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::AmexSupportedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect(); let amex_not_supported_gateways: HashSet = - findByNameFromRedis(C::AMEX_NOT_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::AmexNotSupportedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect(); let sodexo_only_gateways: HashSet = - findByNameFromRedis(C::SODEXO_ONLY_GATEWAYS.get_key()) + findByNameFromRedis(C::SodexoOnlyGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect(); let sodexo_also_gateways: HashSet = - findByNameFromRedis(C::SODEXO_ALSO_GATEWAYS.get_key()) + findByNameFromRedis(C::SodexoAlsoGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() @@ -1042,7 +1042,7 @@ pub async fn filterGatewaysForAuthType( if txn_card_info .authType .as_ref() - .map(|at| *at == AuthType::OTP) + .map(|at| *at == AuthType::Otp) .unwrap_or(false) { setGwsAndMgas( @@ -1062,7 +1062,7 @@ pub async fn filterGatewaysForAuthType( if txn_card_info .authType .as_ref() - .map(|at| *at == AuthType::MOTO) + .map(|at| *at == AuthType::Moto) .unwrap_or(false) { setGwsAndMgas( @@ -1078,11 +1078,11 @@ pub async fn filterGatewaysForAuthType( ); } - // Filter for NO_THREE_DS authentication type + // Filter for NoThreeDs authentication type if txn_card_info .authType .as_ref() - .map(|at| *at == AuthType::NO_THREE_DS) + .map(|at| *at == AuthType::NoThreeDs) .unwrap_or(false) { setGwsAndMgas( @@ -1102,7 +1102,7 @@ pub async fn filterGatewaysForAuthType( if txn_card_info .authType .as_ref() - .map(|at| *at == AuthType::VIES) + .map(|at| *at == AuthType::Vies) .unwrap_or(false) { setGwsAndMgas( @@ -1135,35 +1135,35 @@ pub async fn filterGatewaysForAuthType( // Get gateway restrictions and capabilities from Redis let atm_pin_card_info_restricted_gateways = - findByNameFromRedis(C::ATM_PIN_CARD_INFO_RESTRICTED_GATEWAYS.get_key()) + findByNameFromRedis(C::AtmPinCardInfoRestrictedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect::>(); let otp_card_info_restricted_gateways = - findByNameFromRedis(C::OTP_CARD_INFO_RESTRICTED_GATEWAYS.get_key()) + findByNameFromRedis(C::OtpCardInfoRestrictedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect::>(); let otp_card_info_supported_gateways = - findByNameFromRedis(C::OTP_CARD_INFO_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::OtpCardInfoSupportedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect::>(); let moto_card_info_supported_gateways = - findByNameFromRedis(C::MOTO_CARD_INFO_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::MotoCardInfoSupportedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect::>(); let auth_type_restricted_gateways = - findByNameFromRedis(C::AUTH_TYPE_RESTRICTED_GATEWAYS.get_key()) + findByNameFromRedis(C::AuthTypeRestrictedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() @@ -1250,7 +1250,7 @@ fn isGatewayCardInfoCheckNeeded( txn_card_info .authType .as_ref() - .map(|at| *at == AuthType::ATMPIN) + .map(|at| *at == AuthType::Atmpin) .unwrap_or(false) && atm_pin_card_info_restricted_gateways.contains(gateway) || @@ -1258,7 +1258,7 @@ fn isGatewayCardInfoCheckNeeded( txn_card_info .authType .as_ref() - .map(|at| *at == AuthType::OTP) + .map(|at| *at == AuthType::Otp) .unwrap_or(false) && otp_card_info_supported_gateways.contains(gateway) || @@ -1266,7 +1266,7 @@ fn isGatewayCardInfoCheckNeeded( txn_card_info .authType .as_ref() - .map(|at| *at == AuthType::MOTO) + .map(|at| *at == AuthType::Moto) .unwrap_or(false) && moto_card_info_supported_gateways.contains(gateway) } @@ -1289,13 +1289,13 @@ fn isAuthTypeSupportedGateway( (txn_card_info .authType .as_ref() - .map(|at| *at == AuthType::VIES) + .map(|at| *at == AuthType::Vies) .unwrap_or(false)) || !(txn_card_info .authType .as_ref() .map(|auth_type| { - *auth_type != AuthType::ATMPIN + *auth_type != AuthType::Atmpin && atm_pin_card_info_restricted_gateways.contains(gateway) }) .unwrap_or(false)) @@ -1303,7 +1303,7 @@ fn isAuthTypeSupportedGateway( .authType .as_ref() .map(|auth_type| { - *auth_type != AuthType::OTP + *auth_type != AuthType::Otp && otp_card_info_restricted_gateways.contains(gateway) }) .unwrap_or(false)) @@ -1393,7 +1393,7 @@ pub async fn filterFunctionalGatewaysForOTMFlow(this: &mut DeciderFlow<'_>) -> V let all_gpmf_entries = GPMF::find_all_gpmf_by_country_code_gw_pf_id_pmt_jbcid_db( crate::types::country::country_iso::CountryISO::IND, gw_list, - PaymentFlow::ONE_TIME_MANDATE, + PaymentFlow::OneTimeMandate, txn_card_info.paymentMethodType, jbc.id, ) @@ -1481,7 +1481,7 @@ pub async fn filterGatewaysForValidationType( // Get excluded gateways from Redis let card_mandate_bin_filter_excluded_gateways = - findByNameFromRedis(C::CARD_MANDATE_BIN_FILTER_EXCLUDED_GATEWAYS.get_key()) + findByNameFromRedis(C::CardMandateBinFilterExcludedGateways.get_key()) .await .unwrap_or_else(Vec::new); let bin_wise_filter_excluded_gateways = @@ -1713,7 +1713,7 @@ pub async fn filterGatewaysForValidationType( // Handle other transaction types else { let tpv_only_supported_gateways = - findByNameFromRedis(C::TPV_ONLY_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::TpvOnlySupportedGateways.get_key()) .await .unwrap_or_else(Vec::new); @@ -1852,7 +1852,7 @@ pub async fn filterGatewaysCardInfo( .clone() .unwrap_or_else(|| "THREE_DS".to_string()) == auth_type_to_text( - &m_auth_type.clone().unwrap_or(AuthType::THREE_DS), + &m_auth_type.clone().unwrap_or(AuthType::ThreeDs), ) }) .collect::>() @@ -1877,7 +1877,7 @@ pub async fn filterGatewaysCardInfo( .clone() .unwrap_or_else(|| "THREE_DS".to_string()) == auth_type_to_text( - &m_auth_type.clone().unwrap_or(AuthType::THREE_DS), + &m_auth_type.clone().unwrap_or(AuthType::ThreeDs), )) }) .collect::>(); @@ -2126,7 +2126,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { if txn_detail.isEmi.unwrap_or(false) { let is_mandate_txn = Utils::is_mandate_transaction(&txn_detail); let si_on_emi_card_supported_gateways: HashSet = - findByNameFromRedis::>(C::SI_ON_EMI_CARD_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis::>(C::SiOnEmiCardSupportedGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2145,7 +2145,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { let card_brand = Utils::get_card_brand(this).await; let si_on_emi_disabled_card_brand_gateway_mapping: HashMap> = findByNameFromRedis::>>( - C::SI_ON_EMI_DISABLED_CARD_BRAND_GATEWAY_MAPPING.get_key(), + C::SiOnEmiDisabledCardBrandGatewayMapping.get_key(), ) .await .unwrap_or_default(); @@ -2173,7 +2173,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { let gws = if Utils::check_no_or_low_cost_emi(&txn_card_info) { let no_or_low_cost_emi_supported_gateways: HashSet = findByNameFromRedis::>( - C::NO_OR_LOW_COST_EMI_SUPPORTED_GATEWAYS.get_key(), + C::NoOrLowCostEmiSupportedGateways.get_key(), ) .await .unwrap_or_default() @@ -2240,7 +2240,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { ); let gbes_v2_flag = isFeatureEnabled( - C::gbesV2Enabled.get_key(), + C::GBES_V2_ENABLED.get_key(), merchant_acc.merchantId.0, "kv_redis".to_string(), ) @@ -2260,7 +2260,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { for gbes in gbes_v2_list_.clone() { let is_enabled = if let Some(emi_bank) = emi_bank.clone() { isFeatureEnabledByDimension( - C::altIdEnabledGatewayEmiBank.get_key(), + C::ALT_ID_ENABLED_GATEWAY_EMI_BANK.get_key(), format!("{}::{}", gbes.gateway, emi_bank), ) .await @@ -2319,7 +2319,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { for gbes in gbes_list_.clone() { let is_enabled = if let Some(emi_bank) = emi_bank.clone() { isFeatureEnabledByDimension( - C::altIdEnabledGatewayEmiBank.get_key(), + C::ALT_ID_ENABLED_GATEWAY_EMI_BANK.get_key(), format!("{}::{}", gbes.gateway, emi_bank), ) .await @@ -2343,7 +2343,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { setGws(this, gws); } else if Utils::is_card_transaction(&txn_card_info) { let card_emi_explicit_gateways: HashSet = - findByNameFromRedis::>(C::CARD_EMI_EXPLICIT_GATEWAYS.get_key()) + findByNameFromRedis::>(C::CardEmiExplicitGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2456,7 +2456,7 @@ pub async fn filterGatewaysForPaymentMethod(this: &mut DeciderFlow<'_>) -> Vec = - findByNameFromRedis::>(C::V2_INTEGRATION_NOT_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis::>(C::V2IntegrationNotSupportedGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2465,7 +2465,7 @@ pub async fn filterGatewaysForPaymentMethod(this: &mut DeciderFlow<'_>) -> Vec = v2_integration_not_supported_gateways.iter().cloned().collect(); let upi_intent_not_supported_gateways: Vec = - findByNameFromRedis::>(C::UPI_INTENT_NOT_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis::>(C::UpiIntentNotSupportedGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2596,7 +2596,7 @@ pub async fn filterGatewaysForTokenProvider(this: &mut DeciderFlow<'_>) -> Gatew Some(v) => { let token_provider_gateway_mapping = findByNameFromRedis::>( - C::TOKEN_PROVIDER_GATEWAY_MAPPING.get_key(), + C::TokenProviderGatewayMapping.get_key(), ) .await .unwrap_or_default(); @@ -2622,20 +2622,20 @@ pub async fn filterGatewaysForWallet(this: &mut DeciderFlow<'_>) -> Vec let st = getGws(this); let txn_card_info = this.get().dpTxnCardInfo.clone(); let upi_only_gateways: HashSet = - findByNameFromRedis::>(C::UPI_ONLY_GATEWAYS.get_key()) + findByNameFromRedis::>(C::UpiOnlyGateways.get_key()) .await .unwrap_or_default() .into_iter() .collect(); let wallet_only_gateways: HashSet = - findByNameFromRedis::>(C::WALLET_ONLY_GATEWAYS.get_key()) + findByNameFromRedis::>(C::WalletOnlyGateways.get_key()) .await .unwrap_or_default() .into_iter() .collect(); let wallet_also_gateways: HashSet = - findByNameFromRedis::>(C::WALLET_ALSO_GATEWAYS.get_key()) + findByNameFromRedis::>(C::WalletAlsoGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2670,7 +2670,7 @@ pub async fn filterGatewaysForNbOnly(this: &mut DeciderFlow<'_>) -> Vec let txn_card_info = this.get().dpTxnCardInfo.clone(); if txn_card_info.card_type != Some(ETCA::CardType::Nb) { let nb_only_gateways: Vec = - findByNameFromRedis::>(C::NB_ONLY_GATEWAYS.get_key()) + findByNameFromRedis::>(C::NbOnlyGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2704,19 +2704,19 @@ pub async fn filterFunctionalGatewaysForMerchantRequiredFlow( let mf_filtered_gw = filter_gateways_for_flow( is_mf_order, - C::MUTUAL_FUND_FLOW_SUPPORTED_GATEWAYS.get_key(), + C::MutualFundFlowSupportedGateways.get_key(), st, ) .await; let mf_and_cb_filtered_gw = filter_gateways_for_flow( is_cb_order, - C::CROSS_BORDER_FLOW_SUPPORTED_GATEWAYS.get_key(), + C::CrossBorderFlowSupportedGateways.get_key(), mf_filtered_gw, ) .await; let filtered_gw = filter_gateways_for_flow( is_sbmd, - C::SBMD_SUPPORTED_GATEWAYS.get_key(), + C::SbmdSupportedGateways.get_key(), mf_and_cb_filtered_gw, ) .await; @@ -2825,7 +2825,7 @@ pub fn filterForEMITenureSpecificMGAs(this: &mut DeciderFlow<'_>) -> Vec // First check if gateway is in our functional list if st.contains(&gw_account.gateway) { // Check if gateway needs tenure-specific credentials - if C::gatewaysWithTenureBasedCreds + if C::GATEWAYS_WITH_TENURE_BASED_CREDS .map(|str| str.to_string()) .contains(&gw_account.gateway.to_string()) { @@ -2882,7 +2882,7 @@ pub async fn filterGatewaysForConsumerFinance(this: &mut DeciderFlow<'_>) -> Vec let st = getGws(this); let txn_card_info = this.get().dpTxnCardInfo.clone(); let consumer_finance_only_gateways: Vec = - findByNameFromRedis::>(C::CONSUMER_FINANCE_ONLY_GATEWAYS.get_key()) + findByNameFromRedis::>(C::ConsumerFinanceOnlyGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2894,7 +2894,7 @@ pub async fn filterGatewaysForConsumerFinance(this: &mut DeciderFlow<'_>) -> Vec if txn_card_info.paymentMethodType == CONSUMER_FINANCE { let consumer_finance_also_gateways: Vec = - findByNameFromRedis::>(C::CONSUMER_FINANCE_ALSO_GATEWAYS.get_key()) + findByNameFromRedis::>(C::ConsumerFinanceAlsoGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2933,7 +2933,7 @@ pub async fn filterGatewaysForUpi(this: &mut DeciderFlow<'_>) -> Vec { let txn_card_info = this.get().dpTxnCardInfo.clone(); let txn_detail = this.get().dpTxnDetail.clone(); let upi_only_gateways: Vec = - findByNameFromRedis::>(C::UPI_ONLY_GATEWAYS.get_key()) + findByNameFromRedis::>(C::UpiOnlyGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2944,7 +2944,7 @@ pub async fn filterGatewaysForUpi(this: &mut DeciderFlow<'_>) -> Vec { if txn_card_info.paymentMethodType == UPI { let upi_also_gateway: Vec = - findByNameFromRedis::>(C::UPI_ALSO_GATEWAYS.get_key()) + findByNameFromRedis::>(C::UpiAlsoGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -3015,11 +3015,11 @@ pub async fn filterGatewaysForTxnType(this: &mut DeciderFlow<'_>) -> Vec }; let v2_integration_not_supported_gateways: Vec = - findByNameFromRedis(C::V2_INTEGRATION_NOT_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::V2IntegrationNotSupportedGateways.get_key()) .await .unwrap_or_default(); let upi_intent_not_supported_gateways: Vec = - findByNameFromRedis(C::UPI_INTENT_NOT_SUPPORTED_GATEWAYS.get_key()) + findByNameFromRedis(C::UpiIntentNotSupportedGateways.get_key()) .await .unwrap_or_default(); let (_, filtered_mgas) = if ["UPI_PAY", "UPI_QR"].contains(&txn_type.as_str()) @@ -3041,7 +3041,7 @@ pub async fn filterGatewaysForTxnType(this: &mut DeciderFlow<'_>) -> Vec }; let txn_type_gateway_mapping = findByNameFromRedis::>>( - C::TXN_TYPE_GATEWAY_MAPPING.get_key(), + C::TxnTypeGatewayMapping.get_key(), ) .await .unwrap_or_default(); @@ -3137,7 +3137,7 @@ pub async fn filterGatewaysForTxnDetailType(this: &mut DeciderFlow<'_>) -> Vec) -> Vec let payment_method_type = this.get().dpTxnCardInfo.paymentMethodType.clone(); let card_type = this.get().dpTxnCardInfo.card_type.clone(); let reward_also_gateways: HashSet = - findByNameFromRedis(C::REWARD_ALSO_GATEWAYS.get_key()) + findByNameFromRedis(C::RewardAlsoGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect(); let reward_only_gateways: HashSet = - findByNameFromRedis(C::REWARD_ONLY_GATEWAYS.get_key()) + findByNameFromRedis(C::RewardOnlyGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() @@ -3207,7 +3207,7 @@ pub async fn filterGatewaysForCash(this: &mut DeciderFlow<'_>) -> Vec { let st = getGws(this); let payment_method_type = this.get().dpTxnCardInfo.paymentMethodType.clone(); if payment_method_type != CASH { - let cash_only_gateways: Vec = findByNameFromRedis(C::CASH_ONLY_GATEWAYS.get_key()) + let cash_only_gateways: Vec = findByNameFromRedis(C::CashOnlyGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() @@ -3308,7 +3308,7 @@ pub async fn filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<' .filter(|mgasi| { mgasi.merchantGatewayAccountId == mga.id && mgasi.subIdType == SubIdType::VENDOR - && mgasi.subInfoType == SubInfoType::SPLIT_SETTLEMENT + && mgasi.subInfoType == SubInfoType::SplitSettlement && !mgasi.disabled }) .map(|mgasi| mgasi.juspaySubAccountId.clone()) @@ -3346,7 +3346,7 @@ pub async fn filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<' ); let st = getGws(this); let split_settlement_supported_gateways: Option> = - findByNameFromRedis(C::SPLIT_SETTLEMENT_SUPPORTED_GATEWAYS.get_key()).await; + findByNameFromRedis(C::SplitSettlementSupportedGateways.get_key()).await; if !intersect( &split_settlement_supported_gateways.unwrap_or_default(), &st, diff --git a/src/decider/gatewaydecider/gw_filter_new.rs b/src/decider/gatewaydecider/gw_filter_new.rs index 2737dd84..440976d1 100644 --- a/src/decider/gatewaydecider/gw_filter_new.rs +++ b/src/decider/gatewaydecider/gw_filter_new.rs @@ -72,7 +72,7 @@ pub async fn newGwFilters(this: &mut DeciderFlow<'_>) -> (GatewayList, Vec) -> GatewayList { .collect(), }; - let edcc_supported_gateways = findByNameFromRedis(C::EDCC_SUPPORTED_GATEWAYS.get_key()).await.unwrap_or_else(|| vec![]); + let edcc_supported_gateways = findByNameFromRedis(C::EdccSupportedGateways.get_key()).await.unwrap_or_else(|| vec![]); if txn_detail.currency != oref.currency && is_edcc_applied == Some(true) { mgas.into_iter() @@ -208,7 +208,7 @@ pub async fn getFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList { let filtered_mgas = if proceed_with_all_mgas { rpd_filter_mgas } else { - let mga_eligible_seamless_gateways = findByNameFromRedis(C::MGA_ELIGIBLE_SEAMLESS_GATEWAYS.get_key()) + let mga_eligible_seamless_gateways = findByNameFromRedis(C::MgaEligibleSeamlessGateways.get_key()) .await.unwrap_or_else(|| vec![]); rpd_filter_mgas .into_iter() @@ -247,9 +247,9 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList // CVV Less Gateway Validations if Utils::is_card_transaction(&txnCardInfo) { if let Some(true) = mInternalMeta.as_ref().and_then(|meta| meta.isCvvLessTxn) { - if txnCardInfo.authType == Some(AuthType::MOTO) { + if txnCardInfo.authType == Some(AuthType::Moto) { let st = getGws(this); - let authTypeRestrictedGateways = findByNameFromRedis::>>(C::AUTH_TYPE_RESTRICTED_GATEWAYS.get_key()).await.unwrap_or_else(|| HashMap::new()); + let authTypeRestrictedGateways = findByNameFromRedis::>>(C::AuthTypeRestrictedGateways.get_key()).await.unwrap_or_else(|| HashMap::new()); let motoSupportedGateways: Vec = txnCardInfo.authType.as_ref() .and_then(|auth_type| authTypeRestrictedGateways.get(auth_type)) .cloned() @@ -274,7 +274,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList // let configResp = MerchantConfig::is_payment_flow_enabled_with_hierarchy_check( // mAcc.id, // mAcc.tenantAccountId, - // TC::MERCHANT_CONFIG, + // TC::MerchantConfig, // PF::CVVLESS, // None, // ).await?; @@ -361,8 +361,8 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList setGws(this, functionalGateways) } } else { - let cardBrandToCvvLessTxnSupportedGateways: HashMap> = findByNameFromRedis(C::CARD_BRAND_TO_CVVLESS_TXN_SUPPORTED_GATEWAYS.get_key()).await.unwrap_or_default(); - let cvvLessTxnSupportedCommonGateways: Vec = findByNameFromRedis(C::CVVLESS_TXN_SUPPORTED_COMMON_GATEWAYS.get_key()).await.unwrap_or_default(); + let cardBrandToCvvLessTxnSupportedGateways: HashMap> = findByNameFromRedis(C::CardBrandToCvvlessTxnSupportedGateways.get_key()).await.unwrap_or_default(); + let cvvLessTxnSupportedCommonGateways: Vec = findByNameFromRedis(C::CvvlessTxnSupportedCommonGateways.get_key()).await.unwrap_or_default(); let cvvLessTxnSupportedGateways = cvvLessTxnSupportedCommonGateways.into_iter() .chain(cardBrandToCvvLessTxnSupportedGateways.get(&txnCardInfo.paymentMethod).cloned().unwrap_or_default()) .collect::>() @@ -389,7 +389,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList // Card token based repeat transaction gateway filter if Utils::is_card_transaction(&txnCardInfo) && Utils::is_token_repeat_txn(mInternalMeta.clone()) { if let Some(secAuthType) = txnCardInfo.authType.clone() { - if secAuthType == AuthType::OTP { + if secAuthType == AuthType::Otp { let mTokenRepeatOtpSupportedGateways = Utils::get_token_supported_gateways(txnDetail.clone(), txnCardInfo.clone(), "OTP".to_string(), mInternalMeta.clone()).await; let st = getGws(this); let tokenRepeatOtpSupportedGateways = mTokenRepeatOtpSupportedGateways.unwrap_or_default(); @@ -413,11 +413,11 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList } // Amex BTA Card based gateway filter - if Utils::is_card_transaction(&txnCardInfo) && txnCardInfo.authType == Some(AuthType::MOTO) { + if Utils::is_card_transaction(&txnCardInfo) && txnCardInfo.authType == Some(AuthType::Moto) { let paymentFlowList = Utils::get_payment_flow_list_from_txn_detail(&txnDetail); let st = getGws(this); if paymentFlowList.contains(&"TA_FILE".to_string()) { - let taOfflineEnabledGateways: Vec = findByNameFromRedis::>(C::TA_OFFLINE_ENABLED_GATEWAYS.get_key()).await.unwrap_or_default().into_iter().collect(); + let taOfflineEnabledGateways: Vec = findByNameFromRedis::>(C::TaOfflineEnabledGateways.get_key()).await.unwrap_or_default().into_iter().collect(); let filtered_gateways: Vec = st.into_iter() .filter(|gw| taOfflineEnabledGateways.contains(gw)) .collect(); @@ -432,7 +432,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList "Functional gateways before filtering for MerchantContainer for txn_id: {:?}", txnDetail.txnId ); - let merchantContainerSupportedGateways: Vec = findByNameFromRedis(C::MERCHANT_CONTAINER_SUPPORTED_GATEWAYS.get_key()).await.unwrap_or_default(); + let merchantContainerSupportedGateways: Vec = findByNameFromRedis(C::MerchantContainerSupportedGateways.get_key()).await.unwrap_or_default(); let filtered_gateways: Vec = if txnCardInfo.paymentMethodType == PaymentMethodType::MerchantContainer { st.into_iter() .filter(|gw| merchantContainerSupportedGateways.contains(gw)) @@ -482,7 +482,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { if txn_detail.isEmi { let is_mandate_txn = Utils::is_mandate_transaction(&txn_detail); - let si_on_emi_card_supported_gateways: HashSet = findByNameFromRedis::>(C::SI_ON_EMI_CARD_SUPPORTED_GATEWAYS.get_key()) + let si_on_emi_card_supported_gateways: HashSet = findByNameFromRedis::>(C::SiOnEmiCardSupportedGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -500,7 +500,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { let st_filtered = if is_mandate_txn { let card_brand = Utils::get_card_brand().await; let si_on_emi_disabled_card_brand_gateway_mapping: HashMap> = - findByNameFromRedis::>>(C::SI_ON_EMI_DISABLED_CARD_BRAND_GATEWAY_MAPPING.get_key()) + findByNameFromRedis::>>(C::SiOnEmiDisabledCardBrandGatewayMapping.get_key()) .await .unwrap_or_default(); @@ -525,7 +525,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { }; let gws = if Utils::check_no_or_low_cost_emi(&txn_card_info) { - let no_or_low_cost_emi_supported_gateways: HashSet = findByNameFromRedis::>(C::NO_OR_LOW_COST_EMI_SUPPORTED_GATEWAYS.get_key()) + let no_or_low_cost_emi_supported_gateways: HashSet = findByNameFromRedis::>(C::NoOrLowCostEmiSupportedGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -607,7 +607,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { setGws(this, gws); } else if Utils::is_card_transaction(&txn_card_info) { - let card_emi_explicit_gateways: HashSet = findByNameFromRedis::>(C::CARD_EMI_EXPLICIT_GATEWAYS.get_key()) + let card_emi_explicit_gateways: HashSet = findByNameFromRedis::>(C::CardEmiExplicitGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -647,7 +647,7 @@ pub async fn filterGatewaysForTokenProvider(this: &mut DeciderFlow<'_>) -> Gatew None => returnGwListWithLog(this, DeciderFilterName::FilterFunctionalGatewaysForTokenProvider, false), Some(VaultProvider::Juspay) => returnGwListWithLog(this, DeciderFilterName::FilterFunctionalGatewaysForTokenProvider, true), Some(v) => { - let token_provider_gateway_mapping = findByNameFromRedis::>(C::TOKEN_PROVIDER_GATEWAY_MAPPING.get_key()) + let token_provider_gateway_mapping = findByNameFromRedis::>(C::TokenProviderGatewayMapping.get_key()) .await.unwrap_or_default(); let new_st = st .into_iter() @@ -672,10 +672,10 @@ pub async fn filterFunctionalGatewaysForMerchantRequiredFlow(this: &mut DeciderF let is_cb_order = payment_flow_list.contains(&"CROSS_BORDER_PAYMENT".to_string()); let is_sbmd = payment_flow_list.contains(&"SINGLE_BLOCK_MULTIPLE_DEBIT".to_string()); - let mf_filtered_gw = filter_gateways_for_flow(is_mf_order, C::MUTUAL_FUND_FLOW_SUPPORTED_GATEWAYS.get_key(), st).await; + let mf_filtered_gw = filter_gateways_for_flow(is_mf_order, C::MutualFundFlowSupportedGateways.get_key(), st).await; let mf_and_cb_filtered_gw = - filter_gateways_for_flow(is_cb_order, C::CROSS_BORDER_FLOW_SUPPORTED_GATEWAYS.get_key(), mf_filtered_gw).await; - let filtered_gw = filter_gateways_for_flow(is_sbmd, C::SBMD_SUPPORTED_GATEWAYS.get_key(), mf_and_cb_filtered_gw).await; + filter_gateways_for_flow(is_cb_order, C::CrossBorderFlowSupportedGateways.get_key(), mf_filtered_gw).await; + let filtered_gw = filter_gateways_for_flow(is_sbmd, C::SbmdSupportedGateways.get_key(), mf_and_cb_filtered_gw).await; setGws(this, filtered_gw); returnGwListWithLog(this, DeciderFilterName::FilterFunctionalGatewaysForMerchantRequiredFlow, true) @@ -811,7 +811,7 @@ pub async fn filterFunctionalGatewaysForOTMFlow(this: &mut DeciderFlow<'_>) -> V let all_gpmf_entries = GPMF::find_all_gpmf_by_country_code_gw_pf_id_pmt_jbcid_db( crate::types::country::country_iso::CountryISO::IND, gw_list, - PaymentFlow::ONE_TIME_MANDATE, + PaymentFlow::OneTimeMandate, txn_card_info.paymentMethodType, jbc.id, ) @@ -968,7 +968,7 @@ pub async fn filterGatewaysForValidationType(this: &mut DeciderFlow<'_>) -> () { // Handle Card Mandate transactions if Utils::is_mandate_transaction(&txn_detail) && Utils::is_card_transaction(&txn_card_info) { // Get excluded gateways from Redis - let card_mandate_bin_filter_excluded_gateways = findByNameFromRedis(C::CARD_MANDATE_BIN_FILTER_EXCLUDED_GATEWAYS.get_key()) + let card_mandate_bin_filter_excluded_gateways = findByNameFromRedis(C::CardMandateBinFilterExcludedGateways.get_key()) .await .unwrap_or_else(Vec::new); @@ -1160,7 +1160,7 @@ pub async fn filterGatewaysForValidationType(this: &mut DeciderFlow<'_>) -> () { } // Handle other transaction types else { - let tpv_only_supported_gateways = findByNameFromRedis(C::TPV_ONLY_SUPPORTED_GATEWAYS.get_key()) + let tpv_only_supported_gateways = findByNameFromRedis(C::TpvOnlySupportedGateways.get_key()) .await .unwrap_or_else(Vec::new); @@ -1236,15 +1236,15 @@ fn isGatewayCardInfoCheckNeeded( gateway: &Gateway, ) -> bool { // Check for ATM PIN auth type and if the gateway is in the restricted list - txn_card_info.authType.as_ref().map(|at| *at == AuthType::ATMPIN).unwrap_or(false) + txn_card_info.authType.as_ref().map(|at| *at == AuthType::Atmpin).unwrap_or(false) && atm_pin_card_info_restricted_gateways.contains(gateway) || // Check for OTP auth type and if the gateway supports it - txn_card_info.authType.as_ref().map(|at| *at == AuthType::OTP).unwrap_or(false) + txn_card_info.authType.as_ref().map(|at| *at == AuthType::Otp).unwrap_or(false) && otp_card_info_supported_gateways.contains(gateway) || // Check for MOTO auth type and if the gateway supports it - txn_card_info.authType.as_ref().map(|at| *at == AuthType::MOTO).unwrap_or(false) + txn_card_info.authType.as_ref().map(|at| *at == AuthType::Moto).unwrap_or(false) && moto_card_info_supported_gateways.contains(gateway) } @@ -1260,7 +1260,7 @@ pub async fn filterGatewaysForAuthType(this: &mut DeciderFlow<'_>) -> Vec) -> Vec) -> Vec) -> Vec) -> Vec>(); - let otp_card_info_restricted_gateways = findByNameFromRedis(C::OTP_CARD_INFO_RESTRICTED_GATEWAYS.get_key()).await + let otp_card_info_restricted_gateways = findByNameFromRedis(C::OtpCardInfoRestrictedGateways.get_key()).await .unwrap_or_else(Vec::new) .into_iter() .collect::>(); - let otp_card_info_supported_gateways = findByNameFromRedis(C::OTP_CARD_INFO_SUPPORTED_GATEWAYS.get_key()).await + let otp_card_info_supported_gateways = findByNameFromRedis(C::OtpCardInfoSupportedGateways.get_key()).await .unwrap_or_else(Vec::new) .into_iter() .collect::>(); - let moto_card_info_supported_gateways = findByNameFromRedis(C::MOTO_CARD_INFO_SUPPORTED_GATEWAYS.get_key()).await + let moto_card_info_supported_gateways = findByNameFromRedis(C::MotoCardInfoSupportedGateways.get_key()).await .unwrap_or_else(Vec::new) .into_iter() .collect::>(); - let auth_type_restricted_gateways = findByNameFromRedis(C::AUTH_TYPE_RESTRICTED_GATEWAYS.get_key()).await + let auth_type_restricted_gateways = findByNameFromRedis(C::AuthTypeRestrictedGateways.get_key()).await .unwrap_or_else(Vec::new) .into_iter() .collect::>>(); @@ -1418,25 +1418,25 @@ pub async fn filterGatewaysForAuthType(this: &mut DeciderFlow<'_>) -> Vec, st: &[Gateway], card_brand: Option<&str>) -> Vec { - let amex_supported_gateways: HashSet = findByNameFromRedis(C::AMEX_SUPPORTED_GATEWAYS.get_key()) + let amex_supported_gateways: HashSet = findByNameFromRedis(C::AmexSupportedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect(); - let amex_not_supported_gateways: HashSet = findByNameFromRedis(C::AMEX_NOT_SUPPORTED_GATEWAYS.get_key()) + let amex_not_supported_gateways: HashSet = findByNameFromRedis(C::AmexNotSupportedGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect(); - let sodexo_only_gateways: HashSet = findByNameFromRedis(C::SODEXO_ONLY_GATEWAYS.get_key()) + let sodexo_only_gateways: HashSet = findByNameFromRedis(C::SodexoOnlyGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() .collect(); - let sodexo_also_gateways: HashSet = findByNameFromRedis(C::SODEXO_ALSO_GATEWAYS.get_key()) + let sodexo_also_gateways: HashSet = findByNameFromRedis(C::SodexoAlsoGateways.get_key()) .await .unwrap_or_else(Vec::new) .into_iter() @@ -1651,7 +1651,7 @@ fn isAuthTypeSupportedGateway( .unwrap_or_else(|| { // Check if auth type is VIES (special case that's always allowed) (txn_card_info.authType.as_ref() - .map(|at| *at == AuthType::VIES) + .map(|at| *at == AuthType::Vies) .unwrap_or(false)) || // Not in restricted list by auth type, so check the negative conditions: @@ -1660,14 +1660,14 @@ fn isAuthTypeSupportedGateway( // NOT (auth_type isn't OTP AND gateway is restricted for OTP) !( txn_card_info.authType.as_ref() - .map(|auth_type| *auth_type != AuthType::ATMPIN && + .map(|auth_type| *auth_type != AuthType::Atmpin && atm_pin_card_info_restricted_gateways.contains(gateway)) .unwrap_or(false) ) && !( txn_card_info.authType.as_ref() - .map(|auth_type| *auth_type != AuthType::OTP && + .map(|auth_type| *auth_type != AuthType::Otp && otp_card_info_restricted_gateways.contains(gateway)) .unwrap_or(false) ) @@ -1972,7 +1972,7 @@ pub async fn filterGatewaysCardInfo( let gcis_without_merchant_validation = gcis .iter() .filter(|gci| { - gci_validation_gws.contains(&gci.gateway.clone().unwrap_or(ETG::Gateway::NONE)) + gci_validation_gws.contains(&gci.gateway.clone().unwrap_or(ETG::Gateway::None)) }) .cloned() .collect::>(); @@ -1980,7 +1980,7 @@ pub async fn filterGatewaysCardInfo( let gcis_with_merchant_validation = gcis .iter() .filter(|gci| { - merchant_validation_required_gws.contains(&gci.gateway.clone().unwrap_or(ETG::Gateway::NONE)) + merchant_validation_required_gws.contains(&gci.gateway.clone().unwrap_or(ETG::Gateway::None)) }) .cloned() .collect::>(); @@ -2130,17 +2130,17 @@ pub fn setGwsAndMgas(this: &mut DeciderFlow, filteredMgas: Vec) -> Vec { let st = getGws(this); let txn_card_info = this.get().dpTxnCardInfo.clone(); - let upi_only_gateways = findByNameFromRedis::>(C::UPI_ONLY_GATEWAYS.get_key()).await + let upi_only_gateways = findByNameFromRedis::>(C::UpiOnlyGateways.get_key()).await .unwrap_or_default() .into_iter() .collect::>(); - let wallet_only_gateways:Vec = findByNameFromRedis::>(C::WALLET_ONLY_GATEWAYS.get_key()).await + let wallet_only_gateways:Vec = findByNameFromRedis::>(C::WalletOnlyGateways.get_key()).await .unwrap_or_default() .into_iter() .collect(); let wallet_only_gateways_hashset: HashSet = wallet_only_gateways.into_iter().collect::>(); - let wallet_also_gateways:Vec = findByNameFromRedis::>(C::WALLET_ALSO_GATEWAYS.get_key()).await + let wallet_also_gateways:Vec = findByNameFromRedis::>(C::WalletAlsoGateways.get_key()).await .unwrap_or_default() .into_iter() .collect(); @@ -2170,7 +2170,7 @@ pub async fn filterGatewaysForNbOnly(this: &mut DeciderFlow<'_>) -> Vec = findByNameFromRedis::>(C::NB_ONLY_GATEWAYS.get_key()).await + let nb_only_gateways:Vec = findByNameFromRedis::>(C::NbOnlyGateways.get_key()).await .unwrap_or_default() .into_iter() .collect(); @@ -2189,7 +2189,7 @@ pub async fn filterGatewaysForNbOnly(this: &mut DeciderFlow<'_>) -> Vec) -> Vec { let st = getGws(this); let txn_card_info = this.get().dpTxnCardInfo.clone(); - let consumer_finance_only_gateways:Vec = findByNameFromRedis::>(C::CONSUMER_FINANCE_ONLY_GATEWAYS.get_key()).await + let consumer_finance_only_gateways:Vec = findByNameFromRedis::>(C::ConsumerFinanceOnlyGateways.get_key()).await .unwrap_or_default() .into_iter() .collect(); @@ -2198,7 +2198,7 @@ pub async fn filterGatewaysForConsumerFinance(this: &mut DeciderFlow<'_>) -> Vec if txn_card_info.paymentMethodType == ETP::PaymentMethodType::ConsumerFinance{ - let consumer_finance_also_gateways:Vec = findByNameFromRedis::>(C::CONSUMER_FINANCE_ALSO_GATEWAYS.get_key()) + let consumer_finance_also_gateways:Vec = findByNameFromRedis::>(C::ConsumerFinanceAlsoGateways.get_key()) .await.unwrap_or_default() .into_iter() .collect(); @@ -2217,7 +2217,7 @@ pub async fn filterGatewaysForUpi(this: &mut DeciderFlow<'_>) -> Vec = findByNameFromRedis::>(C::UPI_ONLY_GATEWAYS.get_key()).await + let upi_only_gateways: Vec = findByNameFromRedis::>(C::UpiOnlyGateways.get_key()).await .unwrap_or_default() .into_iter() .collect(); @@ -2227,7 +2227,7 @@ pub async fn filterGatewaysForUpi(this: &mut DeciderFlow<'_>) -> Vec = findByNameFromRedis::>(C::UPI_ALSO_GATEWAYS.get_key()).await + let upi_also_gateway: Vec = findByNameFromRedis::>(C::UpiAlsoGateways.get_key()).await .unwrap_or_default() .into_iter() .collect(); @@ -2279,8 +2279,8 @@ pub async fn filterGatewaysForTxnType(this: &mut DeciderFlow<'_>) -> Vec = findByNameFromRedis(C::V2_INTEGRATION_NOT_SUPPORTED_GATEWAYS.get_key()).await.unwrap_or_default(); - let upi_intent_not_supported_gateways: Vec = findByNameFromRedis(C::UPI_INTENT_NOT_SUPPORTED_GATEWAYS.get_key()).await.unwrap_or_default(); + let v2_integration_not_supported_gateways: Vec = findByNameFromRedis(C::V2IntegrationNotSupportedGateways.get_key()).await.unwrap_or_default(); + let upi_intent_not_supported_gateways: Vec = findByNameFromRedis(C::UpiIntentNotSupportedGateways.get_key()).await.unwrap_or_default(); let (_, filtered_mgas) = if ["UPI_PAY", "UPI_QR"].contains(&txn_type.as_str()) // && intersect(&st, &(v2_integration_not_supported_gateways.clone() + upi_intent_not_supported_gateways.clone())).is_empty() && { @@ -2300,7 +2300,7 @@ pub async fn filterGatewaysForTxnType(this: &mut DeciderFlow<'_>) -> Vec,) -> Vec< let st = getGws(this); let m_txn_type = this.get().dpTxnDetail.txnType.clone(); let txn_type: &str = m_txn_type.as_str(); - let txn_detail_type_restricted_gateways = findByNameFromRedis(C::TXN_DETAIL_TYPE_RESTRICTED_GATEWAYS.get_key()) + let txn_detail_type_restricted_gateways = findByNameFromRedis(C::TxnDetailTypeRestrictedGateways.get_key()) .await.unwrap_or_default(); let filter_gws = if txn_type == "ZERO_AUTH" { st.iter() @@ -2345,11 +2345,11 @@ pub async fn filterGatewaysForReward(this: &mut DeciderFlow<'_>,) -> Vec = findByNameFromRedis(C::REWARD_ALSO_GATEWAYS.get_key()) + let reward_also_gateways: HashSet = findByNameFromRedis(C::RewardAlsoGateways.get_key()) .await.unwrap_or_else(Vec::new) .into_iter() .collect(); - let reward_only_gateways: HashSet = findByNameFromRedis(C::REWARD_ONLY_GATEWAYS.get_key()) + let reward_only_gateways: HashSet = findByNameFromRedis(C::RewardOnlyGateways.get_key()) .await.unwrap_or_else(Vec::new) .into_iter() .collect(); @@ -2372,7 +2372,7 @@ pub async fn filterGatewaysForCash(this: &mut DeciderFlow<'_>,) -> Vec = findByNameFromRedis(C::CASH_ONLY_GATEWAYS.get_key()) + let cash_only_gateways: Vec = findByNameFromRedis(C::CashOnlyGateways.get_key()) .await.unwrap_or_else(Vec::new) .into_iter() .collect(); @@ -2445,7 +2445,7 @@ pub async fn filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<' .filter(|mgasi| { mgasi.merchantGatewayAccountId == mga.id && mgasi.subIdType == SubIdType::VENDOR - && mgasi.subInfoType == SubInfoType::SPLIT_SETTLEMENT + && mgasi.subInfoType == SubInfoType::SplitSettlement && !mgasi.disabled }) .map(|mgasi| mgasi.juspaySubAccountId.clone()) @@ -2476,7 +2476,7 @@ pub async fn filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<' msg ); let st = getGws(this); - let split_settlement_supported_gateways: Option> = findByNameFromRedis(C::SPLIT_SETTLEMENT_SUPPORTED_GATEWAYS.get_key()).await; + let split_settlement_supported_gateways: Option> = findByNameFromRedis(C::SplitSettlementSupportedGateways.get_key()).await; if !intersect(&split_settlement_supported_gateways.unwrap_or_else(Vec::new), &st).is_empty() { let mgas = SETMA::get_split_settlement_only_gateway_accounts( this, @@ -2564,7 +2564,7 @@ pub async fn filterGatewaysForPaymentMethod (this: &mut DeciderFlow<'_>,) -> Vec ); let pm = getPaymentMethodForNonCardTransaction(&txn_card_info); - let v2_integration_not_supported_gateways:Vec = findByNameFromRedis::>(C::V2_INTEGRATION_NOT_SUPPORTED_GATEWAYS.get_key()) + let v2_integration_not_supported_gateways:Vec = findByNameFromRedis::>(C::V2IntegrationNotSupportedGateways.get_key()) .await .unwrap_or_default() .into_iter() @@ -2572,7 +2572,7 @@ pub async fn filterGatewaysForPaymentMethod (this: &mut DeciderFlow<'_>,) -> Vec // let v2_integration_not_supported_gateways_hashset: HashSet = v2_integration_not_supported_gateways.iter().cloned().collect(); - let upi_intent_not_supported_gateways: Vec = findByNameFromRedis::>(C::UPI_INTENT_NOT_SUPPORTED_GATEWAYS.get_key()) + let upi_intent_not_supported_gateways: Vec = findByNameFromRedis::>(C::UpiIntentNotSupportedGateways.get_key()) .await .unwrap_or_default() .into_iter() diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index bcfa88ed..c434107f 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -189,7 +189,7 @@ pub async fn scoring_flow( if functional_gateways.len() == 1 { set_gwsm(decider_flow, create_score_map(functional_gateways.clone())); - set_decider_approach(decider_flow, GatewayDeciderApproach::DEFAULT); + set_decider_approach(decider_flow, GatewayDeciderApproach::Default); Utils::set_top_gateway_before_sr_downtime_evaluation( decider_flow, functional_gateways.first().cloned(), @@ -224,10 +224,10 @@ pub async fn scoring_flow( let is_merchant_enabled_for_sr_based_routing = isMerchantEnabledForPaymentFlows( merchant.id.clone(), - vec![PaymentFlow::SR_BASED_ROUTING], + vec![PaymentFlow::SrBasedRouting], ) .await - || ranking_algorithm == Some(RankingAlgorithm::SR_BASED_ROUTING); + || ranking_algorithm == Some(RankingAlgorithm::SrBasedRouting); let is_sr_v3_metric_enabled = if is_merchant_enabled_for_sr_based_routing { let is_sr_v3_metric_enabled = isFeatureEnabled( @@ -236,7 +236,7 @@ pub async fn scoring_flow( "kv_redis".to_string(), ) .await - || ranking_algorithm == Some(RankingAlgorithm::SR_BASED_ROUTING); + || ranking_algorithm == Some(RankingAlgorithm::SrBasedRouting); if is_sr_v3_metric_enabled { logger::info!( @@ -252,7 +252,7 @@ pub async fn scoring_flow( ) .await; let default_sr_v3_input_config = - findByNameFromRedis(C::srV3DefaultInputConfig.get_key()).await; + findByNameFromRedis(C::SR_V3_DEFAULT_INPUT_CONFIG.get_key()).await; logger::info!( tag = "scoringFlow_Sr_V3_Input_Config", @@ -293,7 +293,7 @@ pub async fn scoring_flow( &sr_routing_dimesions, ) }) - .unwrap_or(C::defaultSrV3BasedHedgingPercent); + .unwrap_or(C::DEFAULT_SR_V3_BASED_HEDGING_PERCENT); Utils::set_sr_v3_hedging_percent(decider_flow, hedging_percent); @@ -348,16 +348,16 @@ pub async fn scoring_flow( ); if should_explore { - set_decider_approach(decider_flow, GatewayDeciderApproach::SR_V3_HEDGING); + set_decider_approach(decider_flow, GatewayDeciderApproach::SrV3Hedging); } else { set_decider_approach( decider_flow, - GatewayDeciderApproach::SR_SELECTION_V3_ROUTING, + GatewayDeciderApproach::SrSelectionV3Routing, ); } let is_route_random_traffic_enabled = isFeatureEnabled( - C::routeRandomTrafficSrV3EnabledMerchant.get_key(), + C::ROUTE_RANDOM_TRAFFIC_SR_V3_ENABLED_MERCHANT.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), ) @@ -386,7 +386,7 @@ pub async fn scoring_flow( if sr_gw_score.len() > 1 && (!is_explore_and_exploit_enabled || should_explore) { let is_debug_mode_enabled = isFeatureEnabled( - C::enableDebugModeOnSrV3.get_key(), + C::ENABLE_DEBUG_MODE_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), ); @@ -432,7 +432,7 @@ pub async fn scoring_flow( Utils::get_m_id(merchant.merchantId.clone()), txn_detail.txnId.clone() ); - set_decider_approach(decider_flow, GatewayDeciderApproach::PRIORITY_LOGIC); + set_decider_approach(decider_flow, GatewayDeciderApproach::PriorityLogic); let gateway_score = get_score_with_priority(functional_gateways.clone(), gateway_priority_list.clone()); set_gwsm(decider_flow, gateway_score.clone()); @@ -502,7 +502,7 @@ pub async fn get_cached_scores_based_on_srv3( let sr_gateway_redis_key_map: GatewayRedisKeyMap = Utils::get_consumer_key( decider_flow, gateway_scoring_data, - super::types::ScoreKeyType::SR_V3_KEY, + super::types::ScoreKeyType::SrV3Key, false, functional_gateways.clone(), ) @@ -580,7 +580,7 @@ pub async fn get_cached_scores_based_on_srv3( .await; let is_srv3_reset_enabled = M::isFeatureEnabled( - C::ENABLE_RESET_ON_SR_V3.get_key(), + C::EnableResetOnSrV3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), ) @@ -600,7 +600,7 @@ pub async fn get_cached_scores_based_on_srv3( &sr_routing_dimesions, ) }) - .unwrap_or(C::defaultSrV3BasedUpperResetFactor); + .unwrap_or(C::DEFAULT_SR_V3_BASED_UPPER_RESET_FACTOR); let lower_reset_factor = Utils::get_sr_v3_lower_reset_factor( merchant_srv3_input_config.clone(), &pmt_str, @@ -615,7 +615,7 @@ pub async fn get_cached_scores_based_on_srv3( &sr_routing_dimesions, ) }) - .unwrap_or(C::defaultSrV3BasedLowerResetFactor); + .unwrap_or(C::DEFAULT_SR_V3_BASED_LOWER_RESET_FACTOR); logger::debug!( tag = "Sr_V3_Upper_Reset_Factor", action = "Sr_V3_Upper_Reset_Factor", @@ -649,7 +649,7 @@ pub async fn get_cached_scores_based_on_srv3( "SR_SELECTION_V3_EVALUATION_AFTER_RESET".to_string(), ) .await; - Utils::set_reset_approach(decider_flow, ResetApproach::SRV3_RESET); + Utils::set_reset_approach(decider_flow, ResetApproach::Srv3Reset); } updated_score_map_after_reset } else { @@ -657,7 +657,7 @@ pub async fn get_cached_scores_based_on_srv3( }; let is_srv3_extra_score_enabled = M::isFeatureEnabled( - C::enable_extra_score_on_sr_v3.get_key(), + C::ENABLE_EXTRA_SCORE_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), ) @@ -695,13 +695,13 @@ pub async fn get_cached_scores_based_on_srv3( }; let is_srv3_binomial_distribution_enabled = M::isFeatureEnabled( - C::enable_binomial_distribution_on_sr_v3.get_key(), + C::ENABLE_BINOMIAL_DISTRIBUTION_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), ) .await; let is_srv3_beta_distribution_enabled = M::isFeatureEnabled( - C::enable_beta_distribution_on_sr_v3.get_key(), + C::ENABLE_BETA_DISTRIBUTION_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), ) @@ -1008,7 +1008,7 @@ pub async fn update_score_for_outage(decider_flow: &mut DeciderFlow<'_>) -> Gate let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); let merchant = decider_flow.get().dpMerchantAccount.clone(); let scheduled_outage_validation_duration = - RService::findByNameFromRedis(C::SCHEDULED_OUTAGE_VALIDATION_DURATION.get_key()) + RService::findByNameFromRedis(C::ScheduledOutageValidationDuration.get_key()) .await .unwrap_or(86400); @@ -1367,7 +1367,7 @@ pub fn get_gateway_wise_routing_inputs_for_global_sr( .as_ref() .and_then(|input| input.defaultGlobalEliminationLevel.clone()) }) - .or(Some(ETGRI::EliminationLevel::PAYMENT_METHOD)); + .or(Some(ETGRI::EliminationLevel::PaymentMethod)); gri.eliminationMaxCountThreshold = gri .eliminationMaxCountThreshold .or(global_routing_defaults.defaultGlobalEliminationMaxCountThreshold); @@ -1387,7 +1387,7 @@ pub async fn get_global_elimination_gateway_score( gateway_key_map: GatewayRedisKeyMap, gsri: GatewayWiseSuccessRateBasedRoutingInput, ) -> Option<(Vec, f64)> { - if gsri.eliminationLevel != Some(ETGRI::EliminationLevel::NONE) { + if gsri.eliminationLevel != Some(ETGRI::EliminationLevel::None) { let redis_key = gateway_key_map .get(&gsri.gateway.to_string()) .cloned() @@ -1448,7 +1448,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( let gateway_redis_key_map = Utils::get_consumer_key( decider_flow, gateway_scoring_data, - ScoreKeyType::ELIMINATION_GLOBAL_KEY, + ScoreKeyType::EliminationGlobalKey, false, gateway_list, ) @@ -1783,11 +1783,11 @@ pub fn check_sr_global_routing_defaults( } pub fn is_forced_pm(v: &GatewaySuccessRateBasedRoutingInput) -> bool { - v.defaultGlobalEliminationLevel == Some(EliminationLevel::FORCED_PAYMENT_METHOD) + v.defaultGlobalEliminationLevel == Some(EliminationLevel::ForcedPaymentMethod) } pub fn global_elim_lvl_not_none(v: &GatewaySuccessRateBasedRoutingInput) -> bool { - v.defaultGlobalEliminationLevel != Some(EliminationLevel::NONE) + v.defaultGlobalEliminationLevel != Some(EliminationLevel::None) } pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( @@ -1799,20 +1799,20 @@ pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( default_success_rate_based_routing_input: Option, ) -> GatewayWiseSuccessRateBasedRoutingInput { let m_option = - RService::findByNameFromRedis(C::SR_BASED_GATEWAY_ELIMINATION_THRESHOLD.get_key()).await; + RService::findByNameFromRedis(C::SrBasedGatewayEliminationThreshold.get_key()).await; let default_soft_txn_reset_count = - RService::findByNameFromRedis(C::srBasedTxnResetCount.get_key()) + RService::findByNameFromRedis(C::SR_BASED_TXN_RESET_COUNT.get_key()) .await - .unwrap_or(C::gwDefaultTxnSoftResetCount); + .unwrap_or(C::GW_DEFAULT_TXN_SOFT_RESET_COUNT); let is_elimination_v2_enabled = isFeatureEnabled( - C::ENABLE_ELIMINATION_V2.get_key(), + C::EnableEliminationV2.get_key(), merchant_acc.merchantId.0.clone(), "kv_redis".to_string(), ) .await; let default_elimination_threshold = - m_option.unwrap_or(C::defaultSrBasedGatewayEliminationThreshold); + m_option.unwrap_or(C::DEFAULT_SR_BASED_GATEWAY_ELIMINATION_THRESHOLD); let merchant_given_default_threshold = gateway_success_rate_merchant_input .clone() .map(|input| input.defaultEliminationThreshold); @@ -1861,7 +1861,7 @@ pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( .eliminationLevel .clone() .or(merchant_given_default_elimination_level.clone()) - .or(Some(EliminationLevel::GATEWAY)), + .or(Some(EliminationLevel::Gateway)), ..e.clone() }) .unwrap_or(GatewayWiseSuccessRateBasedRoutingInput { @@ -1875,11 +1875,11 @@ pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( gatewayLevelEliminationThreshold: merchant_given_default_gateway_sr_threshold .unwrap_or( default_gateway_level_sr_elimination_threshold - .unwrap_or(Some(C::defSRBasedGwLevelEliminationThreshold)), + .unwrap_or(Some(C::DEF_SRBASED_GW_LEVEL_ELIMINATION_THRESHOLD)), ), eliminationLevel: merchant_given_default_elimination_level .or(default_merchant_elimination_level) - .or(Some(EliminationLevel::PAYMENT_METHOD)), + .or(Some(EliminationLevel::PaymentMethod)), currentScore: None, lastResetTimeStamp: None, }) @@ -2018,13 +2018,13 @@ pub async fn get_sr1_and_sr2_and_n( // let m_default_n = RC::r_hget(Config::EC_REDIS, construct_n_key(merchant_id), C::DEFAULT_FIELD_NAME_FOR_SR1_AND_N).await; // if let (Some(sr1), Some(n)) = (m_default_sr1, m_default_n) { -// Some((sr1, sr2, n, None, None, None, ConfigSource::MERCHANT_DEFAULT)) +// Some((sr1, sr2, n, None, None, None, ConfigSource::MerchantDefault)) // } else { // let m_s_config_sr1 = RService::find_by_name_from_redis(C::DEFAULT_SR1_S_CONFIG_PREFIX(merchant_id)).await; // let m_s_config_n = RService::find_by_name_from_redis(C::DEFAULT_N_S_CONFIG_PREFIX(merchant_id)).await; // if let (Some(sr1), Some(n)) = (m_s_config_sr1, m_s_config_n) { -// Some((sr1, sr2, n, None, None, None, ConfigSource::GLOBAL_DEFAULT)) +// Some((sr1, sr2, n, None, None, None, ConfigSource::GlobalDefault)) // } else { // None // } @@ -2053,7 +2053,7 @@ async fn filter_using_service_config( let configs = m_configs.unwrap_or_else(Vec::new); fetch_sr1_and_n_from_service_config_upto( - FilterLevel::TXN_OBJECT_TYPE, + FilterLevel::TxnObjectType, merchant_id.clone(), pmt.clone(), pm.clone(), @@ -2063,7 +2063,7 @@ async fn filter_using_service_config( ) .or_else(|| { fetch_sr1_and_n_from_service_config_upto( - FilterLevel::PAYMENT_METHOD, + FilterLevel::PaymentMethod, merchant_id.clone(), pmt.clone(), pm.clone(), @@ -2074,7 +2074,7 @@ async fn filter_using_service_config( }) .or_else(|| { fetch_sr1_and_n_from_service_config_upto( - FilterLevel::PAYMENT_METHOD_TYPE, + FilterLevel::PaymentMethodType, merchant_id, pmt, pm, @@ -2093,11 +2093,11 @@ pub fn filter_inputs_upto( inputs: Vec, ) -> Option { match level { - FilterLevel::TXN_OBJECT_TYPE => { + FilterLevel::TxnObjectType => { filter_inputs_upto_txn_object_type(pmt, pm, txn_obj_type, inputs) } - FilterLevel::PAYMENT_METHOD => filter_inputs_upto_payment_method(pmt, pm, inputs), - FilterLevel::PAYMENT_METHOD_TYPE => filter_inputs_upto_payment_method_type(pmt, inputs), + FilterLevel::PaymentMethod => filter_inputs_upto_payment_method(pmt, pm, inputs), + FilterLevel::PaymentMethodType => filter_inputs_upto_payment_method_type(pmt, inputs), } } @@ -2190,13 +2190,13 @@ pub fn fetch_sr1_and_n_from_service_config_upto( inputs, ); let m_config = match level { - FilterLevel::TXN_OBJECT_TYPE => { + FilterLevel::TxnObjectType => { filter_configs_upto_txn_object_type(&pmt, pm.as_ref(), &txn_object_type, &configs) } - FilterLevel::PAYMENT_METHOD => { + FilterLevel::PaymentMethod => { filter_configs_upto_payment_method(&pmt, pm.as_ref(), &configs) } - FilterLevel::PAYMENT_METHOD_TYPE => filter_configs_upto_payment_method_type(&pmt, &configs), + FilterLevel::PaymentMethodType => filter_configs_upto_payment_method_type(&pmt, &configs), }; match (m_input, m_config) { @@ -2207,7 +2207,7 @@ pub fn fetch_sr1_and_n_from_service_config_upto( Some(input.paymentMethodType), input.paymentMethod.clone(), input.txnObjectType.clone(), - ConfigSource::SERVICE_CONFIG, + ConfigSource::ServiceConfig, )), _ => None, } @@ -2304,8 +2304,7 @@ pub async fn get_success_rate_routing_inputs( Option, Option, ) { - let redis_input = - findByNameFromRedis(C::DEFAULT_SR_BASED_GATEWAY_ELIMINATION_INPUT.get_key()).await; + let redis_input = findByNameFromRedis(C::DefaultSrBasedGatewayEliminationInput.get_key()).await; let decoded_input = Utils::decode_and_log_error( "Gateway Decider Input Decode Error", &merchant_acc.gatewaySuccessRateBasedDeciderInput, @@ -2346,8 +2345,8 @@ pub async fn update_gateway_score_based_on_success_rate( let enable_success_rate_based_gateway_elimination = isPaymentFlowEnabledWithHierarchyCheck( merchant_acc.id.clone(), merchant_acc.tenantAccountId.clone(), - ModuleName::MERCHANT_CONFIG, - PaymentFlow::ELIMINATION_BASED_ROUTING, + ModuleName::MerchantConfig, + PaymentFlow::EliminationBasedRouting, crate::types::country::country_iso::text_db_to_country_iso( merchant_acc.country.as_deref().unwrap_or_default(), ) @@ -2380,7 +2379,7 @@ pub async fn update_gateway_score_based_on_success_rate( ); let is_reset_score_enabled_for_merchant = isFeatureEnabled( - C::GATEWAY_RESET_SCORE_ENABLED.get_key(), + C::GatewayResetScoreEnabled.get_key(), Utils::get_m_id(txn_detail.merchantId.clone()), "kv_redis".to_string(), ) @@ -2463,7 +2462,7 @@ pub async fn update_gateway_score_based_on_success_rate( let gateway_redis_key_map = Utils::get_consumer_key( decider_flow, gateway_scoring_data.clone(), - ScoreKeyType::ELIMINATION_MERCHANT_KEY, + ScoreKeyType::EliminationMerchantKey, false, gateway_list.clone(), ) @@ -2656,7 +2655,7 @@ pub async fn update_gateway_score_based_on_success_rate( && new_gateway_score.len() == filtered_gateway_success_rate_inputs.len() { let optimization_during_downtime_enabled = isFeatureEnabled( - C::ENABLE_OPTIMIZATION_DURING_DOWNTIME.get_key(), + C::EnableOptimizationDuringDowntime.get_key(), Utils::get_m_id(txn_detail.merchantId.clone()), "kv_redis".to_string(), ) @@ -2672,7 +2671,7 @@ pub async fn update_gateway_score_based_on_success_rate( new_gateway_score, ); - (new_gateway_score.clone(), DownTime::ALL_DOWNTIME, vec![]) + (new_gateway_score.clone(), DownTime::AllDowntime, vec![]) } else { logger::info!( "Overriding priority with PL during downtime for {:?} : {:?}", @@ -2680,7 +2679,7 @@ pub async fn update_gateway_score_based_on_success_rate( initial_gw_scores, ); - (initial_gw_scores.clone(), DownTime::ALL_DOWNTIME, vec![]) + (initial_gw_scores.clone(), DownTime::AllDowntime, vec![]) } } else { logger::info!( @@ -2693,7 +2692,7 @@ pub async fn update_gateway_score_based_on_success_rate( ( new_gateway_score.clone(), - DownTime::ALL_DOWNTIME, + DownTime::AllDowntime, sr_based_elimination_approach_info, ) } @@ -2703,19 +2702,19 @@ pub async fn update_gateway_score_based_on_success_rate( { ( new_gateway_score.clone(), - DownTime::GLOBAL_DOWNTIME, + DownTime::GlobalDowntime, sr_based_elimination_approach_info, ) } else if !filtered_gateway_success_rate_inputs.is_empty() { ( new_gateway_score.clone(), - DownTime::DOWNTIME, + DownTime::Downtime, sr_based_elimination_approach_info, ) } else { ( new_gateway_score.clone(), - DownTime::NO_DOWNTIME, + DownTime::NoDowntime, sr_based_elimination_approach_info, ) }; @@ -2828,8 +2827,8 @@ pub fn merchantGatewayScoreDimension( routingInput: GatewayWiseSuccessRateBasedRoutingInput, ) -> Dimension { match routingInput.eliminationLevel { - Some(EliminationLevel::PAYMENT_METHOD_TYPE) => Dimension::SECOND, - Some(EliminationLevel::PAYMENT_METHOD) => Dimension::THIRD, + Some(EliminationLevel::PaymentMethodType) => Dimension::SECOND, + Some(EliminationLevel::PaymentMethod) => Dimension::THIRD, _ => Dimension::FIRST, } } @@ -2837,20 +2836,20 @@ pub fn merchantGatewayScoreDimension( pub async fn getKeyTTLFromMerchantDimension(dimension: Dimension) -> f64 { let mTtl: Option = match dimension { Dimension::FIRST => { - RService::findByNameFromRedis(C::gwScoreFirstDimensionTtl.get_key()).await + RService::findByNameFromRedis(C::GW_SCORE_FIRST_DIMENSION_TTL.get_key()).await } Dimension::SECOND => { - RService::findByNameFromRedis(C::gwScoreSecondDimensionTtl.get_key()).await + RService::findByNameFromRedis(C::GW_SCORE_SECOND_DIMENSION_TTL.get_key()).await } Dimension::THIRD => { - RService::findByNameFromRedis(C::gwScoreThirdDimensionTtl.get_key()).await + RService::findByNameFromRedis(C::GW_SCORE_THIRD_DIMENSION_TTL.get_key()).await } Dimension::FOURTH => { - RService::findByNameFromRedis(C::gwScoreFourthDimensionTtl.get_key()).await + RService::findByNameFromRedis(C::GW_SCORE_FOURTH_DIMENSION_TTL.get_key()).await } }; - mTtl.unwrap_or(C::defScoreKeysTtl) + mTtl.unwrap_or(C::DEF_SCORE_KEYS_TTL) } pub async fn evaluate_reset_gateway_score( @@ -2935,7 +2934,7 @@ pub async fn trigger_reset_gateway_score( if let Some(sr_input) = m_sr_input { let gw_ref_id = Utils::get_gateway_reference_id(meta, it, oref, pl_ref_id_map); - let hard_ttl = getTTLForKey(ScoreKeyType::ELIMINATION_MERCHANT_KEY).await; + let hard_ttl = getTTLForKey(ScoreKeyType::EliminationMerchantKey).await; let soft_ttl = getKeyTTLFromMerchantDimension(merchantGatewayScoreDimension(sr_input.clone())) .await; @@ -2971,13 +2970,13 @@ pub async fn trigger_reset_gateway_score( let reset_approach = Utils::get_reset_approach(decider_flow); match reset_approach { - ResetApproach::SRV2_RESET => { - Utils::set_reset_approach(decider_flow, ResetApproach::SRV2_ELIMINATION_RESET) + ResetApproach::Srv2Reset => { + Utils::set_reset_approach(decider_flow, ResetApproach::Srv2EliminationReset) } - ResetApproach::SRV3_RESET => { - Utils::set_reset_approach(decider_flow, ResetApproach::SRV3_ELIMINATION_RESET) + ResetApproach::Srv3Reset => { + Utils::set_reset_approach(decider_flow, ResetApproach::Srv3EliminationReset) } - _ => Utils::set_reset_approach(decider_flow, ResetApproach::ELIMINATION_RESET), + _ => Utils::set_reset_approach(decider_flow, ResetApproach::EliminationReset), } logger::info!( tag = "RESET_APPROACH", @@ -3172,7 +3171,7 @@ pub fn route_random_traffic( .collect::>() ); - set_decider_approach(decider_flow, GatewayDeciderApproach::SR_V3_HEDGING); + set_decider_approach(decider_flow, GatewayDeciderApproach::SrV3Hedging); remaining_gateways .into_iter() diff --git a/src/decider/gatewaydecider/runner.rs b/src/decider/gatewaydecider/runner.rs index 062b1a65..20e079e8 100644 --- a/src/decider/gatewaydecider/runner.rs +++ b/src/decider/gatewaydecider/runner.rs @@ -479,10 +479,10 @@ pub fn parse_log_entry(log: Vec) -> LogEntry { pub fn pl_execution_retry_failure_reasons() -> Vec { vec![ - DeciderTypes::PriorityLogicFailure::CONNECTION_FAILED, - DeciderTypes::PriorityLogicFailure::RESPONSE_CONTENT_TYPE_NOT_SUPPORTED, - DeciderTypes::PriorityLogicFailure::RESPONSE_DECODE_FAILURE, - DeciderTypes::PriorityLogicFailure::RESPONSE_PARSE_ERROR, + DeciderTypes::PriorityLogicFailure::ConnectionFailed, + DeciderTypes::PriorityLogicFailure::ResponseContentTypeNotSupported, + DeciderTypes::PriorityLogicFailure::ResponseDecodeFailure, + DeciderTypes::PriorityLogicFailure::ResponseParseError, ] } @@ -815,7 +815,7 @@ async fn get_priority_logic_script_from_tenant_config( Some(ref tenant_account_id) => { match get_tenant_config_by_tenant_id_and_module_name_and_module_key_and_type( tenant_account_id.to_string(), - ModuleName::PRIORITY_LOGIC, + ModuleName::PriorityLogic, "priority_logic".to_string(), ConfigType::FALLBACK, ) @@ -1073,7 +1073,7 @@ fn check_and_update_pl_failure_reason( None => None, Some(mut data) => { if data.failure_reason != pl_failure_reason { - data.status = DeciderTypes::Status::FAILURE; + data.status = DeciderTypes::Status::Failure; data.failure_reason = pl_failure_reason; } Some(data) @@ -1135,7 +1135,7 @@ async fn handle_response( .collect(); let pl_data = DeciderTypes::PriorityLogicData { name: priority_logic_tag, - status: DeciderTypes::Status::FAILURE, + status: DeciderTypes::Status::Failure, failure_reason: pl_resp.errorMessage, }; EvaluationResult::EvaluationError(pl_data, log_entries) @@ -1163,8 +1163,8 @@ async fn handle_failure_response( ) -> EvaluationResult { let pl_data = DeciderTypes::PriorityLogicData { name: priority_logic_tag, - status: DeciderTypes::Status::FAILURE, - failure_reason: DeciderTypes::PriorityLogicFailure::PL_EVALUATION_FAILED, + status: DeciderTypes::Status::Failure, + failure_reason: DeciderTypes::PriorityLogicFailure::PlEvaluationFailed, }; EvaluationResult::EvaluationError(pl_data, log_entries) } @@ -1175,11 +1175,11 @@ async fn handle_success_response( log_entries: Vec, ) -> EvaluationResult { let gws = response_body.result.gatewayPriority.unwrap_or_default(); - let status = DeciderTypes::Status::SUCCESS; + let status = DeciderTypes::Status::Success; let pl_data = DeciderTypes::PriorityLogicData { name: priority_logic_tag.clone(), status: status.clone(), - failure_reason: DeciderTypes::PriorityLogicFailure::NO_ERROR, + failure_reason: DeciderTypes::PriorityLogicFailure::NoError, }; let pl_output = DeciderTypes::GatewayPriorityLogicOutput { isEnforcement: response_body.result.isEnforcement.unwrap_or(false), @@ -1196,7 +1196,7 @@ fn handle_client_error(client_error: ApiClientError) -> PLExecutorError { match client_error { ApiClientError::BadRequest(bytes) => PLExecutorError { error: true, - errorMessage: DeciderTypes::PriorityLogicFailure::COMPILATION_ERROR, + errorMessage: DeciderTypes::PriorityLogicFailure::CompilationError, userMessage: "Bad request sent to the server.".to_string(), log: Some(vec![vec![ "Error".to_string(), @@ -1206,7 +1206,7 @@ fn handle_client_error(client_error: ApiClientError) -> PLExecutorError { }, ApiClientError::Unauthorized(bytes) => PLExecutorError { error: true, - errorMessage: DeciderTypes::PriorityLogicFailure::CONNECTION_FAILED, + errorMessage: DeciderTypes::PriorityLogicFailure::ConnectionFailed, userMessage: "Unauthorized access.".to_string(), log: Some(vec![vec![ "Error".to_string(), @@ -1216,7 +1216,7 @@ fn handle_client_error(client_error: ApiClientError) -> PLExecutorError { }, ApiClientError::InternalServerError(bytes) => PLExecutorError { error: true, - errorMessage: DeciderTypes::PriorityLogicFailure::UNHANDLED_EXCEPTION, + errorMessage: DeciderTypes::PriorityLogicFailure::UnhandledException, userMessage: "Internal server error occurred.".to_string(), log: Some(vec![vec![ "Error".to_string(), @@ -1226,7 +1226,7 @@ fn handle_client_error(client_error: ApiClientError) -> PLExecutorError { }, ApiClientError::ResponseDecodingFailed => PLExecutorError { error: true, - errorMessage: DeciderTypes::PriorityLogicFailure::RESPONSE_DECODE_FAILURE, + errorMessage: DeciderTypes::PriorityLogicFailure::ResponseDecodeFailure, userMessage: "Failed to decode the response.".to_string(), log: Some(vec![vec![ "Error".to_string(), @@ -1236,7 +1236,7 @@ fn handle_client_error(client_error: ApiClientError) -> PLExecutorError { }, ApiClientError::RequestNotSent => PLExecutorError { error: true, - errorMessage: DeciderTypes::PriorityLogicFailure::CONNECTION_FAILED, + errorMessage: DeciderTypes::PriorityLogicFailure::ConnectionFailed, userMessage: "The request was not sent.".to_string(), log: Some(vec![vec![ "Error".to_string(), @@ -1249,7 +1249,7 @@ fn handle_client_error(client_error: ApiClientError) -> PLExecutorError { message, } => PLExecutorError { error: true, - errorMessage: DeciderTypes::PriorityLogicFailure::UNHANDLED_EXCEPTION, + errorMessage: DeciderTypes::PriorityLogicFailure::UnhandledException, userMessage: "An unexpected error occurred.".to_string(), log: Some(vec![vec![ "Error".to_string(), @@ -1259,7 +1259,7 @@ fn handle_client_error(client_error: ApiClientError) -> PLExecutorError { }, _ => PLExecutorError { error: true, - errorMessage: DeciderTypes::PriorityLogicFailure::UNHANDLED_EXCEPTION, + errorMessage: DeciderTypes::PriorityLogicFailure::UnhandledException, userMessage: "An unknown error occurred.".to_string(), log: Some(vec![vec![ "Error".to_string(), diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 42785a47..eb734615 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -180,27 +180,30 @@ pub enum DeciderScoringName { } #[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum DetailedGatewayScoringType { - ELIMINATION_PENALISE, - ELIMINATION_REWARD, - SRV2_PENALISE, - SRV2_REWARD, - SRV3_PENALISE, - SRV3_REWARD, + EliminationPenalise, + EliminationReward, + Srv2Penalise, + Srv2Reward, + Srv3Penalise, + Srv3Reward, } #[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum RoutingFlowType { - ELIMINATION_FLOW, - SRV2_FLOW, - SRV3_FLOW, + EliminationFlow, + Srv2Flow, + Srv3Flow, } #[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum ScoreUpdateStatus { - PENALISED, - REWARDED, - NOT_INITIATED, + Penalised, + Rewarded, + NotInitiated, } pub type GatewayScoreMap = HMap; @@ -491,7 +494,7 @@ pub fn initial_decider_state(date_created: String) -> DeciderState { dateCreated: date_created, gatewayBeforeDowntimeEvaluation: None, }, - gwDeciderApproach: GatewayDeciderApproach::NONE, + gwDeciderApproach: GatewayDeciderApproach::None, srElminiationApproachInfo: vec![], allMgas: None, paymentFlowList: vec![], @@ -501,7 +504,7 @@ pub fn initial_decider_state(date_created: String) -> DeciderState { isSrV3MetricEnabled: false, isPrimaryGateway: Some(true), experiment_tag: None, - reset_approach: ResetApproach::NO_RESET, + reset_approach: ResetApproach::NoReset, routing_dimension: None, routing_dimension_level: None, isScheduledOutage: false, @@ -589,67 +592,72 @@ pub struct MetricsStreamKey(String); // } #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum ScoreKeyType { - ELIMINATION_GLOBAL_KEY, - ELIMINATION_MERCHANT_KEY, - OUTAGE_GLOBAL_KEY, - OUTAGE_MERCHANT_KEY, - SR_V2_KEY, - SR_V3_KEY, + EliminationGlobalKey, + EliminationMerchantKey, + OutageGlobalKey, + OutageMerchantKey, + SrV2Key, + SrV3Key, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum GatewayDeciderApproach { - SR_SELECTION, - SR_SELECTION_V2_ROUTING, - SR_SELECTION_V3_ROUTING, - PRIORITY_LOGIC, - DEFAULT, - NONE, - MERCHANT_PREFERENCE, - PL_ALL_DOWNTIME_ROUTING, - PL_DOWNTIME_ROUTING, - PL_GLOBAL_DOWNTIME_ROUTING, - SR_V2_ALL_DOWNTIME_ROUTING, - SR_V2_DOWNTIME_ROUTING, - SR_V2_GLOBAL_DOWNTIME_ROUTING, - SR_V2_HEDGING, - SR_V2_ALL_DOWNTIME_HEDGING, - SR_V2_DOWNTIME_HEDGING, - SR_V2_GLOBAL_DOWNTIME_HEDGING, - SR_V3_ALL_DOWNTIME_ROUTING, - SR_V3_DOWNTIME_ROUTING, - SR_V3_GLOBAL_DOWNTIME_ROUTING, - SR_V3_HEDGING, - SR_V3_ALL_DOWNTIME_HEDGING, - SR_V3_DOWNTIME_HEDGING, - SR_V3_GLOBAL_DOWNTIME_HEDGING, - NTW_BASED_ROUTING, + SrSelection, + SrSelectionV2Routing, + SrSelectionV3Routing, + PriorityLogic, + Default, + None, + MerchantPreference, + PlAllDowntimeRouting, + PlDowntimeRouting, + PlGlobalDowntimeRouting, + SrV2AllDowntimeRouting, + SrV2DowntimeRouting, + SrV2GlobalDowntimeRouting, + SrV2Hedging, + SrV2AllDowntimeHedging, + SrV2DowntimeHedging, + SrV2GlobalDowntimeHedging, + SrV3AllDowntimeRouting, + SrV3DowntimeRouting, + SrV3GlobalDowntimeRouting, + SrV3Hedging, + SrV3AllDowntimeHedging, + SrV3DowntimeHedging, + SrV3GlobalDowntimeHedging, + NtwBasedRouting, } #[derive(Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum DownTime { - ALL_DOWNTIME, - GLOBAL_DOWNTIME, - DOWNTIME, - NO_DOWNTIME, + AllDowntime, + GlobalDowntime, + Downtime, + NoDowntime, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum ResetApproach { - ELIMINATION_RESET, - SRV2_RESET, - SRV3_RESET, - NO_RESET, - SRV2_ELIMINATION_RESET, - SRV3_ELIMINATION_RESET, + EliminationReset, + Srv2Reset, + Srv3Reset, + NoReset, + Srv2EliminationReset, + Srv3EliminationReset, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum RankingAlgorithm { - SR_BASED_ROUTING, - PL_BASED_ROUTING, - NTW_BASED_ROUTING, + SrBasedRouting, + PlBasedRouting, + NtwBasedRouting, } // pub type DeciderFlow = for<'a> fn(&'a mut (dyn MonadFlow + 'a)) -> ReaderT, R>; @@ -1292,19 +1300,21 @@ pub struct Offer { } #[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum EmiType { - NO_COST_EMI, - LOW_COST_EMI, + NoCostEmi, + LowCostEmi, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum ValidationType { - CARD_MANDATE, - EMANDATE, - TPV, - TPV_MANDATE, - REWARD, - TPV_EMANDATE, + CardMandate, + Emandate, + Tpv, + TpvMandate, + Reward, + TpvEmandate, } impl fmt::Display for DeciderScoringName { @@ -1339,12 +1349,12 @@ impl fmt::Display for DeciderScoringName { impl fmt::Display for DetailedGatewayScoringType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::ELIMINATION_PENALISE => write!(f, "ELIMINATION_PENALISE"), - Self::ELIMINATION_REWARD => write!(f, "ELIMINATION_REWARD"), - Self::SRV2_PENALISE => write!(f, "SRV2_PENALISE"), - Self::SRV2_REWARD => write!(f, "SRV2_REWARD"), - Self::SRV3_PENALISE => write!(f, "SRV3_PENALISE"), - Self::SRV3_REWARD => write!(f, "SRV3_REWARD"), + Self::EliminationPenalise => write!(f, "ELIMINATION_PENALISE"), + Self::EliminationReward => write!(f, "ELIMINATION_REWARD"), + Self::Srv2Penalise => write!(f, "SRV2_PENALISE"), + Self::Srv2Reward => write!(f, "SRV2_REWARD"), + Self::Srv3Penalise => write!(f, "SRV3_PENALISE"), + Self::Srv3Reward => write!(f, "SRV3_REWARD"), } } } @@ -1352,9 +1362,9 @@ impl fmt::Display for DetailedGatewayScoringType { impl fmt::Display for RoutingFlowType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::ELIMINATION_FLOW => write!(f, "ELIMINATION_FLOW"), - Self::SRV2_FLOW => write!(f, "SRV2_FLOW"), - Self::SRV3_FLOW => write!(f, "SRV3_FLOW"), + Self::EliminationFlow => write!(f, "ELIMINATION_FLOW"), + Self::Srv2Flow => write!(f, "SRV2_FLOW"), + Self::Srv3Flow => write!(f, "SRV3_FLOW"), } } } @@ -1362,9 +1372,9 @@ impl fmt::Display for RoutingFlowType { impl fmt::Display for ScoreUpdateStatus { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::PENALISED => write!(f, "PENALISED"), - Self::REWARDED => write!(f, "REWARDED"), - Self::NOT_INITIATED => write!(f, "NOT_INITIATED"), + Self::Penalised => write!(f, "PENALISED"), + Self::Rewarded => write!(f, "REWARDED"), + Self::NotInitiated => write!(f, "NOT_INITIATED"), } } } @@ -1372,12 +1382,12 @@ impl fmt::Display for ScoreUpdateStatus { impl fmt::Display for ScoreKeyType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::ELIMINATION_GLOBAL_KEY => write!(f, "ELIMINATION_GLOBAL_KEY"), - Self::ELIMINATION_MERCHANT_KEY => write!(f, "ELIMINATION_MERCHANT_KEY"), - Self::OUTAGE_GLOBAL_KEY => write!(f, "OUTAGE_GLOBAL_KEY"), - Self::OUTAGE_MERCHANT_KEY => write!(f, "OUTAGE_MERCHANT_KEY"), - Self::SR_V2_KEY => write!(f, "SR_V2_KEY"), - Self::SR_V3_KEY => write!(f, "SR_V3_KEY"), + Self::EliminationGlobalKey => write!(f, "ELIMINATION_GLOBAL_KEY"), + Self::EliminationMerchantKey => write!(f, "ELIMINATION_MERCHANT_KEY"), + Self::OutageGlobalKey => write!(f, "OUTAGE_GLOBAL_KEY"), + Self::OutageMerchantKey => write!(f, "OUTAGE_MERCHANT_KEY"), + Self::SrV2Key => write!(f, "SR_V2_KEY"), + Self::SrV3Key => write!(f, "SR_V3_KEY"), } } } @@ -1385,49 +1395,49 @@ impl fmt::Display for ScoreKeyType { impl fmt::Display for GatewayDeciderApproach { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::SR_SELECTION => write!(f, "SR_SELECTION"), - Self::SR_SELECTION_V2_ROUTING => write!(f, "SR_SELECTION_V2_ROUTING"), - Self::SR_SELECTION_V3_ROUTING => write!(f, "SR_SELECTION_V3_ROUTING"), - Self::PRIORITY_LOGIC => write!(f, "PRIORITY_LOGIC"), - Self::DEFAULT => write!(f, "DEFAULT"), - Self::NONE => write!(f, "NONE"), - Self::MERCHANT_PREFERENCE => write!(f, "MERCHANT_PREFERENCE"), - Self::PL_ALL_DOWNTIME_ROUTING => write!(f, "PL_ALL_DOWNTIME_ROUTING"), - Self::PL_DOWNTIME_ROUTING => write!(f, "PL_DOWNTIME_ROUTING"), - Self::PL_GLOBAL_DOWNTIME_ROUTING => { + Self::SrSelection => write!(f, "SR_SELECTION"), + Self::SrSelectionV2Routing => write!(f, "SR_SELECTION_V2_ROUTING"), + Self::SrSelectionV3Routing => write!(f, "SR_SELECTION_V3_ROUTING"), + Self::PriorityLogic => write!(f, "PRIORITY_LOGIC"), + Self::Default => write!(f, "DEFAULT"), + Self::None => write!(f, "NONE"), + Self::MerchantPreference => write!(f, "MERCHANT_PREFERENCE"), + Self::PlAllDowntimeRouting => write!(f, "PL_ALL_DOWNTIME_ROUTING"), + Self::PlDowntimeRouting => write!(f, "PL_DOWNTIME_ROUTING"), + Self::PlGlobalDowntimeRouting => { write!(f, "PL_GLOBAL_DOWNTIME_ROUTING") } - Self::SR_V2_ALL_DOWNTIME_ROUTING => { + Self::SrV2AllDowntimeRouting => { write!(f, "SR_V2_ALL_DOWNTIME_ROUTING") } - Self::SR_V2_DOWNTIME_ROUTING => write!(f, "SR_V2_DOWNTIME_ROUTING"), - Self::SR_V2_GLOBAL_DOWNTIME_ROUTING => { + Self::SrV2DowntimeRouting => write!(f, "SR_V2_DOWNTIME_ROUTING"), + Self::SrV2GlobalDowntimeRouting => { write!(f, "SR_V2_GLOBAL_DOWNTIME_ROUTING") } - Self::SR_V2_HEDGING => write!(f, "SR_V2_HEDGING"), - Self::SR_V2_ALL_DOWNTIME_HEDGING => { + Self::SrV2Hedging => write!(f, "SR_V2_HEDGING"), + Self::SrV2AllDowntimeHedging => { write!(f, "SR_V2_ALL_DOWNTIME_HEDGING") } - Self::SR_V2_DOWNTIME_HEDGING => write!(f, "SR_V2_DOWNTIME_HEDGING"), - Self::SR_V2_GLOBAL_DOWNTIME_HEDGING => { + Self::SrV2DowntimeHedging => write!(f, "SR_V2_DOWNTIME_HEDGING"), + Self::SrV2GlobalDowntimeHedging => { write!(f, "SR_V2_GLOBAL_DOWNTIME_HEDGING") } - Self::SR_V3_ALL_DOWNTIME_ROUTING => { + Self::SrV3AllDowntimeRouting => { write!(f, "SR_V3_ALL_DOWNTIME_ROUTING") } - Self::SR_V3_DOWNTIME_ROUTING => write!(f, "SR_V3_DOWNTIME_ROUTING"), - Self::SR_V3_GLOBAL_DOWNTIME_ROUTING => { + Self::SrV3DowntimeRouting => write!(f, "SR_V3_DOWNTIME_ROUTING"), + Self::SrV3GlobalDowntimeRouting => { write!(f, "SR_V3_GLOBAL_DOWNTIME_ROUTING") } - Self::SR_V3_HEDGING => write!(f, "SR_V3_HEDGING"), - Self::SR_V3_ALL_DOWNTIME_HEDGING => { + Self::SrV3Hedging => write!(f, "SR_V3_HEDGING"), + Self::SrV3AllDowntimeHedging => { write!(f, "SR_V3_ALL_DOWNTIME_HEDGING") } - Self::SR_V3_DOWNTIME_HEDGING => write!(f, "SR_V3_DOWNTIME_HEDGING"), - Self::SR_V3_GLOBAL_DOWNTIME_HEDGING => { + Self::SrV3DowntimeHedging => write!(f, "SR_V3_DOWNTIME_HEDGING"), + Self::SrV3GlobalDowntimeHedging => { write!(f, "SR_V3_GLOBAL_DOWNTIME_HEDGING") } - Self::NTW_BASED_ROUTING => { + Self::NtwBasedRouting => { write!(f, "NTW_BASED_ROUTING") } } @@ -1437,10 +1447,10 @@ impl fmt::Display for GatewayDeciderApproach { impl fmt::Display for DownTime { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::ALL_DOWNTIME => write!(f, "ALL_DOWNTIME"), - Self::GLOBAL_DOWNTIME => write!(f, "GLOBAL_DOWNTIME"), - Self::DOWNTIME => write!(f, "DOWNTIME"), - Self::NO_DOWNTIME => write!(f, "NO_DOWNTIME"), + Self::AllDowntime => write!(f, "ALL_DOWNTIME"), + Self::GlobalDowntime => write!(f, "GLOBAL_DOWNTIME"), + Self::Downtime => write!(f, "DOWNTIME"), + Self::NoDowntime => write!(f, "NO_DOWNTIME"), } } } @@ -1448,12 +1458,12 @@ impl fmt::Display for DownTime { impl fmt::Display for ResetApproach { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::ELIMINATION_RESET => write!(f, "ELIMINATION_RESET"), - Self::SRV2_RESET => write!(f, "SRV2_RESET"), - Self::SRV3_RESET => write!(f, "SRV3_RESET"), - Self::NO_RESET => write!(f, "NO_RESET"), - Self::SRV2_ELIMINATION_RESET => write!(f, "SRV2_ELIMINATION_RESET"), - Self::SRV3_ELIMINATION_RESET => write!(f, "SRV3_ELIMINATION_RESET"), + Self::EliminationReset => write!(f, "ELIMINATION_RESET"), + Self::Srv2Reset => write!(f, "SRV2_RESET"), + Self::Srv3Reset => write!(f, "SRV3_RESET"), + Self::NoReset => write!(f, "NO_RESET"), + Self::Srv2EliminationReset => write!(f, "SRV2_ELIMINATION_RESET"), + Self::Srv3EliminationReset => write!(f, "SRV3_ELIMINATION_RESET"), } } } @@ -1461,12 +1471,12 @@ impl fmt::Display for ResetApproach { impl fmt::Display for ValidationType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::CARD_MANDATE => write!(f, "CARD_MANDATE"), - Self::EMANDATE => write!(f, "EMANDATE"), - Self::TPV => write!(f, "TPV"), - Self::TPV_MANDATE => write!(f, "TPV_MANDATE"), - Self::REWARD => write!(f, "REWARD"), - Self::TPV_EMANDATE => write!(f, "TPV_EMANDATE"), + Self::CardMandate => write!(f, "CARD_MANDATE"), + Self::Emandate => write!(f, "EMANDATE"), + Self::Tpv => write!(f, "TPV"), + Self::TpvMandate => write!(f, "TPV_MANDATE"), + Self::Reward => write!(f, "REWARD"), + Self::TpvEmandate => write!(f, "TPV_EMANDATE"), } } } @@ -1474,8 +1484,8 @@ impl fmt::Display for ValidationType { impl fmt::Display for Status { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::SUCCESS => write!(f, "SUCCESS"), - Self::FAILURE => write!(f, "FAILURE"), + Self::Success => write!(f, "SUCCESS"), + Self::Failure => write!(f, "FAILURE"), } } } @@ -1483,22 +1493,22 @@ impl fmt::Display for Status { impl fmt::Display for PriorityLogicFailure { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::NO_ERROR => write!(f, "NO_ERROR"), - Self::CONNECTION_FAILED => write!(f, "CONNECTION_FAILED"), - Self::COMPILATION_ERROR => write!(f, "COMPILATION_ERROR"), - Self::MEMORY_EXCEEDED => write!(f, "MEMORY_EXCEEDED"), - Self::GATEWAY_NAME_PARSE_FAILURE => { + Self::NoError => write!(f, "NO_ERROR"), + Self::ConnectionFailed => write!(f, "CONNECTION_FAILED"), + Self::CompilationError => write!(f, "COMPILATION_ERROR"), + Self::MemoryExceeded => write!(f, "MEMORY_EXCEEDED"), + Self::GatewayNameParseFailure => { write!(f, "GATEWAY_NAME_PARSE_FAILURE") } - Self::RESPONSE_CONTENT_TYPE_NOT_SUPPORTED => { + Self::ResponseContentTypeNotSupported => { write!(f, "RESPONSE_CONTENT_TYPE_NOT_SUPPORTED") } - Self::RESPONSE_DECODE_FAILURE => write!(f, "RESPONSE_DECODE_FAILURE"), - Self::RESPONSE_PARSE_ERROR => write!(f, "RESPONSE_PARSE_ERROR"), - Self::PL_EVALUATION_FAILED => write!(f, "PL_EVALUATION_FAILED"), - Self::NULL_AFTER_ENFORCE => write!(f, "NULL_AFTER_ENFORCE"), - Self::UNHANDLED_EXCEPTION => write!(f, "UNHANDLED_EXCEPTION"), - Self::CODE_TOO_LARGE => write!(f, "CODE_TOO_LARGE"), + Self::ResponseDecodeFailure => write!(f, "RESPONSE_DECODE_FAILURE"), + Self::ResponseParseError => write!(f, "RESPONSE_PARSE_ERROR"), + Self::PlEvaluationFailed => write!(f, "PL_EVALUATION_FAILED"), + Self::NullAfterEnforce => write!(f, "NULL_AFTER_ENFORCE"), + Self::UnhandledException => write!(f, "UNHANDLED_EXCEPTION"), + Self::CodeTooLarge => write!(f, "CODE_TOO_LARGE"), } } } @@ -1517,8 +1527,8 @@ impl fmt::Display for Dimension { impl fmt::Display for EmiType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::NO_COST_EMI => write!(f, "NO_COST_EMI"), - Self::LOW_COST_EMI => write!(f, "LOW_COST_EMI"), + Self::NoCostEmi => write!(f, "NO_COST_EMI"), + Self::LowCostEmi => write!(f, "LOW_COST_EMI"), } } } @@ -1616,27 +1626,27 @@ pub struct PriorityLogicData { } #[derive(Debug, PartialEq, Clone, Eq, Serialize, Deserialize)] -// #[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum PriorityLogicFailure { - NO_ERROR, - CONNECTION_FAILED, - COMPILATION_ERROR, - MEMORY_EXCEEDED, - GATEWAY_NAME_PARSE_FAILURE, - RESPONSE_CONTENT_TYPE_NOT_SUPPORTED, - RESPONSE_DECODE_FAILURE, - RESPONSE_PARSE_ERROR, - PL_EVALUATION_FAILED, - NULL_AFTER_ENFORCE, - UNHANDLED_EXCEPTION, - CODE_TOO_LARGE, + NoError, + ConnectionFailed, + CompilationError, + MemoryExceeded, + GatewayNameParseFailure, + ResponseContentTypeNotSupported, + ResponseDecodeFailure, + ResponseParseError, + PlEvaluationFailed, + NullAfterEnforce, + UnhandledException, + CodeTooLarge, } #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] -// #[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum Status { - SUCCESS, - FAILURE, + Success, + Failure, } #[derive(Debug, Serialize, Deserialize)] @@ -1805,17 +1815,19 @@ pub struct SuccessRate1AndNConfig { } #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum FilterLevel { - TXN_OBJECT_TYPE, - PAYMENT_METHOD, - PAYMENT_METHOD_TYPE, + TxnObjectType, + PaymentMethod, + PaymentMethodType, } #[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum ConfigSource { - GLOBAL_DEFAULT, - MERCHANT_DEFAULT, - SERVICE_CONFIG, + GlobalDefault, + MerchantDefault, + ServiceConfig, REDIS, } diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 23505f6f..2f464fdc 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -267,7 +267,7 @@ pub async fn get_merchant_wise_mandate_bin_eligible_gateways( ) -> Vec { let merchant_wise_mandate_bin_enforced_gateways: Vec = RService::findByNameFromRedis::>( - C::MERCHANT_WISE_MANDATE_BIN_ENFORCED_GATEWAYS.get_key(), + C::MerchantWiseMandateBinEnforcedGateways.get_key(), ) .await .unwrap_or_default(); @@ -300,7 +300,7 @@ pub async fn is_merchant_wise_auth_type_check_needed( ) -> bool { let merchant_wise_auth_type_bin_enforced_gateways: Vec = RService::findByNameFromRedis::>( - C::MERCHANT_WISE_AUTH_TYPE_BIN_ENFORCED_GATEWAYS.get_key(), + C::MerchantWiseAuthTypeBinEnforcedGateways.get_key(), ) .await .unwrap_or_default(); @@ -1019,13 +1019,13 @@ async fn get_token_supported_gateways_key( ) -> Option> { if brand == token_provider { RService::findByNameFromRedis( - C::TOKEN_SUPPORTED_GATEWAYS(brand, None, provider_category, flow).get_key(), + C::TokenSupportedGateways(brand, None, provider_category, flow).get_key(), ) .await .unwrap_or_default() } else { RService::findByNameFromRedis( - C::TOKEN_SUPPORTED_GATEWAYS(brand, Some(token_provider), provider_category, flow) + C::TokenSupportedGateways(brand, Some(token_provider), provider_category, flow) .get_key(), ) .await @@ -1091,19 +1091,19 @@ pub fn get_m_id(mid: ETM::id::MerchantId) -> String { } async fn get_upi_handle_list() -> Vec { - RService::findByNameFromRedis(C::V2_ROUTING_HANDLE_LIST.get_key()) + RService::findByNameFromRedis(C::V2RoutingHandleList.get_key()) .await .unwrap_or_default() } async fn get_routing_top_bank_list() -> Vec { - RService::findByNameFromRedis(C::V2_ROUTING_TOP_BANK_LIST.get_key()) + RService::findByNameFromRedis(C::V2RoutingTopBankList.get_key()) .await .unwrap_or_default() } async fn get_upi_package_list() -> Vec { - RService::findByNameFromRedis(C::V2_ROUTING_PSP_PACKAGE_LIST.get_key()) + RService::findByNameFromRedis(C::V2RoutingPspPackageList.get_key()) .await .unwrap_or_default() } @@ -1166,7 +1166,7 @@ pub fn get_payment_flow_list_from_txn_detail(txn_detail: &ETTD::TxnDetail) -> Ve Some(PaymentFlowInfoInInternalTrackingInfo { paymentFlowInfo }) => paymentFlowInfo .paymentFlows .into_iter() - .filter(|flow| C::paymentFlowsRequiredForGwFiltering.contains(&flow.as_str())) + .filter(|flow| C::PAYMENT_FLOWS_REQUIRED_FOR_GW_FILTERING.contains(&flow.as_str())) .collect(), None => vec![], } @@ -1246,10 +1246,10 @@ pub fn get_gateway_decider_approach( if gw_set.len() > 1 { gateway_decider_approach } else { - types::GatewayDeciderApproach::DEFAULT + types::GatewayDeciderApproach::Default } } else { - types::GatewayDeciderApproach::NONE + types::GatewayDeciderApproach::None } } @@ -1258,53 +1258,45 @@ pub fn modify_gateway_decider_approach( down_time: types::DownTime, ) -> types::GatewayDeciderApproach { match gw_decider_approach { - types::GatewayDeciderApproach::SR_SELECTION_V3_ROUTING => match down_time { - types::DownTime::ALL_DOWNTIME => { - types::GatewayDeciderApproach::SR_V3_ALL_DOWNTIME_ROUTING + types::GatewayDeciderApproach::SrSelectionV3Routing => match down_time { + types::DownTime::AllDowntime => types::GatewayDeciderApproach::SrV3AllDowntimeRouting, + types::DownTime::GlobalDowntime => { + types::GatewayDeciderApproach::SrV3GlobalDowntimeRouting } - types::DownTime::GLOBAL_DOWNTIME => { - types::GatewayDeciderApproach::SR_V3_GLOBAL_DOWNTIME_ROUTING - } - types::DownTime::DOWNTIME => types::GatewayDeciderApproach::SR_V3_DOWNTIME_ROUTING, - types::DownTime::NO_DOWNTIME => types::GatewayDeciderApproach::SR_SELECTION_V3_ROUTING, + types::DownTime::Downtime => types::GatewayDeciderApproach::SrV3DowntimeRouting, + types::DownTime::NoDowntime => types::GatewayDeciderApproach::SrSelectionV3Routing, }, - types::GatewayDeciderApproach::SR_V3_HEDGING => match down_time { - types::DownTime::ALL_DOWNTIME => { - types::GatewayDeciderApproach::SR_V3_ALL_DOWNTIME_HEDGING - } - types::DownTime::GLOBAL_DOWNTIME => { - types::GatewayDeciderApproach::SR_V3_GLOBAL_DOWNTIME_HEDGING + types::GatewayDeciderApproach::SrV3Hedging => match down_time { + types::DownTime::AllDowntime => types::GatewayDeciderApproach::SrV3AllDowntimeHedging, + types::DownTime::GlobalDowntime => { + types::GatewayDeciderApproach::SrV3GlobalDowntimeHedging } - types::DownTime::DOWNTIME => types::GatewayDeciderApproach::SR_V3_DOWNTIME_HEDGING, - types::DownTime::NO_DOWNTIME => types::GatewayDeciderApproach::SR_V3_HEDGING, + types::DownTime::Downtime => types::GatewayDeciderApproach::SrV3DowntimeHedging, + types::DownTime::NoDowntime => types::GatewayDeciderApproach::SrV3Hedging, }, - types::GatewayDeciderApproach::SR_SELECTION_V2_ROUTING => match down_time { - types::DownTime::ALL_DOWNTIME => { - types::GatewayDeciderApproach::SR_V2_ALL_DOWNTIME_ROUTING + types::GatewayDeciderApproach::SrSelectionV2Routing => match down_time { + types::DownTime::AllDowntime => types::GatewayDeciderApproach::SrV2AllDowntimeRouting, + types::DownTime::GlobalDowntime => { + types::GatewayDeciderApproach::SrV2GlobalDowntimeRouting } - types::DownTime::GLOBAL_DOWNTIME => { - types::GatewayDeciderApproach::SR_V2_GLOBAL_DOWNTIME_ROUTING - } - types::DownTime::DOWNTIME => types::GatewayDeciderApproach::SR_V2_DOWNTIME_ROUTING, - types::DownTime::NO_DOWNTIME => types::GatewayDeciderApproach::SR_SELECTION_V2_ROUTING, + types::DownTime::Downtime => types::GatewayDeciderApproach::SrV2DowntimeRouting, + types::DownTime::NoDowntime => types::GatewayDeciderApproach::SrSelectionV2Routing, }, - types::GatewayDeciderApproach::SR_V2_HEDGING => match down_time { - types::DownTime::ALL_DOWNTIME => { - types::GatewayDeciderApproach::SR_V2_ALL_DOWNTIME_HEDGING - } - types::DownTime::GLOBAL_DOWNTIME => { - types::GatewayDeciderApproach::SR_V2_GLOBAL_DOWNTIME_HEDGING + types::GatewayDeciderApproach::SrV2Hedging => match down_time { + types::DownTime::AllDowntime => types::GatewayDeciderApproach::SrV2AllDowntimeHedging, + types::DownTime::GlobalDowntime => { + types::GatewayDeciderApproach::SrV2GlobalDowntimeHedging } - types::DownTime::DOWNTIME => types::GatewayDeciderApproach::SR_V2_DOWNTIME_HEDGING, - types::DownTime::NO_DOWNTIME => types::GatewayDeciderApproach::SR_V2_HEDGING, + types::DownTime::Downtime => types::GatewayDeciderApproach::SrV2DowntimeHedging, + types::DownTime::NoDowntime => types::GatewayDeciderApproach::SrV2Hedging, }, _ => match down_time { - types::DownTime::ALL_DOWNTIME => types::GatewayDeciderApproach::PL_ALL_DOWNTIME_ROUTING, - types::DownTime::GLOBAL_DOWNTIME => { - types::GatewayDeciderApproach::PL_GLOBAL_DOWNTIME_ROUTING + types::DownTime::AllDowntime => types::GatewayDeciderApproach::PlAllDowntimeRouting, + types::DownTime::GlobalDowntime => { + types::GatewayDeciderApproach::PlGlobalDowntimeRouting } - types::DownTime::DOWNTIME => types::GatewayDeciderApproach::PL_DOWNTIME_ROUTING, - types::DownTime::NO_DOWNTIME => types::GatewayDeciderApproach::PRIORITY_LOGIC, + types::DownTime::Downtime => types::GatewayDeciderApproach::PlDowntimeRouting, + types::DownTime::NoDowntime => types::GatewayDeciderApproach::PriorityLogic, }, } } @@ -1389,13 +1381,13 @@ pub fn decider_filter_order(filter_name: &str) -> i32 { // pub async fn get_block_time_period(merchant_id: &str) -> i64 { // match RService::findByNameFromRedis::( -// C::OPTIMIZATION_ROUTING_CONFIG(merchant_id.to_string()).get_key(), +// C::OptimizationRoutingConfig(merchant_id.to_string()).get_key(), // ) // .await // { // Some(config_block) => config_block.block_timeperiod.round() as i64, // None => match RService::findByNameFromRedis::( -// C::DEFAULT_OPTIMIZATION_ROUTING_CONFIG.get_key(), +// C::DefaultOptimizationRoutingConfig.get_key(), // ) // .await // { @@ -1846,7 +1838,8 @@ pub async fn check_if_bin_is_eligible_for_emi( (card_isin, juspay_bank_code, card_type) { let bin_check_mandated_banks: Option> = - RService::findByNameFromRedis(C::getEmiBinValidationSupportedBanksKey.get_key()).await; + RService::findByNameFromRedis(C::GET_EMI_BIN_VALIDATION_SUPPORTED_BANKS_KEY.get_key()) + .await; let should_do_bin_validation = bin_check_mandated_banks .is_some_and(|banks| banks.contains(&format!("{}::{}", juspay_bank_code, card_type))); if should_do_bin_validation { @@ -1859,7 +1852,7 @@ pub async fn check_if_bin_is_eligible_for_emi( bin_list, identifier_name_to_text(IdentifierName::BIN), juspay_bank_code, - payment_flows_to_text(&PaymentFlow::PG_EMI), + payment_flows_to_text(&PaymentFlow::PgEmi), ) .await; !emi_eligible_bins.is_empty() @@ -1930,7 +1923,7 @@ pub async fn get_gateway_scoring_data( merchant: ETM::merchant_account::MerchantAccount, ) -> GatewayScoringData { let merchant_enabled_for_unification = isFeatureEnabled( - C::MERCHANTS_ENABLED_FOR_SCORE_KEYS_UNIFICATION.get_key(), + C::MerchantsEnabledForScoreKeysUnification.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), ) @@ -1947,19 +1940,19 @@ pub async fn get_gateway_scoring_data( txn_card_info.paymentMethod.clone() }; let is_performing_experiment = isFeatureEnabled( - C::MERCHANT_ENABLED_FOR_ROUTING_EXPERIMENT.get_key(), + C::MerchantEnabledForRoutingExperiment.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), ) .await; let is_gri_enabled_for_elimination = isFeatureEnabled( - C::GATEWAY_REFERENCE_ID_ENABLED_MERCHANT.get_key(), + C::GatewayReferenceIdEnabledMerchant.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), ) .await; let is_gri_enabled_for_sr_routing = isFeatureEnabled( - C::GW_REF_ID_SELECTION_BASED_ENABLED_MERCHANT.get_key(), + C::GwRefIdSelectionBasedEnabledMerchant.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), ) @@ -1986,7 +1979,7 @@ pub async fn get_gateway_scoring_data( let updated_gateway_scoring_data = match txn_card_info.paymentMethodType.as_str() { UPI => { let handle_and_package_based_routing = isFeatureEnabled( - C::HANDLE_PACKAGE_BASED_ROUTING_CUTOVER.get_key(), + C::HandlePackageBasedRoutingCutover.get_key(), merchant_id.clone(), "kv_redis".to_string(), ) @@ -2006,13 +1999,13 @@ pub async fn get_gateway_scoring_data( } CARD => { let sr_evaluation_at_auth_level = isFeatureEnabled( - C::ENABLE_SELECTION_BASED_AUTH_TYPE_EVALUATION.get_key(), + C::EnableSelectionBasedAuthTypeEvaluation.get_key(), merchant_id.clone(), "kv_redis".to_string(), ) .await; let sr_evaluation_at_bank_level = isFeatureEnabled( - C::ENABLE_SELECTION_BASED_BANK_LEVEL_EVALUATION.get_key(), + C::EnableSelectionBasedBankLevelEvaluation.get_key(), merchant_id.clone(), "kv_redis".to_string(), ) @@ -2069,7 +2062,7 @@ pub async fn get_gateway_scoring_data( get_experiment_tag(txn_detail.dateCreated, "GRI_BASED_SR_ROUTING").await; set_is_experiment_tag(decider_flow, experiment_tag); } - let key = [C::gatewayScoringData, &txn_detail.txnUuid.clone()].concat(); + let key = [C::GATEWAY_SCORING_DATA, &txn_detail.txnUuid.clone()].concat(); updated_gateway_scoring_data } @@ -2085,8 +2078,8 @@ pub async fn get_unified_key( let payment_method = gateway_scoring_data.paymentMethod.clone(); let gateway_redis_key_map = match score_key_type { - ScoreKeyType::ELIMINATION_GLOBAL_KEY => { - let key_prefix = C::elimination_based_routing_global_key_prefix; + ScoreKeyType::EliminationGlobalKey => { + let key_prefix = C::ELIMINATION_BASED_ROUTING_GLOBAL_KEY_PREFIX; let (prefix_key, suffix_key) = if payment_method_type == CARD { ( vec![key_prefix, &order_type.as_str()], @@ -2132,9 +2125,9 @@ pub async fn get_unified_key( }); result_keys } - ScoreKeyType::ELIMINATION_MERCHANT_KEY => { + ScoreKeyType::EliminationMerchantKey => { let isgri_enabled = gateway_scoring_data.isGriEnabledForElimination; - let key_prefix = C::elimination_based_routing_key_prefix; + let key_prefix = C::ELIMINATION_BASED_ROUTING_KEY_PREFIX; let (prefix_key, suffix_key) = if payment_method_type == CARD { ( vec![key_prefix, &merchant_id, &order_type.as_str()], @@ -2196,7 +2189,7 @@ pub async fn get_unified_key( ); result_keys } - ScoreKeyType::SR_V2_KEY => { + ScoreKeyType::SrV2Key => { let key = get_unified_sr_key(&gateway_scoring_data, false, enforce1d).await; let gri_sr_v2_cutover = gateway_scoring_data.isGriEnabledForSrRouting; @@ -2220,7 +2213,7 @@ pub async fn get_unified_key( map } } - ScoreKeyType::SR_V3_KEY => { + ScoreKeyType::SrV3Key => { let base_key = get_unified_sr_key(&gateway_scoring_data, true, enforce1d).await; let gri_sr_v2_cutover = gateway_scoring_data.isGriEnabledForSrRouting; @@ -2256,8 +2249,8 @@ pub async fn get_unified_key( ) } } - ScoreKeyType::OUTAGE_GLOBAL_KEY => { - let key_prefix = C::globalLevelOutageKeyPrefix; + ScoreKeyType::OutageGlobalKey => { + let key_prefix = C::GLOBAL_LEVEL_OUTAGE_KEY_PREFIX; let base_key = if payment_method_type == CARD { vec![ key_prefix, @@ -2290,8 +2283,8 @@ pub async fn get_unified_key( ); map } - ScoreKeyType::OUTAGE_MERCHANT_KEY => { - let key_prefix = C::merchantLevelOutageKeyPrefix; + ScoreKeyType::OutageMerchantKey => { + let key_prefix = C::MERCHANT_LEVEL_OUTAGE_KEY_PREFIX; let base_key = if payment_method_type == CARD { vec![ key_prefix, @@ -2366,9 +2359,9 @@ pub async fn get_unified_sr_key( let country = gateway_scoring_data.country.as_ref().map(|c| c.to_string()); let auth_type = gateway_scoring_data.authType.clone(); let key_prefix = if is_sr_v3_metric_enabled { - C::gateway_selection_v3_order_type_key_prefix.to_string() + C::GATEWAY_SELECTION_V3_ORDER_TYPE_KEY_PREFIX.to_string() } else { - C::gateway_selection_order_type_key_prefix.to_string() + C::GATEWAY_SELECTION_ORDER_TYPE_KEY_PREFIX.to_string() }; // Base key components that are always present @@ -2452,9 +2445,9 @@ async fn get_legacy_unified_sr_key( let payment_method_type = gateway_scoring_data.paymentMethodType.clone(); let payment_method = gateway_scoring_data.paymentMethod.clone(); let key_prefix = if is_sr_v3_metric_enabled { - C::gateway_selection_v3_order_type_key_prefix.to_string() + C::GATEWAY_SELECTION_V3_ORDER_TYPE_KEY_PREFIX.to_string() } else { - C::gateway_selection_order_type_key_prefix.to_string() + C::GATEWAY_SELECTION_ORDER_TYPE_KEY_PREFIX.to_string() }; let base_key = vec![ key_prefix.clone(), @@ -2862,7 +2855,7 @@ pub async fn get_penality_factor_(decider_flow: &mut DeciderFlow<'_>) -> f64 { let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); let merchant_id = get_m_id(merchant.merchantId); let is_elimination_v2_enabled = isFeatureEnabled( - C::ENABLE_ELIMINATION_V2.get_key(), + C::EnableEliminationV2.get_key(), merchant_id.clone(), feedback::constants::kvRedis(), ) @@ -2873,11 +2866,11 @@ pub async fn get_penality_factor_(decider_flow: &mut DeciderFlow<'_>) -> f64 { match m_reward_factor { Some(reward_factor) => return (1.0 - reward_factor), None => { - return getPenaltyFactor(ScoreKeyType::ELIMINATION_MERCHANT_KEY).await; + return getPenaltyFactor(ScoreKeyType::EliminationMerchantKey).await; } } } else { - return getPenaltyFactor(ScoreKeyType::ELIMINATION_MERCHANT_KEY).await; + return getPenaltyFactor(ScoreKeyType::EliminationMerchantKey).await; } } diff --git a/src/decider/network_decider/debit_routing.rs b/src/decider/network_decider/debit_routing.rs index 9f1a8139..bc217a2e 100644 --- a/src/decider/network_decider/debit_routing.rs +++ b/src/decider/network_decider/debit_routing.rs @@ -32,17 +32,17 @@ pub async fn perform_debit_routing( .await { return Ok(gateway_decider_types::DecidedGateway { - // This field should not be consumed when the request is made to /decide-gateway with the rankingAlgorithm set to NTW_BASED_ROUTING. + // This field should not be consumed when the request is made to /decide-gateway with the rankingAlgorithm set to NtwBasedRouting. decided_gateway: first_connector_from_request.unwrap_or("".to_string()), gateway_priority_map: None, filter_wise_gateways: None, priority_logic_tag: None, routing_approach: - gateway_decider_types::GatewayDeciderApproach::NTW_BASED_ROUTING, + gateway_decider_types::GatewayDeciderApproach::NtwBasedRouting, gateway_before_evaluation: None, priority_logic_output: None, debit_routing_output: Some(debit_routing_output), - reset_approach: gateway_decider_types::ResetApproach::NO_RESET, + reset_approach: gateway_decider_types::ResetApproach::NoReset, routing_dimension: None, routing_dimension_level: None, is_scheduled_outage: false, diff --git a/src/feedback/constants.rs b/src/feedback/constants.rs index a982613e..ac349843 100644 --- a/src/feedback/constants.rs +++ b/src/feedback/constants.rs @@ -24,274 +24,274 @@ pub enum Database { UnknownDB(String), } -// Original Haskell data type: SR_V3_BASED_FLOW_CUTOVER +// Original Haskell data type: SrV3BasedFlowCutover #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct SR_V3_BASED_FLOW_CUTOVER; +pub struct SrV3BasedFlowCutover; -impl SC::ServiceConfigKey for SR_V3_BASED_FLOW_CUTOVER { +impl SC::ServiceConfigKey for SrV3BasedFlowCutover { fn get_key(&self) -> std::string::String { "sr_v3_based_flow_cutover".to_string() } } -// Original Haskell data type: ENABLE_DEBUG_MODE_ON_SR_V3 +// Original Haskell data type: EnableDebugModeOnSrV3 #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct ENABLE_DEBUG_MODE_ON_SR_V3; +pub struct EnableDebugModeOnSrV3; -// Original Haskell data type: SR_V3_INPUT_CONFIG_DEFAULT +// Original Haskell data type: SrV3InputConfigDefault #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct SR_V3_INPUT_CONFIG_DEFAULT; +pub struct SrV3InputConfigDefault; -// Original Haskell data type: GW_REF_ID_ENABLED_MERCHANTS_SRV2_PRODUCER +// Original Haskell data type: GwRefIdEnabledMerchantsSrv2Producer #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GW_REF_ID_ENABLED_MERCHANTS_SRV2_PRODUCER; +pub struct GwRefIdEnabledMerchantsSrv2Producer; -impl SC::ServiceConfigKey for GW_REF_ID_ENABLED_MERCHANTS_SRV2_PRODUCER { +impl SC::ServiceConfigKey for GwRefIdEnabledMerchantsSrv2Producer { fn get_key(&self) -> std::string::String { "gw_ref_id_enabled_merchants_SRv2_producer".to_string() } } -// Original Haskell data type: AUTH_TYPE_SR_ROUTING_PRODUCER_ENABLED_MERCHANT +// Original Haskell data type: AuthTypeSrRoutingProducerEnabledMerchant #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct AUTH_TYPE_SR_ROUTING_PRODUCER_ENABLED_MERCHANT; +pub struct AuthTypeSrRoutingProducerEnabledMerchant; -impl SC::ServiceConfigKey for AUTH_TYPE_SR_ROUTING_PRODUCER_ENABLED_MERCHANT { +impl SC::ServiceConfigKey for AuthTypeSrRoutingProducerEnabledMerchant { fn get_key(&self) -> std::string::String { "auth_type_sr_routing_producer_enabled_merchant".to_string() } } -// Original Haskell data type: BANK_LEVEL_SR_ROUTING_PRODUCER_ENABLED_MERCHANT +// Original Haskell data type: BankLevelSrRoutingProducerEnabledMerchant #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct BANK_LEVEL_SR_ROUTING_PRODUCER_ENABLED_MERCHANT; +pub struct BankLevelSrRoutingProducerEnabledMerchant; -impl SC::ServiceConfigKey for BANK_LEVEL_SR_ROUTING_PRODUCER_ENABLED_MERCHANT { +impl SC::ServiceConfigKey for BankLevelSrRoutingProducerEnabledMerchant { fn get_key(&self) -> std::string::String { "bank_level_sr_routing_producer_enabled_merchant".to_string() } } -// Original Haskell data type: PSP_APP_SR_ROUTING_PRODUCER_ENABLED_MERCHANT +// Original Haskell data type: PspAppSrRoutingProducerEnabledMerchant #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct PSP_APP_SR_ROUTING_PRODUCER_ENABLED_MERCHANT; +pub struct PspAppSrRoutingProducerEnabledMerchant; -impl SC::ServiceConfigKey for PSP_APP_SR_ROUTING_PRODUCER_ENABLED_MERCHANT { +impl SC::ServiceConfigKey for PspAppSrRoutingProducerEnabledMerchant { fn get_key(&self) -> std::string::String { "psp_app_sr_routing_producer_enabled_merchant".to_string() } } -// Original Haskell data type: PSP_PACKAGE_SR_ROUTING_PRODUCER_ENABLED_MERCHANT +// Original Haskell data type: PspPackageSrRoutingProducerEnabledMerchant #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct PSP_PACKAGE_SR_ROUTING_PRODUCER_ENABLED_MERCHANT; +pub struct PspPackageSrRoutingProducerEnabledMerchant; -impl SC::ServiceConfigKey for PSP_PACKAGE_SR_ROUTING_PRODUCER_ENABLED_MERCHANT { +impl SC::ServiceConfigKey for PspPackageSrRoutingProducerEnabledMerchant { fn get_key(&self) -> std::string::String { "psp_package_sr_routing_producer_enabled_merchant".to_string() } } -// Original Haskell data type: SR_V3_INPUT_CONFIG +// Original Haskell data type: SrV3InputConfig #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct SR_V3_INPUT_CONFIG(pub String); +pub struct SrV3InputConfig(pub String); -impl SC::ServiceConfigKey for SR_V3_INPUT_CONFIG { +impl SC::ServiceConfigKey for SrV3InputConfig { fn get_key(&self) -> String { format!("SR_V3_INPUT_CONFIG_{}", self.0) } } -// Original Haskell data type: GLOBAL_GATEWAY_SCORING_ENABLED_MERCHANTS +// Original Haskell data type: GlobalGatewayScoringEnabledMerchants #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GLOBAL_GATEWAY_SCORING_ENABLED_MERCHANTS; +pub struct GlobalGatewayScoringEnabledMerchants; -impl SC::ServiceConfigKey for GLOBAL_GATEWAY_SCORING_ENABLED_MERCHANTS { +impl SC::ServiceConfigKey for GlobalGatewayScoringEnabledMerchants { fn get_key(&self) -> std::string::String { "global_gateway_scoring_enabled_merchants".to_string() } } -// Original Haskell data type: GLOBAL_OUTAGE_GATEWAY_SCORING_ENABLED_MERCHANTS +// Original Haskell data type: GlobalOutageGatewayScoringEnabledMerchants #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GLOBAL_OUTAGE_GATEWAY_SCORING_ENABLED_MERCHANTS; +pub struct GlobalOutageGatewayScoringEnabledMerchants; -impl SC::ServiceConfigKey for GLOBAL_OUTAGE_GATEWAY_SCORING_ENABLED_MERCHANTS { +impl SC::ServiceConfigKey for GlobalOutageGatewayScoringEnabledMerchants { fn get_key(&self) -> std::string::String { "global_outage_gateway_scoring_enabled_merchants".to_string() } } #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct UPDATE_SCORE_LOCK_FEATURE_ENABLED_MERCHANT; +pub struct UpdateScoreLockFeatureEnabledMerchant; -impl SC::ServiceConfigKey for UPDATE_SCORE_LOCK_FEATURE_ENABLED_MERCHANT { +impl SC::ServiceConfigKey for UpdateScoreLockFeatureEnabledMerchant { fn get_key(&self) -> std::string::String { "update_score_lock_feature_enabled_merchant".to_string() } } #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct UPDATE_GATEWAY_SCORE_LOCK_FLAG_TTL; +pub struct UpdateGatewayScoreLockFlagTtl; -impl SC::ServiceConfigKey for UPDATE_GATEWAY_SCORE_LOCK_FLAG_TTL { +impl SC::ServiceConfigKey for UpdateGatewayScoreLockFlagTtl { fn get_key(&self) -> std::string::String { "update_gateway_score_lock_flag_ttl".to_string() } } -// Original Haskell data type: MINIMUM_GATEWAY_SCORE +// Original Haskell data type: MinimumGatewayScore #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct MINIMUM_GATEWAY_SCORE; +pub struct MinimumGatewayScore; -impl SC::ServiceConfigKey for MINIMUM_GATEWAY_SCORE { +impl SC::ServiceConfigKey for MinimumGatewayScore { fn get_key(&self) -> std::string::String { "minimum_gateway_score".to_string() } } -// Original Haskell data type: GATEWAY_SCORE_LATENCY_CHECK_IN_MINS +// Original Haskell data type: GatewayScoreLatencyCheckInMins #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_SCORE_LATENCY_CHECK_IN_MINS; +pub struct GatewayScoreLatencyCheckInMins; -impl SC::ServiceConfigKey for GATEWAY_SCORE_LATENCY_CHECK_IN_MINS { +impl SC::ServiceConfigKey for GatewayScoreLatencyCheckInMins { fn get_key(&self) -> std::string::String { "gateway_score_latency_check_in_mins".to_string() } } -// Original Haskell data type: GATEWAY_SCORE_LATENCY_CHECK_EXEMPT_GATEWAYS +// Original Haskell data type: GatewayScoreLatencyCheckExemptGateways #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_SCORE_LATENCY_CHECK_EXEMPT_GATEWAYS; +pub struct GatewayScoreLatencyCheckExemptGateways; -impl SC::ServiceConfigKey for GATEWAY_SCORE_LATENCY_CHECK_EXEMPT_GATEWAYS { +impl SC::ServiceConfigKey for GatewayScoreLatencyCheckExemptGateways { fn get_key(&self) -> std::string::String { "gateway_score_latency_check_exempt_gateways".to_string() } } -// Original Haskell data type: DEFAULT_GW_SCORE_LATENCY_THRESHOLD +// Original Haskell data type: DefaultGwScoreLatencyThreshold #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct DEFAULT_GW_SCORE_LATENCY_THRESHOLD { +pub struct DefaultGwScoreLatencyThreshold { #[serde(rename = "default_gw_score_latency_threshold")] pub default_gw_score_latency_threshold: Option, } -// Original Haskell data type: GATEWAY_PENALTY_FACTOR +// Original Haskell data type: GatewayPenaltyFactor #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_PENALTY_FACTOR; +pub struct GatewayPenaltyFactor; -impl SC::ServiceConfigKey for GATEWAY_PENALTY_FACTOR { +impl SC::ServiceConfigKey for GatewayPenaltyFactor { fn get_key(&self) -> std::string::String { "gateway_penalty_factor".to_string() } } -// Original Haskell data type: GATEWAY_REWARD_FACTOR +// Original Haskell data type: GatewayRewardFactor #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_REWARD_FACTOR; +pub struct GatewayRewardFactor; -impl SC::ServiceConfigKey for GATEWAY_REWARD_FACTOR { +impl SC::ServiceConfigKey for GatewayRewardFactor { fn get_key(&self) -> std::string::String { "gateway_reward_factor".to_string() } } -// Original Haskell data type: OUTAGE_PENALTY_FACTOR +// Original Haskell data type: OutagePenaltyFactor #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct OUTAGE_PENALTY_FACTOR; +pub struct OutagePenaltyFactor; -impl SC::ServiceConfigKey for OUTAGE_PENALTY_FACTOR { +impl SC::ServiceConfigKey for OutagePenaltyFactor { fn get_key(&self) -> std::string::String { "outage_penalty_factor".to_string() } } -// Original Haskell data type: OUTAGE_REWARD_FACTOR +// Original Haskell data type: OutageRewardFactor #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct OUTAGE_REWARD_FACTOR; +pub struct OutageRewardFactor; -impl SC::ServiceConfigKey for OUTAGE_REWARD_FACTOR { +impl SC::ServiceConfigKey for OutageRewardFactor { fn get_key(&self) -> std::string::String { "outage_reward_factor".to_string() } } -// Original Haskell data type: GATEWAY_SCORE_OUTAGE_TTL +// Original Haskell data type: GatewayScoreOutageTtl #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_SCORE_OUTAGE_TTL; +pub struct GatewayScoreOutageTtl; -impl SC::ServiceConfigKey for GATEWAY_SCORE_OUTAGE_TTL { +impl SC::ServiceConfigKey for GatewayScoreOutageTtl { fn get_key(&self) -> std::string::String { "gateway_score_outage_ttl".to_string() } } -// Original Haskell data type: GATEWAY_SCORE_GLOBAL_TTL +// Original Haskell data type: GatewayScoreGlobalTtl #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_SCORE_GLOBAL_TTL; +pub struct GatewayScoreGlobalTtl; -impl SC::ServiceConfigKey for GATEWAY_SCORE_GLOBAL_TTL { +impl SC::ServiceConfigKey for GatewayScoreGlobalTtl { fn get_key(&self) -> std::string::String { "gateway_score_global_ttl".to_string() } } -// Original Haskell data type: GATEWAY_SCORE_GLOBAL_OUTAGE_TTL +// Original Haskell data type: GatewayScoreGlobalOutageTtl #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_SCORE_GLOBAL_OUTAGE_TTL; +pub struct GatewayScoreGlobalOutageTtl; -impl SC::ServiceConfigKey for GATEWAY_SCORE_GLOBAL_OUTAGE_TTL { +impl SC::ServiceConfigKey for GatewayScoreGlobalOutageTtl { fn get_key(&self) -> std::string::String { "gateway_score_global_outage_ttl".to_string() } } -// Original Haskell data type: GATEWAY_SCORE_MERCHANT_ARR_MAX_LENGTH +// Original Haskell data type: GatewayScoreMerchantArrMaxLength #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_SCORE_MERCHANT_ARR_MAX_LENGTH; +pub struct GatewayScoreMerchantArrMaxLength; -impl SC::ServiceConfigKey for GATEWAY_SCORE_MERCHANT_ARR_MAX_LENGTH { +impl SC::ServiceConfigKey for GatewayScoreMerchantArrMaxLength { fn get_key(&self) -> std::string::String { "gateway_score_merchant_arr_max_length".to_string() } } -// Original Haskell data type: GATEWAY_SCORE_THIRD_DIMENSION_TTL +// Original Haskell data type: GatewayScoreThirdDimensionTtl #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct GATEWAY_SCORE_THIRD_DIMENSION_TTL; +pub struct GatewayScoreThirdDimensionTtl; -impl SC::ServiceConfigKey for GATEWAY_SCORE_THIRD_DIMENSION_TTL { +impl SC::ServiceConfigKey for GatewayScoreThirdDimensionTtl { fn get_key(&self) -> std::string::String { "gateway_score_third_dimension_ttl".to_string() } } -// Original Haskell data type: ENFORCE_GW_SCORE_KV_REDIS +// Original Haskell data type: EnforceGwScoreKvRedis #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct ENFORCE_GW_SCORE_KV_REDIS; +pub struct EnforceGwScoreKvRedis; -impl SC::ServiceConfigKey for ENFORCE_GW_SCORE_KV_REDIS { +impl SC::ServiceConfigKey for EnforceGwScoreKvRedis { fn get_key(&self) -> std::string::String { "enforce_gw_score_kv_redis".to_string() } } -// Original Haskell data type: SR_SCORE_REDIS_FALLBACK_LOOKUP_DISABLE +// Original Haskell data type: SrScoreRedisFallbackLookupDisable #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct SR_SCORE_REDIS_FALLBACK_LOOKUP_DISABLE; +pub struct SrScoreRedisFallbackLookupDisable; -impl SC::ServiceConfigKey for SR_SCORE_REDIS_FALLBACK_LOOKUP_DISABLE { +impl SC::ServiceConfigKey for SrScoreRedisFallbackLookupDisable { fn get_key(&self) -> std::string::String { "sr_score_redis_fallback_lookup_disable".to_string() } } -// Original Haskell data type: SR_V3_PRODUCER_ISOLATION +// Original Haskell data type: SrV3ProducerIsolation #[derive(Debug, Serialize, Deserialize, PartialEq)] -pub struct SR_V3_PRODUCER_ISOLATION; +pub struct SrV3ProducerIsolation; -impl SC::ServiceConfigKey for SR_V3_PRODUCER_ISOLATION { +impl SC::ServiceConfigKey for SrV3ProducerIsolation { fn get_key(&self) -> std::string::String { "sr_v3_producer_isolation".to_string() } @@ -308,14 +308,14 @@ pub fn kvRedis() -> String { "kv_redis".into() } -// Original Haskell function: pendingTxnsKeyPrefix -pub const pendingTxnsKeyPrefix: &str = "PENDING_TXNS_"; +// Original Haskell function: PENDING_TXNS_KEY_PREFIX +pub const PENDING_TXNS_KEY_PREFIX: &str = "PENDING_TXNS_"; -// Original Haskell function: defaultSrV3BasedBucketSize -pub const defaultSrV3BasedBucketSize: i32 = 125; +// Original Haskell function: DEFAULT_SR_V3_BASED_BUCKET_SIZE +pub const DEFAULT_SR_V3_BASED_BUCKET_SIZE: i32 = 125; -// Original Haskell function: gatewaySelectionV3OrderTypeKeyPrefix -pub const gatewaySelectionV3OrderTypeKeyPrefix: &str = "{gw_sr_v3_score"; +// Original Haskell function: GATEWAY_SELECTION_V3_ORDER_TYPE_KEY_PREFIX +pub const GATEWAY_SELECTION_V3_ORDER_TYPE_KEY_PREFIX: &str = "{gw_sr_v3_score"; // Original Haskell function: ecRedis pub fn ecRedis() -> String { @@ -362,8 +362,8 @@ pub fn defaultMinimumGatewayScore() -> f64 { 0.0 } -// Original Haskell function: gatewayScoringData -pub const gatewayScoringData: &str = "gateway_scoring_data_"; +// Original Haskell function: GATEWAY_SCORING_DATA +pub const GATEWAY_SCORING_DATA: &str = "gateway_scoring_data_"; // Original Haskell function: defaultMerchantArrMaxLength pub fn defaultMerchantArrMaxLength() -> i32 { diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index 2e23553b..98245c87 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -8,7 +8,7 @@ use crate::{ feedback::constants::{ defaultGWScoringPenaltyFactor, defaultGWScoringRewardFactor, defaultMerchantArrMaxLength, defaultMinimumGatewayScore, defaultScoreGlobalKeysTTL, defaultScoreKeysTTL, ecRedis, - ecRedis2, kvRedis, kvRedis2, ENFORCE_GW_SCORE_KV_REDIS, GATEWAY_SCORE_THIRD_DIMENSION_TTL, + ecRedis2, kvRedis, kvRedis2, EnforceGwScoreKvRedis, GatewayScoreThirdDimensionTtl, }, redis::types::ServiceConfigKey, types::{ @@ -24,7 +24,7 @@ use crate::storage::schema_pg::gateway_bank_emi_support::gateway; use crate::feedback::constants as C; -use crate::decider::gatewaydecider::constants::{ENABLE_ELIMINATION_V2, ENABLE_OUTAGE_V2}; +use crate::decider::gatewaydecider::constants::{EnableEliminationV2, EnableOutageV2}; use crate::types::gateway_routing_input as ETGRI; // use crate::feedback::types as F_TYPES; @@ -104,8 +104,8 @@ pub async fn updateKeyScoreForKeysFromConsumer( // let gateway = txn_detail.gateway.unwrap_or_else(|| "".to_string()); let hard_key_ttl = getTTLForKey(score_key_type).await; let timestamp = CUTILS::get_current_date_in_millis(); - // let should_enforce_kv_redis = isFeatureEnabled(C::ENFORCE_GW_SCORE_KV_REDIS.get_key(), merchant_id, C::kvRedis()).await; - // let should_disable_fallback = isFeatureEnabled(C::SR_SCORE_REDIS_FALLBACK_LOOKUP_DISABLE.get_key(), merchant_id, C::kvRedis()).await; + // let should_enforce_kv_redis = isFeatureEnabled(C::GatewayScoreThirdDimensionTtl.get_key(), merchant_id, C::kvRedis()).await; + // let should_disable_fallback = isFeatureEnabled(C::SrScoreRedisFallbackLookupDisable.get_key(), merchant_id, C::kvRedis()).await; // let m_cached_gateway_score: Option = readFromCacheWithFallback(should_enforce_kv_redis, should_disable_fallback, key); let m_cached_gateway_score = readGatewayScoreFromRedis(&key).await; let gw_score_to_be_updated: CachedGatewayScore = match m_cached_gateway_score { @@ -227,7 +227,7 @@ fn getTransactionCount( match previous_transaction_count { None => Some(1), Some(transaction_count) => { - if gateway_scoring_type == GatewayScoreType::PENALISE { + if gateway_scoring_type == GatewayScoreType::Penalise { Some(transaction_count + 1) } else { Some(transaction_count) @@ -247,17 +247,13 @@ pub async fn updateKeyScoreForTxnStatus( score_key_type: ScoreKeyType, ) -> f64 { let is_elimination_v2_enabled = isFeatureEnabled( - ENABLE_ELIMINATION_V2.get_key(), - merchant_id.clone(), - C::kvRedis(), - ) - .await; - let is_elimination_v2_enabled_for_outage = isFeatureEnabled( - ENABLE_OUTAGE_V2.get_key(), + EnableEliminationV2.get_key(), merchant_id.clone(), C::kvRedis(), ) .await; + let is_elimination_v2_enabled_for_outage = + isFeatureEnabled(EnableOutageV2.get_key(), merchant_id.clone(), C::kvRedis()).await; let is_outage_key = isKeyOutage(score_key_type); logger::debug!( action = "updateKeyScore", @@ -267,7 +263,7 @@ pub async fn updateKeyScoreForTxnStatus( ); match gateway_scoring_type { - GatewayScoreType::PENALISE => { + GatewayScoreType::Penalise => { return updateScoreWithPenalty( is_elimination_v2_enabled, is_outage_key, @@ -280,7 +276,7 @@ pub async fn updateKeyScoreForTxnStatus( ) .await; } - GatewayScoreType::REWARD => { + GatewayScoreType::Reward => { return updateScoreWithReward( is_elimination_v2_enabled, is_outage_key, @@ -393,7 +389,7 @@ pub async fn getFailureKeyScore( current_score: f64, penalty_factor: f64, ) -> f64 { - let m_score: Option = findByNameFromRedis(C::MINIMUM_GATEWAY_SCORE.get_key()) + let m_score: Option = findByNameFromRedis(C::MinimumGatewayScore.get_key()) .await .unwrap_or_default(); let minimum_failure_score = m_score.unwrap_or(C::defaultMinimumGatewayScore()); @@ -412,11 +408,11 @@ pub async fn getFailureKeyScore( // Original Haskell function: getPenaltyFactor pub async fn getPenaltyFactor(scoreKeyType: ScoreKeyType) -> f64 { let penalty_factor = if isKeyOutage(scoreKeyType) { - findByNameFromRedis(C::OUTAGE_PENALTY_FACTOR.get_key()) + findByNameFromRedis(C::OutagePenaltyFactor.get_key()) .await .unwrap_or_else(|| defaultGWScoringPenaltyFactor()) } else { - findByNameFromRedis(C::GATEWAY_PENALTY_FACTOR.get_key()) + findByNameFromRedis(C::GatewayPenaltyFactor.get_key()) .await .unwrap_or_else(|| defaultGWScoringPenaltyFactor()) }; @@ -426,11 +422,11 @@ pub async fn getPenaltyFactor(scoreKeyType: ScoreKeyType) -> f64 { // Original Haskell function: getRewardFactor pub async fn getRewardFactor(scoreKeyType: ScoreKeyType) -> f64 { let reward_factor = if isKeyOutage(scoreKeyType) { - findByNameFromRedis(C::OUTAGE_REWARD_FACTOR.get_key()) + findByNameFromRedis(C::OutageRewardFactor.get_key()) .await .unwrap_or_else(|| defaultGWScoringRewardFactor()) } else { - findByNameFromRedis(C::OUTAGE_REWARD_FACTOR.get_key()) + findByNameFromRedis(C::OutageRewardFactor.get_key()) .await .unwrap_or_else(|| defaultGWScoringRewardFactor()) }; @@ -505,7 +501,7 @@ pub async fn replaceTransactionCount( score_key_type, ) .await; - let new_count = if gateway_scoring_type == GatewayScoreType::PENALISE { + let new_count = if gateway_scoring_type == GatewayScoreType::Penalise { merchant_scoring_details.transactionCount + 1 } else { merchant_scoring_details.transactionCount @@ -579,7 +575,7 @@ pub async fn getAllUnifiedKeys( ) -> Vec<(ScoreKeyType, Option)> { let merchant_id = Merchant::merchant_id_to_text(txn_detail.merchantId.clone()); let is_key_enabled_for_global_gateway_scoring = isFeatureEnabled( - C::GLOBAL_GATEWAY_SCORING_ENABLED_MERCHANTS.get_key(), + C::GlobalGatewayScoringEnabledMerchants.get_key(), merchant_id.clone(), C::kvRedis(), ) @@ -588,8 +584,8 @@ pub async fn getAllUnifiedKeys( || MCU::isPaymentFlowEnabledWithHierarchyCheck( mer_acc_p_id, mer_acc.tenantAccountId.clone(), - ModuleEnum::MERCHANT_CONFIG, - PaymentFlow::PaymentFlow::ELIMINATION_BASED_ROUTING, + ModuleEnum::MerchantConfig, + PaymentFlow::PaymentFlow::EliminationBasedRouting, crate::types::country::country_iso::text_db_to_country_iso( mer_acc.country.as_deref().unwrap_or_default(), ) @@ -597,7 +593,7 @@ pub async fn getAllUnifiedKeys( ) .await; let is_gateway_scoring_enabled_for_global_outage = isFeatureEnabled( - C::GLOBAL_OUTAGE_GATEWAY_SCORING_ENABLED_MERCHANTS.get_key(), + C::GlobalOutageGatewayScoringEnabledMerchants.get_key(), merchant_id.clone(), C::kvRedis(), ) @@ -606,8 +602,8 @@ pub async fn getAllUnifiedKeys( MCU::isPaymentFlowEnabledWithHierarchyCheck( mer_acc_p_id, mer_acc.tenantAccountId, - ModuleEnum::MERCHANT_CONFIG, - PaymentFlow::PaymentFlow::OUTAGE, + ModuleEnum::MerchantConfig, + PaymentFlow::PaymentFlow::Outage, crate::types::country::country_iso::text_db_to_country_iso( mer_acc.country.as_deref().unwrap_or_default(), ) @@ -619,12 +615,12 @@ pub async fn getAllUnifiedKeys( let key = EulerTransforms::getProducerKey( txn_detail.clone(), Some(gateway_scoring_data.clone()), - ScoreKeyType::ELIMINATION_GLOBAL_KEY, + ScoreKeyType::EliminationGlobalKey, false, gateway_reference_id.clone(), ) .await; - vec![(ScoreKeyType::ELIMINATION_GLOBAL_KEY, key)] + vec![(ScoreKeyType::EliminationGlobalKey, key)] } else { logger::debug!( action = "getGlobalKeys", @@ -632,19 +628,19 @@ pub async fn getAllUnifiedKeys( "Global gateway scoring not enabled for merchant {:?}", merchant_id ); - vec![(ScoreKeyType::ELIMINATION_GLOBAL_KEY, None)] + vec![(ScoreKeyType::EliminationGlobalKey, None)] }; let merchant_key = if is_key_enabled_for_merchant_gateway_scoring { let key = EulerTransforms::getProducerKey( txn_detail.clone(), Some(gateway_scoring_data.clone()), - ScoreKeyType::ELIMINATION_MERCHANT_KEY, + ScoreKeyType::EliminationMerchantKey, false, gateway_reference_id.clone(), ) .await; - vec![(ScoreKeyType::ELIMINATION_MERCHANT_KEY, key)] + vec![(ScoreKeyType::EliminationMerchantKey, key)] } else { logger::debug!( action = "getMerchantBasedKeys", @@ -652,19 +648,19 @@ pub async fn getAllUnifiedKeys( "Merchant gateway scoring not enabled for merchant {:?}", merchant_id ); - vec![(ScoreKeyType::ELIMINATION_MERCHANT_KEY, None)] + vec![(ScoreKeyType::EliminationMerchantKey, None)] }; let global_outage_keys = if is_gateway_scoring_enabled_for_global_outage { let key = EulerTransforms::getProducerKey( txn_detail.clone(), Some(gateway_scoring_data.clone()), - ScoreKeyType::OUTAGE_GLOBAL_KEY, + ScoreKeyType::OutageGlobalKey, false, gateway_reference_id.clone(), ) .await; - vec![(ScoreKeyType::OUTAGE_GLOBAL_KEY, key)] + vec![(ScoreKeyType::OutageGlobalKey, key)] } else { logger::debug!( action = "getGlobalKeys", @@ -672,19 +668,19 @@ pub async fn getAllUnifiedKeys( "Global gateway scoring not enabled for merchant {:?}", merchant_id ); - vec![(ScoreKeyType::OUTAGE_GLOBAL_KEY, None)] + vec![(ScoreKeyType::OutageGlobalKey, None)] }; let merchant_outage_keys = if is_gateway_scoring_enabled_for_merchant_outage { let key = EulerTransforms::getProducerKey( txn_detail.clone(), Some(gateway_scoring_data), - ScoreKeyType::OUTAGE_MERCHANT_KEY, + ScoreKeyType::OutageMerchantKey, false, gateway_reference_id.clone(), ) .await; - vec![(ScoreKeyType::OUTAGE_MERCHANT_KEY, key)] + vec![(ScoreKeyType::OutageMerchantKey, key)] } else { logger::debug!( action = "getMerchantScopedOutageKeys", @@ -692,7 +688,7 @@ pub async fn getAllUnifiedKeys( "Outage scoring not enabled for merchant {:?}", merchant_id ); - vec![(ScoreKeyType::OUTAGE_MERCHANT_KEY, None)] + vec![(ScoreKeyType::OutageMerchantKey, None)] }; global_key @@ -708,10 +704,10 @@ pub async fn getTTLForKey(score_key_type: ScoreKeyType) -> u128 { let is_key_global = isGlobalKey(score_key_type); let is_outage_key = isKeyOutage(score_key_type); let key: Option = match (is_key_global, is_outage_key) { - (true, true) => findByNameFromRedis(C::GATEWAY_SCORE_GLOBAL_OUTAGE_TTL.get_key()).await, - (false, true) => findByNameFromRedis(C::GATEWAY_SCORE_OUTAGE_TTL.get_key()).await, - (true, false) => findByNameFromRedis(C::GATEWAY_SCORE_GLOBAL_TTL.get_key()).await, - _ => findByNameFromRedis(C::GATEWAY_SCORE_THIRD_DIMENSION_TTL.get_key()).await, + (true, true) => findByNameFromRedis(C::GatewayScoreGlobalOutageTtl.get_key()).await, + (false, true) => findByNameFromRedis(C::GatewayScoreOutageTtl.get_key()).await, + (true, false) => findByNameFromRedis(C::GatewayScoreGlobalTtl.get_key()).await, + _ => findByNameFromRedis(C::GatewayScoreThirdDimensionTtl.get_key()).await, }; key.map_or_else(|| getDefaultTTL(score_key_type), |k| k.floor() as u128) } @@ -857,7 +853,7 @@ pub fn findMerchantFromMerchantArray( // Original Haskell function: getMerchantArrMaxLength pub async fn getMerchantArrMaxLength() -> i32 { - let max_length = findByNameFromRedis(C::GATEWAY_SCORE_MERCHANT_ARR_MAX_LENGTH.get_key()) + let max_length = findByNameFromRedis(C::GatewayScoreMerchantArrMaxLength.get_key()) .await .unwrap_or_else(|| C::defaultMerchantArrMaxLength()); max_length @@ -865,14 +861,13 @@ pub async fn getMerchantArrMaxLength() -> i32 { // Original Haskell function: isGlobalKey pub fn isGlobalKey(scoreKeyType: ScoreKeyType) -> bool { - scoreKeyType == ScoreKeyType::ELIMINATION_GLOBAL_KEY - || scoreKeyType == ScoreKeyType::OUTAGE_GLOBAL_KEY + scoreKeyType == ScoreKeyType::EliminationGlobalKey + || scoreKeyType == ScoreKeyType::OutageGlobalKey } // Original Haskell function: isKeyOutage pub fn isKeyOutage(scoreKeyType: ScoreKeyType) -> bool { - scoreKeyType == ScoreKeyType::OUTAGE_GLOBAL_KEY - || scoreKeyType == ScoreKeyType::OUTAGE_MERCHANT_KEY + scoreKeyType == ScoreKeyType::OutageGlobalKey || scoreKeyType == ScoreKeyType::OutageMerchantKey } // Original Haskell function: filterAndTransformOutageKeys diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index 5018c624..1bb91eb7 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -5,7 +5,7 @@ use crate::redis::cache::findByNameFromRedis; use crate::redis::feature::isFeatureEnabled; use masking::PeekInterface; // Converted imports -// use gateway_decider::constants as c::{enable_elimination_v2, gateway_scoring_data, ENABLE_EXPLORE_AND_EXPLOIT_ON_SRV3, SR_V3_INPUT_CONFIG, GATEWAY_SCORE_FIRST_DIMENSION_SOFT_TTL}; +// use gateway_decider::constants as c::{enable_elimination_v2, gateway_scoring_data, EnableExploreAndExploitOnSrv3, SrV3InputConfig, GatewayScoreFirstDimensionSoftTtl}; // use feedback::constants as c; // use data::text::encoding as de::encode_utf8; // use db::storage::types::merchant_account as merchant_account; @@ -25,7 +25,7 @@ use masking::PeekInterface; // use eulerhs::types as et; // use eulerhs::tenant_redis_layer as rc; use crate::app::{get_tenant_app_state, APP_STATE}; -use crate::decider::gatewaydecider::constants::{self as DC, srV3DefaultInputConfig}; +use crate::decider::gatewaydecider::constants::{self as DC, SR_V3_DEFAULT_INPUT_CONFIG}; use crate::decider::gatewaydecider::types as T; use crate::decider::gatewaydecider::types::GatewayScoringData; use crate::decider::gatewaydecider::types::{RoutingFlowType as RF, SrRoutingDimensions}; @@ -80,8 +80,8 @@ use crate::{ }; use super::constants::{ - defaultSrV3LatencyThresholdInSecs, SR_V3_INPUT_CONFIG, UPDATE_GATEWAY_SCORE_LOCK_FLAG_TTL, - UPDATE_SCORE_LOCK_FEATURE_ENABLED_MERCHANT, + defaultSrV3LatencyThresholdInSecs, SrV3InputConfig, UpdateGatewayScoreLockFlagTtl, + UpdateScoreLockFeatureEnabledMerchant, }; use super::utils::getTimeFromTxnCreatedInMills; use crate::logger; @@ -291,7 +291,7 @@ pub async fn getGatewayScoringType( flag: bool, ) -> GatewayScoringType { if flag { - return GatewayScoringType::PENALISE_SRV3; + return GatewayScoringType::PenaliseSrv3; } let txn_status = txn_detail.status.clone(); @@ -300,7 +300,7 @@ pub async fn getGatewayScoringType( let is_failure = isTransactionFailure(txn_status.clone()); let time_difference = getTimeFromTxnCreatedInMills(txn_detail.clone()); let merchant_sr_v3_input_config = - findByNameFromRedis(SR_V3_INPUT_CONFIG(get_m_id(merchant_id)).get_key()).await; + findByNameFromRedis(SrV3InputConfig(get_m_id(merchant_id)).get_key()).await; let pmt = txn_card_info.paymentMethodType; let pm = get_payment_method( pmt.to_string(), @@ -330,7 +330,7 @@ pub async fn getGatewayScoringType( let time_difference_threshold = match maybe_latency_threshold { None => { let default_sr_v3_input_config = - findByNameFromRedis(srV3DefaultInputConfig.get_key()).await; + findByNameFromRedis(SR_V3_DEFAULT_INPUT_CONFIG.get_key()).await; let maybe_default_latency_threshold = get_sr_v3_latency_threshold( default_sr_v3_input_config, &pmt, @@ -351,13 +351,13 @@ pub async fn getGatewayScoringType( ); if is_success { - GatewayScoringType::REWARD + GatewayScoringType::Reward } else if is_failure { - GatewayScoringType::PENALISE_SRV3 + GatewayScoringType::PenaliseSrv3 } else if time_difference < ((time_difference_threshold * 1000.0) as u128) { - GatewayScoringType::PENALISE + GatewayScoringType::Penalise } else { - GatewayScoringType::PENALISE_SRV3 + GatewayScoringType::PenaliseSrv3 } } @@ -367,13 +367,13 @@ pub fn updateGatewayScoreLock( gateway: String, ) -> String { match (gateway_scoring_type) { - (GatewayScoringType::PENALISE) => { + (GatewayScoringType::Penalise) => { format!("gateway_scores_lock_PENALISE_{}_{}", txn_uuid, gateway) } - (GatewayScoringType::PENALISE_SRV3) => { + (GatewayScoringType::PenaliseSrv3) => { format!("gateway_scores_lock_PENALISE_SRV3_{}_{}", txn_uuid, gateway) } - (GatewayScoringType::REWARD) => { + (GatewayScoringType::Reward) => { format!("gateway_scores_lock_REWARD_{}_{}", txn_uuid, gateway) } _ => String::new(), @@ -401,7 +401,11 @@ pub fn invalid_request_error(detail: &str, e: &impl std::fmt::Display) -> T::Err pub async fn check_and_update_gateway_score_( apiPayload: FT::UpdateScorePayload, ) -> Result { - let redis_key = format!("{}{}", C::gatewayScoringData, apiPayload.clone().paymentId); + let redis_key = format!( + "{}{}", + C::GATEWAY_SCORING_DATA, + apiPayload.clone().paymentId + ); let app_state = get_tenant_app_state().await; // Attempt to fetch gateway scoring data from Redis @@ -489,7 +493,7 @@ pub async fn check_and_update_gateway_score( gateway_in_string, // Convert Option to String ); - let lock_key_ttl = findByNameFromRedis(UPDATE_GATEWAY_SCORE_LOCK_FLAG_TTL.get_key()) + let lock_key_ttl = findByNameFromRedis(UpdateGatewayScoreLockFlagTtl.get_key()) .await .unwrap_or(300); @@ -498,7 +502,7 @@ pub async fn check_and_update_gateway_score( // Check if feature is enabled for merchant let feature_enabled = isFeatureEnabled( - UPDATE_SCORE_LOCK_FEATURE_ENABLED_MERCHANT.get_key(), + UpdateScoreLockFeatureEnabledMerchant.get_key(), get_m_id(txn_detail.merchantId.clone()), "kv_redis".to_string(), ) @@ -568,16 +572,16 @@ pub async fn updateGatewayScore( routing_approach ); - let should_update_gateway_score = if gateway_scoring_type.clone() == GST::PENALISE_SRV3 { + let should_update_gateway_score = if gateway_scoring_type.clone() == GST::PenaliseSrv3 { false - } else if gateway_scoring_type.clone() == GST::PENALISE { + } else if gateway_scoring_type.clone() == GST::Penalise { isTransactionPending(txn_detail.clone().status) } else { true }; //let is_pm_and_pmt_present = Fbu::isTrueString(txn_card_info.paymentMethod) && txn_card_info.paymentMethodType.is_some(); - let should_update_srv3_gateway_score = if gateway_scoring_type.clone() == GST::PENALISE { + let should_update_srv3_gateway_score = if gateway_scoring_type.clone() == GST::Penalise { false } else { true @@ -593,7 +597,7 @@ pub async fn updateGatewayScore( .await; let should_isolate_srv3_producer = if Cutover::isFeatureEnabled( - C::SR_V3_PRODUCER_ISOLATION.get_key(), + C::SrV3ProducerIsolation.get_key(), MID::merchant_id_to_text(txn_detail.clone().merchantId), C::kvRedis(), ) @@ -609,7 +613,7 @@ pub async fn updateGatewayScore( }; let should_update_explore_txn = if Cutover::isFeatureEnabled( - DC::ENABLE_EXPLORE_AND_EXPLOIT_ON_SRV3(txn_card_info.clone().paymentMethodType.to_string()) + DC::EnableExploreAndExploitOnSrv3(txn_card_info.clone().paymentMethodType.to_string()) .get_key(), MID::merchant_id_to_text(txn_detail.clone().merchantId), C::kvRedis(), @@ -625,7 +629,7 @@ pub async fn updateGatewayScore( true }; - let redis_key = format!("{}{}", C::gatewayScoringData, txn_detail.clone().txnUuid); + let redis_key = format!("{}{}", C::GATEWAY_SCORING_DATA, txn_detail.clone().txnUuid); let redis_gateway_score_data = if should_update_srv3_gateway_score && is_update_within_window && should_isolate_srv3_producer @@ -718,7 +722,7 @@ pub async fn updateGatewayScore( } Fbu::logGatewayScoreType( gateway_scoring_type, - RF::ELIMINATION_FLOW, + RF::EliminationFlow, txn_detail.clone(), ); } else { @@ -796,7 +800,7 @@ pub async fn isUpdateWithinLatencyWindow( txn_latency: Option, ) -> bool { match gateway_scoring_type { - GatewayScoringType::PENALISE => true, + GatewayScoringType::Penalise => true, _ => { let exempt_for_mandate_txn = checkExemptIfMandateTxn(&txn_detail, &txn_card_info).await; if exempt_for_mandate_txn @@ -809,7 +813,7 @@ pub async fn isUpdateWithinLatencyWindow( } else { // let m_auto_refund_conflict_threshold_in_mins: Option = None; // Placeholder for actual implementation let gw_latency_check_threshold = - findByNameFromRedis(C::GATEWAY_SCORE_LATENCY_CHECK_IN_MINS.get_key()) + findByNameFromRedis(C::GatewayScoreLatencyCheckInMins.get_key()) .await .unwrap_or(C::defaultGatewayScoreLatencyCheckInMins()); /// check if the transaction latency calculated by orchestration is within the configured threshold diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index 00415fe9..bcd7f86a 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -74,7 +74,7 @@ pub async fn updateSrV3Score( mb_gateway_scoring_data: Option, gateway_reference_id: Option, ) { - // let is_merchant_enabled_globally = MC::isMerchantEnabledForPaymentFlows(merchant_acc.id, [PF::SR_BASED_ROUTING].to_vec()).await; + // let is_merchant_enabled_globally = MC::isMerchantEnabledForPaymentFlows(merchant_acc.id, [PF::SrBasedRouting].to_vec()).await; match (txn_detail.gateway.clone()) { (None) => { logger::info!( @@ -87,7 +87,7 @@ pub async fn updateSrV3Score( let unified_sr_v3_key = getProducerKey( txn_detail.clone(), mb_gateway_scoring_data, - SK::SR_V3_KEY, + SK::SrV3Key, false, gateway_reference_id.clone(), ) @@ -131,7 +131,7 @@ pub async fn updateSrV3Score( .await; } } - logGatewayScoreType(gateway_scoring_type, RF::SRV3_FLOW, txn_detail); + logGatewayScoreType(gateway_scoring_type, RF::Srv3Flow, txn_detail); } } } @@ -196,8 +196,8 @@ pub async fn updateScoreAndQueue( ) .await; let (value, should_score_increase): (String, bool) = match gateway_scoring_type { - GatewayScoringType::PENALISE_SRV3 => ("0".into(), false), - GatewayScoringType::REWARD => ("1".into(), true), + GatewayScoringType::PenaliseSrv3 => ("0".into(), false), + GatewayScoringType::Reward => ("1".into(), true), _ => ("0".into(), false), }; // let is_debug_mode_enabled = isFeatureEnabled( @@ -295,7 +295,7 @@ pub async fn updateScoreAndQueue( //Original Haskell function: getSrV3MerchantBucketSize pub async fn getSrV3MerchantBucketSize(txn_detail: TxnDetail, txn_card_info: TxnCardInfo) -> i32 { let merchant_sr_v3_input_config: Option = findByNameFromRedis( - C::SR_V3_INPUT_CONFIG(MID::merchant_id_to_text(txn_detail.merchantId)).get_key(), + C::SrV3InputConfig(MID::merchant_id_to_text(txn_detail.merchantId)).get_key(), ) .await; let pmt = txn_card_info.paymentMethodType; @@ -326,9 +326,9 @@ pub async fn getSrV3MerchantBucketSize(txn_detail: TxnDetail, txn_card_info: Txn let merchant_bucket_size = match maybe_bucket_size { None => { let default_sr_v3_input_config: Option = - findByNameFromRedis(DC::srV3DefaultInputConfig.get_key()).await; + findByNameFromRedis(DC::SR_V3_DEFAULT_INPUT_CONFIG.get_key()).await; GU::get_sr_v3_bucket_size(default_sr_v3_input_config, &pmt, &pm, &sr_routing_dimesions) - .unwrap_or(C::defaultSrV3BasedBucketSize) + .unwrap_or(C::DEFAULT_SR_V3_BASED_BUCKET_SIZE) } Some(bucket_size) => bucket_size, }; diff --git a/src/feedback/types.rs b/src/feedback/types.rs index 397e42b1..db05ebad 100644 --- a/src/feedback/types.rs +++ b/src/feedback/types.rs @@ -42,10 +42,11 @@ pub struct TxnInfo { // Original Haskell data type: MandateTxnType #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum MandateTxnType { - REGISTER, - REGISTER_AND_DEBIT, - DEFAULT, + Register, + RegisterAndDebit, + Default, } // Original Haskell data type: MerchantScoringDetails @@ -217,20 +218,20 @@ pub struct GatewayScoringKeyType { #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum TxnObjectType { - MANDATE_REGISTER, - MANDATE_PAYMENT, - ORDER_PAYMENT, - EMANDATE_REGISTER, - EMANDATE_PAYMENT, - TPV_PAYMENT, - PARTIAL_CAPTURE, - PARTIAL_VOID, - TPV_EMANDATE_REGISTER, - TPV_MANDATE_REGISTER, - TPV_EMANDATE_PAYMENT, - TPV_MANDATE_PAYMENT, - VAN_PAYMENT, - MOTO_PAYMENT, + MandateRegister, + MandatePayment, + OrderPayment, + EmandateRegister, + EmandatePayment, + TpvPayment, + PartialCapture, + PartialVoid, + TpvEmandateRegister, + TpvMandateRegister, + TpvEmandatePayment, + TpvMandatePayment, + VanPayment, + MotoPayment, } #[derive(Debug, Serialize, Deserialize, Clone)] @@ -443,7 +444,7 @@ pub struct SrV3DebugBlock { // AADHAAR, // PAPERNACH, // PAN, -// MERCHANT_CONTAINER, +// MerchantContainer, // Virtual_Account, // OTC, // RTP, @@ -547,7 +548,7 @@ pub struct Date { // PaymentMethodType::AADHAAR => "AADHAAR".into(), // PaymentMethodType::PAPERNACH => "PAPERNACH".into(), // PaymentMethodType::PAN => "PAN".into(), -// PaymentMethodType::MERCHANT_CONTAINER => "MERCHANT_CONTAINER".into(), +// PaymentMethodType::MerchantContainer => "MERCHANT_CONTAINER".into(), // PaymentMethodType::Virtual_Account => "VIRTUAL_ACCOUNT".into(), // PaymentMethodType::OTC => "OTC".into(), // PaymentMethodType::RTP => "RTP".into(), @@ -571,7 +572,7 @@ pub struct Date { // "AADHAAR" => PaymentMethodType::AADHAAR, // "PAPERNACH" => PaymentMethodType::PAPERNACH, // "PAN" => PaymentMethodType::PAN, -// "MERCHANT_CONTAINER" => PaymentMethodType::MERCHANT_CONTAINER, +// "MERCHANT_CONTAINER" => PaymentMethodType::MerchantContainer, // "VIRTUAL_ACCOUNT" => PaymentMethodType::Virtual_Account, // "OTC" => PaymentMethodType::OTC, // "RTP" => PaymentMethodType::RTP, diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 4e399357..2a759401 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -70,7 +70,7 @@ use crate::types::payment::payment_method as ETP; // use types::money::{from_double, Money}; // use optics::core::{preview, review}; // use control::category::<<<; -use super::constants::gatewayScoringData; +use super::constants::GATEWAY_SCORING_DATA; use crate::types::gateway::{gateway_any_to_text, GatewayAny}; // use prelude::real_to_frac; // use data::time::clock::posix as DTP; @@ -78,10 +78,11 @@ use crate::logger; // Converted data types // Original Haskell data type: GatewayScoringType #[derive(Debug, Serialize, Clone, Deserialize, PartialEq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum GatewayScoringType { - PENALISE, - PENALISE_SRV3, - REWARD, + Penalise, + PenaliseSrv3, + Reward, } // Original Haskell data type: JuspayBankCode @@ -256,17 +257,17 @@ pub fn getTxnCardInfoFromApiPayload( // Original Haskell function: convertTxnObjectTypeFli:: // pub fn convertTxnObjectTypeFlip(txn_object_type: Option) -> ETTD::TxnObjectType { // match txn_object_type { -// Some(TxnObjectType::ORDER_PAYMENT) => ETTD::TxnObjectType::OrderPayment, -// Some(TxnObjectType::MANDATE_REGISTER) => ETTD::TxnObjectType::MandateRegister, -// Some(TxnObjectType::EMANDATE_REGISTER) => ETTD::TxnObjectType::EmandateRegister, -// Some(TxnObjectType::EMANDATE_PAYMENT) => ETTD::TxnObjectType::EmandatePayment, -// Some(TxnObjectType::MANDATE_PAYMENT) => ETTD::TxnObjectType::MandatePayment, -// Some(TxnObjectType::TPV_PAYMENT) => ETTD::TxnObjectType::TpvPayment, -// Some(TxnObjectType::PARTIAL_CAPTURE) => ETTD::TxnObjectType::PartialCapture, -// Some(TxnObjectType::TPV_EMANDATE_REGISTER) => ETTD::TxnObjectType::TpvEmandateRegister, -// Some(TxnObjectType::TPV_MANDATE_REGISTER) => ETTD::TxnObjectType::TpvMandateRegister, -// Some(TxnObjectType::TPV_EMANDATE_PAYMENT) => ETTD::TxnObjectType::TpvEmandatePayment, -// Some(TxnObjectType::TPV_MANDATE_PAYMENT) => ETTD::TxnObjectType::TpvMandatePayment, +// Some(TxnObjectType::OrderPayment) => ETTD::TxnObjectType::OrderPayment, +// Some(TxnObjectType::MandateRegister) => ETTD::TxnObjectType::MandateRegister, +// Some(TxnObjectType::EmandateRegister) => ETTD::TxnObjectType::EmandateRegister, +// Some(TxnObjectType::EmandatePayment) => ETTD::TxnObjectType::EmandatePayment, +// Some(TxnObjectType::MandatePayment) => ETTD::TxnObjectType::MandatePayment, +// Some(TxnObjectType::TpvPayment) => ETTD::TxnObjectType::TpvPayment, +// Some(TxnObjectType::PartialCapture) => ETTD::TxnObjectType::PartialCapture, +// Some(TxnObjectType::TpvEmandateRegister) => ETTD::TxnObjectType::TpvEmandateRegister, +// Some(TxnObjectType::TpvMandateRegister) => ETTD::TxnObjectType::TpvMandateRegister, +// Some(TxnObjectType::TpvEmandatePayment) => ETTD::TxnObjectType::TpvEmandatePayment, +// Some(TxnObjectType::TpvMandatePayment) => ETTD::TxnObjectType::TpvMandatePayment, // _ => ETTD::TxnObjectType::OrderPayment, // } // } @@ -335,17 +336,17 @@ pub fn getTxnCardInfoFromApiPayload( // Original Haskell function: textToAuthType // pub fn textToAuthType(auth_type: Option) -> Option { // match auth_type.as_deref() { -// Some("ATMPIN") => Some(ETCa::AuthType::ATMPIN), -// Some("THREE_DS") => Some(ETCa::AuthType::THREE_DS), -// Some("THREE_DS_2") => Some(ETCa::AuthType::THREE_DS_2), -// Some("OTP") => Some(ETCa::AuthType::OTP), -// Some("OBO_OTP") => Some(ETCa::AuthType::OBO_OTP), -// Some("VIES") => Some(ETCa::AuthType::VIES), -// Some("NO_THREE_DS") => Some(ETCa::AuthType::NO_THREE_DS), -// Some("NETWORK_TOKEN") => Some(ETCa::AuthType::NETWORK_TOKEN), -// Some("MOTO") => Some(ETCa::AuthType::MOTO), -// Some("FIDO") => Some(ETCa::AuthType::FIDO), -// Some("CTP") => Some(ETCa::AuthType::CTP), +// Some("ATMPIN") => Some(ETCa::AuthType::Atmpin), +// Some("THREE_DS") => Some(ETCa::AuthType::ThreeDs), +// Some("THREE_DS_2") => Some(ETCa::AuthType::ThreeDs2), +// Some("OTP") => Some(ETCa::AuthType::Otp), +// Some("OBO_OTP") => Some(ETCa::AuthType::OboOtp), +// Some("VIES") => Some(ETCa::AuthType::Vies), +// Some("NO_THREE_DS") => Some(ETCa::AuthType::NoThreeDs), +// Some("NETWORK_TOKEN") => Some(ETCa::AuthType::NetworkToken), +// Some("MOTO") => Some(ETCa::AuthType::Moto), +// Some("FIDO") => Some(ETCa::AuthType::Fido), +// Some("CTP") => Some(ETCa::AuthType::Ctp), // _ => None, // } // } @@ -367,7 +368,7 @@ pub fn getTxnCardInfoFromApiPayload( // Some(FT::PaymentMethodType::PAPERNACH) => ETP::PaymentMethodType::Papernach, // Some(FT::PaymentMethodType::PAN) => ETP::PaymentMethodType::PAN, // Some(FT::PaymentMethodType::UNKNOWN(ref val)) if val == "ATM_CARD" => ETP::PaymentMethodType::AtmCard, -// Some(FT::PaymentMethodType::MERCHANT_CONTAINER) => ETP::PaymentMethodType::MerchantContainer, +// Some(FT::PaymentMethodType::MerchantContainer) => ETP::PaymentMethodType::MerchantContainer, // Some(FT::PaymentMethodType::Virtual_Account) => ETP::PaymentMethodType::VirtualAccount, // Some(FT::PaymentMethodType::OTC) => ETP::PaymentMethodType::Otc, // Some(FT::PaymentMethodType::RTP) => ETP::PaymentMethodType::Rtp, @@ -622,11 +623,10 @@ pub async fn getProducerKey( ) -> Option { match redis_gateway_score_data { Some(gateway_score_data) => { - let is_gri_enabled = if [ScoreKeyType::ELIMINATION_MERCHANT_KEY] - .contains(&score_key_type) + let is_gri_enabled = if [ScoreKeyType::EliminationMerchantKey].contains(&score_key_type) { gateway_score_data.isGriEnabledForElimination - } else if [ScoreKeyType::SR_V2_KEY, ScoreKeyType::SR_V3_KEY].contains(&score_key_type) { + } else if [ScoreKeyType::SrV2Key, ScoreKeyType::SrV3Key].contains(&score_key_type) { gateway_score_data.isGriEnabledForSrRouting } else { false @@ -677,17 +677,17 @@ pub fn logGatewayScoreType( txn_detail: TxnDetail, ) { let detailed_gateway_score_type = match routing_flow_type { - RoutingFlowType::ELIMINATION_FLOW => match gateway_score_type { - GatewayScoringType::REWARD => DetailedGatewayScoringType::ELIMINATION_REWARD, - _ => DetailedGatewayScoringType::ELIMINATION_PENALISE, + RoutingFlowType::EliminationFlow => match gateway_score_type { + GatewayScoringType::Reward => DetailedGatewayScoringType::EliminationReward, + _ => DetailedGatewayScoringType::EliminationPenalise, }, - RoutingFlowType::SRV2_FLOW => match gateway_score_type { - GatewayScoringType::REWARD => DetailedGatewayScoringType::SRV2_REWARD, - _ => DetailedGatewayScoringType::SRV2_PENALISE, + RoutingFlowType::Srv2Flow => match gateway_score_type { + GatewayScoringType::Reward => DetailedGatewayScoringType::Srv2Reward, + _ => DetailedGatewayScoringType::Srv2Penalise, }, _ => match gateway_score_type { - GatewayScoringType::REWARD => DetailedGatewayScoringType::SRV3_REWARD, - _ => DetailedGatewayScoringType::SRV3_PENALISE, + GatewayScoringType::Reward => DetailedGatewayScoringType::Srv3Reward, + _ => DetailedGatewayScoringType::Srv3Penalise, }, }; @@ -878,12 +878,12 @@ pub fn getTxnTypeFromInternalMetadata(internal_metadata: Option>) tag = "APP_DEBUG", "FETCH_TXN_TYPE_FROM_IM_FLOW" ); - (MandateTxnType::DEFAULT) + (MandateTxnType::Default) } Some(internal_metadata) => { match serde_json::from_str::(internal_metadata.peek()) { Ok(txn_info) => txn_info.mandateTxnInfo.txnType, - Err(_) => MandateTxnType::DEFAULT, + Err(_) => MandateTxnType::Default, } } } @@ -898,7 +898,7 @@ pub fn isMandateRegTxn(txn_object_type: TxnObjectType) -> bool { pub fn isPennyTxnType(txn_detail: TxnDetail) -> bool { let mandate = getTxnTypeFromInternalMetadata(txn_detail.internalMetadata); match mandate { - MandateTxnType::REGISTER => true, + MandateTxnType::Register => true, _ => false, } } diff --git a/src/merchant_config_util.rs b/src/merchant_config_util.rs index 1d193e00..c17e1538 100644 --- a/src/merchant_config_util.rs +++ b/src/merchant_config_util.rs @@ -27,7 +27,7 @@ use josekit::Value; use crate::{ decider::{ configs::env_vars::enable_merchant_config_entity_lookup, - gatewaydecider::constants::MERCHANT_CONFIG_ENTITY_LEVEL_LOOKUP_CUTOVER, + gatewaydecider::constants::MerchantConfigEntityLevelLookupCutover, }, logger, redis::{cache::findByNameFromRedis, types::ServiceConfigKey}, @@ -77,7 +77,7 @@ use crate::{ // // Original Haskell function: getMerchantConfigEntityLevelLookupConfig pub async fn getMerchantConfigEntityLevelLookupConfig() -> Option { if enable_merchant_config_entity_lookup() { - findByNameFromRedis(MERCHANT_CONFIG_ENTITY_LEVEL_LOOKUP_CUTOVER.get_key()).await + findByNameFromRedis(MerchantConfigEntityLevelLookupCutover.get_key()).await } else { None } @@ -148,7 +148,7 @@ pub async fn isMerchantEnabledForPaymentFlows( ) -> bool { let mc_arr = load_merchant_config_by_mpid_category_and_name( merchant_id, - config_category_to_text(ConfigCategory::PAYMENT_FLOW), + config_category_to_text(ConfigCategory::PaymentFlow), payment_flows .iter() .map(|pf: &PaymentFlow| payment_flows_to_text(pf)) @@ -240,7 +240,7 @@ pub async fn isMerchantEnabledForPaymentFlows( // } // let mc_arr = MerchantConfig::loadArrMerchantConfigByMPidCategoryAndName( // mer_acc_id, -// MCTypes::PAYMENT_FLOW, +// MCTypes::PaymentFlow, // &enabled_pfs.iter().map(|pf| MCTypes::ConfigName(pf.clone())).collect::>(), // ); // let result: Vec<(String, RedisMerchantConfigStatus)> = enabled_pfs @@ -283,7 +283,7 @@ pub async fn isPaymentFlowEnabledForMerchant( payment_flow: PaymentFlow, ) -> bool { let config_name = payment_flows_to_text(&payment_flow); - let config_category = config_category_to_text(ConfigCategory::PAYMENT_FLOW); + let config_category = config_category_to_text(ConfigCategory::PaymentFlow); let config_status = config_status_to_text(ConfigStatus::ENABLED); load_merchant_config_by_mpid_category_name_and_status( @@ -342,7 +342,7 @@ pub async fn getMerchantConfigValueForPaymentFlow( ) -> Option { let m_mer_config = load_merchant_config_by_mpid_category_name_and_status( merchant_p_id_val, - config_category_to_text(ConfigCategory::PAYMENT_FLOW), + config_category_to_text(ConfigCategory::PaymentFlow), payment_flows_to_text(&pf), config_status_to_text(ConfigStatus::ENABLED), ) @@ -365,7 +365,7 @@ pub async fn getMerchantConfigValueForPaymentFlow( // ) -> Option { // let m_mer_config = load_merchant_config_by_mpid_category_name_and_status( // merchant_p_id_val, -// ConfigCategory::PAYMENT_FLOW, +// ConfigCategory::PaymentFlow, // payment_flows_to_text(&pf), // ConfigStatus::ENABLED, // ); @@ -409,7 +409,7 @@ pub async fn getMerchantConfigStatusAndvalueForPaymentFlow( ) -> (ConfigStatus, Option) { let m_mer_config: Option = load_merchant_config_by_mpid_category_and_name( merchant_p_id, - config_category_to_text(ConfigCategory::PAYMENT_FLOW), + config_category_to_text(ConfigCategory::PaymentFlow), payment_flows_to_text(&pf), ) .await; @@ -437,7 +437,7 @@ pub async fn getMerchantConfigStatusAndvalueForPaymentFlow( // ) -> (Option) { // let m_mer_config = load_merchant_config_by_mpid_category_and_name( // merchant_p_id, -// config_category_to_text(ConfigCategory::PAYMENT_FLOW), +// config_category_to_text(ConfigCategory::PaymentFlow), // payment_flows_to_text(&pf), // ).await; // match m_mer_config { @@ -519,7 +519,7 @@ pub async fn isPaymentFlowEnabledWithHierarchyCheck( ); } - let category = config_category_to_text(ConfigCategory::PAYMENT_FLOW); + let category = config_category_to_text(ConfigCategory::PaymentFlow); let m_mer_config = load_merchant_config_by_mpid_category_and_name( merchant_p_id, @@ -607,7 +607,7 @@ pub async fn getPaymentFlowInfoFromTenantConfig( // ) -> (Redis::MerchantConfigStatus, MAConfigs) { // let m_mer_config = MerchantConfig::loadMerchantConfigByMPidCategoryAndName( // &merchant_p_id, -// MCTypes::PAYMENT_FLOW, +// MCTypes::PaymentFlow, // MCTypes::ConfigName(pf.to_string()), // ); @@ -678,7 +678,7 @@ pub async fn getPaymentFlowInfoFromTenantConfig( // ma_configs.clone() // } // }, -// PaymentFlow::AUTO_REFUND => match mer_config.config_value.as_ref().and_then(|v| { +// PaymentFlow::AutoRefund => match mer_config.config_value.as_ref().and_then(|v| { // A::eitherDecodeStrict::(&encodeUtf8(v)).ok() // }) { // Some(v) => MAConfigs::ARC(v), @@ -712,7 +712,7 @@ pub async fn getPaymentFlowInfoFromTenantConfig( // where // T: serde::de::DeserializeOwned, // { -// getConfigValueFromMerchantConfig(MCTypes::GENERAL_CONFIG, arg1, arg2, arg3, arg4) +// getConfigValueFromMerchantConfig(MCTypes::GeneralConfig, arg1, arg2, arg3, arg4) // } // // Original Haskell function: getConfigValueWithPFCatagory @@ -722,7 +722,7 @@ pub async fn getPaymentFlowInfoFromTenantConfig( // arg3: String, // arg4: Option, // ) -> Option { -// getConfigValueFromMerchantConfig(MCTypes::PAYMENT_FLOW, arg1, arg2, arg3, arg4) +// getConfigValueFromMerchantConfig(MCTypes::PaymentFlow, arg1, arg2, arg3, arg4) // } // // Original Haskell function: getConfigValueFromMerchantConfig @@ -735,7 +735,7 @@ pub async fn getPaymentFlowInfoFromTenantConfig( // ) -> Option { // let tenant_config = getPaymentFlowInfoFromTenantConfig( // Some(&tenant_acc_id), -// TC::MERCHANT_CONFIG, +// TC::MerchantConfig, // &merchant_config_key, // m_iso_country_code, // ); diff --git a/src/redis/types.rs b/src/redis/types.rs index d9d55596..0f05b5f4 100644 --- a/src/redis/types.rs +++ b/src/redis/types.rs @@ -57,21 +57,13 @@ pub struct FeatureDimension { } #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum DimensionType { - #[serde(rename = "JUSPAY_BANK_CODE")] - JUSPAY_BANK_CODE, - - #[serde(rename = "GATEWAY")] - GATEWAY, - - #[serde(rename = "CARD_BRAND")] - CARD_BRAND, - - #[serde(rename = "SCOF")] - SCOF, - - #[serde(rename = "FIDO")] - FIDO, + JuspayBankCode, + Gateway, + CardBrand, + Scof, + Fido, } pub trait ServiceConfigKey { diff --git a/src/types/card/txn_card_info.rs b/src/types/card/txn_card_info.rs index 8e230d21..736fb37a 100644 --- a/src/types/card/txn_card_info.rs +++ b/src/types/card/txn_card_info.rs @@ -13,89 +13,77 @@ use std::option::Option; use std::string::String; #[derive(Debug, PartialEq, Clone, Eq, Serialize, Deserialize, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum AuthType { - #[serde(rename = "ATMPIN")] - ATMPIN, - #[serde(rename = "THREE_DS")] - THREE_DS, - #[serde(rename = "THREE_DS_2")] - THREE_DS_2, - #[serde(rename = "OTP")] - OTP, - #[serde(rename = "OBO_OTP")] - OBO_OTP, - #[serde(rename = "VIES")] - VIES, - #[serde(rename = "NO_THREE_DS")] - NO_THREE_DS, - #[serde(rename = "NETWORK_TOKEN")] - NETWORK_TOKEN, - #[serde(rename = "MOTO")] - MOTO, - #[serde(rename = "FIDO")] - FIDO, - #[serde(rename = "CTP")] - CTP, + Atmpin, + ThreeDs, + ThreeDs2, + Otp, + OboOtp, + Vies, + NoThreeDs, + NetworkToken, + Moto, + Fido, + Ctp, } impl std::fmt::Display for AuthType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::ATMPIN => write!(f, "ATMPIN"), - Self::THREE_DS => write!(f, "THREE_DS"), - Self::THREE_DS_2 => write!(f, "THREE_DS_2"), - Self::OTP => write!(f, "OTP"), - Self::OBO_OTP => write!(f, "OBO_OTP"), - Self::VIES => write!(f, "VIES"), - Self::NO_THREE_DS => write!(f, "NO_THREE_DS"), - Self::NETWORK_TOKEN => write!(f, "NETWORK_TOKEN"), - Self::MOTO => write!(f, "MOTO"), - Self::FIDO => write!(f, "FIDO"), - Self::CTP => write!(f, "CTP"), + Self::Atmpin => write!(f, "ATMPIN"), + Self::ThreeDs => write!(f, "THREE_DS"), + Self::ThreeDs2 => write!(f, "THREE_DS_2"), + Self::Otp => write!(f, "OTP"), + Self::OboOtp => write!(f, "OBO_OTP"), + Self::Vies => write!(f, "VIES"), + Self::NoThreeDs => write!(f, "NO_THREE_DS"), + Self::NetworkToken => write!(f, "NETWORK_TOKEN"), + Self::Moto => write!(f, "MOTO"), + Self::Fido => write!(f, "FIDO"), + Self::Ctp => write!(f, "CTP"), } } } pub fn text_to_auth_type(ctx: &str) -> Result { match ctx { - "ATMPIN" => Ok(AuthType::ATMPIN), - "THREE_DS" => Ok(AuthType::THREE_DS), - "THREE_DS_2" => Ok(AuthType::THREE_DS_2), - "OTP" => Ok(AuthType::OTP), - "OBO_OTP" => Ok(AuthType::OBO_OTP), - "VIES" => Ok(AuthType::VIES), - "NO_THREE_DS" => Ok(AuthType::NO_THREE_DS), - "NETWORK_TOKEN" => Ok(AuthType::NETWORK_TOKEN), - "MOTO" => Ok(AuthType::MOTO), - "FIDO" => Ok(AuthType::FIDO), - "CTP" => Ok(AuthType::CTP), + "ATMPIN" => Ok(AuthType::Atmpin), + "THREE_DS" => Ok(AuthType::ThreeDs), + "THREE_DS_2" => Ok(AuthType::ThreeDs2), + "OTP" => Ok(AuthType::Otp), + "OBO_OTP" => Ok(AuthType::OboOtp), + "VIES" => Ok(AuthType::Vies), + "NO_THREE_DS" => Ok(AuthType::NoThreeDs), + "NETWORK_TOKEN" => Ok(AuthType::NetworkToken), + "MOTO" => Ok(AuthType::Moto), + "FIDO" => Ok(AuthType::Fido), + "CTP" => Ok(AuthType::Ctp), _ => Err(ApiError::ParsingError("Invalid Auth Type")), } } pub fn auth_type_to_text(ctx: &AuthType) -> String { match ctx { - AuthType::ATMPIN => "ATMPIN".to_string(), - AuthType::THREE_DS => "THREE_DS".to_string(), - AuthType::THREE_DS_2 => "THREE_DS_2".to_string(), - AuthType::OTP => "OTP".to_string(), - AuthType::OBO_OTP => "OBO_OTP".to_string(), - AuthType::VIES => "VIES".to_string(), - AuthType::NO_THREE_DS => "NO_THREE_DS".to_string(), - AuthType::NETWORK_TOKEN => "NETWORK_TOKEN".to_string(), - AuthType::MOTO => "MOTO".to_string(), - AuthType::FIDO => "FIDO".to_string(), - AuthType::CTP => "CTP".to_string(), + AuthType::Atmpin => "ATMPIN".to_string(), + AuthType::ThreeDs => "THREE_DS".to_string(), + AuthType::ThreeDs2 => "THREE_DS_2".to_string(), + AuthType::Otp => "OTP".to_string(), + AuthType::OboOtp => "OBO_OTP".to_string(), + AuthType::Vies => "VIES".to_string(), + AuthType::NoThreeDs => "NO_THREE_DS".to_string(), + AuthType::NetworkToken => "NETWORK_TOKEN".to_string(), + AuthType::Moto => "MOTO".to_string(), + AuthType::Fido => "FIDO".to_string(), + AuthType::Ctp => "CTP".to_string(), } } #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum EMIType { - #[serde(rename = "NO_COST_EMI")] - NO_COST_EMI, - #[serde(rename = "LOW_COST_EMI")] - LOW_COST_EMI, - #[serde(rename = "STANDARD_EMI")] - STANDARD_EMI, + NoCostEmi, + LowCostEmi, + StandardEmi, } #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/src/types/gateway.rs b/src/types/gateway.rs index 82aba145..d6b6fc62 100644 --- a/src/types/gateway.rs +++ b/src/types/gateway.rs @@ -9,207 +9,208 @@ use crate::error::ApiError; #[derive( Debug, Clone, PartialOrd, Ord, PartialEq, Serialize, Deserialize, Eq, Hash, strum::Display, )] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum Gateway { - ADYEN, - AFTERPAY, - AIRPAY, - PAYPHI, - AIRTELMONEY, - AIRWALLEX, - AMAZONPAY, - AMEX, - AMPS, - ATOM, - AUTHORIZEDOTNET, - AXIS, - AXIS_BIZ, - AXIS_UPI, - AXISNB, - BAJAJFINSERV, - BHARATX, - BILLDESK, - BLAZEPAY, - BRAINTREE, - BOKU, - CAMSPAY, - CAPILLARY, - CAPITALFLOAT, - CAREEMPAY, - CASH, - CASHTOCODE, - CCAVENUE, - CCAVENUE_V2, - CHECKOUT, - CIELO, - CITI, - CITRUS, - CRED, - CYBERSOURCE, - CYBS_CHASE, - DIGIO, - DIRECT_BANK_EMI, - DLOCAL, - DUMMY, - EARLYSALARY, - EASEBUZZ, - EBANX, - EBS, - EBS_V3, - EPAYLATER, - EXPRESSPG, - FACILITAPAY, - FASPAY, - FEDERAL_BIZ, - FDCONNECT, - FIB, - FINBOX, - FLEXMONEY, - FLUTTERWAVE, - FREECHARGE, - FREECHARGEPG, - FREECHARGE_V2, - FSS_ATM_PIN, - FSS_ATM_PIN_V2, - FSSPAY, - GOCASHFREE, - GOKWIK, - GOOGLEPAY, - GPAY_IMF, - GYFTR, - HDFC, - HDFC_DC_EMI, - HDFC_CC_EMI, - HDFC_EBS_VAS, - HDFC_FLEXIPAY, - HDFC_IVR, - HDFCBANK_SMARTGATEWAY, - HDFC_UPI, - HDFCNB, - HSBC, - HSBC_UPI, - HYPERPAY, - HYPERPG, - HYPER_PG, - IATAPAY, - ICICI, - ICICI_UPI, - ICICINB, - ICICIPAYLATER, - IFG, - INDUS_UPI, - INSPIRE_NETZ, - INSTACRED, - INDUS_PAYU, - IPG, - ITAU, - ITZCASH, - JIOMONEY, - JIOPAY, - KBANK, - KLARNA, - KOTAK, - KOTAK_BIZ, - KOTAK_UPI, - LAZYPAY, - LINEPAY, - LOANTAP, - LOTUSPAY, - LOYLTYREWARDZ, - LSP, - LSP_ETB, - LYRA, - M2P, - MERCADOPAGO, - MERCHANT_CONTAINER, - MIDTRANS, - MIGS, - MOBIKWIK, - MOBIKWIKZIP, - MORPHEUS, - MPESA, - MPGS, - MSWIPE, - MYFATOORAH, - TAPPAY, - TAZAPAY, - PAYMOB, - FAWRYPAY, - NAVITAIRE, - NBBL, - MOSAMBEE, - NETCETERA, - NMI, - NOON, - NONE, - NUPAY, - OLAMONEY, - OLAPOSTPAID, - ONEPAY, - OPNPAYMENTS, - PAGALEVE, - PAGSEGURO, - PAYAMIGO, - PAYFORT, - PAYGLOCAL, - PAYLATER, - PAYPAL, - PAYTM, - PAYTM_UPI, - PAYTM_V2, - PAYU, - PAYZAPP, - PHONEPE, - PINELABS, - PINELABS_OFFLINE, - POSTPAY, - QWIKCILVER, - RAZORPAY, - RBL, - RBL_BIZ, - SBI, - SBI_UPI, - SBIBUDDY, - SBIePAY, - SEZZLE, - SHOPSE, - SIKA_SIMPL, - SIMPL, - SNAPMINT, - SODEXO, - STRIPE, - TABBY, - TATA_PA, - TATA_UPI, - TATANEU, - TATAPAY, - TATAPAYLATER, - TAP, - TPSL, - TPSL_SI, - TRIPLEA, - TRUSTPAY, - TWID, - TWID_V2, - TWOC_TWOP, - VIJAYA_UPI, - VOLT, - VISA_PBW, - WALLET_CONTAINER, - WORLDPAY, - XENDIT, - YES_BIZ, - YESBANK_UPI, - YPP, - ZAAKPAY, - ZESTMONEY, - DOKU, - ZAINCASH, - FASTPAY, - PAY10, - PINELABS_ONLINE, - WIBMO, - NDPS, - DEFAULT, + Adyen, + Afterpay, + Airpay, + Payphi, + Airtelmoney, + Airwallex, + Amazonpay, + Amex, + Amps, + Atom, + Authorizedotnet, + Axis, + AxisBiz, + AxisUpi, + Axisnb, + Bajajfinserv, + Bharatx, + Billdesk, + Blazepay, + Braintree, + Boku, + Camspay, + Capillary, + Capitalfloat, + Careempay, + Cash, + Cashtocode, + Ccavenue, + CcavenueV2, + Checkout, + Cielo, + Citi, + Citrus, + Cred, + Cybersource, + CybsChase, + Digio, + DirectBankEmi, + Dlocal, + Dummy, + Earlysalary, + Easebuzz, + Ebanx, + Ebs, + EbsV3, + Epaylater, + Expresspg, + Facilitatpay, + FasPay, + FederalBiz, + Fdconnect, + Fib, + Finbox, + Flexmoney, + Flutterwave, + Freecharge, + Freechargepg, + FreechargeV2, + FssAtmPin, + FssAtmPinV2, + Fsspay, + Gocashfree, + Gokwik, + Googlepay, + GpayImf, + Gyftr, + Hdfc, + HdfcDcEmi, + HdfcCcEmi, + HdfcEbsVas, + HdfcFlexipay, + HdfcIvr, + HdfcbankSmartgateway, + HdfcUpi, + Hdfcnb, + Hsbc, + HsbcUpi, + Hyperpay, + Hyperpg, + HyperPg, + Iatapay, + Icici, + IciciUpi, + Icicinb, + Icicipaylater, + Ifg, + IndusUpi, + InspireNetz, + Instacred, + IndusPayu, + Ipg, + Itau, + Itzcash, + Jiomoney, + Jiopay, + Kbank, + Klarna, + Kotak, + KotakBiz, + KotakUpi, + Lazypay, + Linepay, + Loantap, + Lotuspay, + Loyltyrewardz, + Lsp, + LspEtb, + Lyra, + M2p, + Mercadopago, + MerchantContainer, + Midtrans, + Migs, + Mobikwik, + Mobikwikzip, + Morpheus, + Mpesa, + Mpgs, + Mswipe, + Myfatoorah, + Tappay, + Tazapay, + Paymob, + Fawrypay, + Navitaire, + Nbbl, + Mosambee, + Netcetera, + Nmi, + Noon, + None, + Nupay, + Olamoney, + Olapostpaid, + Onepay, + Opnpayments, + Pagaleve, + Pagseguo, + Payamigo, + Payfort, + Payglocal, + Paylater, + Paypal, + Paytm, + PaytmUpi, + PaytmV2, + Payu, + Payzapp, + Phonepe, + Pinelabs, + PinelabsOffline, + Postpay, + Qwikcilver, + Razorpay, + Rbl, + RblBiz, + Sbi, + SbiUpi, + Sbibuddy, + Sbiepay, + Sezzle, + Shopse, + SikaSimpl, + Simpl, + Snapmint, + Sodexo, + Stripe, + Tabby, + TataPa, + TataUpi, + Tatanue, + Tatapay, + Tatapaylater, + Tap, + Tpsl, + TpslSi, + Triplea, + Trustpay, + Twid, + TwidV2, + TwocTwop, + VijayaUpi, + Volt, + VisaPbw, + WalletContainer, + Worldpay, + Xendit, + YesBiz, + YesbankUpi, + Ypp, + Zaakpay, + Zestmoney, + Doku, + Zaincash, + Fastpay, + Pay10, + PinelabsOnline, + Wibmo, + Ndps, + Default, } #[derive(Debug, PartialEq, Serialize, Deserialize)] @@ -236,206 +237,206 @@ pub fn gateway_any_to_text(gateway_any: &GatewayAny) -> Option { pub fn text_to_gateway(text: &str) -> Result { match text { - "ADYEN" => Ok(Gateway::ADYEN), - "AFTERPAY" => Ok(Gateway::AFTERPAY), - "AIRPAY" => Ok(Gateway::AIRPAY), - "PAYPHI" => Ok(Gateway::PAYPHI), - "AIRTELMONEY" => Ok(Gateway::AIRTELMONEY), - "AIRWALLEX" => Ok(Gateway::AIRWALLEX), - "AMAZONPAY" => Ok(Gateway::AMAZONPAY), - "AMEX" => Ok(Gateway::AMEX), - "AMPS" => Ok(Gateway::AMPS), - "ATOM" => Ok(Gateway::ATOM), - "AUTHORIZEDOTNET" => Ok(Gateway::AUTHORIZEDOTNET), - "AXIS_BIZ" => Ok(Gateway::AXIS_BIZ), - "AXIS_UPI" => Ok(Gateway::AXIS_UPI), - "AXIS" => Ok(Gateway::AXIS), - "AXISNB" => Ok(Gateway::AXISNB), - "BAJAJFINSERV" => Ok(Gateway::BAJAJFINSERV), - "BHARATX" => Ok(Gateway::BHARATX), - "BILLDESK" => Ok(Gateway::BILLDESK), - "BLAZEPAY" => Ok(Gateway::BLAZEPAY), - "BRAINTREE" => Ok(Gateway::BRAINTREE), - "BOKU" => Ok(Gateway::BOKU), - "CAMSPAY" => Ok(Gateway::CAMSPAY), - "CAPILLARY" => Ok(Gateway::CAPILLARY), - "CAPITALFLOAT" => Ok(Gateway::CAPITALFLOAT), - "CAREEMPAY" => Ok(Gateway::CAREEMPAY), - "CASH" => Ok(Gateway::CASH), - "CASHTOCODE" => Ok(Gateway::CASHTOCODE), - "CCAVENUE_V2" => Ok(Gateway::CCAVENUE_V2), - "CCAVENUE" => Ok(Gateway::CCAVENUE), - "CHECKOUT" => Ok(Gateway::CHECKOUT), - "CIELO" => Ok(Gateway::CIELO), - "CITI" => Ok(Gateway::CITI), - "CITRUS" => Ok(Gateway::CITRUS), - "CRED" => Ok(Gateway::CRED), - "CYBERSOURCE" => Ok(Gateway::CYBERSOURCE), - "CYBS_CHASE" => Ok(Gateway::CYBS_CHASE), - "DIGIO" => Ok(Gateway::DIGIO), - "DLOCAL" => Ok(Gateway::DLOCAL), - "DUMMY" => Ok(Gateway::DUMMY), - "EARLYSALARY" => Ok(Gateway::EARLYSALARY), - "EASEBUZZ" => Ok(Gateway::EASEBUZZ), - "EBANX" => Ok(Gateway::EBANX), - "EBS_V3" => Ok(Gateway::EBS_V3), - "EBS" => Ok(Gateway::EBS), - "EPAYLATER" => Ok(Gateway::EPAYLATER), - "EXPRESSPG" => Ok(Gateway::EXPRESSPG), - "FACILITAPAY" => Ok(Gateway::FACILITAPAY), - "FASPAY" => Ok(Gateway::FASPAY), - "FASTPAY" => Ok(Gateway::FASTPAY), - "FEDERAL_BIZ" => Ok(Gateway::FEDERAL_BIZ), - "FDCONNECT" => Ok(Gateway::FDCONNECT), - "FIB" => Ok(Gateway::FIB), - "FINBOX" => Ok(Gateway::FINBOX), - "FLEXMONEY" => Ok(Gateway::FLEXMONEY), - "FLUTTERWAVE" => Ok(Gateway::FLUTTERWAVE), - "FREECHARGE_V2" => Ok(Gateway::FREECHARGE_V2), - "FREECHARGEPG" => Ok(Gateway::FREECHARGEPG), - "FREECHARGE" => Ok(Gateway::FREECHARGE), - "FSS_ATM_PIN_V2" => Ok(Gateway::FSS_ATM_PIN_V2), - "FSS_ATM_PIN" => Ok(Gateway::FSS_ATM_PIN), - "FSSPAY" => Ok(Gateway::FSSPAY), - "GOCASHFREE" => Ok(Gateway::GOCASHFREE), - "GOKWIK" => Ok(Gateway::GOKWIK), - "GOOGLEPAY" => Ok(Gateway::GOOGLEPAY), - "GPAY_IMF" => Ok(Gateway::GPAY_IMF), - "GYFTR" => Ok(Gateway::GYFTR), - "HDFC_DC_EMI" => Ok(Gateway::HDFC_DC_EMI), - "HDFC_CC_EMI" => Ok(Gateway::HDFC_CC_EMI), - "HDFC_EBS_VAS" => Ok(Gateway::HDFC_EBS_VAS), - "HDFC_FLEXIPAY" => Ok(Gateway::HDFC_FLEXIPAY), - "HDFC_IVR" => Ok(Gateway::HDFC_IVR), - "HDFCBANK_SMARTGATEWAY" => Ok(Gateway::HDFCBANK_SMARTGATEWAY), - "HDFC_UPI" => Ok(Gateway::HDFC_UPI), - "HDFC" => Ok(Gateway::HDFC), - "HDFCNB" => Ok(Gateway::HDFCNB), - "HSBC" => Ok(Gateway::HSBC), - "HSBC_UPI" => Ok(Gateway::HSBC_UPI), - "HYPERPG" => Ok(Gateway::HYPERPG), - "HYPERPAY" => Ok(Gateway::HYPERPAY), - "HYPER_PG" => Ok(Gateway::HYPER_PG), - "IATAPAY" => Ok(Gateway::IATAPAY), - "ICICI_UPI" => Ok(Gateway::ICICI_UPI), - "ICICI" => Ok(Gateway::ICICI), - "ICICINB" => Ok(Gateway::ICICINB), - "ICICIPAYLATER" => Ok(Gateway::ICICIPAYLATER), - "IFG" => Ok(Gateway::IFG), - "INDUS_UPI" => Ok(Gateway::INDUS_UPI), - "INSPIRE_NETZ" => Ok(Gateway::INSPIRE_NETZ), - "INSTACRED" => Ok(Gateway::INSTACRED), - "INDUS_PAYU" => Ok(Gateway::INDUS_PAYU), - "IPG" => Ok(Gateway::IPG), - "ITAU" => Ok(Gateway::ITAU), - "ITZCASH" => Ok(Gateway::ITZCASH), - "JIOMONEY" => Ok(Gateway::JIOMONEY), - "JIOPAY" => Ok(Gateway::JIOPAY), - "KBANK" => Ok(Gateway::KBANK), - "KLARNA" => Ok(Gateway::KLARNA), - "KOTAK_UPI" => Ok(Gateway::KOTAK_UPI), - "KOTAK" => Ok(Gateway::KOTAK), - "KOTAK_BIZ" => Ok(Gateway::KOTAK_BIZ), - "LAZYPAY" => Ok(Gateway::LAZYPAY), - "LINEPAY" => Ok(Gateway::LINEPAY), - "LOANTAP" => Ok(Gateway::LOANTAP), - "LOTUSPAY" => Ok(Gateway::LOTUSPAY), - "LOYLTYREWARDZ" => Ok(Gateway::LOYLTYREWARDZ), - "LSP" => Ok(Gateway::LSP), - "LSP_ETB" => Ok(Gateway::LSP_ETB), - "LYRA" => Ok(Gateway::LYRA), - "M2P" => Ok(Gateway::M2P), - "MERCADOPAGO" => Ok(Gateway::MERCADOPAGO), - "MERCHANT_CONTAINER" => Ok(Gateway::MERCHANT_CONTAINER), - "MIDTRANS" => Ok(Gateway::MIDTRANS), - "MIGS" => Ok(Gateway::MIGS), - "MOBIKWIK" => Ok(Gateway::MOBIKWIK), - "MOBIKWIKZIP" => Ok(Gateway::MOBIKWIKZIP), - "MORPHEUS" => Ok(Gateway::MORPHEUS), - "MPESA" => Ok(Gateway::MPESA), - "MPGS" => Ok(Gateway::MPGS), - "MSWIPE" => Ok(Gateway::MSWIPE), - "MYFATOORAH" => Ok(Gateway::MYFATOORAH), - "TAPPAY" => Ok(Gateway::TAPPAY), - "TAZAPAY" => Ok(Gateway::TAZAPAY), - "PAYMOB" => Ok(Gateway::PAYMOB), - "FAWRYPAY" => Ok(Gateway::FAWRYPAY), - "NAVITAIRE" => Ok(Gateway::NAVITAIRE), - "NBBL" => Ok(Gateway::NBBL), - "MOSAMBEE" => Ok(Gateway::MOSAMBEE), - "NETCETERA" => Ok(Gateway::NETCETERA), - "NMI" => Ok(Gateway::NMI), - "NOON" => Ok(Gateway::NOON), - "NONE" => Ok(Gateway::NONE), - "NUPAY" => Ok(Gateway::NUPAY), - "OLAMONEY" => Ok(Gateway::OLAMONEY), - "OLAPOSTPAID" => Ok(Gateway::OLAPOSTPAID), - "ONEPAY" => Ok(Gateway::ONEPAY), - "OPNPAYMENTS" => Ok(Gateway::OPNPAYMENTS), - "PAGALEVE" => Ok(Gateway::PAGALEVE), - "PAGSEGURO" => Ok(Gateway::PAGSEGURO), - "PAYAMIGO" => Ok(Gateway::PAYAMIGO), - "PAYFORT" => Ok(Gateway::PAYFORT), - "PAYGLOCAL" => Ok(Gateway::PAYGLOCAL), - "PAYLATER" => Ok(Gateway::PAYLATER), - "PAYPAL" => Ok(Gateway::PAYPAL), - "PAYTM_UPI" => Ok(Gateway::PAYTM_UPI), - "PAYTM_V2" => Ok(Gateway::PAYTM_V2), - "PAYTM" => Ok(Gateway::PAYTM), - "PAYU" => Ok(Gateway::PAYU), - "PAYZAPP" => Ok(Gateway::PAYZAPP), - "PHONEPE" => Ok(Gateway::PHONEPE), - "PINELABS" => Ok(Gateway::PINELABS), - "PINELABS_OFFLINE" => Ok(Gateway::PINELABS_OFFLINE), - "POSTPAY" => Ok(Gateway::POSTPAY), - "QWIKCILVER" => Ok(Gateway::QWIKCILVER), - "RAZORPAY" => Ok(Gateway::RAZORPAY), - "RBL_BIZ" => Ok(Gateway::RBL_BIZ), - "RBL" => Ok(Gateway::RBL), - "SBI_UPI" => Ok(Gateway::SBI_UPI), - "SBI" => Ok(Gateway::SBI), - "SBIBUDDY" => Ok(Gateway::SBIBUDDY), - "SBIePAY" => Ok(Gateway::SBIePAY), - "SEZZLE" => Ok(Gateway::SEZZLE), - "SHOPSE" => Ok(Gateway::SHOPSE), - "SIKA_SIMPL" => Ok(Gateway::SIKA_SIMPL), - "SIMPL" => Ok(Gateway::SIMPL), - "SNAPMINT" => Ok(Gateway::SNAPMINT), - "SODEXO" => Ok(Gateway::SODEXO), - "STRIPE" => Ok(Gateway::STRIPE), - "TABBY" => Ok(Gateway::TABBY), - "TATA_PA" => Ok(Gateway::TATA_PA), - "TATA_UPI" => Ok(Gateway::TATA_UPI), - "TATANEU" => Ok(Gateway::TATANEU), - "TATAPAY" => Ok(Gateway::TATAPAY), - "TATAPAYLATER" => Ok(Gateway::TATAPAYLATER), - "TAP" => Ok(Gateway::TAP), - "TPSL_SI" => Ok(Gateway::TPSL_SI), - "TPSL" => Ok(Gateway::TPSL), - "TRIPLEA" => Ok(Gateway::TRIPLEA), - "TRUSTPAY" => Ok(Gateway::TRUSTPAY), - "TWID" => Ok(Gateway::TWID), - "TWID_V2" => Ok(Gateway::TWID_V2), - "TWOC_TWOP" => Ok(Gateway::TWOC_TWOP), - "VIJAYA_UPI" => Ok(Gateway::VIJAYA_UPI), - "VISA_PBW" => Ok(Gateway::VISA_PBW), - "VOLT" => Ok(Gateway::VOLT), - "WALLET_CONTAINER" => Ok(Gateway::WALLET_CONTAINER), - "WORLDPAY" => Ok(Gateway::WORLDPAY), - "XENDIT" => Ok(Gateway::XENDIT), - "YES_BIZ" => Ok(Gateway::YES_BIZ), - "YESBANK_UPI" => Ok(Gateway::YESBANK_UPI), - "YPP" => Ok(Gateway::YPP), - "ZAAKPAY" => Ok(Gateway::ZAAKPAY), - "ZESTMONEY" => Ok(Gateway::ZESTMONEY), - "DOKU" => Ok(Gateway::DOKU), - "DIRECT_BANK_EMI" => Ok(Gateway::DIRECT_BANK_EMI), - "ZAINCASH" => Ok(Gateway::ZAINCASH), - "PAY10" => Ok(Gateway::PAY10), - "PINELABS_ONLINE" => Ok(Gateway::PINELABS_ONLINE), - "WIBMO" => Ok(Gateway::WIBMO), - "NDPS" => Ok(Gateway::NDPS), - "DEFAULT" => Ok(Gateway::DEFAULT), + "ADYEN" => Ok(Gateway::Adyen), + "AFTERPAY" => Ok(Gateway::Afterpay), + "AIRPAY" => Ok(Gateway::Airpay), + "PAYPHI" => Ok(Gateway::Payphi), + "AIRTELMONEY" => Ok(Gateway::Airtelmoney), + "AIRWALLEX" => Ok(Gateway::Airwallex), + "AMAZONPAY" => Ok(Gateway::Amazonpay), + "AMEX" => Ok(Gateway::Amex), + "AMPS" => Ok(Gateway::Amps), + "ATOM" => Ok(Gateway::Atom), + "AUTHORIZEDOTNET" => Ok(Gateway::Authorizedotnet), + "AXIS_BIZ" => Ok(Gateway::AxisBiz), + "AXIS_UPI" => Ok(Gateway::AxisUpi), + "AXIS" => Ok(Gateway::Axis), + "AXISNB" => Ok(Gateway::Axisnb), + "BAJAJFINSERV" => Ok(Gateway::Bajajfinserv), + "BHARATX" => Ok(Gateway::Bharatx), + "BILLDESK" => Ok(Gateway::Billdesk), + "BLAZEPAY" => Ok(Gateway::Blazepay), + "BRAINTREE" => Ok(Gateway::Braintree), + "BOKU" => Ok(Gateway::Boku), + "CAMSPAY" => Ok(Gateway::Camspay), + "CAPILLARY" => Ok(Gateway::Capillary), + "CAPITALFLOAT" => Ok(Gateway::Capitalfloat), + "CAREEMPAY" => Ok(Gateway::Careempay), + "CASH" => Ok(Gateway::Cash), + "CASHTOCODE" => Ok(Gateway::Cashtocode), + "CCAVENUE_V2" => Ok(Gateway::CcavenueV2), + "CCAVENUE" => Ok(Gateway::Ccavenue), + "CHECKOUT" => Ok(Gateway::Checkout), + "CIELO" => Ok(Gateway::Cielo), + "CITI" => Ok(Gateway::Citi), + "CITRUS" => Ok(Gateway::Citrus), + "CRED" => Ok(Gateway::Cred), + "CYBERSOURCE" => Ok(Gateway::Cybersource), + "CYBS_CHASE" => Ok(Gateway::CybsChase), + "DIGIO" => Ok(Gateway::Digio), + "DLOCAL" => Ok(Gateway::Dlocal), + "DUMMY" => Ok(Gateway::Dummy), + "EARLYSALARY" => Ok(Gateway::Earlysalary), + "EASEBUZZ" => Ok(Gateway::Easebuzz), + "EBANX" => Ok(Gateway::Ebanx), + "EBS_V3" => Ok(Gateway::EbsV3), + "EBS" => Ok(Gateway::Ebs), + "EPAYLATER" => Ok(Gateway::Epaylater), + "EXPRESSPG" => Ok(Gateway::Expresspg), + "FACILITAPAY" => Ok(Gateway::Facilitatpay), + "FASPAY" => Ok(Gateway::FasPay), + "FASTPAY" => Ok(Gateway::Fastpay), + "FEDERAL_BIZ" => Ok(Gateway::FederalBiz), + "FDCONNECT" => Ok(Gateway::Fdconnect), + "FIB" => Ok(Gateway::Fib), + "FINBOX" => Ok(Gateway::Finbox), + "FLEXMONEY" => Ok(Gateway::Flexmoney), + "FLUTTERWAVE" => Ok(Gateway::Flutterwave), + "FREECHARGE_V2" => Ok(Gateway::FreechargeV2), + "FREECHARGEPG" => Ok(Gateway::Freechargepg), + "FREECHARGE" => Ok(Gateway::Freecharge), + "FSS_ATM_PIN_V2" => Ok(Gateway::FssAtmPinV2), + "FSS_ATM_PIN" => Ok(Gateway::FssAtmPin), + "FSSPAY" => Ok(Gateway::Fsspay), + "GOCASHFREE" => Ok(Gateway::Gocashfree), + "GOKWIK" => Ok(Gateway::Gokwik), + "GOOGLEPAY" => Ok(Gateway::Googlepay), + "GPAY_IMF" => Ok(Gateway::GpayImf), + "GYFTR" => Ok(Gateway::Gyftr), + "HDFC_DC_EMI" => Ok(Gateway::HdfcDcEmi), + "HDFC_CC_EMI" => Ok(Gateway::HdfcCcEmi), + "HDFC_EBS_VAS" => Ok(Gateway::HdfcEbsVas), + "HDFC_FLEXIPAY" => Ok(Gateway::HdfcFlexipay), + "HDFC_IVR" => Ok(Gateway::HdfcIvr), + "HDFCBANK_SMARTGATEWAY" => Ok(Gateway::HdfcbankSmartgateway), + "HDFC_UPI" => Ok(Gateway::HdfcUpi), + "HDFC" => Ok(Gateway::Hdfc), + "HDFCNB" => Ok(Gateway::Hdfcnb), + "HSBC" => Ok(Gateway::Hsbc), + "HSBC_UPI" => Ok(Gateway::HsbcUpi), + "HYPERPG" => Ok(Gateway::Hyperpg), + "HYPERPAY" => Ok(Gateway::Hyperpay), + "HYPER_PG" => Ok(Gateway::HyperPg), + "IATAPAY" => Ok(Gateway::Iatapay), + "ICICI_UPI" => Ok(Gateway::IciciUpi), + "ICICI" => Ok(Gateway::Icici), + "ICICINB" => Ok(Gateway::Icicinb), + "ICICIPAYLATER" => Ok(Gateway::Icicipaylater), + "IFG" => Ok(Gateway::Ifg), + "INDUS_UPI" => Ok(Gateway::IndusUpi), + "INSPIRE_NETZ" => Ok(Gateway::InspireNetz), + "INSTACRED" => Ok(Gateway::Instacred), + "INDUS_PAYU" => Ok(Gateway::IndusPayu), + "IPG" => Ok(Gateway::Ipg), + "ITAU" => Ok(Gateway::Itau), + "ITZCASH" => Ok(Gateway::Itzcash), + "JIOMONEY" => Ok(Gateway::Jiomoney), + "JIOPAY" => Ok(Gateway::Jiopay), + "KBANK" => Ok(Gateway::Kbank), + "KLARNA" => Ok(Gateway::Klarna), + "KOTAK_UPI" => Ok(Gateway::KotakUpi), + "KOTAK" => Ok(Gateway::Kotak), + "KOTAK_BIZ" => Ok(Gateway::KotakBiz), + "LAZYPAY" => Ok(Gateway::Lazypay), + "LINEPAY" => Ok(Gateway::Linepay), + "LOANTAP" => Ok(Gateway::Loantap), + "LOTUSPAY" => Ok(Gateway::Lotuspay), + "LOYLTYREWARDZ" => Ok(Gateway::Loyltyrewardz), + "LSP" => Ok(Gateway::Lsp), + "LSP_ETB" => Ok(Gateway::LspEtb), + "LYRA" => Ok(Gateway::Lyra), + "M2P" => Ok(Gateway::M2p), + "MERCADOPAGO" => Ok(Gateway::Mercadopago), + "MERCHANT_CONTAINER" => Ok(Gateway::MerchantContainer), + "MIDTRANS" => Ok(Gateway::Midtrans), + "MIGS" => Ok(Gateway::Migs), + "MOBIKWIK" => Ok(Gateway::Mobikwik), + "MOBIKWIKZIP" => Ok(Gateway::Mobikwikzip), + "MORPHEUS" => Ok(Gateway::Morpheus), + "MPESA" => Ok(Gateway::Mpesa), + "MPGS" => Ok(Gateway::Mpgs), + "MSWIPE" => Ok(Gateway::Mswipe), + "MYFATOORAH" => Ok(Gateway::Myfatoorah), + "TAPPAY" => Ok(Gateway::Tappay), + "TAZAPAY" => Ok(Gateway::Tazapay), + "PAYMOB" => Ok(Gateway::Paymob), + "FAWRYPAY" => Ok(Gateway::Fawrypay), + "NAVITAIRE" => Ok(Gateway::Navitaire), + "NBBL" => Ok(Gateway::Nbbl), + "MOSAMBEE" => Ok(Gateway::Mosambee), + "NETCETERA" => Ok(Gateway::Netcetera), + "NMI" => Ok(Gateway::Nmi), + "NOON" => Ok(Gateway::Noon), + "NONE" => Ok(Gateway::None), + "NUPAY" => Ok(Gateway::Nupay), + "OLAMONEY" => Ok(Gateway::Olamoney), + "OLAPOSTPAID" => Ok(Gateway::Olapostpaid), + "ONEPAY" => Ok(Gateway::Onepay), + "OPNPAYMENTS" => Ok(Gateway::Opnpayments), + "PAGALEVE" => Ok(Gateway::Pagaleve), + "PAGSEGURO" => Ok(Gateway::Pagseguo), + "PAYAMIGO" => Ok(Gateway::Payamigo), + "PAYFORT" => Ok(Gateway::Payfort), + "PAYGLOCAL" => Ok(Gateway::Payglocal), + "PAYLATER" => Ok(Gateway::Paylater), + "PAYPAL" => Ok(Gateway::Paypal), + "PAYTM_UPI" => Ok(Gateway::PaytmUpi), + "PAYTM_V2" => Ok(Gateway::PaytmV2), + "PAYTM" => Ok(Gateway::Paytm), + "PAYU" => Ok(Gateway::Payu), + "PAYZAPP" => Ok(Gateway::Payzapp), + "PHONEPE" => Ok(Gateway::Phonepe), + "PINELABS" => Ok(Gateway::Pinelabs), + "PINELABS_OFFLINE" => Ok(Gateway::PinelabsOffline), + "POSTPAY" => Ok(Gateway::Postpay), + "QWIKCILVER" => Ok(Gateway::Qwikcilver), + "RAZORPAY" => Ok(Gateway::Razorpay), + "RBL_BIZ" => Ok(Gateway::RblBiz), + "RBL" => Ok(Gateway::Rbl), + "SBI_UPI" => Ok(Gateway::SbiUpi), + "SBI" => Ok(Gateway::Sbi), + "SBIBUDDY" => Ok(Gateway::Sbibuddy), + "SBIePAY" => Ok(Gateway::Sbiepay), + "SEZZLE" => Ok(Gateway::Sezzle), + "SHOPSE" => Ok(Gateway::Shopse), + "SIKA_SIMPL" => Ok(Gateway::SikaSimpl), + "SIMPL" => Ok(Gateway::Simpl), + "SNAPMINT" => Ok(Gateway::Snapmint), + "SODEXO" => Ok(Gateway::Sodexo), + "STRIPE" => Ok(Gateway::Stripe), + "TABBY" => Ok(Gateway::Tabby), + "TATA_PA" => Ok(Gateway::TataPa), + "TATA_UPI" => Ok(Gateway::TataUpi), + "TATANEU" => Ok(Gateway::Tatanue), + "TATAPAY" => Ok(Gateway::Tatapay), + "TATAPAYLATER" => Ok(Gateway::Tatapaylater), + "TAP" => Ok(Gateway::Tap), + "TPSL_SI" => Ok(Gateway::TpslSi), + "TPSL" => Ok(Gateway::Tpsl), + "TRIPLEA" => Ok(Gateway::Triplea), + "TRUSTPAY" => Ok(Gateway::Trustpay), + "TWID" => Ok(Gateway::Twid), + "TWID_V2" => Ok(Gateway::TwidV2), + "TWOC_TWOP" => Ok(Gateway::TwocTwop), + "VIJAYA_UPI" => Ok(Gateway::VijayaUpi), + "VISA_PBW" => Ok(Gateway::VisaPbw), + "VOLT" => Ok(Gateway::Volt), + "WALLET_CONTAINER" => Ok(Gateway::WalletContainer), + "WORLDPAY" => Ok(Gateway::Worldpay), + "XENDIT" => Ok(Gateway::Xendit), + "YES_BIZ" => Ok(Gateway::YesBiz), + "YESBANK_UPI" => Ok(Gateway::YesbankUpi), + "YPP" => Ok(Gateway::Ypp), + "ZAAKPAY" => Ok(Gateway::Zaakpay), + "ZESTMONEY" => Ok(Gateway::Zestmoney), + "DOKU" => Ok(Gateway::Doku), + "DIRECT_BANK_EMI" => Ok(Gateway::DirectBankEmi), + "ZAINCASH" => Ok(Gateway::Zaincash), + "PAY10" => Ok(Gateway::Pay10), + "PINELABS_ONLINE" => Ok(Gateway::PinelabsOnline), + "WIBMO" => Ok(Gateway::Wibmo), + "NDPS" => Ok(Gateway::Ndps), + "DEFAULT" => Ok(Gateway::Default), _ => Err(ApiError::ParsingError("Invalid Gateway")), } } diff --git a/src/types/gateway_routing_input.rs b/src/types/gateway_routing_input.rs index accd1738..41b3ef1f 100644 --- a/src/types/gateway_routing_input.rs +++ b/src/types/gateway_routing_input.rs @@ -7,25 +7,22 @@ use std::string::String; use std::vec::Vec; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum EliminationLevel { - #[serde(rename = "GATEWAY")] - GATEWAY, - #[serde(rename = "PAYMENT_METHOD_TYPE")] - PAYMENT_METHOD_TYPE, - #[serde(rename = "PAYMENT_METHOD")] - PAYMENT_METHOD, - #[serde(rename = "NONE")] - NONE, - #[serde(rename = "FORCED_PAYMENT_METHOD")] - FORCED_PAYMENT_METHOD, + Gateway, + PaymentMethodType, + PaymentMethod, + None, + ForcedPaymentMethod, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum SelectionLevel { #[serde(rename = "PAYMENT_MODE")] - SL_PAYMENT_MODE, + SlPaymentMode, #[serde(rename = "PAYMENT_METHOD")] - SL_PAYMENT_METHOD, + SlPaymentMethod, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -129,7 +126,7 @@ impl GatewaySuccessRateBasedRoutingInput { Self { gatewayWiseInputs: None, defaultEliminationThreshold: config.threshold, - defaultEliminationLevel: EliminationLevel::PAYMENT_METHOD, + defaultEliminationLevel: EliminationLevel::PaymentMethod, defaultSelectionLevel: None, enabledPaymentMethodTypes: vec![], eliminationV2SuccessRateInputs: None, @@ -157,7 +154,7 @@ impl Default for GatewaySuccessRateBasedRoutingInput { Self { gatewayWiseInputs: None, defaultEliminationThreshold: 0.0, - defaultEliminationLevel: EliminationLevel::PAYMENT_METHOD, + defaultEliminationLevel: EliminationLevel::PaymentMethod, defaultSelectionLevel: None, enabledPaymentMethodTypes: vec![], eliminationV2SuccessRateInputs: None, diff --git a/src/types/merchant_config/types.rs b/src/types/merchant_config/types.rs index ff8c791b..f22212ea 100644 --- a/src/types/merchant_config/types.rs +++ b/src/types/merchant_config/types.rs @@ -10,9 +10,10 @@ pub struct MerchantConfigPId(pub String); pub struct ConfigName(pub String); #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum ConfigCategory { - PAYMENT_FLOW, - GENERAL_CONFIG, + PaymentFlow, + GeneralConfig, } #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -49,8 +50,8 @@ pub fn to_merchant_config_pid(id: String) -> MerchantConfigPId { pub fn config_category_to_text(category: ConfigCategory) -> String { match category { - ConfigCategory::PAYMENT_FLOW => "PAYMENT_FLOW".to_string(), - ConfigCategory::GENERAL_CONFIG => "GENERAL_CONFIG".to_string(), + ConfigCategory::PaymentFlow => "PAYMENT_FLOW".to_string(), + ConfigCategory::GeneralConfig => "GENERAL_CONFIG".to_string(), } } @@ -60,8 +61,8 @@ pub fn to_config_name(name: &str) -> ConfigName { pub fn to_config_category(category: &str) -> Result { match category { - "PAYMENT_FLOW" => Ok(ConfigCategory::PAYMENT_FLOW), - "GENERAL_CONFIG" => Ok(ConfigCategory::GENERAL_CONFIG), + "PAYMENT_FLOW" => Ok(ConfigCategory::PaymentFlow), + "GENERAL_CONFIG" => Ok(ConfigCategory::GeneralConfig), _ => Err(ApiError::ParsingError("Invalid ConfigCategory")), } } @@ -85,8 +86,8 @@ pub fn config_status_to_text(status: ConfigStatus) -> String { impl Display for ConfigCategory { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::PAYMENT_FLOW => write!(f, "PAYMENT_FLOW"), - Self::GENERAL_CONFIG => write!(f, "GENERAL_CONFIG"), + Self::PaymentFlow => write!(f, "PAYMENT_FLOW"), + Self::GeneralConfig => write!(f, "GENERAL_CONFIG"), } } } diff --git a/src/types/merchant_gateway_account_sub_info.rs b/src/types/merchant_gateway_account_sub_info.rs index 7cc1c914..2df2fd51 100644 --- a/src/types/merchant_gateway_account_sub_info.rs +++ b/src/types/merchant_gateway_account_sub_info.rs @@ -23,6 +23,7 @@ use crate::storage::schema::merchant_gateway_account_sub_info::dsl; use crate::storage::schema_pg::merchant_gateway_account_sub_info::dsl; use diesel::associations::HasTable; use diesel::*; +use serde::{Deserialize, Serialize}; #[derive(Debug, PartialEq, Eq, Clone)] pub struct MerchantGatewayAccountSubInfo { @@ -44,9 +45,10 @@ pub fn to_mgasi_pid(id: i64) -> MgasiPId { MgasiPId { mgasiPId: id } } -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum SubInfoType { - SPLIT_SETTLEMENT, + SplitSettlement, } #[derive(Debug, PartialEq, Eq, Clone)] @@ -57,7 +59,7 @@ pub enum SubIdType { pub fn text_to_sub_info_type(ctx: String) -> Result { match ctx.as_str() { - "SPLIT_SETTLEMENT" => Ok(SubInfoType::SPLIT_SETTLEMENT), + "SPLIT_SETTLEMENT" => Ok(SubInfoType::SplitSettlement), _ => Err(ApiError::ParsingError("Invalid Sub Info Type")), } } diff --git a/src/types/payment/payment_method.rs b/src/types/payment/payment_method.rs index a92385bf..3bd6ba27 100644 --- a/src/types/payment/payment_method.rs +++ b/src/types/payment/payment_method.rs @@ -46,69 +46,57 @@ pub struct PaymentMethod { } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum PaymentMethodSubType { - #[serde(rename = "WALLET")] - WALLET, - #[serde(rename = "CF_BNPL")] - CF_BNPL, - #[serde(rename = "GIFT_CARD")] - GIFT_CARD, - #[serde(rename = "CF_EMI")] - CF_EMI, - #[serde(rename = "REAL_TIME")] - REAL_TIME, - #[serde(rename = "CF_POD")] - CF_POD, - #[serde(rename = "REWARD")] - REWARD, - #[serde(rename = "VAN")] - VAN, - #[serde(rename = "STORE")] - STORE, - #[serde(rename = "POS")] - POS, - #[serde(rename = "CF_LSP")] - CF_LSP, - #[serde(rename = "FPX")] - FPX, - #[serde(rename = "UNKNOWN")] - UNKNOWN, + Wallet, + CfBnpl, + GiftCard, + CfEmi, + RealTime, + CfPod, + Reward, + Van, + Store, + Pos, + CfLsp, + Fpx, + Unknown, } impl PaymentMethodSubType { pub fn to_text(&self) -> &'static str { match self { - Self::WALLET => "WALLET", - Self::CF_BNPL => "CF_BNPL", - Self::GIFT_CARD => "GIFT_CARD", - Self::CF_EMI => "CF_EMI", - Self::REAL_TIME => "REAL_TIME", - Self::CF_POD => "CF_POD", - Self::REWARD => "REWARD", - Self::VAN => "VAN", - Self::STORE => "STORE", - Self::POS => "POS", - Self::CF_LSP => "CF_LSP", - Self::FPX => "FPX", - Self::UNKNOWN => "UNKNOWN", + Self::Wallet => "WALLET", + Self::CfBnpl => "CF_BNPL", + Self::GiftCard => "GIFT_CARD", + Self::CfEmi => "CF_EMI", + Self::RealTime => "REAL_TIME", + Self::CfPod => "CF_POD", + Self::Reward => "REWARD", + Self::Van => "VAN", + Self::Store => "STORE", + Self::Pos => "POS", + Self::CfLsp => "CF_LSP", + Self::Fpx => "FPX", + Self::Unknown => "UNKNOWN", } } pub fn from_text(ctx: &str) -> Result { match ctx { - "WALLET" => Ok(Self::WALLET), - "CF_BNPL" => Ok(Self::CF_BNPL), - "GIFT_CARD" => Ok(Self::GIFT_CARD), - "CF_EMI" => Ok(Self::CF_EMI), - "REAL_TIME" => Ok(Self::REAL_TIME), - "CF_POD" => Ok(Self::CF_POD), - "REWARD" => Ok(Self::REWARD), - "VAN" => Ok(Self::VAN), - "STORE" => Ok(Self::STORE), - "POS" => Ok(Self::POS), - "CF_LSP" => Ok(Self::CF_LSP), - "FPX" => Ok(Self::FPX), - "UNKNOWN" => Ok(Self::UNKNOWN), + "WALLET" => Ok(Self::Wallet), + "CF_BNPL" => Ok(Self::CfBnpl), + "GIFT_CARD" => Ok(Self::GiftCard), + "CF_EMI" => Ok(Self::CfEmi), + "REAL_TIME" => Ok(Self::RealTime), + "CF_POD" => Ok(Self::CfPod), + "REWARD" => Ok(Self::Reward), + "VAN" => Ok(Self::Van), + "STORE" => Ok(Self::Store), + "POS" => Ok(Self::Pos), + "CF_LSP" => Ok(Self::CfLsp), + "FPX" => Ok(Self::Fpx), + "UNKNOWN" => Ok(Self::Unknown), _ => Err(ApiError::ParsingError("Invalid Payment Method Sub Type")), } } diff --git a/src/types/payment_flow.rs b/src/types/payment_flow.rs index df01244c..8e3ea970 100644 --- a/src/types/payment_flow.rs +++ b/src/types/payment_flow.rs @@ -3,462 +3,460 @@ use serde::{Deserialize, Serialize}; use crate::error::ApiError; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum PaymentFlow { - CARD_3DS, - CARD_3DS2, - CARD_DOTP, - CARD_MOTO, - CARD_NO_3DS, - CARD_VIES, - ZERO_AUTH, - CARD_TOKENIZATION, - CVVLESS, - DIRECT_DEBIT, - EMANDATE, - EMI, - INAPP_DEBIT, - MANDATE, - PARTIAL_CAPTURE, - PARTIAL_VOID, - PARTIAL_PAYMENT, - PREAUTH, - SDKLESS_INTENT, - SPLIT_PAYMENT, - SPLIT_SETTLEMENT, - TOPUP, - TPV, - VISA_CHECKOUT, - OUTAGE, - SR_BASED_ROUTING, - ELIMINATION_BASED_ROUTING, - PL_BASED_ROUTING, - MANDATE_WORKFLOW, - ALTID, - SURCHARGE, - OFFER, - CAPTCHA, - PAYMENT_COLLECTION_LINK, - AUTO_REFUND, - PAYMENT_LINK, - PAYMENT_FORM, - RISK_CHECK, - DYNAMIC_CURRENCY_CONVERSION, - PART_PAYMENT, - STANDALONE_AUTHENTICATION, - STANDALONE_AUTHORIZATION, - STANDALONE_CAPTURE, - AUTHN_AUTHZ, - AUTHZ_CAPTURE, - REDIRECT_DEBIT, - LINK_AND_DEBIT, - NEW_CARD, - INSTANT_REFUND, - ASYNC, - DOTP, - MERCHANT_MANAGED_DEBIT, - ADDRESS_VERIFICATION, - FRICTIONLESS_3DS, - TA_FILE, - FIDO, - REFUND, - CTP, - ONE_TIME_PAYMENT, - REVERSE_PENNY_DROP, - ON_DEMAND_SPLIT_SETTLEMENT, - CREDIT_CARD_ON_UPI, - DECIDER_FALLBACK_DOTP_TO_3DS, - DECIDER_FALLBACK_NO_3DS_TO_3DS, - PAYMENT_CHANNEL_FALLBACK_DOTP_TO_3DS, - PG_FAILURE_FALLBACK_DOTP_TO_3DS, - TOKENIZATION_CONSENT_FALLBACK_DOTP_TO_3DS, - CUSTOMER_FALLBACK_DOTP_TO_3DS, - AUTH_PROVIDER_FALLBACK_3DS2_TO_3DS, - FRM_PREFERENCE_TO_NO_3DS, - MERCHANT_FALLBACK_3DS2_TO_3DS, - MERCHANT_FALLBACK_FIDO_TO_3DS, - ORDER_PREFERENCE_FALLBACK_NO_3DS_TO_3DS, - MERCHANT_PREFERENCE_FALLBACK_NO_3DS_TO_3DS, - ORDER_PREFERENCE_TO_NO_3DS, - MUTUAL_FUND, - CROSS_BORDER_PAYMENT, - APPLEPAY_TOKEN_DECRYPTION_FLOW, - ONE_TIME_MANDATE, - SINGLE_BLOCK_MULTIPLE_DEBIT, - SILENT_RETRY, - WALLET_TOPUP, - NETWORK_TOKEN_CREATED, - ISSUER_TOKEN_CREATED, - LOCKER_TOKEN_CREATED, - SODEXO_TOKEN_CREATED, - NETWORK_TOKEN_USED, - ISSUER_TOKEN_USED, - LOCKER_TOKEN_USED, - SODEXO_TOKEN_USED, - PAYU_TOKEN_USED, - MANDATE_REGISTER, - MANDATE_REGISTER_DEBIT, - MANDATE_PAYMENT, - EMANDATE_REGISTER, - EMANDATE_REGISTER_DEBIT, - EMANDATE_PAYMENT, - SI_HUB, - TPV_EMANDATE, - COLLECT, - INTENT, - INAPP, - QR, - PUSH_PAY, - NO_COST_EMI, - LOW_COST_EMI, - STANDARD_EMI, - STANDARD_EMI_SPLIT, - INTERNAL_NO_COST_EMI, - INTERNAL_LOW_COST_EMI, - INTERNAL_NO_COST_EMI_SPLIT, - INTERNAL_LOW_COST_EMI_SPLIT, - DIRECT_BANK_EMI, - PG_EMI, - AUTO_DISBURSEMENT, - AUTO_USER_REGISTRATION, - BANK_INSTANT_REFUND, - MANDATE_PREDEBIT_NOTIFICATION_DISABLEMENT, - ORDER_AMOUNT_AS_SUBVENTION_AMOUNT, - ORDER_ID_AS_RECON_ID, - PASS_USER_TOKEN_TO_GATEWAY, - S2S_FLOW, - SPLIT_SETTLE_ONLY, - SUBSCRIPTION_ONLY, - TPV_ONLY, - TXN_UUID_AS_TR, - UPI_INTENT_REGISTRATION, - V2_INTEGRATION, - V2_LINK_AND_PAY, - VPOS2, - PAYMENT_PAGE, - PP_QUICKPAY, - PP_RETRY, - INAPP_NEW_PAY, - INAPP_REPEAT_PAY, + Card3ds, + Card3ds2, + CardDotp, + CardMoto, + CardNo3ds, + CardVies, + ZeroAuth, + CardTokenization, + Cvvless, + DirectDebit, + Emandate, + Emi, + InappDebit, + Mandate, + PartialCapture, + PartialVoid, + PartialPayment, + Preauth, + SdklessIntent, + SplitPayment, + SplitSettlement, + Topup, + Tpv, + VisaCheckout, + Outage, + SrBasedRouting, + EliminationBasedRouting, + PlBasedRouting, + MandateWorkflow, + Altid, + Surcharge, + Offer, + Captcha, + PaymentCollectionLink, + AutoRefund, + PaymentLink, + PaymentForm, + RiskCheck, + DynamicCurrencyConversion, + PartPayment, + StandaloneAuthentication, + StandaloneAuthorization, + StandaloneCapture, + AuthnAuthz, + AuthzCapture, + RedirectDebit, + LinkAndDebit, + NewCard, + InstantRefund, + Async, + Dotp, + MerchantManagedDebit, + AddressVerification, + Frictionless3ds, + TaFile, + Fido, + Refund, + Ctp, + OneTimePayment, + ReversePennyDrop, + OnDemandSplitSettlement, + CreditCardOnUpi, + DeciderFallbackDotpTo3ds, + DeciderFallbackNo3dsTo3ds, + PaymentChannelFallbackDotpTo3ds, + PgFailureFallbackDotpTo3ds, + TokenizationConsentFallbackDotpTo3ds, + CustomerFallbackDotpTo3ds, + AuthProviderFallback3ds2To3ds, + FrmPreferenceToNo3ds, + MerchantFallback3ds2To3ds, + MerchantFallbackFidoTo3ds, + OrderPreferenceFallbackNo3dsTo3ds, + MerchantPreferenceFallbackNo3dsTo3ds, + OrderPreferenceToNo3ds, + MutualFund, + CrossBorderPayment, + ApplepayTokenDecryptionFlow, + OneTimeMandate, + SingleBlockMultipleDebit, + SilentRetry, + WalletTopup, + NetworkTokenCreated, + IssuerTokenCreated, + LockerTokenCreated, + SodexoTokenCreated, + NetworkTokenUsed, + IssuerTokenUsed, + LockerTokenUsed, + SodexoTokenUsed, + PayuTokenUsed, + MandateRegister, + MandateRegisterDebit, + MandatePayment, + EmandateRegister, + EmandateRegisterDebit, + EmandatePayment, + SiHub, + TpvEmandate, + Collect, + Intent, + Inapp, + Qr, + PushPay, + NoCostEmi, + LowCostEmi, + StandardEmi, + StandardEmiSplit, + InternalNoCostEmi, + InternalLowCostEmi, + InternalNoCostEmiSplit, + InternalLowCostEmiSplit, + DirectBankEmi, + PgEmi, + AutoDisbursement, + AutoUserRegistration, + BankInstantRefund, + MandatePredebitNotificationDisablement, + OrderAmountAsSubventionAmount, + OrderIdAsReconId, + PassUserTokenToGateway, + S2sFlow, + SplitSettleOnly, + SubscriptionOnly, + TpvOnly, + TxnUuidAsTr, + UpiIntentRegistration, + V2Integration, + V2LinkAndPay, + Vpos2, + PaymentPage, + PpQuickpay, + PpRetry, + InappNewPay, + InappRepeatPay, } pub fn payment_flows_to_text(payment_flow: &PaymentFlow) -> String { match payment_flow { - PaymentFlow::CARD_3DS => "CARD_3DS".to_string(), - PaymentFlow::CARD_3DS2 => "CARD_3DS2".to_string(), - PaymentFlow::FRICTIONLESS_3DS => "FRICTIONLESS_3DS".to_string(), - PaymentFlow::CARD_DOTP => "CARD_DOTP".to_string(), - PaymentFlow::CARD_MOTO => "CARD_MOTO".to_string(), - PaymentFlow::CARD_NO_3DS => "CARD_NO_3DS".to_string(), - PaymentFlow::CARD_VIES => "CARD_VIES".to_string(), - PaymentFlow::ZERO_AUTH => "ZERO_AUTH".to_string(), - PaymentFlow::CARD_TOKENIZATION => "CARD_TOKENIZATION".to_string(), - PaymentFlow::CVVLESS => "CVVLESS".to_string(), - PaymentFlow::DIRECT_DEBIT => "DIRECT_DEBIT".to_string(), - PaymentFlow::EMANDATE => "EMANDATE".to_string(), - PaymentFlow::EMI => "EMI".to_string(), - PaymentFlow::INAPP_DEBIT => "INAPP_DEBIT".to_string(), - PaymentFlow::MANDATE => "MANDATE".to_string(), - PaymentFlow::PARTIAL_CAPTURE => "PARTIAL_CAPTURE".to_string(), - PaymentFlow::PARTIAL_VOID => "PARTIAL_VOID".to_string(), - PaymentFlow::PARTIAL_PAYMENT => "PARTIAL_PAYMENT".to_string(), - PaymentFlow::PREAUTH => "PREAUTH".to_string(), - PaymentFlow::SDKLESS_INTENT => "SDKLESS_INTENT".to_string(), - PaymentFlow::SPLIT_PAYMENT => "SPLIT_PAYMENT".to_string(), - PaymentFlow::SPLIT_SETTLEMENT => "SPLIT_SETTLEMENT".to_string(), - PaymentFlow::WALLET_TOPUP => "WALLET_TOPUP".to_string(), - PaymentFlow::TPV => "TPV".to_string(), - PaymentFlow::VISA_CHECKOUT => "VISA_CHECKOUT".to_string(), - PaymentFlow::AUTO_DISBURSEMENT => "AUTO_DISBURSEMENT".to_string(), - PaymentFlow::AUTO_USER_REGISTRATION => "AUTO_USER_REGISTRATION".to_string(), - PaymentFlow::BANK_INSTANT_REFUND => "BANK_INSTANT_REFUND".to_string(), - PaymentFlow::MANDATE_PREDEBIT_NOTIFICATION_DISABLEMENT => { + PaymentFlow::Card3ds => "CARD_3DS".to_string(), + PaymentFlow::Card3ds2 => "CARD_3DS2".to_string(), + PaymentFlow::Frictionless3ds => "FRICTIONLESS_3DS".to_string(), + PaymentFlow::CardDotp => "CARD_DOTP".to_string(), + PaymentFlow::CardMoto => "CARD_MOTO".to_string(), + PaymentFlow::CardNo3ds => "CARD_NO_3DS".to_string(), + PaymentFlow::CardVies => "CARD_VIES".to_string(), + PaymentFlow::ZeroAuth => "ZERO_AUTH".to_string(), + PaymentFlow::CardTokenization => "CARD_TOKENIZATION".to_string(), + PaymentFlow::Cvvless => "CVVLESS".to_string(), + PaymentFlow::DirectDebit => "DIRECT_DEBIT".to_string(), + PaymentFlow::Emandate => "EMANDATE".to_string(), + PaymentFlow::Emi => "EMI".to_string(), + PaymentFlow::InappDebit => "INAPP_DEBIT".to_string(), + PaymentFlow::Mandate => "MANDATE".to_string(), + PaymentFlow::PartialCapture => "PARTIAL_CAPTURE".to_string(), + PaymentFlow::PartialVoid => "PARTIAL_VOID".to_string(), + PaymentFlow::PartialPayment => "PARTIAL_PAYMENT".to_string(), + PaymentFlow::Preauth => "PREAUTH".to_string(), + PaymentFlow::SdklessIntent => "SDKLESS_INTENT".to_string(), + PaymentFlow::SplitPayment => "SPLIT_PAYMENT".to_string(), + PaymentFlow::SplitSettlement => "SPLIT_SETTLEMENT".to_string(), + PaymentFlow::WalletTopup => "WALLET_TOPUP".to_string(), + PaymentFlow::Tpv => "TPV".to_string(), + PaymentFlow::VisaCheckout => "VISA_CHECKOUT".to_string(), + PaymentFlow::AutoDisbursement => "AUTO_DISBURSEMENT".to_string(), + PaymentFlow::AutoUserRegistration => "AUTO_USER_REGISTRATION".to_string(), + PaymentFlow::BankInstantRefund => "BANK_INSTANT_REFUND".to_string(), + PaymentFlow::MandatePredebitNotificationDisablement => { "MANDATE_PREDEBIT_NOTIFICATION_DISABLEMENT".to_string() } - PaymentFlow::ORDER_AMOUNT_AS_SUBVENTION_AMOUNT => { + PaymentFlow::OrderAmountAsSubventionAmount => { "ORDER_AMOUNT_AS_SUBVENTION_AMOUNT".to_string() } - PaymentFlow::ORDER_ID_AS_RECON_ID => "ORDER_ID_AS_RECON_ID".to_string(), - PaymentFlow::PASS_USER_TOKEN_TO_GATEWAY => "PASS_USER_TOKEN_TO_GATEWAY".to_string(), - PaymentFlow::S2S_FLOW => "S2S_FLOW".to_string(), - PaymentFlow::SPLIT_SETTLE_ONLY => "SPLIT_SETTLE_ONLY".to_string(), - PaymentFlow::SUBSCRIPTION_ONLY => "SUBSCRIPTION_ONLY".to_string(), - PaymentFlow::TPV_ONLY => "TPV_ONLY".to_string(), - PaymentFlow::TXN_UUID_AS_TR => "TXN_UUID_AS_TR".to_string(), - PaymentFlow::UPI_INTENT_REGISTRATION => "UPI_INTENT_REGISTRATION".to_string(), - PaymentFlow::V2_INTEGRATION => "V2_INTEGRATION".to_string(), - PaymentFlow::V2_LINK_AND_PAY => "V2_LINK_AND_PAY".to_string(), - PaymentFlow::VPOS2 => "VPOS2".to_string(), - PaymentFlow::OUTAGE => "OUTAGE".to_string(), - PaymentFlow::SR_BASED_ROUTING => "SR_BASED_ROUTING".to_string(), - PaymentFlow::ELIMINATION_BASED_ROUTING => "ELIMINATION_BASED_ROUTING".to_string(), - PaymentFlow::PL_BASED_ROUTING => "PL_BASED_ROUTING".to_string(), - PaymentFlow::MANDATE_WORKFLOW => "MANDATE_WORKFLOW".to_string(), - PaymentFlow::ALTID => "ALTID".to_string(), - PaymentFlow::SURCHARGE => "SURCHARGE".to_string(), - PaymentFlow::OFFER => "OFFER".to_string(), - PaymentFlow::CAPTCHA => "CAPTCHA".to_string(), - PaymentFlow::PAYMENT_COLLECTION_LINK => "PAYMENT_COLLECTION_LINK".to_string(), - PaymentFlow::AUTO_REFUND => "AUTO_REFUND".to_string(), - PaymentFlow::PAYMENT_LINK => "PAYMENT_LINK".to_string(), - PaymentFlow::PAYMENT_FORM => "PAYMENT_FORM".to_string(), - PaymentFlow::RISK_CHECK => "RISK_CHECK".to_string(), - PaymentFlow::DYNAMIC_CURRENCY_CONVERSION => "DYNAMIC_CURRENCY_CONVERSION".to_string(), - PaymentFlow::PART_PAYMENT => "PART_PAYMENT".to_string(), - PaymentFlow::STANDALONE_AUTHENTICATION => "STANDALONE_AUTHENTICATION".to_string(), - PaymentFlow::STANDALONE_AUTHORIZATION => "STANDALONE_AUTHORIZATION".to_string(), - PaymentFlow::STANDALONE_CAPTURE => "STANDALONE_CAPTURE".to_string(), - PaymentFlow::AUTHN_AUTHZ => "AUTHN_AUTHZ".to_string(), - PaymentFlow::AUTHZ_CAPTURE => "AUTHZ_CAPTURE".to_string(), - PaymentFlow::REDIRECT_DEBIT => "REDIRECT_DEBIT".to_string(), - PaymentFlow::LINK_AND_DEBIT => "LINK_AND_DEBIT".to_string(), - PaymentFlow::NEW_CARD => "NEW_CARD".to_string(), - PaymentFlow::NETWORK_TOKEN_CREATED => "NETWORK_TOKEN_CREATED".to_string(), - PaymentFlow::ISSUER_TOKEN_CREATED => "ISSUER_TOKEN_CREATED".to_string(), - PaymentFlow::LOCKER_TOKEN_CREATED => "LOCKER_TOKEN_CREATED".to_string(), - PaymentFlow::SODEXO_TOKEN_CREATED => "SODEXO_TOKEN_CREATED".to_string(), - PaymentFlow::NETWORK_TOKEN_USED => "NETWORK_TOKEN_USED".to_string(), - PaymentFlow::ISSUER_TOKEN_USED => "ISSUER_TOKEN_USED".to_string(), - PaymentFlow::LOCKER_TOKEN_USED => "LOCKER_TOKEN_USED".to_string(), - PaymentFlow::SODEXO_TOKEN_USED => "SODEXO_TOKEN_USED".to_string(), - PaymentFlow::PAYU_TOKEN_USED => "PAYU_TOKEN_USED".to_string(), - PaymentFlow::MANDATE_REGISTER => "MANDATE_REGISTER".to_string(), - PaymentFlow::MANDATE_REGISTER_DEBIT => "MANDATE_REGISTER_DEBIT".to_string(), - PaymentFlow::MANDATE_PAYMENT => "MANDATE_PAYMENT".to_string(), - PaymentFlow::EMANDATE_REGISTER => "EMANDATE_REGISTER".to_string(), - PaymentFlow::EMANDATE_REGISTER_DEBIT => "EMANDATE_REGISTER_DEBIT".to_string(), - PaymentFlow::EMANDATE_PAYMENT => "EMANDATE_PAYMENT".to_string(), - PaymentFlow::SI_HUB => "SI_HUB".to_string(), - PaymentFlow::TPV_EMANDATE => "TPV_EMANDATE".to_string(), - PaymentFlow::COLLECT => "COLLECT".to_string(), - PaymentFlow::INTENT => "INTENT".to_string(), - PaymentFlow::INAPP => "INAPP".to_string(), - PaymentFlow::QR => "QR".to_string(), - PaymentFlow::PUSH_PAY => "PUSH_PAY".to_string(), - PaymentFlow::INSTANT_REFUND => "INSTANT_REFUND".to_string(), - PaymentFlow::ASYNC => "ASYNC".to_string(), - PaymentFlow::DOTP => "DOTP".to_string(), - PaymentFlow::MERCHANT_MANAGED_DEBIT => "MERCHANT_MANAGED_DEBIT".to_string(), - PaymentFlow::ADDRESS_VERIFICATION => "ADDRESS_VERIFICATION".to_string(), - PaymentFlow::TA_FILE => "TA_FILE".to_string(), - PaymentFlow::PAYMENT_PAGE => "PAYMENT_PAGE".to_string(), - PaymentFlow::PP_QUICKPAY => "PP_QUICKPAY".to_string(), - PaymentFlow::PP_RETRY => "PP_RETRY".to_string(), - PaymentFlow::INAPP_NEW_PAY => "INAPP_NEW_PAY".to_string(), - PaymentFlow::INAPP_REPEAT_PAY => "INAPP_REPEAT_PAY".to_string(), - PaymentFlow::PG_EMI => "PG_EMI".to_string(), - PaymentFlow::SILENT_RETRY => "SILENT_RETRY".to_string(), - PaymentFlow::FIDO => "FIDO".to_string(), - PaymentFlow::REFUND => "REFUND".to_string(), - PaymentFlow::CTP => "CTP".to_string(), - PaymentFlow::ONE_TIME_PAYMENT => "ONE_TIME_PAYMENT".to_string(), - PaymentFlow::NO_COST_EMI => "NO_COST_EMI".to_string(), - PaymentFlow::LOW_COST_EMI => "LOW_COST_EMI".to_string(), - PaymentFlow::STANDARD_EMI => "STANDARD_EMI".to_string(), - PaymentFlow::STANDARD_EMI_SPLIT => "STANDARD_EMI_SPLIT".to_string(), - PaymentFlow::INTERNAL_NO_COST_EMI => "INTERNAL_NO_COST_EMI".to_string(), - PaymentFlow::INTERNAL_LOW_COST_EMI => "INTERNAL_LOW_COST_EMI".to_string(), - PaymentFlow::INTERNAL_NO_COST_EMI_SPLIT => "INTERNAL_NO_COST_EMI_SPLIT".to_string(), - PaymentFlow::INTERNAL_LOW_COST_EMI_SPLIT => "INTERNAL_LOW_COST_EMI_SPLIT".to_string(), - PaymentFlow::DIRECT_BANK_EMI => "DIRECT_BANK_EMI".to_string(), - PaymentFlow::REVERSE_PENNY_DROP => "REVERSE_PENNY_DROP".to_string(), - PaymentFlow::TOPUP => "TOPUP".to_string(), - PaymentFlow::ON_DEMAND_SPLIT_SETTLEMENT => "ON_DEMAND_SPLIT_SETTLEMENT".to_string(), - PaymentFlow::CREDIT_CARD_ON_UPI => "CREDIT_CARD_ON_UPI".to_string(), - PaymentFlow::DECIDER_FALLBACK_DOTP_TO_3DS => "DECIDER_FALLBACK_DOTP_TO_3DS".to_string(), - PaymentFlow::DECIDER_FALLBACK_NO_3DS_TO_3DS => "DECIDER_FALLBACK_NO_3DS_TO_3DS".to_string(), - PaymentFlow::PAYMENT_CHANNEL_FALLBACK_DOTP_TO_3DS => { + PaymentFlow::OrderIdAsReconId => "ORDER_ID_AS_RECON_ID".to_string(), + PaymentFlow::PassUserTokenToGateway => "PASS_USER_TOKEN_TO_GATEWAY".to_string(), + PaymentFlow::S2sFlow => "S2S_FLOW".to_string(), + PaymentFlow::SplitSettleOnly => "SPLIT_SETTLE_ONLY".to_string(), + PaymentFlow::SubscriptionOnly => "SUBSCRIPTION_ONLY".to_string(), + PaymentFlow::TpvOnly => "TPV_ONLY".to_string(), + PaymentFlow::TxnUuidAsTr => "TXN_UUID_AS_TR".to_string(), + PaymentFlow::UpiIntentRegistration => "UPI_INTENT_REGISTRATION".to_string(), + PaymentFlow::V2Integration => "V2_INTEGRATION".to_string(), + PaymentFlow::V2LinkAndPay => "V2_LINK_AND_PAY".to_string(), + PaymentFlow::Vpos2 => "VPOS2".to_string(), + PaymentFlow::Outage => "OUTAGE".to_string(), + PaymentFlow::SrBasedRouting => "SR_BASED_ROUTING".to_string(), + PaymentFlow::EliminationBasedRouting => "ELIMINATION_BASED_ROUTING".to_string(), + PaymentFlow::PlBasedRouting => "PL_BASED_ROUTING".to_string(), + PaymentFlow::MandateWorkflow => "MANDATE_WORKFLOW".to_string(), + PaymentFlow::Altid => "ALTID".to_string(), + PaymentFlow::Surcharge => "SURCHARGE".to_string(), + PaymentFlow::Offer => "OFFER".to_string(), + PaymentFlow::Captcha => "CAPTCHA".to_string(), + PaymentFlow::PaymentCollectionLink => "PAYMENT_COLLECTION_LINK".to_string(), + PaymentFlow::AutoRefund => "AUTO_REFUND".to_string(), + PaymentFlow::PaymentLink => "PAYMENT_LINK".to_string(), + PaymentFlow::PaymentForm => "PAYMENT_FORM".to_string(), + PaymentFlow::RiskCheck => "RISK_CHECK".to_string(), + PaymentFlow::DynamicCurrencyConversion => "DYNAMIC_CURRENCY_CONVERSION".to_string(), + PaymentFlow::PartPayment => "PART_PAYMENT".to_string(), + PaymentFlow::StandaloneAuthentication => "STANDALONE_AUTHENTICATION".to_string(), + PaymentFlow::StandaloneAuthorization => "STANDALONE_AUTHORIZATION".to_string(), + PaymentFlow::StandaloneCapture => "STANDALONE_CAPTURE".to_string(), + PaymentFlow::AuthnAuthz => "AUTHN_AUTHZ".to_string(), + PaymentFlow::AuthzCapture => "AUTHZ_CAPTURE".to_string(), + PaymentFlow::RedirectDebit => "REDIRECT_DEBIT".to_string(), + PaymentFlow::LinkAndDebit => "LINK_AND_DEBIT".to_string(), + PaymentFlow::NewCard => "NEW_CARD".to_string(), + PaymentFlow::NetworkTokenCreated => "NETWORK_TOKEN_CREATED".to_string(), + PaymentFlow::IssuerTokenCreated => "ISSUER_TOKEN_CREATED".to_string(), + PaymentFlow::LockerTokenCreated => "LOCKER_TOKEN_CREATED".to_string(), + PaymentFlow::SodexoTokenCreated => "SODEXO_TOKEN_CREATED".to_string(), + PaymentFlow::NetworkTokenUsed => "NETWORK_TOKEN_USED".to_string(), + PaymentFlow::IssuerTokenUsed => "ISSUER_TOKEN_USED".to_string(), + PaymentFlow::LockerTokenUsed => "LOCKER_TOKEN_USED".to_string(), + PaymentFlow::SodexoTokenUsed => "SODEXO_TOKEN_USED".to_string(), + PaymentFlow::PayuTokenUsed => "PAYU_TOKEN_USED".to_string(), + PaymentFlow::MandateRegister => "MANDATE_REGISTER".to_string(), + PaymentFlow::MandateRegisterDebit => "MANDATE_REGISTER_DEBIT".to_string(), + PaymentFlow::MandatePayment => "MANDATE_PAYMENT".to_string(), + PaymentFlow::EmandateRegister => "EMANDATE_REGISTER".to_string(), + PaymentFlow::EmandateRegisterDebit => "EMANDATE_REGISTER_DEBIT".to_string(), + PaymentFlow::EmandatePayment => "EMANDATE_PAYMENT".to_string(), + PaymentFlow::SiHub => "SI_HUB".to_string(), + PaymentFlow::TpvEmandate => "TPV_EMANDATE".to_string(), + PaymentFlow::Collect => "COLLECT".to_string(), + PaymentFlow::Intent => "INTENT".to_string(), + PaymentFlow::Inapp => "INAPP".to_string(), + PaymentFlow::Qr => "QR".to_string(), + PaymentFlow::PushPay => "PUSH_PAY".to_string(), + PaymentFlow::InstantRefund => "INSTANT_REFUND".to_string(), + PaymentFlow::Async => "ASYNC".to_string(), + PaymentFlow::Dotp => "DOTP".to_string(), + PaymentFlow::MerchantManagedDebit => "MERCHANT_MANAGED_DEBIT".to_string(), + PaymentFlow::AddressVerification => "ADDRESS_VERIFICATION".to_string(), + PaymentFlow::TaFile => "TA_FILE".to_string(), + PaymentFlow::PaymentPage => "PAYMENT_PAGE".to_string(), + PaymentFlow::PpQuickpay => "PP_QUICKPAY".to_string(), + PaymentFlow::PpRetry => "PP_RETRY".to_string(), + PaymentFlow::InappNewPay => "INAPP_NEW_PAY".to_string(), + PaymentFlow::InappRepeatPay => "INAPP_REPEAT_PAY".to_string(), + PaymentFlow::PgEmi => "PG_EMI".to_string(), + PaymentFlow::SilentRetry => "SILENT_RETRY".to_string(), + PaymentFlow::Fido => "FIDO".to_string(), + PaymentFlow::Refund => "REFUND".to_string(), + PaymentFlow::Ctp => "CTP".to_string(), + PaymentFlow::OneTimePayment => "ONE_TIME_PAYMENT".to_string(), + PaymentFlow::NoCostEmi => "NO_COST_EMI".to_string(), + PaymentFlow::LowCostEmi => "LOW_COST_EMI".to_string(), + PaymentFlow::StandardEmi => "STANDARD_EMI".to_string(), + PaymentFlow::StandardEmiSplit => "STANDARD_EMI_SPLIT".to_string(), + PaymentFlow::InternalNoCostEmi => "INTERNAL_NO_COST_EMI".to_string(), + PaymentFlow::InternalLowCostEmi => "INTERNAL_LOW_COST_EMI".to_string(), + PaymentFlow::InternalNoCostEmiSplit => "INTERNAL_NO_COST_EMI_SPLIT".to_string(), + PaymentFlow::InternalLowCostEmiSplit => "INTERNAL_LOW_COST_EMI_SPLIT".to_string(), + PaymentFlow::DirectBankEmi => "DIRECT_BANK_EMI".to_string(), + PaymentFlow::ReversePennyDrop => "REVERSE_PENNY_DROP".to_string(), + PaymentFlow::Topup => "TOPUP".to_string(), + PaymentFlow::OnDemandSplitSettlement => "ON_DEMAND_SPLIT_SETTLEMENT".to_string(), + PaymentFlow::CreditCardOnUpi => "CREDIT_CARD_ON_UPI".to_string(), + PaymentFlow::DeciderFallbackDotpTo3ds => "DECIDER_FALLBACK_DOTP_TO_3DS".to_string(), + PaymentFlow::DeciderFallbackNo3dsTo3ds => "DECIDER_FALLBACK_NO_3DS_TO_3DS".to_string(), + PaymentFlow::PaymentChannelFallbackDotpTo3ds => { "PAYMENT_CHANNEL_FALLBACK_DOTP_TO_3DS".to_string() } - PaymentFlow::PG_FAILURE_FALLBACK_DOTP_TO_3DS => { - "PG_FAILURE_FALLBACK_DOTP_TO_3DS".to_string() - } - PaymentFlow::TOKENIZATION_CONSENT_FALLBACK_DOTP_TO_3DS => { + PaymentFlow::PgFailureFallbackDotpTo3ds => "PG_FAILURE_FALLBACK_DOTP_TO_3DS".to_string(), + PaymentFlow::TokenizationConsentFallbackDotpTo3ds => { "TOKENIZATION_CONSENT_FALLBACK_DOTP_TO_3DS".to_string() } - PaymentFlow::CUSTOMER_FALLBACK_DOTP_TO_3DS => "CUSTOMER_FALLBACK_DOTP_TO_3DS".to_string(), - PaymentFlow::AUTH_PROVIDER_FALLBACK_3DS2_TO_3DS => { + PaymentFlow::CustomerFallbackDotpTo3ds => "CUSTOMER_FALLBACK_DOTP_TO_3DS".to_string(), + PaymentFlow::AuthProviderFallback3ds2To3ds => { "AUTH_PROVIDER_FALLBACK_3DS2_TO_3DS".to_string() } - PaymentFlow::FRM_PREFERENCE_TO_NO_3DS => "FRM_PREFERENCE_TO_NO_3DS".to_string(), - PaymentFlow::MERCHANT_FALLBACK_3DS2_TO_3DS => "MERCHANT_FALLBACK_3DS2_TO_3DS".to_string(), - PaymentFlow::MERCHANT_FALLBACK_FIDO_TO_3DS => "MERCHANT_FALLBACK_FIDO_TO_3DS".to_string(), - PaymentFlow::ORDER_PREFERENCE_FALLBACK_NO_3DS_TO_3DS => { + PaymentFlow::FrmPreferenceToNo3ds => "FRM_PREFERENCE_TO_NO_3DS".to_string(), + PaymentFlow::MerchantFallback3ds2To3ds => "MERCHANT_FALLBACK_3DS2_TO_3DS".to_string(), + PaymentFlow::MerchantFallbackFidoTo3ds => "MERCHANT_FALLBACK_FIDO_TO_3DS".to_string(), + PaymentFlow::OrderPreferenceFallbackNo3dsTo3ds => { "ORDER_PREFERENCE_FALLBACK_NO_3DS_TO_3DS".to_string() } - PaymentFlow::MERCHANT_PREFERENCE_FALLBACK_NO_3DS_TO_3DS => { + PaymentFlow::MerchantPreferenceFallbackNo3dsTo3ds => { "MERCHANT_PREFERENCE_FALLBACK_NO_3DS_TO_3DS".to_string() } - PaymentFlow::ORDER_PREFERENCE_TO_NO_3DS => "ORDER_PREFERENCE_TO_NO_3DS".to_string(), - PaymentFlow::MUTUAL_FUND => "MUTUAL_FUND".to_string(), - PaymentFlow::CROSS_BORDER_PAYMENT => "CROSS_BORDER_PAYMENT".to_string(), - PaymentFlow::APPLEPAY_TOKEN_DECRYPTION_FLOW => "APPLEPAY_TOKEN_DECRYPTION_FLOW".to_string(), - PaymentFlow::ONE_TIME_MANDATE => "ONE_TIME_MANDATE".to_string(), - PaymentFlow::SINGLE_BLOCK_MULTIPLE_DEBIT => "SINGLE_BLOCK_MULTIPLE_DEBIT".to_string(), + PaymentFlow::OrderPreferenceToNo3ds => "ORDER_PREFERENCE_TO_NO_3DS".to_string(), + PaymentFlow::MutualFund => "MUTUAL_FUND".to_string(), + PaymentFlow::CrossBorderPayment => "CROSS_BORDER_PAYMENT".to_string(), + PaymentFlow::ApplepayTokenDecryptionFlow => "APPLEPAY_TOKEN_DECRYPTION_FLOW".to_string(), + PaymentFlow::OneTimeMandate => "ONE_TIME_MANDATE".to_string(), + PaymentFlow::SingleBlockMultipleDebit => "SINGLE_BLOCK_MULTIPLE_DEBIT".to_string(), } } pub fn text_to_payment_flows(text: String) -> Result { match text.as_str() { - "CARD_3DS" => Ok(PaymentFlow::CARD_3DS), - "CARD_3DS2" => Ok(PaymentFlow::CARD_3DS2), - "FRICTIONLESS_3DS" => Ok(PaymentFlow::FRICTIONLESS_3DS), - "CARD_DOTP" => Ok(PaymentFlow::CARD_DOTP), - "CARD_MOTO" => Ok(PaymentFlow::CARD_MOTO), - "CARD_NO_3DS" => Ok(PaymentFlow::CARD_NO_3DS), - "CARD_VIES" => Ok(PaymentFlow::CARD_VIES), - "ZERO_AUTH" => Ok(PaymentFlow::ZERO_AUTH), - "CARD_TOKENIZATION" => Ok(PaymentFlow::CARD_TOKENIZATION), - "CVVLESS" => Ok(PaymentFlow::CVVLESS), - "DIRECT_DEBIT" => Ok(PaymentFlow::DIRECT_DEBIT), - "EMANDATE" => Ok(PaymentFlow::EMANDATE), - "EMI" => Ok(PaymentFlow::EMI), - "INAPP_DEBIT" => Ok(PaymentFlow::INAPP_DEBIT), - "MANDATE" => Ok(PaymentFlow::MANDATE), - "PARTIAL_CAPTURE" => Ok(PaymentFlow::PARTIAL_CAPTURE), - "PARTIAL_VOID" => Ok(PaymentFlow::PARTIAL_VOID), - "PARTIAL_PAYMENT" => Ok(PaymentFlow::PARTIAL_PAYMENT), - "PREAUTH" => Ok(PaymentFlow::PREAUTH), - "SDKLESS_INTENT" => Ok(PaymentFlow::SDKLESS_INTENT), - "SPLIT_PAYMENT" => Ok(PaymentFlow::SPLIT_PAYMENT), - "SPLIT_SETTLEMENT" => Ok(PaymentFlow::SPLIT_SETTLEMENT), - "WALLET_TOPUP" => Ok(PaymentFlow::WALLET_TOPUP), - "TPV" => Ok(PaymentFlow::TPV), - "VISA_CHECKOUT" => Ok(PaymentFlow::VISA_CHECKOUT), - "AUTO_DISBURSEMENT" => Ok(PaymentFlow::AUTO_DISBURSEMENT), - "AUTO_USER_REGISTRATION" => Ok(PaymentFlow::AUTO_USER_REGISTRATION), - "BANK_INSTANT_REFUND" => Ok(PaymentFlow::BANK_INSTANT_REFUND), + "CARD_3DS" => Ok(PaymentFlow::Card3ds), + "CARD_3DS2" => Ok(PaymentFlow::Card3ds2), + "FRICTIONLESS_3DS" => Ok(PaymentFlow::Frictionless3ds), + "CARD_DOTP" => Ok(PaymentFlow::CardDotp), + "CARD_MOTO" => Ok(PaymentFlow::CardMoto), + "CARD_NO_3DS" => Ok(PaymentFlow::CardNo3ds), + "CARD_VIES" => Ok(PaymentFlow::CardVies), + "ZERO_AUTH" => Ok(PaymentFlow::ZeroAuth), + "CARD_TOKENIZATION" => Ok(PaymentFlow::CardTokenization), + "CVVLESS" => Ok(PaymentFlow::Cvvless), + "DIRECT_DEBIT" => Ok(PaymentFlow::DirectDebit), + "EMANDATE" => Ok(PaymentFlow::Emandate), + "EMI" => Ok(PaymentFlow::Emi), + "INAPP_DEBIT" => Ok(PaymentFlow::InappDebit), + "MANDATE" => Ok(PaymentFlow::Mandate), + "PARTIAL_CAPTURE" => Ok(PaymentFlow::PartialCapture), + "PARTIAL_VOID" => Ok(PaymentFlow::PartialVoid), + "PARTIAL_PAYMENT" => Ok(PaymentFlow::PartialPayment), + "PREAUTH" => Ok(PaymentFlow::Preauth), + "SDKLESS_INTENT" => Ok(PaymentFlow::SdklessIntent), + "SPLIT_PAYMENT" => Ok(PaymentFlow::SplitPayment), + "SPLIT_SETTLEMENT" => Ok(PaymentFlow::SplitSettlement), + "WALLET_TOPUP" => Ok(PaymentFlow::WalletTopup), + "TPV" => Ok(PaymentFlow::Tpv), + "VISA_CHECKOUT" => Ok(PaymentFlow::VisaCheckout), + "AUTO_DISBURSEMENT" => Ok(PaymentFlow::AutoDisbursement), + "AUTO_USER_REGISTRATION" => Ok(PaymentFlow::AutoUserRegistration), + "BANK_INSTANT_REFUND" => Ok(PaymentFlow::BankInstantRefund), "MANDATE_PREDEBIT_NOTIFICATION_DISABLEMENT" => { - Ok(PaymentFlow::MANDATE_PREDEBIT_NOTIFICATION_DISABLEMENT) - } - "ORDER_AMOUNT_AS_SUBVENTION_AMOUNT" => Ok(PaymentFlow::ORDER_AMOUNT_AS_SUBVENTION_AMOUNT), - "ORDER_ID_AS_RECON_ID" => Ok(PaymentFlow::ORDER_ID_AS_RECON_ID), - "PASS_USER_TOKEN_TO_GATEWAY" => Ok(PaymentFlow::PASS_USER_TOKEN_TO_GATEWAY), - "S2S_FLOW" => Ok(PaymentFlow::S2S_FLOW), - "SPLIT_SETTLE_ONLY" => Ok(PaymentFlow::SPLIT_SETTLE_ONLY), - "SUBSCRIPTION_ONLY" => Ok(PaymentFlow::SUBSCRIPTION_ONLY), - "TPV_ONLY" => Ok(PaymentFlow::TPV_ONLY), - "TXN_UUID_AS_TR" => Ok(PaymentFlow::TXN_UUID_AS_TR), - "UPI_INTENT_REGISTRATION" => Ok(PaymentFlow::UPI_INTENT_REGISTRATION), - "V2_INTEGRATION" => Ok(PaymentFlow::V2_INTEGRATION), - "V2_LINK_AND_PAY" => Ok(PaymentFlow::V2_LINK_AND_PAY), - "VPOS2" => Ok(PaymentFlow::VPOS2), - "OUTAGE" => Ok(PaymentFlow::OUTAGE), - "SR_BASED_ROUTING" => Ok(PaymentFlow::SR_BASED_ROUTING), - "ELIMINATION_BASED_ROUTING" => Ok(PaymentFlow::ELIMINATION_BASED_ROUTING), - "PL_BASED_ROUTING" => Ok(PaymentFlow::PL_BASED_ROUTING), - "MANDATE_WORKFLOW" => Ok(PaymentFlow::MANDATE_WORKFLOW), - "ALTID" => Ok(PaymentFlow::ALTID), - "SURCHARGE" => Ok(PaymentFlow::SURCHARGE), - "OFFER" => Ok(PaymentFlow::OFFER), - "CAPTCHA" => Ok(PaymentFlow::CAPTCHA), - "PAYMENT_COLLECTION_LINK" => Ok(PaymentFlow::PAYMENT_COLLECTION_LINK), - "AUTO_REFUND" => Ok(PaymentFlow::AUTO_REFUND), - "PAYMENT_LINK" => Ok(PaymentFlow::PAYMENT_LINK), - "PAYMENT_FORM" => Ok(PaymentFlow::PAYMENT_FORM), - "RISK_CHECK" => Ok(PaymentFlow::RISK_CHECK), - "DYNAMIC_CURRENCY_CONVERSION" => Ok(PaymentFlow::DYNAMIC_CURRENCY_CONVERSION), - "PART_PAYMENT" => Ok(PaymentFlow::PART_PAYMENT), - "STANDALONE_AUTHENTICATION" => Ok(PaymentFlow::STANDALONE_AUTHENTICATION), - "STANDALONE_AUTHORIZATION" => Ok(PaymentFlow::STANDALONE_AUTHORIZATION), - "STANDALONE_CAPTURE" => Ok(PaymentFlow::STANDALONE_CAPTURE), - "AUTHN_AUTHZ" => Ok(PaymentFlow::AUTHN_AUTHZ), - "AUTHZ_CAPTURE" => Ok(PaymentFlow::AUTHZ_CAPTURE), - "REDIRECT_DEBIT" => Ok(PaymentFlow::REDIRECT_DEBIT), - "LINK_AND_DEBIT" => Ok(PaymentFlow::LINK_AND_DEBIT), - "NEW_CARD" => Ok(PaymentFlow::NEW_CARD), - "NETWORK_TOKEN_CREATED" => Ok(PaymentFlow::NETWORK_TOKEN_CREATED), - "ISSUER_TOKEN_CREATED" => Ok(PaymentFlow::ISSUER_TOKEN_CREATED), - "LOCKER_TOKEN_CREATED" => Ok(PaymentFlow::LOCKER_TOKEN_CREATED), - "SODEXO_TOKEN_CREATED" => Ok(PaymentFlow::SODEXO_TOKEN_CREATED), - "NETWORK_TOKEN_USED" => Ok(PaymentFlow::NETWORK_TOKEN_USED), - "ISSUER_TOKEN_USED" => Ok(PaymentFlow::ISSUER_TOKEN_USED), - "LOCKER_TOKEN_USED" => Ok(PaymentFlow::LOCKER_TOKEN_USED), - "SODEXO_TOKEN_USED" => Ok(PaymentFlow::SODEXO_TOKEN_USED), - "PAYU_TOKEN_USED" => Ok(PaymentFlow::PAYU_TOKEN_USED), - "MANDATE_REGISTER" => Ok(PaymentFlow::MANDATE_REGISTER), - "MANDATE_REGISTER_DEBIT" => Ok(PaymentFlow::MANDATE_REGISTER_DEBIT), - "MANDATE_PAYMENT" => Ok(PaymentFlow::MANDATE_PAYMENT), - "EMANDATE_REGISTER" => Ok(PaymentFlow::EMANDATE_REGISTER), - "EMANDATE_REGISTER_DEBIT" => Ok(PaymentFlow::EMANDATE_REGISTER_DEBIT), - "EMANDATE_PAYMENT" => Ok(PaymentFlow::EMANDATE_PAYMENT), - "SI_HUB" => Ok(PaymentFlow::SI_HUB), - "TPV_EMANDATE" => Ok(PaymentFlow::TPV_EMANDATE), - "COLLECT" => Ok(PaymentFlow::COLLECT), - "INTENT" => Ok(PaymentFlow::INTENT), - "INAPP" => Ok(PaymentFlow::INAPP), - "QR" => Ok(PaymentFlow::QR), - "PUSH_PAY" => Ok(PaymentFlow::PUSH_PAY), - "INSTANT_REFUND" => Ok(PaymentFlow::INSTANT_REFUND), - "ASYNC" => Ok(PaymentFlow::ASYNC), - "DOTP" => Ok(PaymentFlow::DOTP), - "MERCHANT_MANAGED_DEBIT" => Ok(PaymentFlow::MERCHANT_MANAGED_DEBIT), - "ADDRESS_VERIFICATION" => Ok(PaymentFlow::ADDRESS_VERIFICATION), - "TA_FILE" => Ok(PaymentFlow::TA_FILE), - "PAYMENT_PAGE" => Ok(PaymentFlow::PAYMENT_PAGE), - "PP_QUICKPAY" => Ok(PaymentFlow::PP_QUICKPAY), - "PP_RETRY" => Ok(PaymentFlow::PP_RETRY), - "INAPP_NEW_PAY" => Ok(PaymentFlow::INAPP_NEW_PAY), - "INAPP_REPEAT_PAY" => Ok(PaymentFlow::INAPP_REPEAT_PAY), - "PG_EMI" => Ok(PaymentFlow::PG_EMI), - "SILENT_RETRY" => Ok(PaymentFlow::SILENT_RETRY), - "FIDO" => Ok(PaymentFlow::FIDO), - "REFUND" => Ok(PaymentFlow::REFUND), - "CTP" => Ok(PaymentFlow::CTP), - "ONE_TIME_PAYMENT" => Ok(PaymentFlow::ONE_TIME_PAYMENT), - "NO_COST_EMI" => Ok(PaymentFlow::NO_COST_EMI), - "LOW_COST_EMI" => Ok(PaymentFlow::LOW_COST_EMI), - "STANDARD_EMI" => Ok(PaymentFlow::STANDARD_EMI), - "STANDARD_EMI_SPLIT" => Ok(PaymentFlow::STANDARD_EMI_SPLIT), - "INTERNAL_NO_COST_EMI" => Ok(PaymentFlow::INTERNAL_NO_COST_EMI), - "INTERNAL_LOW_COST_EMI" => Ok(PaymentFlow::INTERNAL_LOW_COST_EMI), - "INTERNAL_NO_COST_EMI_SPLIT" => Ok(PaymentFlow::INTERNAL_NO_COST_EMI_SPLIT), - "INTERNAL_LOW_COST_EMI_SPLIT" => Ok(PaymentFlow::INTERNAL_LOW_COST_EMI_SPLIT), - "DIRECT_BANK_EMI" => Ok(PaymentFlow::DIRECT_BANK_EMI), - "REVERSE_PENNY_DROP" => Ok(PaymentFlow::REVERSE_PENNY_DROP), - "TOPUP" => Ok(PaymentFlow::TOPUP), - "ON_DEMAND_SPLIT_SETTLEMENT" => Ok(PaymentFlow::ON_DEMAND_SPLIT_SETTLEMENT), - "CREDIT_CARD_ON_UPI" => Ok(PaymentFlow::CREDIT_CARD_ON_UPI), - "DECIDER_FALLBACK_DOTP_TO_3DS" => Ok(PaymentFlow::DECIDER_FALLBACK_DOTP_TO_3DS), - "DECIDER_FALLBACK_NO_3DS_TO_3DS" => Ok(PaymentFlow::DECIDER_FALLBACK_NO_3DS_TO_3DS), - "PAYMENT_CHANNEL_FALLBACK_DOTP_TO_3DS" => { - Ok(PaymentFlow::PAYMENT_CHANNEL_FALLBACK_DOTP_TO_3DS) + Ok(PaymentFlow::MandatePredebitNotificationDisablement) } - "PG_FAILURE_FALLBACK_DOTP_TO_3DS" => Ok(PaymentFlow::PG_FAILURE_FALLBACK_DOTP_TO_3DS), + "ORDER_AMOUNT_AS_SUBVENTION_AMOUNT" => Ok(PaymentFlow::OrderAmountAsSubventionAmount), + "ORDER_ID_AS_RECON_ID" => Ok(PaymentFlow::OrderIdAsReconId), + "PASS_USER_TOKEN_TO_GATEWAY" => Ok(PaymentFlow::PassUserTokenToGateway), + "S2S_FLOW" => Ok(PaymentFlow::S2sFlow), + "SPLIT_SETTLE_ONLY" => Ok(PaymentFlow::SplitSettleOnly), + "SUBSCRIPTION_ONLY" => Ok(PaymentFlow::SubscriptionOnly), + "TPV_ONLY" => Ok(PaymentFlow::TpvOnly), + "TXN_UUID_AS_TR" => Ok(PaymentFlow::TxnUuidAsTr), + "UPI_INTENT_REGISTRATION" => Ok(PaymentFlow::UpiIntentRegistration), + "V2_INTEGRATION" => Ok(PaymentFlow::V2Integration), + "V2_LINK_AND_PAY" => Ok(PaymentFlow::V2LinkAndPay), + "VPOS2" => Ok(PaymentFlow::Vpos2), + "OUTAGE" => Ok(PaymentFlow::Outage), + "SR_BASED_ROUTING" => Ok(PaymentFlow::SrBasedRouting), + "ELIMINATION_BASED_ROUTING" => Ok(PaymentFlow::EliminationBasedRouting), + "PL_BASED_ROUTING" => Ok(PaymentFlow::PlBasedRouting), + "MANDATE_WORKFLOW" => Ok(PaymentFlow::MandateWorkflow), + "ALTID" => Ok(PaymentFlow::Altid), + "SURCHARGE" => Ok(PaymentFlow::Surcharge), + "OFFER" => Ok(PaymentFlow::Offer), + "CAPTCHA" => Ok(PaymentFlow::Captcha), + "PAYMENT_COLLECTION_LINK" => Ok(PaymentFlow::PaymentCollectionLink), + "AUTO_REFUND" => Ok(PaymentFlow::AutoRefund), + "PAYMENT_LINK" => Ok(PaymentFlow::PaymentLink), + "PAYMENT_FORM" => Ok(PaymentFlow::PaymentForm), + "RISK_CHECK" => Ok(PaymentFlow::RiskCheck), + "DYNAMIC_CURRENCY_CONVERSION" => Ok(PaymentFlow::DynamicCurrencyConversion), + "PART_PAYMENT" => Ok(PaymentFlow::PartPayment), + "STANDALONE_AUTHENTICATION" => Ok(PaymentFlow::StandaloneAuthentication), + "STANDALONE_AUTHORIZATION" => Ok(PaymentFlow::StandaloneAuthorization), + "STANDALONE_CAPTURE" => Ok(PaymentFlow::StandaloneCapture), + "AUTHN_AUTHZ" => Ok(PaymentFlow::AuthnAuthz), + "AUTHZ_CAPTURE" => Ok(PaymentFlow::AuthzCapture), + "REDIRECT_DEBIT" => Ok(PaymentFlow::RedirectDebit), + "LINK_AND_DEBIT" => Ok(PaymentFlow::LinkAndDebit), + "NEW_CARD" => Ok(PaymentFlow::NewCard), + "NETWORK_TOKEN_CREATED" => Ok(PaymentFlow::NetworkTokenCreated), + "ISSUER_TOKEN_CREATED" => Ok(PaymentFlow::IssuerTokenCreated), + "LOCKER_TOKEN_CREATED" => Ok(PaymentFlow::LockerTokenCreated), + "SODEXO_TOKEN_CREATED" => Ok(PaymentFlow::SodexoTokenCreated), + "NETWORK_TOKEN_USED" => Ok(PaymentFlow::NetworkTokenUsed), + "ISSUER_TOKEN_USED" => Ok(PaymentFlow::IssuerTokenUsed), + "LOCKER_TOKEN_USED" => Ok(PaymentFlow::LockerTokenUsed), + "SODEXO_TOKEN_USED" => Ok(PaymentFlow::SodexoTokenUsed), + "PAYU_TOKEN_USED" => Ok(PaymentFlow::PayuTokenUsed), + "MANDATE_REGISTER" => Ok(PaymentFlow::MandateRegister), + "MANDATE_REGISTER_DEBIT" => Ok(PaymentFlow::MandateRegisterDebit), + "MANDATE_PAYMENT" => Ok(PaymentFlow::MandatePayment), + "EMANDATE_REGISTER" => Ok(PaymentFlow::EmandateRegister), + "EMANDATE_REGISTER_DEBIT" => Ok(PaymentFlow::EmandateRegisterDebit), + "EMANDATE_PAYMENT" => Ok(PaymentFlow::EmandatePayment), + "SI_HUB" => Ok(PaymentFlow::SiHub), + "TPV_EMANDATE" => Ok(PaymentFlow::TpvEmandate), + "COLLECT" => Ok(PaymentFlow::Collect), + "INTENT" => Ok(PaymentFlow::Intent), + "INAPP" => Ok(PaymentFlow::Inapp), + "QR" => Ok(PaymentFlow::Qr), + "PUSH_PAY" => Ok(PaymentFlow::PushPay), + "INSTANT_REFUND" => Ok(PaymentFlow::InstantRefund), + "ASYNC" => Ok(PaymentFlow::Async), + "DOTP" => Ok(PaymentFlow::Dotp), + "MERCHANT_MANAGED_DEBIT" => Ok(PaymentFlow::MerchantManagedDebit), + "ADDRESS_VERIFICATION" => Ok(PaymentFlow::AddressVerification), + "TA_FILE" => Ok(PaymentFlow::TaFile), + "PAYMENT_PAGE" => Ok(PaymentFlow::PaymentPage), + "PP_QUICKPAY" => Ok(PaymentFlow::PpQuickpay), + "PP_RETRY" => Ok(PaymentFlow::PpRetry), + "INAPP_NEW_PAY" => Ok(PaymentFlow::InappNewPay), + "INAPP_REPEAT_PAY" => Ok(PaymentFlow::InappRepeatPay), + "PG_EMI" => Ok(PaymentFlow::PgEmi), + "SILENT_RETRY" => Ok(PaymentFlow::SilentRetry), + "FIDO" => Ok(PaymentFlow::Fido), + "REFUND" => Ok(PaymentFlow::Refund), + "CTP" => Ok(PaymentFlow::Ctp), + "ONE_TIME_PAYMENT" => Ok(PaymentFlow::OneTimePayment), + "NO_COST_EMI" => Ok(PaymentFlow::NoCostEmi), + "LOW_COST_EMI" => Ok(PaymentFlow::LowCostEmi), + "STANDARD_EMI" => Ok(PaymentFlow::StandardEmi), + "STANDARD_EMI_SPLIT" => Ok(PaymentFlow::StandardEmiSplit), + "INTERNAL_NO_COST_EMI" => Ok(PaymentFlow::InternalNoCostEmi), + "INTERNAL_LOW_COST_EMI" => Ok(PaymentFlow::InternalLowCostEmi), + "INTERNAL_NO_COST_EMI_SPLIT" => Ok(PaymentFlow::InternalNoCostEmiSplit), + "INTERNAL_LOW_COST_EMI_SPLIT" => Ok(PaymentFlow::InternalLowCostEmiSplit), + "DIRECT_BANK_EMI" => Ok(PaymentFlow::DirectBankEmi), + "REVERSE_PENNY_DROP" => Ok(PaymentFlow::ReversePennyDrop), + "TOPUP" => Ok(PaymentFlow::Topup), + "ON_DEMAND_SPLIT_SETTLEMENT" => Ok(PaymentFlow::OnDemandSplitSettlement), + "CREDIT_CARD_ON_UPI" => Ok(PaymentFlow::CreditCardOnUpi), + "DECIDER_FALLBACK_DOTP_TO_3DS" => Ok(PaymentFlow::DeciderFallbackDotpTo3ds), + "DECIDER_FALLBACK_NO_3DS_TO_3DS" => Ok(PaymentFlow::DeciderFallbackNo3dsTo3ds), + "PAYMENT_CHANNEL_FALLBACK_DOTP_TO_3DS" => Ok(PaymentFlow::PaymentChannelFallbackDotpTo3ds), + "PG_FAILURE_FALLBACK_DOTP_TO_3DS" => Ok(PaymentFlow::PgFailureFallbackDotpTo3ds), "TOKENIZATION_CONSENT_FALLBACK_DOTP_TO_3DS" => { - Ok(PaymentFlow::TOKENIZATION_CONSENT_FALLBACK_DOTP_TO_3DS) + Ok(PaymentFlow::TokenizationConsentFallbackDotpTo3ds) } - "CUSTOMER_FALLBACK_DOTP_TO_3DS" => Ok(PaymentFlow::CUSTOMER_FALLBACK_DOTP_TO_3DS), - "AUTH_PROVIDER_FALLBACK_3DS2_TO_3DS" => Ok(PaymentFlow::AUTH_PROVIDER_FALLBACK_3DS2_TO_3DS), - "FRM_PREFERENCE_TO_NO_3DS" => Ok(PaymentFlow::FRM_PREFERENCE_TO_NO_3DS), - "MERCHANT_FALLBACK_3DS2_TO_3DS" => Ok(PaymentFlow::MERCHANT_FALLBACK_3DS2_TO_3DS), - "MERCHANT_FALLBACK_FIDO_TO_3DS" => Ok(PaymentFlow::MERCHANT_FALLBACK_FIDO_TO_3DS), + "CUSTOMER_FALLBACK_DOTP_TO_3DS" => Ok(PaymentFlow::CustomerFallbackDotpTo3ds), + "AUTH_PROVIDER_FALLBACK_3DS2_TO_3DS" => Ok(PaymentFlow::AuthProviderFallback3ds2To3ds), + "FRM_PREFERENCE_TO_NO_3DS" => Ok(PaymentFlow::FrmPreferenceToNo3ds), + "MERCHANT_FALLBACK_3DS2_TO_3DS" => Ok(PaymentFlow::MerchantFallback3ds2To3ds), + "MERCHANT_FALLBACK_FIDO_TO_3DS" => Ok(PaymentFlow::MerchantFallbackFidoTo3ds), "ORDER_PREFERENCE_FALLBACK_NO_3DS_TO_3DS" => { - Ok(PaymentFlow::ORDER_PREFERENCE_FALLBACK_NO_3DS_TO_3DS) + Ok(PaymentFlow::OrderPreferenceFallbackNo3dsTo3ds) } "MERCHANT_PREFERENCE_FALLBACK_NO_3DS_TO_3DS" => { - Ok(PaymentFlow::MERCHANT_PREFERENCE_FALLBACK_NO_3DS_TO_3DS) + Ok(PaymentFlow::MerchantPreferenceFallbackNo3dsTo3ds) } - "ORDER_PREFERENCE_TO_NO_3DS" => Ok(PaymentFlow::ORDER_PREFERENCE_TO_NO_3DS), - "MUTUAL_FUND" => Ok(PaymentFlow::MUTUAL_FUND), - "CROSS_BORDER_PAYMENT" => Ok(PaymentFlow::CROSS_BORDER_PAYMENT), - "APPLEPAY_TOKEN_DECRYPTION_FLOW" => Ok(PaymentFlow::APPLEPAY_TOKEN_DECRYPTION_FLOW), - "ONE_TIME_MANDATE" => Ok(PaymentFlow::ONE_TIME_MANDATE), - "SINGLE_BLOCK_MULTIPLE_DEBIT" => Ok(PaymentFlow::SINGLE_BLOCK_MULTIPLE_DEBIT), + "ORDER_PREFERENCE_TO_NO_3DS" => Ok(PaymentFlow::OrderPreferenceToNo3ds), + "MUTUAL_FUND" => Ok(PaymentFlow::MutualFund), + "CROSS_BORDER_PAYMENT" => Ok(PaymentFlow::CrossBorderPayment), + "APPLEPAY_TOKEN_DECRYPTION_FLOW" => Ok(PaymentFlow::ApplepayTokenDecryptionFlow), + "ONE_TIME_MANDATE" => Ok(PaymentFlow::OneTimeMandate), + "SINGLE_BLOCK_MULTIPLE_DEBIT" => Ok(PaymentFlow::SingleBlockMultipleDebit), _ => Err(ApiError::ParsingError("Invalid Payment Flow")), } } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum Purpose { - AFFORDABILITY, - COMPLIANT, - INTERNAL_CONFIG, - SR_IMPROVEMENT, - UEX_IMPROVEMENT, - PAYMENT, - SECURITY, - OPTIMIZATION, - NO_CODE_PAYMENT, + Affordability, + Compliant, + InternalConfig, + SrImprovement, + UexImprovement, + Payment, + Security, + Optimization, + NoCodePayment, } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Serialize, Deserialize)] @@ -468,14 +466,15 @@ pub enum Category { } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum ControlLevel { - GATEWAY, - MERCHANT, - MERCHANT_GATEWAY, - TENANT, - TENANT_GATEWAY, - TRACKING_ONLY, - MERCHANT_GATEWAY_ACCOUNT, + Gateway, + Merchant, + MerchantGateway, + Tenant, + TenantGateway, + TrackingOnly, + MerchantGatewayAccount, } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Serialize, Deserialize)] @@ -494,9 +493,10 @@ pub enum MicroPaymentFlowType { } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum UiAccessMode { - READ_ONLY, - HIDDEN, + ReadOnly, + Hidden, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] diff --git a/src/types/tenant/tenant_config.rs b/src/types/tenant/tenant_config.rs index 639fbdf2..4aed2d66 100644 --- a/src/types/tenant/tenant_config.rs +++ b/src/types/tenant/tenant_config.rs @@ -22,38 +22,38 @@ pub fn tenant_config_id_to_text(id: TenantConfigId) -> String { #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] pub enum ModuleName { #[serde(rename = "MERCHANT_ACCOUNT")] - MERCHANT_ACCOUNT, + MerchantAccount, #[serde(rename = "SURCHARGE_LOGIC")] - SURCHARGE_LOGIC, + SurchargeLogic, #[serde(rename = "PRIORITY_LOGIC")] - PRIORITY_LOGIC, + PriorityLogic, #[serde(rename = "MERCHANT_CONFIG")] - MERCHANT_CONFIG, + MerchantConfig, #[serde(rename = "TENANT_FEATURE")] - TENANT_FEATURE, + TenantFeature, #[serde(rename = "TENANT_ACCOUNT")] - TENANT_ACCOUNT, + TenantAccount, } pub fn module_name_to_text(module_name: &ModuleName) -> String { match module_name { - ModuleName::MERCHANT_ACCOUNT => "MERCHANT_ACCOUNT".to_string(), - ModuleName::SURCHARGE_LOGIC => "SURCHARGE_LOGIC".to_string(), - ModuleName::PRIORITY_LOGIC => "PRIORITY_LOGIC".to_string(), - ModuleName::MERCHANT_CONFIG => "MERCHANT_CONFIG".to_string(), - ModuleName::TENANT_FEATURE => "TENANT_FEATURE".to_string(), - ModuleName::TENANT_ACCOUNT => "TENANT_ACCOUNT".to_string(), + ModuleName::MerchantAccount => "MERCHANT_ACCOUNT".to_string(), + ModuleName::SurchargeLogic => "SURCHARGE_LOGIC".to_string(), + ModuleName::PriorityLogic => "PRIORITY_LOGIC".to_string(), + ModuleName::MerchantConfig => "MERCHANT_CONFIG".to_string(), + ModuleName::TenantFeature => "TENANT_FEATURE".to_string(), + ModuleName::TenantAccount => "TENANT_ACCOUNT".to_string(), } } pub fn text_to_module_name(module_name: String) -> Result { match module_name.as_str() { - "MERCHANT_ACCOUNT" => Ok(ModuleName::MERCHANT_ACCOUNT), - "SURCHARGE_LOGIC" => Ok(ModuleName::SURCHARGE_LOGIC), - "PRIORITY_LOGIC" => Ok(ModuleName::PRIORITY_LOGIC), - "MERCHANT_CONFIG" => Ok(ModuleName::MERCHANT_CONFIG), - "TENANT_FEATURE" => Ok(ModuleName::TENANT_FEATURE), - "TENANT_ACCOUNT" => Ok(ModuleName::TENANT_ACCOUNT), + "MERCHANT_ACCOUNT" => Ok(ModuleName::MerchantAccount), + "SURCHARGE_LOGIC" => Ok(ModuleName::SurchargeLogic), + "PRIORITY_LOGIC" => Ok(ModuleName::PriorityLogic), + "MERCHANT_CONFIG" => Ok(ModuleName::MerchantConfig), + "TENANT_FEATURE" => Ok(ModuleName::TenantFeature), + "TENANT_ACCOUNT" => Ok(ModuleName::TenantAccount), _ => Err(ApiError::ParsingError("Invalid Module Name")), } } diff --git a/src/types/txn_details/types.rs b/src/types/txn_details/types.rs index 2af09466..7a7a3cfc 100644 --- a/src/types/txn_details/types.rs +++ b/src/types/txn_details/types.rs @@ -720,13 +720,14 @@ pub enum ChargeMethod { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum ChargeName { - BASE, - SURCHARGE, - TAX_ON_SURCHARGE, - OFFER, - ADD_ON, - GATEWAY_ADJUSTMENT, + Base, + Surcharge, + TaxOnSurcharge, + Offer, + AddOn, + GatewayAdjustment, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] diff --git a/src/types/txn_offer_info.rs b/src/types/txn_offer_info.rs index fd9d6c59..837619c3 100644 --- a/src/types/txn_offer_info.rs +++ b/src/types/txn_offer_info.rs @@ -20,11 +20,13 @@ pub enum OfferStatus { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum OfferType { - CASHBACK, - VOUCHER, - DISCOUNT, - REWARD_POINT, + Cashback, + VCoucher, + Discount, + #[serde(rename = "REWARD_POINT")] + RewardPoint, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] From bc3ab98dc395e965f78f613c14790a3da7c65dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Decher?= Date: Wed, 22 Oct 2025 15:27:45 +0200 Subject: [PATCH 27/95] fix: remove not needed parentheses to fix all rustc(unused_parens) (#157) --- src/decider/gatewaydecider/flow_new.rs | 8 ++++---- src/decider/gatewaydecider/gw_filter.rs | 6 +++--- src/decider/gatewaydecider/gw_scoring.rs | 2 +- src/decider/gatewaydecider/utils.rs | 4 ++-- src/feedback/gateway_elimination_scoring/flow.rs | 14 +++++++------- src/feedback/gateway_selection_scoring_v3/flow.rs | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 3af7cee6..1ba31296 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -42,7 +42,7 @@ use crate::types::txn_details::types as ETTD; pub async fn deciderFullPayloadHSFunction( dreq_: T::DomainDeciderRequestForApiCallV2, -) -> Result<(T::DecidedGateway), T::ErrorResponse> { +) -> Result { let merchant_account = ETM::merchant_account::load_merchant_by_merchant_id(dreq_.merchantId.clone()) .await @@ -148,7 +148,7 @@ pub async fn runDeciderFlow( rankingAlgorithm: Option, eliminationEnabled: Option, is_legacy_decider_flow: bool, -) -> Result<(T::DecidedGateway), T::ErrorResponse> { +) -> Result { let txnCreationTime = deciderParams .dpTxnDetail .dateCreated @@ -168,7 +168,7 @@ pub async fn runDeciderFlow( deciderParams.dpMerchantAccount.clone(), ) .await; - let (functionalGateways) = deciderParams + let functionalGateways = deciderParams .dpEnforceGatewayList .clone() .unwrap_or_default(); @@ -536,7 +536,7 @@ pub async fn runDeciderFlow( .unwrap_or_default(); updated_gateway_scoring_data; match dResult { - Ok(result) => Ok((result)), + Ok(result) => Ok(result), Err(( debugFilterList, _, diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index f6220471..d4e549e6 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -599,7 +599,7 @@ fn validateMga( Utils::is_seamless(mga) } else if isMandateRegister(mTxnObjType.clone()) { Utils::is_subscription(mga) - } else if (isEmandateRegister(mTxnObjType) && !is_otm_flow) { + } else if isEmandateRegister(mTxnObjType) && !is_otm_flow { Utils::is_emandate_enabled(mga) } else { !Utils::is_only_subscription(mga) @@ -1871,14 +1871,14 @@ pub async fn filterGatewaysCardInfo( .await .into_iter() .filter(|ci| { - (ci.validationType == Some(ETGCI::ValidationType::CardMandate) + ci.validationType == Some(ETGCI::ValidationType::CardMandate) && ci .authType .clone() .unwrap_or_else(|| "THREE_DS".to_string()) == auth_type_to_text( &m_auth_type.clone().unwrap_or(AuthType::ThreeDs), - )) + ) }) .collect::>(); diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index c434107f..8c525bd9 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -2637,7 +2637,7 @@ pub async fn update_gateway_score_based_on_success_rate( // }; let reset_gw_list = decider_flow.writer.resetGatewayList.clone(); - if (!reset_gw_list.is_empty()) { + if !reset_gw_list.is_empty() { trigger_reset_gateway_score( decider_flow, gateway_success_rate_inputs, diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 2f464fdc..4707ce90 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -1131,7 +1131,7 @@ pub async fn get_card_info_by_bin(card_bin: Option) -> Option 6 { (6..=9) .filter(|&len| len <= bin.len()) - .map(|len| (ETCa::isin::to_isin(bin[..len].to_string()))) + .map(|len| ETCa::isin::to_isin(bin[..len].to_string())) .collect() } else { vec![(ETCa::isin::to_isin(bin))] @@ -2864,7 +2864,7 @@ pub async fn get_penality_factor_(decider_flow: &mut DeciderFlow<'_>) -> f64 { let m_reward_factor = eliminationV2RewardFactor(&merchant_id, &txn_card_info, &txn_detail).await; match m_reward_factor { - Some(reward_factor) => return (1.0 - reward_factor), + Some(reward_factor) => return 1.0 - reward_factor, None => { return getPenaltyFactor(ScoreKeyType::EliminationMerchantKey).await; } diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index 98245c87..ab690308 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -450,11 +450,11 @@ pub async fn getUpdatedMerchantDetailsForGlobalKey( if filtered_merchant_details_array.is_empty() { let arr_max_length = getMerchantArrMaxLength().await; if merchant_details_array.len() as i32 >= arr_max_length { - return (Some(merchant_details_array)); + return Some(merchant_details_array); } else { let merchant_detail = getDefaultMerchantScoringDetailsArray(merchant_id, 1.0, 1, None); - return (Some([merchant_details_array, vec![merchant_detail]].concat())); + return Some([merchant_details_array, vec![merchant_detail]].concat()); } } else { let mut results = Vec::new(); @@ -475,11 +475,11 @@ pub async fn getUpdatedMerchantDetailsForGlobalKey( None => { let merchant_scoring_details = getDefaultMerchantScoringDetailsArray(merchant_id, 1.0, 1, None); - return (Some(vec![merchant_scoring_details])); + return Some(vec![merchant_scoring_details]); } } } else { - return (None); + return None; } } @@ -506,13 +506,13 @@ pub async fn replaceTransactionCount( } else { merchant_scoring_details.transactionCount }; - (MerchantScoringDetails { + MerchantScoringDetails { score: updated_score, transactionCount: new_count, ..merchant_scoring_details - }) + } } else { - (merchant_scoring_details) + merchant_scoring_details } } diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index bcd7f86a..91638ec1 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -75,15 +75,15 @@ pub async fn updateSrV3Score( gateway_reference_id: Option, ) { // let is_merchant_enabled_globally = MC::isMerchantEnabledForPaymentFlows(merchant_acc.id, [PF::SrBasedRouting].to_vec()).await; - match (txn_detail.gateway.clone()) { - (None) => { + match txn_detail.gateway.clone() { + None => { logger::info!( action = "gateway not found", tag = "gateway not found", "gateway not found for this transaction having id" ); } - (Some(gateway)) => { + Some(gateway) => { let unified_sr_v3_key = getProducerKey( txn_detail.clone(), mb_gateway_scoring_data, From 771263f3a63415667dbefc8f1bf12df8cada602d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Decher?= Date: Thu, 23 Oct 2025 07:23:54 +0200 Subject: [PATCH 28/95] fix: remove unused imports (#159) --- src/config.rs | 1 + src/decider/gatewaydecider/flow_new.rs | 15 --------------- src/decider/gatewaydecider/flows.rs | 2 -- src/decider/gatewaydecider/gw_filter.rs | 6 +----- src/decider/gatewaydecider/gw_scoring.rs | 10 +++------- src/decider/gatewaydecider/types.rs | 2 -- src/decider/gatewaydecider/utils.rs | 19 +++++++------------ src/decider/gatewaydecider/validators.rs | 2 -- .../storage/utils/gateway_bank_emi_support.rs | 1 - .../storage/utils/merchant_gateway_account.rs | 2 -- src/euclid/handlers/routing_rules.rs | 6 +++--- src/euclid/types.rs | 2 -- src/euclid/utils.rs | 4 ++-- .../gateway_elimination_scoring/flow.rs | 16 ++-------------- src/feedback/gateway_scoring_service.rs | 1 - .../gateway_selection_scoring_v3/flow.rs | 19 +++++-------------- src/feedback/types.rs | 4 +--- src/feedback/utils.rs | 7 +------ src/logger/setup.rs | 2 +- src/redis/commands.rs | 2 +- src/routes/decision_gateway.rs | 2 +- src/routes/merchant_account_config.rs | 2 +- src/routes/update_score.rs | 6 ++---- src/storage.rs | 4 +++- src/storage/types.rs | 1 + src/types/card/txn_card_info.rs | 1 - src/types/feature.rs | 2 +- src/types/gateway_card_info.rs | 4 ---- src/types/gateway_routing_input.rs | 2 +- src/types/merchant/merchant_account.rs | 3 +-- src/types/merchant_priority_logic.rs | 1 - src/types/tenant/tenant_config_filter.rs | 2 +- src/types/txn_details/types.rs | 1 - src/types/txn_offer_info.rs | 2 -- src/utils.rs | 4 +--- 35 files changed, 41 insertions(+), 119 deletions(-) diff --git a/src/config.rs b/src/config.rs index cb76e67a..6d26fbec 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,6 +10,7 @@ use crate::{ logger::config::Log, }; use error_stack::ResultExt; +#[cfg(feature = "kms-hashicorp-vault")] use masking::ExposeInterface; use redis_interface::RedisSettings; use std::{ diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 1ba31296..571254e1 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -3,8 +3,6 @@ use super::types::RankingAlgorithm; use super::types::UnifiedError; use crate::app::get_tenant_app_state; use crate::decider::network_decider; -use axum::response::IntoResponse; -use diesel::expression::is_aggregate::No; use serde_json::json; use serde_json::Value as AValue; use std::collections::HashMap; @@ -20,25 +18,12 @@ use super::runner::handle_fallback_logic; use super::types as T; use super::types::PriorityLogicFailure; use super::utils as Utils; -use super::utils::is_card_transaction; -use super::utils::is_emandate_transaction; -use super::utils::is_mandate_transaction; -use super::utils::is_tpv_mandate_transaction; -use super::utils::is_tpv_transaction; -use crate::decider::storage::utils::txn_card_info::is_google_pay_txn; -use crate::types::card::card_type::card_type_to_text; -use crate::types::card::card_type::CardType; -use crate::types::card::txn_card_info::AuthType; -// use crate::types::card::txn_card_info::TxnCardInfo; -use crate::types::card::vault_provider::VaultProvider; // use optics_core::{preview, review}; use crate::decider::gatewaydecider::constants as C; use crate::logger; use crate::types::card::txn_card_info::TxnCardInfo; -use crate::types::gateway_card_info::ValidationType; use crate::types::merchant as ETM; use crate::types::merchant::merchant_gateway_account::MerchantGatewayAccount; -use crate::types::txn_details::types as ETTD; pub async fn deciderFullPayloadHSFunction( dreq_: T::DomainDeciderRequestForApiCallV2, diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 247bcf52..231f98db 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -23,7 +23,6 @@ use super::utils::is_mandate_transaction; use super::utils::is_tpv_mandate_transaction; use super::utils::is_tpv_transaction; use crate::decider::storage::utils::txn_card_info::is_google_pay_txn; -use crate::redis::types::ServiceConfigKey; use crate::types::card::card_type::card_type_to_text; use crate::types::card::card_type::CardType; use crate::types::card::txn_card_info::AuthType; @@ -33,7 +32,6 @@ use crate::types::card::vault_provider::VaultProvider; use crate::app::get_tenant_app_state; use crate::decider::gatewaydecider::constants as C; use crate::logger; -use crate::redis::feature::isFeatureEnabled; use crate::types::card::txn_card_info::TxnCardInfo; use crate::types::gateway_card_info::ValidationType; use crate::types::merchant as ETM; diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index d4e549e6..05b63a79 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -1,4 +1,3 @@ -use crate::decider::gatewaydecider::constants::CashOnlyGateways; use crate::decider::gatewaydecider::types::*; use crate::decider::gatewaydecider::utils as Utils; use crate::decider::storage::utils::gateway_card_info as ETGCIS; @@ -7,10 +6,8 @@ use crate::redis::feature::{isFeatureEnabled, isFeatureEnabledByDimension}; use crate::redis::types::ServiceConfigKey; use crate::types::bank_code::find_bank_code; use crate::types::card::card_type as ETCA; -use crate::types::card::txn_card_info::{self as ETTCa, auth_type_to_text}; +use crate::types::card::txn_card_info::auth_type_to_text; use crate::types::card::vault_provider::VaultProvider; -use crate::types::gateway as ETG; -use crate::types::gateway as GT; use crate::types::gateway_bank_emi_support::GatewayBankEmiSupport; use crate::types::gateway_bank_emi_support_v2::GatewayBankEmiSupportV2; use crate::types::gateway_card_info as ETGCI; @@ -18,7 +15,6 @@ use crate::types::gateway_card_info::GatewayCardInfo; use crate::types::merchant as ETM; use crate::types::merchant::merchant_account::*; use crate::types::merchant::merchant_gateway_account as ETMA; -use crate::types::merchant_config::merchant_config as MerchantConfig; use crate::types::merchant_gateway_card_info as ETMGCI; use crate::types::payment_flow::PaymentFlow as PF; use crate::types::tenant::tenant_config::ModuleName as TC; diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 8c525bd9..e0b15095 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -12,31 +12,28 @@ use crate::merchant_config_util::{ }; use crate::redis::types::ServiceConfigKey; #[cfg(feature = "mysql")] +#[warn(unused_imports)] use crate::storage::schema::txn_detail; #[cfg(feature = "postgres")] use crate::storage::schema_pg::txn_detail; use crate::types::gateway_routing_input::{ EliminationLevel, EliminationSuccessRateInput, GatewayScore, GatewaySuccessRateBasedRoutingInput, GatewayWiseSuccessRateBasedRoutingInput, - GlobalGatewayScore, GlobalScore, GlobalScoreLog, SelectionLevel, + GlobalGatewayScore, GlobalScore, GlobalScoreLog, }; use crate::types::payment_flow::PaymentFlow; use crate::types::tenant::tenant_config::ModuleName; use crate::types::transaction::id::TransactionId; use crate::utils::{generate_random_number, get_current_date_in_millis}; -use diesel::dsl::update; use masking::PeekInterface; -use rand::prelude::*; use rand_distr::{Beta, Binomial, Distribution}; use serde::{Deserialize, Serialize}; use time::{OffsetDateTime, PrimitiveDateTime}; // use crate::types::card_brand_routes as ETCBR; use crate::redis::feature::{self as M, isFeatureEnabled}; -use crate::types::gateway as ETG; use crate::types::gateway_routing_input as ETGRI; // use crate::types::gateway_health as ETGH; use crate::types::card as ETCT; -use crate::types::payment as ETP; // use crate::types::issuer_routes as ETIssuerR; use crate::types::merchant as ETM; use crate::types::txn_details::types as ETTD; @@ -66,7 +63,7 @@ use crate::types::gateway_outage::{self as ETGO, GatewayOutage}; // use system_random::internal::StdGen; use super::types::{ transform_gateway_wise_success_rate_based_routing, ConfigSource, DebugScoringEntry, - DeciderGatewayWiseSuccessRateBasedRoutingInput, Dimension, DownTime, FilterLevel, Gateway, + DeciderGatewayWiseSuccessRateBasedRoutingInput, Dimension, DownTime, FilterLevel, GatewayRedisKeyMap, GatewayScoringData, GlobalSREvaluationScoreLog, LogCurrScore, RankingAlgorithm, RedisKey, ResetApproach, ResetGatewayInput, ScoreKeyType, SrV3InputConfig, SuccessRate1AndNConfig, @@ -76,7 +73,6 @@ use crate::types::payment::payment_method_type_const::*; use std::collections::HashMap as MP; use std::iter::Iterator; use std::option::Option; -use std::primitive; use std::string::String as T; use std::time::{SystemTime, UNIX_EPOCH}; use std::vec::Vec; diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index eb734615..7e41b056 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -24,7 +24,6 @@ use time::{OffsetDateTime, PrimitiveDateTime}; // use data::time::{UTCTime, LocalTime}; // use unsafe_coerce::unsafeCoerce; use crate::types::card as ETCa; -use crate::types::gateway as ETG; use crate::types::merchant as ETM; use crate::types::merchant::id::MerchantId; use crate::types::order as ETO; @@ -37,7 +36,6 @@ use crate::types::gateway_routing_input as ETGRI; // use eulerhs::language as L; // use juspay::extra::parsing as Parsing; use crate::types::customer as ETCu; -use crate::types::payment as ETP; use diesel::sql_types; use std::fmt; diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 4707ce90..2db6caf9 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -1,6 +1,5 @@ use crate::app::get_tenant_app_state; use crate::decider::gatewaydecider::types::{self, DeciderFlow}; -use crate::error; use crate::euclid::errors::EuclidErrors; use crate::euclid::types::SrDimensionConfig; use crate::feedback::gateway_elimination_scoring::flow::{ @@ -20,16 +19,14 @@ use crate::types::service_configuration::find_config_by_name; use crate::types::user_eligibility_info::{ get_eligibility_info, identifier_name_to_text, IdentifierName, }; -use crate::utils::{generate_random_number, get_current_date_in_millis}; -use crate::{decider, feedback, logger}; -use diesel::Identifiable; +use crate::utils::generate_random_number; +use crate::{feedback, logger}; use error_stack::ResultExt; use fred::prelude::{KeysInterface, ListInterface}; use masking::PeekInterface; use masking::Secret; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; -use serde_json::from_value; use serde_json::{from_slice, from_str, Value}; use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; @@ -62,22 +59,20 @@ use crate::types::feature as ETF; // use crate::types::gateway as Gateway; // // use types::gateway_payment_method as ETGPM; use super::types::{ - ConfigurableBlock, GatewayList, GatewayRedisKeyMap, GatewayScoreMap, GatewayScoringData, - GatewayWiseExtraScore, InternalMetadata, MessageFormat, OptimizationRedisBlockData, - ScoreKeyType, SplitSettlementDetails, SrRoutingDimensions, SrV3InputConfig, - SrV3SubLevelInputConfig, + GatewayList, GatewayRedisKeyMap, GatewayScoreMap, GatewayScoringData, GatewayWiseExtraScore, + InternalMetadata, MessageFormat, ScoreKeyType, SplitSettlementDetails, SrRoutingDimensions, + SrV3InputConfig, SrV3SubLevelInputConfig, }; use crate::types::merchant as ETM; use crate::types::merchant_gateway_card_info as ETMGCI; // // use types::merchant_gateway_card_info as ETMGCI; // // use types::merchant_gateway_payment_method as ETMGPM; // // use types::money as Money; -use crate::types::card::txn_card_info::{self as ETTCa, auth_type_to_text, AuthType}; +use crate::types::card::txn_card_info::{self as ETTCa, auth_type_to_text}; use crate::types::order as ETO; use crate::types::txn_details::types as ETTD; use crate::types::txn_offer as ETTO; // use juspay::extra::parsing as P; -use crate::types::gateway as ETG; use crate::types::gateway_routing_input::{GatewayScore, GatewaySuccessRateBasedRoutingInput}; use crate::types::token_bin_info as ETTB; // // use utils::config::constants as Config; @@ -85,7 +80,7 @@ use crate::types::token_bin_info as ETTB; // // use safe::Safe; // // use control::category::Category; // // use juspay::extra::non_empty_text as NET; -use crate::redis::{self, cache as RService}; +use crate::redis::cache as RService; use crate::types::isin_routes as ETIsinR; // // use utils::redis as EWRedis; // // use db::common::types::payment_flows as PF; diff --git a/src/decider/gatewaydecider/validators.rs b/src/decider/gatewaydecider/validators.rs index 2f53143c..32352f64 100644 --- a/src/decider/gatewaydecider/validators.rs +++ b/src/decider/gatewaydecider/validators.rs @@ -31,7 +31,6 @@ use crate::types::card::txn_card_info as ETCa; use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; use crate::types::customer as ETC; -use crate::types::gateway as ETG; use crate::types::merchant::id::to_merchant_id; use crate::types::merchant::merchant_gateway_account as ETMGA; use crate::types::money::internal::Money; @@ -40,7 +39,6 @@ use crate::types::order::id as ETOID; use crate::types::order::id::to_order_id; use crate::types::order::udfs::UDFs; use crate::types::order_metadata_v2 as ETOMV2; -use crate::types::payment::payment_method as ETP; use crate::types::source_object_id as SO; use crate::types::transaction::id as ETTID; use crate::types::txn_details::types as ETTD; diff --git a/src/decider/storage/utils/gateway_bank_emi_support.rs b/src/decider/storage/utils/gateway_bank_emi_support.rs index deab8ee4..a0b2a23e 100644 --- a/src/decider/storage/utils/gateway_bank_emi_support.rs +++ b/src/decider/storage/utils/gateway_bank_emi_support.rs @@ -1,7 +1,6 @@ // use eulerhs::prelude::*; // use eulerhs::language::MonadFlow; use crate::types::emi_bank_code as EBC; -use crate::types::gateway as ETG; use crate::types::gateway_bank_emi_support as ETGBES; use crate::types::gateway_bank_emi_support_v2 as ETGBESV2; use std::option::Option; diff --git a/src/decider/storage/utils/merchant_gateway_account.rs b/src/decider/storage/utils/merchant_gateway_account.rs index b6b423c4..e4cb7138 100644 --- a/src/decider/storage/utils/merchant_gateway_account.rs +++ b/src/decider/storage/utils/merchant_gateway_account.rs @@ -5,8 +5,6 @@ use crate::decider::gatewaydecider::types::*; // use gatewaydecider::types::*; // use juspay::extra::secret::make_secret; use crate::decider::gatewaydecider::utils::{get_mgas, is_emandate_enabled, set_mgas}; -use crate::logger; -use crate::types::gateway as ETG; use crate::types::merchant as ETM; use crate::types::merchant::id::MerchantId; use crate::types::merchant::merchant_gateway_account::MgaReferenceId; diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index f33bf985..c45178d4 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -5,11 +5,11 @@ use crate::storage::schema_pg::routing_algorithm::dsl; use crate::{ error::ApiErrorResponse, euclid::{ - ast::{self, ComparisonType, ConnectorInfo, Output, ValueType}, + ast::{ComparisonType, ConnectorInfo, Output, ValueType}, cgraph, interpreter::{evaluate_output, InterpreterBackend}, types::{ - ActivateRoutingConfigRequest, Context, DataType, JsonifiedRoutingAlgorithm, + ActivateRoutingConfigRequest, Context, JsonifiedRoutingAlgorithm, RoutingAlgorithmMapperNew, RoutingDictionaryRecord, RoutingEvaluateResponse, RoutingRequest, RoutingRule, SrDimensionConfig, StaticRoutingAlgorithm, ELIGIBLE_DIMENSIONS, @@ -30,7 +30,7 @@ use error_stack::ResultExt; use crate::app::get_tenant_app_state; -use crate::error::{self, ContainerError}; +use crate::error::ContainerError; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; use serde_json::{json, Value}; diff --git a/src/euclid/types.rs b/src/euclid/types.rs index efd43db7..4d736e15 100644 --- a/src/euclid/types.rs +++ b/src/euclid/types.rs @@ -1,6 +1,4 @@ use super::ast::ConnectorInfo; -use super::utils::generate_random_id; -use crate::decider::network_decider; use crate::euclid::ast::{Output, Program, ValueType}; #[cfg(feature = "mysql")] use crate::storage::schema; diff --git a/src/euclid/utils.rs b/src/euclid/utils.rs index e22dbc8e..38e268fd 100644 --- a/src/euclid/utils.rs +++ b/src/euclid/utils.rs @@ -1,7 +1,7 @@ -use super::ast::{self, Comparison, ComparisonType, IfStatement, Rule, ValueType}; +use super::ast::{Comparison, ComparisonType, IfStatement, Rule, ValueType}; use super::errors::EuclidErrors; use super::types::StaticRoutingAlgorithm; -use crate::error::{ApiError, ContainerError}; +use crate::error::ContainerError; use crate::euclid::types::{KeyConfig, RoutingRule, TomlConfig}; use std::collections::HashMap; use uuid::Uuid; diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index ab690308..a0685627 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -4,12 +4,7 @@ // Local Imports use crate::{ app::get_tenant_app_state, - decider::storage::utils::merchant_gateway_account, - feedback::constants::{ - defaultGWScoringPenaltyFactor, defaultGWScoringRewardFactor, defaultMerchantArrMaxLength, - defaultMinimumGatewayScore, defaultScoreGlobalKeysTTL, defaultScoreKeysTTL, ecRedis, - ecRedis2, kvRedis, kvRedis2, EnforceGwScoreKvRedis, GatewayScoreThirdDimensionTtl, - }, + feedback::constants::{defaultGWScoringPenaltyFactor, defaultGWScoringRewardFactor}, redis::types::ServiceConfigKey, types::{ card::txn_card_info::TxnCardInfo, merchant, merchant_config::types::PfMcConfig, @@ -18,6 +13,7 @@ use crate::{ }; #[cfg(feature = "mysql")] +#[warn(unused_imports)] use crate::storage::schema::gateway_bank_emi_support::gateway; #[cfg(feature = "postgres")] use crate::storage::schema_pg::gateway_bank_emi_support::gateway; @@ -26,7 +22,6 @@ use crate::feedback::constants as C; use crate::decider::gatewaydecider::constants::{EnableEliminationV2, EnableOutageV2}; -use crate::types::gateway_routing_input as ETGRI; // use crate::feedback::types as F_TYPES; use crate::decider::gatewaydecider::utils::decode_and_log_error; @@ -48,11 +43,7 @@ use crate::feedback::types::{ // TxnCardInfo, // TxnDetail, CachedGatewayScore, - GatewayScoringKeyType, - KeyType, MerchantScoringDetails, - ScoreType, - ScoringDimension, }; use crate::logger; @@ -60,10 +51,8 @@ use crate::logger; // use eulerhs::language::get_current_date_in_millis; // use eulerhs::language as EL; -use crate::redis::commands::RedisConnectionWrapper; use crate::redis::feature::isFeatureEnabled; -use crate::types::gateway as Gateway; use crate::types::merchant::id as Merchant; // use crate::types::txn_details::types::TxnDetail:: // use types::tenant_config as TenantConfig; @@ -81,7 +70,6 @@ use crate::utils as CUTILS; // Haskell's Double corresponds to Rust's f64, which is built into the language. -use bytes::Bytes; // use encoding_rs as TE; // use lens::set; diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index 1bb91eb7..3935154c 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -52,7 +52,6 @@ use crate::types::merchant::merchant_account::MerchantAccount; // use control::monad::extra::maybe_m; // use control::category; use crate::types::merchant as ETM; -use crate::types::transaction::id::transaction_id_to_text; // use utils::redis as redis; // use db::common::types::payment_flows as pf; // use utils::config::merchant_config as merchant_config; diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index 91638ec1..d3a8d2f0 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -31,11 +31,9 @@ // use feedback::types::{TxnCardInfo, PaymentMethodType, MerchantGatewayAccount}; use crate::decider::gatewaydecider::utils as GU; use crate::logger; -use crate::merchant_config_util as MC; use crate::redis::cache::findByNameFromRedis; use crate::types::payment::payment_method_type_const::*; use crate::{ - app, decider::gatewaydecider::types::{GatewayScoringData, SrRoutingDimensions}, decider::{ gatewaydecider::constants as DC, gatewaydecider::types::RoutingFlowType as RF, @@ -45,22 +43,15 @@ use crate::{ constants as C, types::SrV3DebugBlock, utils::{ - dateInIST, getCurrentIstDateWithFormat, getProducerKey, getTrueString, - isKeyExistsRedis, logGatewayScoreType, updateMovingWindow, updateScore, - GatewayScoringType, + dateInIST, getCurrentIstDateWithFormat, getProducerKey, isKeyExistsRedis, + logGatewayScoreType, updateMovingWindow, updateScore, GatewayScoringType, }, }, - redis::{feature::isFeatureEnabled, types::ServiceConfigKey}, + redis::types::ServiceConfigKey, types::{ - card::txn_card_info::TxnCardInfo, - merchant::id as MID, - merchant::{ - merchant_account::MerchantAccount, merchant_gateway_account::MerchantGatewayAccount, - }, - payment_flow::PaymentFlow as PF, - txn_details::types::TxnDetail, + card::txn_card_info::TxnCardInfo, merchant::id as MID, + merchant::merchant_account::MerchantAccount, txn_details::types::TxnDetail, }, - utils as U, }; use masking::PeekInterface; diff --git a/src/feedback/types.rs b/src/feedback/types.rs index db05ebad..39e09d1e 100644 --- a/src/feedback/types.rs +++ b/src/feedback/types.rs @@ -7,10 +7,8 @@ use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; // use database::beam as B; // use chrono::{Local, Utc}; -use crate::types::gateway as ETG; -use crate::types::txn_details::types::{Offset, TransactionLatency, TxnStatus}; +use crate::types::txn_details::types::{TransactionLatency, TxnStatus}; use std::string::String; -use time::OffsetDateTime; // use eulerhs::types::MeshError; // // Converted type synonyms diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 2a759401..e91e3a2e 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -18,11 +18,9 @@ use crate::feedback::types::{ CachedGatewayScore, InternalMetadata, InternalTrackingInfo, MandateTxnInfo, MandateTxnType, UpdateScorePayload, }; -use crate::storage::types::TxnCardInfo; use crate::types::money::internal::Money; use crate::types::order as ETO; use crate::types::transaction::id as ETId; -use crate::types::{currency::Currency, txn_details::types::TransactionLatency}; use fred::prelude::{KeysInterface, ListInterface}; // use sequelize::{ModelMeta, OrderBy, Set, Where}; use crate::types::card as ETCa; @@ -49,7 +47,7 @@ use crate::types::money::internal as ETMo; // use data::time::local_time as DTL; // use data::time::format as DTF; // use juspay::extra::json::decode_json; -use crate::decider::gatewaydecider::utils::{get_unified_key, get_value}; +use crate::decider::gatewaydecider::utils::get_unified_key; // use control::monad::except::{run_except, ExceptT}; // use data::byte_string::lazy as BSL; // use ghc::generics::Generic; @@ -66,12 +64,9 @@ use crate::types::txn_details::types::{self as ETTD, TxnDetail, TxnObjectType}; // use crate::control::exception as CE; // use juspay::extra::non_empty_text as NE; use crate::types::merchant as ETM; -use crate::types::payment::payment_method as ETP; // use types::money::{from_double, Money}; // use optics::core::{preview, review}; // use control::category::<<<; -use super::constants::GATEWAY_SCORING_DATA; -use crate::types::gateway::{gateway_any_to_text, GatewayAny}; // use prelude::real_to_frac; // use data::time::clock::posix as DTP; use crate::logger; diff --git a/src/logger/setup.rs b/src/logger/setup.rs index f5da22c4..3b3872d0 100644 --- a/src/logger/setup.rs +++ b/src/logger/setup.rs @@ -1,7 +1,7 @@ //! Setup logging subsystem. use tracing_appender::non_blocking::WorkerGuard; -use tracing_subscriber::{fmt, prelude::*, util::SubscriberInitExt, EnvFilter, Layer}; +use tracing_subscriber::{prelude::*, util::SubscriberInitExt, EnvFilter, Layer}; use super::{config, formatter::FormattingLayer, storage::StorageSubscription}; diff --git a/src/redis/commands.rs b/src/redis/commands.rs index ac35b0ed..fd8d5ae7 100644 --- a/src/redis/commands.rs +++ b/src/redis/commands.rs @@ -8,7 +8,7 @@ use fred::types::SetOptions; use fred::{ clients::Transaction, interfaces::{KeysInterface, ListInterface, TransactionInterface}, - types::{Expiration, FromRedis, MultipleValues, Scanner}, + types::{Expiration, FromRedis, MultipleValues}, }; use redis_interface::{errors, types::DelReply, RedisConnectionPool}; use std::fmt::Debug; diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index af236784..6721ed75 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -2,8 +2,8 @@ use crate::decider::gatewaydecider::{ flows::deciderFullPayloadHSFunction, types::{DecidedGateway, DomainDeciderRequest, ErrorResponse, UnifiedError}, }; +use crate::logger; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; -use crate::{logger, metrics}; use axum::body::to_bytes; use axum::http::StatusCode; use axum::response::IntoResponse; diff --git a/src/routes/merchant_account_config.rs b/src/routes/merchant_account_config.rs index 4bdc9962..acb6a93f 100644 --- a/src/routes/merchant_account_config.rs +++ b/src/routes/merchant_account_config.rs @@ -1,6 +1,6 @@ use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; use crate::types::merchant as ETM; -use crate::{error, logger, metrics, types}; +use crate::{error, logger}; use axum::{extract::Path, Json}; use error_stack::ResultExt; use serde::{Deserialize, Serialize}; diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index 18ae46f9..0e6ceca0 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -2,14 +2,12 @@ use crate::decider::gatewaydecider::types::{ErrorResponse, UnifiedError}; use crate::feedback::gateway_scoring_service::{ check_and_update_gateway_score, invalid_request_error, }; +use crate::logger; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; -use crate::types::card::txn_card_info::{ - convert_safe_to_txn_card_info, SafeTxnCardInfo, TxnCardInfo, -}; +use crate::types::card::txn_card_info::{convert_safe_to_txn_card_info, SafeTxnCardInfo}; use crate::types::txn_details::types::{ convert_safe_txn_detail_to_txn_detail, SafeTxnDetail, TransactionLatency, }; -use crate::{logger, metrics}; use axum::body::to_bytes; use cpu_time::ProcessTime; use serde::{Deserialize, Serialize}; diff --git a/src/storage.rs b/src/storage.rs index eed890f6..8c1bdd05 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -1,10 +1,12 @@ use crate::{ config::Database, - config::PgDatabase, error::{self, ContainerError}, logger, }; +#[cfg(feature = "postgres")] +use crate::config::PgDatabase; + use crate::generics::StorageResult; use bb8::PooledConnection; use std::time::Duration; diff --git a/src/storage/types.rs b/src/storage/types.rs index a41f6727..0103a758 100644 --- a/src/storage/types.rs +++ b/src/storage/types.rs @@ -3,6 +3,7 @@ use crate::decider::network_decider; use crate::error; use crate::utils::CustomResult; use diesel::sql_types::Bit; +#[cfg(feature = "postgres")] use diesel::sql_types::Bool; #[cfg(feature = "mysql")] diff --git a/src/types/card/txn_card_info.rs b/src/types/card/txn_card_info.rs index 736fb37a..e70ad730 100644 --- a/src/types/card/txn_card_info.rs +++ b/src/types/card/txn_card_info.rs @@ -1,6 +1,5 @@ use crate::error::ApiError; use crate::types::card::card_type::CardType; -use crate::utils::StringExt; use masking::Secret; use serde::{Deserialize, Deserializer, Serialize}; use time::{OffsetDateTime, PrimitiveDateTime}; diff --git a/src/types/feature.rs b/src/types/feature.rs index f3ce71ca..411018c1 100644 --- a/src/types/feature.rs +++ b/src/types/feature.rs @@ -1,7 +1,7 @@ use crate::app::get_tenant_app_state; // use db::eulermeshimpl::mesh_config; // use db::mesh::internal::*; -use crate::storage::types::{BitBool, Feature as DBFeature}; +use crate::storage::types::Feature as DBFeature; // use types::utils::dbconfig::get_euler_db_conf; use crate::types::merchant::id::{merchant_id_to_text, to_merchant_id, MerchantId}; // use juspay::extra::parsing::{Parsed, Step, around, lift_pure, mandated, parse_field, project}; diff --git a/src/types/gateway_card_info.rs b/src/types/gateway_card_info.rs index 8f3909dc..d97f8201 100644 --- a/src/types/gateway_card_info.rs +++ b/src/types/gateway_card_info.rs @@ -1,12 +1,10 @@ use crate::app::get_tenant_app_state; use crate::logger; -use diesel::sql_types::Bool; use serde::{Deserialize, Serialize}; // use db::euler_mesh_impl::mesh_config; // use db::mesh::internal; use crate::storage::types::{BitBool, GatewayCardInfo as DBGatewayCardInfo}; use crate::types::bank_code::{to_bank_code_id, BankCodeId}; -use crate::types::gateway::GatewayAny; // use juspay::extra::parsing::{ // Parsed, Step, ParsingErrorType, ParsingErrorType::UnexpectedTextValue, around, lift_either, // lift_pure, mandated, non_negative, parse_field, project, @@ -15,7 +13,6 @@ use crate::types::gateway::GatewayAny; // use types::utils::dbconfig::get_euler_db_conf; // use eulerhs::language::MonadFlow; use crate::error::ApiError; -use std::clone; use std::cmp::PartialEq; use std::fmt::Debug; use std::fmt::Display; @@ -28,7 +25,6 @@ use crate::storage::schema::gateway_card_info::dsl; #[cfg(feature = "postgres")] use crate::storage::schema_pg::gateway_card_info::dsl; use diesel::associations::HasTable; -use diesel::dsl::sql; use diesel::*; // use super::payment::payment_method::text_to_payment_method_type; diff --git a/src/types/gateway_routing_input.rs b/src/types/gateway_routing_input.rs index 41b3ef1f..f60e9b5f 100644 --- a/src/types/gateway_routing_input.rs +++ b/src/types/gateway_routing_input.rs @@ -1,5 +1,5 @@ +use crate::error; use crate::types::{merchant::id::MerchantId, routing_configuration}; -use crate::{error, logger}; use error_stack::ResultExt; use serde::{Deserialize, Serialize}; use std::option::Option; diff --git a/src/types/merchant/merchant_account.rs b/src/types/merchant/merchant_account.rs index 46c96767..d973650c 100644 --- a/src/types/merchant/merchant_account.rs +++ b/src/types/merchant/merchant_account.rs @@ -4,8 +4,7 @@ use serde::{Deserialize, Serialize}; // use db::mesh::internal::*; use crate::error::ApiError; use crate::storage::types::{ - BitBool, BitBoolWrite, MerchantAccount as DBMerchantAccount, MerchantAccountNew, - MerchantAccountUpdate, + BitBoolWrite, MerchantAccount as DBMerchantAccount, MerchantAccountNew, MerchantAccountUpdate, }; // use types::utils::dbconfig::get_euler_db_conf; // use types::locker::id::{LockerId, to_locker_id}; diff --git a/src/types/merchant_priority_logic.rs b/src/types/merchant_priority_logic.rs index aa67d534..30fd1c0e 100644 --- a/src/types/merchant_priority_logic.rs +++ b/src/types/merchant_priority_logic.rs @@ -8,7 +8,6 @@ use diesel::associations::HasTable; use diesel::*; use serde::{Deserialize, Serialize}; use std::convert::TryFrom; -use std::error::Error; use std::option::Option; use std::string::String; use std::vec::Vec; diff --git a/src/types/tenant/tenant_config_filter.rs b/src/types/tenant/tenant_config_filter.rs index 6f199520..39abd2e3 100644 --- a/src/types/tenant/tenant_config_filter.rs +++ b/src/types/tenant/tenant_config_filter.rs @@ -1,5 +1,5 @@ #[cfg(feature = "mysql")] -use crate::storage::schema::tenant_config_filter::{dimension_value, dsl, filter_group_id}; +use crate::storage::schema::tenant_config_filter::dsl; #[cfg(feature = "postgres")] use crate::storage::schema_pg::tenant_config_filter::{dimension_value, dsl, filter_group_id}; use crate::{ diff --git a/src/types/txn_details/types.rs b/src/types/txn_details/types.rs index 7a7a3cfc..f4db7327 100644 --- a/src/types/txn_details/types.rs +++ b/src/types/txn_details/types.rs @@ -13,7 +13,6 @@ use time::Time; // use db::mesh::internal; // use crate::storage::internal::primd_id_to_int; // use types::utils::dbconfig::get_euler_db_conf; -use crate::feedback::types::Milliseconds; use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; use crate::types::merchant::id::MerchantId; diff --git a/src/types/txn_offer_info.rs b/src/types/txn_offer_info.rs index 837619c3..2873e14d 100644 --- a/src/types/txn_offer_info.rs +++ b/src/types/txn_offer_info.rs @@ -1,8 +1,6 @@ use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; -use crate::decider::gatewaydecider::types::Gateway; - use super::money::internal::Money; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Serialize, Deserialize)] diff --git a/src/utils.rs b/src/utils.rs index f727de2d..b9e6f3dd 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,6 +1,5 @@ -use crate::logger::storage::Storage; use crate::{ - decider::gatewaydecider::runner::ResponseBody, error::ApiClientError, logger, storage::consts, + decider::gatewaydecider::runner::ResponseBody, error::ApiClientError, storage::consts, }; use axum::{body::Body, extract::Request}; use error_stack::ResultExt; @@ -11,7 +10,6 @@ use reqwest::{ Client, }; use serde::Deserialize; -use serde_json::Value; use std::time::{SystemTime, UNIX_EPOCH}; /// Date-time utilities. From 3c2e71acddc9bf9dbff8bd2087d19eb4104b8a00 Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Thu, 23 Oct 2025 15:02:14 +0530 Subject: [PATCH 29/95] fix for TxnOfferDetails Parse error (#167) --- src/types/txn_offer_detail.rs | 43 +++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/src/types/txn_offer_detail.rs b/src/types/txn_offer_detail.rs index e03a6552..6f3504b9 100644 --- a/src/types/txn_offer_detail.rs +++ b/src/types/txn_offer_detail.rs @@ -1,17 +1,39 @@ use serde::{Deserialize, Serialize}; use std::option::Option; use std::string::String; -use std::time::SystemTime; -use time::PrimitiveDateTime; +use time::{OffsetDateTime, PrimitiveDateTime}; // use chrono::NaiveDateTime; // use data::text::Text; // use juspay::extra::nonemptytext::NonEmptyText; -use crate::types::txn_details::types::TxnDetailId; +use crate::types::txn_details::types::{deserialize_optional_primitive_datetime, TxnDetailId}; +use serde::{de, ser}; -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct TxnOfferDetailId { - #[serde(rename = "txnOfferDetailId")] - pub txnOfferDetailId: String, +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct TxnOfferDetailId(String); + +impl TxnOfferDetailId { + pub fn new(s: String) -> Result { + Ok(TxnOfferDetailId(s)) + } +} + +impl<'de> Deserialize<'de> for TxnOfferDetailId { + fn deserialize(deserializer: D) -> Result + where + D: de::Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + TxnOfferDetailId::new(s).map_err(de::Error::custom) + } +} + +impl Serialize for TxnOfferDetailId { + fn serialize(&self, serializer: S) -> Result + where + S: ser::Serializer, + { + serializer.serialize_str(&self.0) + } } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -25,14 +47,17 @@ pub struct TxnOfferDetail { #[serde(rename = "status")] pub status: TxnOfferDetailStatus, #[serde(rename = "dateCreated")] - pub dateCreated: Option, + #[serde(with = "time::serde::iso8601::option")] + pub dateCreated: Option, #[serde(rename = "lastUpdated")] - pub lastUpdated: Option, + #[serde(with = "time::serde::iso8601::option")] + pub lastUpdated: Option, #[serde(rename = "gatewayInfo")] pub gatewayInfo: Option, #[serde(rename = "internalMetadata")] pub internalMetadata: Option, #[serde(rename = "partitionKey")] + #[serde(deserialize_with = "deserialize_optional_primitive_datetime")] pub partitionKey: Option, } From 112ab712a2859a7d79cfa78ebbe4067861af7a52 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Fri, 24 Oct 2025 18:25:11 +0530 Subject: [PATCH 30/95] fix: elimination error status (#168) --- src/routes/rule_configuration.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/routes/rule_configuration.rs b/src/routes/rule_configuration.rs index c1c783ff..a8061428 100644 --- a/src/routes/rule_configuration.rs +++ b/src/routes/rule_configuration.rs @@ -232,7 +232,7 @@ pub async fn get_rule_config( serde_json::from_str::< types::gateway_routing_input::GatewaySuccessRateBasedRoutingInput, >(&account.gatewaySuccessRateBasedDeciderInput) - .map_err(|_| error::RuleConfigurationError::DeserializationError) + .map_err(|_| error::RuleConfigurationError::ConfigurationNotFound) .map(|config| types::routing_configuration::EliminationData { threshold: config.defaultEliminationThreshold, txnLatency: config.txnLatency, @@ -426,7 +426,7 @@ pub async fn delete_rule_config( logger::debug!("Received rule delete request: {:?}", payload); let mid = payload.merchant_id.clone(); - ETM::merchant_account::load_merchant_by_merchant_id(mid.clone()) + let merchant_account = ETM::merchant_account::load_merchant_by_merchant_id(mid.clone()) .await .ok_or(error::RuleConfigurationError::MerchantNotFound)?; @@ -457,6 +457,16 @@ pub async fn delete_rule_config( } } types::routing_configuration::AlgorithmType::Elimination => { + if merchant_account + .gatewaySuccessRateBasedDeciderInput + .is_empty() + { + API_REQUEST_COUNTER + .with_label_values(&["elimination_delete_rule_config", "failure"]) + .inc(); + return Err(error::RuleConfigurationError::ConfigurationNotFound.into()); + } + let result = types::merchant::merchant_account::update_merchant_account( mid.clone(), Some("".to_string()), From efa175dfb532976a11b9f1a537ab3abe5a8d141e Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Fri, 24 Oct 2025 21:18:43 +0530 Subject: [PATCH 31/95] fix: crud error status (#169) --- src/routes/rule_configuration.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/rule_configuration.rs b/src/routes/rule_configuration.rs index a8061428..3f8dbe69 100644 --- a/src/routes/rule_configuration.rs +++ b/src/routes/rule_configuration.rs @@ -328,7 +328,7 @@ pub async fn update_rule_config( let result = types::service_configuration::update_config(name, Some(serialized_config)) .await - .change_context(error::RuleConfigurationError::StorageError); + .change_context(error::RuleConfigurationError::ConfigurationNotFound); match result { Ok(_) => { @@ -359,7 +359,7 @@ pub async fn update_rule_config( Some(serialized_config), ) .await - .change_context(error::RuleConfigurationError::StorageError); + .change_context(error::RuleConfigurationError::ConfigurationNotFound); match result { Ok(_) => { @@ -387,7 +387,7 @@ pub async fn update_rule_config( let result = types::service_configuration::update_config(name, Some(serialized_config)) .await - .change_context(error::RuleConfigurationError::StorageError); + .change_context(error::RuleConfigurationError::ConfigurationNotFound); match result { Ok(_) => { @@ -436,7 +436,7 @@ pub async fn delete_rule_config( let config_name = format!("SR_V3_INPUT_CONFIG_{}", mid); let result = types::service_configuration::delete_config(config_name) .await - .change_context(error::RuleConfigurationError::StorageError); + .change_context(error::RuleConfigurationError::ConfigurationNotFound); match result { Ok(_) => { @@ -496,7 +496,7 @@ pub async fn delete_rule_config( let config_name = format!("DEBIT_ROUTING_CONFIG_{}", mid); let result = types::service_configuration::delete_config(config_name) .await - .change_context(error::RuleConfigurationError::StorageError); + .change_context(error::RuleConfigurationError::ConfigurationNotFound); match result { Ok(_) => { From 11db0e687a30d72b2a30b44a7e82f0b908eb3f9d Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Mon, 27 Oct 2025 13:17:48 +0530 Subject: [PATCH 32/95] fix: update open-router image version (#170) --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index cbf64535..3410d43a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,6 +1,6 @@ services: open-router: - image: ghcr.io/juspay/decision-engine:v1.2.0 + image: ghcr.io/juspay/decision-engine:v1.2.1 pull_policy: always platform: linux/amd64 container_name: open-router From c3f370b14fc0f10d22d8808d8701ec9d4a65c4b5 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Mon, 3 Nov 2025 16:21:11 +0530 Subject: [PATCH 33/95] refactor: rename functions to snake_case (#171) --- src/decider/gatewaydecider/flow_new.rs | 29 ++++++++++------- src/decider/gatewaydecider/flows.rs | 31 +++++++++++-------- src/decider/gatewaydecider/gw_filter.rs | 6 ++-- src/decider/gatewaydecider/gw_filter_new.rs | 6 ++-- src/decider/gatewaydecider/validators.rs | 26 ++++++++-------- .../storage/utils/gateway_bank_emi_support.rs | 16 +++++----- .../storage/utils/gateway_card_info.rs | 2 +- src/routes/decide_gateway.rs | 4 +-- src/routes/decision_gateway.rs | 4 +-- src/types/gateway_bank_emi_support.rs | 8 ++--- src/types/gateway_bank_emi_support_v2.rs | 6 ++-- src/types/order_metadata_v2.rs | 2 +- 12 files changed, 75 insertions(+), 65 deletions(-) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 571254e1..f0a58a3f 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -25,7 +25,7 @@ use crate::types::card::txn_card_info::TxnCardInfo; use crate::types::merchant as ETM; use crate::types::merchant::merchant_gateway_account::MerchantGatewayAccount; -pub async fn deciderFullPayloadHSFunction( +pub async fn decider_full_payload_hs_function( dreq_: T::DomainDeciderRequestForApiCallV2, ) -> Result { let merchant_account = @@ -46,7 +46,7 @@ pub async fn deciderFullPayloadHSFunction( priority_logic_output: None, is_dynamic_mga_enabled: false, })?; - let enforced_gateway_filter = handleEnforcedGateway(dreq_.clone().eligibleGatewayList); + let enforced_gateway_filter = handle_enforced_gateway(dreq_.clone().eligibleGatewayList); // check if type formation is correct let merchant_prefs = ETM::merchant_iframe_preferences::MerchantIframePreferences { @@ -110,7 +110,7 @@ pub async fn deciderFullPayloadHSFunction( network_decider::debit_routing::perform_debit_routing(dreq_).await } else { logger::debug!("Performing gateway routing"); - runDeciderFlow( + run_decider_flow( decider_params, dreq_.clone().rankingAlgorithm, dreq_.clone().eliminationEnabled, @@ -120,7 +120,7 @@ pub async fn deciderFullPayloadHSFunction( } } -fn handleEnforcedGateway(gateway_list: Option>) -> Option> { +fn handle_enforced_gateway(gateway_list: Option>) -> Option> { match gateway_list { None => None, Some(list) if list.is_empty() => None, @@ -128,7 +128,7 @@ fn handleEnforcedGateway(gateway_list: Option>) -> Option, eliminationEnabled: Option, @@ -277,8 +277,10 @@ pub async fn runDeciderFlow( } }; - let gatewayPriorityList = - addPreferredGatewaysToPriorityList(gwPLogic.gws.clone(), preferredGateway.clone()); + let gatewayPriorityList = add_preferred_gateways_to_priority_list( + gwPLogic.gws.clone(), + preferredGateway.clone(), + ); logger::info!( tag = "gatewayPriorityList", action = "gatewayPriorityList", @@ -294,7 +296,7 @@ pub async fn runDeciderFlow( "Enforcing Priority Logic for {:?}", deciderParams.dpTxnDetail.txnId ); - let (res, priorityLogicOutput) = filterFunctionalGatewaysWithEnforcment( + let (res, priorityLogicOutput) = filter_functional_gateways_with_enforcement( &mut decider_flow, &functionalGateways, &gatewayPriorityList, @@ -549,7 +551,10 @@ pub async fn runDeciderFlow( } #[allow(dead_code)] -fn getGatewayToMGAIdMapF(allMgas: &Vec, gateways: &Vec) -> AValue { +fn get_gateway_to_mga_id_map_f( + allMgas: &Vec, + gateways: &Vec, +) -> AValue { json!(gateways .iter() .map(|x| { @@ -564,7 +569,7 @@ fn getGatewayToMGAIdMapF(allMgas: &Vec, gateways: &Vec>()) } -fn addPreferredGatewaysToPriorityList( +fn add_preferred_gateways_to_priority_list( gwPriority: Vec, preferredGateway: Option, ) -> Vec { @@ -579,7 +584,7 @@ fn addPreferredGatewaysToPriorityList( } } -async fn filterFunctionalGatewaysWithEnforcment( +async fn filter_functional_gateways_with_enforcement( decider_flow: &mut T::DeciderFlow<'_>, fGws: &[String], priorityGws: &[String], @@ -607,7 +612,7 @@ async fn filterFunctionalGatewaysWithEnforcment( ) .await; let fallBackGwPriority = - addPreferredGatewaysToPriorityList(updatedPlOp.gws.clone(), preferredGw); + add_preferred_gateways_to_priority_list(updatedPlOp.gws.clone(), preferredGw); if updatedPlOp.isEnforcement { let updatedEnforcedGateways = fGws .iter() diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 231f98db..996945d3 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -125,7 +125,7 @@ pub trait ResponseDecider { type ErrorResponse: IntoResponse; } -pub async fn deciderFullPayloadHSFunction( +pub async fn decider_full_payload_hs_function( dreq: T::DomainDeciderRequest, ) -> Result<(T::DecidedGateway, Vec<(String, Vec)>), T::ErrorResponse> { let merchant_prefs = match ETM::merchant_iframe_preferences::getMerchantIPrefsByMId( @@ -160,7 +160,7 @@ pub async fn deciderFullPayloadHSFunction( })? } }; - let enforced_gateway_filter = handleEnforcedGateway(dreq.enforceGatewayList); + let enforced_gateway_filter = handle_enforced_gateway(dreq.enforceGatewayList); let resolve_bin = match Utils::fetch_extended_card_bin(&dreq.txnCardInfo.clone()) { Some(card_bin) => Some(card_bin), None => match dreq.txnCardInfo.card_isin { @@ -200,10 +200,10 @@ pub async fn deciderFullPayloadHSFunction( dpEDCCApplied: dreq.isEdccApplied, dpShouldConsumeResult: dreq.shouldConsumeResult, }; - runDeciderFlow(decider_params, true).await + run_decider_flow(decider_params, true).await } -fn handleEnforcedGateway(gateway_list: Option>) -> Option> { +fn handle_enforced_gateway(gateway_list: Option>) -> Option> { match gateway_list { None => None, Some(list) if list.is_empty() => None, @@ -310,7 +310,7 @@ fn handleEnforcedGateway(gateway_list: Option>) -> Option Result<(T::DecidedGateway, Vec<(String, Vec)>), T::ErrorResponse> { @@ -347,7 +347,7 @@ pub async fn runDeciderFlow( .gateway .clone() .or(deciderParams.dpOrder.preferredGateway.clone()); - let gatewayMgaIdMap = getGatewayToMGAIdMapF(&allMgas, &functionalGateways); + let gatewayMgaIdMap = get_gateway_to_mga_id_map_f(&allMgas, &functionalGateways); logger::warn!( action = "PreferredGateway", @@ -451,8 +451,10 @@ pub async fn runDeciderFlow( } }; - let gatewayPriorityList = - addPreferredGatewaysToPriorityList(gwPLogic.gws.clone(), preferredGateway.clone()); + let gatewayPriorityList = add_preferred_gateways_to_priority_list( + gwPLogic.gws.clone(), + preferredGateway.clone(), + ); logger::info!( tag = "gatewayPriorityList", action = "gatewayPriorityList", @@ -468,7 +470,7 @@ pub async fn runDeciderFlow( "Enforcing Priority Logic for {:?}", deciderParams.dpTxnDetail.txnId ); - let (res, priorityLogicOutput) = filterFunctionalGatewaysWithEnforcment( + let (res, priorityLogicOutput) = filter_functional_gateways_with_enforcement( &mut decider_flow, &functionalGateways, &gatewayPriorityList, @@ -740,7 +742,10 @@ pub async fn runDeciderFlow( } } -fn getGatewayToMGAIdMapF(allMgas: &Vec, gateways: &Vec) -> AValue { +fn get_gateway_to_mga_id_map_f( + allMgas: &Vec, + gateways: &Vec, +) -> AValue { json!(gateways .iter() .map(|x| { @@ -755,7 +760,7 @@ fn getGatewayToMGAIdMapF(allMgas: &Vec, gateways: &Vec>()) } -fn addPreferredGatewaysToPriorityList( +fn add_preferred_gateways_to_priority_list( gwPriority: Vec, preferredGatewayM: Option, ) -> Vec { @@ -770,7 +775,7 @@ fn addPreferredGatewaysToPriorityList( } } -async fn filterFunctionalGatewaysWithEnforcment( +async fn filter_functional_gateways_with_enforcement( decider_flow: &mut T::DeciderFlow<'_>, fGws: &[String], priorityGws: &[String], @@ -798,7 +803,7 @@ async fn filterFunctionalGatewaysWithEnforcment( ) .await; let fallBackGwPriority = - addPreferredGatewaysToPriorityList(updatedPlOp.gws.clone(), preferredGw); + add_preferred_gateways_to_priority_list(updatedPlOp.gws.clone(), preferredGw); if updatedPlOp.isEnforcement { let updatedEnforcedGateways = fGws .iter() diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index 05b63a79..7eeede3a 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -1830,7 +1830,7 @@ pub async fn filterGatewaysCardInfo( .collect(); let merchant_wise_eligible_gateway_card_info = if !enabled_gateways.is_empty() { - let supported_gci = ETGCIS::getSupportedGatewayCardInfoForBins( + let supported_gci = ETGCIS::get_supported_gateway_card_info_for_bins( &appState, merchant_account, card_bins.clone(), @@ -2242,7 +2242,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { ) .await; if gbes_v2_flag { - let gbes_v2_list_ = SGBES::getGatewayBankEmiSupportV2( + let gbes_v2_list_ = SGBES::get_gateway_bank_emi_support_v2( txn_detail.emiBank.clone(), gws.clone(), scope_.to_string(), @@ -2302,7 +2302,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { extractGatewaysV2(gbes_v2_filtered) } else { - let gbes_list_ = SGBES::getGatewayBankEmiSupport( + let gbes_list_ = SGBES::get_gateway_bank_emi_support( txn_detail.emiBank.clone(), gws.clone(), scope_.to_string(), diff --git a/src/decider/gatewaydecider/gw_filter_new.rs b/src/decider/gatewaydecider/gw_filter_new.rs index 440976d1..832e2231 100644 --- a/src/decider/gatewaydecider/gw_filter_new.rs +++ b/src/decider/gatewaydecider/gw_filter_new.rs @@ -576,7 +576,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { let gbes_v2_flag = isFeatureEnabled(C::gbesV2Enabled.get_key(), merchant_acc.merchantId.merchantId, "kv_redis".to_string()).await; if gbes_v2_flag { - let gbes_v2s = SGBES::getGatewayBankEmiSupportV2( + let gbes_v2s = SGBES::get_gateway_bank_emi_support_v2( txn_detail.emiBank, gws, scope.to_string(), @@ -595,7 +595,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { } extractGatewaysV2(gbes_v2s) } else { - extractGateways(SGBES::getGatewayBankEmiSupport( + extractGateways(SGBES::get_gateway_bank_emi_support( txn_detail.emiBank, gws, scope.to_string() @@ -1919,7 +1919,7 @@ pub async fn filterGatewaysCardInfo( .collect(); let merchant_wise_eligible_gateway_card_info = if !merchant_wise_mandate_supported_gateway.is_empty() { - ETGCIS::getSupportedGatewayCardInfoForBins(&appState, merchant_account, card_bins.clone()) + ETGCIS::get_supported_gateway_card_info_for_bins(&appState, merchant_account, card_bins.clone()) .await.into_iter() .filter(|ci| { ci.gateway.is_some() && merchant_wise_mandate_supported_gateway_prime.contains(&ci.gateway) diff --git a/src/decider/gatewaydecider/validators.rs b/src/decider/gatewaydecider/validators.rs index 32352f64..902deaba 100644 --- a/src/decider/gatewaydecider/validators.rs +++ b/src/decider/gatewaydecider/validators.rs @@ -51,8 +51,8 @@ use std::string::String; use std::vec::Vec; // pub fn parseFromApiOrderReference(apiType: T::ApiOrderReference) -> Option{ -pub fn parseFromApiOrderReference(apiType: T::ApiOrderReference) -> Option { - let udfs = parseUDFs(&apiType)?; +pub fn parse_from_api_order_reference(apiType: T::ApiOrderReference) -> Option { + let udfs = parse_udfs(&apiType)?; Some(ETO::Order { id: apiType @@ -115,7 +115,7 @@ impl FromIterator<(i32, String)> for UDFs { } } -fn parseUDFs(apiType: &T::ApiOrderReference) -> Option { +fn parse_udfs(apiType: &T::ApiOrderReference) -> Option { Some(UDFs::from_iter( udfLine(apiType) .into_iter() @@ -181,7 +181,7 @@ fn convert_metadata_to_string(metadata: Option>) -> Opti }) } -pub fn parseFromApiOrderMetadataV2( +pub fn parse_from_api_order_metadata_v2( apiType: T::ApiOrderMetadataV2, ) -> Option { Some(ETOMV2::OrderMetadataV2 { @@ -198,7 +198,7 @@ pub fn parseFromApiOrderMetadataV2( }) } -pub fn parseFromApiTxnDetail(apiType: T::ApiTxnDetail) -> Option { +pub fn parse_from_api_txn_detail(apiType: T::ApiTxnDetail) -> Option { Some(ETTD::TxnDetail { id: apiType .id @@ -250,7 +250,7 @@ pub fn parseFromApiTxnDetail(apiType: T::ApiTxnDetail) -> Option Option { +pub fn parse_from_api_txn_card_info(apiType: T::ApiTxnCardInfo) -> Option { Some(ETCa::TxnCardInfo { id: apiType .id @@ -280,10 +280,10 @@ pub fn parseFromApiTxnCardInfo(apiType: T::ApiTxnCardInfo) -> Option Result { - match parseApiDeciderRequestO(apiType) { + match parse_api_decider_request_o(apiType) { Some(domainDeciderRequest) => Ok(domainDeciderRequest), None => Err(error::ApiError::ParsingError( "Failed to parse ApiDeciderRequest", @@ -291,14 +291,14 @@ pub fn parseApiDeciderRequest( } } -pub fn parseApiDeciderRequestO( +pub fn parse_api_decider_request_o( apiType: T::ApiDeciderRequest, ) -> Option { Some(T::DomainDeciderRequestForApiCall { - orderReference: parseFromApiOrderReference(apiType.orderReference)?, - orderMetadata: parseFromApiOrderMetadataV2(apiType.orderMetadata)?, - txnDetail: parseFromApiTxnDetail(apiType.txnDetail)?, - txnCardInfo: parseFromApiTxnCardInfo(apiType.txnCardInfo)?, + orderReference: parse_from_api_order_reference(apiType.orderReference)?, + orderMetadata: parse_from_api_order_metadata_v2(apiType.orderMetadata)?, + txnDetail: parse_from_api_txn_detail(apiType.txnDetail)?, + txnCardInfo: parse_from_api_txn_card_info(apiType.txnCardInfo)?, card_token: apiType.card_token, txn_type: apiType.txn_type, should_create_mandate: apiType.should_create_mandate, diff --git a/src/decider/storage/utils/gateway_bank_emi_support.rs b/src/decider/storage/utils/gateway_bank_emi_support.rs index a0b2a23e..e2d2a1db 100644 --- a/src/decider/storage/utils/gateway_bank_emi_support.rs +++ b/src/decider/storage/utils/gateway_bank_emi_support.rs @@ -9,7 +9,7 @@ use std::vec::Vec; // use data::list::is_suffix_of; // use data::text as T; -pub async fn getGatewayBankEmiSupport( +pub async fn get_gateway_bank_emi_support( emiBank: Option, gws: Vec, scope: String, @@ -19,9 +19,9 @@ pub async fn getGatewayBankEmiSupport( Some(_) if gws.is_empty() => vec![], Some(emiBank) => { if scope == "CARDLESS" { - ETGBES::getGatewayBankEmiSupport(emiBank, gws, "CARD".to_string()).await + ETGBES::get_gateway_bank_emi_support(emiBank, gws, "CARD".to_string()).await } else { - ETGBES::getGatewayBankEmiSupport(emiBank, gws, scope).await + ETGBES::get_gateway_bank_emi_support(emiBank, gws, scope).await } } } @@ -31,7 +31,7 @@ pub fn is_suffix_of(suffix: &str, str: &str) -> bool { str.ends_with(suffix) } -pub async fn getGatewayBankEmiSupportV2( +pub async fn get_gateway_bank_emi_support_v2( emiBank: Option, gws: Vec, scope: String, @@ -39,10 +39,10 @@ pub async fn getGatewayBankEmiSupportV2( ) -> Vec { match (emiBank, tenure) { (Some(emiBank), Some(tenure)) => { - let emiBankCodeList = EBC::findEmiBankCodeByEMIBank(&trimSuffix(&emiBank)).await; + let emiBankCodeList = EBC::findEmiBankCodeByEMIBank(&trim_suffix(&emiBank)).await; match (emiBankCodeList.as_slice(), scope.as_str()) { ([emiBankCode], "CARDLESS") => { - ETGBESV2::getGatewayBankEmiSupportV2( + ETGBESV2::get_gateway_bank_emi_support_v2( emiBankCode.juspay_bank_code_id, gws.clone(), scope, @@ -57,7 +57,7 @@ pub async fn getGatewayBankEmiSupportV2( } else { "CREDIT".to_string() }; - ETGBESV2::getGatewayBankEmiSupportV2( + ETGBESV2::get_gateway_bank_emi_support_v2( emiBankCode.juspay_bank_code_id, gws.clone(), scope, @@ -73,7 +73,7 @@ pub async fn getGatewayBankEmiSupportV2( } } -fn trimSuffix(str: &str) -> String { +fn trim_suffix(str: &str) -> String { if is_suffix_of("_CLEMI", str) { str[..str.len() - "_CLEMI".len()].to_string() } else if is_suffix_of("_CC", str) { diff --git a/src/decider/storage/utils/gateway_card_info.rs b/src/decider/storage/utils/gateway_card_info.rs index 02fbefb0..7dff37ae 100644 --- a/src/decider/storage/utils/gateway_card_info.rs +++ b/src/decider/storage/utils/gateway_card_info.rs @@ -33,7 +33,7 @@ use crate::{ logger, }; -pub async fn getSupportedGatewayCardInfoForBins( +pub async fn get_supported_gateway_card_info_for_bins( app_state: &crate::app::TenantAppState, input_merchant_account: MerchantAccount, card_bins: Vec>, diff --git a/src/routes/decide_gateway.rs b/src/routes/decide_gateway.rs index 8b79d23b..f963bf80 100644 --- a/src/routes/decide_gateway.rs +++ b/src/routes/decide_gateway.rs @@ -1,6 +1,6 @@ use crate::{ decider::gatewaydecider::{ - flow_new::deciderFullPayloadHSFunction, + flow_new::decider_full_payload_hs_function, types::{DecidedGateway, DomainDeciderRequestForApiCallV2, ErrorResponse, UnifiedError}, }, logger, metrics, @@ -77,7 +77,7 @@ pub async fn decide_gateway( let api_decider_request: Result = serde_json::from_slice(&body); let result = match api_decider_request { - Ok(payload) => match deciderFullPayloadHSFunction(payload).await { + Ok(payload) => match decider_full_payload_hs_function(payload).await { Ok(decided_gateway) => { metrics::API_REQUEST_COUNTER .with_label_values(&["decide_gateway", "success"]) diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index 6721ed75..31f6fb74 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -1,5 +1,5 @@ use crate::decider::gatewaydecider::{ - flows::deciderFullPayloadHSFunction, + flows::decider_full_payload_hs_function, types::{DecidedGateway, DomainDeciderRequest, ErrorResponse, UnifiedError}, }; use crate::logger; @@ -142,7 +142,7 @@ where jemalloc_ctl::epoch::advance().unwrap(); let allocated_before = jemalloc_ctl::stats::allocated::read().unwrap_or(0); - let result = deciderFullPayloadHSFunction(payload.clone()).await; + let result = decider_full_payload_hs_function(payload.clone()).await; jemalloc_ctl::epoch::advance().unwrap(); let allocated_after = jemalloc_ctl::stats::allocated::read().unwrap_or(0); diff --git a/src/types/gateway_bank_emi_support.rs b/src/types/gateway_bank_emi_support.rs index 21e7c9fb..b0d94a6e 100644 --- a/src/types/gateway_bank_emi_support.rs +++ b/src/types/gateway_bank_emi_support.rs @@ -63,7 +63,7 @@ impl TryFrom for GatewayBankEmiSupport { } } -pub async fn getGatewayBankEmiSupportDB( +pub async fn get_gateway_bank_emi_support_db( emi_bank: String, t_gws: Vec, scp: String, @@ -103,13 +103,13 @@ pub async fn getGatewayBankEmiSupportDB( query } -pub async fn getGatewayBankEmiSupport( +pub async fn get_gateway_bank_emi_support( emi_bank: String, gws: Vec, scp: String, ) -> Vec { // Call the DB function and handle results - match getGatewayBankEmiSupportDB(emi_bank, gws, scp).await { + match get_gateway_bank_emi_support_db(emi_bank, gws, scp).await { Ok(db_results) => db_results .into_iter() .filter_map(|db_record| GatewayBankEmiSupport::try_from(db_record).ok()) @@ -120,7 +120,7 @@ pub async fn getGatewayBankEmiSupport( // #TOD implement db calls -// pub async fn getGatewayBankEmiSupportDB( +// pub async fn get_gateway_bank_emi_support_db( // emi_bank: String, // gws: Vec, // scp: String, diff --git a/src/types/gateway_bank_emi_support_v2.rs b/src/types/gateway_bank_emi_support_v2.rs index 088f4b83..3e7570ff 100644 --- a/src/types/gateway_bank_emi_support_v2.rs +++ b/src/types/gateway_bank_emi_support_v2.rs @@ -59,7 +59,7 @@ impl TryFrom for GatewayBankEmiSupportV2 { } } -pub async fn getGatewayBankEmiSupportV2DB( +pub async fn get_gateway_bank_emi_support_v2_db( jbc_id: i64, gateway_strings: Vec, scp: String, @@ -86,7 +86,7 @@ pub async fn getGatewayBankEmiSupportV2DB( } // Domain-level function with error handling and conversion -pub async fn getGatewayBankEmiSupportV2( +pub async fn get_gateway_bank_emi_support_v2( jbc_id: i64, gws: Vec, scp: String, @@ -94,7 +94,7 @@ pub async fn getGatewayBankEmiSupportV2( ten: i32, ) -> Vec { // Call the DB function and handle results - match getGatewayBankEmiSupportV2DB(jbc_id, gws, scp, ct, ten).await { + match get_gateway_bank_emi_support_v2_db(jbc_id, gws, scp, ct, ten).await { Ok(db_results) => db_results .into_iter() .filter_map(|db_record| GatewayBankEmiSupportV2::try_from(db_record).ok()) diff --git a/src/types/order_metadata_v2.rs b/src/types/order_metadata_v2.rs index c58dc859..e62eea72 100644 --- a/src/types/order_metadata_v2.rs +++ b/src/types/order_metadata_v2.rs @@ -31,8 +31,8 @@ where } #[serde_as] -#[serde(rename_all = "camelCase")] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct OrderMetadataV2 { pub id: OrderMetadataV2PId, #[serde(with = "time::serde::iso8601")] From 2d889cbb9efcad37e54c49c8b5929739341f0651 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Mon, 3 Nov 2025 19:31:20 +0530 Subject: [PATCH 34/95] refactor: decide gateway structs (#172) --- src/decider/gatewaydecider/flow_new.rs | 32 ++-- src/decider/gatewaydecider/flows.rs | 14 +- src/decider/gatewaydecider/runner.rs | 77 ++++----- src/decider/gatewaydecider/types.rs | 169 ++++++++++--------- src/decider/gatewaydecider/utils.rs | 2 +- src/decider/network_decider/debit_routing.rs | 8 +- 6 files changed, 155 insertions(+), 147 deletions(-) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index f0a58a3f..da66ac7b 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -29,7 +29,7 @@ pub async fn decider_full_payload_hs_function( dreq_: T::DomainDeciderRequestForApiCallV2, ) -> Result { let merchant_account = - ETM::merchant_account::load_merchant_by_merchant_id(dreq_.merchantId.clone()) + ETM::merchant_account::load_merchant_by_merchant_id(dreq_.merchant_id.clone()) .await .ok_or(T::ErrorResponse { status: "Invalid Request".to_string(), @@ -46,7 +46,7 @@ pub async fn decider_full_payload_hs_function( priority_logic_output: None, is_dynamic_mga_enabled: false, })?; - let enforced_gateway_filter = handle_enforced_gateway(dreq_.clone().eligibleGatewayList); + let enforced_gateway_filter = handle_enforced_gateway(dreq_.clone().eligible_gateway_list); // check if type formation is correct let merchant_prefs = ETM::merchant_iframe_preferences::MerchantIframePreferences { @@ -105,15 +105,15 @@ pub async fn decider_full_payload_hs_function( dpShouldConsumeResult: dreq.shouldConsumeResult, }; - if dreq_.rankingAlgorithm == Some(RankingAlgorithm::NtwBasedRouting) { + if dreq_.ranking_algorithm == Some(RankingAlgorithm::NtwBasedRouting) { logger::debug!("Performing debit routing"); network_decider::debit_routing::perform_debit_routing(dreq_).await } else { logger::debug!("Performing gateway routing"); run_decider_flow( decider_params, - dreq_.clone().rankingAlgorithm, - dreq_.clone().eliminationEnabled, + dreq_.clone().ranking_algorithm, + dreq_.clone().elimination_enabled, false, ) .await @@ -269,11 +269,11 @@ pub async fn run_decider_flow( } else { T::GatewayPriorityLogicOutput { gws: functionalGateways.clone(), - isEnforcement: false, - priorityLogicTag: None, - primaryLogic: None, - gatewayReferenceIds: HashMap::new(), - fallbackLogic: None, + is_enforcement: false, + priority_logic_tag: None, + primary_logic: None, + gateway_reference_ids: HashMap::new(), + fallback_logic: None, } }; @@ -289,7 +289,7 @@ pub async fn run_decider_flow( gatewayPriorityList ); - let (mut functionalGateways, updatedPriorityLogicOutput) = if gwPLogic.isEnforcement { + let (mut functionalGateways, updatedPriorityLogicOutput) = if gwPLogic.is_enforcement { logger::info!( tag = "gatewayPriorityList", action = "Enforcing Priority Logic", @@ -384,7 +384,7 @@ pub async fn run_decider_flow( [] => Err(( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), - updatedPriorityLogicOutput.priorityLogicTag.clone(), + updatedPriorityLogicOutput.priority_logic_tag.clone(), T::GatewayDeciderApproach::None, Some(updatedPriorityLogicOutput), decider_flow.writer.is_dynamic_mga_enabled, @@ -469,7 +469,9 @@ pub async fn run_decider_flow( decided_gateway: decideGatewayOutput, gateway_priority_map: gatewayPriorityMap, filter_wise_gateways: None, - priority_logic_tag: updatedPriorityLogicOutput.priorityLogicTag.clone(), + priority_logic_tag: updatedPriorityLogicOutput + .priority_logic_tag + .clone(), routing_approach: finalDeciderApproach.clone(), gateway_before_evaluation: topGatewayBeforeSRDowntimeEvaluation.clone(), priority_logic_output: Some(updatedPriorityLogicOutput), @@ -488,7 +490,7 @@ pub async fn run_decider_flow( None => Err(( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), - updatedPriorityLogicOutput.priorityLogicTag.clone(), + updatedPriorityLogicOutput.priority_logic_tag.clone(), finalDeciderApproach.clone(), Some(updatedPriorityLogicOutput), decider_flow.writer.is_dynamic_mga_enabled, @@ -613,7 +615,7 @@ async fn filter_functional_gateways_with_enforcement( .await; let fallBackGwPriority = add_preferred_gateways_to_priority_list(updatedPlOp.gws.clone(), preferredGw); - if updatedPlOp.isEnforcement { + if updatedPlOp.is_enforcement { let updatedEnforcedGateways = fGws .iter() .filter(|&gw| fallBackGwPriority.contains(gw)) diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 996945d3..4506eafb 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -463,7 +463,7 @@ pub async fn run_decider_flow( gatewayPriorityList ); - let (mut functionalGateways, updatedPriorityLogicOutput) = if gwPLogic.isEnforcement { + let (mut functionalGateways, updatedPriorityLogicOutput) = if gwPLogic.is_enforcement { logger::info!( tag = "gatewayPriorityList", action = "Enforcing Priority Logic", @@ -558,7 +558,7 @@ pub async fn run_decider_flow( [] => Err(( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), - updatedPriorityLogicOutput.priorityLogicTag.clone(), + updatedPriorityLogicOutput.priority_logic_tag.clone(), T::GatewayDeciderApproach::None, Some(updatedPriorityLogicOutput), decider_flow.writer.is_dynamic_mga_enabled, @@ -644,7 +644,9 @@ pub async fn run_decider_flow( decided_gateway: decideGatewayOutput, gateway_priority_map: gatewayPriorityMap, filter_wise_gateways: None, - priority_logic_tag: updatedPriorityLogicOutput.priorityLogicTag.clone(), + priority_logic_tag: updatedPriorityLogicOutput + .priority_logic_tag + .clone(), routing_approach: finalDeciderApproach.clone(), gateway_before_evaluation: topGatewayBeforeSRDowntimeEvaluation.clone(), priority_logic_output: Some(updatedPriorityLogicOutput), @@ -665,7 +667,7 @@ pub async fn run_decider_flow( None => Err(( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), - updatedPriorityLogicOutput.priorityLogicTag.clone(), + updatedPriorityLogicOutput.priority_logic_tag.clone(), finalDeciderApproach.clone(), Some(updatedPriorityLogicOutput), decider_flow.writer.is_dynamic_mga_enabled, @@ -804,7 +806,7 @@ async fn filter_functional_gateways_with_enforcement( .await; let fallBackGwPriority = add_preferred_gateways_to_priority_list(updatedPlOp.gws.clone(), preferredGw); - if updatedPlOp.isEnforcement { + if updatedPlOp.is_enforcement { let updatedEnforcedGateways = fGws .iter() .filter(|&gw| fallBackGwPriority.contains(gw)) @@ -986,7 +988,7 @@ pub async fn getFailureReasonWithFilter( let reference_ids = Utils::get_all_ref_ids( decider_flow.writer.metadata.clone().unwrap_or_default(), priority_logic_output - .map(|logic| logic.gatewayReferenceIds.clone()) + .map(|logic| logic.gateway_reference_ids.clone()) .unwrap_or_default(), ) .await; diff --git a/src/decider/gatewaydecider/runner.rs b/src/decider/gatewaydecider/runner.rs index 20e079e8..8b12e5e7 100644 --- a/src/decider/gatewaydecider/runner.rs +++ b/src/decider/gatewaydecider/runner.rs @@ -573,12 +573,12 @@ pub async fn get_gateway_priority( logs ); DeciderTypes::GatewayPriorityLogicOutput { - isEnforcement: gws.isEnforcement, + is_enforcement: gws.is_enforcement, gws: gws.gws, - priorityLogicTag: gws.priorityLogicTag, - gatewayReferenceIds: gws.gatewayReferenceIds, - primaryLogic: Some(pl_data), - fallbackLogic: gws.fallbackLogic, + priority_logic_tag: gws.priority_logic_tag, + gateway_reference_ids: gws.gateway_reference_ids, + primary_logic: Some(pl_data), + fallback_logic: gws.fallback_logic, } } EvaluationResult::EvaluationError(priority_logic_data, err) => { @@ -603,12 +603,12 @@ pub async fn get_gateway_priority( logs ); DeciderTypes::GatewayPriorityLogicOutput { - isEnforcement: retry_gws.isEnforcement, + is_enforcement: retry_gws.is_enforcement, gws: retry_gws.gws, - priorityLogicTag: retry_gws.priorityLogicTag, - gatewayReferenceIds: retry_gws.gatewayReferenceIds, - primaryLogic: Some(retry_pl_data), - fallbackLogic: retry_gws.fallbackLogic, + priority_logic_tag: retry_gws.priority_logic_tag, + gateway_reference_ids: retry_gws.gateway_reference_ids, + primary_logic: Some(retry_pl_data), + fallback_logic: retry_gws.fallback_logic, } } EvaluationResult::EvaluationError(retry_pl_data, err) => { @@ -627,8 +627,8 @@ pub async fn get_gateway_priority( m_internal_meta, order_meta_data, default_gateway_priority_logic_output() - .setPriorityLogicTag(priority_logic_tag) - .setPrimaryLogic(Some(retry_pl_data)) + .set_priority_logic_tag(priority_logic_tag) + .set_primary_logic(Some(retry_pl_data)) .build(), priority_logic_data.failure_reason.clone(), ) @@ -646,8 +646,8 @@ pub async fn get_gateway_priority( m_internal_meta, order_meta_data, default_gateway_priority_logic_output() - .setPriorityLogicTag(priority_logic_tag) - .setPrimaryLogic(Some(priority_logic_data.clone())) + .set_priority_logic_tag(priority_logic_tag) + .set_primary_logic(Some(priority_logic_data.clone())) .build(), priority_logic_data.failure_reason.clone(), ) @@ -697,7 +697,7 @@ pub async fn get_gateway_priority( res ); default_gateway_priority_logic_output() - .setGws(res.to_vec()) + .set_gws(res.to_vec()) .build() } } @@ -719,12 +719,12 @@ async fn get_script( fn default_gateway_priority_logic_output() -> DeciderTypes::GatewayPriorityLogicOutput { DeciderTypes::GatewayPriorityLogicOutput { - isEnforcement: false, + is_enforcement: false, gws: vec![], - priorityLogicTag: None, - gatewayReferenceIds: std::collections::HashMap::new(), - primaryLogic: None, - fallbackLogic: None, + priority_logic_tag: None, + gateway_reference_ids: std::collections::HashMap::new(), + primary_logic: None, + fallback_logic: None, } } @@ -992,7 +992,8 @@ pub async fn handle_fallback_logic( primary_logic_output: DeciderTypes::GatewayPriorityLogicOutput, pl_failure_reason: DeciderTypes::PriorityLogicFailure, ) -> DeciderTypes::GatewayPriorityLogicOutput { - if primary_logic_output.fallbackLogic.is_none() && primary_logic_output.primaryLogic.is_some() { + if primary_logic_output.fallback_logic.is_none() && primary_logic_output.primary_logic.is_some() + { let (fallback_logic, fallback_pl_tag) = get_fallback_priority_logic_script(&macc).await; match fallback_logic { Some(fallback_script) => { @@ -1018,10 +1019,10 @@ pub async fn handle_fallback_logic( logs ); DeciderTypes::GatewayPriorityLogicOutput { - fallbackLogic: Some(pl_data), - priorityLogicTag: fallback_pl_tag, - primaryLogic: check_and_update_pl_failure_reason( - primary_logic_output.primaryLogic, + fallback_logic: Some(pl_data), + priority_logic_tag: fallback_pl_tag, + primary_logic: check_and_update_pl_failure_reason( + primary_logic_output.primary_logic, pl_failure_reason, ), ..primary_logic_output @@ -1035,20 +1036,20 @@ pub async fn handle_fallback_logic( err ); DeciderTypes::GatewayPriorityLogicOutput { - primaryLogic: check_and_update_pl_failure_reason( - primary_logic_output.primaryLogic, + primary_logic: check_and_update_pl_failure_reason( + primary_logic_output.primary_logic, pl_failure_reason, ), - fallbackLogic: Some(priority_logic_data), - priorityLogicTag: fallback_pl_tag, + fallback_logic: Some(priority_logic_data), + priority_logic_tag: fallback_pl_tag, ..primary_logic_output } } } } None => DeciderTypes::GatewayPriorityLogicOutput { - primaryLogic: check_and_update_pl_failure_reason( - primary_logic_output.primaryLogic, + primary_logic: check_and_update_pl_failure_reason( + primary_logic_output.primary_logic, pl_failure_reason, ), ..primary_logic_output @@ -1056,8 +1057,8 @@ pub async fn handle_fallback_logic( } } else { DeciderTypes::GatewayPriorityLogicOutput { - fallbackLogic: check_and_update_pl_failure_reason( - primary_logic_output.fallbackLogic, + fallback_logic: check_and_update_pl_failure_reason( + primary_logic_output.fallback_logic, pl_failure_reason, ), ..primary_logic_output @@ -1182,12 +1183,12 @@ async fn handle_success_response( failure_reason: DeciderTypes::PriorityLogicFailure::NoError, }; let pl_output = DeciderTypes::GatewayPriorityLogicOutput { - isEnforcement: response_body.result.isEnforcement.unwrap_or(false), + is_enforcement: response_body.result.isEnforcement.unwrap_or(false), gws, - priorityLogicTag: priority_logic_tag.clone(), - gatewayReferenceIds: response_body.result.gatewayReferenceIds.unwrap_or_default(), - primaryLogic: None, - fallbackLogic: None, + priority_logic_tag: priority_logic_tag.clone(), + gateway_reference_ids: response_body.result.gatewayReferenceIds.unwrap_or_default(), + primary_logic: None, + fallback_logic: None, }; EvaluationResult::PLResponse(pl_output, pl_data, log_entries, status) } diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 7e41b056..70427836 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -909,37 +909,39 @@ pub struct DomainDeciderRequest { // impl Given for DomainDeciderRequest {} #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct DomainDeciderRequestForApiCallV2 { - pub paymentInfo: PaymentInfo, - pub merchantId: String, - pub eligibleGatewayList: Option>, - pub rankingAlgorithm: Option, - pub eliminationEnabled: Option, + pub payment_info: PaymentInfo, + pub merchant_id: String, + pub eligible_gateway_list: Option>, + pub ranking_algorithm: Option, + pub elimination_enabled: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct PaymentInfo { - paymentId: String, + payment_id: String, pub amount: f64, currency: Currency, country: Option, - customerId: Option, + customer_id: Option, udfs: Option, - preferredGateway: Option, - paymentType: TxnObjectType, + preferred_gateway: Option, + payment_type: TxnObjectType, pub metadata: Option, - internalMetadata: Option, - isEmi: Option, - emiBank: Option, - emiTenure: Option, - paymentMethodType: String, - paymentMethod: String, - paymentSource: Option, - authType: Option, - cardIssuerBankName: Option, - pub cardIsin: Option, - cardType: Option, - cardSwitchProvider: Option>, + internal_metadata: Option, + is_emi: Option, + emi_bank: Option, + emi_tenure: Option, + payment_method_type: String, + payment_method: String, + payment_source: Option, + auth_type: Option, + card_issuer_bank_name: Option, + pub card_isin: Option, + card_type: Option, + card_switch_provider: Option>, } // write a function to transfer DomainDeciderRequestForApiCallV2 to DomainDeciderRequest @@ -949,64 +951,64 @@ impl DomainDeciderRequestForApiCallV2 { DomainDeciderRequest { orderReference: ETO::Order { id: ETO::id::to_order_prim_id(1), - amount: ETMo::Money::from_double(self.paymentInfo.amount), - currency: self.paymentInfo.currency.clone(), + amount: ETMo::Money::from_double(self.payment_info.amount), + currency: self.payment_info.currency.clone(), dateCreated: OffsetDateTime::now_utc(), - merchantId: ETM::id::to_merchant_id(self.merchantId.clone()), - orderId: ETO::id::to_order_id(self.paymentInfo.paymentId.clone()), + merchantId: ETM::id::to_merchant_id(self.merchant_id.clone()), + orderId: ETO::id::to_order_id(self.payment_info.payment_id.clone()), status: ETO::OrderStatus::Created, description: None, - customerId: self.paymentInfo.customerId.clone(), + customerId: self.payment_info.customer_id.clone(), udfs: self - .paymentInfo + .payment_info .udfs .clone() .unwrap_or(UDFs(HashMap::new())), - preferredGateway: self.paymentInfo.preferredGateway.clone(), + preferredGateway: self.payment_info.preferred_gateway.clone(), productId: None, orderType: ETO::OrderType::from_txn_object_type( - self.paymentInfo.paymentType.clone(), + self.payment_info.payment_type.clone(), ), - metadata: self.paymentInfo.metadata.clone(), - internalMetadata: self.paymentInfo.internalMetadata.clone(), + metadata: self.payment_info.metadata.clone(), + internalMetadata: self.payment_info.internal_metadata.clone(), }, shouldConsumeResult: None, orderMetadata: ETOMV2::OrderMetadataV2 { id: ETOMV2::to_order_metadata_v2_pid(1), date_created: OffsetDateTime::now_utc(), last_updated: OffsetDateTime::now_utc(), - metadata: self.paymentInfo.metadata.clone(), + metadata: self.payment_info.metadata.clone(), order_reference_id: 1, ip_address: None, partition_key: None, }, txnDetail: ETTD::TxnDetail { id: ETTD::to_txn_detail_id(1), - orderId: ETO::id::to_order_id(self.paymentInfo.paymentId.clone()), + orderId: ETO::id::to_order_id(self.payment_info.payment_id.clone()), status: ETTD::TxnStatus::Started, - txnId: ETId::to_transaction_id(self.paymentInfo.paymentId.clone()), + txnId: ETId::to_transaction_id(self.payment_info.payment_id.clone()), txnType: Some("NOT_DEFINED".to_string()), dateCreated: OffsetDateTime::now_utc(), addToLocker: Some(false), - merchantId: ETM::id::to_merchant_id(self.merchantId.clone()), + merchantId: ETM::id::to_merchant_id(self.merchant_id.clone()), gateway: None, expressCheckout: Some(false), - isEmi: Some(self.paymentInfo.isEmi.clone().unwrap_or(false)), - emiBank: self.paymentInfo.emiBank.clone(), - emiTenure: self.paymentInfo.emiTenure.clone(), - txnUuid: self.paymentInfo.paymentId.clone(), + isEmi: Some(self.payment_info.is_emi.clone().unwrap_or(false)), + emiBank: self.payment_info.emi_bank.clone(), + emiTenure: self.payment_info.emi_tenure.clone(), + txnUuid: self.payment_info.payment_id.clone(), merchantGatewayAccountId: None, - txnAmount: Some(ETMo::Money::from_double(self.paymentInfo.amount)), - txnObjectType: Some(self.paymentInfo.paymentType.clone()), - sourceObject: Some(self.paymentInfo.paymentMethod.clone()), + txnAmount: Some(ETMo::Money::from_double(self.payment_info.amount)), + txnObjectType: Some(self.payment_info.payment_type.clone()), + sourceObject: Some(self.payment_info.payment_method.clone()), sourceObjectId: None, - currency: self.paymentInfo.currency.clone(), - country: self.paymentInfo.country.clone(), - netAmount: Some(ETMo::Money::from_double(self.paymentInfo.amount)), + currency: self.payment_info.currency.clone(), + country: self.payment_info.country.clone(), + netAmount: Some(ETMo::Money::from_double(self.payment_info.amount)), surchargeAmount: None, taxAmount: None, - internalMetadata: self.paymentInfo.internalMetadata.clone().map(Secret::new), - metadata: self.paymentInfo.metadata.clone().map(Secret::new), + internalMetadata: self.payment_info.internal_metadata.clone().map(Secret::new), + metadata: self.payment_info.metadata.clone().map(Secret::new), offerDeductionAmount: None, internalTrackingInfo: None, partitionKey: None, @@ -1015,20 +1017,20 @@ impl DomainDeciderRequestForApiCallV2 { txnOfferDetails: None, txnCardInfo: ETCa::txn_card_info::TxnCardInfo { id: ETCa::txn_card_info::to_txn_card_info_pid(1), - card_isin: self.paymentInfo.cardIsin.clone(), - cardIssuerBankName: self.paymentInfo.cardIssuerBankName.clone(), - cardSwitchProvider: self.paymentInfo.cardSwitchProvider.clone(), - card_type: self.paymentInfo.cardType.clone(), + card_isin: self.payment_info.card_isin.clone(), + cardIssuerBankName: self.payment_info.card_issuer_bank_name.clone(), + cardSwitchProvider: self.payment_info.card_switch_provider.clone(), + card_type: self.payment_info.card_type.clone(), nameOnCard: None, dateCreated: OffsetDateTime::now_utc(), - paymentMethodType: self.paymentInfo.paymentMethodType.to_string(), - paymentMethod: self.paymentInfo.paymentMethod.clone(), - paymentSource: self.paymentInfo.paymentSource.clone(), - authType: self.paymentInfo.authType.clone(), + paymentMethodType: self.payment_info.payment_method_type.to_string(), + paymentMethod: self.payment_info.payment_method.clone(), + paymentSource: self.payment_info.payment_source.clone(), + authType: self.payment_info.auth_type.clone(), partitionKey: None, }, merchantAccount: ETM::merchant_account::load_merchant_by_merchant_id( - self.merchantId.clone(), + self.merchant_id.clone(), ) .await .expect("Merchant account not found"), @@ -1561,57 +1563,58 @@ pub struct ApiDeciderFullRequest { } #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct GatewayPriorityLogicOutput { - pub isEnforcement: bool, + pub is_enforcement: bool, pub gws: Vec, - pub priorityLogicTag: Option, - pub gatewayReferenceIds: HMap, - pub primaryLogic: Option, - pub fallbackLogic: Option, + pub priority_logic_tag: Option, + pub gateway_reference_ids: HMap, + pub primary_logic: Option, + pub fallback_logic: Option, } impl GatewayPriorityLogicOutput { pub fn new( - isEnforcement: bool, + is_enforcement: bool, gws: Vec, - priorityLogicTag: Option, - gatewayReferenceIds: HMap, - primaryLogic: Option, - fallbackLogic: Option, + priority_logic_tag: Option, + gateway_reference_ids: HMap, + primary_logic: Option, + fallback_logic: Option, ) -> Self { Self { - isEnforcement, + is_enforcement, gws, - priorityLogicTag, - gatewayReferenceIds, - primaryLogic, - fallbackLogic, + priority_logic_tag, + gateway_reference_ids, + primary_logic, + fallback_logic, } } - pub fn setIsEnforcement(&mut self, isEnforcement: bool) -> &mut Self { - self.isEnforcement = isEnforcement; + pub fn set_is_enforcement(&mut self, is_enforcement: bool) -> &mut Self { + self.is_enforcement = is_enforcement; self } - pub fn setPriorityLogicTag(&mut self, priorityLogicTag: Option) -> &mut Self { - self.priorityLogicTag = priorityLogicTag; + pub fn set_priority_logic_tag(&mut self, priorityLogicTag: Option) -> &mut Self { + self.priority_logic_tag = priorityLogicTag; self } - pub fn setPrimaryLogic(&mut self, primaryLogic: Option) -> &mut Self { - self.primaryLogic = primaryLogic; + pub fn set_primary_logic(&mut self, primaryLogic: Option) -> &mut Self { + self.primary_logic = primaryLogic; self } - pub fn setGws(&mut self, setGws: Vec) -> &mut Self { + pub fn set_gws(&mut self, setGws: Vec) -> &mut Self { self.gws = setGws; self } pub fn build(&self) -> Self { Self { - isEnforcement: self.isEnforcement, + is_enforcement: self.is_enforcement, gws: self.gws.clone(), - priorityLogicTag: self.priorityLogicTag.clone(), - gatewayReferenceIds: self.gatewayReferenceIds.clone(), - primaryLogic: self.primaryLogic.clone(), - fallbackLogic: self.fallbackLogic.clone(), + priority_logic_tag: self.priority_logic_tag.clone(), + gateway_reference_ids: self.gateway_reference_ids.clone(), + primary_logic: self.primary_logic.clone(), + fallback_logic: self.fallback_logic.clone(), } } } diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 2db6caf9..57fb6b47 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -170,7 +170,7 @@ pub fn get_pl_gw_ref_id_map(decider_flow: &DeciderFlow<'_>) -> HashMap Result { let app_state = get_tenant_app_state().await; - let card_isin_optional = decider_request.paymentInfo.cardIsin; - let amount = decider_request.paymentInfo.amount; + let card_isin_optional = decider_request.payment_info.card_isin; + let amount = decider_request.payment_info.amount; let first_connector_from_request = decider_request - .eligibleGatewayList + .eligible_gateway_list .as_ref() .and_then(|connector| connector.first().cloned()); if let Some(metadata_value) = decider_request - .paymentInfo + .payment_info .metadata .map(|metadata_string| gateway_decider_utils::parse_json_from_string(&metadata_string)) .flatten() From a7d2b228dc6232a5c03e875e165fad67cc92c168 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Wed, 5 Nov 2025 15:43:54 +0530 Subject: [PATCH 35/95] refactor: update_gateway_score structs (#173) --- src/decider/gatewaydecider/gw_filter.rs | 12 +- src/decider/gatewaydecider/gw_scoring.rs | 24 ++-- src/decider/gatewaydecider/utils.rs | 18 +-- src/feedback/constants.rs | 4 +- .../gateway_elimination_scoring/flow.rs | 10 +- src/feedback/gateway_scoring_service.rs | 124 ++++++++++-------- .../gateway_selection_scoring_v3/flow.rs | 6 +- src/feedback/types.rs | 11 +- src/feedback/utils.rs | 34 ++--- src/redis/feature.rs | 20 +-- src/routes/update_gateway_score.rs | 4 +- src/types/txn_details/types.rs | 2 +- 12 files changed, 139 insertions(+), 130 deletions(-) diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index 7eeede3a..fd80f93c 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -2,7 +2,7 @@ use crate::decider::gatewaydecider::types::*; use crate::decider::gatewaydecider::utils as Utils; use crate::decider::storage::utils::gateway_card_info as ETGCIS; use crate::merchant_config_util::isPaymentFlowEnabledWithHierarchyCheck; -use crate::redis::feature::{isFeatureEnabled, isFeatureEnabledByDimension}; +use crate::redis::feature::{is_feature_enabled, is_feature_enabled_by_dimension}; use crate::redis::types::ServiceConfigKey; use crate::types::bank_code::find_bank_code; use crate::types::card::card_type as ETCA; @@ -662,7 +662,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList .as_ref() .map(|provider| provider.peek().to_string()) .unwrap_or_else(|| "DEFAULT".to_string()); - let isMerchantEnabledForCvvLessV2Flow = isFeatureEnabled( + let isMerchantEnabledForCvvLessV2Flow = is_feature_enabled( C::CVV_LESS_V2_FLOW.get_key(), mAcc.merchantId.0, "kv_redis".to_string(), @@ -926,7 +926,7 @@ async fn check_cvv_less_support_rupay(txnCardInfo: &TxnCardInfo) -> bool { bCode, mCardType.unwrap_or_default().to_uppercase() ); - isFeatureEnabledByDimension(feature_key, dimension).await + is_feature_enabled_by_dimension(feature_key, dimension).await } else { false } @@ -2235,7 +2235,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { gws.clone() ); - let gbes_v2_flag = isFeatureEnabled( + let gbes_v2_flag = is_feature_enabled( C::GBES_V2_ENABLED.get_key(), merchant_acc.merchantId.0, "kv_redis".to_string(), @@ -2255,7 +2255,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { let mut gbesV2List = Vec::new(); for gbes in gbes_v2_list_.clone() { let is_enabled = if let Some(emi_bank) = emi_bank.clone() { - isFeatureEnabledByDimension( + is_feature_enabled_by_dimension( C::ALT_ID_ENABLED_GATEWAY_EMI_BANK.get_key(), format!("{}::{}", gbes.gateway, emi_bank), ) @@ -2314,7 +2314,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { let mut gbesList = Vec::new(); for gbes in gbes_list_.clone() { let is_enabled = if let Some(emi_bank) = emi_bank.clone() { - isFeatureEnabledByDimension( + is_feature_enabled_by_dimension( C::ALT_ID_ENABLED_GATEWAY_EMI_BANK.get_key(), format!("{}::{}", gbes.gateway, emi_bank), ) diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index e0b15095..966883e2 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -30,7 +30,7 @@ use rand_distr::{Beta, Binomial, Distribution}; use serde::{Deserialize, Serialize}; use time::{OffsetDateTime, PrimitiveDateTime}; // use crate::types::card_brand_routes as ETCBR; -use crate::redis::feature::{self as M, isFeatureEnabled}; +use crate::redis::feature::{self as M, is_feature_enabled}; use crate::types::gateway_routing_input as ETGRI; // use crate::types::gateway_health as ETGH; use crate::types::card as ETCT; @@ -226,7 +226,7 @@ pub async fn scoring_flow( || ranking_algorithm == Some(RankingAlgorithm::SrBasedRouting); let is_sr_v3_metric_enabled = if is_merchant_enabled_for_sr_based_routing { - let is_sr_v3_metric_enabled = isFeatureEnabled( + let is_sr_v3_metric_enabled = is_feature_enabled( C::enable_gateway_selection_based_on_sr_v3_input(pmt_str.clone()).get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -293,7 +293,7 @@ pub async fn scoring_flow( Utils::set_sr_v3_hedging_percent(decider_flow, hedging_percent); - let is_explore_and_exploit_enabled = isFeatureEnabled( + let is_explore_and_exploit_enabled = is_feature_enabled( C::enableExploreAndExploitOnSrV3(pmt_str).get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -352,7 +352,7 @@ pub async fn scoring_flow( ); } - let is_route_random_traffic_enabled = isFeatureEnabled( + let is_route_random_traffic_enabled = is_feature_enabled( C::ROUTE_RANDOM_TRAFFIC_SR_V3_ENABLED_MERCHANT.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -381,7 +381,7 @@ pub async fn scoring_flow( if sr_gw_score.len() > 1 && (!is_explore_and_exploit_enabled || should_explore) { - let is_debug_mode_enabled = isFeatureEnabled( + let is_debug_mode_enabled = is_feature_enabled( C::ENABLE_DEBUG_MODE_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -575,7 +575,7 @@ pub async fn get_cached_scores_based_on_srv3( ) .await; - let is_srv3_reset_enabled = M::isFeatureEnabled( + let is_srv3_reset_enabled = M::is_feature_enabled( C::EnableResetOnSrV3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -652,7 +652,7 @@ pub async fn get_cached_scores_based_on_srv3( score_map }; - let is_srv3_extra_score_enabled = M::isFeatureEnabled( + let is_srv3_extra_score_enabled = M::is_feature_enabled( C::ENABLE_EXTRA_SCORE_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -690,13 +690,13 @@ pub async fn get_cached_scores_based_on_srv3( updated_score_map_after_reset }; - let is_srv3_binomial_distribution_enabled = M::isFeatureEnabled( + let is_srv3_binomial_distribution_enabled = M::is_feature_enabled( C::ENABLE_BINOMIAL_DISTRIBUTION_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), ) .await; - let is_srv3_beta_distribution_enabled = M::isFeatureEnabled( + let is_srv3_beta_distribution_enabled = M::is_feature_enabled( C::ENABLE_BETA_DISTRIBUTION_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -1800,7 +1800,7 @@ pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( RService::findByNameFromRedis(C::SR_BASED_TXN_RESET_COUNT.get_key()) .await .unwrap_or(C::GW_DEFAULT_TXN_SOFT_RESET_COUNT); - let is_elimination_v2_enabled = isFeatureEnabled( + let is_elimination_v2_enabled = is_feature_enabled( C::EnableEliminationV2.get_key(), merchant_acc.merchantId.0.clone(), "kv_redis".to_string(), @@ -2374,7 +2374,7 @@ pub async fn update_gateway_score_based_on_success_rate( gateway_success_rate_merchant_input ); - let is_reset_score_enabled_for_merchant = isFeatureEnabled( + let is_reset_score_enabled_for_merchant = is_feature_enabled( C::GatewayResetScoreEnabled.get_key(), Utils::get_m_id(txn_detail.merchantId.clone()), "kv_redis".to_string(), @@ -2650,7 +2650,7 @@ pub async fn update_gateway_score_based_on_success_rate( if filtered_gateway_success_rate_inputs.len() > 1 && new_gateway_score.len() == filtered_gateway_success_rate_inputs.len() { - let optimization_during_downtime_enabled = isFeatureEnabled( + let optimization_during_downtime_enabled = is_feature_enabled( C::EnableOptimizationDuringDowntime.get_key(), Utils::get_m_id(txn_detail.merchantId.clone()), "kv_redis".to_string(), diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 57fb6b47..e2f61d9a 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -5,7 +5,7 @@ use crate::euclid::types::SrDimensionConfig; use crate::feedback::gateway_elimination_scoring::flow::{ eliminationV2RewardFactor, getPenaltyFactor, }; -use crate::redis::feature::isFeatureEnabled; +use crate::redis::feature::is_feature_enabled; use crate::redis::types::ServiceConfigKey; use crate::types::card::card_type::card_type_to_text; use crate::types::country::country_iso::CountryISO2; @@ -1917,7 +1917,7 @@ pub async fn get_gateway_scoring_data( txn_card_info: ETCa::txn_card_info::TxnCardInfo, merchant: ETM::merchant_account::MerchantAccount, ) -> GatewayScoringData { - let merchant_enabled_for_unification = isFeatureEnabled( + let merchant_enabled_for_unification = is_feature_enabled( C::MerchantsEnabledForScoreKeysUnification.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -1934,19 +1934,19 @@ pub async fn get_gateway_scoring_data( } else { txn_card_info.paymentMethod.clone() }; - let is_performing_experiment = isFeatureEnabled( + let is_performing_experiment = is_feature_enabled( C::MerchantEnabledForRoutingExperiment.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), ) .await; - let is_gri_enabled_for_elimination = isFeatureEnabled( + let is_gri_enabled_for_elimination = is_feature_enabled( C::GatewayReferenceIdEnabledMerchant.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), ) .await; - let is_gri_enabled_for_sr_routing = isFeatureEnabled( + let is_gri_enabled_for_sr_routing = is_feature_enabled( C::GwRefIdSelectionBasedEnabledMerchant.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -1973,7 +1973,7 @@ pub async fn get_gateway_scoring_data( ); let updated_gateway_scoring_data = match txn_card_info.paymentMethodType.as_str() { UPI => { - let handle_and_package_based_routing = isFeatureEnabled( + let handle_and_package_based_routing = is_feature_enabled( C::HandlePackageBasedRoutingCutover.get_key(), merchant_id.clone(), "kv_redis".to_string(), @@ -1993,13 +1993,13 @@ pub async fn get_gateway_scoring_data( default_gateway_scoring_data } CARD => { - let sr_evaluation_at_auth_level = isFeatureEnabled( + let sr_evaluation_at_auth_level = is_feature_enabled( C::EnableSelectionBasedAuthTypeEvaluation.get_key(), merchant_id.clone(), "kv_redis".to_string(), ) .await; - let sr_evaluation_at_bank_level = isFeatureEnabled( + let sr_evaluation_at_bank_level = is_feature_enabled( C::EnableSelectionBasedBankLevelEvaluation.get_key(), merchant_id.clone(), "kv_redis".to_string(), @@ -2849,7 +2849,7 @@ pub async fn get_penality_factor_(decider_flow: &mut DeciderFlow<'_>) -> f64 { let txn_detail = decider_flow.get().dpTxnDetail.clone(); let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); let merchant_id = get_m_id(merchant.merchantId); - let is_elimination_v2_enabled = isFeatureEnabled( + let is_elimination_v2_enabled = is_feature_enabled( C::EnableEliminationV2.get_key(), merchant_id.clone(), feedback::constants::kvRedis(), diff --git a/src/feedback/constants.rs b/src/feedback/constants.rs index ac349843..72ec772c 100644 --- a/src/feedback/constants.rs +++ b/src/feedback/constants.rs @@ -370,10 +370,10 @@ pub fn defaultMerchantArrMaxLength() -> i32 { 40 } -pub fn defaultUpdateGatewayScoreLockFlagTtl() -> i32 { +pub fn default_update_gateway_score_lock_flag_ttl() -> i32 { 300 } -pub fn defaultSrV3LatencyThresholdInSecs() -> f64 { +pub fn default_sr_v3_latency_threshold_in_secs() -> f64 { 300 as f64 } diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index a0685627..2792ccd8 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -51,7 +51,7 @@ use crate::logger; // use eulerhs::language::get_current_date_in_millis; // use eulerhs::language as EL; -use crate::redis::feature::isFeatureEnabled; +use crate::redis::feature::is_feature_enabled; use crate::types::merchant::id as Merchant; // use crate::types::txn_details::types::TxnDetail:: @@ -234,14 +234,14 @@ pub async fn updateKeyScoreForTxnStatus( current_key_score: f64, score_key_type: ScoreKeyType, ) -> f64 { - let is_elimination_v2_enabled = isFeatureEnabled( + let is_elimination_v2_enabled = is_feature_enabled( EnableEliminationV2.get_key(), merchant_id.clone(), C::kvRedis(), ) .await; let is_elimination_v2_enabled_for_outage = - isFeatureEnabled(EnableOutageV2.get_key(), merchant_id.clone(), C::kvRedis()).await; + is_feature_enabled(EnableOutageV2.get_key(), merchant_id.clone(), C::kvRedis()).await; let is_outage_key = isKeyOutage(score_key_type); logger::debug!( action = "updateKeyScore", @@ -562,7 +562,7 @@ pub async fn getAllUnifiedKeys( gateway_reference_id: Option, ) -> Vec<(ScoreKeyType, Option)> { let merchant_id = Merchant::merchant_id_to_text(txn_detail.merchantId.clone()); - let is_key_enabled_for_global_gateway_scoring = isFeatureEnabled( + let is_key_enabled_for_global_gateway_scoring = is_feature_enabled( C::GlobalGatewayScoringEnabledMerchants.get_key(), merchant_id.clone(), C::kvRedis(), @@ -580,7 +580,7 @@ pub async fn getAllUnifiedKeys( .ok(), ) .await; - let is_gateway_scoring_enabled_for_global_outage = isFeatureEnabled( + let is_gateway_scoring_enabled_for_global_outage = is_feature_enabled( C::GlobalOutageGatewayScoringEnabledMerchants.get_key(), merchant_id.clone(), C::kvRedis(), diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index 3935154c..551ff6e5 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -2,7 +2,7 @@ // Generated on 2025-03-23 10:24:42 use crate::redis::cache::findByNameFromRedis; -use crate::redis::feature::isFeatureEnabled; +use crate::redis::feature::is_feature_enabled; use masking::PeekInterface; // Converted imports // use gateway_decider::constants as c::{enable_elimination_v2, gateway_scoring_data, EnableExploreAndExploitOnSrv3, SrV3InputConfig, GatewayScoreFirstDimensionSoftTtl}; @@ -79,10 +79,10 @@ use crate::{ }; use super::constants::{ - defaultSrV3LatencyThresholdInSecs, SrV3InputConfig, UpdateGatewayScoreLockFlagTtl, + default_sr_v3_latency_threshold_in_secs, SrV3InputConfig, UpdateGatewayScoreLockFlagTtl, UpdateScoreLockFeatureEnabledMerchant, }; -use super::utils::getTimeFromTxnCreatedInMills; +use super::utils::get_time_from_txn_created_in_mills; use crate::logger; use crate::types::payment::payment_method_type_const::*; // Converted data types @@ -90,10 +90,10 @@ use crate::types::payment::payment_method_type_const::*; #[derive(Debug, Serialize, Deserialize, PartialEq)] pub struct GatewayLatencyForScoring { #[serde(rename = "defaultLatencyThreshold")] - pub defaultLatencyThreshold: f64, + pub default_latency_threshold: f64, #[serde(rename = "merchantLatencyGatewayWiseInput")] - pub merchantLatencyGatewayWiseInput: Option>, + pub merchant_latency_gateway_wise_input: Option>, } // Original Haskell data type: GatewayWiseLatencyInput @@ -205,17 +205,17 @@ pub struct ResetGatewayScoreBulkRequest { pub order_id: Option, #[serde(rename = "resetGatewayScoreReqArr")] - pub resetGatewayScoreReqArr: Vec, + pub reset_gateway_score_req_arr: Vec, } -pub fn defaultGwLatencyCheckInMins() -> GatewayLatencyForScoring { +pub fn default_gw_latency_check_in_mins() -> GatewayLatencyForScoring { GatewayLatencyForScoring { - defaultLatencyThreshold: 10.0, - merchantLatencyGatewayWiseInput: None, + default_latency_threshold: 10.0, + merchant_latency_gateway_wise_input: None, } } -pub fn txnSuccessStates() -> Vec { +pub fn txn_success_states() -> Vec { vec![ TS::Charged, TS::Authorized, @@ -231,7 +231,7 @@ pub fn txnSuccessStates() -> Vec { ] } -pub fn txnFailureStates() -> Vec { +pub fn txn_failure_states() -> Vec { vec![ TxnStatus::AuthenticationFailed, TxnStatus::AuthorizationFailed, @@ -240,7 +240,10 @@ pub fn txnFailureStates() -> Vec { ] } -pub async fn checkAndSendShouldUpdateGatewayScore(lock_key: String, lock_key_ttl: i32) -> bool { +pub async fn check_and_send_should_update_gateway_score( + lock_key: String, + lock_key_ttl: i32, +) -> bool { let app_state = get_tenant_app_state().await; let is_set_either = app_state .redis_conn @@ -258,12 +261,12 @@ pub async fn checkAndSendShouldUpdateGatewayScore(lock_key: String, lock_key_ttl } } -pub fn isTransactionSuccess(txn_status: TxnStatus) -> bool { - txnSuccessStates().contains(&txn_status) +pub fn is_transaction_success(txn_status: TxnStatus) -> bool { + txn_success_states().contains(&txn_status) } -pub fn isTransactionFailure(txn_status: TxnStatus) -> bool { - txnFailureStates().contains(&txn_status) +pub fn is_transaction_failure(txn_status: TxnStatus) -> bool { + txn_failure_states().contains(&txn_status) } pub fn isGwLatencyWithinConfiguredThreshold( @@ -284,7 +287,7 @@ pub fn isGwLatencyWithinConfiguredThreshold( } } -pub async fn getGatewayScoringType( +pub async fn get_gateway_scoring_type( txn_detail: TxnDetail, txn_card_info: TxnCardInfo, flag: bool, @@ -295,9 +298,9 @@ pub async fn getGatewayScoringType( let txn_status = txn_detail.status.clone(); let merchant_id = txn_detail.merchantId.clone(); - let is_success = isTransactionSuccess(txn_status.clone()); - let is_failure = isTransactionFailure(txn_status.clone()); - let time_difference = getTimeFromTxnCreatedInMills(txn_detail.clone()); + let is_success = is_transaction_success(txn_status.clone()); + let is_failure = is_transaction_failure(txn_status.clone()); + let time_difference = get_time_from_txn_created_in_mills(txn_detail.clone()); let merchant_sr_v3_input_config = findByNameFromRedis(SrV3InputConfig(get_m_id(merchant_id)).get_key()).await; let pmt = txn_card_info.paymentMethodType; @@ -336,7 +339,7 @@ pub async fn getGatewayScoringType( &pm, &sr_routing_dimesions, ); - maybe_default_latency_threshold.unwrap_or(defaultSrV3LatencyThresholdInSecs()) + maybe_default_latency_threshold.unwrap_or(default_sr_v3_latency_threshold_in_secs()) } Some(latency_threshold) => latency_threshold, }; @@ -360,7 +363,7 @@ pub async fn getGatewayScoringType( } } -pub fn updateGatewayScoreLock( +pub fn update_gateway_score_lock( gateway_scoring_type: GatewayScoringType, txn_uuid: String, gateway: String, @@ -398,12 +401,12 @@ pub fn invalid_request_error(detail: &str, e: &impl std::fmt::Display) -> T::Err } pub async fn check_and_update_gateway_score_( - apiPayload: FT::UpdateScorePayload, + api_payload: FT::UpdateScorePayload, ) -> Result { let redis_key = format!( "{}{}", C::GATEWAY_SCORING_DATA, - apiPayload.clone().paymentId + api_payload.clone().payment_id ); let app_state = get_tenant_app_state().await; @@ -419,8 +422,8 @@ pub async fn check_and_update_gateway_score_( match m_gateway_scoring_data { Ok(gateway_scoring_data) => { // Extract transaction details and card info from the API payload - let txn_detail: TxnDetail = match Fbu::getTxnDetailFromApiPayload( - apiPayload.clone(), + let txn_detail: TxnDetail = match Fbu::get_txn_detail_from_api_payload( + api_payload.clone(), gateway_scoring_data.clone(), ) { Ok(detail) => detail, @@ -428,11 +431,13 @@ pub async fn check_and_update_gateway_score_( return Err(invalid_request_error("transaction details", &e)); } }; - let txn_card_info: TxnCardInfo = - Fbu::getTxnCardInfoFromApiPayload(apiPayload.clone(), gateway_scoring_data.clone()); + let txn_card_info: TxnCardInfo = Fbu::get_txn_card_info_from_api_payload( + api_payload.clone(), + gateway_scoring_data.clone(), + ); let log_message = "update_gateway_score"; - let enforce_failure = apiPayload.enforceDynamicRoutingFailure.unwrap_or(false); + let enforce_failure = api_payload.enforce_dynamic_routing_failure.unwrap_or(false); // Call the function to check and update the gateway score check_and_update_gateway_score( @@ -440,8 +445,8 @@ pub async fn check_and_update_gateway_score_( txn_card_info, log_message, enforce_failure, - apiPayload.gatewayReferenceId.clone(), - apiPayload.txnLatency.clone(), + api_payload.gateway_reference_id.clone(), + api_payload.txn_latency.clone(), ) .await; @@ -481,12 +486,12 @@ pub async fn check_and_update_gateway_score( ) -> () { // Get gateway scoring type let gateway_scoring_type = - getGatewayScoringType(txn_detail.clone(), txn_card_info.clone(), enforce_failure).await; + get_gateway_scoring_type(txn_detail.clone(), txn_card_info.clone(), enforce_failure).await; let gateway_in_string = txn_detail.gateway.clone().unwrap_or_default(); // Create update score lock key - let update_score_lock_key = updateGatewayScoreLock( + let update_score_lock_key = update_gateway_score_lock( gateway_scoring_type.clone(), txn_detail.txnUuid.clone(), // This is Maybe type in haskell and here it is not Option gateway_in_string, // Convert Option to String @@ -497,10 +502,10 @@ pub async fn check_and_update_gateway_score( .unwrap_or(300); let should_compute_gw_score = - checkAndSendShouldUpdateGatewayScore(update_score_lock_key, lock_key_ttl).await; + check_and_send_should_update_gateway_score(update_score_lock_key, lock_key_ttl).await; // Check if feature is enabled for merchant - let feature_enabled = isFeatureEnabled( + let feature_enabled = is_feature_enabled( UpdateScoreLockFeatureEnabledMerchant.get_key(), get_m_id(txn_detail.merchantId.clone()), "kv_redis".to_string(), @@ -518,7 +523,7 @@ pub async fn check_and_update_gateway_score( txn_detail.status, gateway_scoring_type ); - updateGatewayScore( + update_gateway_score( gateway_scoring_type.clone(), txn_detail.clone(), txn_card_info.clone(), @@ -536,7 +541,7 @@ pub async fn check_and_update_gateway_score( txn_detail.status, gateway_scoring_type ); - updateGatewayScore( + update_gateway_score( gateway_scoring_type.clone(), txn_detail, txn_card_info.clone(), @@ -550,7 +555,7 @@ pub async fn check_and_update_gateway_score( } // Original Haskell function: updateGatewayScore -pub async fn updateGatewayScore( +pub async fn update_gateway_score( gateway_scoring_type: GatewayScoringType, txn_detail: TxnDetail, txn_card_info: TxnCardInfo, @@ -563,7 +568,7 @@ pub async fn updateGatewayScore( .expect("Merchant account not found"); //let mer_acc = - let routing_approach = getRoutingApproach(txn_detail.clone()); + let routing_approach = get_routing_approach(txn_detail.clone()); logger::info!( action = "routing_approach_value", tag = "routing_approach_value", @@ -574,7 +579,7 @@ pub async fn updateGatewayScore( let should_update_gateway_score = if gateway_scoring_type.clone() == GST::PenaliseSrv3 { false } else if gateway_scoring_type.clone() == GST::Penalise { - isTransactionPending(txn_detail.clone().status) + is_transaction_pending(txn_detail.clone().status) } else { true }; @@ -586,7 +591,7 @@ pub async fn updateGatewayScore( true }; - let is_update_within_window = isUpdateWithinLatencyWindow( + let is_update_within_window = is_update_within_latency_window( txn_detail.clone(), txn_card_info.clone(), gateway_scoring_type.clone(), @@ -595,14 +600,14 @@ pub async fn updateGatewayScore( ) .await; - let should_isolate_srv3_producer = if Cutover::isFeatureEnabled( + let should_isolate_srv3_producer = if Cutover::is_feature_enabled( C::SrV3ProducerIsolation.get_key(), MID::merchant_id_to_text(txn_detail.clone().merchantId), C::kvRedis(), ) .await { - if isRoutingApproachInSRV3(routing_approach.clone()) { + if is_routing_approach_in_srv3(routing_approach.clone()) { true } else { false @@ -611,7 +616,7 @@ pub async fn updateGatewayScore( true }; - let should_update_explore_txn = if Cutover::isFeatureEnabled( + let should_update_explore_txn = if Cutover::is_feature_enabled( DC::EnableExploreAndExploitOnSrv3(txn_card_info.clone().paymentMethodType.to_string()) .get_key(), MID::merchant_id_to_text(txn_detail.clone().merchantId), @@ -619,7 +624,7 @@ pub async fn updateGatewayScore( ) .await { - if isRoutingApproachInExplore(routing_approach.clone()) { + if is_routing_approach_in_explore(routing_approach.clone()) { true } else { false @@ -647,7 +652,7 @@ pub async fn updateGatewayScore( .get_key(&redis_key, "GatewayScoringData") .await .ok(); - GSSV3::flow::updateSrV3Score( + GSSV3::flow::update_sr_v3_score( gateway_scoring_type.clone(), txn_detail.clone(), txn_card_info.clone(), @@ -719,7 +724,7 @@ pub async fn updateGatewayScore( } } } - Fbu::logGatewayScoreType( + Fbu::log_gateway_score_type( gateway_scoring_type, RF::EliminationFlow, txn_detail.clone(), @@ -752,16 +757,18 @@ pub async fn updateGatewayScore( } // Original Haskell function: getRoutingApproach -pub fn getRoutingApproach(txnDetail: TxnDetail) -> Option { - let internalMeta: Option = getValueFromMetaData(&txnDetail); - match internalMeta { +pub fn get_routing_approach(txn_detail: TxnDetail) -> Option { + let internal_meta: Option = get_value_from_meta_data(&txn_detail); + match internal_meta { Some(meta) => Some(meta.internal_tracking_info.routing_approach), None => None, } } // Original Haskell function: getValueFromMetaData -pub fn getValueFromMetaData(txn_detail: &TxnDetail) -> Option { +pub fn get_value_from_meta_data( + txn_detail: &TxnDetail, +) -> Option { let metadata = txn_detail.internalMetadata.clone()?; serde_json::from_str(metadata.peek()).ok() } @@ -775,7 +782,7 @@ pub fn isRoutingApproachInSRV2(maybe_text: Option) -> bool { } // Original Haskell function: isRoutingApproachInSRV3 -pub fn isRoutingApproachInSRV3(maybe_text: Option) -> bool { +pub fn is_routing_approach_in_srv3(maybe_text: Option) -> bool { match maybe_text { Some(text) => text.contains("V3"), None => false, @@ -783,7 +790,7 @@ pub fn isRoutingApproachInSRV3(maybe_text: Option) -> bool { } // Original Haskell function: isRoutingApproachInExplore -pub fn isRoutingApproachInExplore(maybe_text: Option) -> bool { +pub fn is_routing_approach_in_explore(maybe_text: Option) -> bool { match maybe_text { Some(text) => text.contains("HEDGING"), None => false, @@ -791,7 +798,7 @@ pub fn isRoutingApproachInExplore(maybe_text: Option) -> bool { } // Original Haskell function: isUpdateWithinLatencyWindow -pub async fn isUpdateWithinLatencyWindow( +pub async fn is_update_within_latency_window( txn_detail: TxnDetail, txn_card_info: TxnCardInfo, gateway_scoring_type: GatewayScoringType, @@ -817,7 +824,7 @@ pub async fn isUpdateWithinLatencyWindow( .unwrap_or(C::defaultGatewayScoreLatencyCheckInMins()); /// check if the transaction latency calculated by orchestration is within the configured threshold let is_gw_latency_within_threshold = isGwLatencyWithinConfiguredThreshold( - txn_latency.and_then(|m| m.gatewayLatency), + txn_latency.and_then(|m| m.gateway_latency), GatewaySuccessRateBasedRoutingInput::from_str( &mer_acc.gatewaySuccessRateBasedDeciderInput, ) @@ -835,7 +842,8 @@ pub async fn isUpdateWithinLatencyWindow( txn_detail.sourceObject.clone().unwrap_or_default(), ); - let gw_score_update_latency = Fbu::getTimeFromTxnCreatedInMills(txn_detail.clone()); + let gw_score_update_latency = + Fbu::get_time_from_txn_created_in_mills(txn_detail.clone()); logger::info!( action = "gwLatencyCheckThreshold", tag = "gwLatencyCheckThreshold", @@ -862,6 +870,6 @@ async fn checkExemptIfMandateTxn(txn_detail: &TxnDetail, txn_card_info: &TxnCard } // Original Haskell function: isTransactionPending -pub fn isTransactionPending(txnStatus: TxnStatus) -> bool { - txnStatus == TS::PendingVBV || txnStatus == TS::Started +pub fn is_transaction_pending(txn_status: TxnStatus) -> bool { + txn_status == TS::PendingVBV || txn_status == TS::Started } diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index d3a8d2f0..bbf9da42 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -44,7 +44,7 @@ use crate::{ types::SrV3DebugBlock, utils::{ dateInIST, getCurrentIstDateWithFormat, getProducerKey, isKeyExistsRedis, - logGatewayScoreType, updateMovingWindow, updateScore, GatewayScoringType, + log_gateway_score_type, updateMovingWindow, updateScore, GatewayScoringType, }, }, redis::types::ServiceConfigKey, @@ -57,7 +57,7 @@ use masking::PeekInterface; // Converted functions // Original Haskell function: updateSrV3Score -pub async fn updateSrV3Score( +pub async fn update_sr_v3_score( gateway_scoring_type: GatewayScoringType, txn_detail: TxnDetail, txn_card_info: TxnCardInfo, @@ -122,7 +122,7 @@ pub async fn updateSrV3Score( .await; } } - logGatewayScoreType(gateway_scoring_type, RF::Srv3Flow, txn_detail); + log_gateway_score_type(gateway_scoring_type, RF::Srv3Flow, txn_detail); } } } diff --git a/src/feedback/types.rs b/src/feedback/types.rs index 39e09d1e..1dac2dea 100644 --- a/src/feedback/types.rs +++ b/src/feedback/types.rs @@ -233,14 +233,15 @@ pub enum TxnObjectType { } #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] pub struct UpdateScorePayload { - pub merchantId: String, + pub merchant_id: String, pub gateway: String, - pub gatewayReferenceId: Option, + pub gateway_reference_id: Option, pub status: TxnStatus, - pub paymentId: String, - pub enforceDynamicRoutingFailure: Option, - pub txnLatency: Option, + pub payment_id: String, + pub enforce_dynamic_routing_failure: Option, + pub txn_latency: Option, } #[derive(Debug, Serialize, Deserialize, Clone)] diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index e91e3a2e..b8f86799 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -157,25 +157,25 @@ pub fn convertSuccessResponseIdFlip(x: i32) -> ETTD::SuccessResponseId { ETTD::SuccessResponseId(x as i64) } -pub fn getTxnDetailFromApiPayload( - apiPayload: UpdateScorePayload, +pub fn get_txn_detail_from_api_payload( + api_payload: UpdateScorePayload, gateway_scoring_data: GatewayScoringData, ) -> Result { let txn_detail = ETTD::TxnDetail { id: ETTD::to_txn_detail_id(1), dateCreated: gateway_scoring_data.dateCreated, - orderId: ETO::id::to_order_id(apiPayload.paymentId.clone()), - status: apiPayload.status.clone(), - txnId: ETId::to_transaction_id(apiPayload.paymentId.clone()), + orderId: ETO::id::to_order_id(api_payload.payment_id.clone()), + status: api_payload.status.clone(), + txnId: ETId::to_transaction_id(api_payload.payment_id.clone()), txnType: Some("NOT_DEFINED".to_string()), addToLocker: Some(false), - merchantId: ETM::id::to_merchant_id(apiPayload.merchantId.clone()), - gateway: Some(apiPayload.gateway), + merchantId: ETM::id::to_merchant_id(api_payload.merchant_id.clone()), + gateway: Some(api_payload.gateway), expressCheckout: Some(false), isEmi: Some(false), emiBank: None, emiTenure: None, - txnUuid: apiPayload.paymentId.clone(), + txnUuid: api_payload.payment_id.clone(), merchantGatewayAccountId: None, txnAmount: Some(ETMo::Money::from_double(0.0)), txnObjectType: Some( @@ -209,11 +209,11 @@ pub fn getTxnDetailFromApiPayload( Ok(txn_detail) } -pub fn getTxnCardInfoFromApiPayload( - apiPayload: UpdateScorePayload, +pub fn get_txn_card_info_from_api_payload( + api_payload: UpdateScorePayload, gateway_scoring_data: GatewayScoringData, ) -> ETCa::txn_card_info::TxnCardInfo { - let txnCardInfo = ETCa::txn_card_info::TxnCardInfo { + let txn_card_info = ETCa::txn_card_info::TxnCardInfo { id: ETCa::txn_card_info::to_txn_card_info_pid(1), card_isin: None, cardIssuerBankName: None, @@ -232,7 +232,7 @@ pub fn getTxnCardInfoFromApiPayload( }), partitionKey: None, }; - txnCardInfo + txn_card_info } // Original Haskell function: convertMerchantIdFlip // pub fn convertMerchantIdFlip(s: &str) -> Option { @@ -666,7 +666,7 @@ pub async fn getProducerKey( } // Original Haskell function: logGatewayScoreType -pub fn logGatewayScoreType( +pub fn log_gateway_score_type( gateway_score_type: GatewayScoringType, routing_flow_type: RoutingFlowType, txn_detail: TxnDetail, @@ -916,10 +916,10 @@ pub fn isRecurringTxn(txn_object_type: Option) -> bool { // } // Original Haskell function: getTimeFromTxnCreatedInMills -pub fn getTimeFromTxnCreatedInMills(txn: TxnDetail) -> u128 { - let dateCreated = txn.dateCreated.unix_timestamp_nanos() as u128 / 1_000_000; - let currentTime = EU::get_current_date_in_millis(); - currentTime.saturating_sub(dateCreated) +pub fn get_time_from_txn_created_in_mills(txn: TxnDetail) -> u128 { + let date_created = txn.dateCreated.unix_timestamp_nanos() as u128 / 1_000_000; + let current_time = EU::get_current_date_in_millis(); + current_time.saturating_sub(date_created) } // Original Haskell function: dateToMilliSeconds diff --git a/src/redis/feature.rs b/src/redis/feature.rs index a7d526a6..d7a5e808 100644 --- a/src/redis/feature.rs +++ b/src/redis/feature.rs @@ -5,29 +5,29 @@ use rand::Rng; // Converted functions // Original Haskell function: isFeatureEnabled -pub async fn isFeatureEnabled(f_name: String, mid: String, redis_name: String) -> bool { - isFeatureEnabledWithMaybeDBConf(None, f_name, mid, redis_name).await +pub async fn is_feature_enabled(f_name: String, mid: String, redis_name: String) -> bool { + is_feature_enabled_with_maybe_db_conf(None, f_name, mid, redis_name).await } // Original Haskell function: isFeatureEnabledWithMaybeDBConf -pub async fn isFeatureEnabledWithMaybeDBConf( +pub async fn is_feature_enabled_with_maybe_db_conf( maybe_db_conf: Option, f_name: String, mid: String, _: String, ) -> bool { let maybe_conf = findByNameFromRedis::(f_name.clone()).await; - checkMerchantEnabled(maybe_conf, mid, f_name) + check_merchant_enabled(maybe_conf, mid, f_name) } // Original Haskell function: isFeatureEnabledByDimension -pub async fn isFeatureEnabledByDimension(f_name: String, dimension: String) -> bool { +pub async fn is_feature_enabled_by_dimension(f_name: String, dimension: String) -> bool { let maybe_conf = findByNameFromRedis::(f_name.clone()).await; - checkDimensionEnabled(maybe_conf, dimension, f_name) + check_dimension_enabled(maybe_conf, dimension, f_name) } // Original Haskell function: checkDimensionEnabled -pub fn checkDimensionEnabled( +pub fn check_dimension_enabled( dimension_conf: Option, dimension: String, key: String, @@ -54,12 +54,12 @@ pub fn checkDimensionEnabled( None => false, } }; - isDimensionConfigEnabled(conf, dimension, is_enabled, key) + is_dimension_config_enabled(conf, dimension, is_enabled, key) } } } -pub fn isDimensionConfigEnabled( +pub fn is_dimension_config_enabled( dimension_conf: DimensionConf, dimension: String, is_enabled: bool, @@ -80,7 +80,7 @@ pub fn isDimensionConfigEnabled( } // Original Haskell function: checkMerchantEnabled -pub fn checkMerchantEnabled(conf: Option, mid: String, key: String) -> bool { +pub fn check_merchant_enabled(conf: Option, mid: String, key: String) -> bool { match conf { None => false, Some(conf) => { diff --git a/src/routes/update_gateway_score.rs b/src/routes/update_gateway_score.rs index 214b4d43..97160b3b 100644 --- a/src/routes/update_gateway_score.rs +++ b/src/routes/update_gateway_score.rs @@ -75,9 +75,9 @@ pub async fn update_gateway_score( let update_score_request: Result = serde_json::from_slice(&body); match update_score_request { Ok(payload) => { - let merchant_id = payload.merchantId.clone(); + let merchant_id = payload.merchant_id.clone(); let gateway = payload.gateway.clone(); - let payment_id = payload.paymentId.clone(); + let payment_id = payload.payment_id.clone(); let result = check_and_update_gateway_score_(payload).await; match result { Ok(success) => { diff --git a/src/types/txn_details/types.rs b/src/types/txn_details/types.rs index f4db7327..62167ca5 100644 --- a/src/types/txn_details/types.rs +++ b/src/types/txn_details/types.rs @@ -732,5 +732,5 @@ pub enum ChargeName { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct TransactionLatency { #[serde(rename = "gatewayLatency")] - pub gatewayLatency: Option, + pub gateway_latency: Option, } From ce6b7f715c921861d3854c593bb76496ca1a7a0a Mon Sep 17 00:00:00 2001 From: spritianeja03 <146620839+spritianeja03@users.noreply.github.com> Date: Thu, 6 Nov 2025 12:52:50 +0530 Subject: [PATCH 36/95] refactor: add latency field to decide-gateway response (#175) --- src/decider/gatewaydecider/flow_new.rs | 13 +++++++++++-- src/decider/gatewaydecider/flows.rs | 2 ++ src/decider/gatewaydecider/types.rs | 1 + src/decider/network_decider/debit_routing.rs | 1 + src/routes/decide_gateway.rs | 4 +++- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index da66ac7b..ac80ecfa 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -3,6 +3,7 @@ use super::types::RankingAlgorithm; use super::types::UnifiedError; use crate::app::get_tenant_app_state; use crate::decider::network_decider; +use cpu_time::ProcessTime; use serde_json::json; use serde_json::Value as AValue; use std::collections::HashMap; @@ -27,6 +28,7 @@ use crate::types::merchant::merchant_gateway_account::MerchantGatewayAccount; pub async fn decider_full_payload_hs_function( dreq_: T::DomainDeciderRequestForApiCallV2, + cpu_start: ProcessTime, ) -> Result { let merchant_account = ETM::merchant_account::load_merchant_by_merchant_id(dreq_.merchant_id.clone()) @@ -115,6 +117,7 @@ pub async fn decider_full_payload_hs_function( dreq_.clone().ranking_algorithm, dreq_.clone().elimination_enabled, false, + cpu_start, ) .await } @@ -133,6 +136,7 @@ pub async fn run_decider_flow( rankingAlgorithm: Option, eliminationEnabled: Option, is_legacy_decider_flow: bool, + cpu_start: ProcessTime, ) -> Result { let txnCreationTime = deciderParams .dpTxnDetail @@ -195,6 +199,7 @@ pub async fn run_decider_flow( None, ) .await; + let cpu_time = cpu_start.elapsed().as_millis() as u64; Ok(T::DecidedGateway { decided_gateway: pgw.clone(), gateway_priority_map: Some(json!(HashMap::from([(pgw.to_string(), 1.0)]))), @@ -211,6 +216,7 @@ pub async fn run_decider_flow( gateway_mga_id_map: None, debit_routing_output: None, is_rust_based_decider: true, + latency: Some(cpu_time), }) } else { decider_flow @@ -465,7 +471,9 @@ pub async fn run_decider_flow( ); match decidedGateway { - Some(decideGatewayOutput) => Ok(T::DecidedGateway { + Some(decideGatewayOutput) => { + let cpu_time = cpu_start.elapsed().as_millis() as u64; + Ok(T::DecidedGateway { decided_gateway: decideGatewayOutput, gateway_priority_map: gatewayPriorityMap, filter_wise_gateways: None, @@ -486,7 +494,8 @@ pub async fn run_decider_flow( gateway_mga_id_map: None, debit_routing_output: None, is_rust_based_decider: true, - }), + latency: Some(cpu_time), + })}, None => Err(( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 4506eafb..2e698fe5 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -395,6 +395,7 @@ pub async fn run_decider_flow( gateway_mga_id_map: Some(gatewayMgaIdMap), debit_routing_output: None, is_rust_based_decider: deciderParams.dpShouldConsumeResult.unwrap_or(false), + latency: None, }) } else { decider_flow @@ -663,6 +664,7 @@ pub async fn run_decider_flow( is_rust_based_decider: deciderParams .dpShouldConsumeResult .unwrap_or(false), + latency: None, }), None => Err(( decider_flow.writer.debugFilterList.clone(), diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 70427836..5ecede1c 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -1230,6 +1230,7 @@ pub struct DecidedGateway { pub is_dynamic_mga_enabled: bool, pub gateway_mga_id_map: Option, pub is_rust_based_decider: bool, + pub latency: Option, } #[derive(Debug, Serialize, Clone, Deserialize)] diff --git a/src/decider/network_decider/debit_routing.rs b/src/decider/network_decider/debit_routing.rs index 76ab25be..e206ff3d 100644 --- a/src/decider/network_decider/debit_routing.rs +++ b/src/decider/network_decider/debit_routing.rs @@ -49,6 +49,7 @@ pub async fn perform_debit_routing( is_dynamic_mga_enabled: false, gateway_mga_id_map: None, is_rust_based_decider: true, + latency: None, }); } } diff --git a/src/routes/decide_gateway.rs b/src/routes/decide_gateway.rs index f963bf80..a4b4c0dc 100644 --- a/src/routes/decide_gateway.rs +++ b/src/routes/decide_gateway.rs @@ -8,6 +8,7 @@ use crate::{ use axum::body::to_bytes; use axum::http::StatusCode; use axum::response::IntoResponse; +use cpu_time::ProcessTime; // impl IntoResponse for ErrorResponse { // fn into_response(self) -> axum::http::Response { @@ -35,6 +36,7 @@ impl IntoResponse for DecidedGateway { pub async fn decide_gateway( req: axum::http::Request, ) -> Result { + let cpu_start = ProcessTime::now(); let timer = metrics::API_LATENCY_HISTOGRAM .with_label_values(&["decide_gateway"]) .start_timer(); @@ -77,7 +79,7 @@ pub async fn decide_gateway( let api_decider_request: Result = serde_json::from_slice(&body); let result = match api_decider_request { - Ok(payload) => match decider_full_payload_hs_function(payload).await { + Ok(payload) => match decider_full_payload_hs_function(payload, cpu_start).await { Ok(decided_gateway) => { metrics::API_REQUEST_COUNTER .with_label_values(&["decide_gateway", "success"]) From 4f3f60a145948f7c21469e02e7887e2d9874985f Mon Sep 17 00:00:00 2001 From: spritianeja03 <146620839+spritianeja03@users.noreply.github.com> Date: Fri, 7 Nov 2025 17:28:04 +0530 Subject: [PATCH 37/95] fix: change cpu_start time to Instant instead of ProcessTime (#177) --- src/routes/decision_gateway.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index 31f6fb74..b9646df7 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -1,3 +1,5 @@ +use std::time::Instant; + use crate::decider::gatewaydecider::{ flows::decider_full_payload_hs_function, types::{DecidedGateway, DomainDeciderRequest, ErrorResponse, UnifiedError}, @@ -47,7 +49,7 @@ where DecidedGatewayResponse: IntoResponse, ErrorResponse: IntoResponse, { - let cpu_start = ProcessTime::now(); + let cpu_start = Instant::now(); let timer = API_LATENCY_HISTOGRAM .with_label_values(&["decision_gateway"]) .start_timer(); From 5b623dda3af1c3cc09858838f794e56770863705 Mon Sep 17 00:00:00 2001 From: spritianeja03 <146620839+spritianeja03@users.noreply.github.com> Date: Fri, 7 Nov 2025 18:01:32 +0530 Subject: [PATCH 38/95] fix: change cpu_start from ProcessTime::now() to Instant::now() (#178) --- src/decider/gatewaydecider/flow_new.rs | 6 +++--- src/routes/decide_gateway.rs | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index ac80ecfa..97b315d9 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -3,12 +3,12 @@ use super::types::RankingAlgorithm; use super::types::UnifiedError; use crate::app::get_tenant_app_state; use crate::decider::network_decider; -use cpu_time::ProcessTime; use serde_json::json; use serde_json::Value as AValue; use std::collections::HashMap; use std::option::Option; use std::string::String; +use std::time::Instant; use std::vec::Vec; // use eulerhs::prelude::*; // use eulerhs::language as L; @@ -28,7 +28,7 @@ use crate::types::merchant::merchant_gateway_account::MerchantGatewayAccount; pub async fn decider_full_payload_hs_function( dreq_: T::DomainDeciderRequestForApiCallV2, - cpu_start: ProcessTime, + cpu_start: Instant, ) -> Result { let merchant_account = ETM::merchant_account::load_merchant_by_merchant_id(dreq_.merchant_id.clone()) @@ -136,7 +136,7 @@ pub async fn run_decider_flow( rankingAlgorithm: Option, eliminationEnabled: Option, is_legacy_decider_flow: bool, - cpu_start: ProcessTime, + cpu_start: Instant, ) -> Result { let txnCreationTime = deciderParams .dpTxnDetail diff --git a/src/routes/decide_gateway.rs b/src/routes/decide_gateway.rs index a4b4c0dc..ae2c0f85 100644 --- a/src/routes/decide_gateway.rs +++ b/src/routes/decide_gateway.rs @@ -1,3 +1,5 @@ +use std::time::Instant; + use crate::{ decider::gatewaydecider::{ flow_new::decider_full_payload_hs_function, @@ -8,7 +10,6 @@ use crate::{ use axum::body::to_bytes; use axum::http::StatusCode; use axum::response::IntoResponse; -use cpu_time::ProcessTime; // impl IntoResponse for ErrorResponse { // fn into_response(self) -> axum::http::Response { @@ -36,7 +37,7 @@ impl IntoResponse for DecidedGateway { pub async fn decide_gateway( req: axum::http::Request, ) -> Result { - let cpu_start = ProcessTime::now(); + let cpu_start = Instant::now(); let timer = metrics::API_LATENCY_HISTOGRAM .with_label_values(&["decide_gateway"]) .start_timer(); From 00cffcee7c3706fc8defa949f0e1e75ffd6fe1ae Mon Sep 17 00:00:00 2001 From: Gaurav Rawat <104276743+GauravRawat369@users.noreply.github.com> Date: Wed, 12 Nov 2025 18:59:32 +0530 Subject: [PATCH 39/95] feat(decider): Implement udfs support to decision engine (#136) --- src/decider/gatewaydecider/flow_new.rs | 2 + src/decider/gatewaydecider/flows.rs | 2 + src/decider/gatewaydecider/runner.rs | 1 + src/decider/gatewaydecider/types.rs | 31 +++- src/decider/gatewaydecider/utils.rs | 151 ++++++++++++------ src/euclid/handlers/routing_rules.rs | 26 +-- src/euclid/types.rs | 18 ++- .../gateway_selection_scoring_v3/flow.rs | 1 + src/feedback/utils.rs | 1 - 9 files changed, 158 insertions(+), 75 deletions(-) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 97b315d9..e93a8675 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -155,6 +155,7 @@ pub async fn run_decider_flow( deciderParams.dpTxnDetail.clone(), deciderParams.dpTxnCardInfo.clone(), deciderParams.dpMerchantAccount.clone(), + is_legacy_decider_flow.clone(), ) .await; let functionalGateways = deciderParams @@ -518,6 +519,7 @@ pub async fn run_decider_flow( routingApproach: Some(decider_flow.writer.gwDeciderApproach.clone().to_string()), eliminationEnabled: eliminationEnabled.unwrap_or_default(), is_legacy_decider_flow, + udfs: Some(deciderParams.dpOrder.udfs.clone()), ..decider_flow.writer.gateway_scoring_data.clone() }; let app_state = get_tenant_app_state().await; diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 2e698fe5..199a48e5 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -331,6 +331,7 @@ pub async fn run_decider_flow( deciderParams.dpTxnDetail.clone(), deciderParams.dpTxnCardInfo.clone(), deciderParams.dpMerchantAccount.clone(), + is_legacy_decider_flow.clone(), ) .await; let (functionalGateways, allMgas) = GF::newGwFilters(&mut decider_flow).await?; @@ -688,6 +689,7 @@ pub async fn run_decider_flow( let updated_gateway_scoring_data = T::GatewayScoringData { routingApproach: Some(decider_flow.writer.gwDeciderApproach.clone().to_string()), is_legacy_decider_flow, + udfs: Some(deciderParams.dpOrder.udfs.clone()), ..decider_flow.writer.gateway_scoring_data.clone() }; let app_state = get_tenant_app_state().await; diff --git a/src/decider/gatewaydecider/runner.rs b/src/decider/gatewaydecider/runner.rs index 8b12e5e7..c0fa531a 100644 --- a/src/decider/gatewaydecider/runner.rs +++ b/src/decider/gatewaydecider/runner.rs @@ -43,6 +43,7 @@ use crate::decider::gatewaydecider::types as DeciderTypes; use super::utils; use crate::types::payment::payment_method_type_const::*; + // use serde_json::Value as AValue; // use eulerhs::prelude::*; // use data::aeson::{Object, either_decode, (.:)}; diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 5ecede1c..b56a2d2d 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -8,7 +8,7 @@ use crate::types::transaction::id as ETId; use crate::types::txn_details::types::TxnObjectType; use masking::Secret; use serde::ser::SerializeStruct; -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Deserializer, Serialize}; use serde_json::Value as AValue; use std::collections::HashMap as HMap; use std::collections::HashMap; @@ -535,7 +535,8 @@ pub fn initial_decider_state(date_created: String) -> DeciderState { cardSwitchProvider: None, currency: None, country: None, - is_legacy_decider_flow: false, + is_legacy_decider_flow: true, + udfs: None, }, } } @@ -563,6 +564,7 @@ pub struct GatewayScoringData { pub currency: Option, pub country: Option, pub is_legacy_decider_flow: bool, + pub udfs: Option, } #[derive(Debug)] @@ -918,6 +920,30 @@ pub struct DomainDeciderRequestForApiCallV2 { pub elimination_enabled: Option, } +pub fn deserialize_optional_udfs_to_hashmap<'de, D>( + deserializer: D, +) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + // First try to deserialize as Option>> + let opt_raw_vec: Option>> = Option::deserialize(deserializer)?; + + match opt_raw_vec { + None => Ok(None), + Some(raw_vec) => { + // Convert the Vec> to a HashMap + let hashmap: HashMap = raw_vec + .into_iter() + .enumerate() + .filter_map(|(index, value)| value.map(|v| (index as i32, v))) + .collect(); + + Ok(Some(UDFs(hashmap))) + } + } +} + #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PaymentInfo { @@ -926,6 +952,7 @@ pub struct PaymentInfo { currency: Currency, country: Option, customer_id: Option, + #[serde(deserialize_with = "deserialize_optional_udfs_to_hashmap")] udfs: Option, preferred_gateway: Option, payment_type: TxnObjectType, diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index e2f61d9a..72acb099 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -90,6 +90,7 @@ use crate::types::isin_routes as ETIsinR; // // use configs::env_vars as ENV; use crate::error::StorageError; use crate::types::gateway_card_info::ValidationType; +use crate::types::order::udfs::{get_udf, UDFs}; pub fn either_decode_t Deserialize<'de>>(text: &str) -> Result { from_slice(text.as_bytes()).map_err(|e| e.to_string()) @@ -1885,6 +1886,8 @@ pub fn get_default_gateway_scoring_data( currency: Option, country: Option, auth_type: Option, + udfs: Option, + is_legacy_decider_flow: bool, ) -> GatewayScoringData { GatewayScoringData { merchantId: merchant_id, @@ -1907,7 +1910,8 @@ pub fn get_default_gateway_scoring_data( cardSwitchProvider: card_switch_provider, currency: currency, country: country, - is_legacy_decider_flow: false, + is_legacy_decider_flow, + udfs, } } @@ -1916,6 +1920,7 @@ pub async fn get_gateway_scoring_data( txn_detail: ETTD::TxnDetail, txn_card_info: ETCa::txn_card_info::TxnCardInfo, merchant: ETM::merchant_account::MerchantAccount, + is_legacy_decider_flow: bool, ) -> GatewayScoringData { let merchant_enabled_for_unification = is_feature_enabled( C::MerchantsEnabledForScoreKeysUnification.get_key(), @@ -1970,6 +1975,8 @@ pub async fn get_gateway_scoring_data( .authType .as_ref() .map(|a| a.to_string()), + Some(decider_flow.get().dpOrder.udfs.clone()), + is_legacy_decider_flow, ); let updated_gateway_scoring_data = match txn_card_info.paymentMethodType.as_str() { UPI => { @@ -2336,12 +2343,68 @@ pub async fn get_unified_sr_key( is_sr_v3_metric_enabled: bool, enforce1d: bool, ) -> String { + let merchant_id = gateway_scoring_data.merchantId.clone(); + + let name = format!("SR_DIMENSION_CONFIG_{}", merchant_id); + + let service_config = find_config_by_name(name.clone()) + .await + .change_context(EuclidErrors::StorageError) + .and_then(|opt_config| { + opt_config.and_then(|config| config.value).ok_or_else(|| { + error_stack::report!(EuclidErrors::InvalidSrDimensionConfig( + "SR dimension config not found".to_string() + )) + }) + }) + .and_then(|config| { + serde_json::from_str::(&config).change_context( + EuclidErrors::InvalidSrDimensionConfig( + "Failed to parse SR dimension config".to_string(), + ), + ) + }); + + let udfs = service_config + .as_ref() + .map(|config| config.paymentInfo.udfs.clone()) + .unwrap_or_default(); + + let udf_values = + gateway_scoring_data + .udfs + .as_ref() + .zip(Some(udfs)) + .and_then(|(udf_map, udf_keys)| { + let mut values = Vec::with_capacity(udf_keys.len()); + + for udf in udf_keys { + match get_udf(udf_map, udf) { + Some(value) => values.push(value.to_string()), + None => return None, + } + } + + Some(values) + }); + let is_legacy_decider_flow = gateway_scoring_data.is_legacy_decider_flow; + if is_legacy_decider_flow { - return get_legacy_unified_sr_key(gateway_scoring_data, is_sr_v3_metric_enabled, enforce1d) - .await; + let sr_keys = + get_legacy_unified_sr_key(gateway_scoring_data, is_sr_v3_metric_enabled, enforce1d) + .await; + + let sr_key_with_udfs = if let Some(udf_values) = udf_values.clone() { + let mut key_components = vec![sr_keys]; + key_components.extend(udf_values); + intercalate_without_empty_string("_", &key_components) + } else { + sr_keys + }; + return sr_key_with_udfs; } - let merchant_id = gateway_scoring_data.merchantId.clone(); + let order_type = gateway_scoring_data.orderType.clone(); let payment_method_type = gateway_scoring_data.paymentMethodType.clone(); let payment_method = gateway_scoring_data.paymentMethod.clone(); @@ -2368,66 +2431,50 @@ pub async fn get_unified_sr_key( payment_method, ]; - let name = format!("SR_DIMENSION_CONFIG_{}", merchant_id); - - let service_config = find_config_by_name(name.clone()) - .await - .change_context(EuclidErrors::StorageError) - .and_then(|opt_config| { - opt_config.and_then(|config| config.value).ok_or_else(|| { - error_stack::report!(EuclidErrors::InvalidSrDimensionConfig( - "SR dimension config not found".to_string() - )) - }) - }) - .and_then(|config| { - serde_json::from_str::(&config).change_context( - EuclidErrors::InvalidSrDimensionConfig( - "Failed to parse SR dimension config".to_string(), - ), - ) - }); - let fields = service_config - .map(|config| config.fields) + .as_ref() + .map(|config| config.paymentInfo.fields.clone()) .unwrap_or_default(); - for field in fields { - if let Some(suffix) = field.strip_prefix("paymentInfo.") { - match suffix { - "card_network" => { - if let Some(cn) = card_network.clone() { - key_components.push(cn.peek().to_string()); - } - } - "card_is_in" => { - if let Some(ci) = card_isin.clone() { - key_components.push(ci); - } + for field in fields.into_iter().flatten() { + match field.as_str() { + "card_network" => { + if let Some(cn) = card_network.clone() { + key_components.push(cn.peek().to_string()); } - "currency" => { - if let Some(cu) = currency.clone() { - key_components.push(cu); - } + } + "card_is_in" => { + if let Some(ci) = card_isin.clone() { + key_components.push(ci); } - "country" => { - if let Some(co) = country.clone() { - key_components.push(co); - } + } + "currency" => { + if let Some(cu) = currency.clone() { + key_components.push(cu); } - "auth_type" => { - if let Some(at) = auth_type.clone() { - key_components.push(at); - } + } + "country" => { + if let Some(co) = country.clone() { + key_components.push(co); } - _ => { - // Unknown field under payment_info + } + "auth_type" => { + if let Some(at) = auth_type.clone() { + key_components.push(at); } } + _ => { + // Unknown field + } } } - intercalate_without_empty_string("_", &key_components) + if let Some(udf_values) = udf_values { + key_components.extend(udf_values); + } + + let val = intercalate_without_empty_string("_", &key_components); + return val; } async fn get_legacy_unified_sr_key( diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index c45178d4..de5a3d15 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -48,10 +48,16 @@ pub async fn config_sr_dimentions( // Validate dimensions against ELIGIBLE_DIMENSIONS let invalid_dimensions: Vec<&String> = payload + .paymentInfo .fields - .iter() - .filter(|field| !ELIGIBLE_DIMENSIONS.contains(&field.as_str())) - .collect(); + .as_ref() + .map(|fields| { + fields + .iter() + .filter(|field| !ELIGIBLE_DIMENSIONS.contains(&field.as_str())) + .collect() + }) + .unwrap_or_default(); if !invalid_dimensions.is_empty() { metrics::API_REQUEST_COUNTER @@ -59,21 +65,15 @@ pub async fn config_sr_dimentions( .inc(); timer.observe_duration(); - let invalid_dims_str = invalid_dimensions - .iter() - .map(|d| format!("'{}'", d)) - .collect::>() - .join(", "); - logger::error!( - "Invalid dimensions found for merchant {}: {}", + "Invalid dimensions found for merchant {}: {:?}", payload.merchant_id, - invalid_dims_str + invalid_dimensions.clone() ); return Err(EuclidErrors::InvalidSrDimensionConfig(format!( - "Invalid dimensions: {}. Valid dimensions are: {}", - invalid_dims_str, + "Invalid dimensions: {:?}. Valid dimensions are: {}", + invalid_dimensions.clone(), ELIGIBLE_DIMENSIONS.join(", ") )) .into()); diff --git a/src/euclid/types.rs b/src/euclid/types.rs index 4d736e15..cba9989c 100644 --- a/src/euclid/types.rs +++ b/src/euclid/types.rs @@ -101,16 +101,20 @@ impl RoutingDictionaryRecord { #[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] pub struct SrDimensionConfig { pub merchant_id: String, - pub fields: Vec, + pub paymentInfo: SrDimensionInfo, +} +#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] +pub struct SrDimensionInfo { + pub udfs: Vec, + pub fields: Option>, } pub const ELIGIBLE_DIMENSIONS: [&str; 5] = [ - "paymentInfo.currency", - "paymentInfo.country", - "paymentInfo.auth_type", - "paymentInfo.card_is_in", - "paymentInfo.card_network", + "currency", + "country", + "auth_type", + "card_is_in", + "card_network", ]; - #[derive(Debug, serde::Serialize)] pub struct RoutingEvaluateResponse { pub status: String, diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index bbf9da42..43d4db03 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -54,6 +54,7 @@ use crate::{ }, }; use masking::PeekInterface; +use serde_json; // Converted functions // Original Haskell function: updateSrV3Score diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index b8f86799..4be2519e 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -413,7 +413,6 @@ pub async fn isKeyExistsRedis(key: String) -> bool { } } } - // Original Haskell function: updateQueue pub async fn updateQueue( redis_name: String, From 7e1d147b53cb22ff427922f962c41c1abfb54c16 Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Fri, 14 Nov 2025 10:53:21 +0530 Subject: [PATCH 40/95] changes for Metric Tracking Logs and Info to Warn for Monitoring (#180) --- src/decider/gatewaydecider/gw_scoring.rs | 32 ++++++++++++------------ src/decider/gatewaydecider/types.rs | 3 +++ src/decider/gatewaydecider/utils.rs | 25 +++++++++++++----- src/feedback/utils.rs | 1 + 4 files changed, 39 insertions(+), 22 deletions(-) diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 966883e2..d2f21e5f 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1432,7 +1432,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }) .collect::>(); - logger::info!( + logger::warn!( tag = "scoringFlow", action = "scoringFlow", "Gateway Success Rate Inputs for Global SR based elimination for {:?} : {:?}", @@ -1450,7 +1450,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) .await; - logger::info!( + logger::warn!( tag = "scoringFlow", action = "scoringFlow", "Gateway Redis Key Map for Global SR based elimination for {:?} : {:?}", @@ -1466,7 +1466,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( gsri.clone(), ) .await; - logger::info!( + logger::warn!( tag = "scoringFlow", action = "scoringFlow", "Global Elimination Gateway Score for {:?} : {:?}", @@ -1475,8 +1475,8 @@ pub async fn update_gateway_score_based_on_global_success_rate( ); match global_elimination_gateway_score { Some((global_gateway_score, s)) => { - logger::info!(action = "global_gateway_score", "s-value : {:?}", s); - logger::info!( + logger::warn!(action = "global_gateway_score", "s-value : {:?}", s); + logger::warn!( action = "global_gateway_score", "global_gateway_score{:?}", global_gateway_score @@ -1485,14 +1485,14 @@ pub async fn update_gateway_score_based_on_global_success_rate( currentScore: Some(s), ..gsri.clone() }; - logger::info!( + logger::warn!( action = "global_gateway_score", "Global Elimination Gateway Score for {:?} : {:?}", txn_detail.txnId, new_gsri ); upd_gateway_success_rate_inputs.push(new_gsri); - logger::info!( + logger::warn!( action = "global_gateway_score", "upd_gateway_success_rate_inputs{:?}", upd_gateway_success_rate_inputs @@ -1501,7 +1501,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( gsri.gateway.clone(), global_gateway_score, )); - logger::info!( + logger::warn!( action = "update_global_score_log", "global_gateway_scores{:?}", global_gateway_scores @@ -1511,7 +1511,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( } } - logger::info!( + logger::warn!( action = "update_gateway_score_based_on_global_success_rate", "upd_gateway_success_rate_inputs{:?}", upd_gateway_success_rate_inputs @@ -1530,7 +1530,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }) .collect(); - logger::info!( + logger::warn!( action = "filtered_gateway_success_rate_inputs", "filtered_gateway_success_rate_inputs{:?}", filtered_gateway_success_rate_inputs @@ -1571,7 +1571,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }, ); } else { - logger::info!( + logger::warn!( tag="scoringFlow", action = "scoringFlow", "No gateways are eligible for penalties & fallback {:?} based on global score", @@ -1589,7 +1589,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( } let old_sr_metric_log_data = decider_flow.writer.srMetricLogData.clone(); - logger::debug!( + logger::warn!( tag = "MetricData-GLOBAL-ELIMINATION", action = "MetricData-GLOBAL-ELIMINATION", "{:?}", @@ -1616,7 +1616,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) .await; } else { - logger::info!( + logger::warn!( tag = "scoringFlow", action = "scoringFlow", "Global scores not available for {:?} {:?}", @@ -1625,7 +1625,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ); } - logger::info!( + logger::warn!( tag = "scoringFlow", action = "scoringFlow", "Gateway scores after considering global SR based elimination for {:?} : {:?}", @@ -1639,13 +1639,13 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) } Err(reason) => { - logger::debug!( + logger::warn!( tag = "Global SR routing", action = "Global SR routing", "{:?}", reason ); - logger::info!( + logger::warn!( tag = "scoringFlow", action = "scoringFlow", "Global SR routing not enabled for merchant {:?} txn {:?}", diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index b56a2d2d..d01293f1 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -415,6 +415,7 @@ pub struct MessageFormat { pub x_request_id: Option, #[serde(rename = "data")] pub log_data: AValue, + pub is_udf_consumed: Option } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -537,6 +538,7 @@ pub fn initial_decider_state(date_created: String) -> DeciderState { country: None, is_legacy_decider_flow: true, udfs: None, + udfs_consumed_for_routing: None, }, } } @@ -565,6 +567,7 @@ pub struct GatewayScoringData { pub country: Option, pub is_legacy_decider_flow: bool, pub udfs: Option, + pub udfs_consumed_for_routing: Option, } #[derive(Debug)] diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 72acb099..bae69401 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -709,7 +709,7 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo let normalized_log_data = match serde_json::to_value(&log_data) { Ok(value) => value, Err(e) => { - crate::logger::error!( + crate::logger::warn!( action = "metric_tracking_log_error", "Failed to serialize log_data: {}", e @@ -717,7 +717,7 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo return; } }; - crate::logger::info!( + crate::logger::warn!( action = "metric_tracking_log", "{}", normalized_log_data.to_string(), @@ -760,6 +760,7 @@ pub fn get_metric_log_format(decider_flow: &mut DeciderFlow<'_>, stage: &str) -> bank_code: fetch_juspay_bank_code(&txn_card_info), x_request_id: x_req_id.cloned(), log_data: serde_json::to_value(mp).unwrap(), + is_udf_consumed: decider_flow.writer.gateway_scoring_data.udfs_consumed_for_routing } } @@ -824,6 +825,7 @@ pub async fn log_gateway_decider_approach( bank_code: fetch_juspay_bank_code(&txn_card_info), x_request_id: x_req_id, log_data: serde_json::to_value(mp).unwrap(), + is_udf_consumed: None }, ) .await; @@ -1912,6 +1914,7 @@ pub fn get_default_gateway_scoring_data( country: country, is_legacy_decider_flow, udfs, + udfs_consumed_for_routing: None } } @@ -2070,6 +2073,7 @@ pub async fn get_gateway_scoring_data( pub async fn get_unified_key( gateway_scoring_data: GatewayScoringData, + decider_flow: Option<&mut DeciderFlow<'_>>, score_key_type: ScoreKeyType, enforce1d: bool, gateway_ref_id_map: types::GatewayReferenceIdMap, @@ -2192,7 +2196,7 @@ pub async fn get_unified_key( result_keys } ScoreKeyType::SrV2Key => { - let key = get_unified_sr_key(&gateway_scoring_data, false, enforce1d).await; + let key = get_unified_sr_key(&gateway_scoring_data, false, enforce1d, decider_flow).await; let gri_sr_v2_cutover = gateway_scoring_data.isGriEnabledForSrRouting; if gri_sr_v2_cutover { @@ -2216,7 +2220,7 @@ pub async fn get_unified_key( } } ScoreKeyType::SrV3Key => { - let base_key = get_unified_sr_key(&gateway_scoring_data, true, enforce1d).await; + let base_key = get_unified_sr_key(&gateway_scoring_data, true, enforce1d, decider_flow).await; let gri_sr_v2_cutover = gateway_scoring_data.isGriEnabledForSrRouting; if gri_sr_v2_cutover { @@ -2342,6 +2346,7 @@ pub async fn get_unified_sr_key( gateway_scoring_data: &GatewayScoringData, is_sr_v3_metric_enabled: bool, enforce1d: bool, + decider_flow: Option<&mut DeciderFlow<'_>>, ) -> String { let merchant_id = gateway_scoring_data.merchantId.clone(); @@ -2369,7 +2374,7 @@ pub async fn get_unified_sr_key( .as_ref() .map(|config| config.paymentInfo.udfs.clone()) .unwrap_or_default(); - + let mut udf_used = true; let udf_values = gateway_scoring_data .udfs @@ -2381,13 +2386,20 @@ pub async fn get_unified_sr_key( for udf in udf_keys { match get_udf(udf_map, udf) { Some(value) => values.push(value.to_string()), - None => return None, + None => { + udf_used = false; + return None; + }, } } Some(values) }); + if let Some(df) = decider_flow { + df.writer.gateway_scoring_data.udfs_consumed_for_routing = Some(udf_used); + } + let is_legacy_decider_flow = gateway_scoring_data.is_legacy_decider_flow; if is_legacy_decider_flow { @@ -2632,6 +2644,7 @@ pub async fn get_consumer_key( }; let gateway_redis_key_map = get_unified_key( gateway_scoring_data, + Some(decider_flow), score_key_type, enforce1d, gw_ref_id_map, diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 4be2519e..7127d62a 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -643,6 +643,7 @@ pub async fn getProducerKey( let gateway_key = get_unified_key( gateway_score_data, + None, score_key_type, enforce1d, gateway_and_reference_id, From 4c31d54c6bddf7509ef5ebd81b37dafbedf4414f Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Tue, 18 Nov 2025 17:20:10 +0530 Subject: [PATCH 41/95] Changes to have udfs_values in the log (#181) --- src/decider/gatewaydecider/types.rs | 4 ++-- src/decider/gatewaydecider/utils.rs | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index d01293f1..53820078 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -415,7 +415,7 @@ pub struct MessageFormat { pub x_request_id: Option, #[serde(rename = "data")] pub log_data: AValue, - pub is_udf_consumed: Option + pub udf_consumed: Option } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -567,7 +567,7 @@ pub struct GatewayScoringData { pub country: Option, pub is_legacy_decider_flow: bool, pub udfs: Option, - pub udfs_consumed_for_routing: Option, + pub udfs_consumed_for_routing: Option, } #[derive(Debug)] diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index bae69401..db927c72 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -760,7 +760,7 @@ pub fn get_metric_log_format(decider_flow: &mut DeciderFlow<'_>, stage: &str) -> bank_code: fetch_juspay_bank_code(&txn_card_info), x_request_id: x_req_id.cloned(), log_data: serde_json::to_value(mp).unwrap(), - is_udf_consumed: decider_flow.writer.gateway_scoring_data.udfs_consumed_for_routing + udf_consumed: decider_flow.writer.gateway_scoring_data.udfs_consumed_for_routing.as_ref().cloned() } } @@ -825,7 +825,7 @@ pub async fn log_gateway_decider_approach( bank_code: fetch_juspay_bank_code(&txn_card_info), x_request_id: x_req_id, log_data: serde_json::to_value(mp).unwrap(), - is_udf_consumed: None + udf_consumed: None }, ) .await; @@ -2374,7 +2374,7 @@ pub async fn get_unified_sr_key( .as_ref() .map(|config| config.paymentInfo.udfs.clone()) .unwrap_or_default(); - let mut udf_used = true; + let udf_values = gateway_scoring_data .udfs @@ -2387,7 +2387,6 @@ pub async fn get_unified_sr_key( match get_udf(udf_map, udf) { Some(value) => values.push(value.to_string()), None => { - udf_used = false; return None; }, } @@ -2397,7 +2396,11 @@ pub async fn get_unified_sr_key( }); if let Some(df) = decider_flow { - df.writer.gateway_scoring_data.udfs_consumed_for_routing = Some(udf_used); + if let Some(udf_values) = udf_values.as_ref() { + if udf_values.len() == 1 { + df.writer.gateway_scoring_data.udfs_consumed_for_routing = Some(udf_values[0].clone()); + } + } } let is_legacy_decider_flow = gateway_scoring_data.is_legacy_decider_flow; From 7013c2494f3b6014bd63a9d06cbca765d046b6eb Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Wed, 19 Nov 2025 20:15:32 +0530 Subject: [PATCH 42/95] Fix/mask payment s (#184) --- src/decider/gatewaydecider/flow_new.rs | 46 ++++--- src/decider/gatewaydecider/gw_scoring.rs | 6 +- src/decider/gatewaydecider/runner.rs | 10 +- src/decider/gatewaydecider/types.rs | 25 +++- src/decider/gatewaydecider/utils.rs | 166 ++++++++++++++--------- src/feedback/types.rs | 5 +- src/routes/decision_gateway.rs | 2 +- src/routes/update_score.rs | 15 +- src/storage/types.rs | 7 +- src/types/card/txn_card_info.rs | 23 +++- 10 files changed, 193 insertions(+), 112 deletions(-) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index e93a8675..4f3eab82 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -475,28 +475,30 @@ pub async fn run_decider_flow( Some(decideGatewayOutput) => { let cpu_time = cpu_start.elapsed().as_millis() as u64; Ok(T::DecidedGateway { - decided_gateway: decideGatewayOutput, - gateway_priority_map: gatewayPriorityMap, - filter_wise_gateways: None, - priority_logic_tag: updatedPriorityLogicOutput - .priority_logic_tag - .clone(), - routing_approach: finalDeciderApproach.clone(), - gateway_before_evaluation: topGatewayBeforeSRDowntimeEvaluation.clone(), - priority_logic_output: Some(updatedPriorityLogicOutput), - reset_approach: decider_flow.writer.reset_approach.clone(), - routing_dimension: decider_flow.writer.routing_dimension.clone(), - routing_dimension_level: decider_flow - .writer - .routing_dimension_level - .clone(), - is_scheduled_outage: decider_flow.writer.isScheduledOutage, - is_dynamic_mga_enabled: decider_flow.writer.is_dynamic_mga_enabled, - gateway_mga_id_map: None, - debit_routing_output: None, - is_rust_based_decider: true, - latency: Some(cpu_time), - })}, + decided_gateway: decideGatewayOutput, + gateway_priority_map: gatewayPriorityMap, + filter_wise_gateways: None, + priority_logic_tag: updatedPriorityLogicOutput + .priority_logic_tag + .clone(), + routing_approach: finalDeciderApproach.clone(), + gateway_before_evaluation: topGatewayBeforeSRDowntimeEvaluation + .clone(), + priority_logic_output: Some(updatedPriorityLogicOutput), + reset_approach: decider_flow.writer.reset_approach.clone(), + routing_dimension: decider_flow.writer.routing_dimension.clone(), + routing_dimension_level: decider_flow + .writer + .routing_dimension_level + .clone(), + is_scheduled_outage: decider_flow.writer.isScheduledOutage, + is_dynamic_mga_enabled: decider_flow.writer.is_dynamic_mga_enabled, + gateway_mga_id_map: None, + debit_routing_output: None, + is_rust_based_decider: true, + latency: Some(cpu_time), + }) + } None => Err(( decider_flow.writer.debugFilterList.clone(), decider_flow.writer.debugScoringList.clone(), diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index d2f21e5f..c89114e2 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1180,15 +1180,15 @@ fn check_scheduled_outage_metadata( .paymentSource .as_ref() .map_or(false, |payment_source| { - if payment_source.contains('@') { + if payment_source.peek().contains('@') { false } else { schedule_equal_to( - |x, y| x == y, + |x, y| x.peek() == &y, Some(payment_source.clone()), scheduled_outage_metadata.app.clone(), ) && schedule_equal_to( - |x, y| x == y, + |x, y| x.peek() == &y, Some(payment_source.clone()), scheduled_outage_metadata.handle.clone(), ) diff --git a/src/decider/gatewaydecider/runner.rs b/src/decider/gatewaydecider/runner.rs index c0fa531a..354e3950 100644 --- a/src/decider/gatewaydecider/runner.rs +++ b/src/decider/gatewaydecider/runner.rs @@ -35,13 +35,14 @@ use crate::{ }, utils::call_api, }; -use masking::PeekInterface; +use masking::{PeekInterface, Secret}; use serde::{Deserialize, Serialize}; use serde_json::{from_str, Value}; use crate::decider::gatewaydecider::types as DeciderTypes; use super::utils; +use crate::decider::gatewaydecider::utils::mask_secret_option; use crate::types::payment::payment_method_type_const::*; // use serde_json::Value as AValue; @@ -172,10 +173,10 @@ pub fn fetch_emi_type(txnCardInfo: TxnCardInfo) -> Result> match txnCardInfo.paymentSource { None => Err(vec![]), Some(ps) => { - if ps.contains("emi_type") { + if ps.peek().contains("emi_type") { Err(vec![]) } else { - match from_str::(&ps) { + match from_str::(ps.peek()) { Ok(value) => match value.get("emi_type") { Some(emi_type) => match emi_type.as_str() { Some(emi_type_str) => Ok(emi_type_str.to_string()), @@ -207,7 +208,8 @@ pub struct FilteredPaymentInfo { pub paymentMethod: Option, pub paymentMethodType: Option, pub authType: Option, - pub paymentSource: Option, + #[serde(serialize_with = "mask_secret_option")] + pub paymentSource: Option>, pub emiType: Option, pub cardSubType: Option, pub storedCardProvider: Option, diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 53820078..6c2fafa0 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -6,7 +6,7 @@ use crate::types::money::internal as ETMo; use crate::types::order::udfs::UDFs; use crate::types::transaction::id as ETId; use crate::types::txn_details::types::TxnObjectType; -use masking::Secret; +use masking::{PeekInterface, Secret}; use serde::ser::SerializeStruct; use serde::{Deserialize, Deserializer, Serialize}; use serde_json::Value as AValue; @@ -23,6 +23,7 @@ use time::{OffsetDateTime, PrimitiveDateTime}; // use data::reflection::Given; // use data::time::{UTCTime, LocalTime}; // use unsafe_coerce::unsafeCoerce; +use crate::decider::gatewaydecider::utils::mask_secret_option; use crate::types::card as ETCa; use crate::types::merchant as ETM; use crate::types::merchant::id::MerchantId; @@ -402,7 +403,8 @@ pub struct MessageFormat { pub log_type: String, pub payment_method: String, pub payment_method_type: String, - pub payment_source: Option, + #[serde(serialize_with = "mask_secret_option")] + pub payment_source: Option>, pub source_object: Option, pub txn_detail_id: ETTD::TxnDetailId, pub stage: String, @@ -415,7 +417,7 @@ pub struct MessageFormat { pub x_request_id: Option, #[serde(rename = "data")] pub log_data: AValue, - pub udf_consumed: Option + pub udf_consumed: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -552,7 +554,8 @@ pub struct GatewayScoringData { pub cardType: Option, pub bankCode: Option, pub authType: Option, - pub paymentSource: Option, + #[serde(serialize_with = "mask_secret_option")] + pub paymentSource: Option>, pub isPaymentSourceEnabledForSrRouting: bool, pub isAuthLevelEnabledForSrRouting: bool, pub isBankLevelEnabledForSrRouting: bool, @@ -570,6 +573,15 @@ pub struct GatewayScoringData { pub udfs_consumed_for_routing: Option, } +impl GatewayScoringData { + pub fn get_payment_source(&self) -> String { + self.paymentSource + .as_ref() + .map(|s| s.peek().to_string()) + .unwrap_or_default() + } +} + #[derive(Debug)] #[allow(dead_code)] pub struct MetricsStreamKeyShard(String, i32); @@ -875,7 +887,8 @@ pub struct ApiTxnCardInfo { pub paymentMethodType: Option, pub paymentMethod: Option, pub cardGlobalFingerprint: Option, - pub paymentSource: Option, + #[serde(serialize_with = "mask_secret_option")] + pub paymentSource: Option>, pub authType: Option, pub partitionKey: Option, } @@ -1055,7 +1068,7 @@ impl DomainDeciderRequestForApiCallV2 { dateCreated: OffsetDateTime::now_utc(), paymentMethodType: self.payment_info.payment_method_type.to_string(), paymentMethod: self.payment_info.payment_method.clone(), - paymentSource: self.payment_info.payment_source.clone(), + paymentSource: self.payment_info.payment_source.clone().map(Secret::new), authType: self.payment_info.auth_type.clone(), partitionKey: None, }, diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index db927c72..1be052fc 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -26,7 +26,7 @@ use fred::prelude::{KeysInterface, ListInterface}; use masking::PeekInterface; use masking::Secret; use serde::de::DeserializeOwned; -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize, Serializer}; use serde_json::{from_slice, from_str, Value}; use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; @@ -149,21 +149,21 @@ pub fn fetch_emi_type(txn_card_info: &ETCa::txn_card_info::TxnCardInfo) -> Optio txn_card_info .paymentSource .as_ref() - .and_then(|source| get_value("emi_type", source)) + .and_then(|source| get_value("emi_type", source.peek())) } pub fn fetch_extended_card_bin(txn_card_info: &ETCa::txn_card_info::TxnCardInfo) -> Option { txn_card_info .paymentSource .as_ref() - .and_then(|source| get_value("extended_card_bin", source)) + .and_then(|source| get_value("extended_card_bin", source.peek())) } pub fn fetch_juspay_bank_code(txn_card_info: &ETCa::txn_card_info::TxnCardInfo) -> Option { txn_card_info .paymentSource .as_ref() - .and_then(|source| get_value("juspay_bank_code", source)) + .and_then(|source| get_value("juspay_bank_code", source.peek())) } pub fn get_pl_gw_ref_id_map(decider_flow: &DeciderFlow<'_>) -> HashMap { @@ -706,7 +706,7 @@ pub async fn get_split_settlement_details( } pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFormat) { - let normalized_log_data = match serde_json::to_value(&log_data) { + let mut normalized_log_data = match serde_json::to_value(&log_data) { Ok(value) => value, Err(e) => { crate::logger::warn!( @@ -717,6 +717,7 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo return; } }; + crate::logger::warn!( action = "metric_tracking_log", "{}", @@ -724,6 +725,13 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo ); } +pub fn mask_secret_option(_: &Option>, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str("FILTERED") +} + pub fn get_metric_log_format(decider_flow: &mut DeciderFlow<'_>, stage: &str) -> MessageFormat { // let mp = decider_flow.write.sr.sr_metric_log_data.clone(); let mp = decider_flow.writer.srMetricLogData.clone(); @@ -731,10 +739,7 @@ pub fn get_metric_log_format(decider_flow: &mut DeciderFlow<'_>, stage: &str) -> let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); let order_reference = decider_flow.get().dpOrder.clone(); let x_req_id = decider_flow.logger.get("x-request-id"); - let payment_source_m = txn_card_info - .paymentSource - .as_ref() - .and_then(|ps| last(split("@", ps))); + let payment_source_m = txn_card_info.get_payment_source_last(); MessageFormat { model: txn_detail @@ -744,7 +749,7 @@ pub fn get_metric_log_format(decider_flow: &mut DeciderFlow<'_>, stage: &str) -> log_type: "APP_EVENT".to_string(), payment_method: txn_card_info.paymentMethod.clone(), payment_method_type: txn_card_info.paymentMethodType.clone(), - payment_source: payment_source_m, + payment_source: payment_source_m.map(Secret::new), source_object: txn_detail.sourceObject.clone(), txn_detail_id: txn_detail.id.clone(), stage: stage.to_string(), @@ -760,7 +765,12 @@ pub fn get_metric_log_format(decider_flow: &mut DeciderFlow<'_>, stage: &str) -> bank_code: fetch_juspay_bank_code(&txn_card_info), x_request_id: x_req_id.cloned(), log_data: serde_json::to_value(mp).unwrap(), - udf_consumed: decider_flow.writer.gateway_scoring_data.udfs_consumed_for_routing.as_ref().cloned() + udf_consumed: decider_flow + .writer + .gateway_scoring_data + .udfs_consumed_for_routing + .as_ref() + .cloned(), } } @@ -793,10 +803,7 @@ pub async fn log_gateway_decider_approach( dateCreated: txn_creation_time, }; - let payment_source_m = txn_card_info - .paymentSource - .as_ref() - .and_then(|ps| ps.split('@').next_back().map(String::from)); + let payment_source_m = txn_card_info.get_payment_source_last(); metric_tracker_log( "GATEWAY_DECIDER_APPROACH", @@ -809,7 +816,7 @@ pub async fn log_gateway_decider_approach( log_type: "APP_EVENT".to_string(), payment_method: txn_card_info.clone().paymentMethod, payment_method_type: txn_card_info.clone().paymentMethodType.to_string(), - payment_source: payment_source_m, + payment_source: payment_source_m.map(Secret::new), source_object: txn_detail.sourceObject, txn_detail_id: txn_detail.id, stage: "GATEWAY_DECIDER_APPROACH".to_string(), @@ -825,7 +832,7 @@ pub async fn log_gateway_decider_approach( bank_code: fetch_juspay_bank_code(&txn_card_info), x_request_id: x_req_id, log_data: serde_json::to_value(mp).unwrap(), - udf_consumed: None + udf_consumed: None, }, ) .await; @@ -1914,7 +1921,7 @@ pub fn get_default_gateway_scoring_data( country: country, is_legacy_decider_flow, udfs, - udfs_consumed_for_routing: None + udfs_consumed_for_routing: None, } } @@ -1994,9 +2001,10 @@ pub async fn get_gateway_scoring_data( set_is_experiment_tag(decider_flow, experiment_tag); } - let payment_source = get_true_string(txn_card_info.paymentSource.clone()) + let payment_source = get_true_string(txn_card_info.get_payment_source()) .map(|source| source.split("@").last().unwrap_or_default().to_uppercase()) - .unwrap_or_default(); + .map(Secret::new) + .unwrap_or_else(|| Secret::new(String::new())); default_gateway_scoring_data.paymentSource = Some(payment_source); default_gateway_scoring_data.isPaymentSourceEnabledForSrRouting = handle_and_package_based_routing; @@ -2090,8 +2098,8 @@ pub async fn get_unified_key( ( vec![key_prefix, &order_type.as_str()], vec![ - payment_method_type, - payment_method, + payment_method_type.to_string(), + payment_method.to_string(), gateway_scoring_data .cardType .clone() @@ -2196,7 +2204,8 @@ pub async fn get_unified_key( result_keys } ScoreKeyType::SrV2Key => { - let key = get_unified_sr_key(&gateway_scoring_data, false, enforce1d, decider_flow).await; + let key = + get_unified_sr_key(&gateway_scoring_data, false, enforce1d, decider_flow).await; let gri_sr_v2_cutover = gateway_scoring_data.isGriEnabledForSrRouting; if gri_sr_v2_cutover { @@ -2220,7 +2229,8 @@ pub async fn get_unified_key( } } ScoreKeyType::SrV3Key => { - let base_key = get_unified_sr_key(&gateway_scoring_data, true, enforce1d, decider_flow).await; + let base_key = + get_unified_sr_key(&gateway_scoring_data, true, enforce1d, decider_flow).await; let gri_sr_v2_cutover = gateway_scoring_data.isGriEnabledForSrRouting; if gri_sr_v2_cutover { @@ -2259,21 +2269,35 @@ pub async fn get_unified_key( let key_prefix = C::GLOBAL_LEVEL_OUTAGE_KEY_PREFIX; let base_key = if payment_method_type == CARD { vec![ - key_prefix, - &payment_method_type, - &payment_method, - gateway_scoring_data.bankCode.as_deref().unwrap_or(""), - gateway_scoring_data.cardType.as_deref().unwrap_or(""), + key_prefix.to_string(), + payment_method_type.to_string(), + payment_method.to_string(), + gateway_scoring_data + .bankCode + .as_deref() + .unwrap_or("") + .to_string(), + gateway_scoring_data + .cardType + .as_deref() + .unwrap_or("") + .to_string(), ] } else if payment_method_type == UPI { + let peek = gateway_scoring_data.get_payment_source(); + vec![ - key_prefix, - &payment_method_type, - &payment_method, - gateway_scoring_data.paymentSource.as_deref().unwrap_or(""), + key_prefix.to_string(), + payment_method_type.to_string(), + payment_method.to_string(), + peek, ] } else { - vec![key_prefix, &payment_method_type, &payment_method] + vec![ + key_prefix.to_string(), + payment_method_type.to_string(), + payment_method.to_string(), + ] }; let mut map = GatewayRedisKeyMap::new(); @@ -2291,29 +2315,39 @@ pub async fn get_unified_key( } ScoreKeyType::OutageMerchantKey => { let key_prefix = C::MERCHANT_LEVEL_OUTAGE_KEY_PREFIX; - let base_key = if payment_method_type == CARD { + let base_key: Vec = if payment_method_type == CARD { vec![ - key_prefix, - &merchant_id, - &payment_method_type, - &payment_method, - gateway_scoring_data.bankCode.as_deref().unwrap_or(""), - gateway_scoring_data.cardType.as_deref().unwrap_or(""), + key_prefix.to_string(), + merchant_id.clone(), + payment_method_type.to_string(), + payment_method.to_string(), + gateway_scoring_data + .bankCode + .as_deref() + .unwrap_or("") + .to_string(), + gateway_scoring_data + .cardType + .as_deref() + .unwrap_or("") + .to_string(), ] } else if payment_method_type == UPI { + let peek = gateway_scoring_data.get_payment_source(); + vec![ - key_prefix, - &merchant_id, - &payment_method_type, - &payment_method, - gateway_scoring_data.paymentSource.as_deref().unwrap_or(""), + key_prefix.to_string(), + merchant_id.clone(), + payment_method_type.to_string(), + payment_method.to_string(), + peek, ] } else { vec![ - key_prefix, - &merchant_id, - &payment_method_type, - &payment_method, + key_prefix.to_string(), + merchant_id.clone(), + payment_method_type.to_string(), + payment_method.to_string(), ] }; @@ -2388,7 +2422,7 @@ pub async fn get_unified_sr_key( Some(value) => values.push(value.to_string()), None => { return None; - }, + } } } @@ -2398,7 +2432,8 @@ pub async fn get_unified_sr_key( if let Some(df) = decider_flow { if let Some(udf_values) = udf_values.as_ref() { if udf_values.len() == 1 { - df.writer.gateway_scoring_data.udfs_consumed_for_routing = Some(udf_values[0].clone()); + df.writer.gateway_scoring_data.udfs_consumed_for_routing = + Some(udf_values[0].clone()); } } } @@ -2528,9 +2563,9 @@ async fn get_legacy_unified_sr_key( match payment_method.as_str() { "UPI_COLLECT" | "COLLECT" => { let handle_list = get_upi_handle_list().await; - let upi_handle = gateway_scoring_data.paymentSource.as_deref().unwrap_or(""); - let append_handle = if handle_list.contains(&upi_handle.to_string()) { - upi_handle + let upi_handle = gateway_scoring_data.get_payment_source(); + let append_handle = if handle_list.contains(&upi_handle) { + &upi_handle } else { "" }; @@ -2541,9 +2576,9 @@ async fn get_legacy_unified_sr_key( } "UPI_PAY" | "PAY" => { let package_list = get_upi_package_list().await; - let upi_package = gateway_scoring_data.paymentSource.as_deref().unwrap_or(""); - let append_package = if package_list.contains(&upi_package.to_string()) { - upi_package + let upi_package = gateway_scoring_data.get_payment_source(); + let append_package = if package_list.contains(&upi_package) { + upi_package.as_str() } else { "" }; @@ -2676,8 +2711,9 @@ async fn set_routing_dimension_and_reference( "UPI_COLLECT" | "COLLECT" => { let handle_list = get_upi_handle_list().await; let upi_handle = gateway_scoring_data.paymentSource.unwrap_or_default(); - let append_handle = if handle_list.contains(&upi_handle) { - upi_handle + let upi_handle_peek = upi_handle.peek().to_string(); + let append_handle = if handle_list.contains(&upi_handle_peek) { + upi_handle_peek } else { "".to_string() }; @@ -2692,8 +2728,8 @@ async fn set_routing_dimension_and_reference( "UPI_PAY" | "PAY" => { let package_list = get_upi_package_list().await; let upi_package = gateway_scoring_data.paymentSource.unwrap_or_default(); - let append_package = if package_list.contains(&upi_package) { - upi_package + let append_package = if package_list.contains(&upi_package.peek()) { + upi_package.peek().to_string() } else { "".to_string() }; @@ -2831,7 +2867,11 @@ pub fn set_outage_dimension( "/", &[ base_dimension, - vec![gateway_scoring_data.paymentSource.unwrap_or_default()], + vec![gateway_scoring_data + .paymentSource + .unwrap_or_default() + .peek() + .to_string()], ] .concat(), ) diff --git a/src/feedback/types.rs b/src/feedback/types.rs index 1dac2dea..322a7918 100644 --- a/src/feedback/types.rs +++ b/src/feedback/types.rs @@ -7,7 +7,9 @@ use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; // use database::beam as B; // use chrono::{Local, Utc}; +use crate::decider::gatewaydecider::utils::mask_secret_option; use crate::types::txn_details::types::{TransactionLatency, TxnStatus}; +use masking::Secret; use std::string::String; // use eulerhs::types::MeshError; @@ -106,7 +108,8 @@ pub struct GatewayScoringKeyType { pub sourceObject: Option, #[serde(rename = "paymentSource")] - pub paymentSource: Option, + #[serde(serialize_with = "mask_secret_option")] + pub paymentSource: Option>, #[serde(rename = "cardType")] pub cardType: Option, diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index b9646df7..87df8a83 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -179,7 +179,7 @@ where env = std::env::var("APP_ENV").unwrap_or_else(|_| "development".to_string()), action = "POST", - req_body = String::from_utf8_lossy(&body).to_string(), + req_body = format!("{:?}", payload), req_headers = format!("{:?}", headers), res_body = res_body, res_code = 200, diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index 0e6ceca0..fb7655eb 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -12,7 +12,7 @@ use axum::body::to_bytes; use cpu_time::ProcessTime; use serde::{Deserialize, Serialize}; -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] struct UpdateScoreRequest { txn_detail: SafeTxnDetail, txn_card_info: SafeTxnCardInfo, @@ -160,23 +160,24 @@ pub async fn update_score( } // Process the request - let txn_detail = match convert_safe_txn_detail_to_txn_detail(payload.txn_detail) { + let txn_detail = match convert_safe_txn_detail_to_txn_detail(payload.txn_detail.clone()) + { Ok(detail) => detail, Err(e) => { return Err(invalid_request_error("transaction details", &e)); } }; - let txn_card_info = match convert_safe_to_txn_card_info(payload.txn_card_info) { + let txn_card_info = match convert_safe_to_txn_card_info(payload.txn_card_info.clone()) { Ok(card_info) => card_info, Err(e) => { return Err(invalid_request_error("transaction Card Info", &e)); } }; - let log_message = payload.log_message; + let log_message = payload.log_message.clone(); let enforce_failure = payload.enforce_dynaic_routing_failure.unwrap_or(false); - let gateway_reference_id = payload.gateway_reference_id; - let txn_latency = payload.txn_latency; + let gateway_reference_id = payload.gateway_reference_id.clone(); + let txn_latency = payload.txn_latency.clone(); jemalloc_ctl::epoch::advance().unwrap(); let allocated_before = jemalloc_ctl::stats::allocated::read().unwrap_or(0); @@ -210,7 +211,7 @@ pub async fn update_score( request_time = request_time, env = std::env::var("APP_ENV").unwrap_or_else(|_| "development".to_string()), action = "POST", - req_body = req_body, + req_body = format!("{:?}", payload.clone()), category = "INCOMING_API", req_headers = format!("{:?}", headers), "Successfully updated score" diff --git a/src/storage/types.rs b/src/storage/types.rs index 0103a758..54fd1206 100644 --- a/src/storage/types.rs +++ b/src/storage/types.rs @@ -10,6 +10,7 @@ use diesel::sql_types::Bool; use super::schema; #[cfg(feature = "postgres")] use super::schema_pg; +use crate::decider::gatewaydecider::utils::mask_secret_option; #[cfg(feature = "mysql")] use diesel::mysql::Mysql; #[cfg(feature = "postgres")] @@ -22,6 +23,7 @@ use diesel::{ Queryable, Selectable, }; use error_stack::ResultExt; +use masking::{PeekInterface, Secret}; use serde::Serialize; use serde::{self, Deserialize}; use std::io::Write; @@ -591,7 +593,7 @@ pub struct TokenBinInfo { pub last_updated: Option, } -#[derive(Debug, Clone, Identifiable, Queryable)] +#[derive(Debug, Clone, Identifiable, Queryable, Serialize)] #[cfg_attr(feature = "mysql", diesel(table_name = schema::txn_card_info))] #[cfg_attr(feature = "postgres", diesel(table_name = schema_pg::txn_card_info))] pub struct TxnCardInfo { @@ -606,7 +608,8 @@ pub struct TxnCardInfo { pub date_created: Option, pub payment_method_type: Option, pub payment_method: Option, - pub payment_source: Option, + #[serde(serialize_with = "mask_secret_option")] + pub payment_source: Option>, pub auth_type: Option, pub partition_key: Option, } diff --git a/src/types/card/txn_card_info.rs b/src/types/card/txn_card_info.rs index e70ad730..0a848996 100644 --- a/src/types/card/txn_card_info.rs +++ b/src/types/card/txn_card_info.rs @@ -1,12 +1,13 @@ use crate::error::ApiError; use crate::types::card::card_type::CardType; -use masking::Secret; +use masking::{PeekInterface, Secret}; use serde::{Deserialize, Deserializer, Serialize}; use time::{OffsetDateTime, PrimitiveDateTime}; // use crate::types::transaction::id::TransactionId; // use crate::types::txn_details::types::TxnDetailId; // use juspay::extra::parsing::{Step, lift_either, lift_pure, ParsingErrorType}; // use juspay::extra::secret::{Secret, SecretContext}; +use crate::decider::gatewaydecider::utils::mask_secret_option; use std::fmt::Debug; use std::option::Option; use std::string::String; @@ -152,7 +153,8 @@ pub struct TxnCardInfo { #[serde(rename = "paymentMethod")] pub paymentMethod: String, #[serde(rename = "paymentSource")] - pub paymentSource: Option, + #[serde(serialize_with = "mask_secret_option")] + pub paymentSource: Option>, #[serde(rename = "authType")] pub authType: Option, #[serde(rename = "partitionKey")] @@ -160,6 +162,20 @@ pub struct TxnCardInfo { pub partitionKey: Option, } +impl TxnCardInfo { + pub fn get_payment_source_last(&self) -> Option { + self.paymentSource.as_ref().and_then(|ps| { + // use `expose_secret()` instead of peek() + let ps_str = ps.peek(); + ps_str.split('@').last().map(|s| s.to_string()) + }) + } + + pub fn get_payment_source(&self) -> Option { + self.paymentSource.clone().map(|s| s.peek().to_string()) + } +} + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct SafeTxnCardInfo { #[serde(rename = "id")] @@ -182,7 +198,8 @@ pub struct SafeTxnCardInfo { #[serde(rename = "paymentMethod")] pub paymentMethod: String, #[serde(rename = "paymentSource")] - pub paymentSource: Option, + #[serde(serialize_with = "mask_secret_option")] + pub paymentSource: Option>, #[serde(rename = "authType")] pub authType: Option, #[serde(rename = "partitionKey")] From aa29c5d1ad750fb5bee2b566aba8d3dee74a7d40 Mon Sep 17 00:00:00 2001 From: Gaurav Rawat <104276743+GauravRawat369@users.noreply.github.com> Date: Thu, 20 Nov 2025 15:05:19 +0530 Subject: [PATCH 43/95] fix: set default for optional udfs in PaymentInfo struct (#185) --- src/decider/gatewaydecider/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 6c2fafa0..1ca9b3c1 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -968,7 +968,7 @@ pub struct PaymentInfo { currency: Currency, country: Option, customer_id: Option, - #[serde(deserialize_with = "deserialize_optional_udfs_to_hashmap")] + #[serde(default, deserialize_with = "deserialize_optional_udfs_to_hashmap")] udfs: Option, preferred_gateway: Option, payment_type: TxnObjectType, From 4e781276a0a5e9bb1d381cd1acec2d95aa51e502 Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Thu, 20 Nov 2025 18:29:41 +0530 Subject: [PATCH 44/95] Changes for Debug (#187) --- src/decider/gatewaydecider/gw_filter.rs | 8 +++--- src/decider/gatewaydecider/gw_scoring.rs | 34 ++++++++++++------------ src/decider/gatewaydecider/utils.rs | 4 +-- src/logger/formatter.rs | 9 ++++--- src/routes/decision_gateway.rs | 5 ++++ 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index fd80f93c..b1482ff8 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -1500,7 +1500,7 @@ pub async fn filterGatewaysForValidationType( .map(|g| g.gateway) .collect::>(); - logger::debug!( + logger::error!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering after filterGatewaysCardInfo for txn_id {:?}: {:?}", @@ -1534,7 +1534,7 @@ pub async fn filterGatewaysForValidationType( let final_gws = if gws.is_empty() { new_gws.clone() } else { gws }; - logger::debug!( + logger::error!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for token repeat Mandate support for txn_id {:?}: {:?}", @@ -1565,7 +1565,7 @@ pub async fn filterGatewaysForValidationType( let final_gws = if gws.is_empty() { new_gws.clone() } else { gws }; - logger::debug!( + logger::error!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for Mandate Guest Checkout support for txn_id {:?}: {:?}", @@ -1681,7 +1681,7 @@ pub async fn filterGatewaysForValidationType( .map(|g| g.gateway) .collect::>(); - logger::debug!( + logger::error!( "nst for filterGatewaysForValidationType for txn_id {:?}: {:?}", txn_detail.txnId.clone(), nst diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index c89114e2..31a55305 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1294,7 +1294,7 @@ pub async fn get_global_gateway_score( } } } else { - logger::warn!( + logger::error!( tag = "getGlobalGatewayScore", action = "getGlobalGatewayScore", "max_count is {:?}, score_threshold is {:?}", @@ -1432,7 +1432,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }) .collect::>(); - logger::warn!( + logger::error!( tag = "scoringFlow", action = "scoringFlow", "Gateway Success Rate Inputs for Global SR based elimination for {:?} : {:?}", @@ -1450,7 +1450,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) .await; - logger::warn!( + logger::error!( tag = "scoringFlow", action = "scoringFlow", "Gateway Redis Key Map for Global SR based elimination for {:?} : {:?}", @@ -1466,7 +1466,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( gsri.clone(), ) .await; - logger::warn!( + logger::error!( tag = "scoringFlow", action = "scoringFlow", "Global Elimination Gateway Score for {:?} : {:?}", @@ -1475,8 +1475,8 @@ pub async fn update_gateway_score_based_on_global_success_rate( ); match global_elimination_gateway_score { Some((global_gateway_score, s)) => { - logger::warn!(action = "global_gateway_score", "s-value : {:?}", s); - logger::warn!( + logger::error!(action = "global_gateway_score", "s-value : {:?}", s); + logger::error!( action = "global_gateway_score", "global_gateway_score{:?}", global_gateway_score @@ -1485,14 +1485,14 @@ pub async fn update_gateway_score_based_on_global_success_rate( currentScore: Some(s), ..gsri.clone() }; - logger::warn!( + logger::error!( action = "global_gateway_score", "Global Elimination Gateway Score for {:?} : {:?}", txn_detail.txnId, new_gsri ); upd_gateway_success_rate_inputs.push(new_gsri); - logger::warn!( + logger::error!( action = "global_gateway_score", "upd_gateway_success_rate_inputs{:?}", upd_gateway_success_rate_inputs @@ -1501,7 +1501,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( gsri.gateway.clone(), global_gateway_score, )); - logger::warn!( + logger::error!( action = "update_global_score_log", "global_gateway_scores{:?}", global_gateway_scores @@ -1511,7 +1511,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( } } - logger::warn!( + logger::error!( action = "update_gateway_score_based_on_global_success_rate", "upd_gateway_success_rate_inputs{:?}", upd_gateway_success_rate_inputs @@ -1530,7 +1530,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }) .collect(); - logger::warn!( + logger::error!( action = "filtered_gateway_success_rate_inputs", "filtered_gateway_success_rate_inputs{:?}", filtered_gateway_success_rate_inputs @@ -1571,7 +1571,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }, ); } else { - logger::warn!( + logger::error!( tag="scoringFlow", action = "scoringFlow", "No gateways are eligible for penalties & fallback {:?} based on global score", @@ -1589,7 +1589,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( } let old_sr_metric_log_data = decider_flow.writer.srMetricLogData.clone(); - logger::warn!( + logger::error!( tag = "MetricData-GLOBAL-ELIMINATION", action = "MetricData-GLOBAL-ELIMINATION", "{:?}", @@ -1616,7 +1616,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) .await; } else { - logger::warn!( + logger::error!( tag = "scoringFlow", action = "scoringFlow", "Global scores not available for {:?} {:?}", @@ -1625,7 +1625,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ); } - logger::warn!( + logger::error!( tag = "scoringFlow", action = "scoringFlow", "Gateway scores after considering global SR based elimination for {:?} : {:?}", @@ -1639,13 +1639,13 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) } Err(reason) => { - logger::warn!( + logger::error!( tag = "Global SR routing", action = "Global SR routing", "{:?}", reason ); - logger::warn!( + logger::error!( tag = "scoringFlow", action = "scoringFlow", "Global SR routing not enabled for merchant {:?} txn {:?}", diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 1be052fc..267f3579 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -709,7 +709,7 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo let mut normalized_log_data = match serde_json::to_value(&log_data) { Ok(value) => value, Err(e) => { - crate::logger::warn!( + crate::logger::error!( action = "metric_tracking_log_error", "Failed to serialize log_data: {}", e @@ -718,7 +718,7 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo } }; - crate::logger::warn!( + crate::logger::error!( action = "metric_tracking_log", "{}", normalized_log_data.to_string(), diff --git a/src/logger/formatter.rs b/src/logger/formatter.rs index f9cd40e2..1613bf76 100644 --- a/src/logger/formatter.rs +++ b/src/logger/formatter.rs @@ -18,6 +18,7 @@ use crate::logger; use super::env::get_env_var; use super::storage::Storage; +use std::sync::Mutex; use time::format_description::well_known::Iso8601; use tracing::{Event, Metadata, Subscriber}; use tracing_subscriber::{ @@ -342,7 +343,11 @@ where explicit_entries_set.insert("resp_code"); } if !explicit_entries_set.contains("level") { - map_serializer.serialize_entry("level", &Value::String("Info".to_string()))?; + if metadata.level() == &tracing::Level::ERROR { + map_serializer.serialize_entry("level", &Value::String("Error".to_string()))?; + } else { + map_serializer.serialize_entry("level", &Value::String("Info".to_string()))?; + } explicit_entries_set.insert("level"); } if !explicit_entries_set.contains("cell_id") { @@ -350,8 +355,6 @@ where explicit_entries_set.insert("cell_id"); } } else { - // DOMAIN category logic. - // Serialize keys from the span that match the domain keys array. if let Some(span) = span { let extensions = span.extensions(); if let Some(visitor) = extensions.get::>() { diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index 87df8a83..bec39d91 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -150,6 +150,11 @@ where let allocated_after = jemalloc_ctl::stats::allocated::read().unwrap_or(0); let bytes_allocated = allocated_after.saturating_sub(allocated_before); + logger::info!(action = "INFO_LOG_CHECK", "INFO LOG GETTING LOGGED"); + logger::debug!(action = "DEBUG_LOG_CHECK", "DEBUG LOG GETTING LOGGED"); + logger::warn!(action = "WARN_LOG_CHECK", "WARN LOG GETTING LOGGED"); + logger::error!(action = "ERROR_LOG_CHECK", "ERROR LOG GETTING LOGGED"); + let final_result = match result { Ok((decided_gateway, filter_list)) => { let cpu_time = cpu_start.elapsed().as_millis() as u64; From bd366f72c12742edbfe2cdc508fe2c7c80cb4b4b Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Mon, 24 Nov 2025 13:46:40 +0530 Subject: [PATCH 45/95] Fix/log debugging (#188) --- src/decider/gatewaydecider/gw_filter.rs | 30 ++--- src/decider/gatewaydecider/gw_filter_new.rs | 16 +-- src/decider/gatewaydecider/gw_scoring.rs | 108 +++++++++--------- src/decider/gatewaydecider/utils.rs | 4 +- .../storage/utils/merchant_gateway_account.rs | 4 +- src/euclid/handlers/routing_rules.rs | 8 +- src/euclid/interpreter.rs | 2 +- .../gateway_elimination_scoring/flow.rs | 6 +- src/feedback/gateway_scoring_service.rs | 20 ++-- .../gateway_selection_scoring_v3/flow.rs | 16 +-- src/feedback/utils.rs | 6 +- src/logger/formatter.rs | 14 +-- src/metrics.rs | 4 +- src/routes/decision_gateway.rs | 5 - src/storage.rs | 2 +- src/types/gateway_card_info.rs | 8 +- .../merchant/merchant_gateway_account.rs | 2 +- src/utils.rs | 2 +- 18 files changed, 121 insertions(+), 136 deletions(-) diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index b1482ff8..81788bf7 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -184,7 +184,7 @@ pub async fn newGwFilters( if gws.is_empty() { let txnId = this.get().dpTxnDetail.txnId.clone(); let merchantId = this.get().dpTxnDetail.merchantId.clone(); - logger::warn!( + logger::debug!( tag = "GW_Filtering", action = "GW_Filtering", "There are no functional gateways for {:?} for merchant: {:?}", @@ -243,7 +243,7 @@ pub async fn getFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList { let is_edcc_applied = this.get().dpEDCCApplied; let enforce_gateway_list = this.get().dpEnforceGatewayList.clone(); - logger::info!( + logger::debug!( tag = "enableGatewayReferenceIdBasedRouting", action = "enableGatewayReferenceIdBasedRouting", "enableGatewayReferenceIdBasedRouting is enable or not for txn_id : {:?}, enableGatewayReferenceIdBasedRouting: {:?}", @@ -649,7 +649,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList .into_iter() .filter(|gw| motoSupportedGateways.contains(gw)) .collect(); - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for MOTO cvvLessTxns support for txn_id: {:?}", @@ -741,7 +741,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList Vec::new() } }; - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for token repeat cvvLessTxns support for txn_id: {:?}", @@ -777,7 +777,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList } else { Vec::new() }; - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for token repeat cvvLessTxns support for txn_id: {:?}", @@ -811,7 +811,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList .into_iter() .filter(|gw| cvvLessTxnSupportedGateways.contains(gw)) .collect(); - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for cvvLessTxns for txn_id: {:?}", @@ -884,7 +884,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList } let st = getGws(this); - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways before filtering for MerchantContainer for txn_id: {:?}", @@ -1119,7 +1119,7 @@ pub async fn filterGatewaysForAuthType( ) .await; - logger::debug!( + logger::info!( action = "filterFunctionalGatewaysForAuthType", "BIN eligibility check feature flag: {:?}", mb_feature @@ -1203,7 +1203,7 @@ pub async fn filterGatewaysForAuthType( ) .await?; - logger::debug!( + logger::info!( tag = "filterFunctionalGatewaysForAuthType", action = "filterFunctionalGatewaysForAuthType", "Functional gateways after filtering after DISABLE_DECIDER_BIN_ELIGIBILITY_CHECK check: {:?}: {:?}", @@ -1500,7 +1500,7 @@ pub async fn filterGatewaysForValidationType( .map(|g| g.gateway) .collect::>(); - logger::error!( + logger::info!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering after filterGatewaysCardInfo for txn_id {:?}: {:?}", @@ -1534,7 +1534,7 @@ pub async fn filterGatewaysForValidationType( let final_gws = if gws.is_empty() { new_gws.clone() } else { gws }; - logger::error!( + logger::info!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for token repeat Mandate support for txn_id {:?}: {:?}", @@ -1565,7 +1565,7 @@ pub async fn filterGatewaysForValidationType( let final_gws = if gws.is_empty() { new_gws.clone() } else { gws }; - logger::error!( + logger::info!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for Mandate Guest Checkout support for txn_id {:?}: {:?}", @@ -1681,7 +1681,7 @@ pub async fn filterGatewaysForValidationType( .map(|g| g.gateway) .collect::>(); - logger::error!( + logger::info!( "nst for filterGatewaysForValidationType for txn_id {:?}: {:?}", txn_detail.txnId.clone(), nst @@ -1969,7 +1969,7 @@ pub async fn filterGatewaysCardInfo( .collect::>(), }; - logger::info!( + logger::debug!( tag = "filterGatewaysCardInfo", action = "filterGatewaysCardInfo", "merchant_validation_required_gws - {:?}, gci_validation_gws - {:?}, gcis - {:?}, gcis_without_merchant_validation - {:?}, gcis_with_merchant_validation - {:?}, gci_ids - {:?}, mgcis_enabled_gcis - {:?},mgcis_enabled_gci_ids - {:?}, gcis_after_merchant_validation - {:?}, eligible_gateway_card_infos - {:?}", @@ -2273,7 +2273,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { }; if gbes_v2_list.is_empty() { - logger::info!( + logger::debug!( tag = "GBESV2 Entry Not Found", action = "GBESV2 Entry Not Found", "GBESV2 Entry Not Found For emiBank - {:?}, gateways - {:?}, scope_ - {:?}, tenure - {:?}", diff --git a/src/decider/gatewaydecider/gw_filter_new.rs b/src/decider/gatewaydecider/gw_filter_new.rs index 832e2231..30fcefee 100644 --- a/src/decider/gatewaydecider/gw_filter_new.rs +++ b/src/decider/gatewaydecider/gw_filter_new.rs @@ -65,7 +65,7 @@ pub async fn newGwFilters(this: &mut DeciderFlow<'_>) -> (GatewayList, Vec) -> GatewayList { let is_edcc_applied = this.get().dpEDCCApplied.clone(); let enforce_gateway_list = this.get().dpEnforceGatewayList.clone(); - logger::info!( + logger::debug!( tag = "enableGatewayReferenceIdBasedRouting", action = "enableGatewayReferenceIdBasedRouting", "enableGatewayReferenceIdBasedRouting is enable or not for txn_id : {:?}, enableGatewayReferenceIdBasedRouting: {:?}", @@ -257,7 +257,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList let filtered_gateways: Vec = st.into_iter() .filter(|gw| motoSupportedGateways.contains(gw)) .collect(); - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for MOTO cvvLessTxns support for txn_id: {:?}", @@ -326,7 +326,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList Vec::new() } }; - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for token repeat cvvLessTxns support for txn_id: {:?}", @@ -352,7 +352,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList } else { Vec::new() }; - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for token repeat cvvLessTxns support for txn_id: {:?}", @@ -373,7 +373,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList let filtered_gateways: Vec = st.into_iter() .filter(|gw| cvvLessTxnSupportedGateways.contains(gw)) .collect(); - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways after filtering for cvvLessTxns for txn_id: {:?}", @@ -426,7 +426,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList } let st = getGws(this); - logger::info!( + logger::debug!( tag = "filterFunctionalGateways", action = "filterFunctionalGateways", "Functional gateways before filtering for MerchantContainer for txn_id: {:?}", @@ -583,7 +583,7 @@ pub async fn filterGatewaysForEmi(this: &mut DeciderFlow<'_>) -> GatewayList { txn_detail.emiTenure.map(|tenure| tenure as i32) ).await; if gbes_v2s.is_empty() { - logger::info!( + logger::debug!( tag = "GBESV2 Entry Not Found", action = "GBESV2 Entry Not Found", "GBESV2 Entry Not Found For emiBank - {:?}, gateways - {:?}, scope - {:?}, tenure - {:?}", diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 31a55305..9308dc37 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -235,7 +235,7 @@ pub async fn scoring_flow( || ranking_algorithm == Some(RankingAlgorithm::SrBasedRouting); if is_sr_v3_metric_enabled { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Deciding Gateway based on SR V3 Routing for merchant {:?} and for txn Id {:?}", @@ -250,14 +250,14 @@ pub async fn scoring_flow( let default_sr_v3_input_config = findByNameFromRedis(C::SR_V3_DEFAULT_INPUT_CONFIG.get_key()).await; - logger::info!( + logger::debug!( tag = "scoringFlow_Sr_V3_Input_Config", action = "scoringFlow_Sr_V3_Input_Config", "Sr V3 Input Config {:?}", merchant_sr_v3_input_config ); - logger::info!( + logger::debug!( tag = "scoringFlow_Sr_V3_Default_Input_Config", action = "scoringFlow_Sr_V3_Default_Input_Config", "Sr V3 Default Input Config {:?}", @@ -325,7 +325,7 @@ pub async fn scoring_flow( let initial_sr_gw_scores_list = toListOfGatewayScore(initial_sr_gw_scores.clone()); - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Gateway Scores based on SR V3 Routing for txn id : {:?} is {:?}", @@ -336,7 +336,7 @@ pub async fn scoring_flow( if !initial_sr_gw_scores.is_empty() { Utils::set_sr_gateway_scores(decider_flow, initial_sr_gw_scores_list); - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Considering Gateway Scores based on SR V3 for txn id : {:?}", @@ -396,7 +396,7 @@ pub async fn scoring_flow( true } else { - logger::info!( + logger::debug!( tag="scoringFlow", action = "scoringFlow", "Gateway Scores based on SR V3 for txn id : {:?} and for merchant : {:?} is null, So falling back to priorityLogic", @@ -421,7 +421,7 @@ pub async fn scoring_flow( Utils::set_is_optimized_based_on_sr_metric_enabled(decider_flow, false); if !is_sr_v3_metric_enabled { - logger::info!( + logger::debug!( tag="scoringFlow", action = "scoringFlow", "Ordering gateways available based on PRIORITY for merchant {:?} and for txn Id {:?}", @@ -433,7 +433,7 @@ pub async fn scoring_flow( get_score_with_priority(functional_gateways.clone(), gateway_priority_list.clone()); set_gwsm(decider_flow, gateway_score.clone()); return_sm_with_log(decider_flow, DeciderScoringName::GetScoreWithPriority, true); - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Gateway scores after considering priority for {:?} : {:?}", @@ -444,7 +444,7 @@ pub async fn scoring_flow( // update_score_for_isin(decider_flow); // update_score_for_card_brand(decider_flow); } else { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "skipped priority for merchant {:?} and for txn Id {:?}", @@ -1294,7 +1294,7 @@ pub async fn get_global_gateway_score( } } } else { - logger::error!( + logger::info!( tag = "getGlobalGatewayScore", action = "getGlobalGatewayScore", "max_count is {:?}, score_threshold is {:?}", @@ -1432,7 +1432,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }) .collect::>(); - logger::error!( + logger::info!( tag = "scoringFlow", action = "scoringFlow", "Gateway Success Rate Inputs for Global SR based elimination for {:?} : {:?}", @@ -1450,7 +1450,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) .await; - logger::error!( + logger::info!( tag = "scoringFlow", action = "scoringFlow", "Gateway Redis Key Map for Global SR based elimination for {:?} : {:?}", @@ -1466,7 +1466,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( gsri.clone(), ) .await; - logger::error!( + logger::info!( tag = "scoringFlow", action = "scoringFlow", "Global Elimination Gateway Score for {:?} : {:?}", @@ -1475,8 +1475,8 @@ pub async fn update_gateway_score_based_on_global_success_rate( ); match global_elimination_gateway_score { Some((global_gateway_score, s)) => { - logger::error!(action = "global_gateway_score", "s-value : {:?}", s); - logger::error!( + logger::info!(action = "global_gateway_score", "s-value : {:?}", s); + logger::info!( action = "global_gateway_score", "global_gateway_score{:?}", global_gateway_score @@ -1485,14 +1485,14 @@ pub async fn update_gateway_score_based_on_global_success_rate( currentScore: Some(s), ..gsri.clone() }; - logger::error!( + logger::info!( action = "global_gateway_score", "Global Elimination Gateway Score for {:?} : {:?}", txn_detail.txnId, new_gsri ); upd_gateway_success_rate_inputs.push(new_gsri); - logger::error!( + logger::info!( action = "global_gateway_score", "upd_gateway_success_rate_inputs{:?}", upd_gateway_success_rate_inputs @@ -1501,7 +1501,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( gsri.gateway.clone(), global_gateway_score, )); - logger::error!( + logger::info!( action = "update_global_score_log", "global_gateway_scores{:?}", global_gateway_scores @@ -1511,7 +1511,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( } } - logger::error!( + logger::info!( action = "update_gateway_score_based_on_global_success_rate", "upd_gateway_success_rate_inputs{:?}", upd_gateway_success_rate_inputs @@ -1530,7 +1530,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }) .collect(); - logger::error!( + logger::info!( action = "filtered_gateway_success_rate_inputs", "filtered_gateway_success_rate_inputs{:?}", filtered_gateway_success_rate_inputs @@ -1571,7 +1571,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }, ); } else { - logger::error!( + logger::info!( tag="scoringFlow", action = "scoringFlow", "No gateways are eligible for penalties & fallback {:?} based on global score", @@ -1589,7 +1589,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( } let old_sr_metric_log_data = decider_flow.writer.srMetricLogData.clone(); - logger::error!( + logger::info!( tag = "MetricData-GLOBAL-ELIMINATION", action = "MetricData-GLOBAL-ELIMINATION", "{:?}", @@ -1616,7 +1616,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ) .await; } else { - logger::error!( + logger::info!( tag = "scoringFlow", action = "scoringFlow", "Global scores not available for {:?} {:?}", @@ -1625,7 +1625,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( ); } - logger::error!( + logger::info!( tag = "scoringFlow", action = "scoringFlow", "Gateway scores after considering global SR based elimination for {:?} : {:?}", @@ -1917,7 +1917,7 @@ async fn get_elimination_v2_threshold( ) .await { - logger::info!( + logger::debug!( tag="scoringFlow", action = "scoringFlow", "Calculating Threshold: SR1: {:?} SR2: {:?} N: {:?} PMT: {:?} PM: {:?} TxnObjectType: {:?} SourceObject: {:?}", @@ -1930,7 +1930,7 @@ async fn get_elimination_v2_threshold( txn_detail.sourceObject.as_ref().unwrap_or(&"Nothing".to_string()) ); - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Threshold value: {:?}", @@ -1941,7 +1941,7 @@ async fn get_elimination_v2_threshold( Some(((sr1_th_weight * sr1) + (sr2_th_weight * sr2)) / 100.0) } else { - logger::info!( + logger::debug!( tag="scoringFlow", action = "scoringFlow", "Elimination V2 values not found: Threshold: PMT: {:?} PM: {:?} TxnObjectType: {:?} SourceObject: {:?}", @@ -2363,12 +2363,12 @@ pub async fn update_gateway_score_based_on_success_rate( let (default_success_rate_based_routing_input, gateway_success_rate_merchant_input) = get_success_rate_routing_inputs(merchant_acc.clone()).await; - logger::info!( + logger::debug!( action = "update_gateway_score_based_on_success_rate", "Default SR based routing input: {:?}", default_success_rate_based_routing_input ); - logger::info!( + logger::debug!( action = "update_gateway_score_based_on_success_rate", "Merchant SR based routing input: {:?}", gateway_success_rate_merchant_input @@ -2381,7 +2381,7 @@ pub async fn update_gateway_score_based_on_success_rate( ) .await; - logger::info!( + logger::debug!( action = "update_gateway_score_based_on_success_rate", "Is reset score enabled for merchant {:?}", is_reset_score_enabled_for_merchant @@ -2398,12 +2398,12 @@ pub async fn update_gateway_score_based_on_success_rate( .map(|input| input.enabledPaymentMethodTypes.clone()) .unwrap_or_default(); - logger::info!(action = "update_gateway_score_based_on_success_rate","Enabled payment method types for merchant {:?} and Payment method type for transaction {:?}", enabled_payment_method_types, payment_method_type); + logger::debug!(action = "update_gateway_score_based_on_success_rate","Enabled payment method types for merchant {:?} and Payment method type for transaction {:?}", enabled_payment_method_types, payment_method_type); if !enabled_payment_method_types.is_empty() && !enabled_payment_method_types.contains(&payment_method_type.to_string()) { - logger::info!( + logger::debug!( tag="scoringFlow", action = "scoringFlow", "Transaction {:?} with payment method types {:?} not enabled by {:?} for SR based routing", @@ -2424,7 +2424,7 @@ pub async fn update_gateway_score_based_on_success_rate( ) .await; - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Gateway scores input for merchant wise SR based evaluation for {:?} : {:?}", @@ -2546,7 +2546,7 @@ pub async fn update_gateway_score_based_on_success_rate( }, ); - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "No gateways are eligible for penalties & fallback : {:?}", @@ -2659,7 +2659,7 @@ pub async fn update_gateway_score_based_on_success_rate( if optimization_during_downtime_enabled { if is_sr_metric_enabled { - logger::info!( + logger::debug!( tag="scoringFlow", action = "scoringFlow", "Overriding priority with SR Scores during downtime for {:?} : {:?}", @@ -2669,7 +2669,7 @@ pub async fn update_gateway_score_based_on_success_rate( (new_gateway_score.clone(), DownTime::AllDowntime, vec![]) } else { - logger::info!( + logger::debug!( "Overriding priority with PL during downtime for {:?} : {:?}", txn_detail.txnId, initial_gw_scores, @@ -2678,7 +2678,7 @@ pub async fn update_gateway_score_based_on_success_rate( (initial_gw_scores.clone(), DownTime::AllDowntime, vec![]) } } else { - logger::info!( + logger::debug!( tag="scoringFlow", action = "scoringFlow", "Overriding priority with SR Scores during downtime is not enabled for {:?} : {:?}", @@ -2728,14 +2728,14 @@ pub async fn update_gateway_score_based_on_success_rate( sr_based_elimination_approach_info_res, ); - logger::info!("routing_approach: {:?}", gateway_decider_approach); + logger::debug!("routing_approach: {:?}", gateway_decider_approach); } } } let gateway_score_sr_based = get_gwsm(decider_flow); - logger::info!( + logger::debug!( tag = "GW_Scoring", action = "GW_Scoring", "Gateway scores after considering SR based elimination for {:?} : {:?}", @@ -2760,7 +2760,7 @@ pub fn update_score_with_log( .filter_map(|(gw, score)| { if *gw == v.gateway { let new_score = *score / 5_f64; - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Penalizing gateway {:?} for {:?}", @@ -2797,7 +2797,7 @@ pub async fn update_current_score( let txn_detail = decider_flow.get().dpTxnDetail.clone(); let m_score = get_merchant_elimination_gateway_score(redis_key).await; - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Current score for {:?} {:?} : {:?} with elimination level {:?} threshold {:?}", @@ -2895,14 +2895,14 @@ pub async fn trigger_reset_gateway_score( is_reset_score_enabled_for_merchant: bool, gateway_redis_key_map: GatewayRedisKeyMap, ) { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Triggering Reset for Gateways for {:?}", reset_gateway_list ); if is_reset_score_enabled_for_merchant { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Reset Gateway Scores is enabled for {:?} and merchantId {:?}", @@ -2911,7 +2911,7 @@ pub async fn trigger_reset_gateway_score( ); let mut reset_gateway_sr_list = Vec::new(); for it in &reset_gateway_list { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Adding gateway {:?} to resetAPI Request for {:?}", @@ -2954,7 +2954,7 @@ pub async fn trigger_reset_gateway_score( .await; reset_gateway_sr_list.push(reset_gateway_input.clone()); } else { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "No SR Input for {:?} and {:?}", @@ -2974,13 +2974,13 @@ pub async fn trigger_reset_gateway_score( } _ => Utils::set_reset_approach(decider_flow, ResetApproach::EliminationReset), } - logger::info!( + logger::debug!( tag = "RESET_APPROACH", action = "RESET_APPROACH", "{:?}", reset_approach ); - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Reset Gateway List for {:?} is {:?}", @@ -2988,7 +2988,7 @@ pub async fn trigger_reset_gateway_score( reset_gateway_sr_list ); } else { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Reset Gateway Scores is not enabled for {:?} and merchantId {:?}", @@ -3044,7 +3044,7 @@ pub async fn reset_gateway_score( }; (true, reset_cached_gateway_score_) } else { - logger::info!( + logger::debug!( tag = "scoringFresetKeyScorelow", action = "resetKeyScore", "Key {:?} is not eligible for reset", @@ -3060,7 +3060,7 @@ pub async fn reset_gateway_score( lastResetTimestamp: current_timestamp.clone() as i64, timestamp: current_timestamp.clone() as i64, }; - logger::info!( + logger::debug!( tag = "hard Reset", action = "hard Reset", "Score for key {:?} is being hard reset", @@ -3087,7 +3087,7 @@ pub async fn reset_gateway_score( match result { Ok(_) => { if is_eligible_for_reset { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Resetting Gateway Score for {:?} with new score {:?}", @@ -3095,7 +3095,7 @@ pub async fn reset_gateway_score( reset_cached_gateway_score ); } else { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Gateway Score is not eligible for reset for {:?}", @@ -3104,7 +3104,7 @@ pub async fn reset_gateway_score( } } Err(e) => { - logger::error!( + logger::info!( tag = "scoringFlow", action = "scoringFlow", "Failed to reset Gateway Score for {:?} with error: {:?}", @@ -3115,7 +3115,7 @@ pub async fn reset_gateway_score( } } _ => { - logger::info!( + logger::debug!( tag = "scoringFlow", action = "scoringFlow", "Reset Gateway Score is not enabled for {:?} and merchantId {:?}", diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 267f3579..ad7ca6e8 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -709,7 +709,7 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo let mut normalized_log_data = match serde_json::to_value(&log_data) { Ok(value) => value, Err(e) => { - crate::logger::error!( + crate::logger::info!( action = "metric_tracking_log_error", "Failed to serialize log_data: {}", e @@ -718,7 +718,7 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo } }; - crate::logger::error!( + crate::logger::info!( action = "metric_tracking_log", "{}", normalized_log_data.to_string(), diff --git a/src/decider/storage/utils/merchant_gateway_account.rs b/src/decider/storage/utils/merchant_gateway_account.rs index e4cb7138..d9bd0603 100644 --- a/src/decider/storage/utils/merchant_gateway_account.rs +++ b/src/decider/storage/utils/merchant_gateway_account.rs @@ -17,7 +17,7 @@ pub async fn get_enabled_mgas_by_merchant_id_and_ref_id( mid: MerchantId, ref_ids: Vec, ) -> Vec { - crate::logger::info!( + crate::logger::debug!( "MGAS: Length : {:?}", this.writer.mgas.as_ref().map_or(611, |mgas| mgas.len()) ); @@ -38,7 +38,7 @@ pub async fn get_enabled_mgas_by_merchant_id_and_ref_id( ) .await; - crate::logger::info!( + crate::logger::debug!( "length of mgas for txnId in main function: {}", d_mgas.len() ); diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index de5a3d15..a798741c 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -120,7 +120,7 @@ pub async fn config_sr_dimentions( .with_label_values(&["config_sr_dimentions", "success"]) .inc(); timer.observe_duration(); - logger::info!( + logger::debug!( "SR Dimension configuration updated successfully for merchant: {}", mid ); @@ -215,7 +215,7 @@ pub async fn routing_create( timestamp, timestamp, ); - logger::info!("Response: {response:?}"); + logger::debug!("Response: {response:?}"); metrics::API_REQUEST_COUNTER .with_label_values(&["routing_create", "success"]) @@ -435,7 +435,7 @@ pub async fn routing_evaluate( Ok(mut ir) => { // Check if fallback is enabled if default_output_present && ir.output == program.default_selection { - logger::info!( + logger::debug!( "Default fallback triggered: Overriding with fallback connector" ); @@ -476,7 +476,7 @@ pub async fn routing_evaluate( eligible_connectors, }; - logger::info!("Response: {response:?}"); + logger::debug!("Response: {response:?}"); API_REQUEST_COUNTER .with_label_values(&["routing_evaluate", "success"]) diff --git a/src/euclid/interpreter.rs b/src/euclid/interpreter.rs index 451907b9..f4494501 100644 --- a/src/euclid/interpreter.rs +++ b/src/euclid/interpreter.rs @@ -46,7 +46,7 @@ impl InterpreterBackend { _ => ctx.get(&comparison.lhs), }; if ctx_value.is_none() { - crate::logger::warn!( + crate::logger::debug!( missing_context_key = %comparison.lhs, "Context key not found while evaluating condition, skipping rule" ); diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index 2792ccd8..d5ddadac 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -793,7 +793,7 @@ pub async fn eliminationV2RewardFactor( match sr1_and_sr2_and_n { Some((sr1, sr2, n, m_pmt, m_pm, m_txn_object_type, source)) => { - logger::info!( + logger::debug!( "CALCULATING_ALPHA:SR1_SR2_N_PMT_PM_TXNOBJECTTYPE_CONFIGSOURCE {} {} {} {} {} {} {:?}", sr1, sr2, @@ -803,7 +803,7 @@ pub async fn eliminationV2RewardFactor( m_txn_object_type.unwrap_or_else(|| "Nothing".to_string()), source, ); - logger::info!( + logger::debug!( action = "calculateAlpha", tag = "ALPHA_VALUE", alpha_value = calculate_alpha(sr1, sr2, n), @@ -812,7 +812,7 @@ pub async fn eliminationV2RewardFactor( Some(calculate_alpha(sr1, sr2, n)) } None => { - logger::info!("ELIMINATION_V2_VALUES_NOT_FOUND:ALPHA:PMT_PM_TXNOBJECTTYPE_SOURCEOBJECT {:?} {:?} {:?} {:?}", + logger::debug!("ELIMINATION_V2_VALUES_NOT_FOUND:ALPHA:PMT_PM_TXNOBJECTTYPE_SOURCEOBJECT {:?} {:?} {:?} {:?}", txn_card_info.paymentMethodType, if txn_card_info.paymentMethod.is_empty() { "Nothing".to_string() } else { txn_card_info.paymentMethod.clone() }, txn_detail.txnObjectType, diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index 551ff6e5..c1e632ef 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -273,7 +273,7 @@ pub fn isGwLatencyWithinConfiguredThreshold( txn_latency: Option, merchant_latency_threshold: Option, ) -> bool { - logger::info!( + logger::debug!( action = "txn_latency_within_threshold", tag = "txn_latency_within_threshold", "Latency & Threshold: {:?} {:?}", @@ -344,7 +344,7 @@ pub async fn get_gateway_scoring_type( Some(latency_threshold) => latency_threshold, }; - logger::info!( + logger::debug!( action = "sr_v3_latency_threshold", tag = "sr_v3_latency_threshold", "Latency Threshold: {} Time Difference: {}", @@ -515,7 +515,7 @@ pub async fn check_and_update_gateway_score( // Logging and score update logic if feature_enabled { if should_compute_gw_score { - logger::info!( + logger::debug!( action = "UPDATE_GATEWAY_SCORE_LOCK", tag = "UPDATE_GATEWAY_SCORE_LOCK", "Updating Gateway Score in {} flow with status as {:?} and scoring type as {:?}", @@ -533,7 +533,7 @@ pub async fn check_and_update_gateway_score( .await; } } else { - logger::info!( + logger::debug!( action = "GW_SCORE_LOCK_FEATURE_NOT_ENABLED", tag = "GW_SCORE_LOCK_FEATURE_NOT_ENABLED", "Updating Gateway Score in {} flow with status as {:?} and scoring type as {:?}", @@ -569,7 +569,7 @@ pub async fn update_gateway_score( //let mer_acc = let routing_approach = get_routing_approach(txn_detail.clone()); - logger::info!( + logger::debug!( action = "routing_approach_value", tag = "routing_approach_value", "{:?}", @@ -639,7 +639,7 @@ pub async fn update_gateway_score( && should_isolate_srv3_producer && should_update_explore_txn { - logger::info!( + logger::debug!( action = "updateGatewayScore", tag = "updateGatewayScore", "Updating sr v3 score for the txn with scoring type as {:?} and status as {:?}", @@ -681,7 +681,7 @@ pub async fn update_gateway_score( } Some(_) => redis_gateway_score_data, }; - logger::info!(tag = "GatewayScoringData", "{:?}", mb_gateway_scoring_data); + logger::debug!(tag = "GatewayScoringData", "{:?}", mb_gateway_scoring_data); match mb_gateway_scoring_data { None => { logger::error!( @@ -691,7 +691,7 @@ pub async fn update_gateway_score( ); } Some(gateway_scoring_data) => { - logger::info!( + logger::debug!( action = "Downtime-EmailNotification", tag = "Downtime-EmailNotification", "Proceed to updateKeyScoreForKeysFromConsumer" @@ -706,7 +706,7 @@ pub async fn update_gateway_score( gateway_reference_id.clone(), ) .await; - logger::info!( + logger::debug!( action = "Downtime-EmailNotification", tag = "Downtime-EmailNotification", "{:?}", @@ -844,7 +844,7 @@ pub async fn is_update_within_latency_window( let gw_score_update_latency = Fbu::get_time_from_txn_created_in_mills(txn_detail.clone()); - logger::info!( + logger::debug!( action = "gwLatencyCheckThreshold", tag = "gwLatencyCheckThreshold", "gwLatencyCheckThreshold: {}", diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index 43d4db03..469ba79c 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -69,7 +69,7 @@ pub async fn update_sr_v3_score( // let is_merchant_enabled_globally = MC::isMerchantEnabledForPaymentFlows(merchant_acc.id, [PF::SrBasedRouting].to_vec()).await; match txn_detail.gateway.clone() { None => { - logger::info!( + logger::debug!( action = "gateway not found", tag = "gateway not found", "gateway not found for this transaction having id" @@ -103,7 +103,7 @@ pub async fn update_sr_v3_score( let key3d_for_gateway_selection = unified_sr_v3_key.clone().unwrap_or_else(|| "".to_string()); if key3d_for_gateway_selection != key_for_gateway_selection { - logger::info!( + logger::debug!( tag = "SR V3 Based threeD Producer Key", action = "SR V3 Based threeD Producer Key", "{:?}", @@ -137,7 +137,7 @@ pub async fn createKeysIfNotExist( ) { let is_queue_key_exists = isKeyExistsRedis(key_for_gateway_selection_queue.clone()).await; let is_score_key_exists = isKeyExistsRedis(key_for_gateway_selection_score.clone()).await; - logger::info!( + logger::debug!( tag = "createKeysIfNotExist", action = "createKeysIfNotExist", "Value for isQueueKeyExists is {} and isScoreKeyExists is {}", @@ -148,7 +148,7 @@ pub async fn createKeysIfNotExist( return; } else { let merchant_bucket_size = getSrV3MerchantBucketSize(txn_detail, txn_card_info).await; - logger::info!( + logger::debug!( tag = "createKeysIfNotExist", action = "createKeysIfNotExist", "Creating keys with bucket size as {}", @@ -175,7 +175,7 @@ pub async fn updateScoreAndQueue( txn_detail: TxnDetail, txn_card_info: TxnCardInfo, ) { - logger::info!( + logger::debug!( action = "updateScoreAndQueue", tag = "updateScoreAndQueue", "Updating sr v3 score and queue" @@ -255,7 +255,7 @@ pub async fn updateScoreAndQueue( value.clone(), ) .await; - logger::info!( + logger::debug!( action = "updateScoreAndQueue", tag = "updateScoreAndQueue", "Popped Redis Value {}", @@ -266,7 +266,7 @@ pub async fn updateScoreAndQueue( Ok(maybe_popped_status_block) => get_status(maybe_popped_status_block, popped_status), Err(_) => popped_status, }; - logger::info!( + logger::debug!( action = "updateScoreAndQueue", tag = "updateScoreAndQueue", "Popped Returned Value {}", @@ -324,7 +324,7 @@ pub async fn getSrV3MerchantBucketSize(txn_detail: TxnDetail, txn_card_info: Txn } Some(bucket_size) => bucket_size, }; - logger::info!( + logger::debug!( action = "sr_v3_bucket_size", tag = "sr_v3_bucket_size", "Bucket Size: {}", diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 7127d62a..032c11bb 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -449,7 +449,7 @@ pub async fn updateQueue( match r { Ok(result) => { - logger::info!( + logger::debug!( action = "updateQueue", tag = "updateQueue", "Successfully updated queue in Redis: {:?}", @@ -651,7 +651,7 @@ pub async fn getProducerKey( .await; let (_, key) = gateway_key.into_iter().next().unwrap(); - logger::info!(tag = "getProducerKey", "UNIFIED_KEY {}", key); + logger::debug!(tag = "getProducerKey", "UNIFIED_KEY {}", key); Some(key) } None => { @@ -703,7 +703,7 @@ pub fn log_gateway_score_type( ), }; - logger::info!( + logger::debug!( action = "GATEWAY_SCORE_UPDATED", tag = "GATEWAY_SCORE_UPDATED", "Logging gateway score type: {:?}", diff --git a/src/logger/formatter.rs b/src/logger/formatter.rs index 1613bf76..01a8a350 100644 --- a/src/logger/formatter.rs +++ b/src/logger/formatter.rs @@ -616,17 +616,7 @@ where } } - fn on_enter(&self, id: &tracing::Id, ctx: Context<'_, S>) { - let span = ctx.span(id).expect("No span"); - if let Ok(serialized) = self.span_serialize(&span, RecordType::EnterSpan) { - let _ = self.flush(serialized); - } - } + fn on_enter(&self, _id: &tracing::Id, _ctx: Context<'_, S>) {} - fn on_close(&self, id: tracing::Id, ctx: Context<'_, S>) { - let span = ctx.span(&id).expect("No span"); - if let Ok(serialized) = self.span_serialize(&span, RecordType::ExitSpan) { - let _ = self.flush(serialized); - } - } + fn on_close(&self, _id: tracing::Id, _ctx: Context<'_, S>) {} } diff --git a/src/metrics.rs b/src/metrics.rs index 2ce6aeaf..1f6c40c2 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -83,7 +83,7 @@ pub async fn metrics_server_builder( axum::serve(listener, router.into_make_service()) .with_graceful_shutdown(async move { let _ = sigterm.recv().await; - tracing::info!("Metrics server shutting down gracefully"); + tracing::debug!("Metrics server shutting down gracefully"); }) .await?; @@ -97,7 +97,7 @@ impl crate::config::GlobalConfig { ) -> Result { let loc = format!("{}:{}", self.metrics.host, self.metrics.port); - tracing::info!( + tracing::debug!( category = "SERVER", "{} started [{:?}] [{:?}]", server, diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index bec39d91..87df8a83 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -150,11 +150,6 @@ where let allocated_after = jemalloc_ctl::stats::allocated::read().unwrap_or(0); let bytes_allocated = allocated_after.saturating_sub(allocated_before); - logger::info!(action = "INFO_LOG_CHECK", "INFO LOG GETTING LOGGED"); - logger::debug!(action = "DEBUG_LOG_CHECK", "DEBUG LOG GETTING LOGGED"); - logger::warn!(action = "WARN_LOG_CHECK", "WARN LOG GETTING LOGGED"); - logger::error!(action = "ERROR_LOG_CHECK", "ERROR LOG GETTING LOGGED"); - let final_result = match result { Ok((decided_gateway, filter_list)) => { let cpu_time = cpu_start.elapsed().as_millis() as u64; diff --git a/src/storage.rs b/src/storage.rs index 8c1bdd05..0c1bbaed 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -154,7 +154,7 @@ impl Storage { let timeout_duration = Duration::from_secs(10); match time::timeout(timeout_duration, self.pg_pool.get()).await { Ok(Ok(conn)) => { - logger::info!( + logger::debug!( action = "DB_CONNECTION_SUCCESS", "connection to db successful" ); diff --git a/src/types/gateway_card_info.rs b/src/types/gateway_card_info.rs index d97f8201..b224e05f 100644 --- a/src/types/gateway_card_info.rs +++ b/src/types/gateway_card_info.rs @@ -154,7 +154,7 @@ pub async fn get_enabled_gateway_card_info_for_gateways( ) -> Vec { // Early return if both input lists are empty if card_bins.is_empty() && gateways.is_empty() { - logger::info!( + logger::debug!( tag = "get_enabled_gateway_card_info_for_gateways", action = "get_enabled_gateway_card_info_for_gateways", "card_bins and gateways are empty" @@ -167,7 +167,7 @@ pub async fn get_enabled_gateway_card_info_for_gateways( let gateway_strings: Vec> = gateways.clone().into_iter().map(|g| Some(g)).collect(); - logger::info!( + logger::debug!( tag = "get_enabled_gateway_card_info_for_gateways", action = "get_enabled_gateway_card_info_for_gateways", "gateway_strings: {:?}, gateways: {:?}, card_bins: {:?}", @@ -190,7 +190,7 @@ pub async fn get_enabled_gateway_card_info_for_gateways( .await { Ok(db_results) => { - logger::info!( + logger::debug!( tag = "get_enabled_gateway_card_info_for_gateways", action = "get_enabled_gateway_card_info_for_gateways", "db_results: {:?}", @@ -202,7 +202,7 @@ pub async fn get_enabled_gateway_card_info_for_gateways( .collect() } Err(e) => { - logger::info!( + logger::debug!( tag = "get_enabled_gateway_card_info_for_gateways", action = "get_enabled_gateway_card_info_for_gateways", "Error fetching data from DB: {:?}", diff --git a/src/types/merchant/merchant_gateway_account.rs b/src/types/merchant/merchant_gateway_account.rs index 5ea69799..8edffede 100644 --- a/src/types/merchant/merchant_gateway_account.rs +++ b/src/types/merchant/merchant_gateway_account.rs @@ -250,7 +250,7 @@ pub async fn getEnabledMgasByMerchantIdAndRefId( .filter_map(|db_record| MerchantGatewayAccount::try_from(db_record).ok()) .collect(), Err(err) => { - crate::logger::info!("Error in getEnabledMgasByMerchantIdAndRefId: {:?}", err); + crate::logger::debug!("Error in getEnabledMgasByMerchantIdAndRefId: {:?}", err); Vec::new() // Silently handle any errors by returning empty vec } } diff --git a/src/utils.rs b/src/utils.rs index b9e6f3dd..1edf915b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -24,7 +24,7 @@ pub mod date_time { } pub fn record_fields_from_header(request: &Request) -> tracing::Span { - let span = tracing::debug_span!( + let span = tracing::info_span!( "request", method = %request.method(), uri = %request.uri(), From 849ea0bb2808722cf9aaeb0c4ffba026c47854fa Mon Sep 17 00:00:00 2001 From: Gaurav Rawat <104276743+GauravRawat369@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:56:22 +0530 Subject: [PATCH 46/95] fix: change logger level from info to debug for improved logging granularity (#189) --- src/decider/gatewaydecider/flow_new.rs | 13 +++---- src/decider/gatewaydecider/flows.rs | 30 +++++++---------- src/decider/gatewaydecider/gw_scoring.rs | 11 ++++++ src/decider/gatewaydecider/runner.rs | 43 ++++++++++++++---------- 4 files changed, 56 insertions(+), 41 deletions(-) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 4f3eab82..5cbca32e 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -464,12 +464,13 @@ pub async fn run_decider_flow( // ¤tGatewayScoreMap // ).await?; - logger::info!( - action = "GATEWAY_PRIORITY_MAP", - tag = "GATEWAY_PRIORITY_MAP", - "{:?}", - gatewayPriorityMap - ); + if let Some(ref priority_map) = gatewayPriorityMap { + logger::debug!( + action = "GATEWAY_PRIORITY_MAP", + tag = "GATEWAY_PRIORITY_MAP", + gateway_priority_map = %priority_map + ); + } match decidedGateway { Some(decideGatewayOutput) => { diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 199a48e5..8b8c0923 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -350,7 +350,7 @@ pub async fn run_decider_flow( .or(deciderParams.dpOrder.preferredGateway.clone()); let gatewayMgaIdMap = get_gateway_to_mga_id_map_f(&allMgas, &functionalGateways); - logger::warn!( + logger::debug!( action = "PreferredGateway", tag = "PreferredGateway", "Preferred gateway provided by merchant for {:?} = {:?}", @@ -407,7 +407,7 @@ pub async fn run_decider_flow( gateways: vec![], }); - logger::info!( + logger::debug!( action = "PreferredGateway", tag = "PreferredGateway", "Preferred gateway {:?} functional/valid for merchant {:?} in txn {:?}", @@ -460,18 +460,13 @@ pub async fn run_decider_flow( logger::info!( tag = "gatewayPriorityList", action = "gatewayPriorityList", - "Gateway priority for merchant for {:?} = {:?}", + "Gateway priority for merchant for {:?} = {:?}, gwPLogic : {:?}", &deciderParams.dpTxnDetail.txnId, - gatewayPriorityList + gatewayPriorityList, + gwPLogic ); let (mut functionalGateways, updatedPriorityLogicOutput) = if gwPLogic.is_enforcement { - logger::info!( - tag = "gatewayPriorityList", - action = "Enforcing Priority Logic", - "Enforcing Priority Logic for {:?}", - deciderParams.dpTxnDetail.txnId - ); let (res, priorityLogicOutput) = filter_functional_gateways_with_enforcement( &mut decider_flow, &functionalGateways, @@ -617,7 +612,7 @@ pub async fn run_decider_flow( ) .await; - logger::info!( + logger::debug!( action = "Decided Gateway", tag = "Decided Gateway", "Gateway decided for {:?} = {:?}", @@ -634,12 +629,13 @@ pub async fn run_decider_flow( // ¤tGatewayScoreMap // ).await?; - logger::info!( - action = "GATEWAY_PRIORITY_MAP", - tag = "GATEWAY_PRIORITY_MAP", - "{:?}", - gatewayPriorityMap - ); + if let Some(ref priority_map) = gatewayPriorityMap { + logger::debug!( + action = "GATEWAY_PRIORITY_MAP", + tag = "GATEWAY_PRIORITY_MAP", + gateway_priority_map = %priority_map + ); + } match decidedGateway { Some(decideGatewayOutput) => Ok(T::DecidedGateway { diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 9308dc37..25a7a74a 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1280,9 +1280,20 @@ pub async fn get_global_gateway_score( .iter() .all(|x| x.score < score_threshold); let filtered_merchants: Vec = sorted_filtered_merchants + .clone() .into_iter() .map(|gs| mk_gsl(gs, score_threshold, max_count)) .collect(); + logger::info!( + tag = "getGlobalGatewayScore", + action = "getGlobalGatewayScore", + "Filtered merchants for key {:?}: {:?} : {:?} : {:?} : {:?}", + redis_key, + global_gateway_score, + sorted_filtered_merchants, + should_penalize.clone(), + filtered_merchants.clone() + ); Some(( filtered_merchants, if should_penalize { diff --git a/src/decider/gatewaydecider/runner.rs b/src/decider/gatewaydecider/runner.rs index 354e3950..852f4e88 100644 --- a/src/decider/gatewaydecider/runner.rs +++ b/src/decider/gatewaydecider/runner.rs @@ -566,9 +566,16 @@ pub async fn get_gateway_priority( let (script, priority_logic_tag) = get_script(macc.clone(), priority_logic_script_m).await; let result = evaluate_script(script.clone(), priority_logic_tag.clone()).await; + logger::info!( + tag = "PRIORITY_LOGIC_EXECUTION_RESULT", + "MerchantId: {:?} , Result: {:?}", + macc.merchantId.clone(), + result + ); + match result { EvaluationResult::PLResponse(gws, pl_data, logs, status) => { - logger::info!( + logger::debug!( tag = "PRIORITY_LOGIC_EXECUTION_", "MerchantId: {:?} , Gateways: {:?}, Logs: {:?}", macc.merchantId.clone(), @@ -585,7 +592,7 @@ pub async fn get_gateway_priority( } } EvaluationResult::EvaluationError(priority_logic_data, err) => { - logger::info!( + logger::debug!( tag = "PRIORITY_LOGIC_EXECUTION_FAILURE", "MerchantId: {:?}, Error: {:?}", macc.merchantId, @@ -598,7 +605,7 @@ pub async fn get_gateway_priority( match retry_result { EvaluationResult::PLResponse(retry_gws, retry_pl_data, logs, status) => { let tag = format!("PRIORITY_LOGIC_EXECUTION_RETRY_{}", status); - logger::info!( + logger::debug!( tag = %tag, "MerchantId: {:?} , Gateways: {:?}, Logs: {:?}", macc.merchantId, @@ -615,7 +622,7 @@ pub async fn get_gateway_priority( } } EvaluationResult::EvaluationError(retry_pl_data, err) => { - logger::info!( + logger::debug!( tag = "PRIORITY_LOGIC_EXECUTION_RETRY_FAILURE", "MerchantId: {:?} , Error: {:?}", macc.merchantId, @@ -664,7 +671,7 @@ pub async fn get_gateway_priority( None => default_gateway_priority_logic_output(), Some(t) => { if t.is_empty() { - logger::info!( + logger::debug!( tag = "gatewayPriority", "gatewayPriority for merchant: {:?} is empty.", macc.merchantId @@ -676,7 +683,7 @@ pub async fn get_gateway_priority( .map(|s| s.trim().to_string()) .filter(|s| !s.is_empty()) .collect::>(); - logger::info!( + logger::debug!( tag = "gatewayPriority", "gatewayPriority for merchant: {:?} listOfGateway: {:?}", macc.merchantId, @@ -684,7 +691,7 @@ pub async fn get_gateway_priority( ); match list_of_gateway.as_slice() { [] => { - logger::info!( + logger::debug!( tag = "gatewayPriority emptyList", "Can't get gatewayPriority for merchant: {:?} . Input: {:?}", macc.merchantId, @@ -693,7 +700,7 @@ pub async fn get_gateway_priority( default_gateway_priority_logic_output() } res => { - logger::info!( + logger::debug!( tag = "gatewayPriority decoding", "Decoded successfully. Input: {:?} output: {:?}", t, @@ -827,7 +834,7 @@ async fn get_priority_logic_script_from_tenant_config( Some(tenant_config) => { match (tenant_config.filterDimension, tenant_config.filterGroupId) { (Some(filter_dimension), Some(filter_group_id)) => { - logger::info!( + logger::debug!( tag = "getPriorityLogicScriptFromTenantConfig", "Filter dimension found: {:?}", filter_dimension @@ -841,7 +848,7 @@ async fn get_priority_logic_script_from_tenant_config( .await } _ => { - logger::info!( + logger::debug!( tag = "getPriorityLogicScriptFromTenantConfig", "Filter dimension and filter groupId are not present. Proceeding with default tenant config value." ); @@ -851,7 +858,7 @@ async fn get_priority_logic_script_from_tenant_config( } None => { let tenant_account_id = macc.tenantAccountId.clone().unwrap_or_default(); - logger::info!( + logger::debug!( tag = "getPriorityLogicScriptFromTenantConfig", "Tenant Config not found for tenant account id {}", tenant_account_id @@ -875,7 +882,7 @@ async fn get_pl_by_filter_dimension( get_pl_by_merchant_category_code(macc, filter_group_id, config_value).await } _ => { - logger::info!( + logger::debug!( tag = "getPLByFilterDimension", "Filter dimension is not supported. Proceeding with default tenant config value." ); @@ -898,14 +905,14 @@ async fn get_pl_by_merchant_category_code( .await { Some(tenant_config_filter) => { - logger::info!( + logger::debug!( tag = "getPLByMerchantCategoryCode", "Proceeding with tenant config filter priority logic." ); decode_tenant_pl_config(tenant_config_filter.configValue, macc).await } None => { - logger::info!( + logger::debug!( tag = "getPLByMerchantCategoryCode", "Unable to find tenant config filter for groupId {:?} and dimension value {}", filter_group_id, @@ -916,7 +923,7 @@ async fn get_pl_by_merchant_category_code( } } None => { - logger::info!( + logger::debug!( tag = "getPLByMerchantCategoryCode", "Merchant category code is not present for merchantId {:?}", macc.merchantId @@ -932,7 +939,7 @@ async fn decode_tenant_pl_config( ) -> (String, Option) { match utils::either_decode_t::(&config_value) { Ok(tenant_pl_config) => { - logger::info!( + logger::debug!( tag = "decodeTenantPLConfig", "Tenant Priority Logic Config decoded successfully with name: {}", tenant_pl_config.name @@ -1014,7 +1021,7 @@ pub async fn handle_fallback_logic( .await; match fallback_result { EvaluationResult::PLResponse(gws, pl_data, logs, status) => { - logger::info!( + logger::debug!( tag = "FALLBACK_PRIORITY_LOGIC_EXECUTION_", "MerchantId: {:?} , Gateways: {:?}, Logs: {:?}", macc.merchantId.clone(), @@ -1032,7 +1039,7 @@ pub async fn handle_fallback_logic( } } EvaluationResult::EvaluationError(priority_logic_data, err) => { - logger::info!( + logger::debug!( tag = "FALLBACK_PRIORITY_LOGIC_EXECUTION_FAILURE", "MerchantId: {:?} , Error: {:?}", macc.merchantId, From c85f5771e8db7c55c57d263337b296ec5eab483a Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Wed, 26 Nov 2025 20:00:53 +0530 Subject: [PATCH 47/95] Changes for GATEWAY_SCORE_UPDATED (#191) --- src/decider/gatewaydecider/gw_scoring.rs | 37 +++++++++++++++++++++++- src/decider/gatewaydecider/types.rs | 10 +++---- src/feedback/utils.rs | 24 +++++++-------- 3 files changed, 52 insertions(+), 19 deletions(-) diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 25a7a74a..fd2631b4 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -921,6 +921,13 @@ pub async fn get_score_from_redis(bucket_size: i32, redis_key: &RedisKey) -> f64 .get_key::(&score_key, "sr_v3_score_key") .await .unwrap_or(bucket_size); + logger::info!( + tag = "get_score_from_redis", + action = "get_score_from_redis", + "Fetched success count {:?} for redis key {:?}", + success_count, + score_key + ); (success_count as f64 / bucket_size as f64).clamp(0.0, 1.0) } @@ -1266,8 +1273,23 @@ pub async fn get_global_gateway_score( .get_key(&redis_key, "global_gateway_score_key") .await .unwrap_or(None); + logger::info!( + tag = "getGlobalGatewayScore", + action = "getGlobalGatewayScore", + "Fetched GlobalGatewayScore for key {:?}: {:?}", + redis_key, + m_value.clone() + ); match m_value { - None => None, + None => { + logger::info!( + tag = "getGlobalGatewayScore", + action = "getGlobalGatewayScore", + "No GlobalGatewayScore found for key {:?}", + redis_key + ); + None + }, Some(global_gateway_score) => { let sorted_filtered_merchants: Vec = global_gateway_score .merchants @@ -1399,6 +1421,13 @@ pub async fn get_global_elimination_gateway_score( .get(&gsri.gateway.to_string()) .cloned() .unwrap_or_default(); + logger::info!( + tag = "get_global_elimination_gateway_score", + action = "get_global_elimination_gateway_score", + "Redis Key for Gateway {:?} : {:?}", + gsri, + redis_key + ); get_global_gateway_score( redis_key, gsri.eliminationMaxCountThreshold, @@ -1406,6 +1435,12 @@ pub async fn get_global_elimination_gateway_score( ) .await } else { + logger::error!( + tag = "get_global_elimination_gateway_score", + action = "get_global_elimination_gateway_score", + "Elimination Level is None for Gateway {:?}", + gsri + ); None } } diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 1ca9b3c1..d136b09a 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -266,7 +266,7 @@ pub struct GatewayScoringTypeLogData { #[derive(Debug)] pub struct GatewayScoringTypeLog { - pub log_data: AValue, + pub data: AValue, } impl Serialize for GatewayScoringTypeLog { @@ -274,9 +274,9 @@ impl Serialize for GatewayScoringTypeLog { where S: serde::Serializer, { - let mut state = serializer.serialize_struct("GatewayScoringTypeLog", 1)?; - state.serialize_field("data", &self.log_data)?; - state.end() + let mut state = serializer.serialize_struct("GatewayScoringTypeLog", 1)?; + state.serialize_field("data", &self.data)?; + state.end() } } @@ -290,7 +290,7 @@ impl<'de> Deserialize<'de> for GatewayScoringTypeLog { &["data"], GatewayScoringTypeLogVisitor, )?; - Ok(Self { log_data: data }) + Ok(Self { data }) } } diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 032c11bb..505d3203 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -70,6 +70,7 @@ use crate::types::merchant as ETM; // use prelude::real_to_frac; // use data::time::clock::posix as DTP; use crate::logger; +use time::format_description::well_known::Iso8601; // Converted data types // Original Haskell data type: GatewayScoringType #[derive(Debug, Serialize, Clone, Deserialize, PartialEq)] @@ -686,28 +687,25 @@ pub fn log_gateway_score_type( }, }; - let txn_creation_time = txn_detail - .dateCreated - .to_string() - .replace(" ", "T") - .replace(" UTC", "Z"); + let txn_creation_time = match &time::OffsetDateTime::now_utc().format(&Iso8601::DEFAULT) { + Ok(dt) => dt.to_string(), + Err(_) => "Invalid format".to_string(), + }; let log_data = GatewayScoringTypeLogData { dateCreated: txn_creation_time, score_type: detailed_gateway_score_type, }; - let log_entry = GatewayScoringTypeLog { - log_data: serde_json::Value::String( - serde_json::to_string(&log_data).unwrap_or_else(|_| "Serialization error".to_string()), - ), - }; + let log_json = serde_json::json!({ + "data": log_data, + }); - logger::debug!( + logger::info!( action = "GATEWAY_SCORE_UPDATED", tag = "GATEWAY_SCORE_UPDATED", - "Logging gateway score type: {:?}", - log_entry + "{}", + log_json.to_string() ); } From 0c70e74e698b564508b6fc791fba383e7dae8670 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:52:42 +0530 Subject: [PATCH 48/95] feat: caching for service_configuration (#176) --- config/development.toml | 4 +- src/config.rs | 15 +++ src/decider/gatewaydecider/gw_scoring.rs | 27 ++-- src/redis.rs | 1 + src/redis/cache.rs | 132 +++++++++++++++++-- src/redis/mem_cache.rs | 154 +++++++++++++++++++++++ 6 files changed, 307 insertions(+), 26 deletions(-) create mode 100644 src/redis/mem_cache.rs diff --git a/config/development.toml b/config/development.toml index b861a62b..1c62ff22 100644 --- a/config/development.toml +++ b/config/development.toml @@ -45,9 +45,11 @@ default_command_timeout = 30 unresponsive_timeout = 10 max_feed_count = 200 -[cache] +[cache_config] tti = 7200 # i.e. 2 hours max_capacity = 5000 +service_config_redis_prefix = "DE_service_config_" +service_config_ttl = 300 # 5 minutes [tenant_secrets] public = { schema = "public" } diff --git a/src/config.rs b/src/config.rs index 6d26fbec..b1243016 100644 --- a/src/config.rs +++ b/src/config.rs @@ -33,6 +33,7 @@ pub struct GlobalConfig { #[cfg(feature = "limit")] pub limit: Limit, pub redis: RedisSettings, + pub cache_config: CacheConfig, pub tenant_secrets: TenantsSecrets, pub tls: Option, #[serde(default)] @@ -49,6 +50,7 @@ pub struct TenantConfig { pub tenant_secrets: TenantSecrets, pub routing_config: Option, pub debit_routing_config: network_decider::types::DebitRoutingConfig, + pub cache_config: CacheConfig, } impl TenantConfig { @@ -68,6 +70,7 @@ impl TenantConfig { .cloned() .unwrap(), debit_routing_config: global_config.debit_routing_config.clone(), + cache_config: global_config.cache_config.clone(), } } } @@ -106,6 +109,18 @@ pub struct PgDatabase { pub pg_pool_size: Option, } +#[derive(Clone, serde::Deserialize, Debug)] +pub struct CacheConfig { + pub service_config_redis_prefix: String, + pub service_config_ttl: i64, +} + +impl CacheConfig { + pub fn add_prefix(&self, key: &str) -> String { + format!("{}{}", self.service_config_redis_prefix, key) + } +} + #[derive(serde::Deserialize, Debug, Clone)] pub struct TenantSecrets { /// schema name for the tenant (defaults to tenant_id) diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index fd2631b4..7da35483 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1010,10 +1010,11 @@ pub async fn update_score_for_outage(decider_flow: &mut DeciderFlow<'_>) -> Gate let txn_detail = decider_flow.get().dpTxnDetail.clone(); let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); let merchant = decider_flow.get().dpMerchantAccount.clone(); - let scheduled_outage_validation_duration = - RService::findByNameFromRedis(C::ScheduledOutageValidationDuration.get_key()) - .await - .unwrap_or(86400); + let scheduled_outage_validation_duration = RService::findByNameFromRedisWithDefault( + C::ScheduledOutageValidationDuration.get_key(), + 86400, + ) + .await; let potential_outages = get_scheduled_outage(scheduled_outage_validation_duration).await; logger::debug!("updated score for outage {:?}", potential_outages); @@ -1840,12 +1841,16 @@ pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( gateway_success_rate_merchant_input: Option, default_success_rate_based_routing_input: Option, ) -> GatewayWiseSuccessRateBasedRoutingInput { - let m_option = - RService::findByNameFromRedis(C::SrBasedGatewayEliminationThreshold.get_key()).await; - let default_soft_txn_reset_count = - RService::findByNameFromRedis(C::SR_BASED_TXN_RESET_COUNT.get_key()) - .await - .unwrap_or(C::GW_DEFAULT_TXN_SOFT_RESET_COUNT); + let default_elimination_threshold = RService::findByNameFromRedisWithDefault( + C::SrBasedGatewayEliminationThreshold.get_key(), + C::DEFAULT_SR_BASED_GATEWAY_ELIMINATION_THRESHOLD, + ) + .await; + let default_soft_txn_reset_count = RService::findByNameFromRedisWithDefault( + C::SR_BASED_TXN_RESET_COUNT.get_key(), + C::GW_DEFAULT_TXN_SOFT_RESET_COUNT, + ) + .await; let is_elimination_v2_enabled = is_feature_enabled( C::EnableEliminationV2.get_key(), merchant_acc.merchantId.0.clone(), @@ -1853,8 +1858,6 @@ pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( ) .await; - let default_elimination_threshold = - m_option.unwrap_or(C::DEFAULT_SR_BASED_GATEWAY_ELIMINATION_THRESHOLD); let merchant_given_default_threshold = gateway_success_rate_merchant_input .clone() .map(|input| input.defaultEliminationThreshold); diff --git a/src/redis.rs b/src/redis.rs index df780bc5..8fe9a1a6 100644 --- a/src/redis.rs +++ b/src/redis.rs @@ -1,4 +1,5 @@ pub mod cache; +pub mod mem_cache; pub mod commands; pub mod feature; pub mod types; diff --git a/src/redis/cache.rs b/src/redis/cache.rs index 8bc6e7ae..7db27c5f 100644 --- a/src/redis/cache.rs +++ b/src/redis/cache.rs @@ -1,3 +1,6 @@ +use super::mem_cache::GLOBAL_CACHE; +use crate::app::get_tenant_app_state; +use crate::logger; use crate::types::service_configuration; use crate::utils::StringExt; use serde::Deserialize; @@ -6,6 +9,28 @@ use serde::Deserialize; // Original Haskell type: KVDBName pub type KVDBName = String; +async fn get_from_memory_cache(prefixed_key: &str) -> Result { + match GLOBAL_CACHE.get::(prefixed_key) { + Ok(value) => Ok(value), + Err(e) => Err(format!("Memory cache get failed: {}", e)), + } +} + +async fn set_to_memory_cache(prefixed_key: &str, value: &str, ttl_seconds: Option) { + match GLOBAL_CACHE.store(prefixed_key.to_string(), value.to_string(), ttl_seconds) { + Ok(_) => {} + Err(e) => { + crate::logger::warn!( + tag = "memory_cache_write_failed", + action = "memory_cache_write_failed", + "Failed to write cache for key: {}, error: {:?}", + prefixed_key, + e + ); + } + } +} + // // Converted data types // // Original Haskell data type: Multi // #[derive(Debug, Serialize, Deserialize, PartialEq)] @@ -54,7 +79,6 @@ where findByNameFromRedisHelper(key, Some(decode_fn)).await } -// Original Haskell function: findByNameFromRedisHelper pub async fn findByNameFromRedisHelper( key: String, decode_fn: Option Option>, @@ -62,20 +86,102 @@ pub async fn findByNameFromRedisHelper( where A: for<'de> Deserialize<'de>, { - let res = service_configuration::find_config_by_name(key).await; - - match res { - Ok(m_service_config) => match m_service_config { - Some(service_config) => match service_config.value { - Some(value) => match decode_fn { - Some(func) => func(value), + let app_state = get_tenant_app_state().await; + let prefixed_key = app_state.config.cache_config.add_prefix(&key); + + match get_from_memory_cache(&prefixed_key).await { + Ok(cache_value) => { + logger::debug!( + tag = "memory_cache", + action = "hit", + "Cache hit for key: {}", + key + ); + match decode_fn { + Some(func) => func(cache_value), + None => extractValue(cache_value), + } + } + Err(_) => { + logger::debug!( + tag = "memory_cache", + action = "miss", + "Cache miss for key: {}, falling back to database", + key + ); + + let res = service_configuration::find_config_by_name(key.clone()).await; + + match res { + Ok(Some(service_config)) => match service_config.value { + Some(value) => { + // Get TTL from global config + let ttl_seconds = Some( + app_state + .config + .cache_config + .service_config_ttl as u64, + ); + set_to_memory_cache(&prefixed_key, &value, ttl_seconds).await; + + match decode_fn { + Some(func) => func(value), + None => extractValue(value), + } + } None => None, }, - None => None, - }, - None => None, - }, - Err(_) => None, + _ => None, + } + } + } +} + +// Function to find value from memory cache/DB and return default if not present +pub async fn findByNameFromRedisWithDefault(key: String, default_value: A) -> A +where + A: for<'de> Deserialize<'de> + serde::Serialize + Clone, +{ + // First try to get the value using the helper function + let result = findByNameFromRedisHelper(key.clone(), Some(extractValue::)).await; + + match result { + Some(value) => value, + None => { + // Serialize the default value to JSON string + match serde_json::to_string(&default_value) { + Ok(default_json) => { + // Cache the default value in memory for future use + let app_state = get_tenant_app_state().await; + let prefixed_key = app_state.config.cache_config.add_prefix(&key); + let ttl_seconds = Some( + app_state + .config + .cache_config + .service_config_ttl as u64, + ); + set_to_memory_cache(&prefixed_key, &default_json, ttl_seconds).await; + + logger::debug!( + tag = "memory_cache", + action = "default_cached", + "Cached default value for key: {}", + key + ); + } + Err(e) => { + logger::warn!( + tag = "memory_cache", + action = "serialize_failed", + "Failed to serialize default value for key: {}, error: {:?}", + key, + e + ); + } + } + + default_value + } } } diff --git a/src/redis/mem_cache.rs b/src/redis/mem_cache.rs new file mode 100644 index 00000000..dc9aa2f2 --- /dev/null +++ b/src/redis/mem_cache.rs @@ -0,0 +1,154 @@ +use std::collections::HashMap; +use std::sync::{Arc, RwLock}; +use std::time::{Duration, Instant}; +use once_cell::sync::Lazy; + +// Global in-memory cache instance +pub static GLOBAL_CACHE: Lazy = Lazy::new(|| Registry::new(1000)); + +/// In-memory key–value cache with optional TTL expiration and simple eviction. +/// +/// ## Eviction Strategy +/// +/// The cache enforces a maximum capacity (`max_size`). +/// Eviction happens during `store()` when the cache is full **after removing expired entries**. +/// +/// The strategy works in two phases: +/// +/// 1. **Lazy Expiration Cleanup** +/// - Expired keys (based on `expires_at`) are removed during `store()` and `get()`. +/// - No background thread is used for cleanup — expiration is checked only on access. +/// +/// 2. **Size-Based Eviction** +/// - If the cache is still full after removing expired entries, the cache removes the +/// *oldest inserted key*. +/// (The implementation relies on the ordering of `HashMap::keys().next()` which effectively +/// removes an arbitrary older entry — simple FIFO-like eviction, not LRU.) + +#[derive(Debug)] +pub struct Registry { + data: Arc>>, + max_size: usize, +} + +#[derive(Debug, Clone)] +struct CacheEntry { + value: serde_json::Value, + expires_at: Option, +} + +impl Registry { + pub fn new(max_size: usize) -> Self { + Self { + data: Arc::new(RwLock::new(HashMap::new())), + max_size, + } + } + + pub fn get(&self, key: &str) -> Result + where + T: serde::de::DeserializeOwned, + { + { + let data = self.data.read().map_err(|e| format!("Read lock error: {}", e))?; + + if let Some(entry) = data.get(key) { + // Check if entry has expired + if let Some(expires_at) = entry.expires_at { + if Instant::now() > expires_at { + // Entry expired, need to remove it (drop read lock first) + drop(data); + } else { + // Entry is valid, return it + return serde_json::from_value(entry.value.clone()) + .map_err(|e| format!("Deserialization error: {}", e)); + } + } else { + // No expiration, return it + return serde_json::from_value(entry.value.clone()) + .map_err(|e| format!("Deserialization error: {}", e)); + } + } else { + return Err("Key not found".to_string()); + } + } + + // If we get here, the entry was expired and we need to remove it + let mut data = self.data.write().map_err(|e| format!("Write lock error: {}", e))?; + + // Double-check the entry is still there and expired + if let Some(entry) = data.get(key) { + if let Some(expires_at) = entry.expires_at { + if Instant::now() > expires_at { + data.remove(key); + return Err("Key expired".to_string()); + } + // If not expired anymore, return the value + return serde_json::from_value(entry.value.clone()) + .map_err(|e| format!("Deserialization error: {}", e)); + } + } + + Err("Key not found".to_string()) + } + + /// Inserts a value in the cache, applying TTL and eviction rules. + /// + /// - Expired entries are removed first. + /// - If capacity is still exceeded, the oldest remaining entry is evicted. + pub fn store(&self, key: String, value: T, ttl_seconds: Option) -> Result<(), String> + where + T: serde::Serialize, + { + let mut data = self.data.write().map_err(|e| format!("Write lock error: {}", e))?; + + // Remove expired entries and enforce max size + self.cleanup_expired(&mut data); + + if data.len() >= self.max_size { + // Remove oldest entry (simple eviction policy) + if let Some(oldest_key) = data.keys().next().cloned() { + data.remove(&oldest_key); + } + } + + let json_value = serde_json::to_value(value) + .map_err(|e| format!("Serialization error: {}", e))?; + + let expires_at = ttl_seconds.map(|ttl| Instant::now() + Duration::from_secs(ttl)); + + data.insert(key, CacheEntry { + value: json_value, + expires_at, + }); + + Ok(()) + } + + fn cleanup_expired(&self, data: &mut HashMap) { + let now = Instant::now(); + data.retain(|_, entry| { + if let Some(expires_at) = entry.expires_at { + now <= expires_at + } else { + true + } + }); + } + + pub fn remove(&self, key: &str) -> Result<(), String> { + let mut data = self.data.write().map_err(|e| format!("Write lock error: {}", e))?; + data.remove(key); + Ok(()) + } + + pub fn size(&self) -> usize { + self.data.read().unwrap().len() + } + + pub fn clear(&self) -> Result<(), String> { + let mut data = self.data.write().map_err(|e| format!("Write lock error: {}", e))?; + data.clear(); + Ok(()) + } +} From b03f56fc57583b11db2b2bbacd9873ba73b634e1 Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Sat, 29 Nov 2025 20:28:31 +0530 Subject: [PATCH 49/95] Extended card bin (#183) --- config/development.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/development.toml b/config/development.toml index 1c62ff22..3e05dd3d 100644 --- a/config/development.toml +++ b/config/development.toml @@ -80,6 +80,7 @@ open_banking = { type = "enum", values = "open_banking_pis" } mobile_payment = { type = "enum", values = "direct_carrier_billing" } payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } card_type = { type = "enum", values = "debit, credit" } +card = { type = "enum", values = "debit, credit" } payment_card_bin = { type = "udf" } issuer_name = { type = "str_value" } payment_card_type = { type = "enum", values = "CREDIT, DEBIT" } @@ -97,6 +98,7 @@ login_date = { type = "str_value" } currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } payment_card_issuer_country = { type = "enum", values = "AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, US" } card_bin = { type = "str_value" } +extended_card_bin = { type = "str_value" } capture_method = { type = "enum", values = "automatic, manual" } new_customer = { type = "udf" } udf1 = { type = "str_value" } From 9b7f2affabbd913d9a448e4973e9bf9ddcd2c969 Mon Sep 17 00:00:00 2001 From: Sarthak Soni <76486416+Sarthak1799@users.noreply.github.com> Date: Mon, 1 Dec 2025 14:52:47 +0530 Subject: [PATCH 50/95] refactor: add inspect logs for redis get_key (#193) --- src/decider/gatewaydecider/gw_scoring.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 7da35483..85eaab5a 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1273,6 +1273,7 @@ pub async fn get_global_gateway_score( .redis_conn .get_key(&redis_key, "global_gateway_score_key") .await + .inspect_err(|err| logger::error!("get_global_gateway_score get_key_error: {:?}", err)) .unwrap_or(None); logger::info!( tag = "getGlobalGatewayScore", @@ -1290,7 +1291,7 @@ pub async fn get_global_gateway_score( redis_key ); None - }, + } Some(global_gateway_score) => { let sorted_filtered_merchants: Vec = global_gateway_score .merchants From 7dc31fa998a11af6a01cd0d970ad61af1a2f537d Mon Sep 17 00:00:00 2001 From: deepakjuspay001 Date: Mon, 1 Dec 2025 15:56:03 +0530 Subject: [PATCH 51/95] =?UTF-8?q?Removed-HyperPg-Gateway-from-CardMandateB?= =?UTF-8?q?inFilterExcludedGateways-Lis=E2=80=A6=20(#192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/decider/gatewaydecider/gw_filter_new.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/decider/gatewaydecider/gw_filter_new.rs b/src/decider/gatewaydecider/gw_filter_new.rs index 30fcefee..70dec442 100644 --- a/src/decider/gatewaydecider/gw_filter_new.rs +++ b/src/decider/gatewaydecider/gw_filter_new.rs @@ -968,10 +968,19 @@ pub async fn filterGatewaysForValidationType(this: &mut DeciderFlow<'_>) -> () { // Handle Card Mandate transactions if Utils::is_mandate_transaction(&txn_detail) && Utils::is_card_transaction(&txn_card_info) { // Get excluded gateways from Redis - let card_mandate_bin_filter_excluded_gateways = findByNameFromRedis(C::CardMandateBinFilterExcludedGateways.get_key()) + let mut card_mandate_bin_filter_excluded_gateways = findByNameFromRedis(C::CardMandateBinFilterExcludedGateways.get_key()) .await .unwrap_or_else(Vec::new); - + + // Get card brand + let card_brand = Utils::get_card_brand(this).await; + // If card brand is RUPAY remove HYPERPG from config list + if card_brand.as_deref() == Some("RUPAY") { + card_mandate_bin_filter_excluded_gateways + .retain(|gw| gw != &ETG::Gateway::HYPERPG); + } + + let bin_wise_filter_excluded_gateways = intersect(&card_mandate_bin_filter_excluded_gateways, &st); let bin_list = Utils::get_bin_list(txn_card_info.card_isin.clone()); From 0c367238fbd686d56e09e8fe1378b5fc97b55308 Mon Sep 17 00:00:00 2001 From: nagesh-s-juspay Date: Mon, 1 Dec 2025 17:35:48 +0530 Subject: [PATCH 52/95] feat: Added filterFunctionalGatewaysForPixFlows for pix automatic redirect gateway filtering. (#190) --- src/decider/gatewaydecider/constants.rs | 5 +- src/decider/gatewaydecider/gw_filter.rs | 159 +++++++++++++++++++++++- src/decider/gatewaydecider/types.rs | 4 + src/decider/gatewaydecider/utils.rs | 8 ++ src/types/payment_flow.rs | 3 + 5 files changed, 175 insertions(+), 4 deletions(-) diff --git a/src/decider/gatewaydecider/constants.rs b/src/decider/gatewaydecider/constants.rs index de5ddd68..ad577aa2 100644 --- a/src/decider/gatewaydecider/constants.rs +++ b/src/decider/gatewaydecider/constants.rs @@ -729,7 +729,7 @@ impl SC::ServiceConfigKey for GatewaydeciderScoringflow { } } -pub const PAYMENT_FLOWS_REQUIRED_FOR_GW_FILTERING: [&str; 12] = [ +pub const PAYMENT_FLOWS_REQUIRED_FOR_GW_FILTERING: [&str; 13] = [ "DOTP", "CARD_MOTO", "MANDATE_REGISTER", @@ -742,6 +742,7 @@ pub const PAYMENT_FLOWS_REQUIRED_FOR_GW_FILTERING: [&str; 12] = [ "CROSS_BORDER_PAYMENT", "SINGLE_BLOCK_MULTIPLE_DEBIT", "ONE_TIME_MANDATE", + "PIX_AUTOMATIC_REDIRECT", ]; pub const GET_CARD_BRAND_CACHE_EXPIRY: i32 = 2 * 24 * 60 * 60; @@ -953,6 +954,8 @@ pub const CVV_LESS_V2_FLOW: EnabledCvvlessV2EnabledMerchants = EnabledCvvlessV2E pub const GATEWAYS_WITH_TENURE_BASED_CREDS: [&str; 3] = ["HDFC", "HDFC_CC_EMI", "ICICI"]; +pub const PIX_PAYMENT_FLOWS: [&str; 1] = ["PIX_AUTOMATIC_REDIRECT"]; + pub struct MerchantConfigEntityLevelLookupCutover; impl SC::ServiceConfigKey for MerchantConfigEntityLevelLookupCutover { fn get_key(&self) -> String { diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index 81788bf7..608efaf7 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -33,7 +33,7 @@ use crate::types::merchant_gateway_account_sub_info::{self as ETMGASI, SubIdType use crate::types::merchant_gateway_payment_method_flow as MGPMF; use crate::types::order::Order; use crate::types::payment::payment_method::{self as ETP}; -use crate::types::payment_flow::PaymentFlow; +use crate::types::payment_flow::{PaymentFlow, payment_flows_to_text, text_to_payment_flows}; use std::collections::{HashMap, HashSet}; // use crate::types::metadata::Meta; // use crate::types::pl_ref_id_map::PLRefIdMap; @@ -222,6 +222,7 @@ pub async fn newGwFilters( let _ = filterFunctionalGatewaysForSplitSettlement(this).await; let _ = filterFunctionalGatewaysForMerchantRequiredFlow(this).await; let _ = filterFunctionalGatewaysForOTMFlow(this).await; + let _ = filterFunctionalGatewaysForPixFlows(this).await; let _ = filterGatewaysForMGASelectionIntegrity(this).await; let funcGateways = returnGwListWithLog(this, DeciderFilterName::FinalFunctionalGateways, false); @@ -575,12 +576,14 @@ pub fn isMgaEligible( ) -> bool { let payment_flow_list = Utils::get_payment_flow_list_from_txn_detail(&txn_detail); let is_otm_flow = payment_flow_list.contains(&"ONE_TIME_MANDATE".to_string()); + let is_pix_automatic_redirect_flow = payment_flow_list.contains(&"PIX_AUTOMATIC_REDIRECT".to_string()); validateMga( mga, txnCI, mTxnObjType, mgaEligibleSeamlessGateways, is_otm_flow, + is_pix_automatic_redirect_flow, ) } @@ -590,12 +593,13 @@ fn validateMga( mTxnObjType: TxnObjectType, mgaEligibleSeamlessGateways: &[String], is_otm_flow: bool, + is_pix_automatic_redirect_flow: bool, ) -> bool { if mgaEligibleSeamlessGateways.contains(&mga.gateway) && isCardOrNbTxn(txnCI) { Utils::is_seamless(mga) } else if isMandateRegister(mTxnObjType.clone()) { Utils::is_subscription(mga) - } else if isEmandateRegister(mTxnObjType) && !is_otm_flow { + } else if isEmandateRegister(mTxnObjType) && !is_otm_flow && !is_pix_automatic_redirect_flow { Utils::is_emandate_enabled(mga) } else { !Utils::is_only_subscription(mga) @@ -1449,6 +1453,154 @@ pub async fn filterFunctionalGatewaysForOTMFlow(this: &mut DeciderFlow<'_>) -> V ) } +/// Filters gateways for PIX payment flows (e.g., PIX_AUTOMATIC_REDIRECT) +/// Identifies eligible gateways that support PIX flows based on bank codes and payment method compatibility +pub async fn filterFunctionalGatewaysForPixFlows(this: &mut DeciderFlow<'_>) -> Vec { + /// Helper function to get the account details flag to be checked for PIX flows + /// extend this for other pix flows. + fn get_acc_details_flag_to_be_checked(pf: &PaymentFlow) -> &str { + match pf { + _ => "enablePixAutomaticRedirect", + } + } + + // Get current functional gateways + let st = getGws(this); + + // Get transaction data from context + let txn_detail = this.get().dpTxnDetail.clone(); + let macc = this.get().dpMerchantAccount.clone(); + let order_reference = this.get().dpOrder.clone(); + let txn_card_info = this.get().dpTxnCardInfo.clone(); + + // Check if this is a PIX payment flow + let payment_flow_list = Utils::get_payment_flow_list_from_txn_detail(&txn_detail); + let m_pix_flow_text = C::PIX_PAYMENT_FLOWS + .iter() + .find(|&flow| payment_flow_list.contains(&flow.to_string())); + + // Try to parse the PIX flow text into a PaymentFlow enum + let m_pix_payment_flow: Option = m_pix_flow_text + .and_then(|flow_text| text_to_payment_flows(flow_text.to_string()).ok()); + + match m_pix_payment_flow { + Some(pix_payment_flow) => { + // Get order metadata and ref IDs + let (metadata, pl_ref_id_map) = Utils::get_order_metadata_and_pl_ref_id_map( + this, + macc.enableGatewayReferenceIdBasedRouting, + &order_reference, + ); + + // Get all possible merchant reference IDs + let possible_ref_ids_of_merchant = + Utils::get_all_possible_ref_ids(metadata, order_reference.clone(), pl_ref_id_map); + + // Get merchant gateway accounts + let enabled_mgas = SETMA::get_enabled_mgas_by_merchant_id_and_ref_id( + this, + macc.merchantId, + possible_ref_ids_of_merchant, + ) + .await; + + // Get the account details flag to check for this PIX flow + let acc_details_flag_to_be_checked = get_acc_details_flag_to_be_checked(&pix_payment_flow); + + // Filter MGAs that support PIX flows + let mgas: Vec<_> = enabled_mgas + .into_iter() + .filter(|mga| { + Utils::is_pix_flows_enabled( + mga, + payment_flows_to_text(&pix_payment_flow), + acc_details_flag_to_be_checked.to_string(), + ) + }) + .collect(); + + // Filter MGAs to only include those with gateways in our allowed list + let eligible_mga_post_filtering: Vec<_> = mgas + .into_iter() + .filter(|mga| st.contains(&mga.gateway)) + .collect(); + + // Extract just the gateway list from filtered MGAs + let gw_list: Vec = eligible_mga_post_filtering + .iter() + .map(|x| x.gateway.clone()) + .collect(); + + // If we have a valid bank code, do additional filtering based on payment method flow + if let Some(jbc) = find_bank_code(txn_card_info.paymentMethod.clone()).await { + // Find all gateway payment method flows for PIX with this bank code + // Note: Using Brazil country code (BRA) for PIX flows + let all_gpmf_entries = GPMF::find_all_gpmf_by_country_code_gw_pf_id_pmt_jbcid_db( + crate::types::country::country_iso::CountryISO::BRA, + gw_list, + pix_payment_flow.clone(), + txn_card_info.paymentMethodType.clone(), + jbc.id, + ) + .await + .unwrap_or_default(); + + // Extract MGA IDs and GPMF IDs for further filtering + let mga_ids: Vec = eligible_mga_post_filtering + .iter() + .map(|mga| mga.id.merchantGwAccId) + .collect(); + + let gpmf_ids: Vec = all_gpmf_entries + .iter() + .map(|entry| to_gateway_payment_method_flow_id(entry.id.clone())) + .collect(); + + // Get merchant gateway payment method flows that match both MGA and GPMF + let mgpmf_entries = + MGPMF::get_all_mgpmf_by_mga_id_and_gpmf_ids(mga_ids, gpmf_ids).await; + + // Extract merchant gateway account IDs that have matching payment flows + let mgpmf_mga_id_entries: Vec = mgpmf_entries + .iter() + .map(|entry| entry.merchantGatewayAccountId) + .collect(); + + // Final filtering of MGAs to only those with matching payment flows + let eligible_mga_post_filtering_pix_flows: Vec<_> = eligible_mga_post_filtering + .into_iter() + .filter(|mga| mgpmf_mga_id_entries.contains(&mga.id.merchantGwAccId)) + .collect(); + + // Extract final gateway list from filtered MGAs + let gw_list_post_pix_flows_filtering: Vec = + eligible_mga_post_filtering_pix_flows + .iter() + .map(|x| x.gateway.clone()) + .collect(); + + // Update state with final MGA and gateway lists + Utils::set_mgas(this, eligible_mga_post_filtering_pix_flows); + setGws(this, gw_list_post_pix_flows_filtering); + } else { + // If no bank code found, keep original gateway list + setGws(this, st); + } + } + // If not a PIX flow, keep original gateway list + None => { + setGws(this, st); + } + } + + // Return gateway list with logging + returnGwListWithLog( + this, + DeciderFilterName::FilterFunctionalGatewaysForPixFlows, + true, + ) +} + /// Filters gateways based on transaction validation type (Card Mandate, TPV, E-Mandate) pub async fn filterGatewaysForValidationType( this: &mut DeciderFlow<'_>, @@ -1583,8 +1735,9 @@ pub async fn filterGatewaysForValidationType( // Check if we should skip processing for one-time mandate flow let payment_flow_list = Utils::get_payment_flow_list_from_txn_detail(&txn_detail); let is_otm_flow = payment_flow_list.contains(&"ONE_TIME_MANDATE".to_string()); + let is_pix_automatic_redirect_flow = payment_flow_list.contains(&"PIX_AUTOMATIC_REDIRECT".to_string()); - if is_otm_flow { + if is_otm_flow || is_pix_automatic_redirect_flow { logger::info!( "Skipping processing for OTM flow for txn_id {:?}", txn_detail.txnId.clone() diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index d136b09a..9b90c988 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -76,6 +76,7 @@ pub enum DeciderFilterName { FilterGatewaysForEMITenureSpecficGatewayCreds, FilterFunctionalGatewaysForReversePennyDrop, FilterFunctionalGatewaysForOTM, + FilterFunctionalGatewaysForPixFlows, } impl fmt::Display for DeciderFilterName { @@ -158,6 +159,9 @@ impl fmt::Display for DeciderFilterName { Self::FilterFunctionalGatewaysForOTM => { write!(f, "FilterFunctionalGatewaysForOTM") } + Self::FilterFunctionalGatewaysForPixFlows => { + write!(f, "FilterFunctionalGatewaysForPixFlows") + } } } } diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index ad7ca6e8..83483acc 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -132,6 +132,14 @@ pub fn is_otm_enabled(mga: &ETM::merchant_gateway_account::MerchantGatewayAccoun check_if_enabled_in_mga(mga, "ONE_TIME_MANDATE", "OTM_ENABLED") } +pub fn is_pix_flows_enabled( + mga: &ETM::merchant_gateway_account::MerchantGatewayAccount, + payment_flow: String, + acc_details_flag: String, +) -> bool { + check_if_enabled_in_mga(mga, &payment_flow, &acc_details_flag) +} + pub fn is_seamless(mga: &ETM::merchant_gateway_account::MerchantGatewayAccount) -> bool { let secret_json = Some(mga.account_details.peek()); secret_json diff --git a/src/types/payment_flow.rs b/src/types/payment_flow.rs index 8e3ea970..84c46b25 100644 --- a/src/types/payment_flow.rs +++ b/src/types/payment_flow.rs @@ -140,6 +140,7 @@ pub enum PaymentFlow { PpRetry, InappNewPay, InappRepeatPay, + PixAutomaticRedirect, } pub fn payment_flows_to_text(payment_flow: &PaymentFlow) -> String { @@ -293,6 +294,7 @@ pub fn payment_flows_to_text(payment_flow: &PaymentFlow) -> String { PaymentFlow::ApplepayTokenDecryptionFlow => "APPLEPAY_TOKEN_DECRYPTION_FLOW".to_string(), PaymentFlow::OneTimeMandate => "ONE_TIME_MANDATE".to_string(), PaymentFlow::SingleBlockMultipleDebit => "SINGLE_BLOCK_MULTIPLE_DEBIT".to_string(), + PaymentFlow::PixAutomaticRedirect => "PIX_AUTOMATIC_REDIRECT".to_string(), } } @@ -441,6 +443,7 @@ pub fn text_to_payment_flows(text: String) -> Result { "APPLEPAY_TOKEN_DECRYPTION_FLOW" => Ok(PaymentFlow::ApplepayTokenDecryptionFlow), "ONE_TIME_MANDATE" => Ok(PaymentFlow::OneTimeMandate), "SINGLE_BLOCK_MULTIPLE_DEBIT" => Ok(PaymentFlow::SingleBlockMultipleDebit), + "PIX_AUTOMATIC_REDIRECT" => Ok(PaymentFlow::PixAutomaticRedirect), _ => Err(ApiError::ParsingError("Invalid Payment Flow")), } } From e3c76ce56828587f859e448c1d09c2e8258d30b0 Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Tue, 2 Dec 2025 13:09:56 +0530 Subject: [PATCH 53/95] fix: euclid configs (#195) --- config/development.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/development.toml b/config/development.toml index 3e05dd3d..54cb2814 100644 --- a/config/development.toml +++ b/config/development.toml @@ -69,7 +69,6 @@ bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } customer_device_display_size = { type = "enum", values = "size320x568, size375x667, size390x844, size414x896, size428x926, size768x1024, size834x1112, size834x1194, size1024x1366, size1280x720, size1366x768, size1440x900, size1920x1080, size2560x1440, size3840x2160, size500x600, size600x400, size360x640, size412x915, size800x1280" } customer_device_type = { type = "enum", values = "mobile, tablet, desktop, gaming_console" } -card = { type = "enum", values = "credit, debit" } customer_device_platform = { type = "enum", values = "web, android, ios" } bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } crypto = { type = "enum", values = "crypto_currency" } From ded870a6f370e4fe02a153dcefc25ebd4e9fb79e Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:51:30 +0530 Subject: [PATCH 54/95] feat: changes for cache_config (#196) --- config.example.toml | 6 ++++-- config/development.toml | 4 +++- config/docker-configuration.toml | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config.example.toml b/config.example.toml index a5733002..ed691db9 100644 --- a/config.example.toml +++ b/config.example.toml @@ -11,11 +11,14 @@ port = 3001 # The port where the server should be hosted on request_count = 1 # The requests per duration duration = 60 # duration to rate limit the delete api (in sec) - [cache] tti = 7200 # Idle time after a get/insert of a cache entry to free the cache (in secs) max_capacity = 5000 # Max capacity of a single table cache +[cache_config] +service_config_redis_prefix = "DE_service_config_" +service_config_ttl = 300 # 5 minutes + [database] username = "sam" # username for the database password = "damn" # password of the database @@ -63,4 +66,3 @@ private_key = "key.pem" # path to the private key file (`pem` format) client_idle_timeout = 90 # timeout for idle sockets being kept-alive pool_max_idle_per_host = 10 # maximum idle connection per host allowed in the pool. identity = "" # identity to be used for client certificate authentication in mtls. - diff --git a/config/development.toml b/config/development.toml index 54cb2814..0d0e3bbc 100644 --- a/config/development.toml +++ b/config/development.toml @@ -45,9 +45,11 @@ default_command_timeout = 30 unresponsive_timeout = 10 max_feed_count = 200 -[cache_config] +[cache] tti = 7200 # i.e. 2 hours max_capacity = 5000 + +[cache_config] service_config_redis_prefix = "DE_service_config_" service_config_ttl = 300 # 5 minutes diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index 31072b47..10f6b9bf 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -49,6 +49,10 @@ max_feed_count = 200 tti = 7200 # i.e. 2 hours max_capacity = 5000 +[cache_config] +service_config_redis_prefix = "DE_service_config_" +service_config_ttl = 300 # 5 minutes + [tenant_secrets] public = { schema = "public" } From 09cdf5de959014e54d5d4591c7eb2ad508c6d354 Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Tue, 2 Dec 2025 18:34:08 +0530 Subject: [PATCH 55/95] Fix/metric tracking log (#194) --- src/decider/gatewaydecider/gw_scoring.rs | 3 ++ src/decider/gatewaydecider/types.rs | 8 ++--- src/decider/gatewaydecider/utils.rs | 27 +++++++++++---- src/redis.rs | 2 +- src/redis/cache.rs | 15 ++------- src/redis/mem_cache.rs | 42 +++++++++++++++++------- 6 files changed, 62 insertions(+), 35 deletions(-) diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 85eaab5a..e29cb586 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -964,6 +964,7 @@ pub async fn reset_and_log_metrics( .unwrap_or_default(), ); Utils::metric_tracker_log( + decider_flow.get().dpShouldConsumeResult.clone(), metric_title.clone().as_str(), "GW_SCORING", Utils::get_metric_log_format(decider_flow, metric_title.as_str()), @@ -1658,6 +1659,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }, ); Utils::metric_tracker_log( + decider_flow.get().dpShouldConsumeResult.clone(), "GLOBAL_SR_EVALUATION", "GW_SCORING", Utils::get_metric_log_format(decider_flow, "GLOBAL_SR_EVALUATION"), @@ -2635,6 +2637,7 @@ pub async fn update_gateway_score_based_on_success_rate( ); Utils::metric_tracker_log( + decider_flow.get().dpShouldConsumeResult.clone(), "SR_EVALUATION", "GW_SCORING", Utils::get_metric_log_format(decider_flow, "SR_EVALUATION"), diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 9b90c988..7ef34778 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -278,9 +278,9 @@ impl Serialize for GatewayScoringTypeLog { where S: serde::Serializer, { - let mut state = serializer.serialize_struct("GatewayScoringTypeLog", 1)?; - state.serialize_field("data", &self.data)?; - state.end() + let mut state = serializer.serialize_struct("GatewayScoringTypeLog", 1)?; + state.serialize_field("data", &self.data)?; + state.end() } } @@ -294,7 +294,7 @@ impl<'de> Deserialize<'de> for GatewayScoringTypeLog { &["data"], GatewayScoringTypeLogVisitor, )?; - Ok(Self { data }) + Ok(Self { data }) } } diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 83483acc..92817ab8 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -713,7 +713,12 @@ pub async fn get_split_settlement_details( } } -pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFormat) { +pub async fn metric_tracker_log( + consume_from_router: Option, + stage: &str, + flowtype: &str, + log_data: MessageFormat, +) { let mut normalized_log_data = match serde_json::to_value(&log_data) { Ok(value) => value, Err(e) => { @@ -726,11 +731,19 @@ pub async fn metric_tracker_log(stage: &str, flowtype: &str, log_data: MessageFo } }; - crate::logger::info!( - action = "metric_tracking_log", - "{}", - normalized_log_data.to_string(), - ); + if consume_from_router == Some(true) { + crate::logger::info!( + action = "metric_tracking_log", + "{}", + normalized_log_data.to_string(), + ); + } else { + crate::logger::info!( + action = "metric_tracking_log_diff_check_de", + "{}", + normalized_log_data.to_string(), + ); + } } pub fn mask_secret_option(_: &Option>, serializer: S) -> Result @@ -799,6 +812,7 @@ pub async fn log_gateway_decider_approach( let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); let x_req_id = decider_flow.logger.get("x-request-id").cloned(); let txn_creation_time = txn_detail.dateCreated.to_string(); // Assuming dateCreated is a DateTime field + let consume_from_router = decider_flow.get().dpShouldConsumeResult; let mp = types::DeciderApproachLogData { decided_gateway: m_decided_gateway, @@ -814,6 +828,7 @@ pub async fn log_gateway_decider_approach( let payment_source_m = txn_card_info.get_payment_source_last(); metric_tracker_log( + consume_from_router, "GATEWAY_DECIDER_APPROACH", "DECIDER", MessageFormat { diff --git a/src/redis.rs b/src/redis.rs index 8fe9a1a6..24ac6eb1 100644 --- a/src/redis.rs +++ b/src/redis.rs @@ -1,5 +1,5 @@ pub mod cache; -pub mod mem_cache; pub mod commands; pub mod feature; +pub mod mem_cache; pub mod types; diff --git a/src/redis/cache.rs b/src/redis/cache.rs index 7db27c5f..22932d06 100644 --- a/src/redis/cache.rs +++ b/src/redis/cache.rs @@ -116,12 +116,8 @@ where Ok(Some(service_config)) => match service_config.value { Some(value) => { // Get TTL from global config - let ttl_seconds = Some( - app_state - .config - .cache_config - .service_config_ttl as u64, - ); + let ttl_seconds = + Some(app_state.config.cache_config.service_config_ttl as u64); set_to_memory_cache(&prefixed_key, &value, ttl_seconds).await; match decode_fn { @@ -154,12 +150,7 @@ where // Cache the default value in memory for future use let app_state = get_tenant_app_state().await; let prefixed_key = app_state.config.cache_config.add_prefix(&key); - let ttl_seconds = Some( - app_state - .config - .cache_config - .service_config_ttl as u64, - ); + let ttl_seconds = Some(app_state.config.cache_config.service_config_ttl as u64); set_to_memory_cache(&prefixed_key, &default_json, ttl_seconds).await; logger::debug!( diff --git a/src/redis/mem_cache.rs b/src/redis/mem_cache.rs index dc9aa2f2..ef2d513e 100644 --- a/src/redis/mem_cache.rs +++ b/src/redis/mem_cache.rs @@ -1,7 +1,7 @@ +use once_cell::sync::Lazy; use std::collections::HashMap; use std::sync::{Arc, RwLock}; use std::time::{Duration, Instant}; -use once_cell::sync::Lazy; // Global in-memory cache instance pub static GLOBAL_CACHE: Lazy = Lazy::new(|| Registry::new(1000)); @@ -50,7 +50,10 @@ impl Registry { T: serde::de::DeserializeOwned, { { - let data = self.data.read().map_err(|e| format!("Read lock error: {}", e))?; + let data = self + .data + .read() + .map_err(|e| format!("Read lock error: {}", e))?; if let Some(entry) = data.get(key) { // Check if entry has expired @@ -74,7 +77,10 @@ impl Registry { } // If we get here, the entry was expired and we need to remove it - let mut data = self.data.write().map_err(|e| format!("Write lock error: {}", e))?; + let mut data = self + .data + .write() + .map_err(|e| format!("Write lock error: {}", e))?; // Double-check the entry is still there and expired if let Some(entry) = data.get(key) { @@ -100,7 +106,10 @@ impl Registry { where T: serde::Serialize, { - let mut data = self.data.write().map_err(|e| format!("Write lock error: {}", e))?; + let mut data = self + .data + .write() + .map_err(|e| format!("Write lock error: {}", e))?; // Remove expired entries and enforce max size self.cleanup_expired(&mut data); @@ -112,15 +121,18 @@ impl Registry { } } - let json_value = serde_json::to_value(value) - .map_err(|e| format!("Serialization error: {}", e))?; + let json_value = + serde_json::to_value(value).map_err(|e| format!("Serialization error: {}", e))?; let expires_at = ttl_seconds.map(|ttl| Instant::now() + Duration::from_secs(ttl)); - data.insert(key, CacheEntry { - value: json_value, - expires_at, - }); + data.insert( + key, + CacheEntry { + value: json_value, + expires_at, + }, + ); Ok(()) } @@ -137,7 +149,10 @@ impl Registry { } pub fn remove(&self, key: &str) -> Result<(), String> { - let mut data = self.data.write().map_err(|e| format!("Write lock error: {}", e))?; + let mut data = self + .data + .write() + .map_err(|e| format!("Write lock error: {}", e))?; data.remove(key); Ok(()) } @@ -147,7 +162,10 @@ impl Registry { } pub fn clear(&self) -> Result<(), String> { - let mut data = self.data.write().map_err(|e| format!("Write lock error: {}", e))?; + let mut data = self + .data + .write() + .map_err(|e| format!("Write lock error: {}", e))?; data.clear(); Ok(()) } From f6efa41968b88c2244430cda3cef94cc6eb43566 Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Thu, 4 Dec 2025 13:40:52 +0530 Subject: [PATCH 56/95] Changes to fix Global Elimiantion (#197) --- src/decider/gatewaydecider/gw_filter.rs | 17 ++++++++++------- src/decider/gatewaydecider/gw_scoring.rs | 10 ++++++++-- src/decider/gatewaydecider/utils.rs | 6 +++++- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index 608efaf7..59911d11 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -33,7 +33,7 @@ use crate::types::merchant_gateway_account_sub_info::{self as ETMGASI, SubIdType use crate::types::merchant_gateway_payment_method_flow as MGPMF; use crate::types::order::Order; use crate::types::payment::payment_method::{self as ETP}; -use crate::types::payment_flow::{PaymentFlow, payment_flows_to_text, text_to_payment_flows}; +use crate::types::payment_flow::{payment_flows_to_text, text_to_payment_flows, PaymentFlow}; use std::collections::{HashMap, HashSet}; // use crate::types::metadata::Meta; // use crate::types::pl_ref_id_map::PLRefIdMap; @@ -576,7 +576,8 @@ pub fn isMgaEligible( ) -> bool { let payment_flow_list = Utils::get_payment_flow_list_from_txn_detail(&txn_detail); let is_otm_flow = payment_flow_list.contains(&"ONE_TIME_MANDATE".to_string()); - let is_pix_automatic_redirect_flow = payment_flow_list.contains(&"PIX_AUTOMATIC_REDIRECT".to_string()); + let is_pix_automatic_redirect_flow = + payment_flow_list.contains(&"PIX_AUTOMATIC_REDIRECT".to_string()); validateMga( mga, txnCI, @@ -1463,7 +1464,7 @@ pub async fn filterFunctionalGatewaysForPixFlows(this: &mut DeciderFlow<'_>) -> _ => "enablePixAutomaticRedirect", } } - + // Get current functional gateways let st = getGws(this); @@ -1480,8 +1481,8 @@ pub async fn filterFunctionalGatewaysForPixFlows(this: &mut DeciderFlow<'_>) -> .find(|&flow| payment_flow_list.contains(&flow.to_string())); // Try to parse the PIX flow text into a PaymentFlow enum - let m_pix_payment_flow: Option = m_pix_flow_text - .and_then(|flow_text| text_to_payment_flows(flow_text.to_string()).ok()); + let m_pix_payment_flow: Option = + m_pix_flow_text.and_then(|flow_text| text_to_payment_flows(flow_text.to_string()).ok()); match m_pix_payment_flow { Some(pix_payment_flow) => { @@ -1505,7 +1506,8 @@ pub async fn filterFunctionalGatewaysForPixFlows(this: &mut DeciderFlow<'_>) -> .await; // Get the account details flag to check for this PIX flow - let acc_details_flag_to_be_checked = get_acc_details_flag_to_be_checked(&pix_payment_flow); + let acc_details_flag_to_be_checked = + get_acc_details_flag_to_be_checked(&pix_payment_flow); // Filter MGAs that support PIX flows let mgas: Vec<_> = enabled_mgas @@ -1735,7 +1737,8 @@ pub async fn filterGatewaysForValidationType( // Check if we should skip processing for one-time mandate flow let payment_flow_list = Utils::get_payment_flow_list_from_txn_detail(&txn_detail); let is_otm_flow = payment_flow_list.contains(&"ONE_TIME_MANDATE".to_string()); - let is_pix_automatic_redirect_flow = payment_flow_list.contains(&"PIX_AUTOMATIC_REDIRECT".to_string()); + let is_pix_automatic_redirect_flow = + payment_flow_list.contains(&"PIX_AUTOMATIC_REDIRECT".to_string()); if is_otm_flow || is_pix_automatic_redirect_flow { logger::info!( diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index e29cb586..5f36b2c5 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -1270,12 +1270,18 @@ pub async fn get_global_gateway_score( ) -> Option<(Vec, f64)> { if let (Some(max_count), Some(score_threshold)) = (max_count, score_threshold) { let app_state = get_tenant_app_state().await; + // let m_value: Option = app_state + // .redis_conn + // .get_key(&redis_key, "global_gateway_score_key") + // .await + // .inspect_err(|err| logger::error!("get_global_gateway_score get_key_error: {:?}", err)) + // .unwrap_or(None); let m_value: Option = app_state .redis_conn - .get_key(&redis_key, "global_gateway_score_key") + .get_key::(&redis_key, "global_gateway_score_key") .await .inspect_err(|err| logger::error!("get_global_gateway_score get_key_error: {:?}", err)) - .unwrap_or(None); + .ok(); logger::info!( tag = "getGlobalGatewayScore", action = "getGlobalGatewayScore", diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 92817ab8..d66efb74 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -842,7 +842,11 @@ pub async fn log_gateway_decider_approach( payment_source: payment_source_m.map(Secret::new), source_object: txn_detail.sourceObject, txn_detail_id: txn_detail.id, - stage: "GATEWAY_DECIDER_APPROACH".to_string(), + stage: if consume_from_router == Some(true) { + "GATEWAY_DECIDER_APPROACH".to_string() + } else { + "GATEWAY_DECIDER_APPROACH_DIFF_CHECK_DE".to_string() + }, merchant_id: merchant_id_to_text(order_reference.merchantId), txn_uuid: txn_detail.txnUuid, order_id: order_reference.orderId.0, From f0019b0cf9edcf01ca6568503574c30c23b461a5 Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Mon, 15 Dec 2025 19:17:36 +0530 Subject: [PATCH 57/95] feat: Fix global elimination redis key issue (#198) --- Cargo.lock | 24 +- Cargo.toml | 4 +- config/development.toml | 3 + src/app.rs | 5 +- src/config.rs | 6 + src/decider/gatewaydecider/flow_new.rs | 6 +- src/decider/gatewaydecider/flows.rs | 12 +- src/decider/gatewaydecider/gw_scoring.rs | 13 +- src/decider/gatewaydecider/runner.rs | 4 +- src/decider/gatewaydecider/types.rs | 2 + src/decider/gatewaydecider/utils.rs | 42 +- .../gateway_elimination_scoring/flow.rs | 4 +- src/feedback/gateway_scoring_service.rs | 25 +- src/feedback/utils.rs | 28 +- src/redis/commands.rs | 453 +++++++++++++++++- src/redis/feature.rs | 206 ++++++++ src/routes/decision_gateway.rs | 27 +- src/routes/update_score.rs | 21 + 18 files changed, 853 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7f0734f..4ca291ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2955,7 +2955,7 @@ dependencies = [ "subprocess", "thiserror 1.0.69", "uuid", - "zstd", + "zstd 0.13.3", ] [[package]] @@ -3171,6 +3171,7 @@ dependencies = [ "tracing-subscriber", "uuid", "vaultrs", + "zstd 0.12.4", ] [[package]] @@ -6129,13 +6130,32 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", +] + [[package]] name = "zstd" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe", + "zstd-safe 7.2.4", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 77bf6526..1c4968f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ rust-version = "1.85.0" [features] default = ["middleware","mysql"] -release = ["middleware", "kms-aws","mysql"] +release = ["middleware", "kms-aws","mysql", "redis_compression"] kms-aws = ["dep:aws-config", "dep:aws-sdk-kms"] kms-hashicorp-vault = ["dep:vaultrs"] limit = [] @@ -19,6 +19,7 @@ external_key_manager = [] external_key_manager_mtls = ["external_key_manager", "reqwest/rustls-tls"] postgres = [] mysql = [] +redis_compression = ["dep:zstd"] [dependencies] aws-config = { version = "1.5.5", optional = true } @@ -36,6 +37,7 @@ jemallocator = "0.5" jemalloc-ctl = "0.5" prometheus = "0.13" lazy_static = "1.4" +zstd = { version = "0.12", optional = true } async-bb8-diesel = { git = "https://github.com/jarnura/async-bb8-diesel", rev = "53b4ab901aab7635c8215fd1c2d542c8db443094" } redis_interface = { git = "https://github.com/juspay/hyperswitch.git", tag = "2024.09.30.0" } diff --git a/config/development.toml b/config/development.toml index 0d0e3bbc..a4509240 100644 --- a/config/development.toml +++ b/config/development.toml @@ -53,6 +53,9 @@ max_capacity = 5000 service_config_redis_prefix = "DE_service_config_" service_config_ttl = 300 # 5 minutes +[compression_filepath] +zstd_compression_filepath = "/tmp/extra-paths/redis-zstd-dictionaries/sbx" + [tenant_secrets] public = { schema = "public" } diff --git a/src/app.rs b/src/app.rs index e89f5cbb..8b65f0a0 100644 --- a/src/app.rs +++ b/src/app.rs @@ -71,7 +71,10 @@ impl TenantAppState { Ok(Self { db, - redis_conn: Arc::new(RedisConnectionWrapper::new(redis_conn)), + redis_conn: Arc::new(RedisConnectionWrapper::new( + redis_conn, + global_config.compression_filepath.clone(), + )), api_client, config: tenant_config, }) diff --git a/src/config.rs b/src/config.rs index b1243016..1a5fa02c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -42,6 +42,7 @@ pub struct GlobalConfig { pub routing_config: Option, #[serde(default)] pub debit_routing_config: network_decider::types::DebitRoutingConfig, + pub compression_filepath: Option, } #[derive(Clone, Debug)] @@ -121,6 +122,11 @@ impl CacheConfig { } } +#[derive(Clone, serde::Deserialize, Debug)] +pub struct CompressionFilepath { + pub zstd_compression_filepath: String, +} + #[derive(serde::Deserialize, Debug, Clone)] pub struct TenantSecrets { /// schema name for the tenant (defaults to tenant_id) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 5cbca32e..e4d2903e 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -22,6 +22,7 @@ use super::utils as Utils; // use optics_core::{preview, review}; use crate::decider::gatewaydecider::constants as C; use crate::logger; +use crate::redis::feature::RedisDataStruct; use crate::types::card::txn_card_info::TxnCardInfo; use crate::types::merchant as ETM; use crate::types::merchant::merchant_gateway_account::MerchantGatewayAccount; @@ -71,7 +72,7 @@ pub async fn decider_full_payload_hs_function( Some(card_bin) => Some(card_bin), None => match dreq.txnCardInfo.card_isin { Some(c_isin) => { - let res_bin = Utils::get_card_bin_from_token_bin(6, c_isin.as_str()).await; + let res_bin = Utils::get_card_bin_from_token_bin(6, c_isin.as_str(), None).await; Some(res_bin) } None => dreq.txnCardInfo.card_isin.clone(), @@ -105,6 +106,7 @@ pub async fn decider_full_payload_hs_function( dpPriorityLogicScript: dreq.priorityLogicScript, dpEDCCApplied: dreq.isEdccApplied, dpShouldConsumeResult: dreq.shouldConsumeResult, + dpRedisCompressionConfig: None, }; if dreq_.ranking_algorithm == Some(RankingAlgorithm::NtwBasedRouting) { @@ -534,6 +536,8 @@ pub async fn run_decider_flow( .unwrap_or_default() .as_str(), C::GATEWAY_SCORE_KEYS_TTL, + None, + RedisDataStruct::STRING, ) .await .unwrap_or_default(); diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 8b8c0923..5c1c5600 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -1,5 +1,6 @@ use super::runner::get_gateway_priority; use super::types::UnifiedError; +use crate::redis::feature::{RedisCompressionConfigCombined, RedisDataStruct}; use axum::response::IntoResponse; use serde_json::json; use serde_json::Value as AValue; @@ -127,6 +128,7 @@ pub trait ResponseDecider { pub async fn decider_full_payload_hs_function( dreq: T::DomainDeciderRequest, + redis_compression_config: Option, ) -> Result<(T::DecidedGateway, Vec<(String, Vec)>), T::ErrorResponse> { let merchant_prefs = match ETM::merchant_iframe_preferences::getMerchantIPrefsByMId( dreq.txnDetail.merchantId.0.clone(), @@ -165,7 +167,12 @@ pub async fn decider_full_payload_hs_function( Some(card_bin) => Some(card_bin), None => match dreq.txnCardInfo.card_isin { Some(c_isin) => { - let res_bin = Utils::get_card_bin_from_token_bin(6, c_isin.as_str()).await; + let res_bin = Utils::get_card_bin_from_token_bin( + 6, + c_isin.as_str(), + redis_compression_config.clone(), + ) + .await; Some(res_bin) } None => dreq.txnCardInfo.card_isin.clone(), @@ -199,6 +206,7 @@ pub async fn decider_full_payload_hs_function( dpPriorityLogicScript: dreq.priorityLogicScript, dpEDCCApplied: dreq.isEdccApplied, dpShouldConsumeResult: dreq.shouldConsumeResult, + dpRedisCompressionConfig: redis_compression_config, }; run_decider_flow(decider_params, true).await } @@ -698,6 +706,8 @@ pub async fn run_decider_flow( .unwrap_or_default() .as_str(), C::GATEWAY_SCORE_KEYS_TTL, + deciderParams.dpRedisCompressionConfig.clone(), + RedisDataStruct::STRING, ) .await .unwrap_or_default(); diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 5f36b2c5..1ef14fcb 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -30,7 +30,7 @@ use rand_distr::{Beta, Binomial, Distribution}; use serde::{Deserialize, Serialize}; use time::{OffsetDateTime, PrimitiveDateTime}; // use crate::types::card_brand_routes as ETCBR; -use crate::redis::feature::{self as M, is_feature_enabled}; +use crate::redis::feature::{self as M, is_feature_enabled, RedisCompressionConfigCombined}; use crate::types::gateway_routing_input as ETGRI; // use crate::types::gateway_health as ETGH; use crate::types::card as ETCT; @@ -3009,6 +3009,7 @@ pub async fn trigger_reset_gateway_score( decider_flow, txn_detail.clone(), reset_gateway_input.clone(), + decider_flow.get().dpRedisCompressionConfig.clone(), ) .await; reset_gateway_sr_list.push(reset_gateway_input.clone()); @@ -3071,6 +3072,7 @@ pub async fn reset_gateway_score( decider_flow: &mut DeciderFlow<'_>, txn_detail: ETTD::TxnDetail, reset_gateway_input: ResetGatewayInput, + redis_compression_config: Option, ) { let current_timestamp = get_current_date_in_millis(); match ( @@ -3081,6 +3083,14 @@ pub async fn reset_gateway_score( (Some(key), Some(threshold), Some(max_count)) => { let penality_factor = Utils::get_penality_factor_(decider_flow).await; let score = get_merchant_elimination_gateway_score(key.clone()).await; + logger::debug!( + tag = "scoringFlow", + action = "scoringFlow", + "Current Gateway Score for {:?} : key {:?} before reset attempt: {:?}", + txn_detail.txnId, + key, + score + ); let (is_eligible_for_reset, reset_cached_gateway_score) = match score { Some(score) => { let current_score = score.score; @@ -3141,6 +3151,7 @@ pub async fn reset_gateway_score( key.clone(), reset_cached_gateway_score.clone(), safe_remaining_ttl, + redis_compression_config, ) .await; match result { diff --git a/src/decider/gatewaydecider/runner.rs b/src/decider/gatewaydecider/runner.rs index 852f4e88..148abdd4 100644 --- a/src/decider/gatewaydecider/runner.rs +++ b/src/decider/gatewaydecider/runner.rs @@ -509,7 +509,9 @@ pub async fn execute_priority_logic( let resolve_bin = match utils::fetch_extended_card_bin(&req.txnCardInfo) { Some(card_bin) => Some(card_bin), None => match req.txnCardInfo.card_isin { - Some(c_isin) => Some(utils::get_card_bin_from_token_bin(6, c_isin.as_str()).await), + Some(c_isin) => { + Some(utils::get_card_bin_from_token_bin(6, c_isin.as_str(), None).await) + } None => None, }, }; diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 7ef34778..3823b865 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -1,5 +1,6 @@ use crate::app::{get_tenant_app_state, TenantAppState}; use crate::decider::network_decider; +use crate::redis::feature::RedisCompressionConfigCombined; use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; use crate::types::money::internal as ETMo; @@ -1297,6 +1298,7 @@ pub struct DeciderParams { pub dpPriorityLogicScript: Option, pub dpEDCCApplied: Option, pub dpShouldConsumeResult: Option, + pub dpRedisCompressionConfig: Option, } #[derive(Debug, Serialize, Deserialize)] diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index d66efb74..f2958732 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -5,7 +5,9 @@ use crate::euclid::types::SrDimensionConfig; use crate::feedback::gateway_elimination_scoring::flow::{ eliminationV2RewardFactor, getPenaltyFactor, }; -use crate::redis::feature::is_feature_enabled; +use crate::redis::feature::{ + is_feature_enabled, RedisCompressionConfig, RedisCompressionConfigCombined, RedisDataStruct, +}; use crate::redis::types::ServiceConfigKey; use crate::types::card::card_type::card_type_to_text; use crate::types::country::country_iso::CountryISO2; @@ -878,7 +880,11 @@ pub fn get_true_string(val: Option) -> Option { } } -pub async fn get_card_bin_from_token_bin(length: usize, token_bin: &str) -> String { +pub async fn get_card_bin_from_token_bin( + length: usize, + token_bin: &str, + redis_compression_config: Option, +) -> String { let key = format!("token_bin_{}", token_bin); let app_state = get_tenant_app_state().await; // let redis = &decider_flow.state().redis_conn; @@ -888,7 +894,12 @@ pub async fn get_card_bin_from_token_bin(length: usize, token_bin: &str) -> Stri Some(token_bin_info) => { app_state .redis_conn - .set_key(&key, &token_bin_info.cardBin) + .set_key( + &key, + &token_bin_info.cardBin, + redis_compression_config.clone(), + RedisDataStruct::STRING, + ) .await; token_bin_info.cardBin.chars().take(length).collect() } @@ -2945,13 +2956,20 @@ pub async fn writeToCacheWithTTL( key: String, cached_gateway_score: GatewayScore, ttl: i64, + redis_compression_config: Option, ) -> Result { - //from CachedGatewayScore comvert encoded_score to a encoded jasson that can be used as a value for redis sextx + //from CachedGatewayScore convert encoded_score to a encoded json that can be used as a value for redis sextx let encoded_score = serde_json::to_string(&cached_gateway_score).unwrap_or_else(|_| "".to_string()); - let primary_write = - addToCacheWithExpiry("kv_redis".to_string(), key.clone(), encoded_score, ttl).await; + let primary_write = addToCacheWithExpiry( + "kv_redis".to_string(), + key.clone(), + encoded_score, + ttl, + redis_compression_config, + ) + .await; match primary_write { Ok(_) => Ok(0), @@ -2965,9 +2983,19 @@ pub async fn addToCacheWithExpiry( key: String, value: String, ttl: i64, + redis_compression_config: Option, ) -> Result<(), StorageError> { let app_state = get_tenant_app_state().await; - let cached_resp = app_state.redis_conn.setx(&key, &value, ttl).await; + let cached_resp = app_state + .redis_conn + .setx( + &key, + &value, + ttl, + redis_compression_config, + RedisDataStruct::STRING, + ) + .await; match cached_resp { Ok(_) => Ok(()), Err(error) => Err(StorageError::InsertError), diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index d5ddadac..d8e3f3ea 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -47,7 +47,7 @@ use crate::feedback::types::{ }; use crate::logger; - +use crate::redis::feature::RedisCompressionConfigCombined; // use eulerhs::language::get_current_date_in_millis; // use eulerhs::language as EL; @@ -84,6 +84,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( mer_acc_p_id: merchant::id::MerchantPId, mer_acc: MerchantAccount, gateway_scoring_key: (ScoreKeyType, Option), + redis_compression_config: Option, ) -> Option<((ScoreKeyType, String), CachedGatewayScore)> { let merchant_id = Merchant::merchant_id_to_text(txn_detail.merchantId.clone()); let (score_key_type, m_key) = gateway_scoring_key; @@ -177,6 +178,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( key.clone(), updated_cached_gateway_score.clone(), safe_remaining_ttl, + redis_compression_config, ) .await; //To Do: add Ok & Err diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index c1e632ef..0ffc8991 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -2,7 +2,7 @@ // Generated on 2025-03-23 10:24:42 use crate::redis::cache::findByNameFromRedis; -use crate::redis::feature::is_feature_enabled; +use crate::redis::feature::{is_feature_enabled, RedisCompressionConfigCombined}; use masking::PeekInterface; // Converted imports // use gateway_decider::constants as c::{enable_elimination_v2, gateway_scoring_data, EnableExploreAndExploitOnSrv3, SrV3InputConfig, GatewayScoreFirstDimensionSoftTtl}; @@ -66,9 +66,7 @@ use crate::types::merchant as ETM; // use data::aeson as a; // use types::merchant as etm; -use fred::types::SetOptions; -use serde::{Deserialize, Serialize}; - +use crate::redis::feature::RedisDataStruct; use crate::{ feedback::{ constants as C, @@ -77,6 +75,8 @@ use crate::{ }, types::txn_details::types::{TransactionLatency, TxnDetail, TxnStatus, TxnStatus as TS}, }; +use fred::types::SetOptions; +use serde::{Deserialize, Serialize}; use super::constants::{ default_sr_v3_latency_threshold_in_secs, SrV3InputConfig, UpdateGatewayScoreLockFlagTtl, @@ -243,6 +243,7 @@ pub fn txn_failure_states() -> Vec { pub async fn check_and_send_should_update_gateway_score( lock_key: String, lock_key_ttl: i32, + redis_comp_config: Option, ) -> bool { let app_state = get_tenant_app_state().await; let is_set_either = app_state @@ -252,6 +253,8 @@ pub async fn check_and_send_should_update_gateway_score( "true", lock_key_ttl as i64, SetOptions::NX, + redis_comp_config, + RedisDataStruct::STRING, ) .await; @@ -447,6 +450,7 @@ pub async fn check_and_update_gateway_score_( enforce_failure, api_payload.gateway_reference_id.clone(), api_payload.txn_latency.clone(), + None, ) .await; @@ -483,6 +487,7 @@ pub async fn check_and_update_gateway_score( enforce_failure: bool, gateway_reference_id: Option, txn_latency: Option, + redis_comp_config: Option, ) -> () { // Get gateway scoring type let gateway_scoring_type = @@ -501,8 +506,12 @@ pub async fn check_and_update_gateway_score( .await .unwrap_or(300); - let should_compute_gw_score = - check_and_send_should_update_gateway_score(update_score_lock_key, lock_key_ttl).await; + let should_compute_gw_score = check_and_send_should_update_gateway_score( + update_score_lock_key, + lock_key_ttl, + redis_comp_config.clone(), + ) + .await; // Check if feature is enabled for merchant let feature_enabled = is_feature_enabled( @@ -529,6 +538,7 @@ pub async fn check_and_update_gateway_score( txn_card_info.clone(), gateway_reference_id.clone(), txn_latency.clone(), + redis_comp_config.clone(), ) .await; } @@ -547,6 +557,7 @@ pub async fn check_and_update_gateway_score( txn_card_info.clone(), gateway_reference_id.clone(), txn_latency.clone(), + redis_comp_config, ) .await; } @@ -561,6 +572,7 @@ pub async fn update_gateway_score( txn_card_info: TxnCardInfo, gateway_reference_id: Option, txn_latency: Option, + redis_compression_config: Option, ) -> () { let mer_acc: MerchantAccount = MA::load_merchant_by_merchant_id(MID::merchant_id_to_text(txn_detail.clone().merchantId)) @@ -720,6 +732,7 @@ pub async fn update_gateway_score( mer_acc_p_id, mer_acc.clone(), key, + redis_compression_config.clone(), )); } } diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index 505d3203..af682ae8 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -70,6 +70,9 @@ use crate::types::merchant as ETM; // use prelude::real_to_frac; // use data::time::clock::posix as DTP; use crate::logger; +use crate::redis::feature::{ + RedisCompressionConfig, RedisCompressionConfigCombined, RedisDataStruct, +}; use time::format_description::well_known::Iso8601; // Converted data types // Original Haskell data type: GatewayScoringType @@ -714,13 +717,20 @@ pub async fn writeToCacheWithTTL( key: String, cached_gateway_score: CachedGatewayScore, ttl: i64, + redis_compression_config: Option, ) -> Result { - //from CachedGatewayScore comvert encoded_score to a encoded jasson that can be used as a value for redis sextx + //from CachedGatewayScore convert encoded_score to a encoded json that can be used as a value for redis sextx let encoded_score = serde_json::to_string(&cached_gateway_score).unwrap_or_else(|_| "".to_string()); - let primary_write = - addToCacheWithExpiry("kv_redis".to_string(), key.clone(), encoded_score, ttl).await; + let primary_write = addToCacheWithExpiry( + "kv_redis".to_string(), + key.clone(), + encoded_score, + ttl, + redis_compression_config, + ) + .await; match primary_write { Ok(_) => Ok(0), @@ -734,9 +744,19 @@ pub async fn addToCacheWithExpiry( key: String, value: String, ttl: i64, + redis_compression_config: Option, ) -> Result<(), StorageError> { let app_state = get_tenant_app_state().await; - let cached_resp = app_state.redis_conn.setx(&key, &value, ttl).await; + let cached_resp = app_state + .redis_conn + .setx( + &key, + &value, + ttl, + redis_compression_config, + RedisDataStruct::STRING, + ) + .await; match cached_resp { Ok(_) => Ok(()), Err(error) => Err(StorageError::InsertError), diff --git a/src/redis/commands.rs b/src/redis/commands.rs index fd8d5ae7..48321e14 100644 --- a/src/redis/commands.rs +++ b/src/redis/commands.rs @@ -1,6 +1,7 @@ use std::future::Future; use std::pin::Pin; +use crate::logger; use error_stack::Result; use error_stack::ResultExt; use fred::prelude::RedisKey; @@ -8,27 +9,234 @@ use fred::types::SetOptions; use fred::{ clients::Transaction, interfaces::{KeysInterface, ListInterface, TransactionInterface}, - types::{Expiration, FromRedis, MultipleValues}, + types::{Expiration, FromRedis, MultipleValues, RedisValue}, }; use redis_interface::{errors, types::DelReply, RedisConnectionPool}; use std::fmt::Debug; +use crate::config::CompressionFilepath; +use crate::config::GlobalConfig; +use crate::redis::feature; +use crate::redis::feature::{ + RedisCompressionConfig, RedisCompressionConfigCombined, RedisDataStruct, +}; +use serde::de::DeserializeOwned; +use std::collections::HashMap; +use std::env; +use std::fs::File; +use std::io::{Cursor, Read}; +use std::str; +#[cfg(feature = "redis_compression")] +use zstd::{ + bulk::Compressor, + dict::{DecoderDictionary, EncoderDictionary}, + stream::{read::Decoder, write::Encoder}, +}; + pub struct RedisConnectionWrapper { pub conn: RedisConnectionPool, + pub compression_file_path: Option, } +const ZSTD_MAGIC_BYTES: &[u8] = &[0x28, 0xB5, 0x2F, 0xFD]; + impl RedisConnectionWrapper { - pub fn new(redis_conn: RedisConnectionPool) -> Self { - Self { conn: redis_conn } + pub fn new( + redis_conn: RedisConnectionPool, + compression_file_path: Option, + ) -> Self { + Self { + conn: redis_conn, + compression_file_path, + } + } + + #[cfg(feature = "redis_compression")] + fn compress_string_with_config( + &self, + value: &str, + key: &str, + redis_compression_config: Option<&RedisCompressionConfigCombined>, + redis_type: RedisDataStruct, + ) -> Vec { + logger::debug!( + "REDIS_ZSTD_COMPRESS - compress_string_with_config called with key: {}, value length: {}", + key, + value.len() + ); + + let json = value.as_bytes().to_vec(); + + let redis_compression_eligible_length = env::var("REDIS_COMPRESSION_ELIGIBLE_LENGTH") + .ok() + .and_then(|v| v.parse::().ok()) + .unwrap_or(200); + + let redis_type_key = redis_type.as_str(); + + logger::debug!( + "REDIS_ZSTD_COMPRESS - Redis Type Key: {}, JSON Length: {}, redis_compression_config: {:?}, key: {} , eligible_length: {}", + redis_type_key, + json.len(), + redis_compression_config, + key, + redis_compression_eligible_length + ); + + let final_value = match redis_compression_config { + Some(config_combined) if config_combined.isRedisCompEnabled => { + match config_combined + .redisCompressionConfig + .as_ref() + .and_then(|config| config.get(redis_type_key)) + { + Some(comp_conf) + if json.len() > redis_compression_eligible_length + && comp_conf.compEnabled => + { + logger::debug!( + "REDIS_ZSTD_COMPRESS - Compressing data for key: {}, dictId: {}", + key, + comp_conf.dictId + ); + self.compress_with_dict(&json, comp_conf, key) + } + _ => { + logger::debug!( + "REDIS_ZSTD_COMPRESS - Skipping compression for key: {} (length or compEnabled check failed)", + key + ); + json + } + } + } + _ => { + logger::debug!( + "REDIS_ZSTD_COMPRESS - Skipping compression for key: {} (redis compression not enabled or config not present)", + key + ); + json + } + }; + + logger::debug!( + "REDIS_ZSTD_COMPRESS - Compressed/processed key: {}, final value length: {}, is_compressed: {}", + key, + final_value.len(), + Self::is_zstd_compressed(&final_value) + ); + + final_value } - pub async fn set_key(&self, key: &str, value: V) -> Result<(), errors::RedisError> + #[cfg(feature = "redis_compression")] + fn compress_with_dict( + &self, + json: &[u8], + comp_conf: &RedisCompressionConfig, + key: &str, + ) -> Vec { + let dict_file_path = match &self.compression_file_path { + Some(compression_config) => format!( + "{}/{}.dict", + compression_config.zstd_compression_filepath, comp_conf.dictId + ), + None => { + logger::debug!( + "REDIS_ZSTD_COMPRESS - Compression filepath not configured for key: {}", + key + ); + return json.to_vec(); + } + }; + + match std::fs::read(&dict_file_path) { + Ok(dict_bytes) => { + let compression_level = comp_conf + .compLevel + .as_ref() + .and_then(|s| s.parse::().ok()) + .unwrap_or(3); + + match Compressor::with_dictionary(compression_level, &dict_bytes) { + Ok(mut compressor) => match compressor.compress(json) { + Ok(compressed) => { + logger::debug!( + "REDIS_ZSTD_COMPRESS - Successfully compressed data for key: {}, original length: {}, compressed length: {}", + key, + json.len(), + compressed.len() + ); + return compressed; + } + Err(e) => { + logger::error!("Compression failed for key {}: {:?}", key, e); + } + }, + Err(e) => { + logger::error!("Failed to create compressor for key {}: {:?}", key, e); + } + } + } + Err(e) => { + logger::error!( + "Failed to read dictionary file {} for key {}: {:?}", + dict_file_path, + key, + e + ); + } + } + + json.to_vec() + } + + #[cfg(not(feature = "redis_compression"))] + pub async fn set_key( + &self, + key: &str, + value: V, + redis_compression_config: Option, + redis_type: RedisDataStruct, + ) -> Result<(), errors::RedisError> where V: serde::Serialize + Debug, { self.conn.serialize_and_set_key(key, value).await } + #[cfg(feature = "redis_compression")] + pub async fn set_key( + &self, + key: &str, + value: &str, + redis_compression_config: Option, + redis_type: RedisDataStruct, + ) -> Result<(), errors::RedisError> { + let final_value = self.compress_string_with_config( + value, + key, + redis_compression_config.as_ref(), + redis_type, + ); + + // Convert Vec to RedisValue::Bytes for proper serialization + let redis_value = RedisValue::Bytes(final_value.into()); + + self.conn + .pool + .set::<(), _, _>(key, redis_value, None, None, false) + .await + .change_context(errors::RedisError::SetHashFailed)?; + + logger::debug!( + "REDIS_ZSTD_COMPRESS - REDIS_COMPRESSION - Successfully set key: {} (string type)", + key + ); + + Ok(()) + } + pub async fn set_key_with_ttl( &self, key: &str, @@ -43,6 +251,151 @@ impl RedisConnectionWrapper { .await } + #[cfg(feature = "redis_compression")] + fn is_zstd_compressed(data: &[u8]) -> bool { + data.len() >= 4 && &data[..4] == [0x28, 0xB5, 0x2F, 0xFD] + } + #[cfg(feature = "redis_compression")] + fn extract_dict_id_from_cdata(cdata: &[u8]) -> Option { + // Haskell magic: "(\181/\253" + let magic_number: [u8; 4] = [0x28, 0xB5, 0x2F, 0xFD]; + + if cdata.len() > 9 && &cdata[0..4] == magic_number { + let cdata_wo_magic = &cdata[4..]; + + let frame_header_w = cdata_wo_magic[0]; + + // getDictionaryLengthFromDictID (bit1, bit0) + let bit1 = ((frame_header_w >> 1) & 1) == 1; + let bit0 = (frame_header_w & 1) == 1; + + let dict_id_size = match (bit1, bit0) { + (false, false) => 1, + (false, true) => 1, + (true, false) => 2, + (true, true) => 4, + }; + + // singleSegmentFlag = bit 5 + let single_segment_flag = ((frame_header_w >> 5) & 1) == 1; + + let start_offset = if single_segment_flag { 1 } else { 2 }; + + if cdata_wo_magic.len() < start_offset + dict_id_size { + return None; + } + + let dict_id_bytes = &cdata_wo_magic[start_offset..start_offset + dict_id_size]; + + // decodeDictId → convert bytes to hex string + let decoded = Self::decode_dict_id(dict_id_bytes); + + Some(decoded) + } else { + None + } + } + + #[cfg(feature = "redis_compression")] + fn decode_dict_id(bytes: &[u8]) -> String { + let val = match bytes.len() { + 1 => bytes[0] as u32, + 2 => { + let s8 = bytes[0] as u32; + let f8 = bytes[1] as u32; + (f8 << 8) | s8 + } + 3 => { + let a8 = bytes[0] as u32; + let b8 = bytes[1] as u32; + let c8 = bytes[2] as u32; + (c8 << 16) | (b8 << 8) | a8 + } + 4 => { + let a8 = bytes[0] as u32; + let b8 = bytes[1] as u32; + let c8 = bytes[2] as u32; + let d8 = bytes[3] as u32; + ((d8 << 8) | c8) << 16 | (b8 << 8) | a8 + } + _ => { + logger::error!("Unexpected dict_id size: {}", bytes.len()); + return "0".to_string(); + } + }; + + val.to_string() + } + + #[cfg(feature = "redis_compression")] + pub async fn get_key( + &self, + key: &str, + type_name: &'static str, + ) -> Result + where + T: DeserializeOwned, + { + let raw_bytes: Vec = self.conn.get_key(key).await?; + + if raw_bytes.is_empty() { + return Err(errors::RedisError::GetFailed.into()); + } + + match Self::extract_dict_id_from_cdata(&raw_bytes) { + Some(dict_id) => { + let dict_file_path = match &self.compression_file_path { + Some(compression_config) => format!( + "{}/{}.dict", + compression_config.zstd_compression_filepath, dict_id + ), + None => { + logger::debug!( + "REDIS_ZSTD_COMPRESS - Compression filepath not configured for key: {}", + key + ); + return serde_json::from_slice(&raw_bytes) + .change_context(errors::RedisError::GetFailed); + } + }; + + let mut dict_file = File::open(&dict_file_path).map_err(|e| { + logger::error!( + "Failed to open dictionary file {} for key {}: {:?}", + dict_file_path, + key, + e + ); + errors::RedisError::UnknownResult + })?; + + let mut dict_bytes = Vec::new(); + dict_file.read_to_end(&mut dict_bytes).map_err(|e| { + logger::error!("Failed to read dictionary file for key {}: {:?}", key, e); + errors::RedisError::GetFailed + })?; + + let mut decoder = Decoder::with_dictionary(Cursor::new(&raw_bytes), &dict_bytes) + .map_err(|e| { + logger::error!("Failed to create ZSTD decoder for key {}: {:?}", key, e); + errors::RedisError::GetFailed + })?; + + let mut decompressed = Vec::new(); + decoder.read_to_end(&mut decompressed).map_err(|e| { + logger::error!("Failed to decompress data for key {}: {:?}", key, e); + errors::RedisError::GetFailed + })?; + + serde_json::from_slice(&decompressed).change_context(errors::RedisError::GetFailed) + } + None => { + serde_json::from_slice(&raw_bytes).change_context(errors::RedisError::GetFailed) + } + } + } + + #[cfg(not(feature = "redis_compression"))] pub async fn get_key( &self, key: &str, @@ -54,6 +407,12 @@ impl RedisConnectionWrapper { self.conn.get_and_deserialize_key(key, type_name).await } + #[cfg(feature = "redis_compression")] + pub async fn get_key_string(&self, key: &str) -> Result { + self.get_key::(key, "").await + } + + #[cfg(not(feature = "redis_compression"))] pub async fn get_key_string(&self, key: &str) -> Result { self.conn .get_key(key) @@ -129,12 +488,15 @@ impl RedisConnectionWrapper { .change_context(errors::RedisError::IncrementHashFieldFailed) } + #[cfg(not(feature = "redis_compression"))] pub async fn setXWithOption( &self, key: &str, value: &str, ttl: i64, option: SetOptions, + redis_compression_config: Option, + redis_type: RedisDataStruct, ) -> Result { // implement the redis query to set if it doesn't exist self.conn @@ -143,6 +505,47 @@ impl RedisConnectionWrapper { .await .change_context(errors::RedisError::SetHashFailed) } + #[cfg(feature = "redis_compression")] + pub async fn setXWithOption( + &self, + key: &str, + value: &str, + ttl: i64, + option: SetOptions, + redis_compression_config: Option, + redis_type: RedisDataStruct, + ) -> Result { + let final_value = self.compress_string_with_config( + value, + key, + redis_compression_config.as_ref(), + redis_type, + ); + + // Convert Vec to RedisValue::Bytes for proper serialization + let redis_value = RedisValue::Bytes(final_value.into()); + + let result = self + .conn + .pool + .set( + key, + redis_value, + Some(Expiration::EX(ttl)), + Some(option), + false, + ) + .await + .change_context(errors::RedisError::SetHashFailed)?; + + logger::debug!( + "REDIS_ZSTD_COMPRESS - REDIS_COMPRESSION - Successfully set key: {}, result: {}", + key, + result + ); + + Ok(result) + } pub async fn exists(&self, key: &str) -> Result { self.conn .pool @@ -150,13 +553,53 @@ impl RedisConnectionWrapper { .await .change_context(errors::RedisError::GetFailed) } - pub async fn setx(&self, key: &str, value: &str, ttl: i64) -> Result<(), errors::RedisError> { + #[cfg(not(feature = "redis_compression"))] + pub async fn setx( + &self, + key: &str, + value: &str, + ttl: i64, + redis_compression_config: Option, + redis_type: RedisDataStruct, + ) -> Result<(), errors::RedisError> { self.conn .pool .set(key, value, Some(Expiration::EX(ttl)), None, false) .await .change_context(errors::RedisError::SetHashFailed) } + #[cfg(feature = "redis_compression")] + pub async fn setx( + &self, + key: &str, + value: &str, + ttl: i64, + redis_compression_config: Option, + redis_type: RedisDataStruct, + ) -> Result<(), errors::RedisError> { + let final_value = self.compress_string_with_config( + value, + key, + redis_compression_config.as_ref(), + redis_type, + ); + + // Convert Vec to RedisValue::Bytes for proper serialization + let redis_value = RedisValue::Bytes(final_value.into()); + + self.conn + .pool + .set::<(), _, _>(key, redis_value, Some(Expiration::EX(ttl)), None, false) + .await + .change_context(errors::RedisError::SetHashFailed)?; + + logger::debug!( + "REDIS_ZSTD_COMPRESS - REDIS_COMPRESSION - Successfully set key: {}", + key + ); + + Ok(()) + } pub async fn multi(&self, abort_on_error: bool, f: F) -> Result where R: FromRedis, diff --git a/src/redis/feature.rs b/src/redis/feature.rs index d7a5e808..822d2103 100644 --- a/src/redis/feature.rs +++ b/src/redis/feature.rs @@ -2,6 +2,8 @@ use crate::logger; use crate::redis::types::DimensionConf; use crate::redis::{cache::findByNameFromRedis, types::FeatureConf}; use rand::Rng; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; // Converted functions // Original Haskell function: isFeatureEnabled @@ -118,3 +120,207 @@ pub fn roller(key: String, num: i32) -> bool { let random_int_v = rng.gen_range(1..=100); random_int_v <= num } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct RedisCompressionConfig { + pub compEnabled: bool, + pub dictId: String, + pub compLevel: Option, +} +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct RedisCompressionConfigCombined { + pub redisCompressionConfig: Option>, + pub isRedisCompEnabled: bool, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum RedisDataStruct { + STRING, + HASHMAP, + STREAM, + STREAM_V2, +} + +impl RedisDataStruct { + pub fn as_str(&self) -> &'static str { + match self { + RedisDataStruct::STRING => "STRING", + RedisDataStruct::HASHMAP => "HASHMAP", + RedisDataStruct::STREAM => "STREAM", + RedisDataStruct::STREAM_V2 => "STREAM_V2", + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RedisCompEnabledMerchant { + pub rc_merchant_id: String, + pub rc_rollout: u32, + pub enabled_dict_id: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RedisCompFeatureConf { + pub rc_enable_all: bool, + pub rc_enable_all_rollout: Option, + pub global_dict_id: String, + pub rc_disable_any: Option>, + pub explicit_enabled_merchants: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RedisCompressionCutover { + MultiDataStructCutover(HashMap), + StringDataStructCutover(RedisCompFeatureConf), +} + +pub async fn check_redis_comp_merchant_flag( + mid: String, +) -> Option> { + let mb_conf = findByNameFromRedis::( + "redis_compression_merchant_cutover".to_string(), + ) + .await; + + match mb_conf { + Some(RedisCompressionCutover::MultiDataStructCutover(ds_map)) => { + let mut final_map = HashMap::new(); + + for (data_struct_key, conf) in ds_map.iter() { + if let Some(dict_id) = + check_merchant_enabled_for_compression(Some(conf.clone()), &mid).await + { + let redis_comp_config = RedisCompressionConfig { + compEnabled: true, + dictId: dict_id, + compLevel: None, + }; + final_map.insert(data_struct_key.as_str().to_string(), redis_comp_config); + } + } + + if !final_map.is_empty() { + logger::info!( + "Redis compression config set for merchant {}: {:?}", + mid, + final_map + ); + Some(final_map) + } else { + None + } + } + Some(RedisCompressionCutover::StringDataStructCutover(conf)) => { + if let Some(dict_id) = check_merchant_enabled_for_compression(Some(conf), &mid).await { + let redis_comp_config = RedisCompressionConfig { + compEnabled: true, + dictId: dict_id, + compLevel: None, + }; + let mut final_map = HashMap::new(); + final_map.insert("STRING".to_string(), redis_comp_config); + + logger::info!( + "Redis compression config set for merchant {}: {:?}", + mid, + final_map + ); + Some(final_map) + } else { + None + } + } + None => None, + } +} + +async fn check_merchant_enabled_for_compression( + maybe_conf: Option, + mid: &str, +) -> Option { + match maybe_conf { + Some(conf) => { + // First check if merchant is explicitly enabled + if let Some(dict_id_explicit) = is_merchant_enabled_explicitly(&conf, mid).await { + return Some(dict_id_explicit); + } + + // Check global enable with rollout + let maybe_global_dict_id = if conf.rc_enable_all { + match conf.rc_enable_all_rollout { + Some(rollout) => { + // Generate random number for rollout decision + let mut rng = rand::thread_rng(); + let random_int_v: u32 = rng.gen_range(1..=100); + + if random_int_v <= rollout { + Some(conf.global_dict_id.clone()) + } else { + None + } + } + None => Some(conf.global_dict_id.clone()), + } + } else { + None + }; + + is_merchant_enabled_after_disable_check(&conf, mid, maybe_global_dict_id) + } + None => None, + } +} + +fn is_merchant_enabled_after_disable_check( + conf: &RedisCompFeatureConf, + mid: &str, + result: Option, +) -> Option { + match (result, &conf.rc_disable_any) { + (Some(dict_id), Some(disable_list)) => { + // Check if merchant is NOT in the disable list + let mid_lower = mid.to_lowercase(); + let is_disabled = disable_list + .iter() + .any(|disabled_mid| disabled_mid.to_lowercase() == mid_lower); + + if is_disabled { + None + } else { + Some(dict_id) + } + } + (res, _) => res, + } +} + +async fn is_merchant_enabled_explicitly(conf: &RedisCompFeatureConf, mid: &str) -> Option { + let list = &conf.explicit_enabled_merchants; + let mid_lower = mid.to_lowercase(); + + // Find the merchant configuration + let opt_m_conf = list + .iter() + .find(|m_conf| m_conf.rc_merchant_id.to_lowercase() == mid_lower); + + match opt_m_conf { + Some(m_conf) => { + // Generate random number for rollout decision + let mut rng = rand::thread_rng(); + let random_int_v: u32 = rng.gen_range(1..=100); + + if random_int_v <= m_conf.rc_rollout { + // Return the enabled dict ID if present, otherwise use the global dict ID + m_conf + .enabled_dict_id + .clone() + .or_else(|| Some(conf.global_dict_id.clone())) + } else { + None + } + } + None => None, + } +} diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index 87df8a83..5b189b0b 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -1,16 +1,22 @@ use std::time::Instant; +use crate::decider::gatewaydecider::constants as C; use crate::decider::gatewaydecider::{ flows::decider_full_payload_hs_function, types::{DecidedGateway, DomainDeciderRequest, ErrorResponse, UnifiedError}, }; use crate::logger; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; +use crate::redis::feature::{ + check_redis_comp_merchant_flag, is_feature_enabled, RedisCompressionConfig, + RedisCompressionConfigCombined, RedisCompressionCutover, +}; use axum::body::to_bytes; use axum::http::StatusCode; use axum::response::IntoResponse; use cpu_time::ProcessTime; use serde::{Deserialize, Serialize}; +use std::collections::HashMap; impl IntoResponse for DecidedGatewayResponse { fn into_response(self) -> axum::http::Response { @@ -131,6 +137,24 @@ where match api_decider_request { Ok(payload) => { let merchant_id = payload.orderReference.merchantId.clone(); + let merchant_id_string = + crate::types::merchant::id::merchant_id_to_text(merchant_id.clone()); + + let redis_comp_config: Option> = + check_redis_comp_merchant_flag(merchant_id_string.clone()).await; + + let redis_comp_enabled_de = is_feature_enabled( + "REDIS_COMPRESSION_ENABLED_MERCHANT_DE".to_string(), + merchant_id_string.clone(), + "kv_redis".to_string(), + ) + .await; + + let redis_comp_config_final = Some(RedisCompressionConfigCombined { + redisCompressionConfig: redis_comp_config, + isRedisCompEnabled: redis_comp_enabled_de, + }); + let merchant_id_txt = crate::types::merchant::id::merchant_id_to_text(merchant_id); tracing::Span::current().record("merchant_id", merchant_id_txt.clone()); tracing::Span::current().record("udf_txn_uuid", payload.txnDetail.txnUuid.clone()); @@ -144,7 +168,8 @@ where jemalloc_ctl::epoch::advance().unwrap(); let allocated_before = jemalloc_ctl::stats::allocated::read().unwrap_or(0); - let result = decider_full_payload_hs_function(payload.clone()).await; + let result = + decider_full_payload_hs_function(payload.clone(), redis_comp_config_final).await; jemalloc_ctl::epoch::advance().unwrap(); let allocated_after = jemalloc_ctl::stats::allocated::read().unwrap_or(0); diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index fb7655eb..2013d37d 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -4,6 +4,10 @@ use crate::feedback::gateway_scoring_service::{ }; use crate::logger; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; +use crate::redis::feature::{ + check_redis_comp_merchant_flag, is_feature_enabled, RedisCompressionConfig, + RedisCompressionConfigCombined, +}; use crate::types::card::txn_card_info::{convert_safe_to_txn_card_info, SafeTxnCardInfo}; use crate::types::txn_details::types::{ convert_safe_txn_detail_to_txn_detail, SafeTxnDetail, TransactionLatency, @@ -11,6 +15,7 @@ use crate::types::txn_details::types::{ use axum::body::to_bytes; use cpu_time::ProcessTime; use serde::{Deserialize, Serialize}; +use std::collections::HashMap; #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] struct UpdateScoreRequest { @@ -182,6 +187,21 @@ pub async fn update_score( jemalloc_ctl::epoch::advance().unwrap(); let allocated_before = jemalloc_ctl::stats::allocated::read().unwrap_or(0); + let redis_comp_config: Option> = + check_redis_comp_merchant_flag(merchant_id_txt.clone()).await; + + let redis_comp_enabled_de = is_feature_enabled( + "REDIS_COMPRESSION_ENABLED_MERCHANT_DE".to_string(), + merchant_id_txt.clone(), + "kv_redis".to_string(), + ) + .await; + + let redis_comp_config_final = Some(RedisCompressionConfigCombined { + redisCompressionConfig: redis_comp_config, + isRedisCompEnabled: redis_comp_enabled_de, + }); + check_and_update_gateway_score( txn_detail, txn_card_info, @@ -189,6 +209,7 @@ pub async fn update_score( enforce_failure, gateway_reference_id, txn_latency, + redis_comp_config_final, ) .await; From e6592eb728216bb64f4ad5fc164096f04d51478c Mon Sep 17 00:00:00 2001 From: PriyanshuC132 Date: Thu, 18 Dec 2025 18:06:42 +0530 Subject: [PATCH 58/95] Changes for EliminationV2 consumption (#156) --- src/decider/gatewaydecider/constants.rs | 2 +- src/decider/gatewaydecider/gw_scoring.rs | 538 +++++++++++++----- src/decider/gatewaydecider/types.rs | 20 + src/decider/gatewaydecider/utils.rs | 139 +++-- .../gateway_elimination_scoring/flow.rs | 66 ++- src/feedback/gateway_scoring_service.rs | 255 ++++++++- src/feedback/types.rs | 3 + src/redis/commands.rs | 30 +- 8 files changed, 835 insertions(+), 218 deletions(-) diff --git a/src/decider/gatewaydecider/constants.rs b/src/decider/gatewaydecider/constants.rs index ad577aa2..1b9cf01c 100644 --- a/src/decider/gatewaydecider/constants.rs +++ b/src/decider/gatewaydecider/constants.rs @@ -138,7 +138,7 @@ pub fn internalDefaultEliminationV2SuccessRate1AndNPrefix( pub const DEFAULT_FIELD_NAME_FOR_SR1_AND_N: &str = "default"; pub const SR1_KEY_PREFIX: &str = "sr1_"; pub const N_KEY_PREFIX: &str = "n_"; - +pub const aggregateKeyPrefix: &str = "aggregate_data_"; pub const GW_DEFAULT_TXN_SOFT_RESET_COUNT: i64 = 10; pub const DEFAULT_GLOBAL_SELECTION_VOLUME_THRESHOLD: i64 = 20; diff --git a/src/decider/gatewaydecider/gw_scoring.rs b/src/decider/gatewaydecider/gw_scoring.rs index 1ef14fcb..393f71c9 100644 --- a/src/decider/gatewaydecider/gw_scoring.rs +++ b/src/decider/gatewaydecider/gw_scoring.rs @@ -3,9 +3,10 @@ use crate::app::get_tenant_app_state; use crate::decider::gatewaydecider::gw_filter::{getGws, setGws}; use crate::decider::gatewaydecider::types::{ - toListOfGatewayScore, DeciderFlow, DeciderScoringName, GatewayDeciderApproach, GatewayScoreMap, - SRMetricLogData, SrRoutingDimensions, + toListOfGatewayScore, ConfigSource, DeciderFlow, DeciderScoringName, FilterLevel, + GatewayDeciderApproach, GatewayScoreMap, SRMetricLogData, SrMetrics, SrRoutingDimensions, }; +use crate::feedback::gateway_scoring_service::MetricEntry; use crate::logger; use crate::merchant_config_util::{ isMerchantEnabledForPaymentFlows, isPaymentFlowEnabledWithHierarchyCheck, @@ -62,8 +63,8 @@ use crate::types::gateway_outage::{self as ETGO, GatewayOutage}; // use system_random::stateful::{init_std_gen, new_io_gen_m, IOGenM}; // use system_random::internal::StdGen; use super::types::{ - transform_gateway_wise_success_rate_based_routing, ConfigSource, DebugScoringEntry, - DeciderGatewayWiseSuccessRateBasedRoutingInput, Dimension, DownTime, FilterLevel, + transform_gateway_wise_success_rate_based_routing, DebugScoringEntry, + DeciderGatewayWiseSuccessRateBasedRoutingInput, Dimension, DownTime, GatewayRedisKeyMap, GatewayScoringData, GlobalSREvaluationScoreLog, LogCurrScore, RankingAlgorithm, RedisKey, ResetApproach, ResetGatewayInput, ScoreKeyType, SrV3InputConfig, SuccessRate1AndNConfig, @@ -1843,6 +1844,7 @@ pub fn global_elim_lvl_not_none(v: &GatewaySuccessRateBasedRoutingInput) -> bool } pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( + gatewayScoringData: GatewayScoringData, merchant_acc: ETM::merchant_account::MerchantAccount, txn_detail: ETTD::TxnDetail, txn_card_info: ETCT::txn_card_info::TxnCardInfo, @@ -1900,9 +1902,14 @@ pub async fn get_gateway_wise_routing_inputs_for_merchant_sr( .unwrap_or(default_merchant_elimination_threshold.unwrap_or(default_elimination_threshold)); let elimination_threshold_updated = if is_elimination_v2_enabled { - get_elimination_v2_threshold(&merchant_acc, &txn_card_info, &txn_detail) - .await - .unwrap_or(elimination_threshold) + get_elimination_v2_threshold( + &merchant_acc, + &txn_card_info, + &txn_detail, + gatewayScoringData, + ) + .await + .unwrap_or(elimination_threshold) } else { elimination_threshold }; @@ -1943,6 +1950,7 @@ async fn get_elimination_v2_threshold( merchant_acc: &ETM::merchant_account::MerchantAccount, txn_card_info: &ETCT::txn_card_info::TxnCardInfo, txn_detail: &ETTD::TxnDetail, + gateway_Scoring_Data: GatewayScoringData, ) -> Option { let m_gateway_success_rate_merchant_input = Utils::decode_and_log_error( "Gateway Decider Input Decode Error", @@ -1967,28 +1975,32 @@ async fn get_elimination_v2_threshold( // }; // let sr2_th_weight = Env::lookup_env(sr2_th_weight_env).await; - if let Some((sr1, sr2, n, m_pmt, m_pm, m_txn_object_type, source)) = get_sr1_and_sr2_and_n( - m_gateway_success_rate_merchant_input, - merchant_acc.merchantId.0.clone(), - txn_card_info.clone(), - txn_detail.clone(), - ) - .await + if let Some((sr1, sr2, n, n_m_, m_pmt, m_pm, m_txn_object_type, source)) = + get_sr1_and_sr2_and_n( + m_gateway_success_rate_merchant_input, + merchant_acc.merchantId.0.clone(), + txn_card_info.clone(), + txn_detail.clone(), + gateway_Scoring_Data.isGriEnabledForElimination, + gateway_Scoring_Data.gatewayReferenceId.clone(), + ) + .await { - logger::debug!( + logger::info!( tag="scoringFlow", action = "scoringFlow", - "Calculating Threshold: SR1: {:?} SR2: {:?} N: {:?} PMT: {:?} PM: {:?} TxnObjectType: {:?} SourceObject: {:?}", + "Calculating Threshold: SR1: {:?} SR2: {:?} N: {:?} N_M_: {:?} PMT: {:?} PM: {:?} TxnObjectType: {:?} SourceObject: {:?}", sr1, sr2, n, + n_m_.unwrap_or(0.0), m_pmt.unwrap_or_else(|| "Nothing".to_string()), m_pm.unwrap_or_else(|| "Nothing".to_string()), m_txn_object_type.unwrap_or_else(|| "Nothing".to_string()), txn_detail.sourceObject.as_ref().unwrap_or(&"Nothing".to_string()) ); - logger::debug!( + logger::info!( tag = "scoringFlow", action = "scoringFlow", "Threshold value: {:?}", @@ -1999,7 +2011,7 @@ async fn get_elimination_v2_threshold( Some(((sr1_th_weight * sr1) + (sr2_th_weight * sr2)) / 100.0) } else { - logger::debug!( + logger::info!( tag="scoringFlow", action = "scoringFlow", "Elimination V2 values not found: Threshold: PMT: {:?} PM: {:?} TxnObjectType: {:?} SourceObject: {:?}", @@ -2019,87 +2031,182 @@ pub async fn get_sr1_and_sr2_and_n( merchant_id: String, txn_card_info: ETCT::txn_card_info::TxnCardInfo, txn_detail: ETTD::TxnDetail, + is_gri_enabled_for_elimination: bool, + gateway_reference_id: Option, ) -> Option<( f64, f64, f64, + Option, Option, Option, Option, ConfigSource, )> { - if let Some(gateway_success_rate_merchant_input) = m_gateway_success_rate_merchant_input { - if let Some(inputs) = gateway_success_rate_merchant_input.eliminationV2SuccessRateInputs { - let pmt = &txn_card_info.paymentMethodType; - let source_obj = if txn_card_info.paymentMethod == UPI { - txn_detail.sourceObject.clone() - } else { - Some(txn_card_info.paymentMethod.clone()) - }; - let pm = if txn_card_info.paymentMethodType == UPI { - source_obj.clone() - } else { - Some(txn_card_info.paymentMethod.clone()) - }; - let txn_obj_type = txn_detail - .txnObjectType - .map(|t| t.to_string()) - .unwrap_or_default(); + let pmt = &txn_card_info.paymentMethodType; + let pm = if txn_card_info.paymentMethodType == UPI { + txn_detail.sourceObject.clone() + } else { + Some(txn_card_info.paymentMethod.clone()) + }; + let txn_obj_type = match txn_detail.txnObjectType { + Some(obj_type) => obj_type.to_text().to_string(), + None => return None, + }; + let card_type = txn_card_info.card_type.clone(); + + match m_gateway_success_rate_merchant_input { + None => { + filter_using_redis( + merchant_id, + pmt.to_string(), + pm, + txn_obj_type, + None, + is_gri_enabled_for_elimination, + gateway_reference_id, + ) + .await + } + Some(ref gateway_success_rate_merchant_input) => { + let inputs = gateway_success_rate_merchant_input + .eliminationV2SuccessRateInputs + .as_ref(); + + // Try Redis first + let redis_result = filter_using_redis( + merchant_id.clone(), + pmt.to_string(), + pm.clone(), + txn_obj_type.clone(), + inputs.cloned(), + is_gri_enabled_for_elimination, + gateway_reference_id.clone(), + ) + .await; - filter_using_service_config(merchant_id, pmt.to_string(), pm, txn_obj_type, inputs) - .await - } else { - None - // fetch_default_sr1_and_sr2_and_n(&gateway_success_rate_merchant_input).await + if redis_result.is_some() { + return redis_result; + } + + // Try Service Config + let service_config_result = filter_using_service_config( + merchant_id.clone(), + pmt.to_string(), + pm.clone(), + txn_obj_type.clone(), + inputs.cloned(), + is_gri_enabled_for_elimination, + gateway_reference_id.clone(), + ) + .await; + + if service_config_result.is_some() { + return service_config_result; + } + + // Try default SR1 and SR2 and N + fetch_default_sr1_and_sr2_and_n(gateway_success_rate_merchant_input, &merchant_id).await } + } +} + +async fn fetch_default_sr1_and_sr2_and_n( + gateway_success_rate_merchant_input: &GatewaySuccessRateBasedRoutingInput, + merchant_id: &str, +) -> Option<( + f64, + f64, + f64, + Option, + Option, + Option, + Option, + ConfigSource, +)> { + if let Some(sr2) = gateway_success_rate_merchant_input.defaultEliminationV2SuccessRate { + fetch_default_sr1_and_n_and_mk_result(sr2, merchant_id).await } else { None } } -// async fn fetch_default_sr1_and_sr2_and_n( -// gateway_success_rate_merchant_input: &GatewayWiseSuccessRateBasedRoutingInput, -// ) -> Option<(f64, f64, f64, Option, Option, Option, ConfigSource)> { -// if let Some(sr2) = gateway_success_rate_merchant_input.default_elimination_v2_success_rate { -// fetch_default_sr1_and_n_and_mk_result(sr2).await -// } else { -// None -// } -// } +async fn fetch_default_sr1_and_n_and_mk_result( + sr2: f64, + merchant_id: &str, +) -> Option<( + f64, + f64, + f64, + Option, + Option, + Option, + Option, + ConfigSource, +)> { + let app_state = get_tenant_app_state().await; + let redis_conn = &app_state.redis_conn; -// async fn fetch_default_sr1_and_n_and_mk_result(sr2: f64) -> Option<(f64, f64, f64, Option, Option, Option, ConfigSource)> { -// let m_default_sr1 = RC::r_hget(Config::EC_REDIS, construct_sr1_key(merchant_id), C::DEFAULT_FIELD_NAME_FOR_SR1_AND_N).await; -// let m_default_n = RC::r_hget(Config::EC_REDIS, construct_n_key(merchant_id), C::DEFAULT_FIELD_NAME_FOR_SR1_AND_N).await; - -// if let (Some(sr1), Some(n)) = (m_default_sr1, m_default_n) { -// Some((sr1, sr2, n, None, None, None, ConfigSource::MerchantDefault)) -// } else { -// let m_s_config_sr1 = RService::find_by_name_from_redis(C::DEFAULT_SR1_S_CONFIG_PREFIX(merchant_id)).await; -// let m_s_config_n = RService::find_by_name_from_redis(C::DEFAULT_N_S_CONFIG_PREFIX(merchant_id)).await; - -// if let (Some(sr1), Some(n)) = (m_s_config_sr1, m_s_config_n) { -// Some((sr1, sr2, n, None, None, None, ConfigSource::GlobalDefault)) -// } else { -// None -// } -// } -// } + let sr1_key = format!("{}{}", C::SR1_KEY_PREFIX, merchant_id); + let n_key = format!("{}{}", C::N_KEY_PREFIX, merchant_id); + + let m_default_sr1 = redis_conn.get_key::(&sr1_key, "f64").await.ok(); + let m_default_n = redis_conn.get_key::(&n_key, "f64").await.ok(); + + if let (Some(sr1), Some(n)) = (m_default_sr1, m_default_n) { + Some(( + sr1, + sr2, + n, + None, + None, + None, + None, + ConfigSource::MerchantDefault, + )) + } else { + let sr1_config_key = C::defaultSr1SConfigPrefix(merchant_id.to_string()).get_key(); + let n_config_key = C::defaultNSConfigPrefix(merchant_id.to_string()).get_key(); + + let m_s_config_sr1 = RService::findByNameFromRedis::(sr1_config_key).await; + let m_s_config_n = RService::findByNameFromRedis::(n_config_key).await; + + if let (Some(sr1), Some(n)) = (m_s_config_sr1, m_s_config_n) { + Some(( + sr1, + sr2, + n, + None, + None, + None, + None, + ConfigSource::GlobalDefault, + )) + } else { + None + } + } +} async fn filter_using_service_config( merchant_id: String, pmt: String, pm: Option, txn_obj_type: String, - inputs: Vec, + inputs: Option>, + is_gri_enabled_for_elimination: bool, + gateway_reference_id: Option, ) -> Option<( f64, f64, f64, + Option, Option, Option, Option, ConfigSource, )> { + let inputs_vec = inputs.unwrap_or_default(); let m_configs = RService::findByNameFromRedis( C::internalDefaultEliminationV2SuccessRate1AndNPrefix(merchant_id.clone()).get_key(), ) @@ -2112,7 +2219,7 @@ async fn filter_using_service_config( pmt.clone(), pm.clone(), txn_obj_type.clone(), - inputs.clone(), + inputs_vec.clone(), configs.clone(), ) .or_else(|| { @@ -2122,7 +2229,7 @@ async fn filter_using_service_config( pmt.clone(), pm.clone(), txn_obj_type.clone(), - inputs.clone(), + inputs_vec.clone(), configs.clone(), ) }) @@ -2133,7 +2240,7 @@ async fn filter_using_service_config( pmt, pm, txn_obj_type, - inputs, + inputs_vec, configs, ) }) @@ -2155,78 +2262,6 @@ pub fn filter_inputs_upto( } } -// pub async fn filter_using_redis_upto( -// level: FilterLevel, -// merchant_id: T, -// pmt: T, -// pm: Option, -// txn_obj_type: T, -// inputs: Vec, -// ) -> Option<(f64, f64, f64, Option, Option, Option, ConfigSource)> { -// let m_input = filter_inputs_upto(level, pmt.clone(), pm.clone(), txn_obj_type.clone(), inputs); -// let m_sr1_and_n = get_sr1_and_n_from_redis_upto(level, merchant_id.clone(), pmt.clone(), pm.clone(), txn_obj_type.clone()).await; -// match (m_input, m_sr1_and_n) { -// (Some(input), Some((sr1, n))) => Some(( -// sr1, -// input.success_rate, -// n, -// Some(input.payment_method_type), -// input.payment_method.clone(), -// input.txn_object_type.clone(), -// ConfigSource::Redis, -// )), -// _ => None, -// } -// } - -// pub async fn get_sr1_and_n_from_redis_upto( -// level: FilterLevel, -// merchant_id: T, -// pmt: T, -// m_pm: Option, -// txn_obj_type: T, -// ) -> Option<(f64, f64)> { -// let sr1_key = construct_sr1_key(&merchant_id); -// let n_key = construct_n_key(&merchant_id); -// let dim_key = construct_dimension_key(level, &pmt, m_pm.as_ref(), &txn_obj_type); - -// let redis_sr1 = fetch_from_redis(&sr1_key, &dim_key).await; -// let redis_n = fetch_from_redis(&n_key, &dim_key).await; - -// match (redis_sr1, redis_n) { -// (Some(sr1), Some(n)) => Some((sr1, n)), -// _ => None, -// } -// } - -// fn construct_sr1_key(merchant_id: &T) -> T { -// format!("{}{}", C::SR1_KEY_PREFIX, merchant_id) -// } - -// fn construct_n_key(merchant_id: &T) -> T { -// format!("{}{}", C::N_KEY_PREFIX, merchant_id) -// } - -// fn construct_dimension_key( -// level: FilterLevel, -// pmt: &T, -// pm: Option<&T>, -// txn_obj_type: &T, -// ) -> Option { -// match level { -// FilterLevel::TxnObjectType => pm.map(|pm| format!("{}|{}|{}", pmt, pm, txn_obj_type)), -// FilterLevel::PaymentMethod => pm.map(|pm| format!("{}|{}", pmt, pm)), -// FilterLevel::PaymentMethodType => Some(pmt.clone()), -// } -// } - -// async fn fetch_from_redis(key: &T, dim_key: &Option) -> Option { -// match dim_key { -// None => None, -// Some(dkey) => RC::r_hget(Config::EC_REDIS, key, dkey).await, -// } -// } - pub fn fetch_sr1_and_n_from_service_config_upto( level: FilterLevel, merchant_id: String, @@ -2235,7 +2270,16 @@ pub fn fetch_sr1_and_n_from_service_config_upto( txn_object_type: String, inputs: Vec, configs: Vec, -) -> Option<(f64, f64, f64, Option, Option, Option, ConfigSource)> { +) -> Option<( + f64, + f64, + f64, + Option, + Option, + Option, + Option, + ConfigSource, +)> { let m_input = filter_inputs_upto( level.clone(), pmt.clone(), @@ -2258,6 +2302,7 @@ pub fn fetch_sr1_and_n_from_service_config_upto( config.successRate, input.successRate, config.nValue, + None, // Added missing Option element Some(input.paymentMethodType), input.paymentMethod.clone(), input.txnObjectType.clone(), @@ -2500,6 +2545,7 @@ pub async fn update_gateway_score_based_on_success_rate( for (gw, _) in gateway_score_global_sr.clone() { gateway_success_rate_inputs.push( get_gateway_wise_routing_inputs_for_merchant_sr( + gateway_scoring_data.clone(), merchant_acc.clone(), txn_detail.clone(), txn_card_info.clone(), @@ -2700,6 +2746,7 @@ pub async fn update_gateway_score_based_on_success_rate( reset_gw_list, is_reset_score_enabled_for_merchant, gateway_redis_key_map.clone(), + gateway_scoring_data.clone(), ) .await; } @@ -2953,6 +3000,7 @@ pub async fn trigger_reset_gateway_score( reset_gateway_list: Vec, is_reset_score_enabled_for_merchant: bool, gateway_redis_key_map: GatewayRedisKeyMap, + gateway_scoring_data: GatewayScoringData, ) { logger::debug!( tag = "scoringFlow", @@ -3002,6 +3050,9 @@ pub async fn trigger_reset_gateway_score( key: gateway_redis_key_map.get(it).cloned(), hardTtl: hard_ttl, softTtl: soft_ttl, + gatewayReferenceIdEnabled: Some( + gateway_scoring_data.isGriEnabledForElimination, + ), }; // Now these await calls are in an async context @@ -3009,6 +3060,7 @@ pub async fn trigger_reset_gateway_score( decider_flow, txn_detail.clone(), reset_gateway_input.clone(), + gateway_scoring_data.clone(), decider_flow.get().dpRedisCompressionConfig.clone(), ) .await; @@ -3072,6 +3124,7 @@ pub async fn reset_gateway_score( decider_flow: &mut DeciderFlow<'_>, txn_detail: ETTD::TxnDetail, reset_gateway_input: ResetGatewayInput, + gateway_scoring_data: GatewayScoringData, redis_compression_config: Option, ) { let current_timestamp = get_current_date_in_millis(); @@ -3081,7 +3134,8 @@ pub async fn reset_gateway_score( reset_gateway_input.clone().eliminationMaxCount, ) { (Some(key), Some(threshold), Some(max_count)) => { - let penality_factor = Utils::get_penality_factor_(decider_flow).await; + let penality_factor = + Utils::get_penality_factor_(decider_flow, &gateway_scoring_data).await; let score = get_merchant_elimination_gateway_score(key.clone()).await; logger::debug!( tag = "scoringFlow", @@ -3256,3 +3310,199 @@ pub fn route_random_traffic( .collect() } } + +pub async fn filter_using_redis( + merchant_id: String, + pmt: String, + pm: Option, + txn_obj_type: String, + inputs: Option>, + is_gri_enabled_for_elimination: bool, + gateway_reference_id: Option, +) -> Option<( + f64, + f64, + f64, + Option, + Option, + Option, + Option, + ConfigSource, +)> { + let inputs_vec = inputs.unwrap_or_default(); + filter_using_redis_upto( + None, + FilterLevel::TxnObjectType, + merchant_id.clone(), + pmt.clone(), + pm.clone(), + txn_obj_type.clone(), + is_gri_enabled_for_elimination, + gateway_reference_id.clone(), + inputs_vec.clone(), + None, + ) + .await + .or(filter_using_redis_upto( + None, + FilterLevel::PaymentMethod, + merchant_id.clone(), + pmt.clone(), + pm.clone(), + txn_obj_type.clone(), + is_gri_enabled_for_elimination, + gateway_reference_id.clone(), + inputs_vec.clone(), + None, + ) + .await) + .or(filter_using_redis_upto( + None, + FilterLevel::PaymentMethodType, + merchant_id, + pmt, + pm, + txn_obj_type, + is_gri_enabled_for_elimination, + gateway_reference_id, + inputs_vec, + None, + ) + .await) +} + +async fn filter_using_redis_upto( + m_metric_entry: Option, + level: FilterLevel, + merchant_id: String, + pmt: String, + pm: Option, + txn_obj_type: String, + is_gri_enabled_for_elimination: bool, + gateway_reference_id: Option, + inputs: Vec, + card_type: Option, +) -> Option<( + f64, + f64, + f64, + Option, + Option, + Option, + Option, + ConfigSource, +)> { + let m_input = filter_inputs_upto( + level.clone(), + pmt.clone(), + pm.clone(), + txn_obj_type.clone(), + inputs, + ); + + let m_metric_entry_final = match m_metric_entry { + Some(entry) => Some(entry), + None => { + get_metric_entry_data( + merchant_id.clone(), + pmt.clone(), + pm.clone(), + txn_obj_type.clone(), + card_type, + is_gri_enabled_for_elimination, + gateway_reference_id.clone(), + ) + .await + } + }; + + match (m_input, m_metric_entry_final) { + (Some(input), Some(metric_entry)) => Some(( + metric_entry.success_rate.into(), + input.successRate, + metric_entry.sigma_factor.into(), + Some(metric_entry.n_value.into()), + Some(input.paymentMethodType), + input.paymentMethod, + input.txnObjectType, + ConfigSource::REDIS, + )), + (None, Some(metric_entry)) => Some(( + metric_entry.success_rate.into(), + metric_entry.default_success_threshold.into(), + metric_entry.sigma_factor.into(), + Some(metric_entry.n_value.into()), + Some(pmt), + pm, + Some(txn_obj_type), + ConfigSource::REDIS, + )), + _ => None, + } +} + +pub async fn get_metric_entry_data( + merchant_id: String, + pmt: String, + m_pm: Option, + txn_obj_type: String, + card_type: Option, + isGriEnabledForElimination: bool, + gatewayReferenceId: Option, +) -> Option { + let aggregate_key = construct_aggregate_key(&merchant_id); + let dim_key = construct_dimension_key(&pmt, &m_pm, &txn_obj_type, &card_type); + + if isGriEnabledForElimination && gatewayReferenceId.is_some() { + let gri_dim_key = format!( + "{}_{}", + dim_key.clone().unwrap_or_default(), + gatewayReferenceId.unwrap_or_default() + ); + fetch_from_redis(&aggregate_key, &Some(gri_dim_key)).await + } else { + fetch_from_redis(&aggregate_key, &dim_key).await + } +} + +fn construct_dimension_key( + pmt: &str, + m_pm: &Option, + txn_obj_type: &str, + card_type: &Option, +) -> Option { + if pmt == CARD { + Some(format!( + "{}_{}_{}_{}", + txn_obj_type, + pmt, + m_pm.as_ref().unwrap_or(&String::new()), + card_type.as_ref().unwrap_or(&String::new()) + )) + } else { + Some(format!( + "{}_{}_{}", + txn_obj_type, + pmt, + m_pm.as_ref().unwrap_or(&String::new()) + )) + } +} + +async fn fetch_from_redis(key: &str, dim_key: &Option) -> Option { + match dim_key { + None => None, + Some(dkey) => { + let app_state = get_tenant_app_state().await; + app_state + .redis_conn + .hget::(key, dkey, "metric_entry") + .await + .ok() + .flatten() + } + } +} +fn construct_aggregate_key(merchant_id: &str) -> String { + format!("{}{}", C::aggregateKeyPrefix, merchant_id) +} diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 3823b865..9c215a6f 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -546,6 +546,7 @@ pub fn initial_decider_state(date_created: String) -> DeciderState { is_legacy_decider_flow: true, udfs: None, udfs_consumed_for_routing: None, + gatewayReferenceId: None, }, } } @@ -574,6 +575,7 @@ pub struct GatewayScoringData { pub currency: Option, pub country: Option, pub is_legacy_decider_flow: bool, + pub gatewayReferenceId: Option, pub udfs: Option, pub udfs_consumed_for_routing: Option, } @@ -1718,6 +1720,7 @@ pub struct ResetGatewayInput { pub key: Option, pub hardTtl: u128, pub softTtl: f64, + pub gatewayReferenceIdEnabled: Option, } #[derive(Debug, Serialize, Deserialize)] @@ -1863,6 +1866,7 @@ pub struct SuccessRate1AndNConfig { pub paymentMethodType: String, pub paymentMethod: Option, pub txnObjectType: Option, + pub gatewayReferenceId: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -1937,3 +1941,19 @@ pub struct SrRoutingDimensions { pub country: Option, pub auth_type: Option, } + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct MetricEntry { + pub n_value: f64, + pub success_rate: f64, + pub sigma_factor: f64, + pub average_latency: f64, + pub tp99_latency: f64, + pub default_success_threshold: f64, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SrMetrics { + pub dimension: String, + pub value: MetricEntry, +} diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index f2958732..802a919c 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -9,6 +9,7 @@ use crate::redis::feature::{ is_feature_enabled, RedisCompressionConfig, RedisCompressionConfigCombined, RedisDataStruct, }; use crate::redis::types::ServiceConfigKey; +use crate::storage::schema::gateway_bank_emi_support::gateway; use crate::types::card::card_type::card_type_to_text; use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; @@ -252,12 +253,12 @@ pub fn get_merchant_wise_si_bin_key(gw: &String) -> String { fn get_merchant_gateway_card_info_feature_name( auth_type: Option<&ETCa::txn_card_info::AuthType>, validation_type: Option<&ValidationType>, - gateway: &String, + gw: &String, ) -> Option { let flow = validation_type .map(|v| format!("{}", v)) .or_else(|| auth_type.map(|a| format!("{}", a)))?; - Some(format!("MERCHANT_GATEWAY_CARD_INFO_{}_{}", flow, gateway)) + Some(format!("MERCHANT_GATEWAY_CARD_INFO_{}_{}", flow, gw)) } pub fn is_mandate_transaction(txn: &ETTD::TxnDetail) -> bool { @@ -280,19 +281,19 @@ pub async fn get_merchant_wise_mandate_bin_eligible_gateways( let merchant_wise_mandate_supported_gateway: Vec = merchant_wise_mandate_bin_enforced_gateways .into_iter() - .filter(|gateway| mandate_enabled_gateways.contains(gateway)) + .filter(|gw| mandate_enabled_gateways.contains(gw)) .collect(); let mut gws = Vec::new(); - for gateway in merchant_wise_mandate_supported_gateway { + for gw in merchant_wise_mandate_supported_gateway { if ETF::get_feature_enabled( - &get_merchant_wise_si_bin_key(&gateway), + &get_merchant_wise_si_bin_key(&gw), &merchant_account.merchantId, true, ) .await .is_some() { - gws.push(gateway); + gws.push(gw); } } gws @@ -302,7 +303,7 @@ pub async fn is_merchant_wise_auth_type_check_needed( merchant_account: &ETM::merchant_account::MerchantAccount, auth_type: Option<&ETCa::txn_card_info::AuthType>, validation_type: Option<&ValidationType>, - gateway: &String, + gw: &String, ) -> bool { let merchant_wise_auth_type_bin_enforced_gateways: Vec = RService::findByNameFromRedis::>( @@ -310,9 +311,9 @@ pub async fn is_merchant_wise_auth_type_check_needed( ) .await .unwrap_or_default(); - if merchant_wise_auth_type_bin_enforced_gateways.contains(gateway) { + if merchant_wise_auth_type_bin_enforced_gateways.contains(gw) { if let Some(feature_key) = - get_merchant_gateway_card_info_feature_name(auth_type, validation_type, gateway) + get_merchant_gateway_card_info_feature_name(auth_type, validation_type, gw) { return ETF::get_feature_enabled(&feature_key, &merchant_account.merchantId, true) .await @@ -1362,6 +1363,48 @@ pub fn get_ref_id_value( } } +pub async fn get_common_gateway_ref_id( + decider_flow: &mut DeciderFlow<'_>, +) -> (bool, Option) { + let order_ref = decider_flow.get().dpOrder.clone(); + let merchant = decider_flow.get().dpMerchantAccount.clone(); + + let (meta, pl_ref_id_map) = get_order_metadata_and_pl_ref_id_map( + decider_flow, + merchant.enableGatewayReferenceIdBasedRouting, + &order_ref, + ); + + let gateway_list = decider_flow.writer.functionalGateways.clone(); + + let ref_ids: Vec = gateway_list + .iter() + .map(|gw| { + let gw_ref_id = get_gateway_reference_id( + meta.clone(), + gw, + order_ref.clone(), + pl_ref_id_map.clone(), + ); + match gw_ref_id { + None => "NULL".to_string(), + Some(ref_id) => ref_id.mga_reference_id, + } + }) + .collect(); + + if ref_ids.is_empty() { + return (false, None); + } + + let first_ref_id = &ref_ids[0]; + if ref_ids.iter().all(|ref_id| ref_id == first_ref_id) { + (true, Some(first_ref_id.clone())) + } else { + (false, None) + } +} + pub fn decider_filter_order(filter_name: &str) -> i32 { match filter_name { "getFunctionalGateways" => 1, @@ -1933,6 +1976,8 @@ pub fn get_default_gateway_scoring_data( currency: Option, country: Option, auth_type: Option, + useServiceConfigForGri: bool, + gatewayRefId: Option, udfs: Option, is_legacy_decider_flow: bool, ) -> GatewayScoringData { @@ -1948,8 +1993,16 @@ pub fn get_default_gateway_scoring_data( isPaymentSourceEnabledForSrRouting: false, isAuthLevelEnabledForSrRouting: false, isBankLevelEnabledForSrRouting: false, - isGriEnabledForElimination: is_gri_enabled_for_elimination, - isGriEnabledForSrRouting: is_gri_enabled_for_sr_routing, + isGriEnabledForElimination: if useServiceConfigForGri { + is_gri_enabled_for_elimination + } else { + false + }, + isGriEnabledForSrRouting: if useServiceConfigForGri { + is_gri_enabled_for_sr_routing + } else { + false + }, routingApproach: None, dateCreated: date_created, eliminationEnabled: false, @@ -1960,6 +2013,7 @@ pub fn get_default_gateway_scoring_data( is_legacy_decider_flow, udfs, udfs_consumed_for_routing: None, + gatewayReferenceId: gatewayRefId, } } @@ -2005,6 +2059,12 @@ pub async fn get_gateway_scoring_data( "kv_redis".to_string(), ) .await; + let (useServiceConfigForGri, gatewayRefId) = + if is_gri_enabled_for_sr_routing || is_gri_enabled_for_elimination { + (get_common_gateway_ref_id(decider_flow).await) + } else { + (true, None) + }; let mut default_gateway_scoring_data = get_default_gateway_scoring_data( merchant_id.clone(), order_type, @@ -2023,6 +2083,8 @@ pub async fn get_gateway_scoring_data( .authType .as_ref() .map(|a| a.to_string()), + useServiceConfigForGri, + gatewayRefId, Some(decider_flow.get().dpOrder.udfs.clone()), is_legacy_decider_flow, ); @@ -2249,9 +2311,9 @@ pub async fn get_unified_key( if gri_sr_v2_cutover { gateway_ref_id_map.iter().fold( GatewayRedisKeyMap::new(), - |mut acc, (gateway, ref_id)| { + |mut acc, (gw, ref_id)| { acc.insert( - gateway.clone(), + gw.clone(), intercalate_without_empty_string( "_", &vec![key.clone(), ref_id.as_deref().unwrap_or("").to_string()], @@ -2274,33 +2336,32 @@ pub async fn get_unified_key( if gri_sr_v2_cutover { gateway_ref_id_map.iter().fold( GatewayRedisKeyMap::new(), - |mut acc, (gateway, ref_id)| { + |mut acc, (gw, ref_id)| { let key = intercalate_without_empty_string( "_", &vec![ base_key.clone(), ref_id.as_deref().unwrap_or("").to_string(), - gateway.to_string(), + gw.to_string(), ], ); - acc.insert(gateway.clone(), key); + acc.insert(gw.clone(), key); acc }, ) } else { - gateway_ref_id_map.iter().fold( - GatewayRedisKeyMap::new(), - |mut acc, (gateway, _)| { + gateway_ref_id_map + .iter() + .fold(GatewayRedisKeyMap::new(), |mut acc, (gw, _)| { acc.insert( - gateway.clone(), + gw.clone(), intercalate_without_empty_string( "_", - &vec![base_key.clone(), gateway.to_string()], + &vec![base_key.clone(), gw.to_string()], ), ); acc - }, - ) + }) } } ScoreKeyType::OutageGlobalKey => { @@ -2692,11 +2753,11 @@ pub async fn get_consumer_key( merchant.enableGatewayReferenceIdBasedRouting, &order_ref, ); - let gw_ref_ids = gateway_list.iter().fold(HashMap::new(), |acc, gateway| { + let gw_ref_ids = gateway_list.iter().fold(HashMap::new(), |acc, gw| { let mut map = acc; let gwref_id = get_gateway_reference_id( meta.clone(), - gateway, + gw, order_ref.clone(), pl_ref_id_map.clone(), ); @@ -2704,19 +2765,17 @@ pub async fn get_consumer_key( None => "NULL".to_string(), Some(ref_id) => ref_id.mga_reference_id, }; - map.insert(gateway.clone(), Some(val)); + map.insert(gw.clone(), Some(val)); map }); set_gw_ref_id(decider_flow, gw_ref_ids.values().next().cloned().flatten()); logger::debug!("gwRefId {:?}", gw_ref_ids); gw_ref_ids } else { - gateway_list - .iter() - .fold(HashMap::new(), |mut acc, gateway| { - acc.insert(gateway.clone(), None); - acc - }) + gateway_list.iter().fold(HashMap::new(), |mut acc, gw| { + acc.insert(gw.clone(), None); + acc + }) }; let gateway_redis_key_map = get_unified_key( gateway_scoring_data, @@ -3002,7 +3061,10 @@ pub async fn addToCacheWithExpiry( } } -pub async fn get_penality_factor_(decider_flow: &mut DeciderFlow<'_>) -> f64 { +pub async fn get_penality_factor_( + decider_flow: &mut DeciderFlow<'_>, + gateway_scoring_data: &GatewayScoringData, +) -> f64 { let merchant = decider_flow.get().dpMerchantAccount.clone(); let txn_detail = decider_flow.get().dpTxnDetail.clone(); let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); @@ -3014,8 +3076,15 @@ pub async fn get_penality_factor_(decider_flow: &mut DeciderFlow<'_>) -> f64 { ) .await; if is_elimination_v2_enabled { - let m_reward_factor = - eliminationV2RewardFactor(&merchant_id, &txn_card_info, &txn_detail).await; + let griEnabled = gateway_scoring_data.gatewayReferenceId.is_some(); + let m_reward_factor = eliminationV2RewardFactor( + &merchant_id, + &txn_card_info, + &txn_detail, + griEnabled, + gateway_scoring_data.gatewayReferenceId.clone(), + ) + .await; match m_reward_factor { Some(reward_factor) => return 1.0 - reward_factor, None => { diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index d8e3f3ea..26bdd1f6 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -81,6 +81,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( txn_detail: TxnDetail, txn_card_info: TxnCardInfo, gateway_scoring_type: GatewayScoreType, + gateway_scoring_data: GatewayScoringData, mer_acc_p_id: merchant::id::MerchantPId, mer_acc: MerchantAccount, gateway_scoring_key: (ScoreKeyType, Option), @@ -134,6 +135,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( gateway_scoring_type.clone(), txn_detail.clone(), txn_card_info.clone(), + gateway_scoring_data.clone(), ) .await; let updated_score = match gw_score_to_be_updated.score { @@ -146,6 +148,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( gateway_scoring_type.clone(), score, score_key_type, + gateway_scoring_data, ) .await, ), @@ -235,6 +238,7 @@ pub async fn updateKeyScoreForTxnStatus( gateway_scoring_type: GatewayScoreType, current_key_score: f64, score_key_type: ScoreKeyType, + gateway_scoring_data: GatewayScoringData, ) -> f64 { let is_elimination_v2_enabled = is_feature_enabled( EnableEliminationV2.get_key(), @@ -263,6 +267,7 @@ pub async fn updateKeyScoreForTxnStatus( &txn_detail, current_key_score, &score_key_type, + gateway_scoring_data.clone(), ) .await; } @@ -276,6 +281,7 @@ pub async fn updateKeyScoreForTxnStatus( &txn_detail, current_key_score, &score_key_type, + gateway_scoring_data.clone(), ) .await; } @@ -292,6 +298,7 @@ async fn updateScoreWithPenalty( txn_detail: &TxnDetail, current_key_score: f64, score_key_type: &ScoreKeyType, + gateway_scoring_data: GatewayScoringData, ) -> f64 { match ( is_elimination_v2_enabled, @@ -299,8 +306,14 @@ async fn updateScoreWithPenalty( is_elimination_v2_enabled_for_outage, ) { (true, true, true) | (true, _, _) => { - let m_reward_factor = - eliminationV2RewardFactor(merchant_id, txn_card_info, txn_detail).await; + let m_reward_factor = eliminationV2RewardFactor( + merchant_id, + txn_card_info, + txn_detail, + gateway_scoring_data.isGriEnabledForElimination, + gateway_scoring_data.gatewayReferenceId, + ) + .await; match m_reward_factor { None => { getFailureKeyScore( @@ -333,6 +346,7 @@ async fn updateScoreWithReward( txn_detail: &TxnDetail, current_key_score: f64, score_key_type: &ScoreKeyType, + gateway_scoring_data: GatewayScoringData, ) -> f64 { match ( is_elimination_v2_enabled, @@ -340,8 +354,14 @@ async fn updateScoreWithReward( is_elimination_v2_enabled_for_outage, ) { (true, true, true) | (true, _, _) => { - let m_reward_factor = - eliminationV2RewardFactor(merchant_id, txn_card_info, txn_detail).await; + let m_reward_factor = eliminationV2RewardFactor( + merchant_id, + txn_card_info, + txn_detail, + gateway_scoring_data.isGriEnabledForElimination, + gateway_scoring_data.gatewayReferenceId, + ) + .await; match m_reward_factor { None => getSuccessKeyScore( false, @@ -430,6 +450,7 @@ pub async fn getUpdatedMerchantDetailsForGlobalKey( gateway_scoring_type: GatewayScoreType, txn_detail: TxnDetail, txn_card_info: TxnCardInfo, + gateway_scoring_data: GatewayScoringData, ) -> Option> { let merchant_id = Merchant::merchant_id_to_text(txn_detail.merchantId.clone()); if isGlobalKey(score_key_type) { @@ -455,6 +476,7 @@ pub async fn getUpdatedMerchantDetailsForGlobalKey( &txn_card_info, gateway_scoring_type.clone(), score_key_type, + gateway_scoring_data.clone(), ) .await; results.push(result); @@ -479,6 +501,7 @@ pub async fn replaceTransactionCount( txn_card_info: &TxnCardInfo, gateway_scoring_type: GatewayScoreType, score_key_type: ScoreKeyType, + gateway_scoring_data: GatewayScoringData, ) -> MerchantScoringDetails { let merchant_id = Merchant::merchant_id_to_text(txn_detail.merchantId.clone()); if merchant_scoring_details.merchantId == merchant_id { @@ -489,6 +512,7 @@ pub async fn replaceTransactionCount( gateway_scoring_type.clone(), merchant_scoring_details.score, score_key_type, + gateway_scoring_data.clone(), ) .await; let new_count = if gateway_scoring_type == GatewayScoreType::Penalise { @@ -768,6 +792,8 @@ pub async fn eliminationV2RewardFactor( merchant_id: &str, txn_card_info: &TxnCardInfo, txn_detail: &TxnDetail, + is_gri_enabled_for_elimination: bool, + gateway_reference_id: Option, ) -> Option { let merch_acc: MerchantAccount = MA::load_merchant_by_merchant_id(MID::merchant_id_to_text(txn_detail.clone().merchantId)) @@ -790,31 +816,34 @@ pub async fn eliminationV2RewardFactor( merchant_id.to_string(), txn_card_info.clone(), txn_detail.clone(), + is_gri_enabled_for_elimination, + gateway_reference_id.clone(), ) .await; match sr1_and_sr2_and_n { - Some((sr1, sr2, n, m_pmt, m_pm, m_txn_object_type, source)) => { - logger::debug!( - "CALCULATING_ALPHA:SR1_SR2_N_PMT_PM_TXNOBJECTTYPE_CONFIGSOURCE {} {} {} {} {} {} {:?}", + Some((sr1, sr2, n, n_, m_pmt, m_pm, m_txn_object_type, source)) => { + logger::info!( + "CALCULATING_ALPHA:SR1_SR2_N_PMT_PM_TXNOBJECTTYPE_CONFIGSOURCE {} {} {} {:?} {} {} {} {:?}", sr1, sr2, n, + n_, m_pmt.unwrap_or_else(|| "Nothing".to_string()), m_pm.unwrap_or_else(|| "Nothing".to_string()), m_txn_object_type.unwrap_or_else(|| "Nothing".to_string()), source, ); - logger::debug!( + logger::info!( action = "calculateAlpha", tag = "ALPHA_VALUE", - alpha_value = calculate_alpha(sr1, sr2, n), + alpha_value = calculate_alpha(sr1, sr2, n, n_), ); - Some(calculate_alpha(sr1, sr2, n)) + Some(calculate_alpha(sr1, sr2, n, n_)) } None => { - logger::debug!("ELIMINATION_V2_VALUES_NOT_FOUND:ALPHA:PMT_PM_TXNOBJECTTYPE_SOURCEOBJECT {:?} {:?} {:?} {:?}", + logger::info!("ELIMINATION_V2_VALUES_NOT_FOUND:ALPHA:PMT_PM_TXNOBJECTTYPE_SOURCEOBJECT {:?} {:?} {:?} {:?}", txn_card_info.paymentMethodType, if txn_card_info.paymentMethod.is_empty() { "Nothing".to_string() } else { txn_card_info.paymentMethod.clone() }, txn_detail.txnObjectType, @@ -825,8 +854,19 @@ pub async fn eliminationV2RewardFactor( } } -fn calculate_alpha(sr1: f64, sr2: f64, n: f64) -> f64 { - ((sr1 - sr2) * (sr1 - sr2)) / ((n * n) * (sr1 * (100.0 - sr1))) +fn calculate_alpha(sr1: f64, sr2: f64, n: f64, n_prime: Option) -> f64 { + match n_prime { + None => ((sr1 - sr2) * (sr1 - sr2)) / ((n * n) * (sr1 * (100.0 - sr1))), + Some(n_val) => { + // These weights should be fetched from Env or config as per your environment + let sr1_th_weight = 0.29; + let sr2_th_weight = 0.71; + let threshold = ((sr1_th_weight * sr1) + (sr2_th_weight * sr2)) / 100.0; + let val1 = ((sr1 - sr2) * (sr1 - sr2)) / ((n * n) * (sr1 * (100.0 - sr1))); + let val2 = (threshold / (sr1 / 100.0)).powf(1.0 / n_val); + val1.min(val2) + } + } } // Original Haskell function: findMerchantFromMerchantArray diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index 0ffc8991..7d6a3260 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -11,7 +11,7 @@ use masking::PeekInterface; // use db::storage::types::merchant_account as merchant_account; // use types::gateway_routing_input as etgri; // use gateway_decider::utils::decode_and_log_error; -// use gateway_decider::gw_scoring::get_sr1_and_sr2_and_n; +use crate::decider::gatewaydecider::gw_scoring::get_metric_entry_data; // use feedback::utils as euler_transforms; // use feedback::types::*; // use feedback::types::txn_card_info; @@ -89,10 +89,10 @@ use crate::types::payment::payment_method_type_const::*; // Original Haskell data type: GatewayLatencyForScoring #[derive(Debug, Serialize, Deserialize, PartialEq)] pub struct GatewayLatencyForScoring { - #[serde(rename = "defaultLatencyThreshold")] + #[serde(rename = "default_latency_threshold")] pub default_latency_threshold: f64, - #[serde(rename = "merchantLatencyGatewayWiseInput")] + #[serde(rename = "merchant_latency_gateway_wise_input")] pub merchant_latency_gateway_wise_input: Option>, } @@ -135,10 +135,10 @@ pub struct UpdateGatewayScoreRequest { } // Original Haskell data type: MetricEntry -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub struct MetricEntry { - #[serde(rename = "total_volume")] - pub total_volume: f32, + #[serde(rename = "n_value")] + pub n_value: f32, #[serde(rename = "success_rate")] pub success_rate: f32, @@ -151,6 +151,9 @@ pub struct MetricEntry { #[serde(rename = "tp99_latency")] pub tp99_latency: f32, + + #[serde(rename = "default_success_threshold")] + pub default_success_threshold: f32, } // Original Haskell data type: SrMetrics @@ -588,6 +591,12 @@ pub async fn update_gateway_score( routing_approach ); + let m_source_object = if txn_card_info.paymentMethodType == UPI { + txn_detail.sourceObject.clone() + } else { + Some(txn_card_info.paymentMethod.clone()) + }; + let should_update_gateway_score = if gateway_scoring_type.clone() == GST::PenaliseSrv3 { false } else if gateway_scoring_type.clone() == GST::Penalise { @@ -603,15 +612,6 @@ pub async fn update_gateway_score( true }; - let is_update_within_window = is_update_within_latency_window( - txn_detail.clone(), - txn_card_info.clone(), - gateway_scoring_type.clone(), - mer_acc.clone(), - txn_latency.clone(), - ) - .await; - let should_isolate_srv3_producer = if Cutover::is_feature_enabled( C::SrV3ProducerIsolation.get_key(), MID::merchant_id_to_text(txn_detail.clone().merchantId), @@ -646,10 +646,96 @@ pub async fn update_gateway_score( }; let redis_key = format!("{}{}", C::GATEWAY_SCORING_DATA, txn_detail.clone().txnUuid); - let redis_gateway_score_data = if should_update_srv3_gateway_score - && is_update_within_window + let app_state = get_tenant_app_state().await; + + let redis_gateway_score_data_initial: Option = + if should_update_srv3_gateway_score + && should_isolate_srv3_producer + && should_update_explore_txn + { + let mb_gateway_scoring_data: Option = app_state + .redis_conn + .get_key(&redis_key, "GatewayScoringData") + .await + .ok(); + mb_gateway_scoring_data + } else { + None + }; + + let mb_gateway_scoring_data: Option = if should_update_gateway_score { + match redis_gateway_score_data_initial { + None => { + let redis_data: Option = app_state + .redis_conn + .get_key(&redis_key, "GatewayScoringData") + .await + .ok(); + redis_data + } + Some(_) => redis_gateway_score_data_initial, + } + } else { + None + }; + + let m_metric_entry: Option = match mb_gateway_scoring_data.clone() { + None => { + let merchant_id_str = MID::merchant_id_to_text(txn_detail.clone().merchantId); + let pmt_str = txn_card_info.paymentMethodType.to_string(); + let txn_obj_type_str = txn_detail + .txnObjectType + .clone() + .map(|t| t.to_string()) + .unwrap_or_default(); + let card_type_str = txn_card_info.card_type.clone().map(|t| t.to_string()); + get_metric_entry_data( + merchant_id_str, + pmt_str, + m_source_object, + txn_obj_type_str, + card_type_str, + false, + None, + ) + .await + } + Some(gateway_scoring_data) => { + let merchant_id_str = MID::merchant_id_to_text(txn_detail.clone().merchantId); + let pmt_str = txn_card_info.paymentMethodType.to_string(); + let txn_obj_type_str = txn_detail + .txnObjectType + .clone() + .map(|t| t.to_string()) + .unwrap_or_default(); + let card_type_str = txn_card_info.card_type.clone().map(|t| t.to_string()); + get_metric_entry_data( + merchant_id_str, + pmt_str, + m_source_object, + txn_obj_type_str, + card_type_str, + gateway_scoring_data.isGriEnabledForElimination, + gateway_scoring_data.gatewayReferenceId, + ) + .await + } + }; + + let is_update_within_window = is_update_within_latency_window( + txn_detail.clone(), + txn_card_info.clone(), + gateway_scoring_type.clone(), + mer_acc.clone(), + txn_latency.clone(), + m_metric_entry, + ) + .await; + + if should_update_srv3_gateway_score && should_isolate_srv3_producer && should_update_explore_txn + && is_update_within_window { logger::debug!( action = "updateGatewayScore", @@ -673,15 +759,12 @@ pub async fn update_gateway_score( gateway_reference_id.clone(), ) .await; - mb_gateway_scoring_data - } else { - None - }; + } if should_update_gateway_score && is_update_within_window { let mer_acc_p_id: ETM::id::MerchantPId = mer_acc.id.clone(); let m_pf_mc_config = MerchantConfig::getMerchantConfigEntityLevelLookupConfig().await; - let mb_gateway_scoring_data = match redis_gateway_score_data { + let mb_gateway_scoring_data = match mb_gateway_scoring_data { None => { let app_state = get_tenant_app_state().await; let redis_data: Option = app_state @@ -691,7 +774,7 @@ pub async fn update_gateway_score( .ok(); redis_data } - Some(_) => redis_gateway_score_data, + Some(_) => mb_gateway_scoring_data, }; logger::debug!(tag = "GatewayScoringData", "{:?}", mb_gateway_scoring_data); match mb_gateway_scoring_data { @@ -729,6 +812,7 @@ pub async fn update_gateway_score( txn_detail.clone(), txn_card_info.clone(), gateway_scoring_type.clone(), + gateway_scoring_data.clone(), mer_acc_p_id, mer_acc.clone(), key, @@ -817,6 +901,7 @@ pub async fn is_update_within_latency_window( gateway_scoring_type: GatewayScoringType, mer_acc: MerchantAccount, txn_latency: Option, + m_metric_entry: Option, ) -> bool { match gateway_scoring_type { GatewayScoringType::Penalise => true, @@ -835,6 +920,23 @@ pub async fn is_update_within_latency_window( findByNameFromRedis(C::GatewayScoreLatencyCheckInMins.get_key()) .await .unwrap_or(C::defaultGatewayScoreLatencyCheckInMins()); + let gw_wise_latency_threshold = get_gateway_wise_latency( + &default_gw_latency_check_in_mins(), + &txn_card_info.paymentMethodType.to_string(), + &GU::get_payment_method( + txn_card_info.paymentMethodType.to_string(), + txn_card_info.paymentMethod.clone(), + txn_detail.sourceObject.clone().unwrap_or_default(), + ), + &txn_detail.gateway.clone().unwrap_or_default(), // Convert Option to String + ); + logger::info!( + action = "gw_wise_latency_threshold", + tag = "gw_wise_latency_threshold", + "gw_wise_latency_threshold: {}", + gw_wise_latency_threshold + ); + /// check if the transaction latency calculated by orchestration is within the configured threshold let is_gw_latency_within_threshold = isGwLatencyWithinConfiguredThreshold( txn_latency.and_then(|m| m.gateway_latency), @@ -857,13 +959,21 @@ pub async fn is_update_within_latency_window( let gw_score_update_latency = Fbu::get_time_from_txn_created_in_mills(txn_detail.clone()); + let gw_latency_check_threshold_ = + gw_wise_latency_threshold.min(gw_latency_check_threshold as f64); + let gw_latency_check_threshold = match m_metric_entry { + Some(metric_entry) => { + gw_latency_check_threshold_.min(metric_entry.tp99_latency.into()) + } + None => gw_latency_check_threshold_, + }; logger::debug!( action = "gwLatencyCheckThreshold", tag = "gwLatencyCheckThreshold", "gwLatencyCheckThreshold: {}", gw_latency_check_threshold ); - if (gw_score_update_latency < gw_latency_check_threshold * 60000u128) + if (gw_score_update_latency < (gw_latency_check_threshold * 60000.0) as u128) && is_gw_latency_within_threshold { true @@ -886,3 +996,100 @@ async fn checkExemptIfMandateTxn(txn_detail: &TxnDetail, txn_card_info: &TxnCard pub fn is_transaction_pending(txn_status: TxnStatus) -> bool { txn_status == TS::PendingVBV || txn_status == TS::Started } + +// Helper function to filter by gateway only +fn filter_upto_gw<'a>( + latency_input: &'a [GatewayWiseLatencyInput], + gw: &'a str, +) -> Option<&'a GatewayWiseLatencyInput> { + latency_input + .iter() + .find(|x| x.gateway == gw && x.paymentMethodType.is_none() && x.paymentMethod.is_none()) +} + +// Helper function to filter by gateway and payment method type +fn filter_upto_pmt<'a>( + latency_input: &'a [GatewayWiseLatencyInput], + gw: &'a str, + pmt: &'a str, +) -> Option<&'a GatewayWiseLatencyInput> { + latency_input.iter().find(|x| { + x.gateway == gw + && x.paymentMethodType + .as_ref() + .map_or("".to_string(), |s| s.clone()) + == pmt + && x.paymentMethod.is_none() + }) +} + +// Helper function to filter by gateway, payment method type, and payment method +fn filter_upto_pm<'a>( + latency_input: &'a [GatewayWiseLatencyInput], + gw: &'a str, + pmt: &'a str, + pm: &'a str, +) -> Option<&'a GatewayWiseLatencyInput> { + latency_input.iter().find(|x| { + x.gateway == gw + && x.paymentMethodType + .as_ref() + .map_or("".to_string(), |s| s.clone()) + == pmt + && x.paymentMethod + .as_ref() + .map_or("".to_string(), |s| s.clone()) + == pm + }) +} + +// Helper function to get gateway latency threshold +fn get_gw_latency_threshold( + merchant_latency_gateway_wise_input: &Option>, +) -> Option<&GatewayWiseLatencyInput> { + match merchant_latency_gateway_wise_input { + None => None, + Some(latency_input) => { + // This will be called with specific parameters in the main function + // For now, return None as the actual filtering happens in the main function + None + } + } +} + +// Main function to get gateway-wise latency +pub fn get_gateway_wise_latency( + gateway_latency_threshold: &GatewayLatencyForScoring, + pmt: &str, + pm: &str, + gw: &str, +) -> f64 { + let m_gateway_wise_input = + get_gw_latency_threshold(&gateway_latency_threshold.merchant_latency_gateway_wise_input); + + // Log the input (similar to EL.logDebugV in Haskell) + logger::debug!( + action = "get_gateway_wise_latency", + tag = "get_gateway_wise_latency", + "mGatewayWiseInput: {:?}", + gateway_latency_threshold.merchant_latency_gateway_wise_input + ); + + match &gateway_latency_threshold.merchant_latency_gateway_wise_input { + Some(gw_wise_input) => { + // Try to find the most specific match first, then fall back to less specific + if let Some(result) = filter_upto_pm(gw_wise_input, gw, pmt, pm) { + result.latencyThreshold + } else if let Some(result) = filter_upto_pmt(gw_wise_input, gw, pmt) { + result.latencyThreshold + } else if let Some(result) = filter_upto_gw(gw_wise_input, gw) { + result.latencyThreshold + } else { + gateway_latency_threshold.default_latency_threshold + } + } + None => gateway_latency_threshold.default_latency_threshold, + } +} + +// Helper function to filter by gateway only diff --git a/src/feedback/types.rs b/src/feedback/types.rs index 322a7918..a6bf0582 100644 --- a/src/feedback/types.rs +++ b/src/feedback/types.rs @@ -122,6 +122,9 @@ pub struct GatewayScoringKeyType { #[serde(rename = "softTTL")] pub softTTL: Option, + + #[serde(rename = "gatewayReferenceId")] + pub gatewayReferenceId: Option, } // Original Haskell data type: TxnDetailT diff --git a/src/redis/commands.rs b/src/redis/commands.rs index 48321e14..8b3120ff 100644 --- a/src/redis/commands.rs +++ b/src/redis/commands.rs @@ -8,7 +8,7 @@ use fred::prelude::RedisKey; use fred::types::SetOptions; use fred::{ clients::Transaction, - interfaces::{KeysInterface, ListInterface, TransactionInterface}, + interfaces::{HashesInterface, KeysInterface, ListInterface, TransactionInterface}, types::{Expiration, FromRedis, MultipleValues, RedisValue}, }; use redis_interface::{errors, types::DelReply, RedisConnectionPool}; @@ -617,4 +617,32 @@ impl RedisConnectionWrapper { .await .change_context(errors::RedisError::UnknownResult) } + + // Redis Hash Operations + pub async fn hget( + &self, + key: &str, + field: &str, + type_name: &'static str, + ) -> Result, errors::RedisError> + where + T: serde::de::DeserializeOwned, + { + let result: Option = self + .conn + .pool + .hget(key, field) + .await + .change_context(errors::RedisError::GetFailed)?; + + match result { + Some(value_str) => { + let value: T = serde_json::from_str(&value_str) + .map_err(|_| errors::RedisError::UnknownResult) + .change_context(errors::RedisError::GetFailed)?; + Ok(Some(value)) + } + None => Ok(None), + } + } } From 6f531f2ee2cfc6ff1b549033a4ab4d32b9288457 Mon Sep 17 00:00:00 2001 From: Venkatesh <17565447+inventvenkat@users.noreply.github.com> Date: Tue, 30 Dec 2025 12:21:21 +0530 Subject: [PATCH 59/95] ci: helm to accept generic override values for envs (#200) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- helm-charts/config/development.toml | 1 + helm-charts/templates/configmap.yaml | 157 +------------------------- helm-charts/templates/deployment.yaml | 17 ++- helm-charts/templates/service.yaml | 10 +- helm-charts/values.yaml | 19 +++- 5 files changed, 36 insertions(+), 168 deletions(-) create mode 120000 helm-charts/config/development.toml diff --git a/helm-charts/config/development.toml b/helm-charts/config/development.toml new file mode 120000 index 00000000..7f052ec6 --- /dev/null +++ b/helm-charts/config/development.toml @@ -0,0 +1 @@ +../../config/development.toml \ No newline at end of file diff --git a/helm-charts/templates/configmap.yaml b/helm-charts/templates/configmap.yaml index deb33f26..dfa1a13d 100644 --- a/helm-charts/templates/configmap.yaml +++ b/helm-charts/templates/configmap.yaml @@ -6,159 +6,4 @@ metadata: {{- include "decision-engine.labels" . | nindent 4 }} data: development.toml: |- - {{- include "decision-engine.configFile" . | nindent 4 }} - - [routing_config.keys] - billing_country = {type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe"} - business_country = {type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe"} - business_label = { type = "udf"} - metadata = {type = "udf"} - pay_later = {type = "enum", values = "Affirm, Alma, AfterpayClearpay, Klarna, PayBright, Atome, Walley"} - gift_card = {type = "enum", values = "Givex, PaySafeCard"} - wallet = {type = "enum", values = "AmazonPay, ApplePay, GooglePay, Paypal, AliPay, AliPayHk, Dana, MbWay, MobilePay, SamsungPay, Twint, Vipps, TouchNGo, Swish, WeChatPay, GoPay, Gcash, Momo, KakaoPay, Cashapp, Mifinity, Paze"} - upi = {type = "enum", values = "UpiCollect, UpiIntent"} - voucher = {type = "enum", values = "Boleto, Efecty, PagoEfectivo, RedCompra, RedPagos, Indomaret, Alfamart, Oxxo, SevenEleven, Lawson, MiniStop, FamilyMart, Seicomart, PayEasy"} - bank_transfer = {type = "enum", values = "Ach, SepaBankTransfer, Bacs, Multibanco, Pix, Pse, PermataBankTransfer, BcaBankTransfer, BniVa, BriVa, CimbVa, DanamonVa, MandiriVa, LocalBankTransfer, InstantBankTransfer"} - bank_redirect = {type = "enum", values = "Giropay, Ideal, Sofort, Eft, Eps, BancontactCard, Blik, LocalBankRedirect, OnlineBankingThailand, OnlineBankingCzechRepublic, OnlineBankingFinland, OnlineBankingFpx, OnlineBankingPoland, OnlineBankingSlovakia, Przelewy24, Trustly, Bizum, Interac, OpenBankingUk, OpenBankingPIS"} - bank_debit = {type = "enum", values = "Ach, Sepa, Bacs, Becs"} - crypto = {type = "enum", values = "CryptoCurrency"} - reward = {type = "enum", values = "Evoucher, ClassicReward"} - card_redirect = {type = "enum", values = "Knet, Benefit, MomoAtm, CardRedirect"} - real_time_payment = {type = "enum", values = "Fps, DuitNow, PromptPay, VietQr"} - open_banking = {type = "enum", values = "OpenBankingPIS"} - mobile_payment = {type = "enum", values = "DirectCarrierBilling"} - payment_method = {type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment"} - payment_card_bin = {type = "udf"} - payment_card_type = {type = "enum", values = "CREDIT, DEBIT"} - mandate_acceptance_type = {type = "enum", values= "Online, Offline"} - card_network = {type = "enum", values = "Visa, Mastercard, AmericanExpress, JCB, DinersClub, Discover, CartesBancaires, UnionPay, Interac, RuPay, Maestro, Star, Pulse, Accel, Nyce"} - mandate_type = {type = "enum", values= "SingleUse, MultiUse"} - payment_type = {type = "enum", values = "normal, new_mandate, setup_mandate, recurring_mandate, non_mandate"} - payment_method_type = {type = "enum", values = "ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, boleto, bca_bank_transfer, bni_va, bri_va, card, card_redirect, cimb_va, classic_reward, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eft, eps, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, multibanco, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, paypal, paze, pix, pay_safe_card, przelewy24, prompt_pay, pse, red_compra, red_pagos, samsung_pay, sepa, sepa_bank_transfer, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, direct_carrier_billing, instant_bank_transfer"} - authentication_type = {type = "enum", values = "three_ds, no_three_ds"} - capture_methods = {type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic"} - setup_future_usage = {type = "enum", values = "on_session, off_session"} - payment_card_network = {type = "enum", values = "visa, mastercard, american_express, jcb, diners_club, discover, cartes_bancaires, union_pay, interac, rupay, maestro"} - amount = {type = "integer"} - login_date = {type = "str"} - currency = {type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL"} - payment_card_issuer_country = { type = "enum", values = "AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, US"} - card_bin = {type = "str"} - capture_method = {type = "enum", values = "automatic, manual"} - new_customer = {type = "udf"} - - - udf1 = {type = "str"} - order_udf1 = {type = "global_ref"} - payment_payment_method = {type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI"} - payment_payment_source = {type = "enum", values = "net.one97.paytm, @paytm"} - txn_is_emi = {type = "enum", values = "true, false"} - - [routing_config.default] - output = ["stripe", "adyen"] - - [[routing_config.constraint_graph.nodes]] - preds = [] - succs = [0] - - [routing_config.constraint_graph.nodes.kind] - kind = "value" - - [routing_config.constraint_graph.nodes.kind.data] - kind = "value" - - [routing_config.constraint_graph.nodes.kind.data.data] - key = "payment_method" - comparison = "equal" - - [routing_config.constraint_graph.nodes.kind.data.data.value] - type = "enum_variant" - value = "card" - - [[routing_config.constraint_graph.nodes]] - preds = [] - succs = [1] - - [routing_config.constraint_graph.nodes.kind] - kind = "value" - - [routing_config.constraint_graph.nodes.kind.data] - kind = "value" - - [routing_config.constraint_graph.nodes.kind.data.data] - key = "payment_method" - comparison = "equal" - - [routing_config.constraint_graph.nodes.kind.data.data.value] - type = "enum_variant" - value = "bank_debit" - - [[routing_config.constraint_graph.nodes]] - preds = [0] - succs = [] - - [routing_config.constraint_graph.nodes.kind] - kind = "value" - - [routing_config.constraint_graph.nodes.kind.data] - kind = "value" - - [routing_config.constraint_graph.nodes.kind.data.data] - key = "output" - comparison = "equal" - - [routing_config.constraint_graph.nodes.kind.data.data.value] - type = "enum_variant" - value = "stripe" - - [[routing_config.constraint_graph.nodes]] - preds = [1] - succs = [] - - [routing_config.constraint_graph.nodes.kind] - kind = "value" - - [routing_config.constraint_graph.nodes.kind.data] - kind = "value" - - [routing_config.constraint_graph.nodes.kind.data.data] - key = "output" - comparison = "equal" - - [routing_config.constraint_graph.nodes.kind.data.data.value] - type = "enum_variant" - value = "adyen" - - [[routing_config.constraint_graph.edges]] - strength = "strong" - relation = "positive" - pred = 0 - succ = 2 - - [[routing_config.constraint_graph.edges]] - strength = "strong" - relation = "positive" - pred = 1 - succ = 3 - - [debit_routing_config] - fraud_check_fee = 0.01 - - [debit_routing_config.network_fee] - visa = { percentage = 0.1375, fixed_amount = 0.020 } - mastercard = { percentage = 0.15, fixed_amount = 0.40 } - accel = { percentage = 0.0, fixed_amount = 0.040 } - nyce = { percentage = 0.10, fixed_amount = 0.015 } - pulse = { percentage = 0.10, fixed_amount = 0.03 } - star = { percentage = 0.10, fixed_amount = 0.015 } - - [debit_routing_config.interchange_fee] - regulated = { percentage = 0.05, fixed_amount = 0.21 } - - [debit_routing_config.interchange_fee.non_regulated] - merchant_category_code_0001.visa = { percentage = 1.65, fixed_amount = 0.15 } - merchant_category_code_0001.mastercard = { percentage = 1.65, fixed_amount = 0.15 } - merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 0.04 } - merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 0.213125 } - merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 0.15 } - merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 0.15 } + {{ .Files.Get "config/development.toml" | nindent 4 }} \ No newline at end of file diff --git a/helm-charts/templates/deployment.yaml b/helm-charts/templates/deployment.yaml index e579c6a2..a6f7bc81 100644 --- a/helm-charts/templates/deployment.yaml +++ b/helm-charts/templates/deployment.yaml @@ -28,6 +28,7 @@ spec: serviceAccountName: {{ include "decision-engine.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.initContainers.enabled }} initContainers: {{- if .Values.decisionEngine.usePostgreSQL }} - name: wait-for-postgresql @@ -47,6 +48,7 @@ spec: image: busybox:1.28 command: ['sh', '-c', 'until nc -z {{ include "decision-engine.mysqlHost" . }} 3306; do echo waiting for mysql; sleep 2; done;'] {{- end }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: @@ -54,15 +56,18 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.version | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - - name: http - containerPort: {{ .Values.decisionEngine.server.port }} - protocol: TCP - - name: metrics - containerPort: {{ .Values.decisionEngine.metrics.port }} - protocol: TCP + {{- range .Values.service.ports }} + - name: {{ .name }} + containerPort: {{ .targetPort }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} env: - name: GROOVY_RUNNER_HOST value: "{{ include "decision-engine.groovyRunnerName" . }}:{{ .Values.groovyRunner.service.port }}" + {{- with .Values.extraEnvVars }} + {{- toYaml . | nindent 12 }} + {{- end }} + livenessProbe: httpGet: path: /health diff --git a/helm-charts/templates/service.yaml b/helm-charts/templates/service.yaml index c0e9a419..b97106ec 100644 --- a/helm-charts/templates/service.yaml +++ b/helm-charts/templates/service.yaml @@ -8,10 +8,12 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http + {{- range .Values.service.ports }} + - name: {{ .name }} + port: {{ .port }} + targetPort: {{ .targetPort }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} selector: {{- include "decision-engine.selectorLabels" . | nindent 4 }} app.kubernetes.io/component: {{ .Values.decisionEngine.metadata.labels.component }} diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 2fc07263..8a8bed3f 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -8,7 +8,7 @@ image: version: "v1.2.0" # Configure these if your images are in a private registry -imagePullSecrets: +imagePullSecrets: # - name: regcred nameOverride: "" fullnameOverride: "" @@ -27,6 +27,10 @@ podAnnotations: {} podSecurityContext: {} # fsGroup: 2000 +initContainers: + # Set to false to disable all init containers + enabled: true + securityContext: {} # capabilities: # drop: @@ -37,7 +41,15 @@ securityContext: {} service: type: ClusterIP - port: 8080 + ports: + - name: http + port: 80 + targetPort: 8080 + protocol: TCP + - name: metrics + port: 9090 + targetPort: 9090 + protocol: TCP ingress: enabled: false @@ -206,3 +218,6 @@ routingConfig: enabled: true # Path to mount routing config files mountPath: "/app" + +# Additional environment variables to inject into the main container +extraEnvVars: [] \ No newline at end of file From fff0d5b32130175171bee0e31f6a412b3515c596 Mon Sep 17 00:00:00 2001 From: Venkatesh <17565447+inventvenkat@users.noreply.github.com> Date: Tue, 30 Dec 2025 16:00:05 +0530 Subject: [PATCH 60/95] ci: add vs to decision-engine, if wanted to expose to the existing ingress (#201) --- .../templates/istio-destinationrule.yaml | 16 ++++++ .../templates/istio-virtualservice.yaml | 52 +++++++++++++++++++ helm-charts/values.yaml | 36 ++++++++++++- 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 helm-charts/templates/istio-destinationrule.yaml create mode 100644 helm-charts/templates/istio-virtualservice.yaml diff --git a/helm-charts/templates/istio-destinationrule.yaml b/helm-charts/templates/istio-destinationrule.yaml new file mode 100644 index 00000000..a5ab60f8 --- /dev/null +++ b/helm-charts/templates/istio-destinationrule.yaml @@ -0,0 +1,16 @@ +{{- if and .Values.istio.enabled .Values.istio.destinationRule.enabled }} +apiVersion: networking.istio.io/v1 +kind: DestinationRule +metadata: + name: {{ include "decision-engine.fullname" . }}-dr + namespace: {{ .Release.Namespace }} + labels: + {{- include "decision-engine.labels" . | nindent 4 }} + app.kubernetes.io/component: istio-destination-rule +spec: + host: {{ include "decision-engine.fullname" . }} + {{- if .Values.istio.destinationRule.trafficPolicy }} + trafficPolicy: + {{- toYaml .Values.istio.destinationRule.trafficPolicy | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/helm-charts/templates/istio-virtualservice.yaml b/helm-charts/templates/istio-virtualservice.yaml new file mode 100644 index 00000000..9d2994f5 --- /dev/null +++ b/helm-charts/templates/istio-virtualservice.yaml @@ -0,0 +1,52 @@ +{{- if and .Values.istio.enabled .Values.istio.virtualService.enabled }} +apiVersion: networking.istio.io/v1beta1 +kind: VirtualService +metadata: + name: {{ include "decision-engine.fullname" . }}-vs + namespace: {{ .Release.Namespace }} + labels: + {{- include "decision-engine.labels" . | nindent 4 }} + app.kubernetes.io/component: istio-virtual-service +spec: + {{- with .Values.istio.virtualService.hosts }} + hosts: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.istio.virtualService.gateways }} + gateways: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- if .Values.istio.virtualService.http }} + http: + {{- range .Values.istio.virtualService.http }} + - {{- if .name }} + name: {{ .name | quote }} + {{- end }} + {{- if .match }} + match: + {{- toYaml .match | nindent 6 }} + {{- end }} + {{- if .rewrite }} + rewrite: + {{- toYaml .rewrite | nindent 6 }} + {{- end }} + {{- if .timeout }} + timeout: {{ .timeout }} + {{- end }} + {{- if .retries }} + retries: + {{- toYaml .retries | nindent 6 }} + {{- end }} + route: + - destination: + host: {{ include "decision-engine.fullname" $ }} + port: + number: 80 + {{- if .weight }} + weight: {{ .weight }} + {{- else }} + weight: 100 + {{- end }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 8a8bed3f..511932ad 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -220,4 +220,38 @@ routingConfig: mountPath: "/app" # Additional environment variables to inject into the main container -extraEnvVars: [] \ No newline at end of file +extraEnvVars: [] + +# Istio configuration (optional) +istio: + enabled: false + virtualService: + enabled: false + hosts: [] + gateways: [] + # HTTP routing rules - route destination will be automatically set to control center service + http: [] + # Example configuration: + # http: + # - name: "control-center-routes" + # match: + # - uri: + # prefix: / + # rewrite: + # uri: "/dashboard" + # weight: 100 + # timeout: 30s + # retries: + # attempts: 3 + # perTryTimeout: 10s + destinationRule: + enabled: false + trafficPolicy: {} + # Example traffic policy: + # trafficPolicy: + # loadBalancer: + # simple: ROUND_ROBIN + # connectionPool: + # tcp: + # maxConnections: 50 + # connectTimeout: 30s \ No newline at end of file From 454ab8d784709747c36658eb319126701ba12cd3 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Fri, 9 Jan 2026 17:05:17 +0530 Subject: [PATCH 61/95] fix: db specific schema imports (#203) --- src/decider/gatewaydecider/utils.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 802a919c..db7aff50 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -9,7 +9,10 @@ use crate::redis::feature::{ is_feature_enabled, RedisCompressionConfig, RedisCompressionConfigCombined, RedisDataStruct, }; use crate::redis::types::ServiceConfigKey; +#[cfg(feature = "mysql")] use crate::storage::schema::gateway_bank_emi_support::gateway; +#[cfg(feature = "postgres")] +use crate::storage::schema_pg::gateway_bank_emi_support::gateway; use crate::types::card::card_type::card_type_to_text; use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; From 74395449ec116d31286ad2e128db726efc5e3abd Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Tue, 20 Jan 2026 13:37:28 +0530 Subject: [PATCH 62/95] feat: rule validator (#202) --- Cargo.lock | 1 + Cargo.toml | 1 + config/development.toml | 11 +- src/euclid/errors.rs | 52 +++- src/euclid/handlers/routing_rules.rs | 55 +++- src/euclid/types.rs | 94 +++++- src/euclid/utils.rs | 444 +++++++++++++++++++++------ 7 files changed, 535 insertions(+), 123 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ca291ad..87c253d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3151,6 +3151,7 @@ dependencies = [ "rand 0.8.5", "rand_distr", "redis_interface", + "regex", "reqwest 0.12.15", "ring", "rustc-hash 2.1.1", diff --git a/Cargo.toml b/Cargo.toml index 1c4968f7..2aeb8806 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,6 +95,7 @@ rand = "0.8.5" tower-http = { version = "0.6.2", features = ["trace"] } bytes = "1.10.1" strum = { version = "0.26.2", features = ["derive"] } +regex = "1.10" # ------------------------------------- [dev-dependencies] diff --git a/config/development.toml b/config/development.toml index a4509240..3b7383b0 100644 --- a/config/development.toml +++ b/config/development.toml @@ -85,8 +85,8 @@ mobile_payment = { type = "enum", values = "direct_carrier_billing" } payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } card_type = { type = "enum", values = "debit, credit" } card = { type = "enum", values = "debit, credit" } -payment_card_bin = { type = "udf" } -issuer_name = { type = "str_value" } +payment_card_bin = { type = "udf", exact_length = 6, regex = "^[0-9]{6}$" } +issuer_name = { type = "str_value", min_length = 1 } payment_card_type = { type = "enum", values = "CREDIT, DEBIT" } mandate_acceptance_type = { type = "enum", values = "online, offline" } mandate_type = { type = "enum", values = "single_use, multi_use" } @@ -97,12 +97,13 @@ authentication_type = { type = "enum", values = "three_ds, no_three_ds" } capture_methods = { type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic" } setup_future_usage = { type = "enum", values = "on_session, off_session" } payment_card_network = { type = "enum", values = "visa, mastercard, american_express, jcb, diners_club, discover, cartes_bancaires, union_pay, interac, rupay, maestro" } -amount = { type = "integer" } +amount = { type = "integer", min = 0 } login_date = { type = "str_value" } currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } payment_card_issuer_country = { type = "enum", values = "AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, US" } -card_bin = { type = "str_value" } -extended_card_bin = { type = "str_value" } + +card_bin = { type = "str_value", exact_length = 6, regex = "^[0-9]{6}$" } +extended_card_bin = { type = "str_value", exact_length = 8, regex = "^[0-9]{8}$" } capture_method = { type = "enum", values = "automatic, manual" } new_customer = { type = "udf" } udf1 = { type = "str_value" } diff --git a/src/euclid/errors.rs b/src/euclid/errors.rs index 9878c254..81701a7a 100644 --- a/src/euclid/errors.rs +++ b/src/euclid/errors.rs @@ -43,6 +43,30 @@ pub enum EuclidErrors { #[error("Invalid Sr Dimension Configuration")] InvalidSrDimensionConfig(String), + + #[error("Field validation failed: {0}")] + FieldValidationFailed(String), +} + +#[derive(Debug, Clone, serde::Serialize)] +pub struct ValidationErrorDetails { + pub field: String, + pub error_type: String, + pub message: String, +} + +impl ValidationErrorDetails { + pub fn new( + field: impl Into, + error_type: impl Into, + message: impl Into, + ) -> Self { + Self { + field: field.into(), + error_type: error_type.into(), + message: message.into(), + } + } } impl axum::response::IntoResponse for EuclidErrors { @@ -195,15 +219,25 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::InvalidSrDimensionConfig(msg) => ( - hyper::StatusCode::BAD_REQUEST, - axum::Json(ApiErrorResponse::new( - error_codes::TE_04, - msg, - None, - )), - ) - .into_response(), + EuclidErrors::InvalidSrDimensionConfig(msg) => ( + hyper::StatusCode::BAD_REQUEST, + axum::Json(ApiErrorResponse::new( + error_codes::TE_04, + msg, + None, + )), + ) + .into_response(), + + EuclidErrors::FieldValidationFailed(msg) => ( + hyper::StatusCode::BAD_REQUEST, + axum::Json(ApiErrorResponse::new( + error_codes::TE_04, + format!("Field validation failed: {}", msg), + None, + )), + ) + .into_response(), } } } diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index a798741c..c238b1db 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -9,7 +9,7 @@ use crate::{ cgraph, interpreter::{evaluate_output, InterpreterBackend}, types::{ - ActivateRoutingConfigRequest, Context, JsonifiedRoutingAlgorithm, + ActivateRoutingConfigRequest, Context, JsonifiedRoutingAlgorithm, KeyDataType, RoutingAlgorithmMapperNew, RoutingDictionaryRecord, RoutingEvaluateResponse, RoutingRequest, RoutingRule, SrDimensionConfig, StaticRoutingAlgorithm, ELIGIBLE_DIMENSIONS, @@ -145,34 +145,57 @@ pub async fn routing_create( logger::debug!("Received routing config: {:?}", config); - if let Err(err) = validate_routing_rule(&config, &state.config.routing_config) { - let source = err.get_inner(); + match validate_routing_rule(&config, &state.config.routing_config) { + Ok(validation_result) => { + if !validation_result.is_valid { + for error in &validation_result.errors { + logger::error!( + field = %error.field, + error_type = %error.error_type, + message = %error.message, + "Field validation error during routing rule creation" + ); + } + + let error_details: Vec = validation_result + .errors + .iter() + .map(|e| { + serde_json::json!({ + "field": e.field, + "error_type": e.error_type, + "message": e.message, + }) + }) + .collect(); - if let EuclidErrors::FailedToValidateRoutingRule = source { - if let Some(validation_messages) = err.downcast_ref::>() { - let detailed_error = validation_messages.join("; "); - logger::error!("Routing rule validation failed with errors: {detailed_error}"); + let detailed_error = validation_result.to_error_message(); metrics::API_REQUEST_COUNTER .with_label_values(&["routing_create", "failure"]) .inc(); timer.observe_duration(); + return Err(ContainerError::new_with_status_code_and_payload( - EuclidErrors::FailedToValidateRoutingRule, + EuclidErrors::FieldValidationFailed(detailed_error.clone()), axum::http::StatusCode::BAD_REQUEST, ApiErrorResponse::new( - "INVALID_REQUEST_DATA", + "FIELD_VALIDATION_FAILED", format!("Routing rule validation failed: {}", detailed_error), - None, + Some(serde_json::json!({ "validation_errors": error_details })), ), )); } + logger::debug!("Routing rule validation passed successfully"); + } + Err(err) => { + logger::error!(error = ?err, "Failed to validate routing rule configuration"); + metrics::API_REQUEST_COUNTER + .with_label_values(&["routing_create", "failure"]) + .inc(); + timer.observe_duration(); + return Err(err.into()); } - metrics::API_REQUEST_COUNTER - .with_label_values(&["routing_create", "failure"]) - .inc(); - timer.observe_duration(); - return Err(err.into()); } let utc_date_time = time::OffsetDateTime::now_utc(); @@ -306,7 +329,7 @@ pub async fn routing_evaluate( } if let Some(key_config) = routing_config.keys.keys.get(key) { - if key_config.data_type == "enum" { + if key_config.data_type == KeyDataType::Enum { if let Some(Some(ValueType::EnumVariant(value))) = parameters.get(key) { if !is_valid_enum_value(routing_config, key, value) { update_failure_metrics(); diff --git a/src/euclid/types.rs b/src/euclid/types.rs index cba9989c..569d94e1 100644 --- a/src/euclid/types.rs +++ b/src/euclid/types.rs @@ -268,13 +268,105 @@ impl Deref for Context { } } +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[serde(rename_all = "snake_case")] +pub enum KeyDataType { + #[serde(rename = "integer")] + Integer, + #[serde(rename = "enum")] + Enum, + #[serde(rename = "udf")] + Udf, + #[serde(rename = "str_value")] + StrValue, + #[serde(rename = "global_ref")] + GlobalRef, +} + +impl KeyDataType { + pub fn as_str(&self) -> &str { + match self { + KeyDataType::Integer => "integer", + KeyDataType::Enum => "enum", + KeyDataType::Udf => "udf", + KeyDataType::StrValue => "str_value", + KeyDataType::GlobalRef => "global_ref", + } + } +} + /// Represents a key configuration in the TOML file #[derive(Clone, Debug, Deserialize, Serialize)] pub struct KeyConfig { #[serde(rename = "type")] - pub data_type: String, + pub data_type: KeyDataType, #[serde(default)] pub values: Option, + #[serde(default)] + pub min_value: Option, + #[serde(default)] + pub max_value: Option, + #[serde(default)] + pub min_length: Option, + #[serde(default)] + pub max_length: Option, + #[serde(default)] + pub exact_length: Option, + #[serde(default)] + pub regex: Option, +} + +impl KeyConfig { + pub fn has_validation_constraints(&self) -> bool { + self.min_value.is_some() + || self.max_value.is_some() + || self.min_length.is_some() + || self.max_length.is_some() + || self.exact_length.is_some() + || self.regex.is_some() + } + + pub fn build_validation_rules(&self) -> Result { + let regex_pattern = match &self.regex { + Some(pattern) => Some( + regex::Regex::new(pattern) + .map_err(|e| format!("Invalid regex pattern '{}': {}", pattern, e))?, + ), + None => None, + }; + + Ok(FieldValidationRules { + min_value: self.min_value, + max_value: self.max_value, + min_length: self.min_length, + max_length: self.max_length, + exact_length: self.exact_length, + regex_pattern, + }) + } +} + +#[derive(Clone, Debug)] +pub struct FieldValidationRules { + pub min_value: Option, + pub max_value: Option, + pub min_length: Option, + pub max_length: Option, + pub exact_length: Option, + pub regex_pattern: Option, +} + +impl Default for FieldValidationRules { + fn default() -> Self { + Self { + min_value: None, + max_value: None, + min_length: None, + max_length: None, + exact_length: None, + regex_pattern: None, + } + } } /// Structure for the [keys] section in the TOML diff --git a/src/euclid/utils.rs b/src/euclid/utils.rs index 38e268fd..8f2ecdfe 100644 --- a/src/euclid/utils.rs +++ b/src/euclid/utils.rs @@ -1,11 +1,53 @@ use super::ast::{Comparison, ComparisonType, IfStatement, Rule, ValueType}; -use super::errors::EuclidErrors; -use super::types::StaticRoutingAlgorithm; +use super::errors::{EuclidErrors, ValidationErrorDetails}; +use super::types::{KeyDataType, StaticRoutingAlgorithm}; use crate::error::ContainerError; -use crate::euclid::types::{KeyConfig, RoutingRule, TomlConfig}; +use crate::euclid::types::{FieldValidationRules, KeyConfig, RoutingRule, TomlConfig}; use std::collections::HashMap; use uuid::Uuid; +#[derive(Debug, Clone)] +pub struct ValidationResult { + pub is_valid: bool, + pub errors: Vec, + pub error_summary: Option, +} + +impl ValidationResult { + pub fn success() -> Self { + Self { + is_valid: true, + errors: Vec::new(), + error_summary: None, + } + } + + pub fn failure(errors: Vec) -> Self { + let summary = if errors.is_empty() { + None + } else { + Some( + errors + .iter() + .map(|e| e.message.clone()) + .collect::>() + .join("; "), + ) + }; + Self { + is_valid: false, + errors, + error_summary: summary, + } + } + + pub fn to_error_message(&self) -> String { + self.error_summary + .clone() + .unwrap_or_else(|| "Validation failed".to_string()) + } +} + pub fn generate_random_id(prefix: &str) -> String { let uuid = Uuid::new_v4(); format!("{}_{}", prefix, uuid) @@ -27,7 +69,7 @@ pub fn parse_enum_values(key_config: &KeyConfig) -> Vec { pub fn get_all_enum_definitions(config: &TomlConfig) -> HashMap> { let mut result = HashMap::new(); for (key, key_config) in &config.keys.keys { - if key_config.data_type == "enum" { + if key_config.data_type == KeyDataType::Enum { let values = parse_enum_values(key_config); if !values.is_empty() { result.insert(key.clone(), values); @@ -40,7 +82,7 @@ pub fn get_all_enum_definitions(config: &TomlConfig) -> HashMap bool { if let Some(key_config) = config.keys.keys.get(key) { - if key_config.data_type == "enum" { + if key_config.data_type == KeyDataType::Enum { let valid_values = parse_enum_values(key_config); return valid_values.contains(&value.to_string()); } @@ -54,9 +96,10 @@ pub fn get_keys_by_type(config: &TomlConfig) -> HashMap> { result.insert("enum".to_string(), Vec::new()); result.insert("integer".to_string(), Vec::new()); result.insert("udf".to_string(), Vec::new()); - result.insert("string".to_string(), Vec::new()); + result.insert("str_value".to_string(), Vec::new()); for (key, key_config) in &config.keys.keys { - if let Some(keys) = result.get_mut(&key_config.data_type) { + let type_str = key_config.data_type.as_str().to_string(); + if let Some(keys) = result.get_mut(&type_str) { keys.push(key.clone()); } } @@ -66,7 +109,7 @@ pub fn get_keys_by_type(config: &TomlConfig) -> HashMap> { pub fn validate_routing_rule( rule: &RoutingRule, config: &Option, -) -> Result<(), ContainerError> { +) -> Result> { let config = config .clone() .ok_or_else(|| error_stack::report!(EuclidErrors::GlobalRoutingConfigsUnavailable))?; @@ -74,49 +117,52 @@ pub fn validate_routing_rule( match &rule.algorithm { StaticRoutingAlgorithm::Single(_) | StaticRoutingAlgorithm::Priority(_) - | StaticRoutingAlgorithm::VolumeSplit(_) => return Ok(()), + | StaticRoutingAlgorithm::VolumeSplit(_) => Ok(ValidationResult::success()), StaticRoutingAlgorithm::Advanced(program) => { - let mut errors = Vec::new(); + let mut validation_errors: Vec = Vec::new(); + for rule in &program.rules { - validate_rule(rule, &config, &mut errors); + validate_rule(rule, &config, &mut validation_errors); } - if errors.is_empty() { - Ok(()) + if validation_errors.is_empty() { + Ok(ValidationResult::success()) } else { - let detailed_message = errors.join("; "); - crate::logger::error!( - "Routing rule validation failed with errors: {detailed_message}" - ); - Err(EuclidErrors::InvalidRequest(format!( - "Routing rule validation failed: {}", - detailed_message - )) - .into()) + for error in &validation_errors { + crate::logger::warn!( + field = %error.field, + error_type = %error.error_type, + message = %error.message, + "Field validation error" + ); + } + + let result = ValidationResult::failure(validation_errors); + Ok(result) } } } } -fn validate_rule(rule: &Rule, config: &TomlConfig, errors: &mut Vec) { - for (i, statement) in rule.statements.iter().enumerate() { - validate_statement( - statement, - config, - errors, - &format!("Rule '{}' Statement {}", rule.name, i + 1), - ); +fn validate_rule(rule: &Rule, config: &TomlConfig, errors: &mut Vec) { + for statement in &rule.statements { + validate_statement(statement, config, errors); } } fn validate_statement( statement: &IfStatement, config: &TomlConfig, - errors: &mut Vec, - context: &str, + errors: &mut Vec, ) { for condition in &statement.condition { - validate_condition(condition, config, errors, context); + validate_condition(condition, config, errors); + } + + if let Some(nested) = &statement.nested { + for nested_stmt in nested { + validate_statement(nested_stmt, config, errors); + } } } @@ -127,22 +173,23 @@ fn validate_statement( fn validate_condition( condition: &Comparison, config: &TomlConfig, - errors: &mut Vec, - context: &str, + errors: &mut Vec, ) { let key_exists = config.keys.keys.contains_key(&condition.lhs); if !key_exists { - errors.push(format!( - "{}: Unknown key '{}' in condition", - context, condition.lhs + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "unknown_key", + format!("Invalid key '{}': Unknown key in condition", &condition.lhs), )); return; } + let key_config = &config.keys.keys[&condition.lhs]; - match (key_config.data_type.as_str(), &condition.comparison) { + match (&key_config.data_type, &condition.comparison) { ( - "integer", + KeyDataType::Integer, ComparisonType::Equal | ComparisonType::NotEqual | ComparisonType::LessThan @@ -150,34 +197,45 @@ fn validate_condition( | ComparisonType::GreaterThan | ComparisonType::GreaterThanEqual, ) => {} - ("enum", ComparisonType::Equal | ComparisonType::NotEqual) => {} - - ("enum", _) => { - errors.push(format!( - "{}: Invalid comparison type '{:?}' for enum key '{}'", - context, condition.comparison, condition.lhs + (KeyDataType::Enum, ComparisonType::Equal | ComparisonType::NotEqual) => {} + (KeyDataType::Enum, _) => { + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "invalid_comparison", + format!( + "Invalid comparison type '{}': expected Equal or NotEqual, got {:?}", + &condition.lhs, condition.comparison + ), )); } (_, comp) if comp != &ComparisonType::Equal && comp != &ComparisonType::NotEqual => { - errors.push(format!( - "{}: Comparison type '{:?}' may not be appropriate for key '{}' of type '{}'", - context, condition.comparison, condition.lhs, key_config.data_type + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "comparison_warning", + format!( + "Comparison type '{:?}' may not be appropriate for key '{}' of type '{:?}'", + condition.comparison, condition.lhs, key_config.data_type + ), )); } _ => {} } - match (key_config.data_type.as_str(), &condition.value) { - ("enum", ValueType::EnumVariant(value)) => { + match (&key_config.data_type, &condition.value) { + (KeyDataType::Enum, ValueType::EnumVariant(value)) => { if !is_valid_enum_value(config, &condition.lhs, value) { let valid_values = parse_enum_values(key_config); - errors.push(format!( - "{}: Invalid enum value '{}' for key '{}'. Valid values are: {:?}", - context, value, condition.lhs, valid_values + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "invalid_enum_value", + format!( + "Invalid enum value '{}': expected one of {:?}, got '{}'", + &condition.lhs, valid_values, value + ), )); } } - ("enum", ValueType::EnumVariantArray(arr)) => { + (KeyDataType::Enum, ValueType::EnumVariantArray(arr)) => { let invalid: Vec<_> = arr .iter() .filter(|v| !is_valid_enum_value(config, &condition.lhs, *v)) @@ -185,70 +243,272 @@ fn validate_condition( .collect(); if !invalid.is_empty() { let valid_values = parse_enum_values(key_config); - errors.push(format!( - "{}: Invalid enum values {:?} for key '{}'. Valid values are: {:?}", - context, invalid, condition.lhs, valid_values + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "invalid_enum_values", + format!( + "Invalid enum values '{}': expected values from {:?}, got {:?}", + &condition.lhs, valid_values, invalid + ), )); } } - ("enum", _) => { - errors.push(format!( - "{}: Key '{}' is of type 'enum' but value is not an enum variant", - context, condition.lhs + (KeyDataType::Enum, _) => { + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "type_mismatch", + format!( + "Invalid enum variant '{}': expected enum variant, got {:?}", + &condition.lhs, + condition.value.get_type() + ), )); } - ("integer", ValueType::Number(_)) => { - // Number value is valid for integer type + (KeyDataType::Integer, ValueType::Number(n)) => { + if key_config.has_validation_constraints() { + if let Ok(rules) = key_config.build_validation_rules() { + if let Err(e) = validate_numeric_range(&condition.lhs, *n as i64, &rules) { + let mut expected_parts = Vec::new(); + if let Some(min) = rules.min_value { + expected_parts.push(format!("min: {}", min)); + } + if let Some(max) = rules.max_value { + expected_parts.push(format!("max: {}", max)); + } + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "value_out_of_range", + e, + )); + } + } + } } - // array of literals – only == / != make sense - ("integer", ValueType::NumberArray(_)) => { + (KeyDataType::Integer, ValueType::NumberArray(arr)) => { if !matches!( condition.comparison, ComparisonType::Equal | ComparisonType::NotEqual ) { - errors.push(format!( - "{context}: Only '==' or '!=' allowed with number arrays for key '{}'", - condition.lhs + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "invalid_comparison", + format!( + "Only '==' or '!=' allowed with number arrays for key '{}'", + condition.lhs + ), )); } + + if key_config.has_validation_constraints() { + if let Ok(rules) = key_config.build_validation_rules() { + for (i, n) in arr.iter().enumerate() { + if let Err(e) = validate_numeric_range(&condition.lhs, *n as i64, &rules) { + let mut expected_parts = Vec::new(); + if let Some(min) = rules.min_value { + expected_parts.push(format!("min: {}", min)); + } + if let Some(max) = rules.max_value { + expected_parts.push(format!("max: {}", max)); + } + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "value_out_of_range", + format!("Element {}: {}", i + 1, e), + )); + } + } + } + } } - // comparison array – interpreter supports **only `==`** - ("integer", ValueType::NumberComparisonArray(_)) => { + (KeyDataType::Integer, ValueType::NumberComparisonArray(_)) => { if condition.comparison != ComparisonType::Equal { - errors.push(format!( - "{context}: Only '==' allowed with number comparison arrays for key '{}'", - condition.lhs + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "invalid_comparison", + format!( + "Only '==' allowed with number comparison arrays for key '{}'", + condition.lhs + ), )); } } - - ("integer", _) => { - errors.push(format!( - "{}: Key '{}' is of type 'integer' but value is not a number", - context, condition.lhs + (KeyDataType::Integer, _) => { + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "type_mismatch", + format!( + "Invalid key '{}': expected number, got {:?}", + &condition.lhs, + condition.value.get_type() + ), )); } - ("udf", ValueType::MetadataVariant(_)) => { - // Metadata value is valid for udf type + (KeyDataType::Udf, ValueType::MetadataVariant(m)) => { + if key_config.has_validation_constraints() { + if let Ok(rules) = key_config.build_validation_rules() { + if let Err(e) = validate_string_value(&condition.lhs, &m.value, &rules) { + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "length_invalid", + e, + )); + } + } + } } - ("udf", _) => { - errors.push(format!( - "{}: Key '{}' is of type 'udf' but value is not a metadata variant", - context, condition.lhs + (KeyDataType::Udf, _) => { + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "type_mismatch", + format!( + "Invalid key '{}': expected metadata variant, got {:?}", + &condition.lhs, + condition.value.get_type() + ), )); } + + (KeyDataType::StrValue, ValueType::StrValue(s)) => { + if key_config.has_validation_constraints() { + if let Ok(rules) = key_config.build_validation_rules() { + if let Err(e) = validate_string_value(&condition.lhs, s, &rules) { + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "length_invalid", + e, + )); + } + } + } + } + _ => { - if condition.value.get_type().to_string() != key_config.data_type { - errors.push(format!( - "{}: Value type mismatch for key '{}': expected '{}' but got '{}'", - context, - condition.lhs, - key_config.data_type, - condition.value.get_type() + if condition.value.get_type().to_string() != key_config.data_type.as_str() { + errors.push(ValidationErrorDetails::new( + &condition.lhs, + "type_mismatch", + format!( + "Invalid key '{}': expected {}, got {}", + &condition.lhs, + key_config.data_type.as_str(), + condition.value.get_type() + ), )); } } } } + +pub fn validate_numeric_range( + field: &str, + value: i64, + rules: &FieldValidationRules, +) -> Result<(), String> { + if let Some(min) = rules.min_value { + if value < min { + return Err(format!( + "Invalid field '{}': value {} is below minimum {}", + field, value, min + )); + } + } + if let Some(max) = rules.max_value { + if value > max { + return Err(format!( + "Invalid field '{}': value {} exceeds maximum {}", + field, value, max + )); + } + } + Ok(()) +} + +pub fn validate_string_length( + field: &str, + value: &str, + min_length: Option, + max_length: Option, +) -> Result<(), String> { + let len = value.len(); + + if let Some(min) = min_length { + if len < min { + return Err(format!( + "Invalid field '{}': length {} is below minimum {}", + field, len, min + )); + } + } + + if let Some(max) = max_length { + if len > max { + return Err(format!( + "Invalid field '{}': length {} exceeds maximum {}", + field, len, max + )); + } + } + + Ok(()) +} + +pub fn validate_exact_length( + field: &str, + value: &str, + expected_length: usize, +) -> Result<(), String> { + let actual_length = value.len(); + if actual_length != expected_length { + return Err(format!( + "Invalid field '{}': expected {} characters, got {} characters", + field, expected_length, actual_length + )); + } + Ok(()) +} + +pub fn validate_regex_pattern( + field: &str, + value: &str, + pattern: &Option, +) -> Result<(), String> { + if let Some(ref regex) = pattern { + if !regex.is_match(value) { + return Err(format!( + "Invalid field '{}': value does not match required pattern", + field + )); + } + } + Ok(()) +} + +pub fn validate_string_value( + field: &str, + value: &str, + rules: &FieldValidationRules, +) -> Result<(), String> { + let mut errors = Vec::new(); + + if let Some(exact) = rules.exact_length { + if let Err(e) = validate_exact_length(field, value, exact) { + errors.push(e); + } + } else if rules.min_length.is_some() || rules.max_length.is_some() { + if let Err(e) = validate_string_length(field, value, rules.min_length, rules.max_length) { + errors.push(e); + } + } + + if let Err(e) = validate_regex_pattern(field, value, &rules.regex_pattern) { + errors.push(e); + } + + if errors.is_empty() { + Ok(()) + } else { + Err(errors.join("; ")) + } +} From ec63a989aa25f8416bc33c68d457fc62519b0d81 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Gupta <143015358+AnkitKmrGupta@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:26:50 +0530 Subject: [PATCH 63/95] feat: implement redis caching layer for service_configuration (#207) --- src/redis/cache.rs | 133 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 106 insertions(+), 27 deletions(-) diff --git a/src/redis/cache.rs b/src/redis/cache.rs index 22932d06..2ef6d444 100644 --- a/src/redis/cache.rs +++ b/src/redis/cache.rs @@ -1,6 +1,7 @@ use super::mem_cache::GLOBAL_CACHE; use crate::app::get_tenant_app_state; use crate::logger; +use crate::redis::feature::RedisDataStruct; use crate::types::service_configuration; use crate::utils::StringExt; use serde::Deserialize; @@ -31,6 +32,40 @@ async fn set_to_memory_cache(prefixed_key: &str, value: &str, ttl_seconds: Optio } } +async fn get_from_redis_cache(prefixed_key: &str) -> Result { + let app_state = get_tenant_app_state().await; + match app_state.redis_conn.get_key_string(prefixed_key).await { + Ok(value) => Ok(value), + Err(e) => Err(format!("Redis cache get failed: {:?}", e)), + } +} + +async fn set_to_redis_cache(prefixed_key: &str, value: &str, ttl_seconds: i64) { + let app_state = get_tenant_app_state().await; + match app_state + .redis_conn + .setx( + prefixed_key, + value, + ttl_seconds, + None, + RedisDataStruct::STRING, + ) + .await + { + Ok(_) => {} + Err(e) => { + crate::logger::warn!( + tag = "redis_cache_write_failed", + action = "redis_cache_write_failed", + "Failed to write Redis cache for key: {}, error: {:?}", + prefixed_key, + e + ); + } + } +} + // // Converted data types // // Original Haskell data type: Multi // #[derive(Debug, Serialize, Deserialize, PartialEq)] @@ -88,48 +123,89 @@ where { let app_state = get_tenant_app_state().await; let prefixed_key = app_state.config.cache_config.add_prefix(&key); + let ttl_seconds = app_state.config.cache_config.service_config_ttl; + let ttl_seconds_u64 = Some(ttl_seconds as u64); match get_from_memory_cache(&prefixed_key).await { Ok(cache_value) => { logger::debug!( tag = "memory_cache", action = "hit", - "Cache hit for key: {}", + "Memory cache hit for key: {}", key ); - match decode_fn { + if cache_value.is_empty() { + return None; + } + return match &decode_fn { Some(func) => func(cache_value), None => extractValue(cache_value), - } + }; } Err(_) => { logger::debug!( tag = "memory_cache", action = "miss", - "Cache miss for key: {}, falling back to database", + "Memory cache miss for key: {}, checking Redis", + key + ); + } + } + + match get_from_redis_cache(&prefixed_key).await { + Ok(redis_value) => { + logger::debug!( + tag = "redis_cache", + action = "hit", + "Redis cache hit for key: {}", + key + ); + if redis_value.is_empty() { + set_to_memory_cache(&prefixed_key, "", ttl_seconds_u64).await; + return None; + } + + set_to_memory_cache(&prefixed_key, &redis_value, ttl_seconds_u64).await; + return match &decode_fn { + Some(func) => func(redis_value), + None => extractValue(redis_value), + }; + } + Err(_) => { + logger::debug!( + tag = "redis_cache", + action = "miss", + "Redis cache miss for key: {}, falling back to database", key ); + } + } - let res = service_configuration::find_config_by_name(key.clone()).await; - - match res { - Ok(Some(service_config)) => match service_config.value { - Some(value) => { - // Get TTL from global config - let ttl_seconds = - Some(app_state.config.cache_config.service_config_ttl as u64); - set_to_memory_cache(&prefixed_key, &value, ttl_seconds).await; - - match decode_fn { - Some(func) => func(value), - None => extractValue(value), - } - } - None => None, - }, - _ => None, + let res = service_configuration::find_config_by_name(key.clone()).await; + + match res { + Ok(Some(service_config)) => match service_config.value { + Some(value) => { + set_to_redis_cache(&prefixed_key, &value, ttl_seconds).await; + set_to_memory_cache(&prefixed_key, &value, ttl_seconds_u64).await; + + match decode_fn { + Some(func) => func(value), + None => extractValue(value), + } } + None => { + set_to_redis_cache(&prefixed_key, "", ttl_seconds).await; + set_to_memory_cache(&prefixed_key, "", ttl_seconds_u64).await; + None + } + }, + Ok(None) => { + set_to_redis_cache(&prefixed_key, "", ttl_seconds).await; + set_to_memory_cache(&prefixed_key, "", ttl_seconds_u64).await; + None } + Err(_) => None, } } @@ -147,14 +223,17 @@ where // Serialize the default value to JSON string match serde_json::to_string(&default_value) { Ok(default_json) => { - // Cache the default value in memory for future use + // Cache the default value for future use let app_state = get_tenant_app_state().await; let prefixed_key = app_state.config.cache_config.add_prefix(&key); - let ttl_seconds = Some(app_state.config.cache_config.service_config_ttl as u64); - set_to_memory_cache(&prefixed_key, &default_json, ttl_seconds).await; + let ttl_seconds = app_state.config.cache_config.service_config_ttl; + let ttl_seconds_u64 = Some(ttl_seconds as u64); + + set_to_redis_cache(&prefixed_key, &default_json, ttl_seconds).await; + set_to_memory_cache(&prefixed_key, &default_json, ttl_seconds_u64).await; logger::debug!( - tag = "memory_cache", + tag = "cache", action = "default_cached", "Cached default value for key: {}", key @@ -162,7 +241,7 @@ where } Err(e) => { logger::warn!( - tag = "memory_cache", + tag = "cache", action = "serialize_failed", "Failed to serialize default value for key: {}, error: {:?}", key, From ab295471e7c84e59c2298ff4ee3dc489444f3fff Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Mon, 9 Mar 2026 09:38:12 +0530 Subject: [PATCH 64/95] feat(euclid): add eligibility for connector selection (#209) --- config/development.toml | 683 ++++++++++++++++--- config/docker-configuration.toml | 88 --- src/app.rs | 40 ++ src/config.rs | 53 +- src/euclid.rs | 4 + src/euclid/cgraph.rs | 16 +- src/euclid/handlers/routing_rules.rs | 91 ++- src/euclid/pm_filter_graph.rs | 463 +++++++++++++ src/euclid/test.rs | 950 +++++++++++++++++++++++++++ src/euclid/types.rs | 17 - 10 files changed, 2174 insertions(+), 231 deletions(-) create mode 100644 src/euclid/pm_filter_graph.rs create mode 100644 src/euclid/test.rs diff --git a/config/development.toml b/config/development.toml index 3b7383b0..41e508f9 100644 --- a/config/development.toml +++ b/config/development.toml @@ -112,93 +112,6 @@ payment_payment_method = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } payment_payment_source = { type = "enum", values = "net.one97.paytm, @paytm" } txn_is_emi = { type = "enum", values = "true, false" } -[routing_config.default] -output = ["stripe", "adyen"] - -[[routing_config.constraint_graph.nodes]] -preds = [] -succs = [0] - -[routing_config.constraint_graph.nodes.kind] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data.data] -key = "payment_method" -comparison = "equal" - -[routing_config.constraint_graph.nodes.kind.data.data.value] -type = "enum_variant" -value = "card" - -[[routing_config.constraint_graph.nodes]] -preds = [] -succs = [1] - -[routing_config.constraint_graph.nodes.kind] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data.data] -key = "payment_method" -comparison = "equal" - -[routing_config.constraint_graph.nodes.kind.data.data.value] -type = "enum_variant" -value = "bank_debit" - -[[routing_config.constraint_graph.nodes]] -preds = [0] -succs = [] - -[routing_config.constraint_graph.nodes.kind] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data.data] -key = "output" -comparison = "equal" - -[routing_config.constraint_graph.nodes.kind.data.data.value] -type = "enum_variant" -value = "stripe" - -[[routing_config.constraint_graph.nodes]] -preds = [1] -succs = [] - -[routing_config.constraint_graph.nodes.kind] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data.data] -key = "output" -comparison = "equal" - -[routing_config.constraint_graph.nodes.kind.data.data.value] -type = "enum_variant" -value = "adyen" - -[[routing_config.constraint_graph.edges]] -strength = "strong" -relation = "positive" -pred = 0 -succ = 2 - -[[routing_config.constraint_graph.edges]] -strength = "strong" -relation = "positive" -pred = 1 -succ = 3 - [debit_routing_config] fraud_check_fee = 1.0 @@ -220,3 +133,599 @@ merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 4.0 } merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 21.3125 } merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 15.0 } merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 15.0 } + +[pm_filters.default] +google_pay = { country = "AL,DZ,AS,AO,AG,AR,AU,AT,AZ,BH,BY,BE,BR,BG,CA,CL,CO,HR,CZ,DK,DO,EG,EE,FI,FR,DE,GR,HK,HU,IN,ID,IE,IL,IT,JP,JO,KZ,KE,KW,LV,LB,LT,LU,MY,MX,NL,NZ,NO,OM,PK,PA,PE,PH,PL,PT,QA,RO,RU,SA,SG,SK,ZA,ES,LK,SE,CH,TW,TH,TR,UA,AE,GB,US,UY,VN" } +apple_pay = { country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US,KR,VN,MA,ZA,VA,CL,SV,GT,HN,PA", currency = "AED,AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" } +paypal = { currency = "AUD,BRL,CAD,CHF,CNY,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,MYR,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD" } +klarna = { country = "AT,BE,DK,FI,FR,DE,IE,IT,NL,NO,ES,SE,GB,US,CA", currency = "USD,GBP,EUR,CHF,DKK,SEK,NOK,AUD,PLN,CAD" } +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "US,CA,GB,AU,NZ", currency = "GBP,AUD,NZD,CAD,USD" } +giropay = { country = "DE", currency = "EUR" } +eps = { country = "AT", currency = "EUR" } +sofort = { country = "ES,GB,SE,AT,NL,DE,CH,BE,FR,FI,IT,PL", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } + +[pm_filters.stripe] +google_pay = { country = "AU, AT, BE, BR, BG, CA, HR, CZ, DK, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IT, JP, LV, KE, LT, LU, MY, MX, NL, NZ, NO, PL, PT, RO, SG, SK, ZA, ES, SE, CH, TH, AE, GB, US, GI, LI, MT, CY, PH, IS, AR, CL, KR, IL"} +apple_pay = { country = "AU, AT, BE, BR, BG, CA, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, HK, IE, IT, JP, LV, LI, LT, LU, MT, MY, MX, NL, NZ, NO, PL, PT, RO, SK, SG, SI, ZA, ES, SE, CH, GB, AE, US" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,CAD,CHF,CZK,DKK,EUR,GBP,NOK,NZD,PLN,SEK,USD" } +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ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"} +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "US,CA,GB,AU,NZ,FR,ES", currency = "USD,CAD,GBP,AUD,NZD" } +cashapp = { country = "US", currency = "USD" } +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +multibanco = { country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GI,GR,HU,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB", currency = "EUR" } +ach = { country = "US", currency = "USD" } +revolut_pay = { currency = "EUR,GBP" } +sepa = {country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GI,GR,HU,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB,IS,LI", currency="EUR"} +bacs = { country = "GB", currency = "GBP" } +becs = { country = "AU", currency = "AUD" } +sofort = {country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IS,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE", currency = "EUR" } +blik = {country="PL", currency = "PLN"} +bancontact_card = { country = "BE", currency = "EUR" } +przelewy24 = { country = "PL", currency = "EUR,PLN" } +online_banking_fpx = { country = "MY", currency = "MYR" } +amazon_pay = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW,US", currency = "USD,AUD,GBP,DKK,EUR,HKD,JPY,NZD,NOK,ZAR,SEK,CHF" } +we_chat_pay = { country = "CN", currency = "CNY,AUD,CAD,EUR,GBP,HKD,JPY,SGD,USD,DKK,NOK,SEK,CHF" } +ali_pay = {country = "CN", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,MYR,NZD,SGD,USD"} + +[pm_filters.volt] +open_banking = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "GBP,EUR,DKK,NOK,PLN,SEK" } +open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "GBP" } + +[pm_filters.razorpay] +upi_collect = { country = "IN", currency = "INR" } + +[pm_filters.phonepe] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } + +[pm_filters.paytm] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } + +[pm_filters.hyperpg] +credit = { currency = "INR,USD,GBP,EUR" } +debit = { currency = "INR,USD,GBP,EUR" } + +[pm_filters.plaid] +open_banking_pis = { currency = "EUR,GBP" } + +[pm_filters.adyen] +google_pay = { country = "AT, AU, BE, BG, CA, HR, CZ, EE, FI, FR, DE, GR, HK, DK, HU, IE, IT, LV, LT, LU, NL, NO, PL, PT, RO, SK, ES, SE, CH, GB, US, NZ, SG", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, GG, HU, IE, IM, IT, LV, LI, LT, LU, MT, NL, NO, PL, PT, RO, SK, SI, SE, ES, CH, GB, US, PR, CA, AU, HK, NZ, SG", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, CHF, UAH, ARS, BRL, CLP, COP, CRC, DOP, GTQ, HNL, MXN, PAB, USD, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, ILS, QAR, SAR, AED, CAD" } +paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" } +mobile_pay = { country = "DK,FI", currency = "DKK,SEK,NOK,EUR" } +ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" } +we_chat_pay = { country = "AU,NZ,CN,JP,HK,SG,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,LI,MT,SI,GR,PT,IT,CA,US", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,NZD,SGD,USD" } +mb_way = { country = "PT", currency = "EUR" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD" } +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "AU,NZ,ES,GB,FR,IT,CA,US", currency = "GBP" } +pay_bright = { country = "CA", currency = "CAD" } +walley = { country = "SE,NO,DK,FI", currency = "DKK,EUR,NOK,SEK" } +giropay = { country = "DE", currency = "EUR" } +eps = { country = "AT", currency = "EUR" } +sofort = { not_available_flows = { capture_method = "manual" }, country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR" } +ideal = { not_available_flows = { capture_method = "manual" }, country = "NL", currency = "EUR" } +blik = { country = "PL", currency = "PLN" } +trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +online_banking_czech_republic = { country = "CZ", currency = "EUR,CZK" } +online_banking_finland = { country = "FI", currency = "EUR" } +online_banking_poland = { country = "PL", currency = "PLN" } +online_banking_slovakia = { country = "SK", currency = "EUR,CZK" } +bancontact_card = { country = "BE", currency = "EUR" } +ach = { country = "US", currency = "USD" } +bacs = { country = "GB", currency = "GBP" } +sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR" } +ali_pay_hk = { country = "HK", currency = "HKD" } +bizum = { country = "ES", currency = "EUR" } +go_pay = { country = "ID", currency = "IDR" } +kakao_pay = { country = "KR", currency = "KRW" } +momo = { country = "VN", currency = "VND" } +gcash = { country = "PH", currency = "PHP" } +online_banking_fpx = { country = "MY", currency = "MYR" } +online_banking_thailand = { country = "TH", currency = "THB" } +touch_n_go = { country = "MY", currency = "MYR" } +atome = { country = "MY,SG", currency = "MYR,SGD" } +swish = { country = "SE", currency = "SEK" } +permata_bank_transfer = { country = "ID", currency = "IDR" } +bca_bank_transfer = { country = "ID", currency = "IDR" } +bni_va = { country = "ID", currency = "IDR" } +bri_va = { country = "ID", currency = "IDR" } +cimb_va = { country = "ID", currency = "IDR" } +danamon_va = { country = "ID", currency = "IDR" } +mandiri_va = { country = "ID", currency = "IDR" } +alfamart = { country = "ID", currency = "IDR" } +indomaret = { country = "ID", currency = "IDR" } +open_banking_uk = { country = "GB", currency = "GBP" } +oxxo = { country = "MX", currency = "MXN" } +pay_safe_card = { country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,AE,GB,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU" } +seven_eleven = { country = "JP", currency = "JPY" } +lawson = { country = "JP", currency = "JPY" } +mini_stop = { country = "JP", currency = "JPY" } +family_mart = { country = "JP", currency = "JPY" } +seicomart = { country = "JP", currency = "JPY" } +pay_easy = { country = "JP", currency = "JPY" } +pix = { country = "BR", currency = "BRL" } +boleto = { country = "BR", currency = "BRL" } + +[pm_filters.affirm] +affirm = { country = "CA,US", currency = "CAD,USD" } + +[pm_filters.airwallex] +credit = { country = "AU,HK,SG,NZ,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC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,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AZ, BH, BR, BG, CA, CL, CO, CZ, DK, DO, EG, HK, HU, ID, IL, JP, JO, KZ, KE, KW, LB, MY, MX, OM, PK, PA, PE, PH, PL, QA, RO, SA, SG, ZA, LK, SE, TW, TH, TR, UA, AE, UY, VN, AT, BE, HR, EE, FI, FR, DE, GR, IE, IT, LV, LT, LU, NL, PL, PT, SK, ES, SE, RO, BG", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +paypal = { currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,JPY,MYR,MXN,NOK,NZD,PHP,PLN,GBP,RUB,SGD,SEK,CHF,THB,USD" } +klarna = { currency = "EUR, DKK, NOK, PLN, SEK, CHF, GBP, USD, CZK" } +trustly = {currency="DKK, EUR, GBP, NOK, PLN, SEK" } +blik = { country="PL" , currency = "PLN" } +ideal = { country="NL" , currency = "EUR" } +atome = { country = "SG, MY" , currency = "SGD, MYR" } +skrill = { country="AL, DZ, AD, AR, AM, AW, AU, AT, AZ, BS, BD, BE, BJ, BO, BA, BW, BR, BN, BG, KH, CM, CA, CL, CN, CX, CO, CR , HR, CW, CY, CZ, DK, DM, DO, EC, EG, EE , FK, FI, GE, DE, GH, GI, GR, GP, GU, GT, GG, HK, HU, IS, IN, ID , IQ, IE, IM, IL, IT, JE , KZ, KE , KR, KW, KG, LV , LS, LI, LT, LU , MK, MG, MY, MV, MT, MU, YT, MX, MD, MC, MN, ME, MA, NA, NP, NZ, NI, NE, NO, PK , PA, PY, PE, PH, PL, PT, PR, QA, RO , SM , SA, SN , SG, SX, SK, SI, ZA, SS, ES, LK, SE, CH, TW, TZ, TH, TN, AE, GB, UM, UY, VN, VG, VI, US" , currency = "EUR, GBP, USD" } +indonesian_bank_transfer = { country="ID" , currency = "IDR" } + +[pm_filters.elavon] +credit = { country = "US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +debit = { country = "US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } + +[pm_filters.xendit] +credit = { country = "ID,PH", currency = "IDR,PHP,USD,SGD,MYR" } +debit = { country = "ID,PH", currency = "IDR,PHP,USD,SGD,MYR" } +qris = {currency = "IDR" } + +[pm_filters.tsys] +credit = { country = "NA", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL, BYN, KPW, STN, MRU, VES" } +debit = { country = "NA", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL, BYN, KPW, STN, MRU, VES" } + +[pm_filters.billwerk] +credit = { country = "DE, DK, FR, SE", currency = "DKK, NOK" } +debit = { country = "DE, DK, FR, SE", currency = "DKK, NOK" } + +[pm_filters.fiservemea] +credit = { country = "DE, FR, IT, NL, PL, ES, ZA, GB, AE", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF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,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } + +[pm_filters.getnet] +credit = { country = "AR, BR, CL, MX, UY, ES, PT, DE, IT, FR, NL, BE, AT, PL, CH, GB, IE, LU, DK, SE, NO, FI, IN, AE", currency = "ARS, BRL, CLP, MXN, UYU, EUR, PLN, CHF, GBP, DKK, SEK, NOK, INR, AED" } + +[pm_filters.hipay] +credit = { country = "GB, CH, SE, DK, NO, PL, CZ, US, CA, JP, HK, AU, ZA", currency = "EUR, GBP, CHF, SEK, DKK, NOK, PLN, CZK, USD, CAD, JPY, HKD, AUD, ZAR" } +debit = { country = "GB, CH, SE, DK, NO, PL, CZ, US, CA, JP, HK, AU, ZA", currency = "EUR, GBP, CHF, SEK, DKK, NOK, PLN, CZK, USD, CAD, JPY, HKD, AUD, ZAR" } + +[pm_filters.moneris] +credit = { country = "AE, AF, AL, AO, AR, AT, AU, AW, AZ, BA, BB, BD, BE, BG, BH, BI, BM, BN, BO, BR, BT, BY, BZ, CH, CL, CN, CO, CR, CU, CV, CY, CZ, DE, DJ, DK, DO, DZ, EE, EG, ES, FI, FJ, FR, GB, GE, GI, GM, GN, GR, GT, GY, HK, HN, HR, HT, HU, ID, IE, IL, IN, IS, IT, JM, JO, JP, KE, KM, KR, KW, KY, KZ, LA, LK, LR, LS, LV, LT, LU, MA, MD, MG, MK, MO, MR, MT, MU, MV, MW, MX, MY, MZ, NA, NG, NI, NL, NO, NP, NZ, OM, PE, PG, PK, PL, PT, PY, QA, RO, RS, RU, RW, SA, SB, SC, SE, SG, SH, SI, SK, SL, SR, SV, SZ, TH, TJ, TM, TN, TR, TT, TW, TZ, UG, US, UY, UZ, VN, VU, WS, ZA, ZM", currency = "AED, AFN, ALL, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BTN, BYN, BZD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GEL, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JOD, JPY, KES, KMF, KRW, KWD, KYD, KZT, LAK, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SRD, SVC, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VND, VUV, WST, XCD, XOF, XPF, ZAR, ZMW" } +debit = { country = "AE, AF, AL, AO, AR, AT, AU, AW, AZ, BA, BB, BD, BE, BG, BH, BI, BM, BN, BO, BR, BT, BY, BZ, CH, CL, CN, CO, CR, CU, CV, CY, CZ, DE, DJ, DK, DO, DZ, EE, EG, ES, FI, FJ, FR, GB, GE, GI, GM, GN, GR, GT, GY, HK, HN, HR, HT, HU, ID, IE, IL, IN, IS, IT, JM, JO, JP, KE, KM, KR, KW, KY, KZ, LA, LK, LR, LS, LV, LT, LU, MA, MD, MG, MK, MO, MR, MT, MU, MV, MW, MX, MY, MZ, NA, NG, NI, NL, NO, NP, NZ, OM, PE, PG, PK, PL, PT, PY, QA, RO, RS, RU, RW, SA, SB, SC, SE, SG, SH, SI, SK, SL, SR, SV, SZ, TH, TJ, TM, TN, TR, TT, TW, TZ, UG, US, UY, UZ, VN, VU, WS, ZA, ZM", currency = "AED, AFN, ALL, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BTN, BYN, BZD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GEL, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JOD, JPY, KES, KMF, KRW, KWD, KYD, KZT, LAK, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SRD, SVC, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VND, VUV, WST, XCD, XOF, XPF, ZAR, ZMW" } + +[pm_filters.opennode] +crypto_currency = { country = "US, CA, GB, AU, BR, MX, SG, PH, NZ, ZA, JP, AT, BE, HR, CY, EE, FI, FR, DE, GR, IE, IT, LV, LT, LU, MT, NL, PT, SK, SI, ES", currency = "USD, CAD, GBP, AUD, BRL, MXN, SGD, PHP, NZD, ZAR, JPY, EUR" } + +[pm_filters.bambora] +credit = { country = "US,CA", currency = "USD" } +debit = { country = "US,CA", currency = "USD" } + +[pm_filters.bankofamerica] +credit = { country = "AF,AL,DZ,AD,AO,AI,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BA,BW,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CO,KM,CD,CG,CK,CR,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KR,KW,KG,LA,LV,LB,LS,LR,LY,L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,AT,BH,BE,BR,BG,CA,CL,CN,CO,CR,HR,CY,CZ,DK,DO,EC,EE,SV,FI,FR,DE,GR,GT,HN,HK,HU,IS,IN,IE,IL,IT,JP,JO,KZ,KW,LV,LI,LT,LU,MY,MT,MX,MC,ME,NL,NZ,NO,OM,PA,PY,PE,PL,PT,QA,RO,SA,SG,SK,SI,ZA,KR,ES,SE,CH,TW,AE,GB,US,UY,VN,VA", currency = "USD" } +google_pay = { country = "AU,AT,BE,BR,CA,CL,CO,CR,CY,CZ,DK,DO,EC,EE,SV,FI,FR,DE,GR,GT,HN,HK,HU,IS,IN,IE,IL,IT,JP,JO,KZ,KW,LV,LI,LT,LU,MY,MT,MX,NL,NZ,NO,OM,PA,PY,PE,PL,PT,QA,RO,SA,SG,SK,SI,ZA,KR,ES,SE,CH,TW,AE,GB,US,UY,VN,VA", currency = "USD" } +samsung_pay = { country = "AU,BH,BR,CA,CN,DK,FI,FR,DE,HK,IN,IT,JP,KZ,KR,KW,MY,NZ,NO,OM,QA,SA,SG,ZA,ES,SE,CH,TW,AE,GB,US", currency = "USD" } + +[pm_filters.cybersource] +credit = { currency = "USD,GBP,EUR,PLN,SEK,XOF,CAD,KWD,QAR" } +debit = { currency = "USD,GBP,EUR,PLN,SEK,XOF,CAD,KWD,QAR" } +apple_pay = { currency = "ARS, CAD, CLP, COP, CNY, EUR, HKD, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, GBP, AED, USD, PLN, SEK" } +google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" } +samsung_pay = { currency = "USD,GBP,EUR,SEK" } +paze = { currency = "USD,SEK" } + +[pm_filters.barclaycard] +credit = { currency = "USD,GBP,EUR,PLN,SEK" } +debit = { currency = "USD,GBP,EUR,PLN,SEK" } +google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" } +apple_pay = { currency = "ARS, CAD, CLP, COP, CNY, EUR, HKD, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, GBP, AED, USD, PLN, SEK" } + + +[pm_filters.globepay] +ali_pay = { country = "GB",currency = "GBP,CNY" } +we_chat_pay = { country = "GB",currency = "GBP,CNY" } + + +[pm_filters.itaubank] +pix = { country = "BR", currency = "BRL" } + +[pm_filters.nexinets] +credit = { country = "DE",currency = "EUR" } +debit = { country = "DE",currency = "EUR" } +ideal = { country = "DE",currency = "EUR" } +giropay = { country = "DE",currency = "EUR" } +sofort = { country = "DE",currency = "EUR" } +eps = { country = "DE",currency = "EUR" } +apple_pay = { country = "DE",currency = "EUR" } +paypal = { country = "DE",currency = "EUR" } + + +[pm_filters.nuvei] +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE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,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } +afterpay_clearpay = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } +giropay = { currency = "EUR" } +ideal = { currency = "EUR" } +sofort = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } +eps = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL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CL, CO, HR, DK, DO, EE, EG, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, SA, SG, SK, ZA, ES, LK, SE, CH, TH, TW, TR, UA, AE, US, UY, VN", currency = "AED, ALL, AOA, AUD, AZN, BGN, BHD, BRL, CAD, CHF, CLP, COP, CZK, DKK, DOP, DZD, EGP, EUR, GBP, HKD, HUF, IDR, ILS, INR, JPY, KES, KWD, KZT, LKR, MXN, MYR, NOK, NZD, OMR, PAB, PEN, PHP, PKR, PLN, QAR, RON, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, UYU, VND, XCD, ZAR" } +apple_pay = { country = "AM,US, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" } + +[pm_filters.checkbook] +ach = { country = "US", currency = "USD" } + +[pm_filters.nexixpay] +credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU,AU,B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S,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW" } +debit = { country = "AU,CA,FR,IE,JP,ES,GB,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW" } + +[pm_filters.iatapay] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } +ideal = { country = "NL", currency = "EUR" } +local_bank_redirect = { country = "AT,BE,EE,FI,FR,DE,IE,IT,LV,LT,LU,NL,PT,ES,GB,IN,HK,SG,TH,BR,MX,GH,VN,MY,PH,JO,AU,CO", currency = "EUR,GBP,INR,HKD,SGD,THB,BRL,MXN,GHS,VND,MYR,PHP,JOD,AUD,COP" } +duit_now = { country = "MY", currency = "MYR" } +fps = { country = "GB", currency = "GBP" } +prompt_pay = { country = "TH", currency = "THB" } +viet_qr = { country = "VN", currency = "VND" } + +[pm_filters.coinbase] +crypto_currency = { country = "ZA,US,BR,CA,TR,SG,VN,GB,DE,FR,ES,PT,IT,NL,AU" } + +[pm_filters.novalnet] +credit = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,CL,CN,CO,CR,CU,CY,CZ,DE,DJ,DK,DO,DZ,EE,EG,ET,ES,FI,FJ,FR,GB,GE,GH,GI,GM,GR,GT,GY,HK,HN,HR,HU,ID,IE,IL,IN,IS,IT,JM,JO,JP,KE,KH,KR,KW,KY,KZ,LB,LK,LT,LV,LY,MA,MC,MD,ME,MG,MK,MN,MO,MT,MV,MW,MX,MY,NG,NI,NO,NP,NL,NZ,OM,PA,PE,PG,PH,PK,PL,PT,PY,QA,RO,RS,RU,RW,SA,SB,SC,SE,SG,SH,SI,SK,SL,SO,SM,SR,ST,SV,SY,TH,TJ,TN,TO,TR,TW,TZ,UA,UG,US,UY,UZ,VE,VA,VN,VU,WS,CF,AG,DM,GD,KN,LC,VC,YE,ZA,ZM", currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,GBP,GEL,GHS,GIP,GMD,GTQ,GYD,HKD,HNL,HRK,HUF,IDR,ILS,INR,ISK,JMD,JOD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,LYD,MAD,MDL,MGA,MKD,MNT,MOP,MVR,MWK,MXN,MYR,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STN,SVC,S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VUV,WST,XAF,XCD,YER,ZAR,ZMW" } +apple_pay = { country = "EG, MA, ZA, CN, HK, JP, MY, MN, SG, KR, VN, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, GE, DE, GR, GL, HU, IS, IE, IT, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, CA, US, BH, IL, JO, KW, OM, QA, SA, AE, AR, BR, CL, CO, CR, SV, GT, MX, PY, PE, UY, BS, DO, AM, KZ, NZ", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, AZN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } +google_pay = { country = "AO, EG, KE, ZA, AR, BR, CL, CO, MX, PE, UY, AG, DO, AE, TR, SA, QA, OM, LB, KW, JO, IL, BH, KZ, VN, TH, SG, MY, JP, HK, LK, IN, US, CA, GB, UA, CH, SE, ES, SK, PT, RO, PL, NO, NL, LU, LT, LV, IE, IT, HU, GR, DE, FR, FI, EE, DK, CZ, HR, BG, BE, AT, AL", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +paypal = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,C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,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"} +google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" } +apple_pay = { currency = "USD, CAD" } + +[pm_filters.helcim] +credit = { country = "US, CA", currency = "USD, CAD" } +debit = { country = "US, CA", currency = "USD, CAD" } + +[pm_filters.globalpay] +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,B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,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "AFN,DZD,ARS,AMD,AWG,AUD,AZN,BSD,BHD,THB,PAB,BBD,BYN,BZD,BMD,BOB,BRL,BND,BGN,BIF,CVE,CAD,CLP,COP,KMF,CDF,NIO,CRC,CUP,CZK,GMD,DKK,MKD,DJF,DOP,VND,XCD,EGP,SVC,ETB,EUR,FKP,FJD,HUF,GHS,GIP,HTG,PYG,GNF,GYD,HKD,UAH,ISK,INR,IRR,IQD,JMD,JOD,KES,PGK,HRK,KWD,AOA,MMK,LAK,GEL,LBP,ALL,HNL,SLL,LRD,LYD,SZL,LSL,MGA,MWK,MYR,MUR,MXN,MDL,MAD,MZN,NGN,ERN,NAD,NPR,ANG,ILS,TWD,NZD,BTN,KPW,NOK,TOP,PKR,MOP,UYU,PHP,GBP,BWP,QAR,GTQ,ZAR,OMR,KHR,RON,MVR,IDR,RUB,RWF,SHP,SAR,RSD,SCR,SGD,PEN,SBD,KGS,SOS,TJS,SSP,LKR,SDG,SRD,SEK,CHF,SYP,BDT,WST,TZS,KZT,TTD,MNT,TND,TRY,TMT,AED,UGX,USD,UZS,VUV,KRW,YER,JPY,CNY,ZMW,ZWL,PLN,CLF,STD,CUC" } +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +sofort = { country = "AT,BE,DE,ES,IT,NL", currency = "EUR" } + +[pm_filters.jpmorgan] +debit = { country = "CA, GB, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, EUR, GBP, AUD, NZD, SGD, CAD, JPY, HKD, KRW, TWD, MXN, BRL, DKK, NOK, ZAR, SEK, CHF, CZK, PLN, TRY, AFN, ALL, DZD, AOA, ARS, AMD, AWG, AZN, BSD, BDT, BBD, BYN, BZD, BMD, BOB, BAM, BWP, BND, BGN, BIF, BTN, XOF, XAF, XPF, KHR, CVE, KYD, CLP, CNY, COP, KMF, CDF, CRC, HRK, DJF, DOP, XCD, EGP, ETB, FKP, FJD, GMD, GEL, GHS, GIP, GTQ, GYD, HTG, HNL, HUF, ISK, INR, IDR, ILS, JMD, KZT, KES, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRU, MUR, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, PGK, NIO, NGN, PKR, PAB, PYG, PEN, PHP, QAR, RON, RWF, SHP, WST, STN, SAR, RSD, SCR, SLL, SBD, SOS, LKR, SRD, SZL, TJS, TZS, THB, TOP, TTD, UGX, UAH, AED, UYU, UZS, VUV, VND, YER, ZMW" } +credit = { country = "CA, GB, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, EUR, GBP, AUD, NZD, SGD, CAD, JPY, HKD, KRW, TWD, MXN, BRL, DKK, NOK, ZAR, SEK, CHF, CZK, PLN, TRY, AFN, ALL, DZD, AOA, ARS, AMD, AWG, AZN, BSD, BDT, BBD, BYN, BZD, BMD, BOB, BAM, BWP, BND, BGN, BIF, BTN, XOF, XAF, XPF, KHR, CVE, KYD, CLP, CNY, COP, KMF, CDF, CRC, HRK, DJF, DOP, XCD, EGP, ETB, FKP, FJD, GMD, GEL, GHS, GIP, GTQ, GYD, HTG, HNL, HUF, ISK, INR, IDR, ILS, JMD, KZT, KES, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRU, MUR, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, PGK, NIO, NGN, PKR, PAB, PYG, PEN, PHP, QAR, RON, RWF, SHP, WST, STN, SAR, RSD, SCR, SLL, SBD, SOS, LKR, SRD, SZL, TJS, TZS, THB, TOP, TTD, UGX, UAH, AED, UYU, UZS, VUV, VND, YER, ZMW" } + +[pm_filters.bitpay] +crypto_currency = { country = "US, CA, GB, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, AUD, CAD, GBP, MXN, NZD, CHF, EUR"} + +[pm_filters.paybox] +debit = { country = "FR", currency = "CAD, AUD, EUR, USD" } +credit = { country = "FR", currency = "CAD, AUD, EUR, USD" } + +[pm_filters.payload] +debit = { currency = "USD,CAD" } +credit = { currency = "USD,CAD" } +ach = { currency = "USD,CAD" } + + +[pm_filters.digitalvirgo] +direct_carrier_billing = {country = "MA, CM, ZA, EG, SN, DZ, TN, ML, GN, GH, LY, GA, CG, MG, BW, SD, NG, ID, SG, AZ, TR, FR, ES, PL, GB, PT, DE, IT, BE, IE, SK, GR, NL, CH, BR, MX, AR, CL, AE, IQ, KW, BH, SA, QA, PS, JO, OM, RU" , currency = "MAD, XOF, XAF, ZAR, EGP, DZD, TND, GNF, GHS, LYD, XAF, CDF, MGA, BWP, SDG, NGN, IDR, SGD, RUB, AZN, TRY, EUR, PLN, GBP, CHF, BRL, MXN, ARS, CLP, AED, IQD, KWD, BHD, SAR, QAR, ILS, JOD, OMR" } + +[pm_filters.payu] +debit = { country = "AE, AF, AL, AM, CW, AO, AR, AU, AW, AZ, BA, BB, BG, BH, BI, BM, BN, BO, BR, BS, BW, BY, BZ, CA, CD, LI, CL, CN, CO, CR, CV, CZ, DJ, DK, DO, DZ, EG, ET, AD, FJ, FK, GG, GE, GH, GI, GM, GN, GT, GY, HK, HN, HR, HT, HU, ID, IL, IQ, IS, JM, JO, JP, KG, KH, KM, KR, KW, KY, KZ, LA, LB, LR, LS, MA, MD, MG, MK, MN, MO, MR, MV, MW, MX, MY, MZ, NA, NG, NI, BV, CK, OM, PA, PE, PG, PL, PY, QA, RO, RS, RW, SA, SB, SC, SE, SG, SH, SO, SR, SV, SZ, TH, TJ, TM, TN, TO, TR, TT, TW, TZ, UG, AS, UY, UZ, VE, VN, VU, WS, CM, AI, BJ, PF, YE, ZA, ZM, ZW", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IQD, ISK, JMD, JOD, JPY, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LRD, LSL, MAD, MDL, MGA, MKD, MNT, MOP, MRU, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NZD, OMR, PAB, PEN, PGK, PLN, PYG, QAR, RON, RSD, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SOS, SRD, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +credit = { country = "AE, AF, AL, AM, CW, AO, AR, AU, AW, AZ, BA, BB, BG, BH, BI, BM, BN, BO, BR, BS, BW, BY, BZ, CA, CD, LI, CL, CN, CO, CR, CV, CZ, DJ, DK, DO, DZ, EG, ET, AD, FJ, FK, GG, GE, GH, GI, GM, GN, GT, GY, HK, HN, HR, HT, HU, ID, IL, IQ, IS, JM, JO, JP, KG, KH, KM, KR, KW, KY, KZ, LA, LB, LR, LS, MA, MD, MG, MK, MN, MO, MR, MV, MW, MX, MY, MZ, NA, NG, NI, BV, CK, OM, PA, PE, PG, PL, PY, QA, RO, RS, RW, SA, SB, SC, SE, SG, SH, SO, SR, SV, SZ, TH, TJ, TM, TN, TO, TR, TT, TW, TZ, UG, AS, UY, UZ, VE, VN, VU, WS, CM, AI, BJ, PF, YE, ZA, ZM, ZW", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IQD, ISK, JMD, JOD, JPY, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LRD, LSL, MAD, MDL, MGA, MKD, MNT, MOP, MRU, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NZD, OMR, PAB, PEN, PGK, PLN, PYG, QAR, RON, RSD, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SOS, SRD, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +google_pay = { country = "AL, DZ, AS, AO, AR, AU, AZ, BH, BY, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, HK, HU, ID, IN, IL, JP, JO, KZ, KW, LB, MY, MX, OM, PA, PE, PL, QA, RO, SA, SG, SE, TW, TH, TR, AE, UY, VN", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PAB, PEN, PLN, QAR, RON, SAR, SGD, ZAR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } + +[pm_filters.klarna] +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,EUR,EUR,CAD,CZK,DKK,EUR,EUR,EUR,EUR,EUR,EUR,EUR,NZD,NOK,PLN,EUR,EUR,SEK,CHF,GBP,USD" } + +[pm_filters.flexiti] +flexiti = { country = "CA", currency = "CAD" } + +[pm_filters.mifinity] +mifinity = { country = "BR,CN,SG,MY,DE,CH,DK,GB,ES,AD,GI,FI,FR,GR,HR,IT,JP,MX,AR,CO,CL,PE,VE,UY,PY,BO,EC,GT,HN,SV,NI,CR,PA,DO,CU,PR,NL,NO,PL,PT,SE,RU,TR,TW,HK,MO,AX,AL,DZ,AS,AO,AI,AG,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BE,BZ,BJ,BM,BT,BQ,BA,BW,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CX,CC,KM,CG,CK,CI,CW,CY,CZ,DJ,DM,EG,GQ,ER,EE,ET,FK,FO,FJ,GF,PF,TF,GA,GM,GE,GH,GL,GD,GP,GU,GG,GN,GW,GY,HT,HM,VA,IS,IN,ID,IE,IM,IL,JE,JO,KZ,KE,KI,KW,KG,LA,LV,LB,LS,LI,LT,LU,MK,MG,MW,MV,ML,MT,MH,MQ,MR,MU,YT,FM,MD,MC,MN,ME,MS,MA,MZ,NA,NR,NP,NC,NZ,NE,NG,NU,NF,MP,OM,PK,PW,PS,PG,PH,PN,QA,RE,RO,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SX,SK,SI,SB,SO,ZA,GS,KR,LK,SR,SJ,SZ,TH,TL,TG,TK,TO,TT,TN,TM,TC,TV,UG,UA,AE,UZ,VU,VN,VG,VI,WF,EH,ZM", currency = "AUD,CAD,CHF,CNY,CZK,DKK,EUR,GBP,INR,JPY,NOK,NZD,PLN,RUB,SEK,ZAR,USD,EGP,UYU,UZS" } + +[pm_filters.zen] +credit = { not_available_flows = { capture_method = "manual" } } +debit = { not_available_flows = { capture_method = "manual" } } +boleto = { country = "BR", currency = "BRL" } +efecty = { country = "CO", currency = "COP" } +multibanco = { country = "PT", currency = "EUR" } +pago_efectivo = { country = "PE", currency = "PEN" } +pse = { country = "CO", currency = "COP" } +pix = { country = "BR", currency = "BRL" } +red_compra = { country = "CL", currency = "CLP" } +red_pagos = { country = "UY", currency = "UYU" } + +[pm_filters.zsl] +local_bank_transfer = { country = "CN", currency = "CNY" } + +[pm_filters.aci] +credit = { country = "AD,AE,AT,BE,BG,CH,CN,CO,CR,CY,CZ,DE,DK,DO,EE,EG,ES,ET,FI,FR,GB,GH,GI,GR,GT,HN,HK,HR,HU,ID,IE,IS,IT,JP,KH,LA,LI,LT,LU,LY,MK,MM,MX,MY,MZ,NG,NZ,OM,PA,PE,PK,PL,PT,QA,RO,SA,SN,SE,SI,SK,SV,TH,UA,US,UY,VN,ZM", currency = "AED,ALL,ARS,BGN,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,EGP,EUR,GBP,GHS,HKD,HNL,HRK,HUF,IDR,ILS,ISK,JPY,KHR,KPW,LAK,LKR,MAD,MKD,MMK,MXN,MYR,MZN,NGN,NOK,NZD,OMR,PAB,PEN,PHP,PKR,PLN,QAR,RON,RSD,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,UYU,VND,ZAR,ZMW" } +debit = { country = "AD,AE,AT,BE,BG,CH,CN,CO,CR,CY,CZ,DE,DK,DO,EE,EG,ES,ET,FI,FR,GB,GH,GI,GR,GT,HN,HK,HR,HU,ID,IE,IS,IT,JP,KH,LA,LI,LT,LU,LY,MK,MM,MX,MY,MZ,NG,NZ,OM,PA,PE,PK,PL,PT,QA,RO,SA,SN,SE,SI,SK,SV,TH,UA,US,UY,VN,ZM", currency = "AED,ALL,ARS,BGN,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,EGP,EUR,GBP,GHS,HKD,HNL,HRK,HUF,IDR,ILS,ISK,JPY,KHR,KPW,LAK,LKR,MAD,MKD,MMK,MXN,MYR,MZN,NGN,NOK,NZD,OMR,PAB,PEN,PHP,PKR,PLN,QAR,RON,RSD,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,UYU,VND,ZAR,ZMW" } +mb_way = { country = "EE,ES,PT", currency = "EUR" } +ali_pay = { country = "CN", currency = "CNY" } +eps = { country = "AT", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +sofort = { country = "AT,BE,CH,DE,ES,GB,IT,NL,PL", currency = "CHF,EUR,GBP,HUF,PLN"} +interac = { country = "CA", currency = "CAD,USD"} +przelewy24 = { country = "PL", currency = "CZK,EUR,GBP,PLN" } +trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" } + +[pm_filters.gigadat] +interac = { currency = "CAD"} + +[pm_filters.loonio] +interac = { currency = "CAD"} + +[pm_filters.dlocal] +oxxo = { currency = "MXN" } + +[pm_filters.mollie] +eps = { country = "AT", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +przelewy24 = { country = "PL", currency = "PLN,EUR" } +klarna = { country = "DE,AT,NL,BE,FR,GB,IT,ES,PT,SE,DK,FI,NO,CH,IR,CZ,PL,GR,SK", currency = "EUR,GBP,DKK,SEK,NOK,CHF,PLN,CZK" } + +[pm_filters.redsys] +credit = { currency = "AUD,BGN,CAD,CHF,COP,CZK,DKK,EUR,GBP,HRK,HUF,ILS,INR,JPY,MYR,NOK,NZD,PEN,PLN,RUB,SAR,SEK,SGD,THB,USD,ZAR", country="ES" } +debit = { currency = "AUD,BGN,CAD,CHF,COP,CZK,DKK,EUR,GBP,HRK,HUF,ILS,INR,JPY,MYR,NOK,NZD,PEN,PLN,RUB,SAR,SEK,SGD,THB,USD,ZAR", country="ES" } + +[pm_filters.stax] +credit = { country = "US", currency = "USD" } +debit = { country = "US", currency = "USD" } +ach = { country = "US", currency = "USD" } + +[pm_filters.prophetpay] +card_redirect = { country = "US", currency = "USD"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D,HRK,HUF,JPY,MXN,MYR,NOK,NZD,PHP,PLN,RUB,SEK,SGD,THB,TRY,TWD,USD" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +klarna = { country = "AT,BE,DK,FI,FR,DE,IT,NL,NO,PT,ES,SE,GB", currency = "DKK,EUR,GBP,NOK,SEK" } +trustly = { country = "AT,CZ,DK,EE,FI,DE,LV,LT,NL,NO,PL,PT,ES,SE,GB" , currency = "EUR,GBP,SEK"} +ali_pay = { currency = "EUR,USD" } +we_chat_pay = { currency = "EUR"} +eps = { country = "AT" , currency = "EUR" } +mb_way = { country = "PT" , currency = "EUR" } +sofort = { country = "AT,BE,FR,DE,IT,PL,ES,CH,GB" , currency = "EUR"} + +[pm_filters.cashtocode] +classic = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,S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,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,US,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +google_pay = { country = "US", currency = "USD" } +apple_pay = { country = "US", currency = "USD" } +ach = { country = "US", currency = "USD" } + +[pm_filters.trustpay] +credit = { not_available_flows = { capture_method = "manual" } } +debit = { not_available_flows = { capture_method = "manual" } } +instant_bank_transfer = { country = "CZ,SK,GB,AT,DE,IT", currency = "CZK, EUR, GBP" } +instant_bank_transfer_poland = { country = "PL", currency = "PLN" } +instant_bank_transfer_finland = { country = "FI", currency = "EUR" } +sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,GB", currency = "EUR" } + +[pm_filters.tesouro] +credit = { country = "AF,AL,DZ,AD,AO,AI,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BA,BW,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CO,KM,CD,CG,CK,CR,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MG,MW,MY,MV,ML,MT,MH,MR,MU,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PL,PT,PR,QA,CG,RO,RW,KN,LC,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SO,ZA,GS,ES,LK,SR,SJ,SZ,SE,CH,TW,TJ,TZ,TH,TL,TG,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UY,UZ,VU,VE,VN,VG,WF,YE,ZM,ZW", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE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N,RS,SC,SL,SG,SX,SK,SI,SO,ZA,GS,ES,LK,SR,SJ,SZ,SE,CH,TW,TJ,TZ,TH,TL,TG,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UY,UZ,VU,VE,VN,VG,WF,YE,ZM,ZW", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +apple_pay = { currency = "USD" } +google_pay = { currency = "USD" } + +[pm_filters.authorizedotnet] +credit = {currency = "CAD,USD"} +debit = {currency = "CAD,USD"} +google_pay = {currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"} +apple_pay = {currency = "EUR,GBP,ISK,USD,AUD,CAD,BRL,CLP,COP,CRC,CZK,DKK,EGP,GEL,GHS,GTQ,HNL,HKD,HUF,ILS,INR,JPY,KZT,KRW,KWD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KR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" } +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "DZD, AOA, USD, XCD, ARS, AUD, AZN, EUR, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "EG, MA, ZA, AU, CN, HK, JP, MO, MY, MN, NZ, SG, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, CZ, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IE, IS, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US, PR", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, EUR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D,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" } + +[pm_filters.worldpaymodular] +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "DZD, AOA, USD, XCD, ARS, AUD, AZN, EUR, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "EG, MA, ZA, AU, CN, HK, JP, MO, MY, MN, NZ, SG, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, CZ, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IE, IS, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US, PR", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } + +[pm_filters.calida] +bluecode = { country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,SK,SI,ES,SE,IS,LI,NO", currency = "EUR" } + +[file_upload_config] +bucket_name = "" +region = "" + +[pm_filters.forte] +credit = { country = "US, CA", currency = "CAD,USD"} +debit = { country = "US, CA", currency = "CAD,USD"} + +[pm_filters.nordea] +sepa = { country = "DK,FI,NO,SE", currency = "DKK,EUR,NOK,SEK" } + +[pm_filters.fiuu] +duit_now = { country = "MY", currency = "MYR" } +apple_pay = { country = "MY", currency = "MYR" } +google_pay = { country = "MY", currency = "MYR" } +online_banking_fpx = { country = "MY", currency = "MYR" } +credit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PHP,SGD,THB,TWD,VND" } +debit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PHP,SGD,THB,TWD,VND" } + +[pm_filters.inespay] +sepa = { country = "ES", currency = "EUR"} + +[pm_filters.bluesnap] +credit = { country = "AD,AE,AG,AL,AM,AO,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BJ,BN,BO,BR,BS,BT,BW,BY,BZ,CA,CD,CF,CG,CH,CI,CL,CM,CN,CO,CR,CV,CY,CZ,DE,DK,DJ,DM,DO,DZ,EC,EE,EG,ER,ES,ET,FI,FJ,FM,FR,GA,GB,GD,GE,GG,GH,GM,GN,GQ,GR,GT,GW,GY,HN,HR,HT,HU,ID,IE,IL,IN,IS,IT,JM,JP,JO,KE,KG,KH,KI,KM,KN,KR,KW,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,MA,MC,MD,ME,MG,MH,MK,ML,MM,MN,MR,MT,MU,MV,MW,MX,MY,MZ,NA,NE,NG,NI,NL,NO,NP,NR,NZ,OM,PA,PE,PG,PH,PK,PL,PS,PT,PW,PY,QA,RO,RS,RW,SA,SB,SC,SE,SG,SI,SK,SL,SM,SN,SO,SR,SS,ST,SV,SZ,TD,TG,TH,TJ,TL,TM,TN,TO,TR,TT,TV,TZ,UA,UG,US,UY,UZ,VA,VC,VE,VN,VU,WS,ZA,ZM,ZW", currency = "AED,AFN,ALL,AMD,ANG,ARS,AUD,AWG,BAM,BBD,BGN,BHD,BMD,BND,BOB,BRL,BSD,BWP,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,FJD,GBP,GEL,GIP,GTQ,HKD,HUF,IDR,ILS,INR,ISK,JMD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MUR,MWK,MXN,MYR,NAD,NGN,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PLN,PKR,QAR,RON,RSD,RUB,SAR,SCR,SDG,SEK,SGD,THB,TND,TRY,TTD,TWD,TZS,UAH,USD,UYU,UZS,VND,XAF,XCD,XOF,ZAR"} +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND"} +apple_pay = { country = "EG, MA, ZA, AU, HK, JP, MO, MY, MN, NZ, SG, KR, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT , KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, UY, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MYR, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, GBP, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, MXN, PAB, PEN, BSD, UYU, BHD, ILS, KWD, OMR, QAR, SAR, AED, CAD"} + +[pm_filters.fiserv] +credit = {country = "AU,NZ,CN,HK,IN,LK,KR,MY,SG,GB,BE,FR,DE,IT,ME,NL,PL,ES,ZA,AR,BR,CO,MX,PA,UY,US,CA", currency = "AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BYN,BZD,BMD,BTN,BOB,VES,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XAF,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,CZK,DKK,DJF,DOP,XCD,EGP,ERN,ETB,EUR,FKP,FJD,XPF,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KGS,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,NZD,NIO,NGN,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U, BE, BR, CA, CN, DE, ES, FR, GB, HK, IN, IT, JP, MY, NL, NZ, PH, PL, SG, US" } +google_pay = { country = "AU,AT,BE,BR,CA,CN,HK,MY,NZ,SG,US", currency = "AUD,EUR,EUR,BRL,CAD,CNY,HKD,MYR,NZD,SGD,USD" } +apple_pay = { country = "AU,NZ,CN,HK,JP,SG,MY,KR,TW,VN,GB,IE,FR,DE,IT,ES,PT,NL,BE,LU,AT,CH,SE,FI,DK,NO,PL,CZ,SK,HU,LT,LV,EE,GR,RO,BG,HR,SI,MT,CY,IS,LI,MC,SM,VA,US,CA,MX,BR,AR,CL,CO,PE,UY,CR,PA,DO,EC,SV,GT,HN,BS,PR,AE,SA,QA,KW,BH,OM,IL,JO,PS,EG,MA,ZA,GE,AM,AZ,MD,ME,MK,AL,BA,RS,UA", currency = "AUD,BRL,CAD,CHF,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD" } + + +[pm_filters.amazonpay] +amazon_pay = { country = "US", currency = "USD" } + +[pm_filters.rapyd] +apple_pay = { country = "BR, CA, CL, CO, DO, SV, MX, PE, PT, US, AT, BE, BG, HR, CY, CZ, DO, DK, EE, FI, FR, GE, DE, GR, GL, HU, IS, IE, IL, IT, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, RO, SM, SK, SI, ZA, ES, SE, CH, GB, VA, AU, HK, JP, MY, NZ, SG, KR, TW, VN", currency = "AMD, AUD, BGN, BRL, BYN, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DOP, EUR, GBP, GEL, GTQ, HUF, ISK, JPY, KRW, MDL, MXN, MYR, NOK, PAB, PEN, PLN, PYG, RON, RSD, SEK, SGD, TWD, UAH, USD, UYU, VND, ZAR" } +google_pay = { country = "BR, CA, CL, CO, DO, MX, PE, PT, US, AT, BE, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IL, IT, LV, LT, LU, NZ, NO, GB, PL, R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,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } + +[pm_filters.shift4] +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +sofort = { country = "AT,BE,CH,DE,ES,FI,FR,GB,IT,NL,PL,SE", currency = "CHF,EUR" } +credit = { country = "AD,AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GT,GU,GW,GY,HK,HM,HN,HR,HT,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GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +boleto = { country = "BR", currency = "BRL" } +trustly = { currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +ali_pay = { country = "CN", currency = "CNY" } +we_chat_pay = { country = "CN", currency = "CNY" } +klarna = { currency = "EUR,GBP,CHF,SEK" } +blik = { country = "PL", currency = "PLN" } +crypto_currency = { currency = "USD,GBP,AED" } +paysera = { currency = "EUR" } +skrill = { currency = "USD" } + +[pm_filters.placetopay] +credit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"} +debit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"} + +[pm_filters.coingate] +crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" } + +[pm_filters.paystack] +eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" } + +[pm_filters.santander] +pix = { country = "BR", currency = "BRL" } +boleto = { country = "BR", currency = "BRL" } + +[pm_filters.boku] +dana = { country = "ID", currency = "IDR" } +gcash = { country = "PH", currency = "PHP" } +go_pay = { country = "ID", currency = "IDR" } +kakao_pay = { country = "KR", currency = "KRW" } +momo = { country = "VN", currency = "VND" } + +[pm_filters.nmi] +credit = { country = "EG,ZA,BH,CY,HK,IN,ID,IL,JP,JO,KW,MY,PK,PH,SA,SG,KR,TW,TH,TR,AE,VN,AL,AD,AM,AT,AZ,BY,BE,BA,BG,HR,CZ,DK,EE,FI,FR,GE,DE,GR,HU,IS,IE,IT,KZ,LV,LI,LT,LU,MT,MD,MC,ME,NL,MK,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,TR,GB,VA,AG,BS,BB,BZ,CA,SV,GT,HN,MX,PA,KN,LC,TT,US,AU,NZ,AR,BO,BR,CL,CO,EC,GY,PY,PE,SR,UY,VE", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,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MH,FM,MN,NR,NP,NC,NZ,NU,NF,OM,PW,PG,PH,PN,QA,WS,SA,SG,SB,KR,LK,TW,TJ,TH,TO,TM,TV,AE,VU,VN,WF,YE,AL,AD,AT,AZ,BY,BE,BA,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,HU,IS,IE,IT,LV,LI,LT,LU,MK,MT,MD,MC,ME,NL,NO,PL,PT,RO,RU,SM,RS,SK,SI,ES,SJ,SE,CH,UA,GB,VA", currency = "AUD,BRL,CAD,CNY,CZK,DKK,EUR,HKD,HUF,ILS,JPY,MYR,MXN,TWD,NZD,NOK,PHP,PLN,GBP,SGD,SEK,CHF,THB,USD" } + +[pm_filters.datatrans] +credit = { country = "AL,AD,AM,AT,AZ,BY,BE,BA,BG,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GE,GR,HR,HU,IE,IS,IT,KZ,LI,LT,LU,LV,MC,MD,ME,MK,MT,NL,NO,PL,PT,RO,RU,SE,SI,SK,SM,TR,UA,VA", currency = "BHD,BIF,CHF,DJF,EUR,GBP,GNF,IQD,ISK,JPY,JOD,KMF,KRW,KWD,LYD,OMR,PYG,RWF,TND,UGX,USD,VND,VUV,XAF,XOF,XPF" } +debit = { country = "AL,AD,AM,AT,AZ,BY,BE,BA,BG,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GE,GR,HR,HU,IE,IS,IT,KZ,LI,LT,LU,LV,MC,MD,ME,MK,MT,NL,NO,PL,PT,RO,RU,SE,SI,SK,SM,TR,UA,VA", currency = "BHD,BIF,CHF,DJF,EUR,GBP,GNF,IQD,ISK,JPY,JOD,KMF,KRW,KWD,LYD,OMR,PYG,RWF,TND,UGX,USD,VND,VUV,XAF,XOF,XPF" } + +[pm_filters.payme] +credit = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } +debit = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } +apple_pay = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } + +[pm_filters.paysafe] +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RSD,SGD,ZAR,LKR,SEK,CHF,SYP,TWD,THB,TTD,TND,TRY,UAH,AED,UYU,USD,VND" } + +[pm_filters.payjustnow] +payjustnow = { country = "ZA", currency = "ZAR" } + +[pm_filters.payjustnowinstore] +payjustnow = { country = "ZA", currency = "ZAR" } diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index 10f6b9bf..11febcc8 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -83,93 +83,6 @@ payment_paymentMethod = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } payment_paymentSource = { type = "enum", values = "net.one97.paytm, @paytm" } txn_isEmi = { type = "enum", values = "true, false" } -[routing_config.default] -output = ["stripe", "adyen"] - -[[routing_config.constraint_graph.nodes]] -preds = [] -succs = [0] - -[routing_config.constraint_graph.nodes.kind] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data.data] -key = "payment_method" -comparison = "equal" - -[routing_config.constraint_graph.nodes.kind.data.data.value] -type = "enum_variant" -value = "card" - -[[routing_config.constraint_graph.nodes]] -preds = [] -succs = [1] - -[routing_config.constraint_graph.nodes.kind] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data.data] -key = "payment_method" -comparison = "equal" - -[routing_config.constraint_graph.nodes.kind.data.data.value] -type = "enum_variant" -value = "bank_debit" - -[[routing_config.constraint_graph.nodes]] -preds = [0] -succs = [] - -[routing_config.constraint_graph.nodes.kind] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data.data] -key = "output" -comparison = "equal" - -[routing_config.constraint_graph.nodes.kind.data.data.value] -type = "enum_variant" -value = "stripe" - -[[routing_config.constraint_graph.nodes]] -preds = [1] -succs = [] - -[routing_config.constraint_graph.nodes.kind] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data] -kind = "value" - -[routing_config.constraint_graph.nodes.kind.data.data] -key = "output" -comparison = "equal" - -[routing_config.constraint_graph.nodes.kind.data.data.value] -type = "enum_variant" -value = "adyen" - -[[routing_config.constraint_graph.edges]] -strength = "strong" -relation = "positive" -pred = 0 -succ = 2 - -[[routing_config.constraint_graph.edges]] -strength = "strong" -relation = "positive" -pred = 1 -succ = 3 - [debit_routing_config] fraud_check_fee = 1.0 @@ -191,4 +104,3 @@ merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 4.0 } merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 21.3125 } merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 15.0 } merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 15.0 } - diff --git a/src/app.rs b/src/app.rs index 8b65f0a0..d8bbb642 100644 --- a/src/app.rs +++ b/src/app.rs @@ -7,6 +7,7 @@ use axum_server::{tls_rustls::RustlsConfig, Handle}; use error_stack::ResultExt; use std::sync::Arc; use tokio::signal::unix::{signal, SignalKind}; +use tokio::sync::OnceCell as TokioOnceCell; use tower_http::trace as tower_trace; use crate::{ @@ -43,6 +44,8 @@ pub struct TenantAppState { pub redis_conn: Arc, pub config: config::TenantConfig, pub api_client: ApiClient, + pub pm_filter_graph_bundle: + Arc>>, } #[allow(clippy::expect_used)] @@ -77,8 +80,45 @@ impl TenantAppState { )), api_client, config: tenant_config, + pm_filter_graph_bundle: Arc::new(TokioOnceCell::new()), }) } + + pub async fn get_pm_filter_graph_bundle( + &self, + ) -> Option> { + self.pm_filter_graph_bundle + .get_or_try_init(|| async { + let bundle = crate::euclid::pm_filter_graph::build_pm_filter_graph_bundle( + &self.config.pm_filters, + self.config.routing_config.as_ref(), + ) + .map_err(|err| { + logger::error!( + tenant_id = %self.config.tenant_id, + error = %err, + "Failed to build pm_filters constraint graph; failing open" + ); + err + })?; + + logger::info!( + tenant_id = %self.config.tenant_id, + explicit_connector_count = bundle.explicit_connectors.len(), + has_default_rules = bundle.has_default_rules, + graph_node_count = bundle.node_count, + graph_edge_count = bundle.edge_count, + "pm_filters constraint graph built successfully" + ); + + Ok::, String>(Arc::new( + bundle, + )) + }) + .await + .ok() + .cloned() + } } /// diff --git a/src/config.rs b/src/config.rs index 1a5fa02c..189dc08b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,8 +13,9 @@ use error_stack::ResultExt; #[cfg(feature = "kms-hashicorp-vault")] use masking::ExposeInterface; use redis_interface::RedisSettings; +use serde::Deserialize; use std::{ - collections::HashMap, + collections::{HashMap, HashSet}, ops::{Deref, DerefMut}, path::PathBuf, }; @@ -41,6 +42,8 @@ pub struct GlobalConfig { #[serde(default)] pub routing_config: Option, #[serde(default)] + pub pm_filters: ConnectorFilters, + #[serde(default)] pub debit_routing_config: network_decider::types::DebitRoutingConfig, pub compression_filepath: Option, } @@ -50,6 +53,7 @@ pub struct TenantConfig { pub tenant_id: String, pub tenant_secrets: TenantSecrets, pub routing_config: Option, + pub pm_filters: ConnectorFilters, pub debit_routing_config: network_decider::types::DebitRoutingConfig, pub cache_config: CacheConfig, } @@ -64,6 +68,7 @@ impl TenantConfig { Self { tenant_id: tenant_id.clone(), routing_config: global_config.routing_config.clone(), + pm_filters: global_config.pm_filters.clone(), #[allow(clippy::unwrap_used)] tenant_secrets: global_config .tenant_secrets @@ -76,6 +81,46 @@ impl TenantConfig { } } +#[derive(Clone, Debug, Default, Deserialize)] +#[serde(transparent)] +pub struct ConnectorFilters(pub HashMap); + +#[derive(Clone, Debug, Default, Deserialize)] +#[serde(transparent)] +pub struct PaymentMethodFilters(pub HashMap); + +#[derive(Clone, Debug, Default, Deserialize)] +#[serde(default)] +pub struct CurrencyCountryFlowFilter { + #[serde(default, deserialize_with = "deserialize_optional_hashset")] + pub country: Option>, + #[serde(default, deserialize_with = "deserialize_optional_hashset")] + pub currency: Option>, + pub not_available_flows: Option, +} + +#[derive(Clone, Debug, Default, Deserialize)] +#[serde(default)] +pub struct NotAvailableFlows { + pub capture_method: Option, +} + +fn deserialize_optional_hashset<'a, D>(deserializer: D) -> Result>, D::Error> +where + D: serde::Deserializer<'a>, +{ + let raw = Option::::deserialize(deserializer)?; + Ok(raw.map(|value| { + value + .trim() + .split(',') + .map(str::trim) + .filter(|part| !part.is_empty()) + .map(ToOwned::to_owned) + .collect() + })) +} + #[cfg(feature = "limit")] #[derive(Clone, serde::Deserialize, Debug)] pub struct Limit { @@ -382,9 +427,3 @@ pub struct KeysConfig { #[serde(flatten)] pub keys: HashMap, } - -/// Structure for the [default] section in the TOML -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct DefaultConfig { - pub output: Vec, -} diff --git a/src/euclid.rs b/src/euclid.rs index 4d026675..b5d44a7a 100644 --- a/src/euclid.rs +++ b/src/euclid.rs @@ -3,5 +3,9 @@ pub mod cgraph; pub mod errors; pub mod handlers; pub mod interpreter; +pub mod pm_filter_graph; pub mod types; pub mod utils; + +#[cfg(test)] +mod test; diff --git a/src/euclid/cgraph.rs b/src/euclid/cgraph.rs index 1ba58f25..31f2ba1c 100644 --- a/src/euclid/cgraph.rs +++ b/src/euclid/cgraph.rs @@ -237,6 +237,12 @@ pub struct ConstraintGraphData { edges: Vec, } +impl ConstraintGraphData { + pub fn new(nodes: Vec, edges: Vec) -> Self { + Self { nodes, edges } + } +} + impl TryFrom for ConstraintGraph { type Error = String; @@ -438,12 +444,12 @@ mod tests { #[derive(Debug, Serialize, Deserialize)] struct Config { - routing_config: RoutingConfig, + graph_config: GraphConfig, } #[derive(Debug, Serialize, Deserialize)] - struct RoutingConfig { - constraint_graph: ConstraintGraphData, + struct GraphConfig { + graph: ConstraintGraphData, } #[test] @@ -504,8 +510,8 @@ mod tests { }; let config = Config { - routing_config: RoutingConfig { - constraint_graph: graph, + graph_config: GraphConfig { + graph, }, }; diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index c238b1db..7d69a3c6 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -5,9 +5,9 @@ use crate::storage::schema_pg::routing_algorithm::dsl; use crate::{ error::ApiErrorResponse, euclid::{ - ast::{ComparisonType, ConnectorInfo, Output, ValueType}, - cgraph, + ast::{ConnectorInfo, Output, ValueType}, interpreter::{evaluate_output, InterpreterBackend}, + pm_filter_graph, types::{ ActivateRoutingConfigRequest, Context, JsonifiedRoutingAlgorithm, KeyDataType, RoutingAlgorithmMapperNew, RoutingDictionaryRecord, RoutingEvaluateResponse, @@ -128,6 +128,7 @@ pub async fn config_sr_dimentions( "SR Dimension configuration updated successfully".to_string(), )) } + pub async fn routing_create( Json(payload): Json, ) -> Result, ContainerError> { @@ -264,12 +265,6 @@ pub async fn routing_evaluate( payload.created_by ); - let config_identifier = format!( - "{}_{}", - DEFAULT_FALLBACK_IDENTIFIER, - payload.created_by.clone() - ); - let update_failure_metrics = || { API_REQUEST_COUNTER .with_label_values(&["routing_evaluate", "failure"]) @@ -469,7 +464,7 @@ pub async fn routing_evaluate( ir.evaluated_output = vec![fallback_connector.first().cloned().unwrap_or_default()]; } - } + } (ir.output, ir.evaluated_output, ir.rule_name) } Err(e) => { @@ -481,13 +476,19 @@ pub async fn routing_evaluate( } }; - let eligible_connectors = if let Some(ref cfg) = state.config.routing_config { - let ctx = cgraph::CheckCtx::from(payload.parameters.clone()); - perform_eligibility_analysis(&cfg.constraint_graph, ctx, &evaluated_output) + let pm_filter_bundle = if pm_filter_graph::has_payment_method_type(¶meters) { + state.get_pm_filter_graph_bundle().await } else { - evaluated_output.clone() + None }; + let connectors_for_eligibility = extract_connectors_for_eligibility(&output); + let eligible_connectors = eligibility_for_output( + pm_filter_bundle.as_deref(), + ¶meters, + &connectors_for_eligibility, + ); + let response = RoutingEvaluateResponse { status: match rule_name.as_deref() { Some("default_selection") | Some("default_fallback") => "default_selection".into(), @@ -796,24 +797,60 @@ fn format_output(output: &Output) -> Value { } } -fn perform_eligibility_analysis( - constraint_graph: &cgraph::ConstraintGraph, - ctx: cgraph::CheckCtx, - output: &[ConnectorInfo], +pub(crate) fn eligibility_for_output( + pm_filter_bundle: Option<&pm_filter_graph::PmFilterGraphBundle>, + parameters: &std::collections::HashMap>, + connectors: &[ConnectorInfo], ) -> Vec { - let mut eligible_connectors = Vec::::with_capacity(output.len()); + if !pm_filter_graph::has_payment_method_type(parameters) { + logger::debug!("Skipping pm_filters eligibility; payment_method_type missing"); + return connectors.to_vec(); + } - for out in output { - let clause = cgraph::Clause { - key: "output".to_string(), - comparison: ComparisonType::Equal, - value: ValueType::EnumVariant(out.gateway_name.clone()), - }; + apply_pm_filter_eligibility(pm_filter_bundle, parameters, connectors) +} + +pub(crate) fn apply_pm_filter_eligibility( + bundle: Option<&pm_filter_graph::PmFilterGraphBundle>, + parameters: &std::collections::HashMap>, + eligible_connectors: &[ConnectorInfo], +) -> Vec { + let Some(bundle) = bundle else { + logger::debug!("Skipping pm_filters eligibility; graph unavailable"); + return eligible_connectors.to_vec(); + }; + + pm_filter_graph::filter_eligible_connectors(bundle, parameters, eligible_connectors) +} - if let Ok(true) = constraint_graph.check_clause_validity(clause, &ctx) { - eligible_connectors.push(out.clone()); +pub(crate) fn extract_connectors_for_eligibility(output: &Output) -> Vec { + let mut connectors = Vec::::new(); + let mut push_unique = |connector: &ConnectorInfo| { + if !connectors.iter().any(|existing| existing == connector) { + connectors.push(connector.clone()); + } + }; + + match output { + Output::Single(connector) => push_unique(connector), + Output::Priority(priority_connectors) => { + for connector in priority_connectors { + push_unique(connector); + } + } + Output::VolumeSplit(splits) => { + for split in splits { + push_unique(&split.output); + } + } + Output::VolumeSplitPriority(splits) => { + for split in splits { + for connector in &split.output { + push_unique(connector); + } + } } } - eligible_connectors + connectors } diff --git a/src/euclid/pm_filter_graph.rs b/src/euclid/pm_filter_graph.rs new file mode 100644 index 00000000..88f454aa --- /dev/null +++ b/src/euclid/pm_filter_graph.rs @@ -0,0 +1,463 @@ +use std::collections::{HashMap, HashSet}; + +use super::{ + ast::{ComparisonType, ConnectorInfo, ValueType}, + cgraph::{ + self, Clause, ConstraintGraph, ConstraintGraphData, Edge, EdgeId, EntityId, Node, NodeId, + NodeKind, NodeValue, Relation, Strength, + }, + types::TomlConfig, +}; +use crate::{ + config::{ConnectorFilters, CurrencyCountryFlowFilter}, + logger, +}; + +pub const PM_FILTER_DEFAULT_OUTPUT_SENTINEL: &str = "__pm_default__"; + +#[derive(Debug, Clone)] +pub struct PmFilterGraphBundle { + pub graph: ConstraintGraph, + pub explicit_connectors: HashSet, + pub has_default_rules: bool, + pub explicit_connector_payment_method_types: HashMap>, + pub default_payment_method_types: HashSet, + pub billing_country_to_iso2: HashMap, + pub node_count: usize, + pub edge_count: usize, +} + +pub fn build_pm_filter_graph_bundle( + pm_filters: &ConnectorFilters, + routing_config: Option<&TomlConfig>, +) -> Result { + let mut compiler = GraphCompiler::default(); + let mut explicit_connectors = HashSet::new(); + let mut has_default_rules = false; + let mut explicit_connector_payment_method_types = HashMap::new(); + let mut default_payment_method_types = HashSet::new(); + + for (connector_name, filters_for_connector) in &pm_filters.0 { + let normalized_connector = connector_name.trim().to_ascii_lowercase(); + let is_default = normalized_connector == "default"; + let output_value = if is_default { + has_default_rules = true; + PM_FILTER_DEFAULT_OUTPUT_SENTINEL.to_string() + } else { + explicit_connectors.insert(normalized_connector.clone()); + normalized_connector + }; + + let output_node = compiler.add_value_node("output", &output_value); + for (payment_method_type, filter) in &filters_for_connector.0 { + let normalized_payment_method_type = payment_method_type.trim().to_ascii_lowercase(); + if normalized_payment_method_type.is_empty() { + continue; + } + + if is_default { + default_payment_method_types.insert(normalized_payment_method_type.clone()); + } else { + explicit_connector_payment_method_types + .entry(output_value.clone()) + .or_insert_with(HashSet::new) + .insert(normalized_payment_method_type.clone()); + } + + let rule_node = compiler.add_aggregator_node(NodeKind::AllAggregator); + let pm_type_node = + compiler.add_value_node("payment_method_type", &normalized_payment_method_type); + compiler.add_edge( + pm_type_node, + rule_node, + Strength::Strong, + Relation::Positive, + ); + + attach_country_filter_nodes(&mut compiler, filter, rule_node); + attach_currency_filter_nodes(&mut compiler, filter, rule_node); + attach_not_available_flow_nodes(&mut compiler, filter, rule_node); + + compiler.add_edge(rule_node, output_node, Strength::Normal, Relation::Positive); + } + } + + let node_count = compiler.nodes.len(); + let edge_count = compiler.edges.len(); + let graph = + ConstraintGraph::try_from(ConstraintGraphData::new(compiler.nodes, compiler.edges))?; + + let billing_country_to_iso2 = build_billing_country_to_iso2_map(routing_config); + + Ok(PmFilterGraphBundle { + graph, + explicit_connectors, + has_default_rules, + explicit_connector_payment_method_types, + default_payment_method_types, + billing_country_to_iso2, + node_count, + edge_count, + }) +} + +pub fn has_payment_method_type(parameters: &HashMap>) -> bool { + get_parameter_string(parameters, "payment_method_type").is_some() +} + +pub fn filter_eligible_connectors( + bundle: &PmFilterGraphBundle, + parameters: &HashMap>, + connectors: &[ConnectorInfo], +) -> Vec { + let Some(base_ctx) = build_pm_filter_context(parameters, &bundle.billing_country_to_iso2) + else { + return connectors.to_vec(); + }; + + connectors + .iter() + .filter(|connector| connector_is_eligible(bundle, &base_ctx, connector)) + .cloned() + .collect() +} + +fn connector_is_eligible( + bundle: &PmFilterGraphBundle, + base_ctx: &HashMap, + connector: &ConnectorInfo, +) -> bool { + let normalized_connector = connector.gateway_name.trim().to_ascii_lowercase(); + let payment_method_type = get_context_enum_value(base_ctx, "payment_method_type"); + let explicit_has_pmt_rule = payment_method_type.is_some_and(|pmt| { + bundle + .explicit_connector_payment_method_types + .get(&normalized_connector) + .is_some_and(|types| types.contains(pmt)) + }); + let default_has_pmt_rule = + payment_method_type.is_some_and(|pmt| bundle.default_payment_method_types.contains(pmt)); + + let (output_clause_value, source) = if explicit_has_pmt_rule { + (normalized_connector, "explicit") + } else if default_has_pmt_rule { + (PM_FILTER_DEFAULT_OUTPUT_SENTINEL.to_string(), "default") + } else { + logger::debug!( + connector = %connector.gateway_name, + payment_method_type = ?payment_method_type, + has_explicit_connector = bundle.explicit_connectors.contains(&normalized_connector), + has_default_rules = bundle.has_default_rules, + "No pm_filters rule for connector/payment_method_type; allowing by default" + ); + return true; + }; + + let mut ctx_vals = base_ctx.clone(); + ctx_vals.insert( + "output".to_string(), + ValueType::EnumVariant(output_clause_value.clone()), + ); + + let clause = Clause { + key: "output".to_string(), + comparison: ComparisonType::Equal, + value: ValueType::EnumVariant(output_clause_value), + }; + + match bundle + .graph + .check_clause_validity(clause, &cgraph::CheckCtx { ctx_vals }) + { + Ok(true) => true, + Ok(false) => { + logger::debug!( + connector = %connector.gateway_name, + rule_source = source, + "Connector filtered by pm_filters constraint graph" + ); + false + } + Err(err) => { + logger::error!( + error = ?err, + connector = %connector.gateway_name, + "pm_filters graph evaluation failed, failing open for connector" + ); + true + } + } +} + +fn get_context_enum_value<'a>(ctx: &'a HashMap, key: &str) -> Option<&'a str> { + ctx.get(key).and_then(|value| match value { + ValueType::EnumVariant(inner) => Some(inner.as_str()), + ValueType::StrValue(inner) => Some(inner.as_str()), + _ => None, + }) +} + +fn build_pm_filter_context( + parameters: &HashMap>, + billing_country_to_iso2: &HashMap, +) -> Option> { + let payment_method_type = get_parameter_string(parameters, "payment_method_type") + .map(str::trim) + .filter(|v| !v.is_empty()) + .map(|v| v.to_ascii_lowercase())?; + + let mut ctx_vals = HashMap::new(); + ctx_vals.insert( + "payment_method_type".to_string(), + ValueType::EnumVariant(payment_method_type), + ); + + if let Some(currency) = get_parameter_string(parameters, "currency") + .map(str::trim) + .filter(|v| !v.is_empty()) + .map(|v| v.to_ascii_uppercase()) + { + ctx_vals.insert("currency".to_string(), ValueType::EnumVariant(currency)); + } + + if let Some(capture_method) = get_parameter_string(parameters, "capture_method") + .map(str::trim) + .filter(|v| !v.is_empty()) + .map(|v| v.to_ascii_lowercase()) + { + ctx_vals.insert( + "capture_method".to_string(), + ValueType::EnumVariant(capture_method), + ); + } + + if let Some(billing_country) = get_parameter_string(parameters, "billing_country") + .and_then(|country| normalize_billing_country_iso2(country, billing_country_to_iso2)) + { + ctx_vals.insert( + "billing_country".to_string(), + ValueType::EnumVariant(billing_country), + ); + } + + Some(ctx_vals) +} + +fn normalize_billing_country_iso2( + billing_country: &str, + billing_country_to_iso2: &HashMap, +) -> Option { + let trimmed = billing_country.trim(); + if trimmed.is_empty() { + return None; + } + + let normalized = trimmed.to_ascii_uppercase(); + if normalized.len() == 2 && normalized.chars().all(|c| c.is_ascii_alphabetic()) { + return Some(normalized); + } + + billing_country_to_iso2.get(trimmed).cloned().or_else(|| { + billing_country_to_iso2 + .get(&trimmed.to_ascii_lowercase()) + .cloned() + }) +} + +fn build_billing_country_to_iso2_map( + routing_config: Option<&TomlConfig>, +) -> HashMap { + let mut map = HashMap::new(); + let Some(routing_config) = routing_config else { + return map; + }; + + let Some(billing_country_key_config) = routing_config.keys.keys.get("billing_country") else { + return map; + }; + + let Some(billing_values) = billing_country_key_config.values.as_ref() else { + return map; + }; + + for billing_country in parse_csv_values(billing_values) { + let iso2 = billing_country.trim().to_ascii_uppercase(); + if iso2.len() == 2 && iso2.chars().all(|c| c.is_ascii_alphabetic()) { + map.insert(billing_country.clone(), iso2.clone()); + map.insert(billing_country.to_ascii_lowercase(), iso2); + } + } + map +} + +fn attach_country_filter_nodes( + compiler: &mut GraphCompiler, + filter: &CurrencyCountryFlowFilter, + parent_node: NodeId, +) { + let Some(allowed_countries) = filter.country.as_ref() else { + return; + }; + + let allowed_countries = allowed_countries + .iter() + .map(|value| value.trim().to_ascii_uppercase()) + .filter(|value| !value.is_empty()) + .collect::>(); + + if allowed_countries.is_empty() { + return; + } + + let country_any_node = compiler.add_aggregator_node(NodeKind::AnyAggregator); + for country in allowed_countries { + let country_node = compiler.add_value_node("billing_country", &country); + compiler.add_edge( + country_node, + country_any_node, + Strength::Weak, + Relation::Positive, + ); + } + + compiler.add_edge( + country_any_node, + parent_node, + Strength::Normal, + Relation::Positive, + ); +} + +fn attach_currency_filter_nodes( + compiler: &mut GraphCompiler, + filter: &CurrencyCountryFlowFilter, + parent_node: NodeId, +) { + let Some(allowed_currencies) = filter.currency.as_ref() else { + return; + }; + + let allowed_currencies = allowed_currencies + .iter() + .map(|value| value.trim().to_ascii_uppercase()) + .filter(|value| !value.is_empty()) + .collect::>(); + + if allowed_currencies.is_empty() { + return; + } + + let currency_any_node = compiler.add_aggregator_node(NodeKind::AnyAggregator); + for currency in allowed_currencies { + let currency_node = compiler.add_value_node("currency", ¤cy); + compiler.add_edge( + currency_node, + currency_any_node, + Strength::Weak, + Relation::Positive, + ); + } + + compiler.add_edge( + currency_any_node, + parent_node, + Strength::Normal, + Relation::Positive, + ); +} + +fn attach_not_available_flow_nodes( + compiler: &mut GraphCompiler, + filter: &CurrencyCountryFlowFilter, + parent_node: NodeId, +) { + let Some(capture_method) = filter + .not_available_flows + .as_ref() + .and_then(|flows| flows.capture_method.as_ref()) + .map(|value| value.trim()) + .filter(|value| !value.is_empty()) + .map(|value| value.to_ascii_lowercase()) + else { + return; + }; + + let capture_method_node = compiler.add_value_node("capture_method", &capture_method); + compiler.add_edge( + capture_method_node, + parent_node, + Strength::Strong, + Relation::Negative, + ); +} + +fn get_parameter_string<'a>( + parameters: &'a HashMap>, + key: &str, +) -> Option<&'a str> { + parameters.get(key).and_then(|value| match value.as_ref() { + Some(ValueType::EnumVariant(inner)) => Some(inner.as_str()), + Some(ValueType::StrValue(inner)) => Some(inner.as_str()), + _ => None, + }) +} + +fn parse_csv_values(raw_values: &str) -> Vec { + raw_values + .split(',') + .map(str::trim) + .filter(|value| !value.is_empty()) + .map(ToOwned::to_owned) + .collect() +} + +#[derive(Default)] +struct GraphCompiler { + nodes: Vec, + edges: Vec, + value_nodes: HashMap, +} + +impl GraphCompiler { + fn add_value_node(&mut self, key: &str, value: &str) -> NodeId { + let node_value = NodeValue::Value(Clause { + key: key.to_string(), + comparison: ComparisonType::Equal, + value: ValueType::EnumVariant(value.to_string()), + }); + + if let Some(existing_id) = self.value_nodes.get(&node_value).copied() { + return existing_id; + } + + let node_id = self.add_node(NodeKind::Value(node_value.clone())); + self.value_nodes.insert(node_value, node_id); + node_id + } + + fn add_aggregator_node(&mut self, kind: NodeKind) -> NodeId { + self.add_node(kind) + } + + fn add_node(&mut self, kind: NodeKind) -> NodeId { + let node_id = NodeId::with_id(self.nodes.len()); + self.nodes.push(Node { + kind, + preds: Vec::new(), + succs: Vec::new(), + }); + node_id + } + + fn add_edge(&mut self, pred: NodeId, succ: NodeId, strength: Strength, relation: Relation) { + let edge_id = EdgeId::with_id(self.edges.len()); + self.edges.push(Edge { + strength, + relation, + pred, + succ, + }); + self.nodes[pred.get_id()].succs.push(edge_id); + self.nodes[succ.get_id()].preds.push(edge_id); + } +} diff --git a/src/euclid/test.rs b/src/euclid/test.rs new file mode 100644 index 00000000..2b772f7b --- /dev/null +++ b/src/euclid/test.rs @@ -0,0 +1,950 @@ +#[cfg(test)] +mod tests { + use std::collections::{HashMap, HashSet}; + + use crate::{ + config::{ + ConnectorFilters, CurrencyCountryFlowFilter, NotAvailableFlows, PaymentMethodFilters, + }, + euclid::{ + ast::{ConnectorInfo, Output, ValueType, VolumeSplit}, + handlers::routing_rules::{ + apply_pm_filter_eligibility, compute_routing_evaluate_eligibility, + extract_connectors_for_eligibility, + }, + pm_filter_graph, + types::{KeyConfig, KeyDataType, KeysConfig, TomlConfig}, + }, + }; + + fn enum_value(value: &str) -> Option { + Some(ValueType::EnumVariant(value.to_string())) + } + + fn connectors(names: &[&str]) -> Vec { + names + .iter() + .map(|name| ConnectorInfo { + gateway_name: (*name).to_string(), + gateway_id: None, + }) + .collect() + } + + fn routing_config_for_tests() -> TomlConfig { + let mut keys = HashMap::new(); + keys.insert( + "billing_country".to_string(), + KeyConfig { + data_type: KeyDataType::Enum, + values: Some("US,IN".to_string()), + min_value: None, + max_value: None, + min_length: None, + max_length: None, + exact_length: None, + regex: None, + }, + ); + TomlConfig { + keys: KeysConfig { keys }, + } + } + + fn build_bundle_for_tests() -> pm_filter_graph::PmFilterGraphBundle { + let mut connector_configs = HashMap::new(); + connector_configs.insert( + "stripe".to_string(), + PaymentMethodFilters( + [( + "credit".to_string(), + CurrencyCountryFlowFilter { + country: Some(HashSet::from(["US".to_string()])), + currency: None, + not_available_flows: None, + }, + )] + .into_iter() + .collect(), + ), + ); + connector_configs.insert( + "default".to_string(), + PaymentMethodFilters( + [( + "debit".to_string(), + CurrencyCountryFlowFilter { + country: None, + currency: None, + not_available_flows: None, + }, + )] + .into_iter() + .collect(), + ), + ); + + pm_filter_graph::build_pm_filter_graph_bundle( + &ConnectorFilters(connector_configs), + Some(&routing_config_for_tests()), + ) + .expect("pm filter bundle should build") + } + + fn build_priority_matrix_bundle() -> pm_filter_graph::PmFilterGraphBundle { + let mut connector_configs = HashMap::new(); + connector_configs.insert( + "razorpay".to_string(), + PaymentMethodFilters( + [( + "upi_collect".to_string(), + CurrencyCountryFlowFilter { + country: Some(HashSet::from(["IN".to_string()])), + currency: Some(HashSet::from(["INR".to_string()])), + not_available_flows: None, + }, + )] + .into_iter() + .collect(), + ), + ); + connector_configs.insert( + "stripe".to_string(), + PaymentMethodFilters( + [( + "credit".to_string(), + CurrencyCountryFlowFilter { + country: Some(HashSet::from(["US".to_string()])), + currency: Some(HashSet::from(["USD".to_string()])), + not_available_flows: None, + }, + )] + .into_iter() + .collect(), + ), + ); + connector_configs.insert( + "default".to_string(), + PaymentMethodFilters( + [( + "google_pay".to_string(), + CurrencyCountryFlowFilter { + country: Some(HashSet::from(["US".to_string()])), + currency: None, + not_available_flows: None, + }, + )] + .into_iter() + .collect(), + ), + ); + + pm_filter_graph::build_pm_filter_graph_bundle( + &ConnectorFilters(connector_configs), + Some(&routing_config_for_tests()), + ) + .expect("priority matrix bundle should build") + } + + fn params_for_case( + payment_method_type: Option<&str>, + billing_country: Option<&str>, + currency: Option<&str>, + ) -> HashMap> { + let mut params = HashMap::new(); + if let Some(payment_method_type) = payment_method_type { + params.insert( + "payment_method_type".to_string(), + enum_value(payment_method_type), + ); + } + if let Some(billing_country) = billing_country { + params.insert("billing_country".to_string(), enum_value(billing_country)); + } + if let Some(currency) = currency { + params.insert("currency".to_string(), enum_value(currency)); + } + params + } + + fn connector_names(connectors: &[ConnectorInfo]) -> Vec { + connectors + .iter() + .map(|connector| connector.gateway_name.clone()) + .collect() + } + + fn print_priority_test_setup(bundle: &pm_filter_graph::PmFilterGraphBundle) { + println!("=== TEST SETUP: ROUTING + PM ELIGIBILITY ==="); + println!("Routing rule under test:"); + println!(" if payment_method == card => priority [razorpay, stripe]"); + println!(" else => default [adyen]"); + println!("Eligibility input:"); + println!(" all connectors from routing output (single/priority/volume variants)"); + println!("pm_filters under test:"); + println!(" razorpay.upi_collect => country=[IN], currency=[INR]"); + println!(" stripe.credit => country=[US], currency=[USD]"); + println!(" default.google_pay => country=[US]"); + println!("Resolution order:"); + println!(" explicit connector PMT rule -> default PMT rule -> pass-open"); + println!( + "Derived billing_country -> ISO2 map: {:?}", + bundle.billing_country_to_iso2 + ); + println!( + "explicit connector PMT map: {:?}", + bundle.explicit_connector_payment_method_types + ); + println!("default PMT set: {:?}", bundle.default_payment_method_types); + println!("=== END SETUP ==="); + } + + fn pm_filter_test_connectors(names: &[&str]) -> Vec { + names + .iter() + .map(|name| ConnectorInfo { + gateway_name: (*name).to_string(), + gateway_id: None, + }) + .collect() + } + + fn pm_filter_test_routing_config() -> TomlConfig { + let mut keys = HashMap::new(); + keys.insert( + "billing_country".to_string(), + KeyConfig { + data_type: KeyDataType::Enum, + values: Some("US,DE".to_string()), + min_value: None, + max_value: None, + min_length: None, + max_length: None, + exact_length: None, + regex: None, + }, + ); + TomlConfig { + keys: KeysConfig { keys }, + } + } + + fn pm_filter_make_filter( + country: Option<&[&str]>, + currency: Option<&[&str]>, + capture_method: Option<&str>, + ) -> CurrencyCountryFlowFilter { + CurrencyCountryFlowFilter { + country: country.map(|values| values.iter().map(|v| (*v).to_string()).collect()), + currency: currency.map(|values| values.iter().map(|v| (*v).to_string()).collect()), + not_available_flows: capture_method.map(|capture_method| NotAvailableFlows { + capture_method: Some(capture_method.to_string()), + }), + } + } + + fn pm_filter_build_connector_filters() -> ConnectorFilters { + let mut connector_filters = HashMap::new(); + + connector_filters.insert( + "stripe".to_string(), + PaymentMethodFilters( + [( + "credit".to_string(), + pm_filter_make_filter(Some(&["US"]), Some(&["USD"]), None), + )] + .into_iter() + .collect(), + ), + ); + + connector_filters.insert( + "default".to_string(), + PaymentMethodFilters( + [ + ( + "credit".to_string(), + pm_filter_make_filter(Some(&["US"]), Some(&["USD"]), Some("manual")), + ), + ( + "debit".to_string(), + pm_filter_make_filter(Some(&["US"]), Some(&["USD"]), None), + ), + ] + .into_iter() + .collect(), + ), + ); + + ConnectorFilters(connector_filters) + } + + #[test] + fn routing_evaluate_eligibility_applies_pm_filters_on_routing_output() { + let bundle = build_bundle_for_tests(); + let params = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ("billing_country".to_string(), enum_value("IN")), + ]); + let initial = connectors(&["stripe", "adyen"]); + + let filtered = compute_routing_evaluate_eligibility(Some(&bundle), ¶ms, &initial); + assert_eq!(filtered, connectors(&["adyen"])); + } + + #[test] + fn routing_evaluate_eligibility_skips_pm_filters_when_payment_method_type_missing() { + let bundle = build_bundle_for_tests(); + let params = HashMap::from([( + "billing_country".to_string(), + enum_value("US"), + )]); + let initial = connectors(&["stripe", "adyen"]); + + let filtered = compute_routing_evaluate_eligibility(Some(&bundle), ¶ms, &initial); + assert_eq!(filtered, initial); + } + + #[test] + fn routing_evaluate_eligibility_fails_open_for_pm_filters_after_routing_pass() { + let params = HashMap::from([("payment_method_type".to_string(), enum_value("credit"))]); + let initial = connectors(&["stripe", "adyen", "checkout"]); + + let filtered = compute_routing_evaluate_eligibility(None, ¶ms, &initial); + assert_eq!(filtered, connectors(&["stripe", "adyen", "checkout"])); + } + + #[test] + fn apply_pm_filter_eligibility_returns_intersection() { + let bundle = build_bundle_for_tests(); + let params = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ("billing_country".to_string(), enum_value("IN")), + ]); + let initial = connectors(&["stripe", "adyen"]); + + let filtered = apply_pm_filter_eligibility(Some(&bundle), ¶ms, &initial); + assert_eq!(filtered, connectors(&["adyen"])); + } + + #[test] + fn apply_pm_filter_eligibility_skips_when_payment_method_type_missing() { + let bundle = build_bundle_for_tests(); + let params = HashMap::from([( + "billing_country".to_string(), + enum_value("US"), + )]); + let initial = connectors(&["stripe", "adyen"]); + + let filtered = if pm_filter_graph::has_payment_method_type(¶ms) { + apply_pm_filter_eligibility(Some(&bundle), ¶ms, &initial) + } else { + initial.clone() + }; + assert_eq!(filtered, initial); + } + + #[test] + fn apply_pm_filter_eligibility_fails_open_when_bundle_unavailable() { + let params = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ( + "billing_country".to_string(), + enum_value("US"), + ), + ]); + let initial = connectors(&["stripe", "adyen"]); + + let filtered = apply_pm_filter_eligibility(None, ¶ms, &initial); + assert_eq!(filtered, initial); + } + + #[test] + fn pm_filter_explicit_connector_pass_and_fail_for_country_currency_pmt() { + let bundle = pm_filter_graph::build_pm_filter_graph_bundle( + &pm_filter_build_connector_filters(), + Some(&pm_filter_test_routing_config()), + ) + .expect("bundle should build"); + + let params_pass = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ( + "billing_country".to_string(), + enum_value("US"), + ), + ("currency".to_string(), enum_value("USD")), + ]); + let params_fail_country = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ("billing_country".to_string(), enum_value("DE")), + ("currency".to_string(), enum_value("USD")), + ]); + + assert_eq!( + pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms_pass, + &pm_filter_test_connectors(&["stripe"]) + ) + .len(), + 1 + ); + assert!(pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms_fail_country, + &pm_filter_test_connectors(&["stripe"]) + ) + .is_empty()); + } + + #[test] + fn pm_filter_default_rule_applies_for_non_explicit_connector() { + let bundle = pm_filter_graph::build_pm_filter_graph_bundle( + &pm_filter_build_connector_filters(), + Some(&pm_filter_test_routing_config()), + ) + .expect("bundle should build"); + + let params = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ( + "billing_country".to_string(), + enum_value("US"), + ), + ("currency".to_string(), enum_value("USD")), + ("capture_method".to_string(), enum_value("automatic")), + ]); + + assert_eq!( + pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms, + &pm_filter_test_connectors(&["adyen"]) + ) + .len(), + 1 + ); + } + + #[test] + fn pm_filter_explicit_connector_without_specific_rule_falls_back_to_default() { + let bundle = pm_filter_graph::build_pm_filter_graph_bundle( + &pm_filter_build_connector_filters(), + Some(&pm_filter_test_routing_config()), + ) + .expect("bundle should build"); + + let params = HashMap::from([ + ("payment_method_type".to_string(), enum_value("debit")), + ( + "billing_country".to_string(), + enum_value("US"), + ), + ("currency".to_string(), enum_value("USD")), + ]); + + assert_eq!( + pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms, + &pm_filter_test_connectors(&["stripe"]) + ) + .len(), + 1 + ); + } + + #[test] + fn pm_filter_connector_passes_when_rule_absent_in_explicit_and_default() { + let bundle = pm_filter_graph::build_pm_filter_graph_bundle( + &pm_filter_build_connector_filters(), + Some(&pm_filter_test_routing_config()), + ) + .expect("bundle should build"); + + let params = + HashMap::from([("payment_method_type".to_string(), enum_value("upi_collect"))]); + + assert_eq!( + pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms, + &pm_filter_test_connectors(&["stripe"]) + ) + .len(), + 1 + ); + } + + #[test] + fn pm_filter_capture_method_exclusion_works() { + let bundle = pm_filter_graph::build_pm_filter_graph_bundle( + &pm_filter_build_connector_filters(), + Some(&pm_filter_test_routing_config()), + ) + .expect("bundle should build"); + + let params_manual = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ( + "billing_country".to_string(), + enum_value("US"), + ), + ("currency".to_string(), enum_value("USD")), + ("capture_method".to_string(), enum_value("manual")), + ]); + let params_auto = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ( + "billing_country".to_string(), + enum_value("US"), + ), + ("currency".to_string(), enum_value("USD")), + ("capture_method".to_string(), enum_value("automatic")), + ]); + + assert!(pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms_manual, + &pm_filter_test_connectors(&["adyen"]) + ) + .is_empty()); + assert_eq!( + pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms_auto, + &pm_filter_test_connectors(&["adyen"]) + ) + .len(), + 1 + ); + } + + #[test] + fn pm_filter_missing_country_or_currency_does_not_fail_when_configured() { + let bundle = pm_filter_graph::build_pm_filter_graph_bundle( + &pm_filter_build_connector_filters(), + Some(&pm_filter_test_routing_config()), + ) + .expect("bundle should build"); + + let params = HashMap::from([("payment_method_type".to_string(), enum_value("credit"))]); + assert_eq!( + pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms, + &pm_filter_test_connectors(&["adyen"]) + ) + .len(), + 1 + ); + } + + #[test] + fn pm_filter_billing_country_mapping_is_derived_from_routing_keys() { + let bundle = pm_filter_graph::build_pm_filter_graph_bundle( + &pm_filter_build_connector_filters(), + Some(&pm_filter_test_routing_config()), + ) + .expect("bundle should build"); + assert_eq!( + bundle.billing_country_to_iso2.get("US"), + Some(&"US".to_string()) + ); + assert_eq!( + bundle.billing_country_to_iso2.get("DE"), + Some(&"DE".to_string()) + ); + } + + #[test] + fn pm_filter_unknown_billing_country_is_ignored_and_does_not_false_reject() { + let bundle = pm_filter_graph::build_pm_filter_graph_bundle( + &pm_filter_build_connector_filters(), + Some(&pm_filter_test_routing_config()), + ) + .expect("bundle should build"); + + let params = HashMap::from([ + ("payment_method_type".to_string(), enum_value("credit")), + ("billing_country".to_string(), enum_value("UnknownLand")), + ("currency".to_string(), enum_value("USD")), + ("capture_method".to_string(), enum_value("automatic")), + ]); + + assert_eq!( + pm_filter_graph::filter_eligible_connectors( + &bundle, + ¶ms, + &pm_filter_test_connectors(&["adyen"]) + ) + .len(), + 1 + ); + } + + #[test] + fn extract_connectors_for_priority_output_returns_all_unique_connectors() { + let output = Output::Priority(vec![ + ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + ]); + + let connectors = extract_connectors_for_eligibility(&output); + assert_eq!( + connectors, + vec![ + ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + ] + ); + } + + #[test] + fn extract_connectors_for_volume_split_output_returns_all_split_connectors() { + let output = Output::VolumeSplit(vec![ + VolumeSplit { + split: 70, + output: ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + }, + VolumeSplit { + split: 30, + output: ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + }, + ]); + + let connectors = extract_connectors_for_eligibility(&output); + assert_eq!( + connectors, + vec![ + ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + ] + ); + } + + #[test] + fn extract_connectors_for_volume_split_priority_flattens_all_unique_connectors() { + let output = Output::VolumeSplitPriority(vec![ + VolumeSplit { + split: 50, + output: vec![ + ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + ], + }, + VolumeSplit { + split: 50, + output: vec![ + ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + ConnectorInfo { + gateway_name: "adyen".to_string(), + gateway_id: Some("mca_ady".to_string()), + }, + ], + }, + ]); + + let connectors = extract_connectors_for_eligibility(&output); + assert_eq!( + connectors, + vec![ + ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + ConnectorInfo { + gateway_name: "adyen".to_string(), + gateway_id: Some("mca_ady".to_string()), + }, + ] + ); + } + + #[test] + fn priority_and_fallback_permutation_matrix_with_logs() { + let bundle = build_priority_matrix_bundle(); + print_priority_test_setup(&bundle); + + #[derive(Clone)] + struct Case { + name: &'static str, + connectors: Vec<&'static str>, + payment_method_type: Option<&'static str>, + billing_country: Option<&'static str>, + currency: Option<&'static str>, + expected: Vec<&'static str>, + } + + let cases = vec![ + Case { + name: "priority_card_no_pmt_type_pm_skipped", + connectors: vec!["razorpay", "stripe"], + payment_method_type: None, + billing_country: None, + currency: None, + expected: vec!["razorpay", "stripe"], + }, + Case { + name: "priority_card_upi_in_inr_both_pass", + connectors: vec!["razorpay", "stripe"], + payment_method_type: Some("upi_collect"), + billing_country: Some("IN"), + currency: Some("INR"), + expected: vec!["razorpay", "stripe"], + }, + Case { + name: "priority_card_upi_us_usd_only_stripe_passes", + connectors: vec!["razorpay", "stripe"], + payment_method_type: Some("upi_collect"), + billing_country: Some("US"), + currency: Some("USD"), + expected: vec!["stripe"], + }, + Case { + name: "priority_card_credit_us_usd_both_pass", + connectors: vec!["razorpay", "stripe"], + payment_method_type: Some("credit"), + billing_country: Some("US"), + currency: Some("USD"), + expected: vec!["razorpay", "stripe"], + }, + Case { + name: "priority_card_google_pay_us_both_pass", + connectors: vec!["razorpay", "stripe"], + payment_method_type: Some("google_pay"), + billing_country: Some("US"), + currency: None, + expected: vec!["razorpay", "stripe"], + }, + Case { + name: "priority_card_google_pay_in_both_fail", + connectors: vec!["razorpay", "stripe"], + payment_method_type: Some("google_pay"), + billing_country: Some("IN"), + currency: None, + expected: vec![], + }, + Case { + name: "default_output_no_pmt_type_pm_skipped", + connectors: vec!["adyen"], + payment_method_type: None, + billing_country: None, + currency: None, + expected: vec!["adyen"], + }, + Case { + name: "fallback_razorpay_stripe_no_pmt_type_pm_skipped", + connectors: vec!["razorpay", "stripe"], + payment_method_type: None, + billing_country: None, + currency: None, + expected: vec!["razorpay", "stripe"], + }, + Case { + name: "fallback_razorpay_stripe_upi_in_inr_both_pass", + connectors: vec!["razorpay", "stripe"], + payment_method_type: Some("upi_collect"), + billing_country: Some("IN"), + currency: Some("INR"), + expected: vec!["razorpay", "stripe"], + }, + Case { + name: "fallback_razorpay_stripe_upi_us_usd_only_stripe_passes", + connectors: vec!["razorpay", "stripe"], + payment_method_type: Some("upi_collect"), + billing_country: Some("US"), + currency: Some("USD"), + expected: vec!["stripe"], + }, + Case { + name: "fallback_stripe_razorpay_upi_us_usd_only_stripe_passes", + connectors: vec!["stripe", "razorpay"], + payment_method_type: Some("upi_collect"), + billing_country: Some("US"), + currency: Some("USD"), + expected: vec!["stripe"], + }, + Case { + name: "fallback_razorpay_stripe_credit_us_usd_both_pass", + connectors: vec!["razorpay", "stripe"], + payment_method_type: Some("credit"), + billing_country: Some("US"), + currency: Some("USD"), + expected: vec!["razorpay", "stripe"], + }, + ]; + + for (index, case) in cases.iter().enumerate() { + let input_connectors = connectors(&case.connectors); + let params = params_for_case( + case.payment_method_type, + case.billing_country, + case.currency, + ); + let eligible = + compute_routing_evaluate_eligibility(Some(&bundle), ¶ms, &input_connectors); + let expected = connectors(&case.expected); + + println!( + "CASE {index}: {}\n input={:?}\n pmt={:?} country={:?} currency={:?}\n eligible={:?}\n expected={:?}", + case.name, + connector_names(&input_connectors), + case.payment_method_type, + case.billing_country, + case.currency, + connector_names(&eligible), + case.expected + ); + + assert_eq!(eligible, expected, "failed case: {}", case.name); + } + } + + #[test] + fn eligibility_runs_on_all_connectors_for_all_output_forms_with_logs() { + let bundle = build_priority_matrix_bundle(); + print_priority_test_setup(&bundle); + println!("Output forms tested: single, priority, volume_split, volume_split_priority"); + let params = params_for_case( + Some("upi_collect"), + Some("US"), + Some("USD"), + ); + + let test_outputs = vec![ + ( + "single", + Output::Single(ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }), + vec![], + ), + ( + "priority", + Output::Priority(vec![ + ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + ]), + vec!["stripe"], + ), + ( + "volume_split", + Output::VolumeSplit(vec![ + VolumeSplit { + split: 60, + output: ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + }, + VolumeSplit { + split: 40, + output: ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + }, + ]), + vec!["stripe"], + ), + ( + "volume_split_priority", + Output::VolumeSplitPriority(vec![ + VolumeSplit { + split: 50, + output: vec![ + ConnectorInfo { + gateway_name: "razorpay".to_string(), + gateway_id: Some("mca_rzp".to_string()), + }, + ConnectorInfo { + gateway_name: "stripe".to_string(), + gateway_id: Some("mca_strp".to_string()), + }, + ], + }, + VolumeSplit { + split: 50, + output: vec![ConnectorInfo { + gateway_name: "adyen".to_string(), + gateway_id: Some("mca_ady".to_string()), + }], + }, + ]), + vec!["stripe", "adyen"], + ), + ]; + + for (name, output, expected_eligible_names) in test_outputs { + let connectors_for_eligibility = extract_connectors_for_eligibility(&output); + let eligible = compute_routing_evaluate_eligibility( + Some(&bundle), + ¶ms, + &connectors_for_eligibility, + ); + + println!( + "FORM {name}\n extracted={:?}\n eligible={:?}\n expected={:?}", + connector_names(&connectors_for_eligibility), + connector_names(&eligible), + expected_eligible_names + ); + + assert_eq!( + connector_names(&eligible), + expected_eligible_names, + "unexpected eligible connectors for output form {name}" + ); + } + } +} diff --git a/src/euclid/types.rs b/src/euclid/types.rs index 569d94e1..dce9ba33 100644 --- a/src/euclid/types.rs +++ b/src/euclid/types.rs @@ -376,27 +376,16 @@ pub struct KeysConfig { pub keys: HashMap, } -/// Structure for the [default] section in the TOML -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct DefaultConfig { - pub output: Vec, -} - /// The complete TOML configuration structure #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TomlConfig { pub keys: KeysConfig, - pub default: DefaultConfig, - #[serde(default)] - pub constraint_graph: crate::euclid::cgraph::ConstraintGraph, } impl Default for TomlConfig { fn default() -> Self { Self { keys: KeysConfig::default(), - default: DefaultConfig::default(), - constraint_graph: crate::euclid::cgraph::ConstraintGraph::default(), } } } @@ -408,9 +397,3 @@ impl Default for KeysConfig { } } } - -impl Default for DefaultConfig { - fn default() -> Self { - Self { output: Vec::new() } - } -} From 8a2fbabe60d0840edf2fb9b0951308c029eac5f6 Mon Sep 17 00:00:00 2001 From: Harshvardhan Bahukhandi <90124977+itsharshvb@users.noreply.github.com> Date: Mon, 23 Mar 2026 19:25:54 +0530 Subject: [PATCH 65/95] chore: change extraEnvVars from list to map for proper values merging (#215) --- helm-charts/templates/deployment.yaml | 10 ++++++++-- helm-charts/values.yaml | 19 +++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/helm-charts/templates/deployment.yaml b/helm-charts/templates/deployment.yaml index a6f7bc81..a164299c 100644 --- a/helm-charts/templates/deployment.yaml +++ b/helm-charts/templates/deployment.yaml @@ -64,8 +64,14 @@ spec: env: - name: GROOVY_RUNNER_HOST value: "{{ include "decision-engine.groovyRunnerName" . }}:{{ .Values.groovyRunner.service.port }}" - {{- with .Values.extraEnvVars }} - {{- toYaml . | nindent 12 }} + {{- range $name, $value := .Values.extraEnvVars }} + - name: {{ $name }} + {{- if and (kindIs "map" $value) $value.valueFrom }} + valueFrom: + {{- toYaml $value.valueFrom | nindent 16 }} + {{- else }} + value: {{ $value | quote }} + {{- end }} {{- end }} livenessProbe: diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 511932ad..434e724e 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -219,8 +219,23 @@ routingConfig: # Path to mount routing config files mountPath: "/app" -# Additional environment variables to inject into the main container -extraEnvVars: [] +# Additional environment variables to inject into the main container (map format for proper merging) +# Supports both simple values and valueFrom references for secrets/configmaps +extraEnvVars: {} + # Simple value example: + # MY_VAR: "my-value" + # Secret reference example: + # DB_PASSWORD: + # valueFrom: + # secretKeyRef: + # name: decision-engine-secrets + # key: LOCKER__PG_DATABASE__PG_PASSWORD + # ConfigMap reference example: + # APP_CONFIG: + # valueFrom: + # configMapKeyRef: + # name: app-config + # key: config.json # Istio configuration (optional) istio: From fcc02b93bf809698099ad17b62f6ada0a76c2aac Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Tue, 24 Mar 2026 15:55:39 +0530 Subject: [PATCH 66/95] refactor: startup logs (#211) --- config/development.toml | 2 +- config/docker-configuration.toml | 2 +- helm-charts/config/development.toml | 732 +++++++++++++++++++++++++++- src/app.rs | 51 +- src/bin/open_router.rs | 11 +- src/logger/formatter.rs | 16 + src/metrics.rs | 8 +- 7 files changed, 808 insertions(+), 14 deletions(-) mode change 120000 => 100644 helm-charts/config/development.toml diff --git a/config/development.toml b/config/development.toml index 41e508f9..6bb23dfd 100644 --- a/config/development.toml +++ b/config/development.toml @@ -1,7 +1,7 @@ [log.console] enabled = true level = "DEBUG" -log_format = "default" +log_format = "json" [server] host = "127.0.0.1" diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index 11febcc8..bc79e97d 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -1,7 +1,7 @@ [log.console] enabled = true level = "DEBUG" -log_format = "default" +log_format = "json" [server] host = "0.0.0.0" diff --git a/helm-charts/config/development.toml b/helm-charts/config/development.toml deleted file mode 120000 index 7f052ec6..00000000 --- a/helm-charts/config/development.toml +++ /dev/null @@ -1 +0,0 @@ -../../config/development.toml \ No newline at end of file diff --git a/helm-charts/config/development.toml b/helm-charts/config/development.toml new file mode 100644 index 00000000..6bb23dfd --- /dev/null +++ b/helm-charts/config/development.toml @@ -0,0 +1,731 @@ +[log.console] +enabled = true +level = "DEBUG" +log_format = "json" + +[server] +host = "127.0.0.1" +port = 8080 + +[metrics] +host = "127.0.0.1" +port = 9094 + +[limit] +request_count = 1 +duration = 60 + +[database] +username = "root" +password = "root" +host = "127.0.0.1" +port = 3306 +dbname = "jdb" + +[pg_database] +pg_username = "db_user" +pg_password = "db_pass" +pg_host = "localhost" +pg_port = 5432 +pg_dbname = "decision_engine_db" + + +[redis] +host = "127.0.0.1" +port = 6379 +pool_size = 5 +reconnect_max_attempts = 5 +reconnect_delay = 5 +use_legacy_version = false +stream_read_count = 1 +auto_pipeline = true +disable_auto_backpressure = false +max_in_flight_commands = 5000 +default_command_timeout = 30 +unresponsive_timeout = 10 +max_feed_count = 200 + +[cache] +tti = 7200 # i.e. 2 hours +max_capacity = 5000 + +[cache_config] +service_config_redis_prefix = "DE_service_config_" +service_config_ttl = 300 # 5 minutes + +[compression_filepath] +zstd_compression_filepath = "/tmp/extra-paths/redis-zstd-dictionaries/sbx" + +[tenant_secrets] +public = { schema = "public" } + +[routing_config.keys] +billing_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } +issuer_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } +business_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } +business_label = { type = "str_value" } +metadata = { type = "udf" } +pay_later = { type = "enum", values = "affirm, alma, afterpay_clearpay, klarna, pay_bright, atome, walley" } +gift_card = { type = "enum", values = "givex, pay_safe_card" } +upi = { type = "enum", values = "upi_collect, upi_intent" } +wallet = { type = "enum", values = "amazon_pay, apple_pay, google_pay, paypal, ali_pay, ali_pay_hk, dana, mb_way, mobile_pay, samsung_pay, twint, vipps, touch_n_go, swish, we_chat_pay, go_pay, gcash, momo, kakao_pay, cashapp, mifinity, paze" } +voucher = { type = "enum", values = "boleto, efecty, pago_efectivo, red_compra, red_pagos, indomaret, alfamart, oxxo, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy" } +bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, multibanco, pix, pse, permata_bank_transfer, bca_bank_transfer, bni_va, bri_va, cimb_va, danamon_va, mandiri_va, local_bank_transfer, instant_bank_transfer" } +bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } +customer_device_display_size = { type = "enum", values = "size320x568, size375x667, size390x844, size414x896, size428x926, size768x1024, size834x1112, size834x1194, size1024x1366, size1280x720, size1366x768, size1440x900, size1920x1080, size2560x1440, size3840x2160, size500x600, size600x400, size360x640, size412x915, size800x1280" } +customer_device_type = { type = "enum", values = "mobile, tablet, desktop, gaming_console" } +customer_device_platform = { type = "enum", values = "web, android, ios" } +bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } +crypto = { type = "enum", values = "crypto_currency" } +reward = { type = "enum", values = "evoucher, classic_reward" } +card_redirect = { type = "enum", values = "knet, benefit, momo_atm, card_redirect" } +real_time_payment = { type = "enum", values = "fps, duit_now, prompt_pay, viet_qr" } +open_banking = { type = "enum", values = "open_banking_pis" } +mobile_payment = { type = "enum", values = "direct_carrier_billing" } +payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } +card_type = { type = "enum", values = "debit, credit" } +card = { type = "enum", values = "debit, credit" } +payment_card_bin = { type = "udf", exact_length = 6, regex = "^[0-9]{6}$" } +issuer_name = { type = "str_value", min_length = 1 } +payment_card_type = { type = "enum", values = "CREDIT, DEBIT" } +mandate_acceptance_type = { type = "enum", values = "online, offline" } +mandate_type = { type = "enum", values = "single_use, multi_use" } +card_network = { type = "enum", values = "visa, VISA, Visa, visaCard, mastercard, MASTERCARD, MasterCard, masterCard, mastercardCard, master_card, Master_card, Master_Card, Master Card, Mastercard, american_express, AMERICANEXPRESS, AmericanExpress, americanExpress, americanExpressCard, amex, AMEX, Amex, jcb, JCB, Jcb, diners_club, DINERSCLUB, DinersClub, dinersClub, dinersClubCard, discover, DISCOVER, Discover, discoverCard, cartes_bancaires, CARTESBANCAIRES, CartesBancaires, cartesBancaires, union_pay, UNIONPAY, UnionPay, unionPay, interac, INTERAC, Interac, rupay, RUPAY, RuPay, ruPay, maestro, MAESTRO, Maestro, star, STAR, Star, pulse, PULSE, Pulse, accel, ACCEL, Accel, nyce, NYCE, Nyce" } +payment_type = { type = "enum", values = "normal, new_mandate, setup_mandate, recurring_mandate, non_mandate" } +payment_method_type = { type = "enum", values = "ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, boleto, bca_bank_transfer, bni_va, bri_va, card, card_redirect, cimb_va, classic_reward, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eft, eps, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, multibanco, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, paypal, paze, pix, pay_safe_card, przelewy24, prompt_pay, pse, red_compra, red_pagos, samsung_pay, sepa, sepa_bank_transfer, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, direct_carrier_billing, instant_bank_transfer" } +authentication_type = { type = "enum", values = "three_ds, no_three_ds" } +capture_methods = { type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic" } +setup_future_usage = { type = "enum", values = "on_session, off_session" } +payment_card_network = { type = "enum", values = "visa, mastercard, american_express, jcb, diners_club, discover, cartes_bancaires, union_pay, interac, rupay, maestro" } +amount = { type = "integer", min = 0 } +login_date = { type = "str_value" } +currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +payment_card_issuer_country = { type = "enum", values = "AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, US" } + +card_bin = { type = "str_value", exact_length = 6, regex = "^[0-9]{6}$" } +extended_card_bin = { type = "str_value", exact_length = 8, regex = "^[0-9]{8}$" } +capture_method = { type = "enum", values = "automatic, manual" } +new_customer = { type = "udf" } +udf1 = { type = "str_value" } +order_udf1 = { type = "global_ref" } +payment_payment_method = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } +payment_payment_source = { type = "enum", values = "net.one97.paytm, @paytm" } +txn_is_emi = { type = "enum", values = "true, false" } + +[debit_routing_config] +fraud_check_fee = 1.0 + +[debit_routing_config.network_fee] +visa = { percentage = 0.1375, fixed_amount = 2.0 } +mastercard = { percentage = 0.15, fixed_amount = 4.0 } +accel = { percentage = 0.0, fixed_amount = 4.0 } +nyce = { percentage = 0.10, fixed_amount = 1.5 } +pulse = { percentage = 0.10, fixed_amount = 3.0 } +star = { percentage = 0.10, fixed_amount = 1.5 } + +[debit_routing_config.interchange_fee] +regulated = { percentage = 0.05, fixed_amount = 0.21 } + +[debit_routing_config.interchange_fee.non_regulated] +merchant_category_code_0001.visa = { percentage = 1.65, fixed_amount = 15.0 } +merchant_category_code_0001.mastercard = { percentage = 1.65, fixed_amount = 15.0 } +merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 4.0 } +merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 21.3125 } +merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 15.0 } +merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 15.0 } + +[pm_filters.default] +google_pay = { country = "AL,DZ,AS,AO,AG,AR,AU,AT,AZ,BH,BY,BE,BR,BG,CA,CL,CO,HR,CZ,DK,DO,EG,EE,FI,FR,DE,GR,HK,HU,IN,ID,IE,IL,IT,JP,JO,KZ,KE,KW,LV,LB,LT,LU,MY,MX,NL,NZ,NO,OM,PK,PA,PE,PH,PL,PT,QA,RO,RU,SA,SG,SK,ZA,ES,LK,SE,CH,TW,TH,TR,UA,AE,GB,US,UY,VN" } +apple_pay = { country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US,KR,VN,MA,ZA,VA,CL,SV,GT,HN,PA", currency = "AED,AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" } +paypal = { currency = "AUD,BRL,CAD,CHF,CNY,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,MYR,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD" } +klarna = { country = "AT,BE,DK,FI,FR,DE,IE,IT,NL,NO,ES,SE,GB,US,CA", currency = "USD,GBP,EUR,CHF,DKK,SEK,NOK,AUD,PLN,CAD" } +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "US,CA,GB,AU,NZ", currency = "GBP,AUD,NZD,CAD,USD" } +giropay = { country = "DE", currency = "EUR" } +eps = { country = "AT", currency = "EUR" } +sofort = { country = "ES,GB,SE,AT,NL,DE,CH,BE,FR,FI,IT,PL", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } + +[pm_filters.stripe] +google_pay = { country = "AU, AT, BE, BR, BG, CA, HR, CZ, DK, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IT, JP, LV, KE, LT, LU, MY, MX, NL, NZ, NO, PL, PT, RO, SG, SK, ZA, ES, SE, CH, TH, AE, GB, US, GI, LI, MT, CY, PH, IS, AR, CL, KR, IL"} +apple_pay = { country = "AU, AT, BE, BR, BG, CA, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, HK, IE, IT, JP, LV, LI, LT, LU, MT, MY, MX, NL, NZ, NO, PL, PT, RO, SK, SG, SI, ZA, ES, SE, CH, GB, AE, US" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,CAD,CHF,CZK,DKK,EUR,GBP,NOK,NZD,PLN,SEK,USD" } +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,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TN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"} +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "US,CA,GB,AU,NZ,FR,ES", currency = "USD,CAD,GBP,AUD,NZD" } +cashapp = { country = "US", currency = "USD" } +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +multibanco = { country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GI,GR,HU,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB", currency = "EUR" } +ach = { country = "US", currency = "USD" } +revolut_pay = { currency = "EUR,GBP" } +sepa = {country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GI,GR,HU,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB,IS,LI", currency="EUR"} +bacs = { country = "GB", currency = "GBP" } +becs = { country = "AU", currency = "AUD" } +sofort = {country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IS,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE", currency = "EUR" } +blik = {country="PL", currency = "PLN"} +bancontact_card = { country = "BE", currency = "EUR" } +przelewy24 = { country = "PL", currency = "EUR,PLN" } +online_banking_fpx = { country = "MY", currency = "MYR" } +amazon_pay = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW,US", currency = "USD,AUD,GBP,DKK,EUR,HKD,JPY,NZD,NOK,ZAR,SEK,CHF" } +we_chat_pay = { country = "CN", currency = "CNY,AUD,CAD,EUR,GBP,HKD,JPY,SGD,USD,DKK,NOK,SEK,CHF" } +ali_pay = {country = "CN", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,MYR,NZD,SGD,USD"} + +[pm_filters.volt] +open_banking = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "GBP,EUR,DKK,NOK,PLN,SEK" } +open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "GBP" } + +[pm_filters.razorpay] +upi_collect = { country = "IN", currency = "INR" } + +[pm_filters.phonepe] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } + +[pm_filters.paytm] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } + +[pm_filters.hyperpg] +credit = { currency = "INR,USD,GBP,EUR" } +debit = { currency = "INR,USD,GBP,EUR" } + +[pm_filters.plaid] +open_banking_pis = { currency = "EUR,GBP" } + +[pm_filters.adyen] +google_pay = { country = "AT, AU, BE, BG, CA, HR, CZ, EE, FI, FR, DE, GR, HK, DK, HU, IE, IT, LV, LT, LU, NL, NO, PL, PT, RO, SK, ES, SE, CH, GB, US, NZ, SG", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, GG, HU, IE, IM, IT, LV, LI, LT, LU, MT, NL, NO, PL, PT, RO, SK, SI, SE, ES, CH, GB, US, PR, CA, AU, HK, NZ, SG", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, CHF, UAH, ARS, BRL, CLP, COP, CRC, DOP, GTQ, HNL, MXN, PAB, USD, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, ILS, QAR, SAR, AED, CAD" } +paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" } +mobile_pay = { country = "DK,FI", currency = "DKK,SEK,NOK,EUR" } +ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" } +we_chat_pay = { country = "AU,NZ,CN,JP,HK,SG,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,LI,MT,SI,GR,PT,IT,CA,US", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,NZD,SGD,USD" } +mb_way = { country = "PT", currency = "EUR" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD" } +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "AU,NZ,ES,GB,FR,IT,CA,US", currency = "GBP" } +pay_bright = { country = "CA", currency = "CAD" } +walley = { country = "SE,NO,DK,FI", currency = "DKK,EUR,NOK,SEK" } +giropay = { country = "DE", currency = "EUR" } +eps = { country = "AT", currency = "EUR" } +sofort = { not_available_flows = { capture_method = "manual" }, country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR" } +ideal = { not_available_flows = { capture_method = "manual" }, country = "NL", currency = "EUR" } +blik = { country = "PL", currency = "PLN" } +trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +online_banking_czech_republic = { country = "CZ", currency = "EUR,CZK" } +online_banking_finland = { country = "FI", currency = "EUR" } +online_banking_poland = { country = "PL", currency = "PLN" } +online_banking_slovakia = { country = "SK", currency = "EUR,CZK" } +bancontact_card = { country = "BE", currency = "EUR" } +ach = { country = "US", currency = "USD" } +bacs = { country = "GB", currency = "GBP" } +sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR" } +ali_pay_hk = { country = "HK", currency = "HKD" } +bizum = { country = "ES", currency = "EUR" } +go_pay = { country = "ID", currency = "IDR" } +kakao_pay = { country = "KR", currency = "KRW" } +momo = { country = "VN", currency = "VND" } +gcash = { country = "PH", currency = "PHP" } +online_banking_fpx = { country = "MY", currency = "MYR" } +online_banking_thailand = { country = "TH", currency = "THB" } +touch_n_go = { country = "MY", currency = "MYR" } +atome = { country = "MY,SG", currency = "MYR,SGD" } +swish = { country = "SE", currency = "SEK" } +permata_bank_transfer = { country = "ID", currency = "IDR" } +bca_bank_transfer = { country = "ID", currency = "IDR" } +bni_va = { country = "ID", currency = "IDR" } +bri_va = { country = "ID", currency = "IDR" } +cimb_va = { country = "ID", currency = "IDR" } +danamon_va = { country = "ID", currency = "IDR" } +mandiri_va = { country = "ID", currency = "IDR" } +alfamart = { country = "ID", currency = "IDR" } +indomaret = { country = "ID", currency = "IDR" } +open_banking_uk = { country = "GB", currency = "GBP" } +oxxo = { country = "MX", currency = "MXN" } +pay_safe_card = { country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,AE,GB,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU" } +seven_eleven = { country = "JP", currency = "JPY" } +lawson = { country = "JP", currency = "JPY" } +mini_stop = { country = "JP", currency = "JPY" } +family_mart = { country = "JP", currency = "JPY" } +seicomart = { country = "JP", currency = "JPY" } +pay_easy = { country = "JP", currency = "JPY" } +pix = { country = "BR", currency = "BRL" } +boleto = { country = "BR", currency = "BRL" } + +[pm_filters.affirm] +affirm = { country = "CA,US", currency = "CAD,USD" } + +[pm_filters.airwallex] +credit = { country = "AU,HK,SG,NZ,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MO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, PA, PE, PH, PL, QA, RO, SA, SG, ZA, LK, SE, TW, TH, TR, UA, AE, UY, VN, AT, BE, HR, EE, FI, FR, DE, GR, IE, IT, LV, LT, LU, NL, PL, PT, SK, ES, SE, RO, BG", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +paypal = { currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,JPY,MYR,MXN,NOK,NZD,PHP,PLN,GBP,RUB,SGD,SEK,CHF,THB,USD" } +klarna = { currency = "EUR, DKK, NOK, PLN, SEK, CHF, GBP, USD, CZK" } +trustly = {currency="DKK, EUR, GBP, NOK, PLN, SEK" } +blik = { country="PL" , currency = "PLN" } +ideal = { country="NL" , currency = "EUR" } +atome = { country = "SG, MY" , currency = "SGD, MYR" } +skrill = { country="AL, DZ, AD, AR, AM, AW, AU, AT, AZ, BS, BD, BE, BJ, BO, BA, BW, BR, BN, BG, KH, CM, CA, CL, CN, CX, CO, CR , HR, CW, CY, CZ, DK, DM, DO, EC, EG, EE , FK, FI, GE, DE, GH, GI, GR, GP, GU, GT, GG, HK, HU, IS, IN, ID , IQ, IE, IM, IL, IT, JE , KZ, KE , KR, KW, KG, LV , LS, LI, LT, LU , MK, MG, MY, MV, MT, MU, YT, MX, MD, MC, MN, ME, MA, NA, NP, NZ, NI, NE, NO, PK , PA, PY, PE, PH, PL, PT, PR, QA, RO , SM , SA, SN , SG, SX, SK, SI, ZA, SS, ES, LK, SE, CH, TW, TZ, TH, TN, AE, GB, UM, UY, VN, VG, VI, US" , currency = "EUR, GBP, USD" } +indonesian_bank_transfer = { country="ID" , currency = "IDR" } + +[pm_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N,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } + +[pm_filters.xendit] +credit = { country = "ID,PH", currency = "IDR,PHP,USD,SGD,MYR" } +debit = { country = "ID,PH", currency = "IDR,PHP,USD,SGD,MYR" } +qris = {currency = "IDR" } + +[pm_filters.tsys] +credit = { country = "NA", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL, BYN, KPW, STN, MRU, VES" } +debit = { country = "NA", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL, BYN, KPW, STN, MRU, VES" } + +[pm_filters.billwerk] +credit = { country = "DE, DK, FR, SE", currency = "DKK, NOK" } +debit = { country = "DE, DK, FR, SE", currency = "DKK, NOK" } + +[pm_filters.fiservemea] +credit = { country = "DE, FR, IT, NL, PL, ES, ZA, GB, AE", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,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Y, ES, PT, DE, IT, FR, NL, BE, AT, PL, CH, GB, IE, LU, DK, SE, NO, FI, IN, AE", currency = "ARS, BRL, CLP, MXN, UYU, EUR, PLN, CHF, GBP, DKK, SEK, NOK, INR, AED" } + +[pm_filters.hipay] +credit = { country = "GB, CH, SE, DK, NO, PL, CZ, US, CA, JP, HK, AU, ZA", currency = "EUR, GBP, CHF, SEK, DKK, NOK, PLN, CZK, USD, CAD, JPY, HKD, AUD, ZAR" } +debit = { country = "GB, CH, SE, DK, NO, PL, CZ, US, CA, JP, HK, AU, ZA", currency = "EUR, GBP, CHF, SEK, DKK, NOK, PLN, CZK, USD, CAD, JPY, HKD, AUD, ZAR" } + +[pm_filters.moneris] +credit = { country = "AE, AF, AL, AO, AR, AT, AU, AW, AZ, BA, BB, BD, BE, BG, BH, BI, BM, BN, BO, BR, BT, BY, BZ, CH, CL, CN, CO, CR, CU, CV, CY, CZ, DE, DJ, DK, DO, DZ, EE, EG, ES, FI, FJ, FR, GB, GE, GI, GM, GN, GR, GT, GY, HK, HN, HR, HT, HU, ID, IE, IL, IN, IS, IT, JM, JO, JP, KE, KM, KR, KW, KY, KZ, LA, LK, LR, LS, LV, LT, LU, MA, MD, MG, MK, MO, MR, MT, MU, MV, MW, MX, MY, MZ, NA, NG, NI, NL, NO, NP, NZ, OM, PE, PG, PK, PL, PT, PY, QA, RO, RS, RU, RW, SA, SB, SC, SE, SG, SH, SI, SK, SL, SR, SV, SZ, TH, TJ, TM, TN, TR, TT, TW, TZ, UG, US, UY, UZ, VN, VU, WS, ZA, ZM", currency = "AED, AFN, ALL, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BTN, BYN, BZD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GEL, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JOD, JPY, KES, KMF, KRW, KWD, KYD, KZT, LAK, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SRD, SVC, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VND, VUV, WST, XCD, XOF, XPF, ZAR, ZMW" } +debit = { country = "AE, AF, AL, AO, AR, AT, AU, AW, AZ, BA, BB, BD, BE, BG, BH, BI, BM, BN, BO, BR, BT, BY, BZ, CH, CL, CN, CO, CR, CU, CV, CY, CZ, DE, DJ, DK, DO, DZ, EE, EG, ES, FI, FJ, FR, GB, GE, GI, GM, GN, GR, GT, GY, HK, HN, HR, HT, HU, ID, IE, IL, IN, IS, IT, JM, JO, JP, KE, KM, KR, KW, KY, KZ, LA, LK, LR, LS, LV, LT, LU, MA, MD, MG, MK, MO, MR, MT, MU, MV, MW, MX, MY, MZ, NA, NG, NI, NL, NO, NP, NZ, OM, PE, PG, PK, PL, PT, PY, QA, RO, RS, RU, RW, SA, SB, SC, SE, SG, SH, SI, SK, SL, SR, SV, SZ, TH, TJ, TM, TN, TR, TT, TW, TZ, UG, US, UY, UZ, VN, VU, WS, ZA, ZM", currency = "AED, AFN, ALL, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BTN, BYN, BZD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GEL, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JOD, JPY, KES, KMF, KRW, KWD, KYD, KZT, LAK, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SRD, SVC, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VND, VUV, WST, XCD, XOF, XPF, ZAR, ZMW" } + +[pm_filters.opennode] +crypto_currency = { country = "US, CA, GB, AU, BR, MX, SG, PH, NZ, ZA, JP, AT, BE, HR, CY, EE, FI, FR, DE, GR, IE, IT, LV, LT, LU, MT, NL, PT, SK, SI, ES", currency = "USD, CAD, GBP, AUD, BRL, MXN, SGD, PHP, NZD, ZAR, JPY, EUR" } + +[pm_filters.bambora] +credit = { country = "US,CA", currency = "USD" } +debit = { country = "US,CA", currency = "USD" } + +[pm_filters.bankofamerica] +credit = { country = "AF,AL,DZ,AD,AO,AI,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BA,BW,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CO,KM,CD,CG,CK,CR,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MG,MW,MY,MV,ML,MT,MH,MR,MU,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PL,PT,PR,QA,CG,RO,RW,KN,LC,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SO,ZA,GS,ES,LK,SR,SJ,SZ,SE,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google_pay = { country = "AU,AT,BE,BR,CA,CL,CO,CR,CY,CZ,DK,DO,EC,EE,SV,FI,FR,DE,GR,GT,HN,HK,HU,IS,IN,IE,IL,IT,JP,JO,KZ,KW,LV,LI,LT,LU,MY,MT,MX,NL,NZ,NO,OM,PA,PY,PE,PL,PT,QA,RO,SA,SG,SK,SI,ZA,KR,ES,SE,CH,TW,AE,GB,US,UY,VN,VA", currency = "USD" } +samsung_pay = { country = "AU,BH,BR,CA,CN,DK,FI,FR,DE,HK,IN,IT,JP,KZ,KR,KW,MY,NZ,NO,OM,QA,SA,SG,ZA,ES,SE,CH,TW,AE,GB,US", currency = "USD" } + +[pm_filters.cybersource] +credit = { currency = "USD,GBP,EUR,PLN,SEK,XOF,CAD,KWD,QAR" } +debit = { currency = "USD,GBP,EUR,PLN,SEK,XOF,CAD,KWD,QAR" } +apple_pay = { currency = "ARS, CAD, CLP, COP, CNY, EUR, HKD, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, GBP, AED, USD, PLN, SEK" } +google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" } +samsung_pay = { currency = "USD,GBP,EUR,SEK" } +paze = { currency = "USD,SEK" } + +[pm_filters.barclaycard] +credit = { currency = "USD,GBP,EUR,PLN,SEK" } +debit = { currency = "USD,GBP,EUR,PLN,SEK" } +google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" } +apple_pay = { currency = "ARS, CAD, CLP, COP, CNY, EUR, HKD, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, GBP, AED, USD, PLN, SEK" } + + +[pm_filters.globepay] +ali_pay = { country = "GB",currency = "GBP,CNY" } +we_chat_pay = { country = "GB",currency = "GBP,CNY" } + + +[pm_filters.itaubank] +pix = { country = "BR", currency = "BRL" } + +[pm_filters.nexinets] +credit = { country = "DE",currency = "EUR" } +debit = { country = "DE",currency = "EUR" } +ideal = { country = "DE",currency = "EUR" } +giropay = { country = "DE",currency = "EUR" } +sofort = { country = "DE",currency = "EUR" } +eps = { country = "DE",currency = "EUR" } +apple_pay = { country = "DE",currency = "EUR" } +paypal = { country = "DE",currency = "EUR" } + + +[pm_filters.nuvei] +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW,US",currency = "AED,ALL,AMD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,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } +giropay = { currency = "EUR" } +ideal = { currency = "EUR" } +sofort = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } +eps = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND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,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IS,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB,US,AU,HK,SG,SA,AE,BH,MX,AR,CL,CO,PE", currency = "AED,AFN,ALL,AMD,ANG,AOA,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +google_pay = { country = "AL,DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, CA, BG, CL, CO, HR, DK, DO, EE, EG, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, SA, SG, SK, ZA, ES, LK, SE, CH, TH, TW, TR, UA, AE, US, UY, VN", currency = "AED, ALL, AOA, AUD, AZN, BGN, BHD, BRL, CAD, CHF, CLP, COP, CZK, DKK, DOP, DZD, EGP, EUR, GBP, HKD, HUF, IDR, ILS, INR, JPY, KES, KWD, KZT, LKR, MXN, MYR, NOK, NZD, OMR, PAB, PEN, PHP, PKR, PLN, QAR, RON, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, UYU, VND, XCD, ZAR" } +apple_pay = { country = "AM,US, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" } + +[pm_filters.checkbook] +ach = { country = "US", currency = "USD" } + +[pm_filters.nexixpay] +credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU,AU,BR,US", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" } +debit = { country = "AT,BE,CY,EE,FI,FR,DE,GR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L,BSD,BTN,BWP,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW" } + +[pm_filters.iatapay] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } +ideal = { country = "NL", currency = "EUR" } +local_bank_redirect = { country = "AT,BE,EE,FI,FR,DE,IE,IT,LV,LT,LU,NL,PT,ES,GB,IN,HK,SG,TH,BR,MX,GH,VN,MY,PH,JO,AU,CO", currency = "EUR,GBP,INR,HKD,SGD,THB,BRL,MXN,GHS,VND,MYR,PHP,JOD,AUD,COP" } +duit_now = { country = "MY", currency = "MYR" } +fps = { country = "GB", currency = "GBP" } +prompt_pay = { country = "TH", currency = "THB" } +viet_qr = { country = "VN", currency = "VND" } + +[pm_filters.coinbase] +crypto_currency = { country = "ZA,US,BR,CA,TR,SG,VN,GB,DE,FR,ES,PT,IT,NL,AU" } + +[pm_filters.novalnet] +credit = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,C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, AR, BR, CL, CO, CR, SV, GT, MX, PY, PE, UY, BS, DO, AM, KZ, NZ", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, AZN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } +google_pay = { country = "AO, EG, KE, ZA, AR, BR, CL, CO, MX, PE, UY, AG, DO, AE, TR, SA, QA, OM, LB, KW, JO, IL, BH, KZ, VN, TH, SG, MY, JP, HK, LK, IN, US, CA, GB, UA, CH, SE, ES, SK, PT, RO, PL, NO, NL, LU, LT, LV, IE, IT, HU, GR, DE, FR, FI, EE, DK, CZ, HR, BG, BE, AT, AL", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +paypal = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,CL,CN,CO,CR,CU,CY,CZ,DE,DJ,DK,DO,DZ,EE,EG,ET,ES,FI,FJ,FR,GB,GE,GH,GI,GM,GR,GT,GY,HK,HN,HR,HU,ID,IE,IL,IN,IS,IT,JM,JO,JP,KE,KH,KR,KW,KY,KZ,LB,LK,LT,LV,LY,MA,MC,MD,ME,MG,MK,MN,MO,MT,MV,MW,MX,MY,NG,NI,NO,NP,NL,NZ,OM,PA,PE,PG,PH,PK,PL,PT,PY,QA,RO,RS,RU,RW,SA,SB,SC,SE,SG,SH,SI,SK,SL,SO,SM,SR,ST,SV,SY,TH,TJ,TN,TO,TR,TW,TZ,UA,UG,US,UY,UZ,VE,VA,VN,VU,WS,CF,AG,DM,GD,KN,LC,VC,YE,ZA,ZM", currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,GBP,GEL,GHS,GIP,GMD,GTQ,GYD,HKD,HNL,HRK,HUF,IDR,ILS,INR,ISK,JMD,JOD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,LYD,MAD,MDL,MGA,MKD,MNT,MOP,MVR,MWK,MXN,MYR,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STN,SVC,SYP,THB,TJS,TND,TOP,TRY,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,YER,ZAR,ZMW" } +sepa = {country = "FR, IT, GR, BE, BG, FI, EE, HR, IE, DE, DK, LT, LV, MT, LU, AT, NL, PT, RO, PL, SK, SE, ES, SI, HU, CZ, CY, GB, LI, NO, IS, MC, CH, YT, PM, SM", currency="EUR"} +sepa_guarenteed_debit = {country = "AT, CH, DE", currency="EUR"} + +[pm_filters.braintree] +credit = { country = "AD,AT,AU,BE,BG,CA,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GG,GI,GR,HK,HR,HU,IE,IM,IT,JE,LI,LT,LU,LV,MT,MC,MY,NL,NO,NZ,PL,PT,RO,SE,SG,SI,SK,SM,US", currency = "AED,AMD,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BIF,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G, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" } +apple_pay = { currency = "USD, CAD" } + +[pm_filters.helcim] +credit = { country = "US, CA", currency = "USD, CAD" } +debit = { country = "US, CA", currency = "USD, CAD" } + +[pm_filters.globalpay] +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,SZ,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,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G,PYG,GNF,GYD,HKD,UAH,ISK,INR,IRR,IQD,JMD,JOD,KES,PGK,HRK,KWD,AOA,MMK,LAK,GEL,LBP,ALL,HNL,SLL,LRD,LYD,SZL,LSL,MGA,MWK,MYR,MUR,MXN,MDL,MAD,MZN,NGN,ERN,NAD,NPR,ANG,ILS,TWD,NZD,BTN,KPW,NOK,TOP,PKR,MOP,UYU,PHP,GBP,BWP,QAR,GTQ,ZAR,OMR,KHR,RON,MVR,IDR,RUB,RWF,SHP,SAR,RSD,SCR,SGD,PEN,SBD,KGS,SOS,TJS,SSP,LKR,SDG,SRD,SEK,CHF,SYP,BDT,WST,TZS,KZT,TTD,MNT,TND,TRY,TMT,AED,UGX,USD,UZS,VUV,KRW,YER,JPY,CNY,ZMW,ZWL,PLN,CLF,STD,CUC" } +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +sofort = { country = "AT,BE,DE,ES,IT,NL", currency = "EUR" } + +[pm_filters.jpmorgan] +debit = { country = "CA, GB, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, EUR, GBP, AUD, NZD, SGD, CAD, JPY, HKD, KRW, TWD, MXN, BRL, DKK, NOK, ZAR, SEK, CHF, CZK, PLN, TRY, AFN, ALL, DZD, AOA, ARS, AMD, AWG, AZN, BSD, BDT, BBD, BYN, BZD, BMD, BOB, BAM, BWP, BND, BGN, BIF, BTN, XOF, XAF, XPF, KHR, CVE, KYD, CLP, CNY, COP, KMF, CDF, CRC, HRK, DJF, DOP, XCD, EGP, ETB, FKP, FJD, GMD, GEL, GHS, GIP, GTQ, GYD, HTG, HNL, HUF, ISK, INR, IDR, ILS, JMD, KZT, KES, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRU, MUR, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, PGK, NIO, NGN, PKR, PAB, PYG, PEN, PHP, QAR, RON, RWF, SHP, WST, STN, SAR, RSD, SCR, SLL, SBD, SOS, LKR, SRD, SZL, TJS, TZS, THB, TOP, TTD, UGX, UAH, AED, UYU, UZS, VUV, VND, YER, ZMW" } +credit = { country = "CA, GB, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, EUR, GBP, AUD, NZD, SGD, CAD, JPY, HKD, KRW, TWD, MXN, BRL, DKK, NOK, ZAR, SEK, CHF, CZK, PLN, TRY, AFN, ALL, DZD, AOA, ARS, AMD, AWG, AZN, BSD, BDT, BBD, BYN, BZD, BMD, BOB, BAM, BWP, BND, BGN, BIF, BTN, XOF, XAF, XPF, KHR, CVE, KYD, CLP, CNY, COP, KMF, CDF, CRC, HRK, DJF, DOP, XCD, EGP, ETB, FKP, FJD, GMD, GEL, GHS, GIP, GTQ, GYD, HTG, HNL, HUF, ISK, INR, IDR, ILS, JMD, KZT, KES, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRU, MUR, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, PGK, NIO, NGN, PKR, PAB, PYG, PEN, PHP, QAR, RON, RWF, SHP, WST, STN, SAR, RSD, SCR, SLL, SBD, SOS, LKR, SRD, SZL, TJS, TZS, THB, TOP, TTD, UGX, UAH, AED, UYU, UZS, VUV, VND, YER, ZMW" } + +[pm_filters.bitpay] +crypto_currency = { country = "US, CA, GB, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, AUD, CAD, GBP, MXN, NZD, CHF, EUR"} + +[pm_filters.paybox] +debit = { country = "FR", currency = "CAD, AUD, EUR, USD" } +credit = { country = "FR", currency = "CAD, AUD, EUR, USD" } + +[pm_filters.payload] +debit = { currency = "USD,CAD" } +credit = { currency = "USD,CAD" } +ach = { currency = "USD,CAD" } + + +[pm_filters.digitalvirgo] +direct_carrier_billing = {country = "MA, CM, ZA, EG, SN, DZ, TN, ML, GN, GH, LY, GA, CG, MG, BW, SD, NG, ID, SG, AZ, TR, FR, ES, PL, GB, PT, DE, IT, BE, IE, SK, GR, NL, CH, BR, MX, AR, CL, AE, IQ, KW, BH, SA, QA, PS, JO, OM, RU" , currency = "MAD, XOF, XAF, ZAR, EGP, DZD, TND, GNF, GHS, LYD, XAF, CDF, MGA, BWP, SDG, NGN, IDR, SGD, RUB, AZN, TRY, EUR, PLN, GBP, CHF, BRL, MXN, ARS, CLP, AED, IQD, KWD, BHD, SAR, QAR, ILS, JOD, OMR" } + +[pm_filters.payu] +debit = { country = "AE, AF, AL, AM, CW, AO, AR, AU, AW, AZ, BA, BB, BG, BH, BI, BM, BN, BO, BR, BS, BW, BY, BZ, CA, CD, LI, CL, CN, CO, CR, CV, CZ, DJ, DK, DO, DZ, EG, ET, AD, FJ, FK, GG, GE, GH, GI, GM, GN, GT, GY, HK, HN, HR, HT, HU, ID, IL, IQ, IS, JM, JO, JP, KG, KH, KM, KR, KW, KY, KZ, LA, LB, LR, LS, MA, MD, MG, MK, MN, MO, MR, MV, MW, MX, MY, MZ, NA, NG, NI, BV, CK, OM, PA, PE, PG, PL, PY, QA, RO, RS, RW, SA, SB, SC, SE, SG, SH, SO, SR, SV, SZ, TH, TJ, TM, TN, TO, TR, TT, TW, TZ, UG, AS, UY, UZ, VE, VN, VU, WS, CM, AI, BJ, PF, YE, ZA, ZM, ZW", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IQD, ISK, JMD, JOD, JPY, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LRD, LSL, MAD, MDL, MGA, MKD, MNT, MOP, MRU, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NZD, OMR, PAB, PEN, PGK, PLN, PYG, QAR, RON, RSD, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SOS, SRD, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +credit = { country = "AE, AF, AL, AM, CW, AO, AR, AU, AW, AZ, BA, BB, BG, BH, BI, BM, BN, BO, BR, BS, BW, BY, BZ, CA, CD, LI, CL, CN, CO, CR, CV, CZ, DJ, DK, DO, DZ, EG, ET, AD, FJ, FK, GG, GE, GH, GI, GM, GN, GT, GY, HK, HN, HR, HT, HU, ID, IL, IQ, IS, JM, JO, JP, KG, KH, KM, KR, KW, KY, KZ, LA, LB, LR, LS, MA, MD, MG, MK, MN, MO, MR, MV, MW, MX, MY, MZ, NA, NG, NI, BV, CK, OM, PA, PE, PG, PL, PY, QA, RO, RS, RW, SA, SB, SC, SE, SG, SH, SO, SR, SV, SZ, TH, TJ, TM, TN, TO, TR, TT, TW, TZ, UG, AS, UY, UZ, VE, VN, VU, WS, CM, AI, BJ, PF, YE, ZA, ZM, ZW", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IQD, ISK, JMD, JOD, JPY, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LRD, LSL, MAD, MDL, MGA, MKD, MNT, MOP, MRU, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NZD, OMR, PAB, PEN, PGK, PLN, PYG, QAR, RON, RSD, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SOS, SRD, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +google_pay = { country = "AL, DZ, AS, AO, AR, AU, AZ, BH, BY, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, HK, HU, ID, IN, IL, JP, JO, KZ, KW, LB, MY, MX, OM, PA, PE, PL, QA, RO, SA, SG, SE, TW, TH, TR, AE, UY, VN", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PAB, PEN, PLN, QAR, RON, SAR, SGD, ZAR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } + +[pm_filters.klarna] +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,EUR,EUR,CAD,CZK,DKK,EUR,EUR,EUR,EUR,EUR,EUR,EUR,NZD,NOK,PLN,EUR,EUR,SEK,CHF,GBP,USD" } + +[pm_filters.flexiti] +flexiti = { country = "CA", currency = "CAD" } + +[pm_filters.mifinity] +mifinity = { country = "BR,CN,SG,MY,DE,CH,DK,GB,ES,AD,GI,FI,FR,GR,HR,IT,JP,MX,AR,CO,CL,PE,VE,UY,PY,BO,EC,GT,HN,SV,NI,CR,PA,DO,CU,PR,NL,NO,PL,PT,SE,RU,TR,TW,HK,MO,AX,AL,DZ,AS,AO,AI,AG,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BE,BZ,BJ,BM,BT,BQ,BA,BW,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CX,CC,KM,CG,CK,CI,CW,CY,CZ,DJ,DM,EG,GQ,ER,EE,ET,FK,FO,FJ,GF,PF,TF,GA,GM,GE,GH,GL,GD,GP,GU,GG,GN,GW,GY,HT,HM,VA,IS,IN,ID,IE,IM,IL,JE,JO,KZ,KE,KI,KW,KG,LA,LV,LB,LS,LI,LT,LU,MK,MG,MW,MV,ML,MT,MH,MQ,MR,MU,YT,FM,MD,MC,MN,ME,MS,MA,MZ,NA,NR,NP,NC,NZ,NE,NG,NU,NF,MP,OM,PK,PW,PS,PG,PH,PN,QA,RE,RO,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SX,SK,SI,SB,SO,ZA,GS,KR,LK,SR,SJ,SZ,TH,TL,TG,TK,TO,TT,TN,TM,TC,TV,UG,UA,AE,UZ,VU,VN,VG,VI,WF,EH,ZM", currency = "AUD,CAD,CHF,CNY,CZK,DKK,EUR,GBP,INR,JPY,NOK,NZD,PLN,RUB,SEK,ZAR,USD,EGP,UYU,UZS" } + +[pm_filters.zen] +credit = { not_available_flows = { capture_method = "manual" } } +debit = { not_available_flows = { capture_method = "manual" } } +boleto = { country = "BR", currency = "BRL" } +efecty = { country = "CO", currency = "COP" } +multibanco = { country = "PT", currency = "EUR" } +pago_efectivo = { country = "PE", currency = "PEN" } +pse = { country = "CO", currency = "COP" } +pix = { country = "BR", currency = "BRL" } +red_compra = { country = "CL", currency = "CLP" } +red_pagos = { country = "UY", currency = "UYU" } + +[pm_filters.zsl] +local_bank_transfer = { country = "CN", currency = "CNY" } + +[pm_filters.aci] +credit = { country = "AD,AE,AT,BE,BG,CH,CN,CO,CR,CY,CZ,DE,DK,DO,EE,EG,ES,ET,FI,FR,GB,GH,GI,GR,GT,HN,HK,HR,HU,ID,IE,IS,IT,JP,KH,LA,LI,LT,LU,LY,MK,MM,MX,MY,MZ,NG,NZ,OM,PA,PE,PK,PL,PT,QA,RO,SA,SN,SE,SI,SK,SV,TH,UA,US,UY,VN,ZM", currency = "AED,ALL,ARS,BGN,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,EGP,EUR,GBP,GHS,HKD,HNL,HRK,HUF,IDR,ILS,ISK,JPY,KHR,KPW,LAK,LKR,MAD,MKD,MMK,MXN,MYR,MZN,NGN,NOK,NZD,OMR,PAB,PEN,PHP,PKR,PLN,QAR,RON,RSD,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,UYU,VND,ZAR,ZMW" } +debit = { country = "AD,AE,AT,BE,BG,CH,CN,CO,CR,CY,CZ,DE,DK,DO,EE,EG,ES,ET,FI,FR,GB,GH,GI,GR,GT,HN,HK,HR,HU,ID,IE,IS,IT,JP,KH,LA,LI,LT,LU,LY,MK,MM,MX,MY,MZ,NG,NZ,OM,PA,PE,PK,PL,PT,QA,RO,SA,SN,SE,SI,SK,SV,TH,UA,US,UY,VN,ZM", currency = "AED,ALL,ARS,BGN,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,EGP,EUR,GBP,GHS,HKD,HNL,HRK,HUF,IDR,ILS,ISK,JPY,KHR,KPW,LAK,LKR,MAD,MKD,MMK,MXN,MYR,MZN,NGN,NOK,NZD,OMR,PAB,PEN,PHP,PKR,PLN,QAR,RON,RSD,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,UYU,VND,ZAR,ZMW" } +mb_way = { country = "EE,ES,PT", currency = "EUR" } +ali_pay = { country = "CN", currency = "CNY" } +eps = { country = "AT", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +sofort = { country = "AT,BE,CH,DE,ES,GB,IT,NL,PL", currency = "CHF,EUR,GBP,HUF,PLN"} +interac = { country = "CA", currency = "CAD,USD"} +przelewy24 = { country = "PL", currency = "CZK,EUR,GBP,PLN" } +trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" } + +[pm_filters.gigadat] +interac = { currency = "CAD"} + +[pm_filters.loonio] +interac = { currency = "CAD"} + +[pm_filters.dlocal] +oxxo = { currency = "MXN" } + +[pm_filters.mollie] +eps = { country = "AT", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +przelewy24 = { country = "PL", currency = "PLN,EUR" } +klarna = { country = "DE,AT,NL,BE,FR,GB,IT,ES,PT,SE,DK,FI,NO,CH,IR,CZ,PL,GR,SK", currency = "EUR,GBP,DKK,SEK,NOK,CHF,PLN,CZK" } + +[pm_filters.redsys] +credit = { currency = "AUD,BGN,CAD,CHF,COP,CZK,DKK,EUR,GBP,HRK,HUF,ILS,INR,JPY,MYR,NOK,NZD,PEN,PLN,RUB,SAR,SEK,SGD,THB,USD,ZAR", country="ES" } +debit = { currency = "AUD,BGN,CAD,CHF,COP,CZK,DKK,EUR,GBP,HRK,HUF,ILS,INR,JPY,MYR,NOK,NZD,PEN,PLN,RUB,SAR,SEK,SGD,THB,USD,ZAR", country="ES" } + +[pm_filters.stax] +credit = { country = "US", currency = "USD" } +debit = { country = "US", currency = "USD" } +ach = { country = "US", currency = "USD" } + +[pm_filters.prophetpay] +card_redirect = { country = "US", currency = "USD" } + +[pm_filters.multisafepay] +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,CV,KH,CM,CA,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC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,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "AED,AUD,BRL,CAD,CHF,CLP,CNY,COP,CZK,DKK,EUR,GBP,HKD,HRK,HUF,ILS,INR,ISK,JPY,KRW,MXN,MYR,NOK,NZD,PEN,PLN,RON,RUB,SEK,SGD,TRY,TWD,USD,ZAR", not_available_flows = { capture_method = "manual" } } +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "AED, AUD, BRL, CAD, CHF, CLP, COP, CZK, DKK, EUR, GBP, HKD, HRK, HUF, ILS, INR, JPY, MXN, MYR, NOK, NZD, PEN, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, TWD, UAH, USD, ZAR" } +paypal = { country = "AF,AX,AL,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ES,SE,GB" , currency = "EUR,GBP,SEK"} +ali_pay = { currency = "EUR,USD" } +we_chat_pay = { currency = "EUR"} +eps = { country = "AT" , currency = "EUR" } +mb_way = { country = "PT" , currency = "EUR" } +sofort = { country = "AT,BE,FR,DE,IT,PL,ES,CH,GB" , currency = "EUR"} + +[pm_filters.cashtocode] +classic = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BO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TR,TM,TC,TV,UG,UA,US,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +google_pay = { country = "US", currency = "USD" } +apple_pay = { country = "US", currency = "USD" } +ach = { country = "US", currency = "USD" } + +[pm_filters.trustpay] +credit = { not_available_flows = { capture_method = "manual" } } +debit = { not_available_flows = { capture_method = "manual" } } +instant_bank_transfer = { country = "CZ,SK,GB,AT,DE,IT", currency = "CZK, EUR, GBP" } +instant_bank_transfer_poland = { country = "PL", currency = "PLN" } +instant_bank_transfer_finland = { country = "FI", currency = "EUR" } +sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,GB", currency = "EUR" } + +[pm_filters.tesouro] +credit = { country = "AF,AL,DZ,AD,AO,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BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +apple_pay = { currency = "USD" } +google_pay = { currency = "USD" } + +[pm_filters.authorizedotnet] +credit = {currency = "CAD,USD"} +debit = {currency = "CAD,USD"} +google_pay = {currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"} +apple_pay = {currency = "EUR,GBP,ISK,USD,AUD,CAD,BRL,CLP,COP,CRC,CZK,DKK,EGP,GEL,GHS,GTQ,HNL,HKD,HUF,ILS,INR,JPY,KZT,KRW,KWD,MAD,MXN,MYR,NOK,NZD,PEN,PLN,PYG,QAR,RON,SAR,SEK,SGD,THB,TWD,UAH,AED,VND,ZAR"} +paypal = {currency = "AUD,BRL,CAD,CHF,CNY,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,MYR,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD"} + +[pm_filters.dwolla] +ach = { country = "US", currency = "USD" } + +[pm_filters.worldpay]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AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "DZD, AOA, USD, XCD, ARS, AUD, AZN, EUR, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "EG, MA, ZA, AU, CN, HK, JP, MO, MY, MN, NZ, SG, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, CZ, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IE, IS, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US, PR", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } + +[pm_filters.worldpayxml] +debit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM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, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "DZD, AOA, USD, XCD, ARS, AUD, AZN, EUR, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "EG, MA, ZA, AU, CN, HK, JP, MO, MY, MN, NZ, SG, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, CZ, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IE, IS, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US, PR", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } + +[pm_filters.calida] +bluecode = { country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,SK,SI,ES,SE,IS,LI,NO", currency = "EUR" } + +[file_upload_config] +bucket_name = "" +region = "" + +[pm_filters.forte] +credit = { country = "US, CA", currency = "CAD,USD"} +debit = { country = "US, CA", currency = "CAD,USD"} + +[pm_filters.nordea] +sepa = { country = "DK,FI,NO,SE", currency = "DKK,EUR,NOK,SEK" } + +[pm_filters.fiuu] +duit_now = { country = "MY", currency = "MYR" } +apple_pay = { country = "MY", currency = "MYR" } +google_pay = { country = "MY", currency = "MYR" } +online_banking_fpx = { country = "MY", currency = "MYR" } +credit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PHP,SGD,THB,TWD,VND" } +debit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PHP,SGD,THB,TWD,VND" } + +[pm_filters.inespay] +sepa = { country = "ES", currency = "EUR"} + +[pm_filters.bluesnap] +credit = { country = "AD,AE,AG,AL,AM,AO,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BJ,BN,BO,BR,BS,BT,BW,BY,BZ,CA,CD,CF,CG,CH,CI,CL,CM,CN,CO,CR,CV,CY,CZ,DE,DK,DJ,DM,DO,DZ,EC,EE,EG,ER,ES,ET,FI,FJ,FM,FR,GA,GB,GD,GE,GG,GH,GM,GN,GQ,GR,GT,GW,GY,HN,HR,HT,HU,ID,IE,IL,IN,IS,IT,JM,JP,JO,KE,KG,KH,KI,KM,KN,KR,KW,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,MA,MC,MD,ME,MG,MH,MK,ML,MM,MN,MR,MT,MU,MV,MW,MX,MY,MZ,NA,NE,NG,NI,NL,NO,NP,NR,NZ,OM,PA,PE,PG,PH,PK,PL,PS,PT,PW,PY,QA,RO,RS,RW,SA,SB,SC,SE,SG,SI,SK,SL,SM,SN,SO,SR,SS,ST,SV,SZ,TD,TG,TH,TJ,TL,TM,TN,TO,TR,TT,TV,TZ,UA,UG,US,UY,UZ,VA,VC,VE,VN,VU,WS,ZA,ZM,ZW", currency = "AED,AFN,ALL,AMD,ANG,ARS,AUD,AWG,BAM,BBD,BGN,BHD,BMD,BND,BOB,BRL,BSD,BWP,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,FJD,GBP,GEL,GIP,GTQ,HKD,HUF,IDR,ILS,INR,ISK,JMD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MUR,MWK,MXN,MYR,NAD,NGN,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PLN,PKR,QAR,RON,RSD,RUB,SAR,SCR,SDG,SEK,SGD,THB,TND,TRY,TTD,TWD,TZS,UAH,USD,UYU,UZS,VND,XAF,XCD,XOF,ZAR"} +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND"} +apple_pay = { country = "EG, MA, ZA, AU, HK, JP, MO, MY, MN, NZ, SG, KR, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT , KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, UY, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MYR, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, GBP, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, MXN, PAB, PEN, BSD, UYU, BHD, ILS, KWD, OMR, QAR, SAR, AED, CAD"} + +[pm_filters.fiserv] +credit = {country = "AU,NZ,CN,HK,IN,LK,KR,MY,SG,GB,BE,FR,DE,IT,ME,NL,PL,ES,ZA,AR,BR,CO,MX,PA,UY,US,CA", currency = "AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BYN,BZD,BMD,BTN,BOB,VES,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XAF,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,CZK,DKK,DJF,DOP,XCD,EGP,ERN,ETB,EUR,FKP,FJD,XPF,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KGS,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,NZD,NIO,NGN,VUV,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SHP,SVC,WST,STN,SAR,RSD,SCR,SLL,SGD,SBD,SOS,ZAR,KRW,SSP,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,UGX,UAH,AED,USD,UYU,UZS,VND,XOF,YER,ZMW,ZWL"} +debit = {country = "AU,NZ,CN,HK,IN,LK,KR,MY,SG,GB,BE,FR,DE,IT,ME,NL,PL,ES,ZA,AR,BR,CO,MX,PA,UY,US,CA", currency = "AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BYN,BZD,BMD,BTN,BOB,VES,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XAF,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,CZK,DKK,DJF,DOP,XCD,EGP,ERN,ETB,EUR,FKP,FJD,XPF,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KGS,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,NZD,NIO,NGN,VUV,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SHP,SVC,WST,STN,SAR,RSD,SCR,SLL,SGD,SBD,SOS,ZAR,KRW,SSP,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,UGX,UAH,AED,USD,UYU,UZS,VND,XOF,YER,ZMW,ZWL"} +paypal = { currency = "AUD,EUR,BRL,CAD,CNY,EUR,EUR,EUR,GBP,HKD,INR,EUR,JPY,MYR,EUR,NZD,PHP,PLN,SGD,USD", country = "AU, BE, BR, CA, CN, DE, ES, FR, GB, HK, IN, IT, JP, MY, NL, NZ, PH, PL, SG, US" } +google_pay = { country = "AU,AT,BE,BR,CA,CN,HK,MY,NZ,SG,US", currency = "AUD,EUR,EUR,BRL,CAD,CNY,HKD,MYR,NZD,SGD,USD" } +apple_pay = { country = "AU,NZ,CN,HK,JP,SG,MY,KR,TW,VN,GB,IE,FR,DE,IT,ES,PT,NL,BE,LU,AT,CH,SE,FI,DK,NO,PL,CZ,SK,HU,LT,LV,EE,GR,RO,BG,HR,SI,MT,CY,IS,LI,MC,SM,VA,US,CA,MX,BR,AR,CL,CO,PE,UY,CR,PA,DO,EC,SV,GT,HN,BS,PR,AE,SA,QA,KW,BH,OM,IL,JO,PS,EG,MA,ZA,GE,AM,AZ,MD,ME,MK,AL,BA,RS,UA", currency = "AUD,BRL,CAD,CHF,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD" } + + +[pm_filters.amazonpay] +amazon_pay = { country = "US", currency = "USD" } + +[pm_filters.rapyd] +apple_pay = { country = "BR, CA, CL, CO, DO, SV, MX, PE, PT, US, AT, BE, BG, HR, CY, CZ, DO, DK, EE, FI, FR, GE, DE, GR, GL, HU, IS, IE, IL, IT, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, RO, SM, SK, SI, ZA, ES, SE, CH, GB, VA, AU, HK, JP, MY, NZ, SG, KR, TW, VN", currency = "AMD, AUD, BGN, BRL, BYN, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DOP, EUR, GBP, GEL, GTQ, HUF, ISK, JPY, KRW, MDL, MXN, MYR, NOK, PAB, PEN, PLN, PYG, RON, RSD, SEK, SGD, TWD, UAH, USD, UYU, VND, ZAR" } +google_pay = { country = "BR, CA, CL, CO, DO, MX, PE, PT, US, AT, BE, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IL, IT, LV, LT, LU, NZ, NO, GB, PL, RO, RU, SK, ZA, ES, SE, CH, TR, AU, HK, IN, ID, JP, MY, PH, SG, TW, TH, VN", currency = "AUD, BGN, BRL, BYN, CAD, CHF, CLP, COP, CZK, DKK, DOP, EUR, GBP, HUF, IDR, JPY, KES, MXN, MYR, NOK, PAB, PEN, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, TWD, UAH, USD, UYU, VND, ZAR" } +credit = { country = "AE,AF,AG,AI,AL,AM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,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } + +[pm_filters.shift4] +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +sofort = { country = "AT,BE,CH,DE,ES,FI,FR,GB,IT,NL,PL,SE", currency = "CHF,EUR" } +credit = { country = "AD,AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IM,IN,IO,IQ,IR,IS,IT,JE,JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,LY,MA,MC,MD,ME,MF,MG,MH,MK,ML,MM,MN,MO,MP,MQ,MR,MS,MT,MU,MV,MW,MX,MY,MZ,NA,NC,NE,NF,NG,NI,NL,NO,NP,NR,NU,NZ,OM,PA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,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +boleto = { country = "BR", currency = "BRL" } +trustly = { currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +ali_pay = { country = "CN", currency = "CNY" } +we_chat_pay = { country = "CN", currency = "CNY" } +klarna = { currency = "EUR,GBP,CHF,SEK" } +blik = { country = "PL", currency = "PLN" } +crypto_currency = { currency = "USD,GBP,AED" } +paysera = { currency = "EUR" } +skrill = { currency = "USD" } + +[pm_filters.placetopay] +credit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"} +debit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"} + +[pm_filters.coingate] +crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" } + +[pm_filters.paystack] +eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" } + +[pm_filters.santander] +pix = { country = "BR", currency = "BRL" } +boleto = { country = "BR", currency = "BRL" } + +[pm_filters.boku] +dana = { country = "ID", currency = "IDR" } +gcash = { country = "PH", currency = "PHP" } +go_pay = { country = "ID", currency = "IDR" } +kakao_pay = { country = "KR", currency = "KRW" } +momo = { country = "VN", currency = "VND" } + +[pm_filters.nmi] +credit = { country = "EG,ZA,BH,CY,HK,IN,ID,IL,JP,JO,KW,MY,PK,PH,SA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ES,SJ,SE,CH,UA,GB,VA", currency = "AUD,BRL,CAD,CNY,CZK,DKK,EUR,HKD,HUF,ILS,JPY,MYR,MXN,TWD,NZD,NOK,PHP,PLN,GBP,SGD,SEK,CHF,THB,USD" } + +[pm_filters.datatrans] +credit = { country = "AL,AD,AM,AT,AZ,BY,BE,BA,BG,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GE,GR,HR,HU,IE,IS,IT,KZ,LI,LT,LU,LV,MC,MD,ME,MK,MT,NL,NO,PL,PT,RO,RU,SE,SI,SK,SM,TR,UA,VA", currency = "BHD,BIF,CHF,DJF,EUR,GBP,GNF,IQD,ISK,JPY,JOD,KMF,KRW,KWD,LYD,OMR,PYG,RWF,TND,UGX,USD,VND,VUV,XAF,XOF,XPF" } +debit = { country = "AL,AD,AM,AT,AZ,BY,BE,BA,BG,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GE,GR,HR,HU,IE,IS,IT,KZ,LI,LT,LU,LV,MC,MD,ME,MK,MT,NL,NO,PL,PT,RO,RU,SE,SI,SK,SM,TR,UA,VA", currency = "BHD,BIF,CHF,DJF,EUR,GBP,GNF,IQD,ISK,JPY,JOD,KMF,KRW,KWD,LYD,OMR,PYG,RWF,TND,UGX,USD,VND,VUV,XAF,XOF,XPF" } + +[pm_filters.payme] +credit = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } +debit = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } +apple_pay = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } + +[pm_filters.paysafe] +apple_pay = {country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,PM,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,NL,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VA,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "ARS,AUD,AZN,BHD,BOB,BAM,BRL,BGN,CAD,CLP,CNY,COP,CRC,HRK,CZK,DKK,DOP,XCD,EGP,ETB,EUR,FJD,GEL,GTQ,HTG,HNL,HKD,HUF,INR,IDR,JMD,JPY,JOD,KZT,KES,KRW,KWD,LBP,LYD,MWK,MUR,MXN,MDL,MAD,ILS,NZD,NGN,NOK,OMR,PKR,PAB,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SAR,RSD,SGD,ZAR,LKR,SEK,CHF,SYP,TWD,THB,TTD,TND,TRY,UAH,AED,UYU,USD,VND" } + +[pm_filters.payjustnow] +payjustnow = { country = "ZA", currency = "ZAR" } + +[pm_filters.payjustnowinstore] +payjustnow = { country = "ZA", currency = "ZAR" } diff --git a/src/app.rs b/src/app.rs index d8bbb642..027dd450 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,13 +1,18 @@ use crate::redis::commands::RedisConnectionWrapper; use axum::{ + body::Body, extract::Request, + middleware::{self, Next}, + response::Response, routing::{delete, get, post}, }; +use axum::http::HeaderValue; use axum_server::{tls_rustls::RustlsConfig, Handle}; use error_stack::ResultExt; use std::sync::Arc; use tokio::signal::unix::{signal, SignalKind}; use tokio::sync::OnceCell as TokioOnceCell; +use tower::ServiceBuilder; use tower_http::trace as tower_trace; use crate::{ @@ -32,6 +37,35 @@ pub async fn get_tenant_app_state() -> Arc { type Storage = storage::Storage; +async fn ensure_request_id(mut request: Request, next: Next) -> Response { + let header_value = request + .headers() + .get(storage::consts::X_REQUEST_ID) + .filter(|value| !value.as_bytes().is_empty()) + .cloned() + .unwrap_or_else(generate_request_id_header_value); + + request + .headers_mut() + .insert(storage::consts::X_REQUEST_ID, header_value.clone()); + + let mut response = next.run(request).await; + response + .headers_mut() + .insert(storage::consts::X_REQUEST_ID, header_value); + + response +} + +fn generate_request_id_header_value() -> HeaderValue { + loop { + let request_id = storage::utils::generate_uuid(); + if let Ok(value) = HeaderValue::from_str(&request_id) { + return value; + } + } +} + /// /// TenantAppState: /// @@ -230,8 +264,10 @@ where post(routes::update_gateway_score::update_gateway_score), ); - let router = router.layer( - tower_trace::TraceLayer::new_for_http() + let middleware = ServiceBuilder::new() + .layer(middleware::from_fn(ensure_request_id)) + .layer( + tower_trace::TraceLayer::new_for_http() .make_span_with(|request: &Request<_>| utils::record_fields_from_header(request)) .on_request(tower_trace::DefaultOnRequest::new().level(tracing::Level::INFO)) .on_response( @@ -244,17 +280,20 @@ where .latency_unit(tower_http::LatencyUnit::Micros) .level(tracing::Level::ERROR), ), - ); + ); let router = router .nest("/health", routes::health::serve()) + .layer(middleware) .with_state(global_app_state.clone()); logger::info!( category = "SERVER", - "OpenRouter started [{:?}] [{:?}]", - global_app_state.global_config.server, - global_app_state.global_config.log + action = "main_server_startup", + bind_address = %socket_addr, + tls_enabled = global_app_state.global_config.tls.is_some(), + request_id_header = storage::consts::X_REQUEST_ID, + "Main HTTP server listening" ); if let Some(tls_config) = &global_app_state.global_config.tls { diff --git a/src/bin/open_router.rs b/src/bin/open_router.rs index 2b184fe7..e4f4a53b 100644 --- a/src/bin/open_router.rs +++ b/src/bin/open_router.rs @@ -9,7 +9,7 @@ async fn main() -> Result<(), Box> { let _guard = logger::setup( &global_config.log, open_router::service_name!(), - [open_router::service_name!(), "tower_http"], + ["tower_http"], ); #[allow(clippy::expect_used)] @@ -21,6 +21,8 @@ async fn main() -> Result<(), Box> { .await .expect("Failed to fetch raw application secrets"); + log_startup_configuration(&global_config); + let global_app_state = GlobalAppState::new(global_config.clone()).await; // Run both servers concurrently using tokio::spawn @@ -41,3 +43,10 @@ async fn main() -> Result<(), Box> { Ok(()) } + +fn log_startup_configuration(global_config: &open_router::config::GlobalConfig) { + logger::info!( + "Decision engine started [{:?}]", + global_config + ); +} diff --git a/src/logger/formatter.rs b/src/logger/formatter.rs index 01a8a350..994fca43 100644 --- a/src/logger/formatter.rs +++ b/src/logger/formatter.rs @@ -225,6 +225,11 @@ where let domain_keys = [ "message_number", "error_category", + "error", + "error_message", + "jp_error_code", + "jp_error_message", + "source", "x-request-id", "env", "@timestamp", @@ -384,6 +389,13 @@ where } } + if !explicit_entries_set.contains("startup_config") { + if let Some(value) = storage.values.get("startup_config") { + map_serializer.serialize_entry("startup_config", value)?; + explicit_entries_set.insert("startup_config"); + } + } + // Set additional fields for DOMAIN logs. if metadata.level() == &tracing::Level::ERROR { if !explicit_entries_set.contains("category") { @@ -434,6 +446,7 @@ where explicit_entries_set.insert("@timestamp"); } } + if !explicit_entries_set.contains("is_art_enabled") { map_serializer.serialize_entry("is_art_enabled", "false")?; explicit_entries_set.insert("is_art_enabled"); @@ -570,6 +583,9 @@ where let value = storage .values .get("message") + .or_else(|| storage.values.get("error")) + .or_else(|| storage.values.get("error_message")) + .or_else(|| storage.values.get("jp_error_message")) .cloned() .unwrap_or(Value::String("null".to_string())); diff --git a/src/metrics.rs b/src/metrics.rs index 1f6c40c2..c49ddcda 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -97,12 +97,12 @@ impl crate::config::GlobalConfig { ) -> Result { let loc = format!("{}:{}", self.metrics.host, self.metrics.port); - tracing::debug!( + tracing::info!( category = "SERVER", - "{} started [{:?}] [{:?}]", + action = "metrics_server_startup", server, - self.metrics, - self.log + bind_address = %loc, + "Metrics server listening" ); Ok(tokio::net::TcpListener::bind(loc).await?) From dd7417f506ee87f181def1e1fe2487654caff53f Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Tue, 24 Mar 2026 15:56:01 +0530 Subject: [PATCH 67/95] fix: clippy errors (#214) --- .typos.toml | 80 +++ config/development.toml | 2 +- docs/api-reference1.md | 2 +- src/app.rs | 2 +- src/bin/open_router.rs | 2 + src/config.rs | 2 +- .../secrets_manager/secrets_management.rs | 4 +- src/decider/configs/env_vars.rs | 2 +- src/decider/gatewaydecider/constants.rs | 4 +- src/decider/gatewaydecider/flow_new.rs | 30 +- src/decider/gatewaydecider/flows.rs | 25 +- src/decider/gatewaydecider/gw_filter.rs | 44 +- src/decider/gatewaydecider/gw_filter_new.rs | 2 +- src/decider/gatewaydecider/gw_scoring.rs | 201 ++++--- src/decider/gatewaydecider/runner.rs | 10 +- src/decider/gatewaydecider/types.rs | 38 +- src/decider/gatewaydecider/utils.rs | 134 +++-- .../network_decider/co_badged_card_info.rs | 6 +- src/decider/network_decider/debit_routing.rs | 3 +- src/decider/network_decider/helpers.rs | 16 +- src/decider/network_decider/types.rs | 2 +- src/decider/network_decider/utils.rs | 10 +- .../storage/utils/gateway_card_info.rs | 14 +- .../storage/utils/merchant_gateway_account.rs | 4 +- .../utils/merchant_gateway_card_info.rs | 7 +- src/error/custom_error.rs | 24 +- src/euclid/ast.rs | 2 +- src/euclid/cgraph.rs | 8 +- src/euclid/errors.rs | 30 +- src/euclid/handlers/routing_rules.rs | 36 +- src/euclid/interpreter.rs | 2 +- src/euclid/test.rs | 46 +- src/euclid/types.rs | 47 +- src/euclid/utils.rs | 2 +- src/feedback/constants.rs | 2 +- .../gateway_elimination_scoring/flow.rs | 82 ++- src/feedback/gateway_scoring_service.rs | 63 +-- .../gateway_selection_scoring_v3/flow.rs | 27 +- src/feedback/utils.rs | 35 +- src/generics.rs | 32 +- src/lib.rs | 27 + src/logger/formatter.rs | 14 +- src/logger/storage.rs | 2 +- src/merchant_config_util.rs | 17 +- src/redis/commands.rs | 49 +- src/redis/feature.rs | 13 +- src/routes/decision_gateway.rs | 10 +- src/routes/update_gateway_score.rs | 6 +- src/routes/update_score.rs | 10 +- src/storage.rs | 40 +- src/storage/types.rs | 29 +- src/types/bank_code.rs | 2 +- src/types/card/isin.rs | 3 +- src/types/card/txn_card_info.rs | 2 +- src/types/country/country_iso.rs | 496 +++++++++--------- src/types/gateway_bank_emi_support_v2.rs | 1 - src/types/gateway_card_info.rs | 11 +- src/types/gateway_payment_method_flow.rs | 6 +- src/types/merchant/merchant_account.rs | 43 +- .../merchant/merchant_gateway_account.rs | 7 +- .../merchant/merchant_iframe_preferences.rs | 3 +- src/types/merchant_config/types.rs | 2 +- src/types/merchant_gateway_card_info.rs | 5 +- .../merchant_gateway_payment_method_flow.rs | 5 +- src/types/merchant_priority_logic.rs | 6 +- src/types/service_configuration.rs | 4 +- src/types/tenant/tenant_config_filter.rs | 8 +- src/types/token_bin_info.rs | 4 +- src/types/txn_details/types.rs | 6 +- src/types/txn_offer.rs | 5 +- src/types/txn_offer_detail.rs | 4 +- src/utils.rs | 2 +- 72 files changed, 948 insertions(+), 978 deletions(-) diff --git a/.typos.toml b/.typos.toml index 7c107218..f42b186a 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,2 +1,82 @@ [default] check-filename = true + +# Ignore 2-3 letter all-caps identifiers (likely codes/abbreviations) +# and 2-3 letter lowercase identifiers (likely variable names) +extend-ignore-identifiers-re = [ + "^[A-Z]{2,3}$", + "^[a-z]{2,3}$", +] + +# Module/type aliases used throughout the codebase +[default.extend-identifiers] +HasTable = "HasTable" +ETO = "ETO" +ETCC = "ETCC" +ETM = "ETM" +ETD = "ETD" +ETCa = "ETCa" +ETTD = "ETTD" +ETOd = "ETOd" +ETMo = "ETMo" +TE = "TE" +ser = "ser" + +# ISO 3166-1 alpha-3 country codes +CAF = "CAF" +NAM = "NAM" +SOM = "SOM" +THA = "THA" +FO = "FO" + +# ISO 4217 currency codes +ZAR = "ZAR" + +# Common abbreviations in code (e.g., ect = extendedCardType) +ect = "ect" + +# CamelCase identifiers (Mis = Mismatch, etc.) +Mis = "Mis" + +# Time zones (IST = Indian Standard Time) +IST = "IST" +Ist = "Ist" +ist = "ist" + +# Order Type abbreviation +OT = "OT" + +# Value Added Services (banking term) +VAS = "VAS" +Vas = "Vas" + +# JWT library API term +encrypter = "encrypter" + +[default.extend-words] +# Project-specific terms that are valid +incase = "incase" +# Database column name (would require migration to fix) +penality = "penality" +# HashiCorp (company name) +hashi = "hashi" +# CamelCase function name (Mismatch) +Mis = "Mis" +# Time zones (Indian Standard Time) +IST = "IST" +Ist = "Ist" +ist = "ist" +# Order Type abbreviation +OT = "OT" +# Value Added Services (banking term) +VAS = "VAS" +Vas = "Vas" +# JWT library API term +encrypter = "encrypter" + +[files] +extend-exclude = [ + # Exclude non-source files + "*.groovy", + "**/Untitled*", +] diff --git a/config/development.toml b/config/development.toml index 6bb23dfd..60cfcd67 100644 --- a/config/development.toml +++ b/config/development.toml @@ -404,7 +404,7 @@ apple_pay = { country = "EG, MA, ZA, CN, HK, JP, MY, MN, SG, KR, VN, AT, BE, BG, google_pay = { country = "AO, EG, KE, ZA, AR, BR, CL, CO, MX, PE, UY, AG, DO, AE, TR, SA, QA, OM, LB, KW, JO, IL, BH, KZ, VN, TH, SG, MY, JP, HK, LK, IN, US, CA, GB, UA, CH, SE, ES, SK, PT, RO, PL, NO, NL, LU, LT, LV, IE, IT, HU, GR, DE, FR, FI, EE, DK, CZ, HR, BG, BE, AT, AL", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN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BD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STN,SVC,SYP,THB,TJS,TND,TOP,TRY,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,YER,ZAR,ZMW" } sepa = {country = "FR, IT, GR, BE, BG, FI, EE, HR, IE, DE, DK, LT, LV, MT, LU, AT, NL, PT, RO, PL, SK, SE, ES, SI, HU, CZ, CY, GB, LI, NO, IS, MC, CH, YT, PM, SM", currency="EUR"} -sepa_guarenteed_debit = {country = "AT, CH, DE", currency="EUR"} +sepa_guaranteed_debit = {country = "AT, CH, DE", currency="EUR"} [pm_filters.braintree] credit = { country = "AD,AT,AU,BE,BG,CA,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GG,GI,GR,HK,HR,HU,IE,IM,IT,JE,LI,LT,LU,LV,MT,MC,MY,NL,NO,NZ,PL,PT,RO,SE,SG,SI,SK,SM,US", currency = "AED,AMD,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CHF,CLP,CNY,COP,CRC,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,ISK,JMD,JPY,KES,KGS,KHR,KMF,KRW,KYD,KZT,LAK,LBP,LKR,LRD,LSL,MAD,MDL,MKD,MNT,MOP,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STD,SVC,SYP,SZL,THB,TJS,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"} diff --git a/docs/api-reference1.md b/docs/api-reference1.md index 75638e3e..673c9c6d 100644 --- a/docs/api-reference1.md +++ b/docs/api-reference1.md @@ -914,7 +914,7 @@ The input for evaluation parameter must be one of the mentioned values in array. } ``` -The input for evaluation parameter must be in the specifed thresholds. +The input for evaluation parameter must be in the specified thresholds. --- diff --git a/src/app.rs b/src/app.rs index 027dd450..fd3e2b39 100644 --- a/src/app.rs +++ b/src/app.rs @@ -252,7 +252,7 @@ where ) .route( "/config-sr-dimension", - axum::routing::post(crate::euclid::handlers::routing_rules::config_sr_dimentions), + axum::routing::post(crate::euclid::handlers::routing_rules::config_sr_dimensions), ); let router = router.route("/update-score", post(routes::update_score::update_score)); let router = router.route( diff --git a/src/bin/open_router.rs b/src/bin/open_router.rs index e4f4a53b..b96a0356 100644 --- a/src/bin/open_router.rs +++ b/src/bin/open_router.rs @@ -1,3 +1,5 @@ +#![allow(clippy::unwrap_in_result)] + use open_router::{logger, tenant::GlobalAppState}; #[allow(clippy::expect_used)] diff --git a/src/config.rs b/src/config.rs index 189dc08b..3b202b64 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,7 +10,7 @@ use crate::{ logger::config::Log, }; use error_stack::ResultExt; -#[cfg(feature = "kms-hashicorp-vault")] +#[cfg(all(feature = "kms-hashicorp-vault", test))] use masking::ExposeInterface; use redis_interface::RedisSettings; use serde::Deserialize; diff --git a/src/crypto/secrets_manager/secrets_management.rs b/src/crypto/secrets_manager/secrets_management.rs index 2b69a1c0..fe397482 100644 --- a/src/crypto/secrets_manager/secrets_management.rs +++ b/src/crypto/secrets_manager/secrets_management.rs @@ -45,7 +45,7 @@ enum SecretsManagerClient { #[cfg(feature = "kms-aws")] AwsKms(AwsKmsClient), #[cfg(feature = "kms-hashicorp-vault")] - HashiCorp(HashiCorpVault), + HashiCorp(Box), NoEncryption(NoEncryption), } @@ -89,7 +89,7 @@ impl SecretsManagementConfig { #[cfg(feature = "kms-hashicorp-vault")] Self::HashiCorpVault { hashi_corp_vault } => HashiCorpVault::new(hashi_corp_vault) .change_context(SecretsManagementError::ClientCreationFailed) - .map(SecretsManagerClient::HashiCorp), + .map(|v| SecretsManagerClient::HashiCorp(Box::new(v))), Self::NoEncryption => Ok(SecretsManagerClient::NoEncryption(NoEncryption)), } } diff --git a/src/decider/configs/env_vars.rs b/src/decider/configs/env_vars.rs index ccc3b6c5..92225b57 100644 --- a/src/decider/configs/env_vars.rs +++ b/src/decider/configs/env_vars.rs @@ -25,7 +25,7 @@ where // } // } -trait FromStrExt { +pub trait FromStrExt { type Error; fn from_str(s: &str) -> Result where diff --git a/src/decider/gatewaydecider/constants.rs b/src/decider/gatewaydecider/constants.rs index 1b9cf01c..cb1a1be9 100644 --- a/src/decider/gatewaydecider/constants.rs +++ b/src/decider/gatewaydecider/constants.rs @@ -138,7 +138,7 @@ pub fn internalDefaultEliminationV2SuccessRate1AndNPrefix( pub const DEFAULT_FIELD_NAME_FOR_SR1_AND_N: &str = "default"; pub const SR1_KEY_PREFIX: &str = "sr1_"; pub const N_KEY_PREFIX: &str = "n_"; -pub const aggregateKeyPrefix: &str = "aggregate_data_"; +pub const AGGREGATE_KEY_PREFIX: &str = "aggregate_data_"; pub const GW_DEFAULT_TXN_SOFT_RESET_COUNT: i64 = 10; pub const DEFAULT_GLOBAL_SELECTION_VOLUME_THRESHOLD: i64 = 20; @@ -809,7 +809,7 @@ impl SC::ServiceConfigKey for SrVolumeCheckEnabledMerchant { pub const IS_MERCHANT_ENABLED_FOR_VOLUME_CHECK: SrVolumeCheckEnabledMerchant = SrVolumeCheckEnabledMerchant; -pub const DEFAULT_SELECTION_BUCKET_TXN_VOLUME_THREHOLD: i64 = 5; +pub const DEFAULT_SELECTION_BUCKET_TXN_VOLUME_THRESHOLD: i64 = 5; pub struct SrSelectionBucketVolumeThreshold; impl SC::ServiceConfigKey for SrSelectionBucketVolumeThreshold { diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index e4d2903e..55ad61bd 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -54,12 +54,12 @@ pub async fn decider_full_payload_hs_function( // check if type formation is correct let merchant_prefs = ETM::merchant_iframe_preferences::MerchantIframePreferences { id: ETM::merchant_iframe_preferences::to_merchant_iframe_prefs_pid( - crate::types::merchant::id::merchant_pid_to_text(merchant_account.id.clone()), + crate::types::merchant::id::merchant_pid_to_text(merchant_account.id), ), merchantId: merchant_account.merchantId.clone(), dynamicSwitchingEnabled: enforced_gateway_filter .as_ref() - .map(|list| !(list.len() <= 1)) + .map(|list| list.len() > 1) .unwrap_or(false), isinRoutingEnabled: false, issuerRoutingEnabled: false, @@ -157,7 +157,7 @@ pub async fn run_decider_flow( deciderParams.dpTxnDetail.clone(), deciderParams.dpTxnCardInfo.clone(), deciderParams.dpMerchantAccount.clone(), - is_legacy_decider_flow.clone(), + is_legacy_decider_flow, ) .await; let functionalGateways = deciderParams @@ -184,10 +184,7 @@ pub async fn run_decider_flow( let dResult = match ( preferredGateway.clone(), - deciderParams - .dpMerchantPrefs - .dynamicSwitchingEnabled - .clone(), + deciderParams.dpMerchantPrefs.dynamicSwitchingEnabled, ) { (Some(pgw), false) => { if functionalGateways.contains(&pgw) { @@ -398,9 +395,9 @@ pub async fn run_decider_flow( Some(updatedPriorityLogicOutput), decider_flow.writer.is_dynamic_mga_enabled, )), - gs => { + _gs => { let maxScore = Utils::get_max_score_gateway(¤tGatewayScoreMap) - .map(|(gw, score)| score); + .map(|(_gw, score)| score); let decidedGateway = Utils::random_gateway_selection_for_same_score( ¤tGatewayScoreMap, maxScore, @@ -426,8 +423,8 @@ pub async fn run_decider_flow( let ( srEliminationInfo, - isOptimizedBasedOnSRMetricEnabled, - isSrV3MetricEnabled, + _isOptimizedBasedOnSRMetricEnabled, + _isSrV3MetricEnabled, topGatewayBeforeSRDowntimeEvaluation, isPrimaryGateway, experimentTag, @@ -541,11 +538,11 @@ pub async fn run_decider_flow( ) .await .unwrap_or_default(); - updated_gateway_scoring_data; + drop(updated_gateway_scoring_data); match dResult { Ok(result) => Ok(result), Err(( - debugFilterList, + _debugFilterList, _, priorityLogicTag, finalDeciderApproach, @@ -571,10 +568,7 @@ pub async fn run_decider_flow( } #[allow(dead_code)] -fn get_gateway_to_mga_id_map_f( - allMgas: &Vec, - gateways: &Vec, -) -> AValue { +fn get_gateway_to_mga_id_map_f(allMgas: &[MerchantGatewayAccount], gateways: &[String]) -> AValue { json!(gateways .iter() .map(|x| { @@ -583,7 +577,7 @@ fn get_gateway_to_mga_id_map_f( allMgas .iter() .find(|mga| mga.gateway == *x) - .map(|mga| mga.id.merchantGwAccId.clone()), + .map(|mga| mga.id.merchantGwAccId), ) }) .collect::>()) diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 5c1c5600..9850f59b 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -110,7 +110,7 @@ use crate::types::txn_details::types as ETTD; // ); // let request = T::transformRequest(req, merchant_acc, resolve_bin); // logger::debug!( -// tag = "enforeced gateway list", +// tag = "enforced gateway list", // "{}", // request.enforceGatewayList.to_string() // ); @@ -339,7 +339,7 @@ pub async fn run_decider_flow( deciderParams.dpTxnDetail.clone(), deciderParams.dpTxnCardInfo.clone(), deciderParams.dpMerchantAccount.clone(), - is_legacy_decider_flow.clone(), + is_legacy_decider_flow, ) .await; let (functionalGateways, allMgas) = GF::newGwFilters(&mut decider_flow).await?; @@ -370,10 +370,7 @@ pub async fn run_decider_flow( let dResult = match ( preferredGateway.clone(), - deciderParams - .dpMerchantPrefs - .dynamicSwitchingEnabled - .clone(), + deciderParams.dpMerchantPrefs.dynamicSwitchingEnabled, ) { (Some(pgw), false) => { if functionalGateways.contains(&pgw) { @@ -568,9 +565,9 @@ pub async fn run_decider_flow( Some(updatedPriorityLogicOutput), decider_flow.writer.is_dynamic_mga_enabled, )), - gs => { + _gs => { let maxScore = Utils::get_max_score_gateway(¤tGatewayScoreMap) - .map(|(gw, score)| score); + .map(|(_gw, score)| score); let decidedGateway = Utils::random_gateway_selection_for_same_score( ¤tGatewayScoreMap, maxScore, @@ -597,8 +594,8 @@ pub async fn run_decider_flow( let ( srEliminationInfo, - isOptimizedBasedOnSRMetricEnabled, - isSrV3MetricEnabled, + _isOptimizedBasedOnSRMetricEnabled, + _isSrV3MetricEnabled, topGatewayBeforeSRDowntimeEvaluation, isPrimaryGateway, experimentTag, @@ -711,7 +708,7 @@ pub async fn run_decider_flow( ) .await .unwrap_or_default(); - updated_gateway_scoring_data; + drop(updated_gateway_scoring_data); } match dResult { Ok(result) => Ok(( @@ -766,7 +763,7 @@ fn get_gateway_to_mga_id_map_f( allMgas .iter() .find(|mga| mga.gateway == *x) - .map(|mga| mga.id.merchantGwAccId.clone()), + .map(|mga| mga.id.merchantGwAccId), ) }) .collect::>()) @@ -960,7 +957,7 @@ pub async fn getFailureReasonWithFilter( ) -> String { let txn_detail = &decider_flow.get().dpTxnDetail; let txn_card_info = &decider_flow.get().dpTxnCardInfo; - let macc = &decider_flow.get().dpMerchantAccount; + let _macc = &decider_flow.get().dpMerchantAccount; let order_reference = &decider_flow.get().dpOrder; let m_internal_meta = &decider_flow.writer.internalMetaData; let m_card_brand = &decider_flow.writer.cardBrand; @@ -1213,7 +1210,7 @@ pub async fn getFailureReasonWithFilter( "Conflicting configurations found or no functional gateways supporting this transaction" .to_string() } - "filterGatewaysForEMITenureSpecficGatewayCreds" => { + "filterGatewaysForEMITenureSpecificGatewayCreds" => { "No functional gateways supporting for emi.".to_string() } "FilterFunctionalGatewaysForReversePennyDrop" => { diff --git a/src/decider/gatewaydecider/gw_filter.rs b/src/decider/gatewaydecider/gw_filter.rs index 59911d11..1587c144 100644 --- a/src/decider/gatewaydecider/gw_filter.rs +++ b/src/decider/gatewaydecider/gw_filter.rs @@ -281,7 +281,7 @@ pub async fn getFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList { Utils::set_payment_flow_list(this, payment_flow_list); let mgas_ = match ( - txn_detail.isEmi.unwrap_or(false) || Utils::is_reccuring_payment_transaction(&txn_detail), + txn_detail.isEmi.unwrap_or(false) || Utils::is_recurring_payment_transaction(&txn_detail), &enforce_gateway_list, ) { (false, _) => enabled_gateway_accounts.clone(), @@ -431,7 +431,7 @@ pub fn filterMGAsByEnforcedPaymentFlows( .collect(); // Get context from DeciderFlow - let txn_card_info = this.get().dpTxnCardInfo.clone(); + let _txn_card_info = this.get().dpTxnCardInfo.clone(); let oref = this.get().dpOrder.clone(); let macc = this.get().dpMerchantAccount.clone(); let txn_detail = this.get().dpTxnDetail.clone(); @@ -574,7 +574,7 @@ pub fn isMgaEligible( mgaEligibleSeamlessGateways: &[String], txn_detail: &TxnDetail, ) -> bool { - let payment_flow_list = Utils::get_payment_flow_list_from_txn_detail(&txn_detail); + let payment_flow_list = Utils::get_payment_flow_list_from_txn_detail(txn_detail); let is_otm_flow = payment_flow_list.contains(&"ONE_TIME_MANDATE".to_string()); let is_pix_automatic_redirect_flow = payment_flow_list.contains(&"PIX_AUTOMATIC_REDIRECT".to_string()); @@ -675,7 +675,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList .await; if isMerchantEnabledForCvvLessV2Flow { let configResp = isPaymentFlowEnabledWithHierarchyCheck( - mAcc.id.clone(), + mAcc.id, mAcc.tenantAccountId, TC::MerchantConfig, PF::Cvvless, @@ -966,7 +966,7 @@ pub async fn filterGatewaysForBrand(this: &mut DeciderFlow<'_>) -> Vec { /// - Others: filter out AMEX-not-supported and SODEXO-only gateways /// - Unknown brand: filter out AMEX-not-supported gateways pub async fn filterByCardBrand( - this: &mut DeciderFlow<'_>, + _this: &mut DeciderFlow<'_>, st: &[String], card_brand: Option<&str>, ) -> Vec { @@ -1036,7 +1036,7 @@ pub async fn filterGatewaysForAuthType( let txn_detail = this.get().dpTxnDetail.clone(); let txn_card_info = this.get().dpTxnCardInfo.clone(); let macc = this.get().dpMerchantAccount.clone(); - let dynamic_mga_enabled = Utils::get_is_merchant_enabled_for_dynamic_mga_selection(this).await; + let _dynamic_mga_enabled = Utils::get_is_merchant_enabled_for_dynamic_mga_selection(this).await; // Only proceed with filtering if card ISIN is available if let Some(ref card_isin) = txn_card_info.card_isin { // Filter for OTP authentication type @@ -1346,12 +1346,12 @@ pub async fn filterFunctionalGatewaysForOTMFlow(this: &mut DeciderFlow<'_>) -> V let txn_card_info = this.get().dpTxnCardInfo.clone(); // Get merchant gateway accounts - let m_mgas = Utils::get_mgas(this); + let _m_mgas = Utils::get_mgas(this); // Check if this is a One-Time Mandate flow let payment_flow_list = Utils::get_payment_flow_list_from_txn_detail(&txn_detail); let is_otm_flow = payment_flow_list.contains(&"ONE_TIME_MANDATE".to_string()); - let internal_tracking_info = txn_detail.internalTrackingInfo.clone(); + let _internal_tracking_info = txn_detail.internalTrackingInfo.clone(); if is_otm_flow { // Get order metadata and ref IDs @@ -1459,10 +1459,8 @@ pub async fn filterFunctionalGatewaysForOTMFlow(this: &mut DeciderFlow<'_>) -> V pub async fn filterFunctionalGatewaysForPixFlows(this: &mut DeciderFlow<'_>) -> Vec { /// Helper function to get the account details flag to be checked for PIX flows /// extend this for other pix flows. - fn get_acc_details_flag_to_be_checked(pf: &PaymentFlow) -> &str { - match pf { - _ => "enablePixAutomaticRedirect", - } + fn get_acc_details_flag_to_be_checked(_pf: &PaymentFlow) -> &str { + "enablePixAutomaticRedirect" } // Get current functional gateways @@ -1942,7 +1940,7 @@ where /// Determines if a merchant gateway account matches the provided gateway reference ID /// Used for gateway reference ID based routing pub fn predicate( - this: &mut DeciderFlow<'_>, + _this: &mut DeciderFlow<'_>, mga: ETM::merchant_gateway_account::MerchantGatewayAccount, gw: String, metadata: HashMap, @@ -2203,7 +2201,7 @@ pub async fn filterGatewaysForTxnOfferDetails(this: &mut DeciderFlow<'_>) -> Vec /// Filters gateway list based on gateway routing rules defined in transaction offer details /// If force_routing is enabled, only keeps gateways that appear in both the input list and the offer routing rules pub async fn filterByGatewayRule( - this: &mut DeciderFlow<'_>, + _this: &mut DeciderFlow<'_>, txn_detail: &TxnDetail, gw_list_acc: Vec, txn_offer_detail: &ETOD::TxnOfferDetail, @@ -2669,13 +2667,13 @@ fn is_disjoint(gateways1: &Vec, gateways2: &Vec) -> bool { } async fn getGatewaysAcceptingPaymentMethod( - oref: &Order, - merchant_acc: &MerchantAccount, + _oref: &Order, + _merchant_acc: &MerchantAccount, eligible_mgas: &[MerchantGatewayAccount], gateways: &GatewayList, payment_method: &str, - proceed_with_all_mgas: bool, - is_dynamic_mga_enabled: bool, + _proceed_with_all_mgas: bool, + _is_dynamic_mga_enabled: bool, ) -> (GatewayList, Vec) { let filtered_mgas: Vec<_> = eligible_mgas .iter() @@ -3008,7 +3006,7 @@ pub fn filterForEMITenureSpecificMGAs(this: &mut DeciderFlow<'_>) -> Vec // Return the gateway list with logging returnGwListWithLog( this, - DeciderFilterName::FilterGatewaysForEMITenureSpecficGatewayCreds, + DeciderFilterName::FilterGatewaysForEMITenureSpecificGatewayCreds, true, ) } @@ -3083,7 +3081,7 @@ pub async fn filterGatewaysForConsumerFinance(this: &mut DeciderFlow<'_>) -> Vec pub async fn filterGatewaysForUpi(this: &mut DeciderFlow<'_>) -> Vec { let st = getGws(this); let txn_card_info = this.get().dpTxnCardInfo.clone(); - let txn_detail = this.get().dpTxnDetail.clone(); + let _txn_detail = this.get().dpTxnDetail.clone(); let upi_only_gateways: Vec = findByNameFromRedis::>(C::UpiOnlyGateways.get_key()) .await @@ -3229,10 +3227,10 @@ fn getTxnTypeSupportedGateways( } /// Filters gateways and merchant gateway accounts based on UPI payment flow support -/// Checks both V2 integration and UPI intent capabilities +/// Checks both V2 integration and UPI Intent capabilities pub fn filterGatewaysForUpiPayBasedOnSupportedFlow( - this: &mut DeciderFlow<'_>, - gws: Vec, + _this: &mut DeciderFlow<'_>, + _gws: Vec, mgas: Vec, v2_integration_not_supported_gateways: Vec, upi_intent_not_supported_gateways: Vec, diff --git a/src/decider/gatewaydecider/gw_filter_new.rs b/src/decider/gatewaydecider/gw_filter_new.rs index 70dec442..292539c9 100644 --- a/src/decider/gatewaydecider/gw_filter_new.rs +++ b/src/decider/gatewaydecider/gw_filter_new.rs @@ -1538,7 +1538,7 @@ pub fn filterForEMITenureSpecificMGAs(this: &mut DeciderFlow) -> Vec 1 && (!is_explore_and_exploit_enabled || should_explore) { - let is_debug_mode_enabled = is_feature_enabled( + let _is_debug_mode_enabled = is_feature_enabled( C::ENABLE_DEBUG_MODE_ON_SR_V3.get_key(), Utils::get_m_id(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -508,7 +499,7 @@ pub async fn get_cached_scores_based_on_srv3( // Extract the new parameters from txn_card_info let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); - let sr_routing_dimesions = SrRoutingDimensions { + let sr_routing_dimensions = SrRoutingDimensions { card_network: txn_card_info .cardSwitchProvider .as_ref() @@ -528,14 +519,14 @@ pub async fn get_cached_scores_based_on_srv3( merchant_srv3_input_config.clone(), &pmt_str, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ) .or_else(|| { Utils::get_sr_v3_bucket_size( default_srv3_input_config.clone(), &pmt_str, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ) }) .unwrap_or(C::DEFAULT_SR_V3_BASED_BUCKET_SIZE); @@ -587,14 +578,14 @@ pub async fn get_cached_scores_based_on_srv3( merchant_srv3_input_config.clone(), &pmt_str, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ) .or_else(|| { Utils::get_sr_v3_upper_reset_factor( default_srv3_input_config.clone(), &pmt_str, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ) }) .unwrap_or(C::DEFAULT_SR_V3_BASED_UPPER_RESET_FACTOR); @@ -602,14 +593,14 @@ pub async fn get_cached_scores_based_on_srv3( merchant_srv3_input_config.clone(), &pmt_str, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ) .or_else(|| { Utils::get_sr_v3_lower_reset_factor( default_srv3_input_config.clone(), &pmt_str, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ) }) .unwrap_or(C::DEFAULT_SR_V3_BASED_LOWER_RESET_FACTOR); @@ -670,7 +661,7 @@ pub async fn get_cached_scores_based_on_srv3( pmt_str.to_string(), pm.clone(), gw.clone(), - sr_routing_dimesions.clone(), + sr_routing_dimensions.clone(), ); final_score_map.insert(gw, extra_score); } @@ -799,14 +790,14 @@ pub fn add_extra_score( pmt: String, pm: String, gw: String, - sr_routing_dimesions: SrRoutingDimensions, + sr_routing_dimensions: SrRoutingDimensions, ) -> f64 { let gateway_sigma_factor = Utils::get_sr_v3_gateway_sigma_factor( merchant_sr_v3_input_config, &pmt, &pm, &gw, - &sr_routing_dimesions, + &sr_routing_dimensions, ) .or_else(|| { Utils::get_sr_v3_gateway_sigma_factor( @@ -814,7 +805,7 @@ pub fn add_extra_score( &pmt, &pm, &gw, - &sr_routing_dimesions, + &sr_routing_dimensions, ) }) .unwrap_or(C::DEFAULT_SR_V3_BASED_GATEWAY_SIGMA_FACTOR); @@ -869,7 +860,7 @@ pub async fn reset_sr_v3_score( .iter() .filter_map(|(gw, score)| { sr_gateway_redis_key_map - .get(&format!("{}", gw)) + .get(&gw.to_string()) .map(|key| (key.clone(), *score)) }) .collect(); @@ -942,7 +933,7 @@ pub fn prepare_log_curr_score( score: f64, ) -> &Vec { acc.push(LogCurrScore { - gateway: format!("{}", gw), + gateway: gw.to_string(), current_score: score, }); acc @@ -965,7 +956,7 @@ pub async fn reset_and_log_metrics( .unwrap_or_default(), ); Utils::metric_tracker_log( - decider_flow.get().dpShouldConsumeResult.clone(), + decider_flow.get().dpShouldConsumeResult, metric_title.clone().as_str(), "GW_SCORING", Utils::get_metric_log_format(decider_flow, metric_title.as_str()), @@ -1028,7 +1019,7 @@ pub async fn update_score_for_outage(decider_flow: &mut DeciderFlow<'_>) -> Gate let out_gws: Vec<_> = potential_outages .into_iter() .filter(|outage| { - check_scheduled_outtage( + check_scheduled_outage( &txn_detail, &txn_card_info, &merchant.merchantId, @@ -1088,7 +1079,7 @@ where } } -fn check_scheduled_outtage( +fn check_scheduled_outage( txn_detail: &ETTD::TxnDetail, txn_card_info: &ETCT::txn_card_info::TxnCardInfo, merchant_id: &ETM::id::MerchantId, @@ -1123,7 +1114,7 @@ fn check_scheduled_outtage( false } }, - Some(juspay_bank_code.clone()), + Some(juspay_bank_code), scheduled_outage.bank.clone(), ) && check_scheduled_outage_metadata( txn_detail, @@ -1189,7 +1180,7 @@ fn check_scheduled_outage_metadata( UPI => txn_card_info .paymentSource .as_ref() - .map_or(false, |payment_source| { + .is_some_and(|payment_source| { if payment_source.peek().contains('@') { false } else { @@ -1216,10 +1207,10 @@ async fn get_scheduled_outage(scheduled_outage_validation_duration: i64) -> Vec< let scheduled_outages = ETGO::getPotentialGwOutages(primitive_time).await; let validated_outages: Vec = scheduled_outages .iter() - .cloned() - .filter(|outage| { + .filter(|&outage| { validate_scheduled_outage(scheduled_outage_validation_duration, outage.clone()) }) + .cloned() .collect(); logger::debug!("scheduled Outages length: {:?}", scheduled_outages.len()); // if validated_outages.len() != scheduled_outages.len() { @@ -1304,8 +1295,8 @@ pub async fn get_global_gateway_score( let sorted_filtered_merchants: Vec = global_gateway_score .merchants .iter() - .cloned() .take(max_count as usize) + .cloned() .collect::>(); let should_penalize = sorted_filtered_merchants.len() >= max_count as usize && sorted_filtered_merchants @@ -1477,8 +1468,8 @@ pub async fn update_gateway_score_based_on_global_success_rate( Ok(global_routing_defaults) => { let gateway_success_rate_inputs = gateway_score .clone() - .iter() - .map(|(k, _)| { + .keys() + .map(|k| { get_gateway_wise_routing_inputs_for_global_sr( k.clone(), merchant_wise_global_routing_input.clone(), @@ -1529,41 +1520,38 @@ pub async fn update_gateway_score_based_on_global_success_rate( txn_detail.txnId, global_elimination_gateway_score ); - match global_elimination_gateway_score { - Some((global_gateway_score, s)) => { - logger::info!(action = "global_gateway_score", "s-value : {:?}", s); - logger::info!( - action = "global_gateway_score", - "global_gateway_score{:?}", - global_gateway_score - ); - let new_gsri = GatewayWiseSuccessRateBasedRoutingInput { - currentScore: Some(s), - ..gsri.clone() - }; - logger::info!( - action = "global_gateway_score", - "Global Elimination Gateway Score for {:?} : {:?}", - txn_detail.txnId, - new_gsri - ); - upd_gateway_success_rate_inputs.push(new_gsri); - logger::info!( - action = "global_gateway_score", - "upd_gateway_success_rate_inputs{:?}", - upd_gateway_success_rate_inputs - ); - global_gateway_scores.extend(update_global_score_log( - gsri.gateway.clone(), - global_gateway_score, - )); - logger::info!( - action = "update_global_score_log", - "global_gateway_scores{:?}", - global_gateway_scores - ); - } - None => {} + if let Some((global_gateway_score, s)) = global_elimination_gateway_score { + logger::info!(action = "global_gateway_score", "s-value : {:?}", s); + logger::info!( + action = "global_gateway_score", + "global_gateway_score{:?}", + global_gateway_score + ); + let new_gsri = GatewayWiseSuccessRateBasedRoutingInput { + currentScore: Some(s), + ..gsri.clone() + }; + logger::info!( + action = "global_gateway_score", + "Global Elimination Gateway Score for {:?} : {:?}", + txn_detail.txnId, + new_gsri + ); + upd_gateway_success_rate_inputs.push(new_gsri); + logger::info!( + action = "global_gateway_score", + "upd_gateway_success_rate_inputs{:?}", + upd_gateway_success_rate_inputs + ); + global_gateway_scores.extend(update_global_score_log( + gsri.gateway.clone(), + global_gateway_score, + )); + logger::info!( + action = "update_global_score_log", + "global_gateway_scores{:?}", + global_gateway_scores + ); } } @@ -1666,7 +1654,7 @@ pub async fn update_gateway_score_based_on_global_success_rate( }, ); Utils::metric_tracker_log( - decider_flow.get().dpShouldConsumeResult.clone(), + decider_flow.get().dpShouldConsumeResult, "GLOBAL_SR_EVALUATION", "GW_SCORING", Utils::get_metric_log_format(decider_flow, "GLOBAL_SR_EVALUATION"), @@ -1975,7 +1963,7 @@ async fn get_elimination_v2_threshold( // }; // let sr2_th_weight = Env::lookup_env(sr2_th_weight_env).await; - if let Some((sr1, sr2, n, n_m_, m_pmt, m_pm, m_txn_object_type, source)) = + if let Some((sr1, sr2, n, n_m_, m_pmt, m_pm, m_txn_object_type, _source)) = get_sr1_and_sr2_and_n( m_gateway_success_rate_merchant_input, merchant_acc.merchantId.0.clone(), @@ -2053,7 +2041,7 @@ pub async fn get_sr1_and_sr2_and_n( Some(obj_type) => obj_type.to_text().to_string(), None => return None, }; - let card_type = txn_card_info.card_type.clone(); + let _card_type = txn_card_info.card_type.clone(); match m_gateway_success_rate_merchant_input { None => { @@ -2194,8 +2182,8 @@ async fn filter_using_service_config( pm: Option, txn_obj_type: String, inputs: Option>, - is_gri_enabled_for_elimination: bool, - gateway_reference_id: Option, + _is_gri_enabled_for_elimination: bool, + _gateway_reference_id: Option, ) -> Option<( f64, f64, @@ -2264,7 +2252,7 @@ pub fn filter_inputs_upto( pub fn fetch_sr1_and_n_from_service_config_upto( level: FilterLevel, - merchant_id: String, + _merchant_id: String, pmt: String, pm: Option, txn_object_type: String, @@ -2442,7 +2430,7 @@ pub async fn update_gateway_score_based_on_success_rate( let txn_detail = decider_flow.get().dpTxnDetail.clone(); let txn_card_info = decider_flow.get().dpTxnCardInfo.clone(); let enable_success_rate_based_gateway_elimination = isPaymentFlowEnabledWithHierarchyCheck( - merchant_acc.id.clone(), + merchant_acc.id, merchant_acc.tenantAccountId.clone(), ModuleName::MerchantConfig, PaymentFlow::EliminationBasedRouting, @@ -2689,7 +2677,7 @@ pub async fn update_gateway_score_based_on_success_rate( ); Utils::metric_tracker_log( - decider_flow.get().dpShouldConsumeResult.clone(), + decider_flow.get().dpShouldConsumeResult, "SR_EVALUATION", "GW_SCORING", Utils::get_metric_log_format(decider_flow, "SR_EVALUATION"), @@ -2863,7 +2851,7 @@ pub fn update_score_with_log( ) -> GatewayScoreMap { let new_m = m .iter() - .filter_map(|(gw, score)| { + .map(|(gw, score)| { if *gw == v.gateway { let new_score = *score / 5_f64; logger::debug!( @@ -2873,9 +2861,9 @@ pub fn update_score_with_log( v.gateway, txn_id ); - Some((gw.clone(), new_score)) + (gw.clone(), new_score) } else { - Some((gw.clone(), *score)) + (gw.clone(), *score) } }) .collect(); @@ -2897,7 +2885,7 @@ pub async fn update_current_score( i: ETGRI::GatewayWiseSuccessRateBasedRoutingInput, ) -> ETGRI::GatewayWiseSuccessRateBasedRoutingInput { let redis_key = gateway_redis_key_map - .get(&format!("{}", i.gateway)) + .get(&i.gateway.to_string()) .unwrap_or(&String::new()) .to_string(); let txn_detail = decider_flow.get().dpTxnDetail.clone(); @@ -2976,7 +2964,7 @@ pub async fn evaluate_reset_gateway_score( let key_ttl = getKeyTTLFromMerchantDimension(merchantGatewayScoreDimension(it.clone())).await; if let Some(last_reset_time) = it.lastResetTimeStamp { - if (current_time * 1000 - last_reset_time as i64) > key_ttl.round() as i64 { + if (current_time * 1000 - last_reset_time) > key_ttl.round() as i64 { logger::debug!( tag = "evaluateResetGatewayScore", action = "evaluateResetGatewayScore", @@ -3044,7 +3032,7 @@ pub async fn trigger_reset_gateway_score( let reset_gateway_input = ResetGatewayInput { gateway: it.clone(), eliminationThreshold: sr_input.eliminationThreshold, - eliminationMaxCount: sr_input.softTxnResetCount.map(|v| v as i64), + eliminationMaxCount: sr_input.softTxnResetCount.map(|v| v), gatewayEliminationThreshold: sr_input.gatewayLevelEliminationThreshold, gatewayReferenceId: gw_ref_id.map(|id| id.mga_reference_id), key: gateway_redis_key_map.get(it).cloned(), @@ -3147,13 +3135,13 @@ pub async fn reset_gateway_score( ); let (is_eligible_for_reset, reset_cached_gateway_score) = match score { Some(score) => { - let current_score = score.score; + let _current_score = score.score; let transaction_count = score.transactionCount; - let last_reset_time = score.lastResetTimestamp; - let is_eligible_for_reset_ = Utils::is_reset_eligibile( + let _last_reset_time = score.lastResetTimestamp; + let is_eligible_for_reset_ = Utils::is_reset_eligible( Some(reset_gateway_input.clone().softTtl), - current_timestamp.clone(), - threshold.clone(), + current_timestamp, + threshold, score.clone(), ); if is_eligible_for_reset_ { @@ -3162,7 +3150,7 @@ pub async fn reset_gateway_score( let reset_cached_gateway_score_ = GatewayScore { score: reset_score, transactionCount: transaction_count, - lastResetTimestamp: current_timestamp.clone() as i64, + lastResetTimestamp: current_timestamp as i64, timestamp: score.clone().timestamp, }; (true, reset_cached_gateway_score_) @@ -3180,8 +3168,8 @@ pub async fn reset_gateway_score( let default_gw_score = GatewayScore { score: 1.0, transactionCount: 0, - lastResetTimestamp: current_timestamp.clone() as i64, - timestamp: current_timestamp.clone() as i64, + lastResetTimestamp: current_timestamp as i64, + timestamp: current_timestamp as i64, }; logger::debug!( tag = "hard Reset", @@ -3194,9 +3182,8 @@ pub async fn reset_gateway_score( }; let elapsed_time = current_timestamp.saturating_sub(reset_cached_gateway_score.timestamp as u128); - let remaining_ttl = (reset_gateway_input.hardTtl as u128).saturating_sub(elapsed_time); - #[allow(clippy::absurd_extreme_comparisons)] - let safe_remaining_ttl = if remaining_ttl < 0 { + let remaining_ttl = reset_gateway_input.hardTtl.saturating_sub(elapsed_time); + let safe_remaining_ttl = if elapsed_time > reset_gateway_input.hardTtl { reset_gateway_input.hardTtl as i64 } else { remaining_ttl as i64 @@ -3258,7 +3245,7 @@ pub fn route_random_traffic( decider_flow: &mut DeciderFlow<'_>, gws: GatewayScoreMap, hedging_percent: f64, - is_sr_v3_metric_enabled: bool, + _is_sr_v3_metric_enabled: bool, tag: String, ) -> GatewayScoreMap { let num = generate_random_number( @@ -3277,11 +3264,11 @@ pub fn route_random_traffic( if num < hedging_percent * (remaining_gateways.len() as f64) { let remaining_gateways: Vec<_> = remaining_gateways .iter() - .map(|(gw, _)| (gw.clone(), 1.0)) + .map(|(gw, _)| ((*gw).clone(), 1.0)) .collect(); let head_gateways: Vec<_> = head_gateway .iter() - .map(|(gw, _)| (gw.clone(), 0.5)) + .map(|(gw, _)| ((*gw).clone(), 0.5)) .collect(); logger::debug!( "Gateway Scores After Route Random Traffic Feature: {:?}", @@ -3504,5 +3491,5 @@ async fn fetch_from_redis(key: &str, dim_key: &Option) -> Option String { - format!("{}{}", C::aggregateKeyPrefix, merchant_id) + format!("{}{}", C::AGGREGATE_KEY_PREFIX, merchant_id) } diff --git a/src/decider/gatewaydecider/runner.rs b/src/decider/gatewaydecider/runner.rs index 148abdd4..8113fc3a 100644 --- a/src/decider/gatewaydecider/runner.rs +++ b/src/decider/gatewaydecider/runner.rs @@ -238,12 +238,12 @@ pub fn make_payment_info( paymentMethodType: txnCardInfo .card_type .as_ref() - .map(|ct| card_type_to_text(&ct)) - .or_else(|| Some(txnCardInfo.paymentMethodType)), + .map(card_type_to_text) + .or(Some(txnCardInfo.paymentMethodType)), paymentMethod: txnCardInfo .cardIssuerBankName .clone() - .or_else(|| Some(txnCardInfo.paymentMethod)), + .or(Some(txnCardInfo.paymentMethod)), paymentSource: txnCardInfo.paymentSource, cardIssuer: txnCardInfo.cardIssuerBankName, cardType: txnCardInfo.card_type.map(|c| card_type_to_text(&c)), @@ -576,7 +576,7 @@ pub async fn get_gateway_priority( ); match result { - EvaluationResult::PLResponse(gws, pl_data, logs, status) => { + EvaluationResult::PLResponse(gws, pl_data, logs, _status) => { logger::debug!( tag = "PRIORITY_LOGIC_EXECUTION_", "MerchantId: {:?} , Gateways: {:?}, Logs: {:?}", @@ -1022,7 +1022,7 @@ pub async fn handle_fallback_logic( ) .await; match fallback_result { - EvaluationResult::PLResponse(gws, pl_data, logs, status) => { + EvaluationResult::PLResponse(gws, pl_data, logs, _status) => { logger::debug!( tag = "FALLBACK_PRIORITY_LOGIC_EXECUTION_", "MerchantId: {:?} , Gateways: {:?}, Logs: {:?}", diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 9c215a6f..6b98af82 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_json::Value as AValue; use std::collections::HashMap as HMap; use std::collections::HashMap; -use std::i64; use std::option::Option; use std::string::String; use std::vec::Vec; @@ -74,7 +73,7 @@ pub enum DeciderFilterName { GatewayPriorityList, FilterFunctionalGatewaysForMerchantRequiredFlow, FilterGatewaysForMGASelectionIntegrity, - FilterGatewaysForEMITenureSpecficGatewayCreds, + FilterGatewaysForEMITenureSpecificGatewayCreds, FilterFunctionalGatewaysForReversePennyDrop, FilterFunctionalGatewaysForOTM, FilterFunctionalGatewaysForPixFlows, @@ -151,8 +150,8 @@ impl fmt::Display for DeciderFilterName { Self::FilterGatewaysForMGASelectionIntegrity => { write!(f, "FilterGatewaysForMGASelectionIntegrity") } - Self::FilterGatewaysForEMITenureSpecficGatewayCreds => { - write!(f, "FilterGatewaysForEMITenureSpecficGatewayCreds") + Self::FilterGatewaysForEMITenureSpecificGatewayCreds => { + write!(f, "FilterGatewaysForEMITenureSpecificGatewayCreds") } Self::FilterFunctionalGatewaysForReversePennyDrop => { write!(f, "FilterFunctionalGatewaysForReversePennyDrop") @@ -373,20 +372,15 @@ pub fn transform_gateway_wise_success_rate_based_routing( ) -> DeciderGatewayWiseSuccessRateBasedRoutingInput { DeciderGatewayWiseSuccessRateBasedRoutingInput { gateway: gateway_wise_success_rate_input.gateway.clone(), - eliminationThreshold: gateway_wise_success_rate_input.eliminationThreshold.clone(), - eliminationMaxCountThreshold: gateway_wise_success_rate_input - .eliminationMaxCountThreshold - .clone(), - selectionMaxCountThreshold: gateway_wise_success_rate_input - .selectionMaxCountThreshold - .clone(), - softTxnResetCount: gateway_wise_success_rate_input.softTxnResetCount.clone(), + eliminationThreshold: gateway_wise_success_rate_input.eliminationThreshold, + eliminationMaxCountThreshold: gateway_wise_success_rate_input.eliminationMaxCountThreshold, + selectionMaxCountThreshold: gateway_wise_success_rate_input.selectionMaxCountThreshold, + softTxnResetCount: gateway_wise_success_rate_input.softTxnResetCount, gatewayLevelEliminationThreshold: gateway_wise_success_rate_input - .gatewayLevelEliminationThreshold - .clone(), + .gatewayLevelEliminationThreshold, eliminationLevel: gateway_wise_success_rate_input.eliminationLevel.clone(), - currentScore: gateway_wise_success_rate_input.currentScore.clone(), - lastResetTimeStamp: gateway_wise_success_rate_input.lastResetTimeStamp.clone(), + currentScore: gateway_wise_success_rate_input.currentScore, + lastResetTimeStamp: gateway_wise_success_rate_input.lastResetTimeStamp, } } @@ -1043,9 +1037,9 @@ impl DomainDeciderRequestForApiCallV2 { merchantId: ETM::id::to_merchant_id(self.merchant_id.clone()), gateway: None, expressCheckout: Some(false), - isEmi: Some(self.payment_info.is_emi.clone().unwrap_or(false)), + isEmi: Some(self.payment_info.is_emi.unwrap_or(false)), emiBank: self.payment_info.emi_bank.clone(), - emiTenure: self.payment_info.emi_tenure.clone(), + emiTenure: self.payment_info.emi_tenure, txnUuid: self.payment_info.payment_id.clone(), merchantGatewayAccountId: None, txnAmount: Some(ETMo::Money::from_double(self.payment_info.amount)), @@ -1053,7 +1047,7 @@ impl DomainDeciderRequestForApiCallV2 { sourceObject: Some(self.payment_info.payment_method.clone()), sourceObjectId: None, currency: self.payment_info.currency.clone(), - country: self.payment_info.country.clone(), + country: self.payment_info.country, netAmount: Some(ETMo::Money::from_double(self.payment_info.amount)), surchargeAmount: None, taxAmount: None, @@ -1928,9 +1922,9 @@ pub async fn initial_decider_flow<'a>( } } -struct Reader { - reader: T, - tenant_state: TenantAppState, +pub struct Reader { + pub reader: T, + pub tenant_state: TenantAppState, } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index db7aff50..4d58537f 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -5,18 +5,12 @@ use crate::euclid::types::SrDimensionConfig; use crate::feedback::gateway_elimination_scoring::flow::{ eliminationV2RewardFactor, getPenaltyFactor, }; -use crate::redis::feature::{ - is_feature_enabled, RedisCompressionConfig, RedisCompressionConfigCombined, RedisDataStruct, -}; +use crate::redis::feature::{is_feature_enabled, RedisCompressionConfigCombined, RedisDataStruct}; use crate::redis::types::ServiceConfigKey; -#[cfg(feature = "mysql")] -use crate::storage::schema::gateway_bank_emi_support::gateway; -#[cfg(feature = "postgres")] -use crate::storage::schema_pg::gateway_bank_emi_support::gateway; use crate::types::card::card_type::card_type_to_text; use crate::types::country::country_iso::CountryISO2; use crate::types::currency::Currency; -use crate::types::merchant::id::{merchant_id_to_text, MerchantId}; +use crate::types::merchant::id::merchant_id_to_text; use crate::types::merchant::merchant_gateway_account::MerchantGatewayAccount; use crate::types::money::internal::Money; use crate::types::payment::payment_method_type_const::*; @@ -87,7 +81,6 @@ use crate::types::token_bin_info as ETTB; // // use control::category::Category; // // use juspay::extra::non_empty_text as NET; use crate::redis::cache as RService; -use crate::types::isin_routes as ETIsinR; // // use utils::redis as EWRedis; // // use db::common::types::payment_flows as PF; // // use utils::redis as Redis; @@ -191,7 +184,7 @@ pub fn get_pl_gw_ref_id_map(decider_flow: &DeciderFlow<'_>) -> HashMap, enable_gateway_reference_id_based_routing: Option, - order: &ETO::Order, + _order: &ETO::Order, ) -> (HashMap, HashMap) { if enable_gateway_reference_id_based_routing.unwrap_or(false) { let order_metadata = get_metadata(decider_flow); @@ -228,7 +221,7 @@ pub fn is_emandate_payment_transaction(txn_detail: &ETTD::TxnDetail) -> bool { ) } -pub fn is_reccuring_payment_transaction(txn_detail: &ETTD::TxnDetail) -> bool { +pub fn is_recurring_payment_transaction(txn_detail: &ETTD::TxnDetail) -> bool { matches!( txn_detail.txnObjectType, Some(ETTD::TxnObjectType::EmandatePayment) @@ -500,7 +493,7 @@ fn decode_metadata(text: &str) -> HashMap { pub fn get_all_possible_ref_ids( metadata: HashMap, - oref: ETO::Order, + _oref: ETO::Order, pl_ref_id_map: HashMap, ) -> Vec { let gateway_ref_ids = is_suffix_of_gateway_ref_id(metadata.iter().collect()); @@ -544,7 +537,7 @@ pub async fn get_all_ref_ids( pub fn get_gateway_reference_id( metadata: HashMap, gw: &String, - oref: ETO::Order, + _oref: ETO::Order, pl_ref_id_map: HashMap, ) -> Option { let meta_res = pl_ref_id_map @@ -721,11 +714,11 @@ pub async fn get_split_settlement_details( pub async fn metric_tracker_log( consume_from_router: Option, - stage: &str, - flowtype: &str, + _stage: &str, + _flowtype: &str, log_data: MessageFormat, ) { - let mut normalized_log_data = match serde_json::to_value(&log_data) { + let normalized_log_data = match serde_json::to_value(&log_data) { Ok(value) => value, Err(e) => { crate::logger::info!( @@ -896,7 +889,7 @@ pub async fn get_card_bin_from_token_bin( Some(bin) => bin.chars().take(length).collect(), None => match get_extended_token_bin_info(token_bin).await { Some(token_bin_info) => { - app_state + let _ = app_state .redis_conn .set_key( &key, @@ -979,7 +972,7 @@ pub enum EnabledGatewaysForBrand { } pub async fn get_token_supported_gateways( - txn_detail: ETTD::TxnDetail, + _txn_detail: ETTD::TxnDetail, txn_card_info: ETCa::txn_card_info::TxnCardInfo, flow: String, m_internal_meta: Option, @@ -1433,7 +1426,7 @@ pub fn decider_filter_order(filter_name: &str) -> i32 { "preferredGateway" => 21, "filterEnforcement" => 22, "filterFunctionalGatewaysForMerchantRequiredFlow" => 23, - "filterGatewaysForEMITenureSpecficGatewayCreds" => 24, + "filterGatewaysForEMITenureSpecificGatewayCreds" => 24, "filterGatewaysForMGASelectionIntegrity" => 25, "FilterFunctionalGatewaysForOTM" => 26, _ => 27, @@ -1542,15 +1535,15 @@ pub async fn get_experiment_tag(utc_time: OffsetDateTime, dim: &str) -> Option, ) { // todo!() let app_state = get_tenant_app_state().await; - let r: Result, error_stack::Report> = + let _r: Result, error_stack::Report> = app_state .redis_conn .multi(false, |transaction| { @@ -1558,24 +1551,18 @@ pub async fn create_moving_window_and_score( transaction.del::<(), _>(queue_key.clone()).await?; transaction .lpush::<(), _, _>( - queue_key.as_bytes().clone(), + queue_key.as_bytes(), score_list.iter().map(|s| s.as_bytes()).collect::>(), ) .await?; transaction - .set::<(), _, _>( - score_key.clone(), - score.to_string().clone(), - None, - None, - false, - ) + .set::<(), _, _>(score_key.clone(), score.to_string(), None, None, false) .await?; transaction - .expire::<(), _>(queue_key.as_bytes().clone(), 10000000) + .expire::<(), _>(queue_key.as_bytes(), 10000000) .await?; transaction - .expire::<(), _>(score_key.as_bytes().clone(), 10000000) + .expire::<(), _>(score_key.as_bytes(), 10000000) .await?; Ok(()) }) @@ -1601,14 +1588,14 @@ pub fn get_sr_v3_latency_threshold( sr_v3_input_config: Option, pmt: &str, pm: &str, - sr_routing_dimesions: &SrRoutingDimensions, + sr_routing_dimensions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { get_sr_v3_sub_level_input_config( &config.subLevelInputConfig, pmt, pm, - sr_routing_dimesions, + sr_routing_dimensions, |x| x.latencyThreshold.is_some(), ) .and_then(|sub_config| sub_config.latencyThreshold) @@ -1620,14 +1607,14 @@ pub fn get_sr_v3_bucket_size( sr_v3_input_config: Option, pmt: &str, pm: &str, - sr_routing_dimesions: &SrRoutingDimensions, + sr_routing_dimensions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { get_sr_v3_sub_level_input_config( &config.subLevelInputConfig, pmt, pm, - sr_routing_dimesions, + sr_routing_dimensions, |x| x.bucketSize.is_some(), ) .and_then(|sub_config| sub_config.bucketSize) @@ -1640,14 +1627,14 @@ pub fn get_sr_v3_hedging_percent( sr_v3_input_config: Option, pmt: &str, pm: &str, - sr_routing_dimesions: &SrRoutingDimensions, + sr_routing_dimensions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { get_sr_v3_sub_level_input_config( &config.subLevelInputConfig, pmt, pm, - sr_routing_dimesions, + sr_routing_dimensions, |x| x.hedgingPercent.is_some(), ) .and_then(|sub_config| sub_config.hedgingPercent) @@ -1660,14 +1647,14 @@ pub fn get_sr_v3_lower_reset_factor( sr_v3_input_config: Option, pmt: &str, pm: &str, - sr_routing_dimesions: &SrRoutingDimensions, + sr_routing_dimensions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { get_sr_v3_sub_level_input_config( &config.subLevelInputConfig, pmt, pm, - sr_routing_dimesions, + sr_routing_dimensions, |x| x.lowerResetFactor.is_some(), ) .and_then(|sub_config| sub_config.lowerResetFactor) @@ -1680,14 +1667,14 @@ pub fn get_sr_v3_upper_reset_factor( sr_v3_input_config: Option, pmt: &str, pm: &str, - sr_routing_dimesions: &SrRoutingDimensions, + sr_routing_dimensions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { get_sr_v3_sub_level_input_config( &config.subLevelInputConfig, pmt, pm, - sr_routing_dimesions, + sr_routing_dimensions, |x| x.upperResetFactor.is_some(), ) .and_then(|sub_config| sub_config.upperResetFactor) @@ -1701,14 +1688,14 @@ pub fn get_sr_v3_gateway_sigma_factor( pmt: &str, pm: &str, gw: &String, - sr_routing_dimesions: &SrRoutingDimensions, + sr_routing_dimensions: &SrRoutingDimensions, ) -> Option { sr_v3_input_config.and_then(|config| { get_sr_v3_sub_level_input_config( &config.subLevelInputConfig, pmt, pm, - sr_routing_dimesions, + sr_routing_dimensions, |x| { x.gatewayExtraScore .as_ref() @@ -1736,7 +1723,7 @@ fn get_sr_v3_sub_level_input_config( sub_level_input_config: &Option>, pmt: &str, pm: &str, - sr_routing_dimesions: &SrRoutingDimensions, + sr_routing_dimensions: &SrRoutingDimensions, is_input_non_null: impl Fn(&SrV3SubLevelInputConfig) -> bool, ) -> Option { sub_level_input_config @@ -1749,7 +1736,7 @@ fn get_sr_v3_sub_level_input_config( config, Some(pmt.to_string()), Some(pm.to_string()), - &sr_routing_dimesions, + sr_routing_dimensions, ) && is_input_non_null(config) }) .or_else(|| { @@ -1758,7 +1745,7 @@ fn get_sr_v3_sub_level_input_config( config, Some(pmt.to_string()), None, - &sr_routing_dimesions, + sr_routing_dimensions, ) && is_input_non_null(config) }) }) @@ -1770,20 +1757,20 @@ fn is_sr_v3_config_match( config: &SrV3SubLevelInputConfig, pmt: Option, pm: Option, - sr_routing_dimesions: &SrRoutingDimensions, + sr_routing_dimensions: &SrRoutingDimensions, ) -> bool { let pmt_matches = config.paymentMethodType == pmt; let pm_matches = config.paymentMethod.is_none() || config.paymentMethod == pm; let card_network_matches = - config.cardNetwork.is_none() || config.cardNetwork == sr_routing_dimesions.card_network; + config.cardNetwork.is_none() || config.cardNetwork == sr_routing_dimensions.card_network; let card_isin_matches = - config.cardIsIn.is_none() || config.cardIsIn == sr_routing_dimesions.card_isin; + config.cardIsIn.is_none() || config.cardIsIn == sr_routing_dimensions.card_isin; let currency_matches = - config.currency.is_none() || config.currency == sr_routing_dimesions.currency; + config.currency.is_none() || config.currency == sr_routing_dimensions.currency; let country_matches = - config.country.is_none() || config.country == sr_routing_dimesions.country; + config.country.is_none() || config.country == sr_routing_dimensions.country; let auth_type_matches = - config.authType.is_none() || config.authType == sr_routing_dimesions.auth_type; + config.authType.is_none() || config.authType == sr_routing_dimensions.auth_type; pmt_matches && pm_matches @@ -1842,7 +1829,7 @@ pub async fn delete_score_key_if_bucket_size_changes( .delete_key(&[sr_redis_key, "}score".to_string()].concat()) .await { - Ok(res) => (), + Ok(_res) => (), Err(err) => { logger::error!( action = "deleteScoreKeyIfBucketSizeChanges", @@ -1868,7 +1855,7 @@ pub fn intercalate>(separator: &str, strings: &[S]) -> String { // Function to check if the bucket size has changed for a specific gateway pub async fn check_if_bucket_size_changed( - decider_flow: &mut DeciderFlow<'_>, + _decider_flow: &mut DeciderFlow<'_>, merchant_bucket_size: i32, gateway_redis_key: (String, String), ) -> bool { @@ -2011,8 +1998,8 @@ pub fn get_default_gateway_scoring_data( eliminationEnabled: false, cardIsIn: card_isin, cardSwitchProvider: card_switch_provider, - currency: currency, - country: country, + currency, + country, is_legacy_decider_flow, udfs, udfs_consumed_for_routing: None, @@ -2027,7 +2014,7 @@ pub async fn get_gateway_scoring_data( merchant: ETM::merchant_account::MerchantAccount, is_legacy_decider_flow: bool, ) -> GatewayScoringData { - let merchant_enabled_for_unification = is_feature_enabled( + let _merchant_enabled_for_unification = is_feature_enabled( C::MerchantsEnabledForScoreKeysUnification.get_key(), merchant_id_to_text(merchant.merchantId.clone()), "kv_redis".to_string(), @@ -2064,7 +2051,7 @@ pub async fn get_gateway_scoring_data( .await; let (useServiceConfigForGri, gatewayRefId) = if is_gri_enabled_for_sr_routing || is_gri_enabled_for_elimination { - (get_common_gateway_ref_id(decider_flow).await) + get_common_gateway_ref_id(decider_flow).await } else { (true, None) }; @@ -2075,11 +2062,11 @@ pub async fn get_gateway_scoring_data( m_source_object, is_gri_enabled_for_elimination, is_gri_enabled_for_sr_routing, - decider_flow.get().dpTxnDetail.dateCreated.clone(), + decider_flow.get().dpTxnDetail.dateCreated, decider_flow.get().dpTxnCardInfo.card_isin.clone(), decider_flow.get().dpTxnCardInfo.cardSwitchProvider.clone(), Some(decider_flow.get().dpOrder.currency.clone()), - decider_flow.get().dpTxnDetail.country.clone(), + decider_flow.get().dpTxnDetail.country, decider_flow .get() .dpTxnCardInfo @@ -2178,7 +2165,7 @@ pub async fn get_gateway_scoring_data( get_experiment_tag(txn_detail.dateCreated, "GRI_BASED_SR_ROUTING").await; set_is_experiment_tag(decider_flow, experiment_tag); } - let key = [C::GATEWAY_SCORING_DATA, &txn_detail.txnUuid.clone()].concat(); + let _key = [C::GATEWAY_SCORING_DATA, &txn_detail.txnUuid.clone()].concat(); updated_gateway_scoring_data } @@ -2625,8 +2612,7 @@ pub async fn get_unified_sr_key( key_components.extend(udf_values); } - let val = intercalate_without_empty_string("_", &key_components); - return val; + intercalate_without_empty_string("_", &key_components) } async fn get_legacy_unified_sr_key( @@ -2746,7 +2732,7 @@ pub async fn get_consumer_key( gateway_list: GatewayList, ) -> GatewayRedisKeyMap { let merchant = decider_flow.get().dpMerchantAccount.clone(); - let txn_detail = decider_flow.get().dpTxnDetail.clone(); + let _txn_detail = decider_flow.get().dpTxnDetail.clone(); let gw_ref_id_map = if gateway_scoring_data.isGriEnabledForElimination || gateway_scoring_data.isGriEnabledForSrRouting { @@ -2828,7 +2814,7 @@ async fn set_routing_dimension_and_reference( "UPI_PAY" | "PAY" => { let package_list = get_upi_package_list().await; let upi_package = gateway_scoring_data.paymentSource.unwrap_or_default(); - let append_package = if package_list.contains(&upi_package.peek()) { + let append_package = if package_list.contains(upi_package.peek()) { upi_package.peek().to_string() } else { "".to_string() @@ -2873,7 +2859,7 @@ async fn set_routing_dimension_and_reference( let bank_code = gateway_scoring_data .bankCode .unwrap_or("UNKNOWN".to_string()); - let append_bank_code = if top_bank_list.contains(&bank_code) { + let _append_bank_code = if top_bank_list.contains(&bank_code) { bank_code.clone() } else { "".to_string() @@ -2994,7 +2980,7 @@ pub fn route_random_traffic_to_explore( num < explore_hedging_percent } -pub fn is_reset_eligibile( +pub fn is_reset_eligible( soft_ttl: Option, current_time_in_millis: u128, threshold: f64, @@ -3041,7 +3027,7 @@ pub async fn writeToCacheWithTTL( // Original Haskell function: addToCacheWithExpiry pub async fn addToCacheWithExpiry( - redis_name: String, + _redis_name: String, key: String, value: String, ttl: i64, @@ -3060,7 +3046,7 @@ pub async fn addToCacheWithExpiry( .await; match cached_resp { Ok(_) => Ok(()), - Err(error) => Err(StorageError::InsertError), + Err(_error) => Err(StorageError::InsertError), } } @@ -3089,13 +3075,11 @@ pub async fn get_penality_factor_( ) .await; match m_reward_factor { - Some(reward_factor) => return 1.0 - reward_factor, - None => { - return getPenaltyFactor(ScoreKeyType::EliminationMerchantKey).await; - } + Some(reward_factor) => 1.0 - reward_factor, + None => getPenaltyFactor(ScoreKeyType::EliminationMerchantKey).await, } } else { - return getPenaltyFactor(ScoreKeyType::EliminationMerchantKey).await; + getPenaltyFactor(ScoreKeyType::EliminationMerchantKey).await } } diff --git a/src/decider/network_decider/co_badged_card_info.rs b/src/decider/network_decider/co_badged_card_info.rs index 2617d660..bf8bbb3f 100644 --- a/src/decider/network_decider/co_badged_card_info.rs +++ b/src/decider/network_decider/co_badged_card_info.rs @@ -232,7 +232,7 @@ pub fn calculate_interchange_fee( &debit_routing.interchange_fee.regulated } else { logger::debug!("Non regulated bank"); - debit_routing.get_non_regulated_interchange_fee(&merchant_category_code, network)? + debit_routing.get_non_regulated_interchange_fee(merchant_category_code, network)? }; let percentage = fee_data.percentage; @@ -304,8 +304,8 @@ pub fn calculate_total_fees_per_network( .map(|network| { let interchange_fee = calculate_interchange_fee( &network, - &co_badged_cards_info, - &merchant_category_code, + co_badged_cards_info, + merchant_category_code, amount, debit_routing_config, ) diff --git a/src/decider/network_decider/debit_routing.rs b/src/decider/network_decider/debit_routing.rs index e206ff3d..a782c234 100644 --- a/src/decider/network_decider/debit_routing.rs +++ b/src/decider/network_decider/debit_routing.rs @@ -20,8 +20,7 @@ pub async fn perform_debit_routing( if let Some(metadata_value) = decider_request .payment_info .metadata - .map(|metadata_string| gateway_decider_utils::parse_json_from_string(&metadata_string)) - .flatten() + .and_then(|metadata_string| gateway_decider_utils::parse_json_from_string(&metadata_string)) { logger::debug!("Parsed debit routing metadata to json"); match TryInto::::try_into(metadata_value) { diff --git a/src/decider/network_decider/helpers.rs b/src/decider/network_decider/helpers.rs index 6f63dee1..0d5839f2 100644 --- a/src/decider/network_decider/helpers.rs +++ b/src/decider/network_decider/helpers.rs @@ -34,15 +34,14 @@ impl types::DebitRoutingConfig { &self, network: &gateway_decider_types::NETWORK, ) -> CustomResult<&types::NetworkProcessingData, error::ApiError> { - Ok(self - .network_fee + self.network_fee .get(network) .ok_or(error::ApiError::MissingRequiredField( "interchange fee for non regulated", )) .attach_printable( "Failed to fetch interchange fee for non regulated banks in debit routing", - )?) + ) } } @@ -199,15 +198,8 @@ impl types::CoBadgedCardRequest { impl gateway_decider_types::NETWORK { pub fn is_global_network(&self) -> bool { match self { - gateway_decider_types::NETWORK::VISA - | gateway_decider_types::NETWORK::AMEX - | gateway_decider_types::NETWORK::DINERS - | gateway_decider_types::NETWORK::RUPAY - | gateway_decider_types::NETWORK::MASTERCARD => true, - gateway_decider_types::NETWORK::STAR - | gateway_decider_types::NETWORK::PULSE - | gateway_decider_types::NETWORK::ACCEL - | gateway_decider_types::NETWORK::NYCE => false, + Self::VISA | Self::AMEX | Self::DINERS | Self::RUPAY | Self::MASTERCARD => true, + Self::STAR | Self::PULSE | Self::ACCEL | Self::NYCE => false, } } } diff --git a/src/decider/network_decider/types.rs b/src/decider/network_decider/types.rs index ade649f6..90e2bbfa 100644 --- a/src/decider/network_decider/types.rs +++ b/src/decider/network_decider/types.rs @@ -303,7 +303,7 @@ pub struct CoBadgedCardInfoResponse { impl From for CoBadgedCardInfoResponse { fn from(co_badged_card_data: DebitRoutingRequestData) -> Self { - CoBadgedCardInfoResponse { + Self { co_badged_card_networks: co_badged_card_data.co_badged_card_networks, issuer_country: co_badged_card_data.issuer_country, is_regulated: co_badged_card_data.is_regulated, diff --git a/src/decider/network_decider/utils.rs b/src/decider/network_decider/utils.rs index c0a0bd96..8eaf5fae 100644 --- a/src/decider/network_decider/utils.rs +++ b/src/decider/network_decider/utils.rs @@ -13,7 +13,7 @@ macro_rules! impl_to_sql_from_sql_text_mysql { &'b self, out: &mut ::diesel::serialize::Output<'b, '_, ::diesel::mysql::Mysql>, ) -> ::diesel::serialize::Result { - use ::std::io::Write; + use std::io::Write; out.write_all(self.to_string().as_bytes())?; Ok(::diesel::serialize::IsNull::No) } @@ -25,7 +25,7 @@ macro_rules! impl_to_sql_from_sql_text_mysql { fn from_sql( value: ::diesel::mysql::MysqlValue<'_>, ) -> ::diesel::deserialize::Result { - use ::core::str::FromStr; + use core::str::FromStr; let s = ::core::str::from_utf8(value.as_bytes())?; <$type>::from_str(s).map_err(|_| "Unrecognized enum variant".into()) } @@ -40,15 +40,15 @@ macro_rules! impl_to_sql_from_sql_text_pg { &'b self, out: &mut ::diesel::serialize::Output<'b, '_, ::diesel::pg::Pg>, ) -> ::diesel::serialize::Result { - use ::std::io::Write; + use std::io::Write; out.write_all(self.to_string().as_bytes())?; Ok(::diesel::serialize::IsNull::No) } } impl ::diesel::deserialize::FromSql<::diesel::sql_types::Text, ::diesel::pg::Pg> for $type { - fn from_sql(value: ::diesel::pg::PgValue) -> ::diesel::deserialize::Result { - use ::core::str::FromStr; + fn from_sql(value: ::diesel::pg::PgValue<'_>) -> ::diesel::deserialize::Result { + use core::str::FromStr; let s = ::core::str::from_utf8(value.as_bytes())?; <$type>::from_str(s).map_err(|_| "Unrecognized enum variant".into()) } diff --git a/src/decider/storage/utils/gateway_card_info.rs b/src/decider/storage/utils/gateway_card_info.rs index 7dff37ae..3b230e90 100644 --- a/src/decider/storage/utils/gateway_card_info.rs +++ b/src/decider/storage/utils/gateway_card_info.rs @@ -39,7 +39,7 @@ pub async fn get_supported_gateway_card_info_for_bins( card_bins: Vec>, ) -> Result, ErrorResponse> { // Step 1: Query GatewayCardInfo with diesel - let gci_records: Vec = match crate::generics::generic_find_all::< + let gci_records: Vec = crate::generics::generic_find_all::< ::Table, _, DBGatewayCardInfo, @@ -50,10 +50,7 @@ pub async fn get_supported_gateway_card_info_for_bins( .and(dsl::disabled.eq(Some(BitBool(false)))), ) .await - { - Ok(records) => records, - Err(_) => Vec::new(), - }; + .unwrap_or_default(); let gcis: Vec = gci_records.iter().map(|r| r.id).collect(); if gcis.is_empty() { @@ -61,7 +58,7 @@ pub async fn get_supported_gateway_card_info_for_bins( } // Step 2: Query MerchantGatewayCardInfo using diesel - let mgci_records: Vec = match crate::generics::generic_find_all::< + let mgci_records: Vec = crate::generics::generic_find_all::< ::Table, _, DBMerchantGatewayCardInfo, @@ -73,10 +70,7 @@ pub async fn get_supported_gateway_card_info_for_bins( .and(m_dsl::gateway_card_info_id.eq_any(gcis)), ) .await - { - Ok(records) => records, - Err(_) => Vec::new(), - }; + .unwrap_or_default(); // Step 3: Filter GatewayCardInfo records let gcis_filtered: Vec = mgci_records diff --git a/src/decider/storage/utils/merchant_gateway_account.rs b/src/decider/storage/utils/merchant_gateway_account.rs index d9bd0603..652a2c04 100644 --- a/src/decider/storage/utils/merchant_gateway_account.rs +++ b/src/decider/storage/utils/merchant_gateway_account.rs @@ -86,7 +86,7 @@ fn filter_morpheus( mgas: Vec, ) -> Vec { mgas.into_iter() - .filter(|mga| mga.gateway != "MORPHEUS".to_string()) + .filter(|mga| mga.gateway != "MORPHEUS") .collect() } @@ -95,7 +95,7 @@ pub fn is_only_one_paylater( ) -> bool { match mgas.as_slice() { [] => false, - [mga] => mga.gateway == "PAYLATER".to_string(), + [mga] => mga.gateway == "PAYLATER", _ => false, } } diff --git a/src/decider/storage/utils/merchant_gateway_card_info.rs b/src/decider/storage/utils/merchant_gateway_card_info.rs index 198891d6..77f76874 100644 --- a/src/decider/storage/utils/merchant_gateway_card_info.rs +++ b/src/decider/storage/utils/merchant_gateway_card_info.rs @@ -103,7 +103,7 @@ pub async fn filter_gateways_for_payment_method_and_validation_type( &app_state.db, m_dsl::gateway_card_info_id .eq_any(gci_ids) - .and(m_dsl::merchant_account_id.eq(merchant_pid_to_text(merchant_account.id.clone()))) + .and(m_dsl::merchant_account_id.eq(merchant_pid_to_text(merchant_account.id))) .and(m_dsl::disabled.eq(BitBool(false))) .and(m_dsl::merchant_gateway_account_id.eq_any(enabled_gateway_accounts_ids)), ) @@ -114,8 +114,5 @@ pub async fn filter_gateways_for_payment_method_and_validation_type( }; // Step 4: Convert to Domain Types - mgci_records - .into_iter() - .filter_map(|db_record| MerchantGatewayCardInfo::try_from(db_record).ok()) - .collect() + mgci_records.into_iter().map(From::from).collect() } diff --git a/src/error/custom_error.rs b/src/error/custom_error.rs index f28a8e26..3eb6978e 100644 --- a/src/error/custom_error.rs +++ b/src/error/custom_error.rs @@ -109,7 +109,7 @@ pub enum RuleConfigurationError { impl axum::response::IntoResponse for RuleConfigurationError { fn into_response(self) -> axum::response::Response { match self { - RuleConfigurationError::StorageError => ( + Self::StorageError => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -118,7 +118,7 @@ impl axum::response::IntoResponse for RuleConfigurationError { )), ) .into_response(), - RuleConfigurationError::DeserializationError => ( + Self::DeserializationError => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -127,7 +127,7 @@ impl axum::response::IntoResponse for RuleConfigurationError { )), ) .into_response(), - RuleConfigurationError::InvalidRuleConfiguration => ( + Self::InvalidRuleConfiguration => ( hyper::StatusCode::BAD_REQUEST, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -136,7 +136,7 @@ impl axum::response::IntoResponse for RuleConfigurationError { )), ) .into_response(), - RuleConfigurationError::MerchantNotFound => ( + Self::MerchantNotFound => ( hyper::StatusCode::NOT_FOUND, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -145,7 +145,7 @@ impl axum::response::IntoResponse for RuleConfigurationError { )), ) .into_response(), - RuleConfigurationError::ConfigurationNotFound => ( + Self::ConfigurationNotFound => ( hyper::StatusCode::NOT_FOUND, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -154,7 +154,7 @@ impl axum::response::IntoResponse for RuleConfigurationError { )), ) .into_response(), - RuleConfigurationError::ConfigurationAlreadyExists => ( + Self::ConfigurationAlreadyExists => ( hyper::StatusCode::BAD_REQUEST, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -186,7 +186,7 @@ pub enum MerchantAccountConfigurationError { impl axum::response::IntoResponse for MerchantAccountConfigurationError { fn into_response(self) -> axum::response::Response { match self { - MerchantAccountConfigurationError::StorageError => ( + Self::StorageError => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -195,7 +195,7 @@ impl axum::response::IntoResponse for MerchantAccountConfigurationError { )), ) .into_response(), - MerchantAccountConfigurationError::InvalidConfiguration => ( + Self::InvalidConfiguration => ( hyper::StatusCode::BAD_REQUEST, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -204,7 +204,7 @@ impl axum::response::IntoResponse for MerchantAccountConfigurationError { )), ) .into_response(), - MerchantAccountConfigurationError::MerchantNotFound => ( + Self::MerchantNotFound => ( hyper::StatusCode::NOT_FOUND, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -213,7 +213,7 @@ impl axum::response::IntoResponse for MerchantAccountConfigurationError { )), ) .into_response(), - MerchantAccountConfigurationError::MerchantAlreadyExists => ( + Self::MerchantAlreadyExists => ( hyper::StatusCode::BAD_REQUEST, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -222,7 +222,7 @@ impl axum::response::IntoResponse for MerchantAccountConfigurationError { )), ) .into_response(), - MerchantAccountConfigurationError::MerchantDeletionFailed => ( + Self::MerchantDeletionFailed => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, @@ -231,7 +231,7 @@ impl axum::response::IntoResponse for MerchantAccountConfigurationError { )), ) .into_response(), - MerchantAccountConfigurationError::MerchantInsertionFailed => ( + Self::MerchantInsertionFailed => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(crate::error::ApiErrorResponse::new( crate::error::error_codes::TE_04, diff --git a/src/euclid/ast.rs b/src/euclid/ast.rs index 304a7c48..68666dba 100644 --- a/src/euclid/ast.rs +++ b/src/euclid/ast.rs @@ -117,7 +117,7 @@ pub type IfCondition = Vec; pub struct IfStatement { // #[schema(value_type=Vec)] pub condition: IfCondition, - pub nested: Option>, + pub nested: Option>, } /// Represents a rule diff --git a/src/euclid/cgraph.rs b/src/euclid/cgraph.rs index 31f2ba1c..cbc72d29 100644 --- a/src/euclid/cgraph.rs +++ b/src/euclid/cgraph.rs @@ -40,11 +40,11 @@ pub enum AnalysisTrace { }, AllAggregation { - unsatisfied: Vec, + unsatisfied: Vec, }, AnyAggregation { - unsatisfied: Vec, + unsatisfied: Vec, }, } @@ -510,9 +510,7 @@ mod tests { }; let config = Config { - graph_config: GraphConfig { - graph, - }, + graph_config: GraphConfig { graph }, }; let string = toml::to_string(&config).expect("failed toml conversion"); diff --git a/src/euclid/errors.rs b/src/euclid/errors.rs index 81701a7a..877d6aa0 100644 --- a/src/euclid/errors.rs +++ b/src/euclid/errors.rs @@ -72,7 +72,7 @@ impl ValidationErrorDetails { impl axum::response::IntoResponse for EuclidErrors { fn into_response(self) -> axum::response::Response { match self { - EuclidErrors::InvalidRuleConfiguration => ( + Self::InvalidRuleConfiguration => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -82,7 +82,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::InvalidRequestParameter(param) => ( + Self::InvalidRequestParameter(param) => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -95,7 +95,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::FailedToValidateRoutingRule => ( + Self::FailedToValidateRoutingRule => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -105,7 +105,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::InvalidRequest(msg) => ( + Self::InvalidRequest(msg) => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -118,7 +118,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::GlobalRoutingConfigsUnavailable => ( + Self::GlobalRoutingConfigsUnavailable => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -128,7 +128,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::StorageError => ( + Self::StorageError => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -138,7 +138,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::FailedToParseJsonInput => ( + Self::FailedToParseJsonInput => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -148,7 +148,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::FailedToSerializeJsonToString => ( + Self::FailedToSerializeJsonToString => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -158,7 +158,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::ActiveRoutingAlgorithmNotFound(msg) => ( + Self::ActiveRoutingAlgorithmNotFound(msg) => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -171,7 +171,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::RoutingAlgorithmNotFound(msg) => ( + Self::RoutingAlgorithmNotFound(msg) => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -184,7 +184,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::DefaultFallbackNotFound(creator_by) => ( + Self::DefaultFallbackNotFound(creator_by) => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -197,7 +197,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::FailedToEvaluateOutput(msg) => ( + Self::FailedToEvaluateOutput(msg) => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -209,7 +209,7 @@ impl axum::response::IntoResponse for EuclidErrors { )), ).into_response(), - EuclidErrors::RoutingInterpretationFailed => ( + Self::RoutingInterpretationFailed => ( hyper::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -219,7 +219,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::InvalidSrDimensionConfig(msg) => ( + Self::InvalidSrDimensionConfig(msg) => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, @@ -229,7 +229,7 @@ impl axum::response::IntoResponse for EuclidErrors { ) .into_response(), - EuclidErrors::FieldValidationFailed(msg) => ( + Self::FieldValidationFailed(msg) => ( hyper::StatusCode::BAD_REQUEST, axum::Json(ApiErrorResponse::new( error_codes::TE_04, diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index 7d69a3c6..47a67f73 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -34,15 +34,16 @@ use crate::error::ContainerError; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; use serde_json::{json, Value}; +#[allow(dead_code)] const DEFAULT_FALLBACK_IDENTIFIER: &str = "default_fallback_enabled"; -pub async fn config_sr_dimentions( +pub async fn config_sr_dimensions( Json(payload): Json, ) -> Result, ContainerError> { let timer = metrics::API_LATENCY_HISTOGRAM - .with_label_values(&["config_sr_dimentions"]) + .with_label_values(&["config_sr_dimensions"]) .start_timer(); metrics::API_REQUEST_TOTAL_COUNTER - .with_label_values(&["config_sr_dimentions"]) + .with_label_values(&["config_sr_dimensions"]) .inc(); logger::debug!("Received SR Dimension config: {:?}", payload); @@ -61,7 +62,7 @@ pub async fn config_sr_dimentions( if !invalid_dimensions.is_empty() { metrics::API_REQUEST_COUNTER - .with_label_values(&["config_sr_dimentions", "failure"]) + .with_label_values(&["config_sr_dimensions", "failure"]) .inc(); timer.observe_duration(); @@ -107,7 +108,7 @@ pub async fn config_sr_dimentions( if let Err(_) = result { metrics::API_REQUEST_COUNTER - .with_label_values(&["config_sr_dimentions", "failure"]) + .with_label_values(&["config_sr_dimensions", "failure"]) .inc(); timer.observe_duration(); logger::error!( @@ -117,7 +118,7 @@ pub async fn config_sr_dimentions( return Err(ContainerError::from(EuclidErrors::StorageError)); } metrics::API_REQUEST_COUNTER - .with_label_values(&["config_sr_dimentions", "success"]) + .with_label_values(&["config_sr_dimensions", "success"]) .inc(); timer.observe_duration(); logger::debug!( @@ -195,7 +196,7 @@ pub async fn routing_create( .with_label_values(&["routing_create", "failure"]) .inc(); timer.observe_duration(); - return Err(err.into()); + return Err(err); } } @@ -275,7 +276,7 @@ pub async fn routing_evaluate( let default_output_present = payload .fallback_output .as_ref() - .map_or(false, |output| !output.is_empty()); + .is_some_and(|output| !output.is_empty()); // fetch the active routing_algorithm of the merchant let active_routing_algorithm_id = match crate::generics::generic_find_one::< @@ -354,13 +355,12 @@ pub async fn routing_evaluate( RoutingAlgorithm, >(&state.db, dsl::id.eq(active_routing_algorithm_id.clone())) .await - .map_err(|e| { + .inspect_err(|&e| { logger::error!( ?e, "Failed to fetch RoutingAlgorithm for ID {:?}", active_routing_algorithm_id ); - e }) .change_context(EuclidErrors::StorageError) { @@ -397,7 +397,7 @@ pub async fn routing_evaluate( match evaluate_output(&out_enum).map_err(|_| { EuclidErrors::FailedToEvaluateOutput(format!( "{}", - StaticRoutingAlgorithm::Single(conn.clone()).to_string() + StaticRoutingAlgorithm::Single(conn.clone()) )) }) { Ok((_, eval)) => (out_enum, eval, Some("straight_through_rule".into())), @@ -414,7 +414,7 @@ pub async fn routing_evaluate( match evaluate_output(&out_enum).map_err(|_| { EuclidErrors::FailedToEvaluateOutput(format!( "{}", - StaticRoutingAlgorithm::Priority(connectors.clone()).to_string() + StaticRoutingAlgorithm::Priority(connectors.clone()) )) }) { Ok((_, eval)) => (out_enum, eval, Some("priority_rule".into())), @@ -431,7 +431,7 @@ pub async fn routing_evaluate( match evaluate_output(&out_enum).map_err(|_| { EuclidErrors::FailedToEvaluateOutput(format!( "{}", - StaticRoutingAlgorithm::VolumeSplit(splits.clone()).to_string() + StaticRoutingAlgorithm::VolumeSplit(splits.clone()) )) }) { Ok((_, eval)) => (out_enum, eval, Some("volume_split_rule".into())), @@ -464,7 +464,7 @@ pub async fn routing_evaluate( ir.evaluated_output = vec![fallback_connector.first().cloned().unwrap_or_default()]; } - } + } (ir.output, ir.evaluated_output, ir.rule_name) } Err(e) => { @@ -810,6 +810,14 @@ pub(crate) fn eligibility_for_output( apply_pm_filter_eligibility(pm_filter_bundle, parameters, connectors) } +pub fn compute_routing_evaluate_eligibility( + pm_filter_bundle: Option<&pm_filter_graph::PmFilterGraphBundle>, + parameters: &std::collections::HashMap>, + connectors: &[ConnectorInfo], +) -> Vec { + eligibility_for_output(pm_filter_bundle, parameters, connectors) +} + pub(crate) fn apply_pm_filter_eligibility( bundle: Option<&pm_filter_graph::PmFilterGraphBundle>, parameters: &std::collections::HashMap>, diff --git a/src/euclid/interpreter.rs b/src/euclid/interpreter.rs index f4494501..6502e33c 100644 --- a/src/euclid/interpreter.rs +++ b/src/euclid/interpreter.rs @@ -206,7 +206,7 @@ pub enum RoutingError { impl fmt::Display for RoutingError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - RoutingError::VolumeSplitFailed => write!(f, "Volume split calculation failed"), + Self::VolumeSplitFailed => write!(f, "Volume split calculation failed"), } } } diff --git a/src/euclid/test.rs b/src/euclid/test.rs index 2b772f7b..0fbcdc95 100644 --- a/src/euclid/test.rs +++ b/src/euclid/test.rs @@ -295,10 +295,7 @@ mod tests { #[test] fn routing_evaluate_eligibility_skips_pm_filters_when_payment_method_type_missing() { let bundle = build_bundle_for_tests(); - let params = HashMap::from([( - "billing_country".to_string(), - enum_value("US"), - )]); + let params = HashMap::from([("billing_country".to_string(), enum_value("US"))]); let initial = connectors(&["stripe", "adyen"]); let filtered = compute_routing_evaluate_eligibility(Some(&bundle), ¶ms, &initial); @@ -330,10 +327,7 @@ mod tests { #[test] fn apply_pm_filter_eligibility_skips_when_payment_method_type_missing() { let bundle = build_bundle_for_tests(); - let params = HashMap::from([( - "billing_country".to_string(), - enum_value("US"), - )]); + let params = HashMap::from([("billing_country".to_string(), enum_value("US"))]); let initial = connectors(&["stripe", "adyen"]); let filtered = if pm_filter_graph::has_payment_method_type(¶ms) { @@ -348,10 +342,7 @@ mod tests { fn apply_pm_filter_eligibility_fails_open_when_bundle_unavailable() { let params = HashMap::from([ ("payment_method_type".to_string(), enum_value("credit")), - ( - "billing_country".to_string(), - enum_value("US"), - ), + ("billing_country".to_string(), enum_value("US")), ]); let initial = connectors(&["stripe", "adyen"]); @@ -369,10 +360,7 @@ mod tests { let params_pass = HashMap::from([ ("payment_method_type".to_string(), enum_value("credit")), - ( - "billing_country".to_string(), - enum_value("US"), - ), + ("billing_country".to_string(), enum_value("US")), ("currency".to_string(), enum_value("USD")), ]); let params_fail_country = HashMap::from([ @@ -408,10 +396,7 @@ mod tests { let params = HashMap::from([ ("payment_method_type".to_string(), enum_value("credit")), - ( - "billing_country".to_string(), - enum_value("US"), - ), + ("billing_country".to_string(), enum_value("US")), ("currency".to_string(), enum_value("USD")), ("capture_method".to_string(), enum_value("automatic")), ]); @@ -437,10 +422,7 @@ mod tests { let params = HashMap::from([ ("payment_method_type".to_string(), enum_value("debit")), - ( - "billing_country".to_string(), - enum_value("US"), - ), + ("billing_country".to_string(), enum_value("US")), ("currency".to_string(), enum_value("USD")), ]); @@ -487,19 +469,13 @@ mod tests { let params_manual = HashMap::from([ ("payment_method_type".to_string(), enum_value("credit")), - ( - "billing_country".to_string(), - enum_value("US"), - ), + ("billing_country".to_string(), enum_value("US")), ("currency".to_string(), enum_value("USD")), ("capture_method".to_string(), enum_value("manual")), ]); let params_auto = HashMap::from([ ("payment_method_type".to_string(), enum_value("credit")), - ( - "billing_country".to_string(), - enum_value("US"), - ), + ("billing_country".to_string(), enum_value("US")), ("currency".to_string(), enum_value("USD")), ("capture_method".to_string(), enum_value("automatic")), ]); @@ -848,11 +824,7 @@ mod tests { let bundle = build_priority_matrix_bundle(); print_priority_test_setup(&bundle); println!("Output forms tested: single, priority, volume_split, volume_split_priority"); - let params = params_for_case( - Some("upi_collect"), - Some("US"), - Some("USD"), - ); + let params = params_for_case(Some("upi_collect"), Some("US"), Some("USD")); let test_outputs = vec![ ( diff --git a/src/euclid/types.rs b/src/euclid/types.rs index dce9ba33..2d4e3d6f 100644 --- a/src/euclid/types.rs +++ b/src/euclid/types.rs @@ -171,7 +171,7 @@ impl From for JsonifiedRoutingAlgorithm { let algorithm_data: serde_json::Value = serde_json::from_str(&ra.algorithm_data).unwrap_or_else(|_| serde_json::Value::Null); - JsonifiedRoutingAlgorithm { + Self { id: ra.id, created_by: ra.created_by, name: ra.name, @@ -286,11 +286,11 @@ pub enum KeyDataType { impl KeyDataType { pub fn as_str(&self) -> &str { match self { - KeyDataType::Integer => "integer", - KeyDataType::Enum => "enum", - KeyDataType::Udf => "udf", - KeyDataType::StrValue => "str_value", - KeyDataType::GlobalRef => "global_ref", + Self::Integer => "integer", + Self::Enum => "enum", + Self::Udf => "udf", + Self::StrValue => "str_value", + Self::GlobalRef => "global_ref", } } } @@ -346,7 +346,7 @@ impl KeyConfig { } } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct FieldValidationRules { pub min_value: Option, pub max_value: Option, @@ -356,44 +356,15 @@ pub struct FieldValidationRules { pub regex_pattern: Option, } -impl Default for FieldValidationRules { - fn default() -> Self { - Self { - min_value: None, - max_value: None, - min_length: None, - max_length: None, - exact_length: None, - regex_pattern: None, - } - } -} - /// Structure for the [keys] section in the TOML -#[derive(Clone, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize, Default)] pub struct KeysConfig { #[serde(flatten)] pub keys: HashMap, } /// The complete TOML configuration structure -#[derive(Clone, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize, Default)] pub struct TomlConfig { pub keys: KeysConfig, } - -impl Default for TomlConfig { - fn default() -> Self { - Self { - keys: KeysConfig::default(), - } - } -} - -impl Default for KeysConfig { - fn default() -> Self { - Self { - keys: HashMap::new(), - } - } -} diff --git a/src/euclid/utils.rs b/src/euclid/utils.rs index 8f2ecdfe..c780a273 100644 --- a/src/euclid/utils.rs +++ b/src/euclid/utils.rs @@ -238,7 +238,7 @@ fn validate_condition( (KeyDataType::Enum, ValueType::EnumVariantArray(arr)) => { let invalid: Vec<_> = arr .iter() - .filter(|v| !is_valid_enum_value(config, &condition.lhs, *v)) + .filter(|v| !is_valid_enum_value(config, &condition.lhs, v)) .cloned() .collect(); if !invalid.is_empty() { diff --git a/src/feedback/constants.rs b/src/feedback/constants.rs index 72ec772c..6862f097 100644 --- a/src/feedback/constants.rs +++ b/src/feedback/constants.rs @@ -375,5 +375,5 @@ pub fn default_update_gateway_score_lock_flag_ttl() -> i32 { } pub fn default_sr_v3_latency_threshold_in_secs() -> f64 { - 300 as f64 + 300_f64 } diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index 26bdd1f6..97fcb8ae 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -12,12 +12,6 @@ use crate::{ }, }; -#[cfg(feature = "mysql")] -#[warn(unused_imports)] -use crate::storage::schema::gateway_bank_emi_support::gateway; -#[cfg(feature = "postgres")] -use crate::storage::schema_pg::gateway_bank_emi_support::gateway; - use crate::feedback::constants as C; use crate::decider::gatewaydecider::constants::{EnableEliminationV2, EnableOutageV2}; @@ -82,8 +76,8 @@ pub async fn updateKeyScoreForKeysFromConsumer( txn_card_info: TxnCardInfo, gateway_scoring_type: GatewayScoreType, gateway_scoring_data: GatewayScoringData, - mer_acc_p_id: merchant::id::MerchantPId, - mer_acc: MerchantAccount, + _mer_acc_p_id: merchant::id::MerchantPId, + _mer_acc: MerchantAccount, gateway_scoring_key: (ScoreKeyType, Option), redis_compression_config: Option, ) -> Option<((ScoreKeyType, String), CachedGatewayScore)> { @@ -107,9 +101,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( txn_card_info.clone(), ), Some(cached_gateway_score) => { - if (timestamp.clone() - cached_gateway_score.timestamp.clone()) - > (hard_key_ttl.clone()) - 1000 - { + if (timestamp - cached_gateway_score.timestamp) > hard_key_ttl - 1000 { logger::debug!( action = "updateKeyScore", tag = "updateKeyScore", @@ -166,7 +158,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( transactionCount: transaction_count, } }; - let encoded_json = serde_json::to_string(&updated_cached_gateway_score).unwrap(); + let _encoded_json = serde_json::to_string(&updated_cached_gateway_score).unwrap(); let elapsed_time = timestamp.saturating_sub(updated_cached_gateway_score.timestamp as u128); let remaining_ttl = (hard_key_ttl as u128).saturating_sub(elapsed_time); @@ -175,7 +167,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( } else { remaining_ttl as i64 }; - let app_state: std::sync::Arc = + let _app_state: std::sync::Arc = get_tenant_app_state().await; let result = EulerTransforms::writeToCacheWithTTL( key.clone(), @@ -262,9 +254,9 @@ pub async fn updateKeyScoreForTxnStatus( is_elimination_v2_enabled, is_outage_key, is_elimination_v2_enabled_for_outage, - &merchant_id, - &txn_card_info, - &txn_detail, + merchant_id, + txn_card_info, + txn_detail, current_key_score, &score_key_type, gateway_scoring_data.clone(), @@ -276,16 +268,16 @@ pub async fn updateKeyScoreForTxnStatus( is_elimination_v2_enabled, is_outage_key, is_elimination_v2_enabled_for_outage, - &merchant_id, - &txn_card_info, - &txn_detail, + merchant_id, + txn_card_info, + txn_detail, current_key_score, &score_key_type, gateway_scoring_data.clone(), ) .await; } - _ => return current_key_score, + _ => current_key_score, } } @@ -319,7 +311,7 @@ async fn updateScoreWithPenalty( getFailureKeyScore( false, current_key_score, - getPenaltyFactor(score_key_type.clone()).await, + getPenaltyFactor(*score_key_type).await, ) .await } @@ -330,7 +322,7 @@ async fn updateScoreWithPenalty( getFailureKeyScore( false, current_key_score, - getPenaltyFactor(score_key_type.clone()).await, + getPenaltyFactor(*score_key_type).await, ) .await } @@ -366,7 +358,7 @@ async fn updateScoreWithReward( None => getSuccessKeyScore( false, current_key_score, - getRewardFactor(score_key_type.clone()).await, + getRewardFactor(*score_key_type).await, ), Some(factor) => getSuccessKeyScore(true, current_key_score, factor), } @@ -374,7 +366,7 @@ async fn updateScoreWithReward( _ => getSuccessKeyScore( false, current_key_score, - getRewardFactor(score_key_type.clone()).await, + getRewardFactor(*score_key_type).await, ), } } @@ -420,11 +412,11 @@ pub async fn getPenaltyFactor(scoreKeyType: ScoreKeyType) -> f64 { let penalty_factor = if isKeyOutage(scoreKeyType) { findByNameFromRedis(C::OutagePenaltyFactor.get_key()) .await - .unwrap_or_else(|| defaultGWScoringPenaltyFactor()) + .unwrap_or_else(defaultGWScoringPenaltyFactor) } else { findByNameFromRedis(C::GatewayPenaltyFactor.get_key()) .await - .unwrap_or_else(|| defaultGWScoringPenaltyFactor()) + .unwrap_or_else(defaultGWScoringPenaltyFactor) }; penalty_factor } @@ -434,11 +426,11 @@ pub async fn getRewardFactor(scoreKeyType: ScoreKeyType) -> f64 { let reward_factor = if isKeyOutage(scoreKeyType) { findByNameFromRedis(C::OutageRewardFactor.get_key()) .await - .unwrap_or_else(|| defaultGWScoringRewardFactor()) + .unwrap_or_else(defaultGWScoringRewardFactor) } else { findByNameFromRedis(C::OutageRewardFactor.get_key()) .await - .unwrap_or_else(|| defaultGWScoringRewardFactor()) + .unwrap_or_else(defaultGWScoringRewardFactor) }; reward_factor } @@ -461,11 +453,11 @@ pub async fn getUpdatedMerchantDetailsForGlobalKey( if filtered_merchant_details_array.is_empty() { let arr_max_length = getMerchantArrMaxLength().await; if merchant_details_array.len() as i32 >= arr_max_length { - return Some(merchant_details_array); + Some(merchant_details_array) } else { let merchant_detail = getDefaultMerchantScoringDetailsArray(merchant_id, 1.0, 1, None); - return Some([merchant_details_array, vec![merchant_detail]].concat()); + Some([merchant_details_array, vec![merchant_detail]].concat()) } } else { let mut results = Vec::new(); @@ -481,17 +473,17 @@ pub async fn getUpdatedMerchantDetailsForGlobalKey( .await; results.push(result); } - return Some(results); + Some(results) } } None => { let merchant_scoring_details = getDefaultMerchantScoringDetailsArray(merchant_id, 1.0, 1, None); - return Some(vec![merchant_scoring_details]); + Some(vec![merchant_scoring_details]) } } } else { - return None; + None } } @@ -532,11 +524,11 @@ pub async fn replaceTransactionCount( // Original Haskell function: getNewCachedGatewayScore pub fn getNewCachedGatewayScore( - key: String, - gateway_scoring_type: GatewayScoreType, + _key: String, + _gateway_scoring_type: GatewayScoreType, score_key_type: ScoreKeyType, txn_detail: TxnDetail, - txn_card_info: TxnCardInfo, + _txn_card_info: TxnCardInfo, ) -> CachedGatewayScore { let merchant_id = Merchant::merchant_id_to_text(txn_detail.merchantId); let current_date: u128 = CUTILS::get_current_date_in_millis(); @@ -545,7 +537,7 @@ pub fn getNewCachedGatewayScore( getDefaultMerchantScoringDetailsArray(merchant_id, 1.0, 0, None); CachedGatewayScore { score: None, - timestamp: current_date.clone(), + timestamp: current_date, lastResetTimestamp: None, merchants: Some(vec![merchant_scoring_details]), transactionCount: None, @@ -553,8 +545,8 @@ pub fn getNewCachedGatewayScore( } else { CachedGatewayScore { score: Some(1.0), - timestamp: current_date.clone(), - lastResetTimestamp: Some(current_date.clone()), + timestamp: current_date, + lastResetTimestamp: Some(current_date), merchants: None, transactionCount: Some(0), } @@ -570,7 +562,7 @@ pub fn getDefaultMerchantScoringDetailsArray( ) -> MerchantScoringDetails { let current_date = CUTILS::get_current_date_in_millis(); MerchantScoringDetails { - score: score, + score, merchantId: merchant_id, transactionCount: transaction_count, lastResetTimestamp: m_last_reset_timestamp.unwrap_or(current_date as i32), @@ -580,9 +572,9 @@ pub fn getDefaultMerchantScoringDetailsArray( // Original Haskell function: getAllUnifiedKeys pub async fn getAllUnifiedKeys( txn_detail: TxnDetail, - txn_card_info: TxnCardInfo, + _txn_card_info: TxnCardInfo, mer_acc_p_id: Merchant::MerchantPId, - m_pf_mc_config: Option, + _m_pf_mc_config: Option, mer_acc: MerchantAccount, gateway_scoring_data: GatewayScoringData, gateway_reference_id: Option, @@ -738,9 +730,9 @@ pub async fn readGatewayScoreFromRedis(key: &str) -> Option let app_state = get_tenant_app_state().await; app_state .redis_conn - .get_key::(&key, "gateway_score_key") + .get_key::(key, "gateway_score_key") .await - .map_or_else(|_| None, Some) + .ok() } // pub async fn readFromCacheWithFallback( @@ -885,7 +877,7 @@ pub fn findMerchantFromMerchantArray( pub async fn getMerchantArrMaxLength() -> i32 { let max_length = findByNameFromRedis(C::GatewayScoreMerchantArrMaxLength.get_key()) .await - .unwrap_or_else(|| C::defaultMerchantArrMaxLength()); + .unwrap_or_else(C::defaultMerchantArrMaxLength); max_length } diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index 7d6a3260..b4d19ffb 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -24,7 +24,7 @@ use crate::decider::gatewaydecider::gw_scoring::get_metric_entry_data; // use eulerhs::language as el; // use eulerhs::types as et; // use eulerhs::tenant_redis_layer as rc; -use crate::app::{get_tenant_app_state, APP_STATE}; +use crate::app::get_tenant_app_state; use crate::decider::gatewaydecider::constants::{self as DC, SR_V3_DEFAULT_INPUT_CONFIG}; use crate::decider::gatewaydecider::types as T; use crate::decider::gatewaydecider::types::GatewayScoringData; @@ -261,10 +261,7 @@ pub async fn check_and_send_should_update_gateway_score( ) .await; - match is_set_either { - Ok(value) => value, - Err(_) => false, - } + is_set_either.unwrap_or(false) } pub fn is_transaction_success(txn_status: TxnStatus) -> bool { @@ -317,7 +314,7 @@ pub async fn get_gateway_scoring_type( ); // Extract the new parameters from txn_card_info - let sr_routing_dimesions = SrRoutingDimensions { + let sr_routing_dimensions = SrRoutingDimensions { card_network: txn_card_info .cardSwitchProvider .as_ref() @@ -332,7 +329,7 @@ pub async fn get_gateway_scoring_type( merchant_sr_v3_input_config.clone(), &pmt, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ); let time_difference_threshold = match maybe_latency_threshold { @@ -343,7 +340,7 @@ pub async fn get_gateway_scoring_type( default_sr_v3_input_config, &pmt, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ); maybe_default_latency_threshold.unwrap_or(default_sr_v3_latency_threshold_in_secs()) } @@ -374,17 +371,16 @@ pub fn update_gateway_score_lock( txn_uuid: String, gateway: String, ) -> String { - match (gateway_scoring_type) { - (GatewayScoringType::Penalise) => { + match gateway_scoring_type { + GatewayScoringType::Penalise => { format!("gateway_scores_lock_PENALISE_{}_{}", txn_uuid, gateway) } - (GatewayScoringType::PenaliseSrv3) => { + GatewayScoringType::PenaliseSrv3 => { format!("gateway_scores_lock_PENALISE_SRV3_{}_{}", txn_uuid, gateway) } - (GatewayScoringType::Reward) => { + GatewayScoringType::Reward => { format!("gateway_scores_lock_REWARD_{}_{}", txn_uuid, gateway) } - _ => String::new(), } } @@ -564,8 +560,6 @@ pub async fn check_and_update_gateway_score( ) .await; } - - () } // Original Haskell function: updateGatewayScore @@ -606,11 +600,7 @@ pub async fn update_gateway_score( }; //let is_pm_and_pmt_present = Fbu::isTrueString(txn_card_info.paymentMethod) && txn_card_info.paymentMethodType.is_some(); - let should_update_srv3_gateway_score = if gateway_scoring_type.clone() == GST::Penalise { - false - } else { - true - }; + let should_update_srv3_gateway_score = gateway_scoring_type.clone() != GST::Penalise; let should_isolate_srv3_producer = if Cutover::is_feature_enabled( C::SrV3ProducerIsolation.get_key(), @@ -619,11 +609,7 @@ pub async fn update_gateway_score( ) .await { - if is_routing_approach_in_srv3(routing_approach.clone()) { - true - } else { - false - } + is_routing_approach_in_srv3(routing_approach.clone()) } else { true }; @@ -636,11 +622,7 @@ pub async fn update_gateway_score( ) .await { - if is_routing_approach_in_explore(routing_approach.clone()) { - true - } else { - false - } + is_routing_approach_in_explore(routing_approach.clone()) } else { true }; @@ -762,7 +744,7 @@ pub async fn update_gateway_score( } if should_update_gateway_score && is_update_within_window { - let mer_acc_p_id: ETM::id::MerchantPId = mer_acc.id.clone(); + let mer_acc_p_id: ETM::id::MerchantPId = mer_acc.id; let m_pf_mc_config = MerchantConfig::getMerchantConfigEntityLevelLookupConfig().await; let mb_gateway_scoring_data = match mb_gateway_scoring_data { None => { @@ -794,7 +776,7 @@ pub async fn update_gateway_score( let key_array = GEF::getAllUnifiedKeys( txn_detail.clone(), txn_card_info.clone(), - mer_acc_p_id.clone(), + mer_acc_p_id, m_pf_mc_config.clone(), mer_acc.clone(), gateway_scoring_data.clone(), @@ -937,7 +919,7 @@ pub async fn is_update_within_latency_window( gw_wise_latency_threshold ); - /// check if the transaction latency calculated by orchestration is within the configured threshold + // check if the transaction latency calculated by orchestration is within the configured threshold let is_gw_latency_within_threshold = isGwLatencyWithinConfiguredThreshold( txn_latency.and_then(|m| m.gateway_latency), GatewaySuccessRateBasedRoutingInput::from_str( @@ -949,9 +931,9 @@ pub async fn is_update_within_latency_window( // Cutover::findByNameFromRedis(C.gatewayScoreLatencyCheckInMins) // .await // .unwrap_or(C.defaultGatewayScoreLatencyCheckInMins); - let merchant_id = MID::merchant_id_to_text(txn_detail.merchantId.clone()); + let _merchant_id = MID::merchant_id_to_text(txn_detail.merchantId.clone()); let pmt = txn_card_info.paymentMethodType; - let pm = GU::get_payment_method( + let _pm = GU::get_payment_method( pmt, txn_card_info.paymentMethod, txn_detail.sourceObject.clone().unwrap_or_default(), @@ -973,13 +955,8 @@ pub async fn is_update_within_latency_window( "gwLatencyCheckThreshold: {}", gw_latency_check_threshold ); - if (gw_score_update_latency < (gw_latency_check_threshold * 60000.0) as u128) + (gw_score_update_latency < (gw_latency_check_threshold * 60000.0) as u128) && is_gw_latency_within_threshold - { - true - } else { - false - } } } } @@ -1049,7 +1026,7 @@ fn get_gw_latency_threshold( ) -> Option<&GatewayWiseLatencyInput> { match merchant_latency_gateway_wise_input { None => None, - Some(latency_input) => { + Some(_latency_input) => { // This will be called with specific parameters in the main function // For now, return None as the actual filtering happens in the main function None @@ -1064,7 +1041,7 @@ pub fn get_gateway_wise_latency( pm: &str, gw: &str, ) -> f64 { - let m_gateway_wise_input = + let _m_gateway_wise_input = get_gw_latency_threshold(&gateway_latency_threshold.merchant_latency_gateway_wise_input); // Log the input (similar to EL.logDebugV in Haskell) diff --git a/src/feedback/gateway_selection_scoring_v3/flow.rs b/src/feedback/gateway_selection_scoring_v3/flow.rs index 469ba79c..7b907fa3 100644 --- a/src/feedback/gateway_selection_scoring_v3/flow.rs +++ b/src/feedback/gateway_selection_scoring_v3/flow.rs @@ -62,7 +62,7 @@ pub async fn update_sr_v3_score( gateway_scoring_type: GatewayScoringType, txn_detail: TxnDetail, txn_card_info: TxnCardInfo, - merchant_acc: MerchantAccount, + _merchant_acc: MerchantAccount, mb_gateway_scoring_data: Option, gateway_reference_id: Option, ) { @@ -75,7 +75,7 @@ pub async fn update_sr_v3_score( "gateway not found for this transaction having id" ); } - Some(gateway) => { + Some(_gateway) => { let unified_sr_v3_key = getProducerKey( txn_detail.clone(), mb_gateway_scoring_data, @@ -145,7 +145,6 @@ pub async fn createKeysIfNotExist( is_score_key_exists ); if is_queue_key_exists && is_score_key_exists { - return; } else { let merchant_bucket_size = getSrV3MerchantBucketSize(txn_detail, txn_card_info).await; logger::debug!( @@ -154,7 +153,7 @@ pub async fn createKeysIfNotExist( "Creating keys with bucket size as {}", merchant_bucket_size ); - let score_list = vec!["1".to_string(); merchant_bucket_size.clone().try_into().unwrap()]; + let score_list = vec!["1".to_string(); merchant_bucket_size.try_into().unwrap()]; let redis = C::kvRedis(); GU::create_moving_window_and_score( redis, @@ -231,8 +230,8 @@ pub async fn updateScoreAndQueue( // } // } // } - let current_ist_time = getCurrentIstDateWithFormat("YYYY-MM-DD HH:mm:SS.sss".to_string()); - let date_created = dateInIST( + let _current_ist_time = getCurrentIstDateWithFormat("YYYY-MM-DD HH:mm:SS.sss".to_string()); + let _date_created = dateInIST( txn_detail.clone().dateCreated.to_string(), "YYYY-MM-DD HH:mm:SS.sss".to_string(), ) @@ -273,7 +272,6 @@ pub async fn updateScoreAndQueue( returned_value ); if returned_value == value { - return; } else { updateScore( C::kvRedis(), @@ -292,13 +290,13 @@ pub async fn getSrV3MerchantBucketSize(txn_detail: TxnDetail, txn_card_info: Txn .await; let pmt = txn_card_info.paymentMethodType; let pm = GU::get_payment_method( - (&pmt).to_string(), + pmt.to_string(), txn_card_info.paymentMethod, txn_detail.sourceObject.unwrap_or_default(), ); // Extract the new parameters from txn_card_info - let sr_routing_dimesions = SrRoutingDimensions { + let sr_routing_dimensions = SrRoutingDimensions { card_network: txn_card_info .cardSwitchProvider .as_ref() @@ -313,14 +311,19 @@ pub async fn getSrV3MerchantBucketSize(txn_detail: TxnDetail, txn_card_info: Txn merchant_sr_v3_input_config, &pmt, &pm, - &sr_routing_dimesions, + &sr_routing_dimensions, ); let merchant_bucket_size = match maybe_bucket_size { None => { let default_sr_v3_input_config: Option = findByNameFromRedis(DC::SR_V3_DEFAULT_INPUT_CONFIG.get_key()).await; - GU::get_sr_v3_bucket_size(default_sr_v3_input_config, &pmt, &pm, &sr_routing_dimesions) - .unwrap_or(C::DEFAULT_SR_V3_BASED_BUCKET_SIZE) + GU::get_sr_v3_bucket_size( + default_sr_v3_input_config, + &pmt, + &pm, + &sr_routing_dimensions, + ) + .unwrap_or(C::DEFAULT_SR_V3_BASED_BUCKET_SIZE) } Some(bucket_size) => bucket_size, }; diff --git a/src/feedback/utils.rs b/src/feedback/utils.rs index af682ae8..3a044ff4 100644 --- a/src/feedback/utils.rs +++ b/src/feedback/utils.rs @@ -38,7 +38,7 @@ use time::PrimitiveDateTime; // use data::list as DL; // use ghc::records::extra::HasField; use crate::decider::gatewaydecider::types::{ - DetailedGatewayScoringType, GatewayReferenceIdMap, GatewayScoringData, GatewayScoringTypeLog, + DetailedGatewayScoringType, GatewayReferenceIdMap, GatewayScoringData, GatewayScoringTypeLogData, RoutingFlowType, ScoreKeyType, }; use crate::types::money::internal as ETMo; @@ -70,9 +70,7 @@ use crate::types::merchant as ETM; // use prelude::real_to_frac; // use data::time::clock::posix as DTP; use crate::logger; -use crate::redis::feature::{ - RedisCompressionConfig, RedisCompressionConfigCombined, RedisDataStruct, -}; +use crate::redis::feature::{RedisCompressionConfigCombined, RedisDataStruct}; use time::format_description::well_known::Iso8601; // Converted data types // Original Haskell data type: GatewayScoringType @@ -184,7 +182,7 @@ pub fn get_txn_detail_from_api_payload( txnAmount: Some(ETMo::Money::from_double(0.0)), txnObjectType: Some( ETTD::TxnObjectType::from_text(gateway_scoring_data.orderType.clone()) - .unwrap_or_else(|| ETTD::TxnObjectType::OrderPayment), + .unwrap_or(ETTD::TxnObjectType::OrderPayment), ), sourceObject: Some(gateway_scoring_data.paymentMethod.clone()), sourceObjectId: None, @@ -192,7 +190,7 @@ pub fn get_txn_detail_from_api_payload( .currency .clone() .ok_or(crate::error::ApiError::MissingRequiredField("currency"))?, - country: gateway_scoring_data.country.clone(), + country: gateway_scoring_data.country, surchargeAmount: None, taxAmount: None, internalMetadata: Some(Secret::new( @@ -214,10 +212,10 @@ pub fn get_txn_detail_from_api_payload( } pub fn get_txn_card_info_from_api_payload( - api_payload: UpdateScorePayload, + _api_payload: UpdateScorePayload, gateway_scoring_data: GatewayScoringData, ) -> ETCa::txn_card_info::TxnCardInfo { - let txn_card_info = ETCa::txn_card_info::TxnCardInfo { + ETCa::txn_card_info::TxnCardInfo { id: ETCa::txn_card_info::to_txn_card_info_pid(1), card_isin: None, cardIssuerBankName: None, @@ -235,8 +233,7 @@ pub fn get_txn_card_info_from_api_payload( ETCa::txn_card_info::text_to_auth_type(&auth_type_text).ok() }), partitionKey: None, - }; - txn_card_info + } } // Original Haskell function: convertMerchantIdFlip // pub fn convertMerchantIdFlip(s: &str) -> Option { @@ -378,7 +375,7 @@ pub fn get_txn_card_info_from_api_payload( // } // Original Haskell function: updateScore -pub async fn updateScore(redis: String, key: String, should_score_increase: bool) -> () { +pub async fn updateScore(_redis: String, key: String, should_score_increase: bool) -> () { let app_state = get_tenant_app_state().await; let either_res = if should_score_increase { app_state.redis_conn.increment_key(&key).await @@ -419,13 +416,13 @@ pub async fn isKeyExistsRedis(key: String) -> bool { } // Original Haskell function: updateQueue pub async fn updateQueue( - redis_name: String, + _redis_name: String, queue_key: String, score_key: String, value: String, ) -> Result, error_stack::Report> { let app_state = get_tenant_app_state().await; - let value_clone = value.clone(); + let _value_clone = value.clone(); let r: Result, error_stack::Report> = app_state .redis_conn @@ -515,7 +512,7 @@ pub fn isTrueString(val: Option) -> bool { // Original Haskell function: dateInIST pub fn dateInIST(db_date: String, format: String) -> Option { - // Parse input date uisng primitivedatetime + // Parse input date using primitivedatetime let format_description = match time::format_description::parse(&format) { Ok(desc) => desc, Err(_) => return None, @@ -673,7 +670,7 @@ pub async fn getProducerKey( pub fn log_gateway_score_type( gateway_score_type: GatewayScoringType, routing_flow_type: RoutingFlowType, - txn_detail: TxnDetail, + _txn_detail: TxnDetail, ) { let detailed_gateway_score_type = match routing_flow_type { RoutingFlowType::EliminationFlow => match gateway_score_type { @@ -740,7 +737,7 @@ pub async fn writeToCacheWithTTL( // Original Haskell function: addToCacheWithExpiry pub async fn addToCacheWithExpiry( - redis_name: String, + _redis_name: String, key: String, value: String, ttl: i64, @@ -759,7 +756,7 @@ pub async fn addToCacheWithExpiry( .await; match cached_resp { Ok(_) => Ok(()), - Err(error) => Err(StorageError::InsertError), + Err(_error) => Err(StorageError::InsertError), } } @@ -771,7 +768,7 @@ pub async fn deleteFromCache(redis_name: String, key: String) -> Result Result { +pub async fn delCache(_dbName: String, key: String) -> Result { let app_state = get_tenant_app_state().await; let data = app_state.redis_conn.conn.delete_key(&key).await; // convert data to Result @@ -891,7 +888,7 @@ pub fn getTxnTypeFromInternalMetadata(internal_metadata: Option>) tag = "APP_DEBUG", "FETCH_TXN_TYPE_FROM_IM_FLOW" ); - (MandateTxnType::Default) + MandateTxnType::Default } Some(internal_metadata) => { match serde_json::from_str::(internal_metadata.peek()) { diff --git a/src/generics.rs b/src/generics.rs index f9e6600f..5918420d 100644 --- a/src/generics.rs +++ b/src/generics.rs @@ -86,8 +86,8 @@ where InsertStatement>::Values>: AsQuery + ExecuteDsl + Send, { - let mut conn = storage.get_conn().await.map_err(|_| MeshError::Others)?; - generic_insert_core::(&mut conn, values).await + let conn = storage.get_conn().await.map_err(|_| MeshError::Others)?; + generic_insert_core::(&conn, values).await } #[cfg(feature = "postgres")] @@ -99,8 +99,8 @@ where >::Values: CanInsertInSingleQuery + QueryFragment + 'static, InsertStatement>::Values>: AsQuery + ExecuteDsl + Send, { - let mut conn = storage.get_conn().await.map_err(|_| MeshError::Others)?; - generic_insert_core::(&mut conn, values).await + let conn = storage.get_conn().await.map_err(|_| MeshError::Others)?; + generic_insert_core::(&conn, values).await } #[cfg(feature = "mysql")] @@ -116,7 +116,7 @@ where InsertStatement>::Values>: AsQuery + ExecuteDsl + Send, { - let debug_values = format!("{values:?}"); + let _debug_values = format!("{values:?}"); let query = diesel::insert_into(::table()).values(values); logger::debug!( action = "generic_insert", @@ -141,7 +141,7 @@ where >::Values: CanInsertInSingleQuery + QueryFragment + 'static, InsertStatement>::Values>: AsQuery + ExecuteDsl + Send, { - let debug_values = format!("{values:?}"); + let _debug_values = format!("{values:?}"); let query = diesel::insert_into(::table()).values(values); logger::debug!( action = "generic_insert", @@ -153,7 +153,7 @@ where .await .change_context(MeshError::Others) } -// Returns error incase of entry not found in DB or due to other issues +// Returns error in case of entry not found in DB or due to other issues #[cfg(feature = "mysql")] pub async fn generic_update( conn: &MysqlPoolConn, @@ -206,7 +206,7 @@ where Ok(res) }) } -// Returns 0 incase of entry not found in DB and errors due to other issues +// Returns 0 in case of entry not found in DB and errors due to other issues #[cfg(feature = "mysql")] pub async fn generic_update_if_present( conn: &MysqlPoolConn, @@ -342,7 +342,7 @@ where { let conn = match storage.get_conn().await { Ok(conn) => Ok(conn), - Err(err) => Err(MeshError::Others), + Err(_err) => Err(MeshError::Others), }?; generic_filter::(&conn, predicate).await } @@ -355,7 +355,7 @@ where { let conn = match storage.get_conn().await { Ok(conn) => Ok(conn), - Err(err) => Err(MeshError::Others), + Err(_err) => Err(MeshError::Others), }?; generic_filter::(&conn, predicate).await } @@ -456,7 +456,7 @@ where { let conn = match storage.get_conn().await { Ok(conn) => Ok(conn), - Err(err) => Err(MeshError::Others), + Err(_err) => Err(MeshError::Others), }?; generic_find_one_core::(&conn, predicate).await } @@ -469,7 +469,7 @@ where { let conn = match storage.get_conn().await { Ok(conn) => Ok(conn), - Err(err) => Err(MeshError::Others), + Err(_err) => Err(MeshError::Others), }?; generic_find_one_core::(&conn, predicate).await } @@ -532,7 +532,7 @@ where { let conn = match storage.get_conn().await { Ok(conn) => Ok(conn), - Err(err) => Err(MeshError::Others), + Err(_err) => Err(MeshError::Others), }?; to_optional(generic_find_by_id_core::(&conn, id).await) } @@ -551,16 +551,16 @@ where { let conn = match storage.get_conn().await { Ok(conn) => Ok(conn), - Err(err) => Err(MeshError::Others), + Err(_err) => Err(MeshError::Others), }?; to_optional(generic_find_by_id_core::(&conn, id).await) } -pub async fn track_database_call(future: Fut, operation: DatabaseOperation) -> U +pub async fn track_database_call(future: Fut, _operation: DatabaseOperation) -> U where Fut: std::future::Future, { - let start = std::time::Instant::now(); + let _start = std::time::Instant::now(); let output = future.await; output } diff --git a/src/lib.rs b/src/lib.rs index 564b2735..cfd92378 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,30 @@ +#![allow(non_snake_case)] +#![allow(clippy::missing_panics_doc)] +#![allow(clippy::too_many_arguments)] +#![allow(clippy::expect_used)] +#![allow(clippy::unwrap_used)] +#![allow(clippy::cast_possible_truncation)] +#![allow(clippy::cast_possible_wrap)] +#![allow(clippy::cast_sign_loss)] +#![allow(clippy::cast_lossless)] +#![allow(clippy::cast_precision_loss)] +#![allow(clippy::ptr_arg)] +#![allow(clippy::type_complexity)] +#![allow(clippy::as_conversions)] +#![allow(clippy::useless_conversion)] +#![allow(clippy::module_inception)] +#![allow(clippy::should_implement_trait)] +#![allow(clippy::panic)] +#![allow(clippy::unwrap_in_result)] +#![allow(clippy::match_like_matches_macro)] +#![allow(clippy::match_single_binding)] +#![allow(clippy::if_same_then_else)] +#![allow(clippy::map_identity)] +#![allow(clippy::redundant_pattern_matching)] +#![allow(clippy::manual_filter_map)] +#![allow(clippy::single_match)] +#![allow(clippy::manual_ok_err)] + pub mod api_client; pub mod app; pub mod config; diff --git a/src/logger/formatter.rs b/src/logger/formatter.rs index 994fca43..c643c921 100644 --- a/src/logger/formatter.rs +++ b/src/logger/formatter.rs @@ -18,7 +18,6 @@ use crate::logger; use super::env::get_env_var; use super::storage::Storage; -use std::sync::Mutex; use time::format_description::well_known::Iso8601; use tracing::{Event, Metadata, Subscriber}; use tracing_subscriber::{ @@ -168,7 +167,7 @@ where Value::String(s) => { // Try parsing string as JSON match serde_json::from_str::(&s) { - Ok(inner_json) => FormattingLayer::::normalize_json(inner_json), + Ok(inner_json) => Self::normalize_json(inner_json), Err(_) => Value::String(s), } } @@ -377,7 +376,7 @@ where if !explicit_entries_set.contains(*key) { if let Some(value) = storage.values.get(*key) { if key == &"message" { - let normalized_value = get_normalized_message::(&storage); + let normalized_value = get_normalized_message::(storage); map_serializer.serialize_entry("message", &normalized_value)?; explicit_entries_set.insert("message"); @@ -435,7 +434,7 @@ where } if !explicit_entries_set.contains("message") { - let normalized_value = get_normalized_message::(&storage); + let normalized_value = get_normalized_message::(storage); map_serializer.serialize_entry("message", &normalized_value)?; explicit_entries_set.insert("message"); @@ -518,7 +517,7 @@ where /// /// Flush memory buffer into an output stream trailing it with next line. /// - /// Should be done by single `write_all` call to avoid fragmentation of log because of mutlithreading. + /// Should be done by single `write_all` call to avoid fragmentation of log because of multithreading. /// fn flush(&self, mut buffer: Vec) -> Result<(), std::io::Error> { buffer.write_all(b"\n")?; @@ -526,10 +525,11 @@ where } /// Serialize entries of span. + #[allow(dead_code)] fn span_serialize( &self, span: &SpanRef<'_, S>, - ty: RecordType, + _ty: RecordType, ) -> Result, std::io::Error> where S: Subscriber + for<'a> LookupSpan<'a>, @@ -537,7 +537,7 @@ where let mut buffer = Vec::new(); let mut serializer = serde_json::Serializer::new(&mut buffer); let mut map_serializer = serializer.serialize_map(None)?; - let mut storage = Storage::default(); + let storage = Storage::default(); self.common_serialize( &mut map_serializer, diff --git a/src/logger/storage.rs b/src/logger/storage.rs index 00a84cfb..ce3fb605 100644 --- a/src/logger/storage.rs +++ b/src/logger/storage.rs @@ -18,7 +18,7 @@ use crate::logger; pub struct StorageSubscription; /// Storage to store key value pairs of spans. -/// When new entry is crated it stores it in [HashMap] which is owned by `extensions`. +/// When new entry is created it stores it in [HashMap] which is owned by `extensions`. #[derive(Clone, Debug)] pub struct Storage<'a> { /// Hash map to store values. diff --git a/src/merchant_config_util.rs b/src/merchant_config_util.rs index c17e1538..e3fde3c9 100644 --- a/src/merchant_config_util.rs +++ b/src/merchant_config_util.rs @@ -161,10 +161,7 @@ pub async fn isMerchantEnabledForPaymentFlows( if !is_valid_length { logMerConfigLengthMisMatchError( payment_flows.iter().map(payment_flows_to_text).collect(), - mc_arr - .into_iter() - .filter_map(|mc| Some(mc.clone())) - .collect(), + mc_arr.into_iter().collect(), ); } is_valid_length && are_all_pfs_enabled @@ -403,9 +400,9 @@ pub async fn getMerchantConfigValueForPaymentFlow( // // Original Haskell function: getMerchantConfigStatusAndvalueForPaymentFlow pub async fn getMerchantConfigStatusAndvalueForPaymentFlow( merchant_p_id: MerchantPId, - merchant_id: MerchantPId, + _merchant_id: MerchantPId, pf: PaymentFlow, - m_pf_mc_config: Option, + _m_pf_mc_config: Option, ) -> (ConfigStatus, Option) { let m_mer_config: Option = load_merchant_config_by_mpid_category_and_name( merchant_p_id, @@ -702,8 +699,8 @@ pub async fn getPaymentFlowInfoFromTenantConfig( // } // } -// // Original Haskell function: getConfigValueWithGCCatagory -// pub fn getConfigValueWithGCCatagory( +// // Original Haskell function: getConfigValueWithGCCategory +// pub fn getConfigValueWithGCCategory( // arg1: i64, // arg2: String, // arg3: String, @@ -715,8 +712,8 @@ pub async fn getPaymentFlowInfoFromTenantConfig( // getConfigValueFromMerchantConfig(MCTypes::GeneralConfig, arg1, arg2, arg3, arg4) // } -// // Original Haskell function: getConfigValueWithPFCatagory -// pub fn getConfigValueWithPFCatagory( +// // Original Haskell function: getConfigValueWithPFCategory +// pub fn getConfigValueWithPFCategory( // arg1: i64, // arg2: String, // arg3: String, diff --git a/src/redis/commands.rs b/src/redis/commands.rs index 8b3120ff..cd038429 100644 --- a/src/redis/commands.rs +++ b/src/redis/commands.rs @@ -1,7 +1,6 @@ use std::future::Future; use std::pin::Pin; -use crate::logger; use error_stack::Result; use error_stack::ResultExt; use fred::prelude::RedisKey; @@ -9,35 +8,42 @@ use fred::types::SetOptions; use fred::{ clients::Transaction, interfaces::{HashesInterface, KeysInterface, ListInterface, TransactionInterface}, - types::{Expiration, FromRedis, MultipleValues, RedisValue}, + types::{Expiration, FromRedis, MultipleValues}, }; use redis_interface::{errors, types::DelReply, RedisConnectionPool}; use std::fmt::Debug; +use std::str; use crate::config::CompressionFilepath; -use crate::config::GlobalConfig; -use crate::redis::feature; +#[cfg(feature = "redis_compression")] +use crate::logger; +#[cfg(feature = "redis_compression")] use crate::redis::feature::{ RedisCompressionConfig, RedisCompressionConfigCombined, RedisDataStruct, }; +#[cfg(not(feature = "redis_compression"))] +use crate::redis::feature::{RedisCompressionConfigCombined, RedisDataStruct}; +#[cfg(feature = "redis_compression")] +use fred::types::RedisValue; +#[cfg(feature = "redis_compression")] use serde::de::DeserializeOwned; -use std::collections::HashMap; +#[cfg(feature = "redis_compression")] use std::env; +#[cfg(feature = "redis_compression")] use std::fs::File; +#[cfg(feature = "redis_compression")] use std::io::{Cursor, Read}; -use std::str; #[cfg(feature = "redis_compression")] -use zstd::{ - bulk::Compressor, - dict::{DecoderDictionary, EncoderDictionary}, - stream::{read::Decoder, write::Encoder}, -}; +use zstd::bulk::Compressor; +#[cfg(feature = "redis_compression")] +use zstd::stream::read::Decoder; pub struct RedisConnectionWrapper { pub conn: RedisConnectionPool, pub compression_file_path: Option, } +#[allow(dead_code)] const ZSTD_MAGIC_BYTES: &[u8] = &[0x28, 0xB5, 0x2F, 0xFD]; impl RedisConnectionWrapper { @@ -196,8 +202,8 @@ impl RedisConnectionWrapper { &self, key: &str, value: V, - redis_compression_config: Option, - redis_type: RedisDataStruct, + _redis_compression_config: Option, + _redis_type: RedisDataStruct, ) -> Result<(), errors::RedisError> where V: serde::Serialize + Debug, @@ -253,14 +259,14 @@ impl RedisConnectionWrapper { #[cfg(feature = "redis_compression")] fn is_zstd_compressed(data: &[u8]) -> bool { - data.len() >= 4 && &data[..4] == [0x28, 0xB5, 0x2F, 0xFD] + data.len() >= 4 && data[..4] == [0x28, 0xB5, 0x2F, 0xFD] } #[cfg(feature = "redis_compression")] fn extract_dict_id_from_cdata(cdata: &[u8]) -> Option { // Haskell magic: "(\181/\253" let magic_number: [u8; 4] = [0x28, 0xB5, 0x2F, 0xFD]; - if cdata.len() > 9 && &cdata[0..4] == magic_number { + if cdata.len() > 9 && cdata[0..4] == magic_number { let cdata_wo_magic = &cdata[4..]; let frame_header_w = cdata_wo_magic[0]; @@ -331,7 +337,7 @@ impl RedisConnectionWrapper { pub async fn get_key( &self, key: &str, - type_name: &'static str, + _type_name: &'static str, ) -> Result where T: DeserializeOwned, @@ -495,10 +501,9 @@ impl RedisConnectionWrapper { value: &str, ttl: i64, option: SetOptions, - redis_compression_config: Option, - redis_type: RedisDataStruct, + _redis_compression_config: Option, + _redis_type: RedisDataStruct, ) -> Result { - // implement the redis query to set if it doesn't exist self.conn .pool .set(key, value, Some(Expiration::EX(ttl)), Some(option), false) @@ -559,8 +564,8 @@ impl RedisConnectionWrapper { key: &str, value: &str, ttl: i64, - redis_compression_config: Option, - redis_type: RedisDataStruct, + _redis_compression_config: Option, + _redis_type: RedisDataStruct, ) -> Result<(), errors::RedisError> { self.conn .pool @@ -623,7 +628,7 @@ impl RedisConnectionWrapper { &self, key: &str, field: &str, - type_name: &'static str, + _type_name: &'static str, ) -> Result, errors::RedisError> where T: serde::de::DeserializeOwned, diff --git a/src/redis/feature.rs b/src/redis/feature.rs index 822d2103..b71bbf10 100644 --- a/src/redis/feature.rs +++ b/src/redis/feature.rs @@ -13,7 +13,7 @@ pub async fn is_feature_enabled(f_name: String, mid: String, redis_name: String) // Original Haskell function: isFeatureEnabledWithMaybeDBConf pub async fn is_feature_enabled_with_maybe_db_conf( - maybe_db_conf: Option, + _maybe_db_conf: Option, f_name: String, mid: String, _: String, @@ -137,16 +137,17 @@ pub enum RedisDataStruct { STRING, HASHMAP, STREAM, - STREAM_V2, + #[serde(rename = "STREAM_V2")] + StreamV2, } impl RedisDataStruct { pub fn as_str(&self) -> &'static str { match self { - RedisDataStruct::STRING => "STRING", - RedisDataStruct::HASHMAP => "HASHMAP", - RedisDataStruct::STREAM => "STREAM", - RedisDataStruct::STREAM_V2 => "STREAM_V2", + Self::STRING => "STRING", + Self::HASHMAP => "HASHMAP", + Self::STREAM => "STREAM", + Self::StreamV2 => "STREAM_V2", } } } diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index 5b189b0b..586a2927 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -1,6 +1,5 @@ use std::time::Instant; -use crate::decider::gatewaydecider::constants as C; use crate::decider::gatewaydecider::{ flows::decider_full_payload_hs_function, types::{DecidedGateway, DomainDeciderRequest, ErrorResponse, UnifiedError}, @@ -9,12 +8,11 @@ use crate::logger; use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; use crate::redis::feature::{ check_redis_comp_merchant_flag, is_feature_enabled, RedisCompressionConfig, - RedisCompressionConfigCombined, RedisCompressionCutover, + RedisCompressionConfigCombined, }; use axum::body::to_bytes; use axum::http::StatusCode; use axum::response::IntoResponse; -use cpu_time::ProcessTime; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -74,7 +72,11 @@ where let request_time = time::OffsetDateTime::now_utc() .format(&time::format_description::well_known::Rfc3339) .unwrap_or_else(|_| "unknown".to_string()); - let query_params = original_url.splitn(2, '?').nth(1).unwrap_or("").to_string(); + let query_params = original_url + .split_once('?') + .map(|x| x.1) + .unwrap_or("") + .to_string(); // Extract request headers as a JSON string // let req_headers = serde_json::to_string(&headers).unwrap_or("{}".to_string()); diff --git a/src/routes/update_gateway_score.rs b/src/routes/update_gateway_score.rs index 97160b3b..2d745329 100644 --- a/src/routes/update_gateway_score.rs +++ b/src/routes/update_gateway_score.rs @@ -80,7 +80,7 @@ pub async fn update_gateway_score( let payment_id = payload.payment_id.clone(); let result = check_and_update_gateway_score_(payload).await; match result { - Ok(success) => { + Ok(_success) => { API_REQUEST_COUNTER .with_label_values(&["update_gateway_score", "success"]) .inc(); @@ -108,7 +108,7 @@ pub async fn update_gateway_score( .with_label_values(&["update_gateway_score", "failure"]) .inc(); timer.observe_duration(); - return Err(ErrorResponse { + Err(ErrorResponse { status: "400".to_string(), error_code: "400".to_string(), error_message: "Error parsing request".to_string(), @@ -122,7 +122,7 @@ pub async fn update_gateway_score( }, priority_logic_output: None, is_dynamic_mga_enabled: false, - }); + }) } } } diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index 2013d37d..2c005cfe 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -51,7 +51,11 @@ pub async fn update_score( let request_time = time::OffsetDateTime::now_utc() .format(&time::format_description::well_known::Rfc3339) .unwrap_or_else(|_| "unknown".to_string()); - let query_params = original_url.splitn(2, '?').nth(1).unwrap_or("").to_string(); + let query_params = original_url + .split_once('?') + .map(|x| x.1) + .unwrap_or("") + .to_string(); tracing::Span::current().record("is_audit_trail_log", "true"); // Buffer the body into memory let body_bytes = match to_bytes(req.into_body(), usize::MAX).await { @@ -242,7 +246,7 @@ pub async fn update_score( .with_label_values(&["update_score", "success"]) .inc(); timer.observe_duration(); - return Ok("Success"); + Ok("Success") } Err(e) => { let error_response = ErrorResponse { @@ -289,7 +293,7 @@ pub async fn update_score( .with_label_values(&["update_score", "failure"]) .inc(); timer.observe_duration(); - return Err(error_response); + Err(error_response) } } } diff --git a/src/storage.rs b/src/storage.rs index 0c1bbaed..f7154edc 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -1,15 +1,18 @@ -use crate::{ - config::Database, - error::{self, ContainerError}, - logger, -}; +use crate::error::{self, ContainerError}; +#[cfg(feature = "mysql")] +use crate::config::Database; #[cfg(feature = "postgres")] use crate::config::PgDatabase; +#[cfg(feature = "mysql")] +use crate::logger; + use crate::generics::StorageResult; use bb8::PooledConnection; +#[cfg(feature = "mysql")] use std::time::Duration; +#[cfg(feature = "mysql")] use tokio::time; #[cfg(feature = "mysql")] @@ -18,18 +21,12 @@ use diesel::MysqlConnection; use diesel::PgConnection; #[cfg(feature = "mysql")] use diesel_async::{ - pooled_connection::{ - self, - deadpool::{Object, Pool}, - }, + pooled_connection::{self, deadpool::Pool}, AsyncMysqlConnection, }; #[cfg(feature = "postgres")] use diesel_async::{ - pooled_connection::{ - self, - deadpool::{Object, Pool}, - }, + pooled_connection::{self, deadpool::Pool}, AsyncPgConnection, }; @@ -70,9 +67,6 @@ pub type MysqlPoolConn = async_bb8_diesel::Connection; #[cfg(feature = "mysql")] pub type MysqlPool = bb8::Pool; -#[cfg(feature = "postgres")] -type DeadPoolConnType = Object; - #[cfg(feature = "postgres")] impl Storage { /// Create a new storage interface from configuration @@ -95,13 +89,13 @@ impl Storage { pooled_connection::AsyncDieselConnectionManager::::new(database_url); let pool = Pool::builder(config); - let pool = match database.pg_pool_size { + let _pool = match database.pg_pool_size { Some(value) => pool.max_size(value), None => pool, }; let pool = diesel_make_pg_pool(database, schema, false).await?; - return Ok(Self { pg_pool: pool }); + Ok(Self { pg_pool: pool }) } pub async fn get_conn( &self, @@ -109,7 +103,7 @@ impl Storage { { match self.pg_pool.get().await { Ok(conn) => Ok(conn), - Err(err) => Err(crate::generics::MeshError::DatabaseConnectionError), + Err(_err) => Err(crate::generics::MeshError::DatabaseConnectionError), } } } @@ -137,13 +131,13 @@ impl Storage { ); let pool = Pool::builder(config); - let pool = match database.pool_size { + let _pool = match database.pool_size { Some(value) => pool.max_size(value), None => pool, }; let pool = diesel_make_mysql_pool(database, schema, false).await?; - return Ok(Self { pg_pool: pool }); + Ok(Self { pg_pool: pool }) } /// Get connection from database pool for accessing data @@ -190,7 +184,7 @@ pub(crate) trait TestInterface { pub async fn diesel_make_pg_pool( database: &PgDatabase, schema: &str, - test_transaction: bool, + _test_transaction: bool, ) -> error_stack::Result { let database_url = format!( "postgres://{}:{}@{}:{}/{}?application_name={}&options=-c search_path%3D{}", @@ -217,7 +211,7 @@ pub async fn diesel_make_pg_pool( pub async fn diesel_make_mysql_pool( database: &Database, schema: &str, - test_transaction: bool, + _test_transaction: bool, ) -> error_stack::Result { let database_url = format!( "mysql://{}:{}@{}:{}/{}?application_name={}&options=-c search_path%3D{}", diff --git a/src/storage/types.rs b/src/storage/types.rs index 54fd1206..6350c616 100644 --- a/src/storage/types.rs +++ b/src/storage/types.rs @@ -2,6 +2,7 @@ use crate::decider::gatewaydecider::{self, types}; use crate::decider::network_decider; use crate::error; use crate::utils::CustomResult; +#[cfg(feature = "mysql")] use diesel::sql_types::Bit; #[cfg(feature = "postgres")] use diesel::sql_types::Bool; @@ -16,6 +17,7 @@ use diesel::mysql::Mysql; #[cfg(feature = "postgres")] use diesel::pg::Pg; use diesel::serialize::{IsNull, Output}; +#[cfg(feature = "mysql")] use diesel::sql_types::Binary; use diesel::*; use diesel::{ @@ -23,7 +25,7 @@ use diesel::{ Queryable, Selectable, }; use error_stack::ResultExt; -use masking::{PeekInterface, Secret}; +use masking::Secret; use serde::Serialize; use serde::{self, Deserialize}; use std::io::Write; @@ -69,7 +71,6 @@ pub struct EmiBankCode { #[derive(Debug, Clone, Identifiable, Queryable, Serialize, Selectable)] #[cfg_attr(feature = "mysql", diesel(table_name = schema::feature))] #[cfg_attr(feature = "postgres", diesel(table_name = schema_pg::feature))] - pub struct Feature { #[cfg(feature = "mysql")] pub id: i64, @@ -385,10 +386,10 @@ pub struct BitBool(pub bool); impl ToSql for BitBool { fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> diesel::serialize::Result { match *self { - BitBool(true) => { + Self(true) => { out.write_all(&[1u8])?; } - BitBool(false) => { + Self(false) => { out.write_all(&[0u8])?; } } @@ -409,8 +410,8 @@ impl FromSql for BitBool { impl ToSql for BitBool { fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> diesel::serialize::Result { match *self { - BitBool(true) => out.write_all(&[1])?, - BitBool(false) => out.write_all(&[0])?, + Self(true) => out.write_all(&[1])?, + Self(false) => out.write_all(&[0])?, } Ok(IsNull::No) } @@ -420,8 +421,8 @@ impl ToSql for BitBool { impl FromSql for BitBool { fn from_sql(bytes: ::RawValue<'_>) -> diesel::deserialize::Result { match bytes.as_bytes().first() { - Some(&1) => Ok(BitBool(true)), - _ => Ok(BitBool(false)), + Some(&1) => Ok(Self(true)), + _ => Ok(Self(false)), } } } @@ -435,10 +436,10 @@ pub struct BitBoolWrite(pub bool); impl ToSql for BitBoolWrite { fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> diesel::serialize::Result { match *self { - BitBoolWrite(true) => { + Self(true) => { out.write_all(&[1u8])?; } - BitBoolWrite(false) => { + Self(false) => { out.write_all(&[0u8])?; } } @@ -460,8 +461,8 @@ impl FromSql for BitBoolWrite { impl ToSql for BitBoolWrite { fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> diesel::serialize::Result { match *self { - BitBoolWrite(true) => out.write_all(&[1])?, - BitBoolWrite(false) => out.write_all(&[0])?, + Self(true) => out.write_all(&[1])?, + Self(false) => out.write_all(&[0])?, } Ok(IsNull::No) } @@ -472,8 +473,8 @@ impl FromSql for BitBoolWrite { fn from_sql(bytes: ::RawValue<'_>) -> diesel::deserialize::Result { // Should be Pg match bytes.as_bytes().first() { - Some(&1) => Ok(BitBoolWrite(true)), - _ => Ok(BitBoolWrite(false)), + Some(&1) => Ok(Self(true)), + _ => Ok(Self(false)), } } } diff --git a/src/types/bank_code.rs b/src/types/bank_code.rs index 655c7513..69f58b52 100644 --- a/src/types/bank_code.rs +++ b/src/types/bank_code.rs @@ -50,7 +50,7 @@ pub async fn find_bank_code(bank_code: String) -> Option { .await { Ok(db_record) => parse_juspay_bank_code(db_record).ok(), - Err(e) => None, + Err(_e) => None, } } diff --git a/src/types/card/isin.rs b/src/types/card/isin.rs index bd0c236d..b6237192 100644 --- a/src/types/card/isin.rs +++ b/src/types/card/isin.rs @@ -1,6 +1,5 @@ -#[macro_use] -use serde::{Deserialize, Serialize, Serializer}; use crate::error::ApiError; +use serde::{Deserialize, Serialize, Serializer}; use std::convert::TryFrom; use std::option::Option; use std::string::String; diff --git a/src/types/card/txn_card_info.rs b/src/types/card/txn_card_info.rs index 0a848996..3385ca13 100644 --- a/src/types/card/txn_card_info.rs +++ b/src/types/card/txn_card_info.rs @@ -167,7 +167,7 @@ impl TxnCardInfo { self.paymentSource.as_ref().and_then(|ps| { // use `expose_secret()` instead of peek() let ps_str = ps.peek(); - ps_str.split('@').last().map(|s| s.to_string()) + ps_str.split('@').next_back().map(|s| s.to_string()) }) } diff --git a/src/types/country/country_iso.rs b/src/types/country/country_iso.rs index a29e98bb..ad37ef8e 100644 --- a/src/types/country/country_iso.rs +++ b/src/types/country/country_iso.rs @@ -662,254 +662,254 @@ pub enum CountryISO2 { impl CountryISO2 { pub fn text_to_country(text: &str) -> Result { match text { - "AD" => Ok(CountryISO2::AD), - "AE" => Ok(CountryISO2::AE), - "AF" => Ok(CountryISO2::AF), - "AG" => Ok(CountryISO2::AG), - "AI" => Ok(CountryISO2::AI), - "AL" => Ok(CountryISO2::AL), - "AM" => Ok(CountryISO2::AM), - "AO" => Ok(CountryISO2::AO), - "AQ" => Ok(CountryISO2::AQ), - "AR" => Ok(CountryISO2::AR), - "AS" => Ok(CountryISO2::AS), - "AT" => Ok(CountryISO2::AT), - "AU" => Ok(CountryISO2::AU), - "AW" => Ok(CountryISO2::AW), - "AX" => Ok(CountryISO2::AX), - "AZ" => Ok(CountryISO2::AZ), - "BA" => Ok(CountryISO2::BA), - "BB" => Ok(CountryISO2::BB), - "BD" => Ok(CountryISO2::BD), - "BE" => Ok(CountryISO2::BE), - "BF" => Ok(CountryISO2::BF), - "BG" => Ok(CountryISO2::BG), - "BH" => Ok(CountryISO2::BH), - "BI" => Ok(CountryISO2::BI), - "BJ" => Ok(CountryISO2::BJ), - "BL" => Ok(CountryISO2::BL), - "BM" => Ok(CountryISO2::BM), - "BN" => Ok(CountryISO2::BN), - "BO" => Ok(CountryISO2::BO), - "BQ" => Ok(CountryISO2::BQ), - "BR" => Ok(CountryISO2::BR), - "BS" => Ok(CountryISO2::BS), - "BT" => Ok(CountryISO2::BT), - "BV" => Ok(CountryISO2::BV), - "BW" => Ok(CountryISO2::BW), - "BY" => Ok(CountryISO2::BY), - "BZ" => Ok(CountryISO2::BZ), - "CA" => Ok(CountryISO2::CA), - "CC" => Ok(CountryISO2::CC), - "CD" => Ok(CountryISO2::CD), - "CF" => Ok(CountryISO2::CF), - "CG" => Ok(CountryISO2::CG), - "CH" => Ok(CountryISO2::CH), - "CI" => Ok(CountryISO2::CI), - "CK" => Ok(CountryISO2::CK), - "CL" => Ok(CountryISO2::CL), - "CM" => Ok(CountryISO2::CM), - "CN" => Ok(CountryISO2::CN), - "CO" => Ok(CountryISO2::CO), - "CR" => Ok(CountryISO2::CR), - "CU" => Ok(CountryISO2::CU), - "CV" => Ok(CountryISO2::CV), - "CW" => Ok(CountryISO2::CW), - "CX" => Ok(CountryISO2::CX), - "CY" => Ok(CountryISO2::CY), - "CZ" => Ok(CountryISO2::CZ), - "DE" => Ok(CountryISO2::DE), - "DJ" => Ok(CountryISO2::DJ), - "DK" => Ok(CountryISO2::DK), - "DM" => Ok(CountryISO2::DM), - "DO" => Ok(CountryISO2::DO), - "DZ" => Ok(CountryISO2::DZ), - "EC" => Ok(CountryISO2::EC), - "EE" => Ok(CountryISO2::EE), - "EH" => Ok(CountryISO2::EH), - "EG" => Ok(CountryISO2::EG), - "ER" => Ok(CountryISO2::ER), - "ES" => Ok(CountryISO2::ES), - "ET" => Ok(CountryISO2::ET), - "FI" => Ok(CountryISO2::FI), - "FJ" => Ok(CountryISO2::FJ), - "FK" => Ok(CountryISO2::FK), - "FM" => Ok(CountryISO2::FM), - "FO" => Ok(CountryISO2::FO), - "FR" => Ok(CountryISO2::FR), - "GA" => Ok(CountryISO2::GA), - "GB" => Ok(CountryISO2::GB), - "GD" => Ok(CountryISO2::GD), - "GE" => Ok(CountryISO2::GE), - "GF" => Ok(CountryISO2::GF), - "GG" => Ok(CountryISO2::GG), - "GH" => Ok(CountryISO2::GH), - "GI" => Ok(CountryISO2::GI), - "GL" => Ok(CountryISO2::GL), - "GM" => Ok(CountryISO2::GM), - "GN" => Ok(CountryISO2::GN), - "GP" => Ok(CountryISO2::GP), - "GQ" => Ok(CountryISO2::GQ), - "GR" => Ok(CountryISO2::GR), - "GS" => Ok(CountryISO2::GS), - "GT" => Ok(CountryISO2::GT), - "GU" => Ok(CountryISO2::GU), - "GW" => Ok(CountryISO2::GW), - "GY" => Ok(CountryISO2::GY), - "HK" => Ok(CountryISO2::HK), - "HM" => Ok(CountryISO2::HM), - "HN" => Ok(CountryISO2::HN), - "HR" => Ok(CountryISO2::HR), - "HT" => Ok(CountryISO2::HT), - "HU" => Ok(CountryISO2::HU), - "ID" => Ok(CountryISO2::ID), - "IE" => Ok(CountryISO2::IE), - "IL" => Ok(CountryISO2::IL), - "IM" => Ok(CountryISO2::IM), - "IN" => Ok(CountryISO2::IN), - "IO" => Ok(CountryISO2::IO), - "IQ" => Ok(CountryISO2::IQ), - "IR" => Ok(CountryISO2::IR), - "IS" => Ok(CountryISO2::IS), - "IT" => Ok(CountryISO2::IT), - "JE" => Ok(CountryISO2::JE), - "JM" => Ok(CountryISO2::JM), - "JO" => Ok(CountryISO2::JO), - "JP" => Ok(CountryISO2::JP), - "KE" => Ok(CountryISO2::KE), - "KG" => Ok(CountryISO2::KG), - "KH" => Ok(CountryISO2::KH), - "KI" => Ok(CountryISO2::KI), - "KM" => Ok(CountryISO2::KM), - "KN" => Ok(CountryISO2::KN), - "KP" => Ok(CountryISO2::KP), - "KR" => Ok(CountryISO2::KR), - "KW" => Ok(CountryISO2::KW), - "KY" => Ok(CountryISO2::KY), - "KZ" => Ok(CountryISO2::KZ), - "LA" => Ok(CountryISO2::LA), - "LB" => Ok(CountryISO2::LB), - "LC" => Ok(CountryISO2::LC), - "LI" => Ok(CountryISO2::LI), - "LK" => Ok(CountryISO2::LK), - "LR" => Ok(CountryISO2::LR), - "LS" => Ok(CountryISO2::LS), - "LT" => Ok(CountryISO2::LT), - "LU" => Ok(CountryISO2::LU), - "LV" => Ok(CountryISO2::LV), - "LY" => Ok(CountryISO2::LY), - "MA" => Ok(CountryISO2::MA), - "MC" => Ok(CountryISO2::MC), - "MD" => Ok(CountryISO2::MD), - "ME" => Ok(CountryISO2::ME), - "MF" => Ok(CountryISO2::MF), - "MG" => Ok(CountryISO2::MG), - "MH" => Ok(CountryISO2::MH), - "MK" => Ok(CountryISO2::MK), - "ML" => Ok(CountryISO2::ML), - "MM" => Ok(CountryISO2::MM), - "MN" => Ok(CountryISO2::MN), - "MO" => Ok(CountryISO2::MO), - "MP" => Ok(CountryISO2::MP), - "MQ" => Ok(CountryISO2::MQ), - "MR" => Ok(CountryISO2::MR), - "MS" => Ok(CountryISO2::MS), - "MT" => Ok(CountryISO2::MT), - "MU" => Ok(CountryISO2::MU), - "MV" => Ok(CountryISO2::MV), - "MW" => Ok(CountryISO2::MW), - "MX" => Ok(CountryISO2::MX), - "MY" => Ok(CountryISO2::MY), - "MZ" => Ok(CountryISO2::MZ), - "NA" => Ok(CountryISO2::NA), - "NC" => Ok(CountryISO2::NC), - "NE" => Ok(CountryISO2::NE), - "NF" => Ok(CountryISO2::NF), - "NG" => Ok(CountryISO2::NG), - "NI" => Ok(CountryISO2::NI), - "NL" => Ok(CountryISO2::NL), - "NO" => Ok(CountryISO2::NO), - "NP" => Ok(CountryISO2::NP), - "NR" => Ok(CountryISO2::NR), - "NU" => Ok(CountryISO2::NU), - "NZ" => Ok(CountryISO2::NZ), - "OM" => Ok(CountryISO2::OM), - "PA" => Ok(CountryISO2::PA), - "PE" => Ok(CountryISO2::PE), - "PF" => Ok(CountryISO2::PF), - "PG" => Ok(CountryISO2::PG), - "PH" => Ok(CountryISO2::PH), - "PK" => Ok(CountryISO2::PK), - "PL" => Ok(CountryISO2::PL), - "PM" => Ok(CountryISO2::PM), - "PN" => Ok(CountryISO2::PN), - "PR" => Ok(CountryISO2::PR), - "PS" => Ok(CountryISO2::PS), - "PT" => Ok(CountryISO2::PT), - "PW" => Ok(CountryISO2::PW), - "PY" => Ok(CountryISO2::PY), - "QA" => Ok(CountryISO2::QA), - "RE" => Ok(CountryISO2::RE), - "RO" => Ok(CountryISO2::RO), - "RS" => Ok(CountryISO2::RS), - "RU" => Ok(CountryISO2::RU), - "RW" => Ok(CountryISO2::RW), - "SA" => Ok(CountryISO2::SA), - "SB" => Ok(CountryISO2::SB), - "SC" => Ok(CountryISO2::SC), - "SD" => Ok(CountryISO2::SD), - "SE" => Ok(CountryISO2::SE), - "SG" => Ok(CountryISO2::SG), - "SH" => Ok(CountryISO2::SH), - "SI" => Ok(CountryISO2::SI), - "SJ" => Ok(CountryISO2::SJ), - "SK" => Ok(CountryISO2::SK), - "SL" => Ok(CountryISO2::SL), - "SM" => Ok(CountryISO2::SM), - "SN" => Ok(CountryISO2::SN), - "SO" => Ok(CountryISO2::SO), - "SR" => Ok(CountryISO2::SR), - "SS" => Ok(CountryISO2::SS), - "ST" => Ok(CountryISO2::ST), - "SV" => Ok(CountryISO2::SV), - "SX" => Ok(CountryISO2::SX), - "SY" => Ok(CountryISO2::SY), - "SZ" => Ok(CountryISO2::SZ), - "TC" => Ok(CountryISO2::TC), - "TD" => Ok(CountryISO2::TD), - "TF" => Ok(CountryISO2::TF), - "TG" => Ok(CountryISO2::TG), - "TH" => Ok(CountryISO2::TH), - "TJ" => Ok(CountryISO2::TJ), - "TK" => Ok(CountryISO2::TK), - "TL" => Ok(CountryISO2::TL), - "TM" => Ok(CountryISO2::TM), - "TN" => Ok(CountryISO2::TN), - "TO" => Ok(CountryISO2::TO), - "TR" => Ok(CountryISO2::TR), - "TT" => Ok(CountryISO2::TT), - "TV" => Ok(CountryISO2::TV), - "TZ" => Ok(CountryISO2::TZ), - "UA" => Ok(CountryISO2::UA), - "UG" => Ok(CountryISO2::UG), - "UM" => Ok(CountryISO2::UM), - "US" => Ok(CountryISO2::US), - "UY" => Ok(CountryISO2::UY), - "UZ" => Ok(CountryISO2::UZ), - "VA" => Ok(CountryISO2::VA), - "VC" => Ok(CountryISO2::VC), - "VE" => Ok(CountryISO2::VE), - "VG" => Ok(CountryISO2::VG), - "VI" => Ok(CountryISO2::VI), - "VN" => Ok(CountryISO2::VN), - "VU" => Ok(CountryISO2::VU), - "WF" => Ok(CountryISO2::WF), - "WS" => Ok(CountryISO2::WS), - "YE" => Ok(CountryISO2::YE), - "YT" => Ok(CountryISO2::YT), - "ZA" => Ok(CountryISO2::ZA), - "ZM" => Ok(CountryISO2::ZM), - "ZW" => Ok(CountryISO2::ZW), + "AD" => Ok(Self::AD), + "AE" => Ok(Self::AE), + "AF" => Ok(Self::AF), + "AG" => Ok(Self::AG), + "AI" => Ok(Self::AI), + "AL" => Ok(Self::AL), + "AM" => Ok(Self::AM), + "AO" => Ok(Self::AO), + "AQ" => Ok(Self::AQ), + "AR" => Ok(Self::AR), + "AS" => Ok(Self::AS), + "AT" => Ok(Self::AT), + "AU" => Ok(Self::AU), + "AW" => Ok(Self::AW), + "AX" => Ok(Self::AX), + "AZ" => Ok(Self::AZ), + "BA" => Ok(Self::BA), + "BB" => Ok(Self::BB), + "BD" => Ok(Self::BD), + "BE" => Ok(Self::BE), + "BF" => Ok(Self::BF), + "BG" => Ok(Self::BG), + "BH" => Ok(Self::BH), + "BI" => Ok(Self::BI), + "BJ" => Ok(Self::BJ), + "BL" => Ok(Self::BL), + "BM" => Ok(Self::BM), + "BN" => Ok(Self::BN), + "BO" => Ok(Self::BO), + "BQ" => Ok(Self::BQ), + "BR" => Ok(Self::BR), + "BS" => Ok(Self::BS), + "BT" => Ok(Self::BT), + "BV" => Ok(Self::BV), + "BW" => Ok(Self::BW), + "BY" => Ok(Self::BY), + "BZ" => Ok(Self::BZ), + "CA" => Ok(Self::CA), + "CC" => Ok(Self::CC), + "CD" => Ok(Self::CD), + "CF" => Ok(Self::CF), + "CG" => Ok(Self::CG), + "CH" => Ok(Self::CH), + "CI" => Ok(Self::CI), + "CK" => Ok(Self::CK), + "CL" => Ok(Self::CL), + "CM" => Ok(Self::CM), + "CN" => Ok(Self::CN), + "CO" => Ok(Self::CO), + "CR" => Ok(Self::CR), + "CU" => Ok(Self::CU), + "CV" => Ok(Self::CV), + "CW" => Ok(Self::CW), + "CX" => Ok(Self::CX), + "CY" => Ok(Self::CY), + "CZ" => Ok(Self::CZ), + "DE" => Ok(Self::DE), + "DJ" => Ok(Self::DJ), + "DK" => Ok(Self::DK), + "DM" => Ok(Self::DM), + "DO" => Ok(Self::DO), + "DZ" => Ok(Self::DZ), + "EC" => Ok(Self::EC), + "EE" => Ok(Self::EE), + "EH" => Ok(Self::EH), + "EG" => Ok(Self::EG), + "ER" => Ok(Self::ER), + "ES" => Ok(Self::ES), + "ET" => Ok(Self::ET), + "FI" => Ok(Self::FI), + "FJ" => Ok(Self::FJ), + "FK" => Ok(Self::FK), + "FM" => Ok(Self::FM), + "FO" => Ok(Self::FO), + "FR" => Ok(Self::FR), + "GA" => Ok(Self::GA), + "GB" => Ok(Self::GB), + "GD" => Ok(Self::GD), + "GE" => Ok(Self::GE), + "GF" => Ok(Self::GF), + "GG" => Ok(Self::GG), + "GH" => Ok(Self::GH), + "GI" => Ok(Self::GI), + "GL" => Ok(Self::GL), + "GM" => Ok(Self::GM), + "GN" => Ok(Self::GN), + "GP" => Ok(Self::GP), + "GQ" => Ok(Self::GQ), + "GR" => Ok(Self::GR), + "GS" => Ok(Self::GS), + "GT" => Ok(Self::GT), + "GU" => Ok(Self::GU), + "GW" => Ok(Self::GW), + "GY" => Ok(Self::GY), + "HK" => Ok(Self::HK), + "HM" => Ok(Self::HM), + "HN" => Ok(Self::HN), + "HR" => Ok(Self::HR), + "HT" => Ok(Self::HT), + "HU" => Ok(Self::HU), + "ID" => Ok(Self::ID), + "IE" => Ok(Self::IE), + "IL" => Ok(Self::IL), + "IM" => Ok(Self::IM), + "IN" => Ok(Self::IN), + "IO" => Ok(Self::IO), + "IQ" => Ok(Self::IQ), + "IR" => Ok(Self::IR), + "IS" => Ok(Self::IS), + "IT" => Ok(Self::IT), + "JE" => Ok(Self::JE), + "JM" => Ok(Self::JM), + "JO" => Ok(Self::JO), + "JP" => Ok(Self::JP), + "KE" => Ok(Self::KE), + "KG" => Ok(Self::KG), + "KH" => Ok(Self::KH), + "KI" => Ok(Self::KI), + "KM" => Ok(Self::KM), + "KN" => Ok(Self::KN), + "KP" => Ok(Self::KP), + "KR" => Ok(Self::KR), + "KW" => Ok(Self::KW), + "KY" => Ok(Self::KY), + "KZ" => Ok(Self::KZ), + "LA" => Ok(Self::LA), + "LB" => Ok(Self::LB), + "LC" => Ok(Self::LC), + "LI" => Ok(Self::LI), + "LK" => Ok(Self::LK), + "LR" => Ok(Self::LR), + "LS" => Ok(Self::LS), + "LT" => Ok(Self::LT), + "LU" => Ok(Self::LU), + "LV" => Ok(Self::LV), + "LY" => Ok(Self::LY), + "MA" => Ok(Self::MA), + "MC" => Ok(Self::MC), + "MD" => Ok(Self::MD), + "ME" => Ok(Self::ME), + "MF" => Ok(Self::MF), + "MG" => Ok(Self::MG), + "MH" => Ok(Self::MH), + "MK" => Ok(Self::MK), + "ML" => Ok(Self::ML), + "MM" => Ok(Self::MM), + "MN" => Ok(Self::MN), + "MO" => Ok(Self::MO), + "MP" => Ok(Self::MP), + "MQ" => Ok(Self::MQ), + "MR" => Ok(Self::MR), + "MS" => Ok(Self::MS), + "MT" => Ok(Self::MT), + "MU" => Ok(Self::MU), + "MV" => Ok(Self::MV), + "MW" => Ok(Self::MW), + "MX" => Ok(Self::MX), + "MY" => Ok(Self::MY), + "MZ" => Ok(Self::MZ), + "NA" => Ok(Self::NA), + "NC" => Ok(Self::NC), + "NE" => Ok(Self::NE), + "NF" => Ok(Self::NF), + "NG" => Ok(Self::NG), + "NI" => Ok(Self::NI), + "NL" => Ok(Self::NL), + "NO" => Ok(Self::NO), + "NP" => Ok(Self::NP), + "NR" => Ok(Self::NR), + "NU" => Ok(Self::NU), + "NZ" => Ok(Self::NZ), + "OM" => Ok(Self::OM), + "PA" => Ok(Self::PA), + "PE" => Ok(Self::PE), + "PF" => Ok(Self::PF), + "PG" => Ok(Self::PG), + "PH" => Ok(Self::PH), + "PK" => Ok(Self::PK), + "PL" => Ok(Self::PL), + "PM" => Ok(Self::PM), + "PN" => Ok(Self::PN), + "PR" => Ok(Self::PR), + "PS" => Ok(Self::PS), + "PT" => Ok(Self::PT), + "PW" => Ok(Self::PW), + "PY" => Ok(Self::PY), + "QA" => Ok(Self::QA), + "RE" => Ok(Self::RE), + "RO" => Ok(Self::RO), + "RS" => Ok(Self::RS), + "RU" => Ok(Self::RU), + "RW" => Ok(Self::RW), + "SA" => Ok(Self::SA), + "SB" => Ok(Self::SB), + "SC" => Ok(Self::SC), + "SD" => Ok(Self::SD), + "SE" => Ok(Self::SE), + "SG" => Ok(Self::SG), + "SH" => Ok(Self::SH), + "SI" => Ok(Self::SI), + "SJ" => Ok(Self::SJ), + "SK" => Ok(Self::SK), + "SL" => Ok(Self::SL), + "SM" => Ok(Self::SM), + "SN" => Ok(Self::SN), + "SO" => Ok(Self::SO), + "SR" => Ok(Self::SR), + "SS" => Ok(Self::SS), + "ST" => Ok(Self::ST), + "SV" => Ok(Self::SV), + "SX" => Ok(Self::SX), + "SY" => Ok(Self::SY), + "SZ" => Ok(Self::SZ), + "TC" => Ok(Self::TC), + "TD" => Ok(Self::TD), + "TF" => Ok(Self::TF), + "TG" => Ok(Self::TG), + "TH" => Ok(Self::TH), + "TJ" => Ok(Self::TJ), + "TK" => Ok(Self::TK), + "TL" => Ok(Self::TL), + "TM" => Ok(Self::TM), + "TN" => Ok(Self::TN), + "TO" => Ok(Self::TO), + "TR" => Ok(Self::TR), + "TT" => Ok(Self::TT), + "TV" => Ok(Self::TV), + "TZ" => Ok(Self::TZ), + "UA" => Ok(Self::UA), + "UG" => Ok(Self::UG), + "UM" => Ok(Self::UM), + "US" => Ok(Self::US), + "UY" => Ok(Self::UY), + "UZ" => Ok(Self::UZ), + "VA" => Ok(Self::VA), + "VC" => Ok(Self::VC), + "VE" => Ok(Self::VE), + "VG" => Ok(Self::VG), + "VI" => Ok(Self::VI), + "VN" => Ok(Self::VN), + "VU" => Ok(Self::VU), + "WF" => Ok(Self::WF), + "WS" => Ok(Self::WS), + "YE" => Ok(Self::YE), + "YT" => Ok(Self::YT), + "ZA" => Ok(Self::ZA), + "ZM" => Ok(Self::ZM), + "ZW" => Ok(Self::ZW), _ => Err(ApiError::ParsingError("Invalid Country ISO2")), } } diff --git a/src/types/gateway_bank_emi_support_v2.rs b/src/types/gateway_bank_emi_support_v2.rs index 3e7570ff..46e3fd56 100644 --- a/src/types/gateway_bank_emi_support_v2.rs +++ b/src/types/gateway_bank_emi_support_v2.rs @@ -5,7 +5,6 @@ use serde::{Deserialize, Serialize}; use crate::app::get_tenant_app_state; use crate::error::ApiError; use crate::storage::types::GatewayBankEmiSupportV2 as DBGatewayBankEmiSupportV2; -use std::i64; use std::string::String; use std::vec::Vec; // use types::utils::dbconfig::getEulerDbConf; diff --git a/src/types/gateway_card_info.rs b/src/types/gateway_card_info.rs index b224e05f..430c9e52 100644 --- a/src/types/gateway_card_info.rs +++ b/src/types/gateway_card_info.rs @@ -115,15 +115,13 @@ impl TryFrom for GatewayCardInfo { gateway: db_gci.gateway, cardIssuerBankName: db_gci.card_issuer_bank_name, authType: db_gci.auth_type, - juspayBankCodeId: db_gci.juspay_bank_code_id.map(|id| to_bank_code_id(id)), + juspayBankCodeId: db_gci.juspay_bank_code_id.map(to_bank_code_id), disabled: db_gci.disabled.map(|f| f.0), validationType: db_gci .validation_type - .map(|validation_type| text_to_validation_type(validation_type)) + .map(text_to_validation_type) .transpose()?, - paymentMethodType: db_gci - .payment_method_type - .map(|payment_method_type| payment_method_type), + paymentMethodType: db_gci.payment_method_type, }) } } @@ -164,8 +162,7 @@ pub async fn get_enabled_gateway_card_info_for_gateways( let app_state = get_tenant_app_state().await; // Convert gateways to strings - let gateway_strings: Vec> = - gateways.clone().into_iter().map(|g| Some(g)).collect(); + let gateway_strings: Vec> = gateways.clone().into_iter().map(Some).collect(); logger::debug!( tag = "get_enabled_gateway_card_info_for_gateways", diff --git a/src/types/gateway_payment_method_flow.rs b/src/types/gateway_payment_method_flow.rs index 8df505ca..082245c4 100644 --- a/src/types/gateway_payment_method_flow.rs +++ b/src/types/gateway_payment_method_flow.rs @@ -112,11 +112,7 @@ impl TryFrom for GatewayPaymentMethodFlowF { }; // Convert optional payment method type - let payment_method_type = if let Some(pmt) = db.payment_method_type { - Some(pmt) - } else { - None - }; + let payment_method_type = db.payment_method_type; // Construct the GatewayPaymentMethodFlow instance Ok(Self { diff --git a/src/types/merchant/merchant_account.rs b/src/types/merchant/merchant_account.rs index d973650c..8208a9ad 100644 --- a/src/types/merchant/merchant_account.rs +++ b/src/types/merchant/merchant_account.rs @@ -35,7 +35,7 @@ pub struct EnableTokenization { pub enable_issuer_tokenization: bool, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Clone, PartialEq, Serialize, Deserialize)] pub struct MerchantAccount { // #[serde(rename = "id")] pub id: MerchantPId, @@ -77,6 +77,39 @@ pub struct MerchantAccount { pub merchantCategoryCode: Option, } +impl Debug for MerchantAccount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("MerchantAccount") + .field("id", &self.id) + .field("merchantId", &self.merchantId) + .field("country", &self.country) + .field( + "gatewayDecidedByHealthEnabled", + &self.gatewayDecidedByHealthEnabled, + ) + .field("gatewayPriority", &self.gatewayPriority) + .field("gatewayPriorityLogic", &self.gatewayPriorityLogic) + .field("useCodeForGatewayPriority", &self.useCodeForGatewayPriority) + .field("internalHashKey", &"[REDACTED]") + .field("userId", &self.userId) + .field("secondaryMerchantAccountId", &"[REDACTED]") + .field( + "enableGatewayReferenceIdBasedRouting", + &self.enableGatewayReferenceIdBasedRouting, + ) + .field( + "gatewaySuccessRateBasedDeciderInput", + &self.gatewaySuccessRateBasedDeciderInput, + ) + .field("internalMetadata", &"[REDACTED]") + .field("installmentEnabled", &self.installmentEnabled) + .field("tenantAccountId", &"[REDACTED]") + .field("priorityLogicConfig", &self.priorityLogicConfig) + .field("merchantCategoryCode", &self.merchantCategoryCode) + .finish() + } +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct MerchantAccountCreateRequest { pub merchant_id: String, @@ -135,9 +168,7 @@ impl TryFrom for MerchantAccount { useCodeForGatewayPriority: value.use_code_for_gateway_priority.0, internalHashKey: value.internal_hash_key, userId: value.user_id, - secondaryMerchantAccountId: value - .secondary_merchant_account_id - .map(|mid| to_merchant_pid(mid)), + secondaryMerchantAccountId: value.secondary_merchant_account_id.map(to_merchant_pid), enableGatewayReferenceIdBasedRouting: value .enable_gateway_reference_id_based_routing .map(|f| f.0), @@ -232,7 +263,7 @@ pub async fn delete_merchant_account( let conn = &app_state.db.get_conn().await?; // Use Diesel's query builder with multiple conditions crate::generics::generic_delete::<::Table, _>( - &conn, + conn, dsl::merchant_id.eq(merchant_id), ) .await?; @@ -254,7 +285,7 @@ pub async fn update_merchant_account( ::Table, MerchantAccountUpdate, _, - >(&conn, dsl::merchant_id.eq(merchant_id), values) + >(conn, dsl::merchant_id.eq(merchant_id), values) .await?; Ok(()) } diff --git a/src/types/merchant/merchant_gateway_account.rs b/src/types/merchant/merchant_gateway_account.rs index 8edffede..b67f4264 100644 --- a/src/types/merchant/merchant_gateway_account.rs +++ b/src/types/merchant/merchant_gateway_account.rs @@ -12,7 +12,6 @@ use crate::types::merchant::id::{to_merchant_id, MerchantId}; // use juspay::extra::secret::{Secret, SecretContext}; // use eulerhs::extra::combinators::to_domain_all; // use eulerhs::language::MonadFlow; -use std::i64; use std::option::Option; use std::string::String; use std::vec::Vec; @@ -54,7 +53,7 @@ pub fn to_supported_payment_flows( ) -> Result { match serde_json::from_str::(&supported_payment_flows) { Ok(res) => Ok(res), - Err(_) => Err(ApiError::ParsingError("Inavlid Supported Payment Flowws")), + Err(_) => Err(ApiError::ParsingError("Invalid Supported Payment Flows")), } } @@ -127,10 +126,10 @@ impl TryFrom for MerchantGatewayAccount { paymentMethods: value.payment_methods, supported_payment_flows: value .supported_payment_flows - .map(|flows| to_supported_payment_flows(flows)) + .map(to_supported_payment_flows) .transpose()?, disabled: value.disabled.map(|f| f.0), - referenceId: value.reference_id.map(|id| to_mga_reference_id(id)), + referenceId: value.reference_id.map(to_mga_reference_id), supportedCurrencies: value.supported_currencies, gatewayIdentifier: value.gateway_identifier, gatewayType: value.gateway_type, diff --git a/src/types/merchant/merchant_iframe_preferences.rs b/src/types/merchant/merchant_iframe_preferences.rs index 23df262e..dcdd4506 100644 --- a/src/types/merchant/merchant_iframe_preferences.rs +++ b/src/types/merchant/merchant_iframe_preferences.rs @@ -10,7 +10,6 @@ use crate::types::merchant::id::{to_merchant_id, MerchantId}; // use juspay::extra::parsing::{Parsed, Step, defaulting, lift_pure, mandated, non_negative, parse_field, project}; // use eulerhs::extra::combinators::to_domain_all; // use eulerhs::language::MonadFlow; -use std::i64; use std::option::Option; use std::string::String; // use named::Named; @@ -48,7 +47,7 @@ pub struct MerchantIframePreferences { impl From for MerchantIframePreferences { fn from(value: DBMerchantIframePreferences) -> Self { - MerchantIframePreferences { + Self { id: to_merchant_iframe_prefs_pid(value.id), merchantId: to_merchant_id(value.merchant_id), dynamicSwitchingEnabled: value.dynamic_switching_enabled.unwrap_or(BitBool(false)).0, diff --git a/src/types/merchant_config/types.rs b/src/types/merchant_config/types.rs index f22212ea..ee020bac 100644 --- a/src/types/merchant_config/types.rs +++ b/src/types/merchant_config/types.rs @@ -24,7 +24,7 @@ pub enum ConfigStatus { pub struct TenantConfigValueType { pub status: ConfigStatus, - pub configValue: Option>, + pub configValue: Option>, } #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/src/types/merchant_gateway_card_info.rs b/src/types/merchant_gateway_card_info.rs index 8d9ca7f8..a784dde3 100644 --- a/src/types/merchant_gateway_card_info.rs +++ b/src/types/merchant_gateway_card_info.rs @@ -87,10 +87,7 @@ pub async fn find_all_mgcis_by_macc_and_gci_p_id( ) -> Vec { // Call the database function and handle results match find_all_mgcis_by_macc_and_gci_p_id_db(&m_pid, &gci_ids).await { - Ok(db_results) => db_results - .into_iter() - .filter_map(|db_record| MerchantGatewayCardInfo::try_from(db_record).ok()) - .collect(), + Ok(db_results) => db_results.into_iter().map(From::from).collect(), Err(_) => Vec::new(), // Silently handle any errors by returning empty vec } } diff --git a/src/types/merchant_gateway_payment_method_flow.rs b/src/types/merchant_gateway_payment_method_flow.rs index 178fef4b..b7ad7135 100644 --- a/src/types/merchant_gateway_payment_method_flow.rs +++ b/src/types/merchant_gateway_payment_method_flow.rs @@ -168,10 +168,7 @@ pub async fn get_all_mgpmf_by_mga_id_and_gpmf_ids( ) .await { - Ok(db_results) => db_results - .into_iter() - .filter_map(|db_record| MerchantGatewayPaymentMethodFlow::try_from(db_record).ok()) - .collect(), + Ok(db_results) => db_results.into_iter().map(From::from).collect(), Err(_) => Vec::new(), // Silently handle any errors by returning empty vec } } diff --git a/src/types/merchant_priority_logic.rs b/src/types/merchant_priority_logic.rs index 30fd1c0e..39e097bc 100644 --- a/src/types/merchant_priority_logic.rs +++ b/src/types/merchant_priority_logic.rs @@ -7,7 +7,6 @@ use crate::storage::types::MerchantPriorityLogic as DBMerchantPriorityLogic; use diesel::associations::HasTable; use diesel::*; use serde::{Deserialize, Serialize}; -use std::convert::TryFrom; use std::option::Option; use std::string::String; use std::vec::Vec; @@ -104,10 +103,7 @@ pub async fn find_all_priority_logic_by_merchant_pid(mpid: i64) -> Vec(&app_state.db, dsl::merchant_account_id.eq(mpid)) .await { - Ok(db_results) => db_results - .into_iter() - .filter_map(|db_record| MerchantPriorityLogic::try_from(db_record).ok()) - .collect(), + Ok(db_results) => db_results.into_iter().map(From::from).collect(), Err(_) => Vec::new(), // Silently handle any errors by returning an empty vector } } diff --git a/src/types/service_configuration.rs b/src/types/service_configuration.rs index 0b51c77b..d7120609 100644 --- a/src/types/service_configuration.rs +++ b/src/types/service_configuration.rs @@ -61,7 +61,7 @@ pub async fn update_config( ::Table, ServiceConfigurationUpdate, _, - >(&conn, dsl::name.eq(name), values) + >(conn, dsl::name.eq(name), values) .await?; Ok(()) @@ -77,7 +77,7 @@ pub async fn delete_config(name: String) -> Result<(), crate::generics::MeshErro .map_err(|_| crate::generics::MeshError::DatabaseConnectionError)?; // Use Diesel's query builder with multiple conditions crate::generics::generic_delete::<::Table, _>( - &conn, + conn, dsl::name.eq(name), ) .await?; diff --git a/src/types/tenant/tenant_config_filter.rs b/src/types/tenant/tenant_config_filter.rs index 39abd2e3..1ec1ba9c 100644 --- a/src/types/tenant/tenant_config_filter.rs +++ b/src/types/tenant/tenant_config_filter.rs @@ -1,7 +1,7 @@ #[cfg(feature = "mysql")] use crate::storage::schema::tenant_config_filter::dsl; #[cfg(feature = "postgres")] -use crate::storage::schema_pg::tenant_config_filter::{dimension_value, dsl, filter_group_id}; +use crate::storage::schema_pg::tenant_config_filter::dsl; use crate::{ app::get_tenant_app_state, error::ApiError, storage::types::TenantConfigFilter as DBTenantConfigFilter, @@ -44,7 +44,7 @@ impl TryFrom for TenantConfigFilter { type Error = ApiError; fn try_from(db_tenant_config_filter: DBTenantConfigFilter) -> Result { - Ok(TenantConfigFilter { + Ok(Self { id: text_to_tenant_config_filter_id(db_tenant_config_filter.id), filterGroupId: db_tenant_config_filter.filter_group_id, dimensionValue: db_tenant_config_filter.dimension_value, @@ -56,7 +56,7 @@ impl TryFrom for TenantConfigFilter { pub async fn get_tenant_config_filter_by_group_id_and_dimension_value( group_id: String, - dimension_valu: String, + dimension_value: String, ) -> Option { let app_state = get_tenant_app_state().await; @@ -69,7 +69,7 @@ pub async fn get_tenant_config_filter_by_group_id_and_dimension_value( &app_state.db, dsl::filter_group_id .eq(group_id) - .and(dsl::dimension_value.eq(dimension_valu)), + .and(dsl::dimension_value.eq(dimension_value)), ) .await { diff --git a/src/types/token_bin_info.rs b/src/types/token_bin_info.rs index f904104a..19a9134a 100644 --- a/src/types/token_bin_info.rs +++ b/src/types/token_bin_info.rs @@ -69,9 +69,7 @@ pub async fn getAllTokenBinInfoByTokenBins(token_bins: Vec) -> Vec db_results.into_iter() - .filter_map(|db_record| TokenBinInfo::try_from(db_record).ok()) - .collect(), + Ok(db_results) => db_results.into_iter().map(From::from).collect(), Err(_) => Vec::new(), // Silently handle any errors by returning an empty vec } } diff --git a/src/types/txn_details/types.rs b/src/types/txn_details/types.rs index 62167ca5..e190e233 100644 --- a/src/types/txn_details/types.rs +++ b/src/types/txn_details/types.rs @@ -562,7 +562,7 @@ pub fn convert_safe_txn_detail_to_txn_detail( .unwrap(), dateCreated: safe_detail .dateCreated - .unwrap_or_else(|| OffsetDateTime::now_utc()), + .unwrap_or_else(OffsetDateTime::now_utc), orderId: safe_detail.orderId, status: TxnStatus::from_text(safe_detail.status).unwrap_or(TxnStatus::Failure), txnId: safe_detail.txnId, @@ -582,9 +582,7 @@ pub fn convert_safe_txn_detail_to_txn_detail( }), netAmount: safe_detail.netAmount, txnAmount: safe_detail.txnAmount, - txnObjectType: safe_detail - .txnObjectType - .and_then(|s| TxnObjectType::from_text(s)), + txnObjectType: safe_detail.txnObjectType.and_then(TxnObjectType::from_text), sourceObject: safe_detail.sourceObject, sourceObjectId: safe_detail.sourceObjectId.map(to_source_object_id), currency: safe_detail diff --git a/src/types/txn_offer.rs b/src/types/txn_offer.rs index 9e117a8f..affd0d98 100644 --- a/src/types/txn_offer.rs +++ b/src/types/txn_offer.rs @@ -75,10 +75,7 @@ pub async fn getOffersDB( pub async fn getOffers(txn_id: &TxnDetailId) -> Vec { // Call the database function and handle results match getOffersDB(txn_id).await { - Ok(db_results) => db_results - .into_iter() - .filter_map(|db_record| TxnOffer::try_from(db_record).ok()) - .collect(), + Ok(db_results) => db_results.into_iter().map(From::from).collect(), Err(_) => Vec::new(), // Silently handle any errors by returning empty vec } } diff --git a/src/types/txn_offer_detail.rs b/src/types/txn_offer_detail.rs index 6f3504b9..8481c7a7 100644 --- a/src/types/txn_offer_detail.rs +++ b/src/types/txn_offer_detail.rs @@ -13,7 +13,7 @@ pub struct TxnOfferDetailId(String); impl TxnOfferDetailId { pub fn new(s: String) -> Result { - Ok(TxnOfferDetailId(s)) + Ok(Self(s)) } } @@ -23,7 +23,7 @@ impl<'de> Deserialize<'de> for TxnOfferDetailId { D: de::Deserializer<'de>, { let s = String::deserialize(deserializer)?; - TxnOfferDetailId::new(s).map_err(de::Error::custom) + Self::new(s).map_err(de::Error::custom) } } diff --git a/src/utils.rs b/src/utils.rs index 1edf915b..9663dea2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -225,7 +225,7 @@ pub async fn call_api(url: &str, body: &serde_json::Value) -> Result f64 { +pub fn generate_random_number(_tag: String, range: (f64, f64)) -> f64 { let (min, max) = range; // Create a random number generator From aea281bde632f62962630e5fa327d86f75c7174e Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Tue, 24 Mar 2026 15:56:58 +0530 Subject: [PATCH 68/95] feat: implement static and dynamic hybrid routing endpoint (#213) --- src/app.rs | 4 + src/routes.rs | 1 + src/routes/hybrid_routing.rs | 267 +++++++++++++++++++++++++++++++++++ src/types.rs | 1 + src/types/hybrid_routing.rs | 9 ++ 5 files changed, 282 insertions(+) create mode 100644 src/routes/hybrid_routing.rs create mode 100644 src/types/hybrid_routing.rs diff --git a/src/app.rs b/src/app.rs index fd3e2b39..f14390d9 100644 --- a/src/app.rs +++ b/src/app.rs @@ -259,6 +259,10 @@ where "/decide-gateway", post(routes::decide_gateway::decide_gateway), ); + let router = router.route( + "/routing/hybrid", + post(routes::hybrid_routing::hybrid_routing_evaluate), + ); let router = router.route( "/update-gateway-score", post(routes::update_gateway_score::update_gateway_score), diff --git a/src/routes.rs b/src/routes.rs index cee46491..d7a8bf25 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -1,3 +1,4 @@ +pub mod hybrid_routing; // pub mod data; pub mod decide_gateway; pub mod decision_gateway; diff --git a/src/routes/hybrid_routing.rs b/src/routes/hybrid_routing.rs new file mode 100644 index 00000000..587b3179 --- /dev/null +++ b/src/routes/hybrid_routing.rs @@ -0,0 +1,267 @@ +use crate::decider::gatewaydecider::flow_new::decider_full_payload_hs_function; +use crate::decider::gatewaydecider::types::DecidedGateway; +use crate::error::ContainerError; +use crate::euclid::ast::ConnectorInfo; +use crate::euclid::errors::EuclidErrors; +use crate::euclid::handlers::routing_rules::routing_evaluate; +use crate::metrics::{API_LATENCY_HISTOGRAM, API_REQUEST_COUNTER, API_REQUEST_TOTAL_COUNTER}; +use crate::types::hybrid_routing::HybridRoutingRequest; +use axum::{response::IntoResponse, Json}; +use serde::Serialize; +use std::time::Instant; + +fn to_json_value_or_invalid( + value: &T, + context: &str, +) -> Result> { + serde_json::to_value(value).map_err(|err| { + crate::logger::error!( + serialization_context = context, + "Failed to serialize hybrid routing response field: {}", + err + ); + EuclidErrors::FailedToSerializeJsonToString.into() + }) +} + +fn insert_serialized( + map: &mut serde_json::Map, + key: &str, + value: &T, + context: &str, +) -> Result<(), ContainerError> { + to_json_value_or_invalid(value, context).map(|json_value| { + map.insert(key.to_string(), json_value); + }) +} + +fn to_logged_success_response( + map: serde_json::Map, +) -> axum::response::Response { + let response_value = serde_json::Value::Object(map); + crate::logger::debug!(decision_engine_success_response = ?response_value); + Json(response_value).into_response() +} + +fn log_serializable_response(label: &str, value: &T) { + match serde_json::to_value(value) { + Ok(response_value) => { + crate::logger::debug!(decision_engine_response_label = label, decision_engine_response = ?response_value) + } + Err(err) => crate::logger::warn!( + decision_engine_response_label = label, + "Failed to serialize response for logging: {}", + err + ), + } +} + +/// Extracts ordered connector blobs from static routing output. +/// +/// Order is preserved intentionally because static routing can return +/// connector priority, and dynamic routing consumes this as candidate order. +fn extract_static_eligible_gateways( + response: &crate::euclid::types::RoutingEvaluateResponse, +) -> Vec { + response.eligible_connectors.clone() +} + +fn extract_gateway_names(connectors: &[ConnectorInfo]) -> Vec { + connectors + .iter() + .map(|connector| connector.gateway_name.clone()) + .collect::>() +} + +fn parse_dynamic_connector(connector_with_id: &str) -> ConnectorInfo { + match connector_with_id.split_once(':') { + Some((gateway_name, gateway_id)) => ConnectorInfo { + gateway_name: gateway_name.to_string(), + gateway_id: Some(gateway_id.to_string()), + }, + None => ConnectorInfo { + gateway_name: connector_with_id.to_string(), + gateway_id: None, + }, + } +} + +#[derive(Serialize)] +struct DynamicRoutingEnvelope { + status: &'static str, + decision: Option, + fallback_connectors: Option>, +} + +/// Stores the normalized client-facing connector field. +/// +/// Clients should rely on `evaluated_connectors` for connector consumption +/// instead of branching on static/dynamic payload shapes. +fn insert_evaluated_connectors( + map: &mut serde_json::Map, + connectors: &[ConnectorInfo], +) -> Result<(), ContainerError> { + insert_serialized( + map, + "evaluated_connectors", + &connectors.to_vec(), + "evaluated_connectors", + ) +} + +#[axum::debug_handler] +pub async fn hybrid_routing_evaluate( + Json(payload): Json, +) -> Result> { + let timer = API_LATENCY_HISTOGRAM + .with_label_values(&["hybrid_routing_evaluate"]) + .start_timer(); + API_REQUEST_TOTAL_COUNTER + .with_label_values(&["hybrid_routing_evaluate"]) + .inc(); + + let HybridRoutingRequest { + static_routing_request, + dynamic_routing_request, + } = payload; + + let is_empty_request = static_routing_request.is_none() && dynamic_routing_request.is_none(); + + let (static_routing_response, static_routing_error, static_fallback_gateways) = + match static_routing_request { + Some(req) => { + // Preserve static fallback connectors even when static evaluation fails, + // so dynamic can still run with a bounded candidate set. + let fallback_gateways = req.fallback_output.clone(); + + match routing_evaluate(Json(req)).await { + Ok(response) => (Some(response.0), None, fallback_gateways), + Err(err) => (None, Some(err), fallback_gateways), + } + } + None => (None, None, None), + }; + + // Prefer static evaluated connectors over static fallback connectors + // when auto-populating dynamic candidates. + let static_eligible_gateways = static_routing_response + .as_ref() + .map(extract_static_eligible_gateways); + + let dynamic_fallback_gateways = static_eligible_gateways + .clone() + .or(static_fallback_gateways); + + let dynamic_eval_result = match dynamic_routing_request { + Some(mut req) => { + // Request-provided dynamic list has precedence. + // Static-derived list is only used when request list is absent/empty. + let request_eligible_gateways = match req.eligible_gateway_list.take() { + Some(gateways) if gateways.is_empty() => None, + Some(gateways) => Some(gateways), + None => None, + }; + let fallback_eligible_gateways = dynamic_fallback_gateways + .clone() + .map(|connectors| extract_gateway_names(&connectors)); + req.eligible_gateway_list = request_eligible_gateways.or(fallback_eligible_gateways); + Some(decider_full_payload_hs_function(req, Instant::now()).await) + } + None => None, + }; + + let mut res = serde_json::Map::new(); + + let static_insert_result = match static_routing_response.as_ref() { + Some(static_response) => insert_serialized( + &mut res, + "static_routing", + static_response, + "static_routing", + ), + None => Ok(()), + }; + + let response_result = match ( + is_empty_request, + dynamic_eval_result, + dynamic_fallback_gateways, + static_eligible_gateways, + static_routing_error, + ) { + (true, _, _, _, _) => Err(EuclidErrors::InvalidRequest( + "At least one of static_routing_request or dynamic_routing_request must be provided." + .to_string(), + ) + .into()), + (false, Some(Ok(dynamic_ok)), _, _, _) => { + // Dynamic winner is the first-class output for normalized connector field. + let dynamic_connector = vec![parse_dynamic_connector(&dynamic_ok.decided_gateway)]; + let dynamic_payload = DynamicRoutingEnvelope { + status: "success", + decision: Some(dynamic_ok), + fallback_connectors: None, + }; + insert_serialized( + &mut res, + "dynamic_routing", + &dynamic_payload, + "dynamic_routing", + ) + .and_then(|_| insert_evaluated_connectors(&mut res, &dynamic_connector)) + .map(|_| (to_logged_success_response(res), "success")) + } + (false, Some(Err(_dynamic_err)), Some(dynamic_fallback), _, _) => { + // Graceful degradation: when dynamic fails but fallback connectors exist, + // return fallback connectors instead of hard-failing. + let dynamic_payload = DynamicRoutingEnvelope { + status: "fallback", + decision: None, + fallback_connectors: Some(dynamic_fallback.clone()), + }; + insert_serialized( + &mut res, + "dynamic_routing", + &dynamic_payload, + "dynamic_routing", + ) + .and_then(|_| insert_evaluated_connectors(&mut res, &dynamic_fallback)) + .map(|_| (to_logged_success_response(res), "success")) + } + (false, Some(Err(dynamic_err)), None, _, _) => { + log_serializable_response("dynamic_error_response", &dynamic_err); + Ok((dynamic_err.into_response(), "failure")) + } + (false, None, _, Some(static_gateways), _) => { + insert_evaluated_connectors(&mut res, &static_gateways) + .map(|_| (to_logged_success_response(res), "success")) + } + (false, None, Some(dynamic_fallback), None, _) => { + insert_evaluated_connectors(&mut res, &dynamic_fallback) + .map(|_| (to_logged_success_response(res), "success")) + } + (false, None, _, None, Some(static_err)) => { + crate::logger::debug!(decision_engine_response_label = "static_error_response", error = ?static_err); + Ok((static_err.into_response(), "failure")) + } + (false, None, _, None, None) => Ok((to_logged_success_response(res), "success")), + }; + + let final_result = static_insert_result.and(response_result); + let api_result = match final_result { + Ok((response, metric_status)) => { + API_REQUEST_COUNTER + .with_label_values(&["hybrid_routing_evaluate", metric_status]) + .inc(); + Ok(response) + } + Err(err) => { + API_REQUEST_COUNTER + .with_label_values(&["hybrid_routing_evaluate", "failure"]) + .inc(); + Err(err) + } + }; + timer.observe_duration(); + api_result +} diff --git a/src/types.rs b/src/types.rs index 47f6d310..292651e6 100644 --- a/src/types.rs +++ b/src/types.rs @@ -13,6 +13,7 @@ pub mod gateway_outage; pub mod gateway_payment_flow; pub mod gateway_payment_method_flow; pub mod gateway_routing_input; +pub mod hybrid_routing; pub mod isin_routes; pub mod merchant; pub mod merchant_config; diff --git a/src/types/hybrid_routing.rs b/src/types/hybrid_routing.rs new file mode 100644 index 00000000..c8b1368a --- /dev/null +++ b/src/types/hybrid_routing.rs @@ -0,0 +1,9 @@ +use crate::euclid::types::RoutingRequest; +use crate::decider::gatewaydecider::types::DomainDeciderRequestForApiCallV2; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct HybridRoutingRequest { + pub static_routing_request: Option, + pub dynamic_routing_request: Option, +} From 248f63ece426f29003d3d9a3bfa50c180a9321b4 Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Tue, 24 Mar 2026 17:14:02 +0530 Subject: [PATCH 69/95] fix: formatting (#216) --- helm-charts/config/development.toml | 2 +- src/app.rs | 26 +++++++++++++------------- src/bin/open_router.rs | 5 +---- src/types/hybrid_routing.rs | 2 +- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/helm-charts/config/development.toml b/helm-charts/config/development.toml index 6bb23dfd..60cfcd67 100644 --- a/helm-charts/config/development.toml +++ b/helm-charts/config/development.toml @@ -404,7 +404,7 @@ apple_pay = { country = "EG, MA, ZA, CN, HK, JP, MY, MN, SG, KR, VN, AT, BE, BG, google_pay = { country = "AO, EG, KE, ZA, AR, BR, CL, CO, MX, PE, UY, AG, DO, AE, TR, SA, QA, OM, LB, KW, JO, IL, BH, KZ, VN, TH, SG, MY, JP, HK, LK, IN, US, CA, GB, UA, CH, SE, ES, SK, PT, RO, PL, NO, NL, LU, LT, LV, IE, IT, HU, GR, DE, FR, FI, EE, DK, CZ, HR, BG, BE, AT, AL", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } paypal = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,CL,CN,CO,CR,CU,CY,CZ,DE,DJ,DK,DO,DZ,EE,EG,ET,ES,FI,FJ,FR,GB,GE,GH,GI,GM,GR,GT,GY,HK,HN,HR,HU,ID,IE,IL,IN,IS,IT,JM,JO,JP,KE,KH,KR,KW,KY,KZ,LB,LK,LT,LV,LY,MA,MC,MD,ME,MG,MK,MN,MO,MT,MV,MW,MX,MY,NG,NI,NO,NP,NL,NZ,OM,PA,PE,PG,PH,PK,PL,PT,PY,QA,RO,RS,RU,RW,SA,SB,SC,SE,SG,SH,SI,SK,SL,SO,SM,SR,ST,SV,SY,TH,TJ,TN,TO,TR,TW,TZ,UA,UG,US,UY,UZ,VE,VA,VN,VU,WS,CF,AG,DM,GD,KN,LC,VC,YE,ZA,ZM", currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,GBP,GEL,GHS,GIP,GMD,GTQ,GYD,HKD,HNL,HRK,HUF,IDR,ILS,INR,ISK,JMD,JOD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,LYD,MAD,MDL,MGA,MKD,MNT,MOP,MVR,MWK,MXN,MYR,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STN,SVC,SYP,THB,TJS,TND,TOP,TRY,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,YER,ZAR,ZMW" } sepa = {country = "FR, IT, GR, BE, BG, FI, EE, HR, IE, DE, DK, LT, LV, MT, LU, AT, NL, PT, RO, PL, SK, SE, ES, SI, HU, CZ, CY, GB, LI, NO, IS, MC, CH, YT, PM, SM", currency="EUR"} -sepa_guarenteed_debit = {country = "AT, CH, DE", currency="EUR"} +sepa_guaranteed_debit = {country = "AT, CH, DE", currency="EUR"} [pm_filters.braintree] credit = { country = "AD,AT,AU,BE,BG,CA,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GG,GI,GR,HK,HR,HU,IE,IM,IT,JE,LI,LT,LU,LV,MT,MC,MY,NL,NO,NZ,PL,PT,RO,SE,SG,SI,SK,SM,US", currency = "AED,AMD,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CHF,CLP,CNY,COP,CRC,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,ISK,JMD,JPY,KES,KGS,KHR,KMF,KRW,KYD,KZT,LAK,LBP,LKR,LRD,LSL,MAD,MDL,MKD,MNT,MOP,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STD,SVC,SYP,SZL,THB,TJS,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"} diff --git a/src/app.rs b/src/app.rs index f14390d9..27970110 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,4 +1,5 @@ use crate::redis::commands::RedisConnectionWrapper; +use axum::http::HeaderValue; use axum::{ body::Body, extract::Request, @@ -6,7 +7,6 @@ use axum::{ response::Response, routing::{delete, get, post}, }; -use axum::http::HeaderValue; use axum_server::{tls_rustls::RustlsConfig, Handle}; use error_stack::ResultExt; use std::sync::Arc; @@ -272,18 +272,18 @@ where .layer(middleware::from_fn(ensure_request_id)) .layer( tower_trace::TraceLayer::new_for_http() - .make_span_with(|request: &Request<_>| utils::record_fields_from_header(request)) - .on_request(tower_trace::DefaultOnRequest::new().level(tracing::Level::INFO)) - .on_response( - tower_trace::DefaultOnResponse::new() - .level(tracing::Level::INFO) - .latency_unit(tower_http::LatencyUnit::Micros), - ) - .on_failure( - tower_trace::DefaultOnFailure::new() - .latency_unit(tower_http::LatencyUnit::Micros) - .level(tracing::Level::ERROR), - ), + .make_span_with(|request: &Request<_>| utils::record_fields_from_header(request)) + .on_request(tower_trace::DefaultOnRequest::new().level(tracing::Level::INFO)) + .on_response( + tower_trace::DefaultOnResponse::new() + .level(tracing::Level::INFO) + .latency_unit(tower_http::LatencyUnit::Micros), + ) + .on_failure( + tower_trace::DefaultOnFailure::new() + .latency_unit(tower_http::LatencyUnit::Micros) + .level(tracing::Level::ERROR), + ), ); let router = router diff --git a/src/bin/open_router.rs b/src/bin/open_router.rs index b96a0356..b2b29298 100644 --- a/src/bin/open_router.rs +++ b/src/bin/open_router.rs @@ -47,8 +47,5 @@ async fn main() -> Result<(), Box> { } fn log_startup_configuration(global_config: &open_router::config::GlobalConfig) { - logger::info!( - "Decision engine started [{:?}]", - global_config - ); + logger::info!("Decision engine started [{:?}]", global_config); } diff --git a/src/types/hybrid_routing.rs b/src/types/hybrid_routing.rs index c8b1368a..b2cd9c0b 100644 --- a/src/types/hybrid_routing.rs +++ b/src/types/hybrid_routing.rs @@ -1,5 +1,5 @@ -use crate::euclid::types::RoutingRequest; use crate::decider::gatewaydecider::types::DomainDeciderRequestForApiCallV2; +use crate::euclid::types::RoutingRequest; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] From 001e3d447761676aa2af3fc77dc7a0752e970966 Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Tue, 24 Mar 2026 18:30:37 +0530 Subject: [PATCH 70/95] fix: clippy (#217) --- src/feedback/gateway_elimination_scoring/flow.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feedback/gateway_elimination_scoring/flow.rs b/src/feedback/gateway_elimination_scoring/flow.rs index 97fcb8ae..5946598b 100644 --- a/src/feedback/gateway_elimination_scoring/flow.rs +++ b/src/feedback/gateway_elimination_scoring/flow.rs @@ -161,7 +161,7 @@ pub async fn updateKeyScoreForKeysFromConsumer( let _encoded_json = serde_json::to_string(&updated_cached_gateway_score).unwrap(); let elapsed_time = timestamp.saturating_sub(updated_cached_gateway_score.timestamp as u128); - let remaining_ttl = (hard_key_ttl as u128).saturating_sub(elapsed_time); + let remaining_ttl = hard_key_ttl.saturating_sub(elapsed_time); let safe_remaining_ttl = if remaining_ttl < 1000 { hard_key_ttl as i64 } else { From 55fe1e3c23d8e96af919abb1dae302dafebd8e98 Mon Sep 17 00:00:00 2001 From: Venkatesh <17565447+inventvenkat@users.noreply.github.com> Date: Sat, 28 Mar 2026 22:23:25 +0530 Subject: [PATCH 71/95] feat(helm): make busybox init containers configurable and optional (#218) --- helm-charts/templates/deployment.yaml | 12 ++++++++---- helm-charts/templates/mysql-migration-job.yaml | 5 ++++- helm-charts/templates/postgresql-migration-job.yaml | 5 ++++- helm-charts/templates/routing-config-job.yaml | 8 ++++++-- helm-charts/values.yaml | 4 ++++ 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/helm-charts/templates/deployment.yaml b/helm-charts/templates/deployment.yaml index a164299c..c5dbea8f 100644 --- a/helm-charts/templates/deployment.yaml +++ b/helm-charts/templates/deployment.yaml @@ -32,20 +32,24 @@ spec: initContainers: {{- if .Values.decisionEngine.usePostgreSQL }} - name: wait-for-postgresql - image: busybox:1.28 + image: "{{ .Values.initContainers.busybox.repository }}:{{ .Values.initContainers.busybox.tag }}" + imagePullPolicy: {{ .Values.initContainers.busybox.pullPolicy }} command: ['sh', '-c', 'until nc -z {{ include "decision-engine.postgresqlHost" . }} 5432; do echo waiting for postgresql; sleep 2; done;'] {{- end }} {{- if .Values.decisionEngine.useRedis }} - name: wait-for-redis - image: busybox:1.28 + image: "{{ .Values.initContainers.busybox.repository }}:{{ .Values.initContainers.busybox.tag }}" + imagePullPolicy: {{ .Values.initContainers.busybox.pullPolicy }} command: ['sh', '-c', 'until nc -z {{ include "decision-engine.redisHost" . }} 6379; do echo waiting for redis; sleep 2; done;'] {{- end }} - name: wait-for-groovy-runner - image: busybox:1.28 + image: "{{ .Values.initContainers.busybox.repository }}:{{ .Values.initContainers.busybox.tag }}" + imagePullPolicy: {{ .Values.initContainers.busybox.pullPolicy }} command: ['sh', '-c', 'until nc -z {{ include "decision-engine.groovyRunnerName" . }} {{ .Values.groovyRunner.service.port }}; do echo waiting for groovy-runner; sleep 2; done;'] {{- if .Values.decisionEngine.useMySQL }} - name: wait-for-mysql - image: busybox:1.28 + image: "{{ .Values.initContainers.busybox.repository }}:{{ .Values.initContainers.busybox.tag }}" + imagePullPolicy: {{ .Values.initContainers.busybox.pullPolicy }} command: ['sh', '-c', 'until nc -z {{ include "decision-engine.mysqlHost" . }} 3306; do echo waiting for mysql; sleep 2; done;'] {{- end }} {{- end }} diff --git a/helm-charts/templates/mysql-migration-job.yaml b/helm-charts/templates/mysql-migration-job.yaml index 97c412e3..85d52d5a 100644 --- a/helm-charts/templates/mysql-migration-job.yaml +++ b/helm-charts/templates/mysql-migration-job.yaml @@ -26,10 +26,13 @@ spec: serviceAccountName: {{ include "decision-engine.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.initContainers.enabled }} initContainers: - name: wait-for-mysql - image: busybox:1.28 + image: "{{ .Values.initContainers.busybox.repository }}:{{ .Values.initContainers.busybox.tag }}" + imagePullPolicy: {{ .Values.initContainers.busybox.pullPolicy }} command: ['sh', '-c', 'until nc -z {{ include "decision-engine.mysqlHost" . }} 3306; do echo waiting for mysql; sleep 2; done;'] + {{- end }} containers: - name: migration image: "debian:stable-slim" diff --git a/helm-charts/templates/postgresql-migration-job.yaml b/helm-charts/templates/postgresql-migration-job.yaml index ae561780..28d6488d 100644 --- a/helm-charts/templates/postgresql-migration-job.yaml +++ b/helm-charts/templates/postgresql-migration-job.yaml @@ -36,10 +36,13 @@ spec: serviceAccountName: {{ include "decision-engine.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.initContainers.enabled }} initContainers: - name: wait-for-postgresql - image: busybox:1.28 + image: "{{ .Values.initContainers.busybox.repository }}:{{ .Values.initContainers.busybox.tag }}" + imagePullPolicy: {{ .Values.initContainers.busybox.pullPolicy }} command: ['sh', '-c', 'until nc -z {{ include "decision-engine.postgresqlHost" . }} 5432; do echo waiting for postgresql; sleep 2; done;'] + {{- end }} containers: - name: migration image: rust:latest diff --git a/helm-charts/templates/routing-config-job.yaml b/helm-charts/templates/routing-config-job.yaml index 1a6becb4..467d4e24 100644 --- a/helm-charts/templates/routing-config-job.yaml +++ b/helm-charts/templates/routing-config-job.yaml @@ -26,17 +26,21 @@ spec: serviceAccountName: {{ include "decision-engine.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.initContainers.enabled }} initContainers: {{- if .Values.decisionEngine.usePostgreSQL }} - name: wait-for-postgresql - image: busybox:1.28 + image: "{{ .Values.initContainers.busybox.repository }}:{{ .Values.initContainers.busybox.tag }}" + imagePullPolicy: {{ .Values.initContainers.busybox.pullPolicy }} command: ['sh', '-c', 'until nc -z {{ include "decision-engine.postgresqlHost" . }} 5432; do echo waiting for postgresql; sleep 2; done;'] {{- end }} {{- if .Values.decisionEngine.useMySQL }} - name: wait-for-mysql - image: busybox:1.28 + image: "{{ .Values.initContainers.busybox.repository }}:{{ .Values.initContainers.busybox.tag }}" + imagePullPolicy: {{ .Values.initContainers.busybox.pullPolicy }} command: ['sh', '-c', 'until nc -z {{ include "decision-engine.mysqlHost" . }} 3306; do echo waiting for mysql; sleep 2; done;'] {{- end }} + {{- end }} containers: - name: routing-config image: "{{ .Values.routingConfig.image.repository }}:{{ .Values.routingConfig.image.tag }}" diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 434e724e..02dac507 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -30,6 +30,10 @@ podSecurityContext: {} initContainers: # Set to false to disable all init containers enabled: true + busybox: + repository: public.ecr.aws/docker/library/busybox + tag: "1.28" + pullPolicy: IfNotPresent securityContext: {} # capabilities: From 8c10da5058a421cb7b580b20876fc62c23ac34a2 Mon Sep 17 00:00:00 2001 From: Hangsai Date: Thu, 2 Apr 2026 12:44:55 +0530 Subject: [PATCH 72/95] [envs]: update envs for hyps compatibility (#223) Co-authored-by: bot4pk --- config/development.toml | 3 +++ helm-charts/config/development.toml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config/development.toml b/config/development.toml index 60cfcd67..7b07a2d8 100644 --- a/config/development.toml +++ b/config/development.toml @@ -111,6 +111,9 @@ order_udf1 = { type = "global_ref" } payment_payment_method = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } payment_payment_source = { type = "enum", values = "net.one97.paytm, @paytm" } txn_is_emi = { type = "enum", values = "true, false" } +transaction_initiator = { type = "enum", values = "customer, merchant" } +network_token = { type = "enum", values = "network_token" } +card_discovery = { type = "enum", values = "manual, saved_card, click_to_pay" } [debit_routing_config] fraud_check_fee = 1.0 diff --git a/helm-charts/config/development.toml b/helm-charts/config/development.toml index 60cfcd67..7b07a2d8 100644 --- a/helm-charts/config/development.toml +++ b/helm-charts/config/development.toml @@ -111,6 +111,9 @@ order_udf1 = { type = "global_ref" } payment_payment_method = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } payment_payment_source = { type = "enum", values = "net.one97.paytm, @paytm" } txn_is_emi = { type = "enum", values = "true, false" } +transaction_initiator = { type = "enum", values = "customer, merchant" } +network_token = { type = "enum", values = "network_token" } +card_discovery = { type = "enum", values = "manual, saved_card, click_to_pay" } [debit_routing_config] fraud_check_fee = 1.0 From 60c49044a7ba35ad22ba027e81b31aa8afbb9bc3 Mon Sep 17 00:00:00 2001 From: Hangsai Date: Thu, 2 Apr 2026 14:06:15 +0530 Subject: [PATCH 73/95] docs: modernize README with improved visual design (#222) Co-authored-by: bot4pk --- README.md | 256 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 220 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 8df9c155..dcaebd71 100644 --- a/README.md +++ b/README.md @@ -1,67 +1,251 @@ -# Decision Engine -## Overview +
-The Decision Engine system helps in choosing the most optimal payment gateway in real-time for every transaction based on pre-defined rules, success rate, latency and other business requirements. It is a fully modular service that can work with any orchestrator and any PCI-compliant vaults. +Rust +License +Docker +Release +Slack -## Vision +

-Build a reliable, open source payments software for the world \- which is interoperable, collaborative and community-driven. +# ⚡ Decision Engine -## Features +### **The Brain Behind Smarter Payments** -The Decision Engine comes with the following features out-of-the box for your payment routing needs. -✅ Eligibility Check – Ensures only eligible gateways are used, reducing payment failures and improving transaction success. +**Open-Source • High-Performance • ML-Powered** -📌 Rule-Based Ordering – Routes transactions based on predefined merchant rules, ensuring predictable and obligation-driven payment processing. +*Route payments intelligently. Maximize success rates. Zero vendor lock-in.* -🔄 Dynamic Gateway Ordering – Uses real-time success rates and ML-driven optimization to route transactions to the best-performing gateway. +--- -⚠️ Downtime Detection – Monitors gateway health, dynamically reordering or pausing routing to prevent transaction failures during downtime. +**[🚀 Quick Start](#-quick-start)** • +**[📚 Documentation](#-documentation)** • +**[🏗 Architecture](#-architecture)** • +**[🤝 Contributing](#-contributing)** -To learn more, refer to this blog: [https://juspay.io/blog/juspay-orchestrator-and-merchant-controlled-routing-engine](https://juspay.io/blog/juspay-orchestrator-and-merchant-controlled-routing-engine) +
+--- -## Architecture +## 🎯 What is Decision Engine? -![](https://cdn.sanity.io/images/9sed75bn/production/fd872ae5b086e7a60011ad9d4d5c7988e1084d03-1999x1167.png) +Decision Engine is a **high-performance payment gateway router** built in Rust that intelligently selects the optimal payment gateway for each transaction — in real-time. -### How it can fit into your existing architecture +``` +┌─────────────┐ ┌──────────────────┐ ┌─────────────┐ +│ Payment │────▶│ Decision Engine │────▶│ Best │ +│ Request │ │ (Routes in <1ms)│ │ Gateway │ +└─────────────┘ └──────────────────┘ └─────────────┘ +``` -image +### Why Teams Choose Decision Engine -## Try it out - - Check the [SETUP.md](/docs/setup-guide-mysql.md) for detailed steps to try out the application. +| 💥 The Problem | ✅ Our Solution | +|----------------|-----------------| +| Payment failures from gateway downtime | **Real-time health monitoring** with automatic failover | +| Suboptimal routing = lost revenue | **ML-driven routing** based on success rates & latency | +| Vendor lock-in limits flexibility | **Modular design** — works with any orchestrator | +| Complex rule management | **Flexible policies** — rule-based + ML hybrid | +--- +## ✨ Features -## API Reference : + + + + + +
-Check the [API_REFERENCE.md](/docs/api-reference1.md) for more details +### 🧠 Intelligent Routing +| Feature | What It Does | +|---------|--------------| +| **Eligibility Check** | Filters out ineligible gateways before routing | +| **Rule-Based Ordering** | Apply merchant-specific priority rules | +| **Dynamic Ordering** | ML optimizes gateway selection in real-time | +| **Downtime Detection** | Auto-pause failing gateways | -## Support, Feature Requests, Bugs + -For any support, join the conversation in [Slack](https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2jqxmpsbm-WXUENx022HjNEy~Ark7Orw) - -For new product features, enhancements, roadmap discussions, or to share queries and ideas, visit our [GitHub Discussions](https://github.com/juspay/decision-engine/discussions) +### 🛠 Built for Production -For reporting a bug, please read the issue guidelines and search for [existing and closed issues]. If your problem or idea is not addressed yet, please [open a new issue]. +| Capability | Details | +|------------|---------| +| **⚡ Blazing Fast** | Sub-millisecond routing decisions | +| **🔐 Memory Safe** | Built in Rust — no data races | +| **📊 Multi-DB** | MySQL & PostgreSQL support | +| **🐳 Docker Ready** | One-command deployment | +| **☸️ K8s Native** | Helm charts included | -[existing and closed issues]: https://github.com/juspay/decision-engine/issues -[open a new issue]: https://github.com/juspay/decision-engine/issues/new/choose - +
-## Contributing +--- -We welcome contributions from everyone\! Here's how you can help: +## 📊 Performance at a Glance -See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines. +
-## Versioning +| Metric | Value | +|--------|-------| +| Routing Decision Time | **< 1ms** | +| Memory Footprint | **~50MB** | +| Concurrent Requests | **100K+** | +| Uptime SLA Support | **99.99%** | -Check the [CHANGELOG.md](CHANGELOG.md) file for details. +
-## Copyright and License +--- -This product is licensed under the [AGPL V3](LICENSE) License. +## 🏃 Quick Start + +### 🐳 Docker (Recommended) + +```bash +# Clone and run +git clone https://github.com/juspay/decision-engine.git +cd decision-engine +docker compose up -d + +# That's it! API ready at http://localhost:8080 +``` + +### 🦀 From Source + +```bash +# Prerequisites: Rust 1.85+, MySQL/PostgreSQL, Redis + +git clone https://github.com/juspay/decision-engine.git +cd decision-engine +cargo build --release + +# Configure +cp config.example.toml config/development.toml +# Edit config with your settings + +# Run migrations & start +diesel migration run +./target/release/open_router +``` + +### ✅ Verify + +```bash +curl http://localhost:8080/health +# → {"status":"ok"} +``` + +--- + +## 📖 Documentation + +| 📘 Resource | Description | +|-------------|-------------| +| [MySQL Setup Guide](docs/setup-guide-mysql.md) | Step-by-step MySQL configuration | +| [PostgreSQL Setup Guide](docs/setup-guide-postgres.md) | Step-by-step PostgreSQL configuration | +| [API Reference](docs/api-reference1.md) | Complete REST API documentation | +| [Configuration Guide](docs/configuration.md) | All config options explained | +| [Deep Dive Blog](https://juspay.io/blog/juspay-orchestrator-and-merchant-controlled-routing-engine) | How routing logic works | + +--- + +## 🏗 Architecture + +### High-Level Flow + +
+ Decision Engine Architecture +
+ +### Integration Pattern + +Decision Engine integrates seamlessly into your existing payment stack: + +
+ Integration Pattern +
+ +**Integration Steps:** + +| Step | Direction | Component | Action | +|:----:|:---------:|-----------|--------| +| 1 | → | Your App | Initiates payment request | +| 2 | → | Orchestrator | Forwards to Decision Engine | +| 3 | → | Decision Engine | Selects optimal gateway | +| 4 | → | Vault | Returns card token (PCI-safe) | +| 5 | → | Gateway | Processes payment | +| 6 | ← | Gateway | Returns result | +| 7 | ← | Orchestrator | Routes response back | +| 8 | ← | Your App | Receives final result | + +**Key Benefits:** +- **Zero PCI scope** — Vault handles all card data +- **Drop-in integration** — Works with any orchestrator +- **Intelligent fallback** — Auto-switches on gateway failure + +--- + +## 🗺 Roadmap + +| Status | Feature | Description | +|:------:|---------|-------------| +| ✅ | Rule-based routing | Merchant-defined priority rules | +| ✅ | Dynamic ordering | ML-driven gateway selection | +| ✅ | Downtime detection | Automatic health monitoring | +| ✅ | Multi-database | MySQL & PostgreSQL support | +| 🔄 | Enhanced ML models | Better success rate prediction | +| 🔄 | Admin dashboard | Visual rule management UI | +| 📋 | Multi-tenant analytics | Per-tenant routing insights | +| 📋 | GraphQL API | Alternative query interface | + +--- + +## 🤝 Contributing + +We ❤️ contributions! + +```bash +# 1. Fork & clone +git clone https://github.com/YOUR_USERNAME/decision-engine.git + +# 2. Create branch +git checkout -b feature/your-feature + +# 3. Make changes & test +cargo test + +# 4. Submit PR! +``` + +👉 See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. + +🌱 **New to open source?** Check out [good first issues](https://github.com/juspay/decision-engine/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)! + +--- + +## 💬 Community + +| Platform | What It's For | +|----------|---------------| +| [![Slack](https://img.shields.io/badge/Slack-Join_Chat-4A154B?logo=slack)](https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2jqxmpsbm-WXUENx022HjNEy~Ark7Orw) | Real-time help, discussions | +| [GitHub Discussions](https://github.com/juspay/decision-engine/discussions) | Ideas, feature requests | +| [GitHub Issues](https://github.com/juspay/decision-engine/issues) | Bug reports | + +--- + +## 📜 License + +Licensed under [GNU AGPL v3.0](LICENSE). + +--- + +
+ +### Built with ❤️ by [Juspay](https://juspay.io) + +*Reliable, open-source payments infrastructure for the world.* + +**[⬆ Back to Top](#-decision-engine)** + +
From 6c93cf17fef1b20e676523eaf2426e26352f9d61 Mon Sep 17 00:00:00 2001 From: Hangsai Date: Sat, 4 Apr 2026 19:46:27 +0530 Subject: [PATCH 74/95] fix(docs): refactor readme.md (#225) Co-authored-by: bot4pk --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index dcaebd71..f003bcaf 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ### **The Brain Behind Smarter Payments** -**Open-Source • High-Performance • ML-Powered** +**Open-Source • High-Performance • Success Rate Based** *Route payments intelligently. Maximize success rates. Zero vendor lock-in.* @@ -34,7 +34,7 @@ Decision Engine is a **high-performance payment gateway router** built in Rust t ``` ┌─────────────┐ ┌──────────────────┐ ┌─────────────┐ │ Payment │────▶│ Decision Engine │────▶│ Best │ -│ Request │ │ (Routes in <1ms)│ │ Gateway │ +│ Request │ │ (Fast routing) │ │ Gateway │ └─────────────┘ └──────────────────┘ └─────────────┘ ``` @@ -43,9 +43,9 @@ Decision Engine is a **high-performance payment gateway router** built in Rust t | 💥 The Problem | ✅ Our Solution | |----------------|-----------------| | Payment failures from gateway downtime | **Real-time health monitoring** with automatic failover | -| Suboptimal routing = lost revenue | **ML-driven routing** based on success rates & latency | +| Suboptimal routing = lost revenue | **SR-based routing** based on success rates & latency | | Vendor lock-in limits flexibility | **Modular design** — works with any orchestrator | -| Complex rule management | **Flexible policies** — rule-based + ML hybrid | +| Complex rule management | **Flexible policies** — rule-based + SR-based hybrid | --- @@ -61,7 +61,7 @@ Decision Engine is a **high-performance payment gateway router** built in Rust t |---------|--------------| | **Eligibility Check** | Filters out ineligible gateways before routing | | **Rule-Based Ordering** | Apply merchant-specific priority rules | -| **Dynamic Ordering** | ML optimizes gateway selection in real-time | +| **Dynamic Ordering** | Success rate based gateway optimization | | **Downtime Detection** | Auto-pause failing gateways | @@ -71,7 +71,7 @@ Decision Engine is a **high-performance payment gateway router** built in Rust t | Capability | Details | |------------|---------| -| **⚡ Blazing Fast** | Sub-millisecond routing decisions | +| **⚡ Blazing Fast** | Fast routing decisions | | **🔐 Memory Safe** | Built in Rust — no data races | | **📊 Multi-DB** | MySQL & PostgreSQL support | | **🐳 Docker Ready** | One-command deployment | @@ -89,7 +89,7 @@ Decision Engine is a **high-performance payment gateway router** built in Rust t | Metric | Value | |--------|-------| -| Routing Decision Time | **< 1ms** | +| Routing Decision Time | **Low latency** | | Memory Footprint | **~50MB** | | Concurrent Requests | **100K+** | | Uptime SLA Support | **99.99%** | @@ -191,10 +191,10 @@ Decision Engine integrates seamlessly into your existing payment stack: | Status | Feature | Description | |:------:|---------|-------------| | ✅ | Rule-based routing | Merchant-defined priority rules | -| ✅ | Dynamic ordering | ML-driven gateway selection | +| ✅ | Dynamic ordering | SR-based gateway selection | | ✅ | Downtime detection | Automatic health monitoring | | ✅ | Multi-database | MySQL & PostgreSQL support | -| 🔄 | Enhanced ML models | Better success rate prediction | +| 🔄 | Enhanced routing models | Better success rate prediction | | 🔄 | Admin dashboard | Visual rule management UI | | 📋 | Multi-tenant analytics | Per-tenant routing insights | | 📋 | GraphQL API | Alternative query interface | From 1382d8f51a7fcc880984eb83dae18985eff4b42c Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Mon, 6 Apr 2026 22:22:07 +0530 Subject: [PATCH 75/95] refactor(euclid): payment_id for better logging (#226) --- src/euclid/handlers/routing_rules.rs | 6 ++++-- src/euclid/types.rs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index 47a67f73..3a1fd42d 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -262,8 +262,9 @@ pub async fn routing_evaluate( let state = get_tenant_app_state().await; logger::debug!( - "Received routing evaluation request for ID: {}", - payload.created_by + payment_id = ?payload.payment_id, + created_by = %payload.created_by, + "Received routing evaluation request" ); let update_failure_metrics = || { @@ -490,6 +491,7 @@ pub async fn routing_evaluate( ); let response = RoutingEvaluateResponse { + payment_id: payload.payment_id.clone(), status: match rule_name.as_deref() { Some("default_selection") | Some("default_fallback") => "default_selection".into(), Some(_) => "success".into(), diff --git a/src/euclid/types.rs b/src/euclid/types.rs index 2d4e3d6f..380c2a7b 100644 --- a/src/euclid/types.rs +++ b/src/euclid/types.rs @@ -59,6 +59,7 @@ pub enum AlgorithmType { #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] pub struct RoutingRequest { + pub payment_id: Option, pub created_by: String, pub fallback_output: Option>, pub parameters: HashMap>, @@ -117,6 +118,7 @@ pub const ELIGIBLE_DIMENSIONS: [&str; 5] = [ ]; #[derive(Debug, serde::Serialize)] pub struct RoutingEvaluateResponse { + pub payment_id: Option, pub status: String, pub output: serde_json::Value, pub evaluated_output: Vec, From 9e0b9ba0e90824d9153604bdb4a40911880561df Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Fri, 10 Apr 2026 16:19:26 +0530 Subject: [PATCH 76/95] feat(euclid): frontend changes (#229) Co-authored-by: tinu hareesswar --- .typos.toml | 2 + Dockerfile.docs | 12 + Makefile | 3 + config/docker-configuration.toml | 660 +++- decision-engine.postman_collection.json | 368 ++ docker-compose.override.yml | 29 + docker-compose.yaml | 221 +- docs/api-reference/contract.md | 393 -- docs/api-reference/elimination.md | 404 -- .../endpoint/activateRoutingRule.mdx | 4 + .../api-reference/endpoint/createMerchant.mdx | 4 + .../endpoint/createRoutingRule.mdx | 4 + .../endpoint/createRuleConfig.mdx | 4 + docs/api-reference/endpoint/decideGateway.mdx | 4 + .../api-reference/endpoint/deleteMerchant.mdx | 4 + .../endpoint/deleteRuleConfig.mdx | 4 + .../endpoint/evaluateRoutingRule.mdx | 4 + .../endpoint/getActiveRoutingRule.mdx | 4 + docs/api-reference/endpoint/getMerchant.mdx | 4 + docs/api-reference/endpoint/getRuleConfig.mdx | 4 + docs/api-reference/endpoint/healthCheck.mdx | 4 + .../endpoint/listRoutingRules.mdx | 4 + .../endpoint/updateGatewayScore.mdx | 4 + .../endpoint/updateRuleConfig.mdx | 4 + docs/api-reference/success-rate.md | 485 --- docs/introduction.mdx | 90 + docs/local-setup.md | 350 ++ docs/logo/dark.svg | 22 + docs/logo/light.svg | 22 + docs/mint.json | 73 + docs/openapi.json | 815 +++++ helm-charts/Chart.lock | 10 +- helm-charts/Chart.yaml | 6 +- helm-charts/charts/mysql-13.0.0.tgz | Bin 67931 -> 0 bytes helm-charts/charts/mysql-13.0.4.tgz | Bin 0 -> 67857 bytes helm-charts/charts/postgresql-12.5.9.tgz | Bin 56602 -> 0 bytes helm-charts/charts/postgresql-18.5.14.tgz | Bin 0 -> 89368 bytes helm-charts/charts/redis-17.11.8.tgz | Bin 92279 -> 0 bytes helm-charts/charts/redis-25.3.9.tgz | Bin 0 -> 104348 bytes helm-charts/config/development.toml | 8 +- nginx/nginx.conf | 54 + oneclick.sh | 107 + src/app.rs | 4 + src/euclid/handlers/routing_rules.rs | 31 + website/dist/assets/index-CT0UhhRt.js | 328 ++ website/dist/assets/index-D41MAvos.css | 1 + website/dist/index.html | 14 + website/index.html | 13 + website/package-lock.json | 3239 +++++++++++++++++ website/package.json | 36 + website/postcss.config.js | 6 + website/src/App.tsx | 26 + website/src/ErrorBoundary.tsx | 41 + website/src/components/layout/AppShell.tsx | 18 + website/src/components/layout/Sidebar.tsx | 94 + website/src/components/layout/TopBar.tsx | 87 + .../src/components/pages/DebitRoutingPage.tsx | 139 + .../components/pages/DecisionExplorerPage.tsx | 1211 ++++++ .../src/components/pages/EuclidRulesPage.tsx | 821 +++++ website/src/components/pages/OverviewPage.tsx | 178 + .../src/components/pages/RoutingHubPage.tsx | 121 + .../src/components/pages/SRRoutingPage.tsx | 482 +++ .../src/components/pages/VolumeSplitPage.tsx | 335 ++ website/src/components/ui/Badge.tsx | 23 + website/src/components/ui/Button.tsx | 38 + website/src/components/ui/Card.tsx | 32 + website/src/components/ui/ErrorMessage.tsx | 12 + website/src/components/ui/Spinner.tsx | 25 + website/src/hooks/useDynamicRoutingConfig.ts | 131 + website/src/index.css | 174 + website/src/lib/api.ts | 96 + website/src/lib/constants.ts | 95 + website/src/main.tsx | 46 + website/src/store/merchantStore.ts | 24 + website/src/types/api.ts | 145 + website/tailwind.config.ts | 32 + website/tsconfig.json | 21 + website/tsconfig.node.json | 10 + website/vite.config.ts | 143 + 79 files changed, 11068 insertions(+), 1398 deletions(-) create mode 100644 Dockerfile.docs create mode 100644 decision-engine.postman_collection.json create mode 100644 docker-compose.override.yml delete mode 100644 docs/api-reference/contract.md delete mode 100644 docs/api-reference/elimination.md create mode 100644 docs/api-reference/endpoint/activateRoutingRule.mdx create mode 100644 docs/api-reference/endpoint/createMerchant.mdx create mode 100644 docs/api-reference/endpoint/createRoutingRule.mdx create mode 100644 docs/api-reference/endpoint/createRuleConfig.mdx create mode 100644 docs/api-reference/endpoint/decideGateway.mdx create mode 100644 docs/api-reference/endpoint/deleteMerchant.mdx create mode 100644 docs/api-reference/endpoint/deleteRuleConfig.mdx create mode 100644 docs/api-reference/endpoint/evaluateRoutingRule.mdx create mode 100644 docs/api-reference/endpoint/getActiveRoutingRule.mdx create mode 100644 docs/api-reference/endpoint/getMerchant.mdx create mode 100644 docs/api-reference/endpoint/getRuleConfig.mdx create mode 100644 docs/api-reference/endpoint/healthCheck.mdx create mode 100644 docs/api-reference/endpoint/listRoutingRules.mdx create mode 100644 docs/api-reference/endpoint/updateGatewayScore.mdx create mode 100644 docs/api-reference/endpoint/updateRuleConfig.mdx delete mode 100644 docs/api-reference/success-rate.md create mode 100644 docs/introduction.mdx create mode 100644 docs/local-setup.md create mode 100644 docs/logo/dark.svg create mode 100644 docs/logo/light.svg create mode 100644 docs/mint.json create mode 100644 docs/openapi.json delete mode 100644 helm-charts/charts/mysql-13.0.0.tgz create mode 100644 helm-charts/charts/mysql-13.0.4.tgz delete mode 100644 helm-charts/charts/postgresql-12.5.9.tgz create mode 100644 helm-charts/charts/postgresql-18.5.14.tgz delete mode 100644 helm-charts/charts/redis-17.11.8.tgz create mode 100644 helm-charts/charts/redis-25.3.9.tgz create mode 100644 nginx/nginx.conf create mode 100755 oneclick.sh create mode 100644 website/dist/assets/index-CT0UhhRt.js create mode 100644 website/dist/assets/index-D41MAvos.css create mode 100644 website/dist/index.html create mode 100644 website/index.html create mode 100644 website/package-lock.json create mode 100644 website/package.json create mode 100644 website/postcss.config.js create mode 100644 website/src/App.tsx create mode 100644 website/src/ErrorBoundary.tsx create mode 100644 website/src/components/layout/AppShell.tsx create mode 100644 website/src/components/layout/Sidebar.tsx create mode 100644 website/src/components/layout/TopBar.tsx create mode 100644 website/src/components/pages/DebitRoutingPage.tsx create mode 100644 website/src/components/pages/DecisionExplorerPage.tsx create mode 100644 website/src/components/pages/EuclidRulesPage.tsx create mode 100644 website/src/components/pages/OverviewPage.tsx create mode 100644 website/src/components/pages/RoutingHubPage.tsx create mode 100644 website/src/components/pages/SRRoutingPage.tsx create mode 100644 website/src/components/pages/VolumeSplitPage.tsx create mode 100644 website/src/components/ui/Badge.tsx create mode 100644 website/src/components/ui/Button.tsx create mode 100644 website/src/components/ui/Card.tsx create mode 100644 website/src/components/ui/ErrorMessage.tsx create mode 100644 website/src/components/ui/Spinner.tsx create mode 100644 website/src/hooks/useDynamicRoutingConfig.ts create mode 100644 website/src/index.css create mode 100644 website/src/lib/api.ts create mode 100644 website/src/lib/constants.ts create mode 100644 website/src/main.tsx create mode 100644 website/src/store/merchantStore.ts create mode 100644 website/src/types/api.ts create mode 100644 website/tailwind.config.ts create mode 100644 website/tsconfig.json create mode 100644 website/tsconfig.node.json create mode 100644 website/vite.config.ts diff --git a/.typos.toml b/.typos.toml index f42b186a..3f79ac71 100644 --- a/.typos.toml +++ b/.typos.toml @@ -79,4 +79,6 @@ extend-exclude = [ # Exclude non-source files "*.groovy", "**/Untitled*", + # Exclude build artifacts + "website/dist/**", ] diff --git a/Dockerfile.docs b/Dockerfile.docs new file mode 100644 index 00000000..3fd22d88 --- /dev/null +++ b/Dockerfile.docs @@ -0,0 +1,12 @@ +FROM node:20-alpine + +ARG MINTLIFY_VERSION=4.0.0 +RUN npm install -g "mintlify@${MINTLIFY_VERSION}" + +WORKDIR /docs + +COPY docs/ . + +EXPOSE 3000 + +CMD ["mintlify", "dev", "--port", "3000", "--no-browser"] diff --git a/Makefile b/Makefile index b4d27525..eda82aa5 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,9 @@ init-local-pg-monitor: init-pg-monitor: docker-compose run --rm db-migrator-postgres && docker-compose up --build -d prometheus && docker-compose up --build -d grafana && docker-compose up --build open-router-pg +init-pg-local: + docker-compose run --rm db-migrator-postgres && docker-compose --profile local up open-router-pg + run-local: docker-compose up open-router-local diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index bc79e97d..ce4512d9 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -69,19 +69,61 @@ pool_max_idle_per_host = 10 identity = "" [routing_config.keys] -payment_method = { type = "enum", values = "card, bank_debit, bank_transfer" } -amount = { type = "integer" } +billing_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } +issuer_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } +business_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } +business_label = { type = "str_value" } metadata = { type = "udf" } -currency = { type = "enum", values = "USD, EUR, GBP, JPY, CAD, AUD" } +pay_later = { type = "enum", values = "affirm, alma, afterpay_clearpay, klarna, pay_bright, atome, walley" } +gift_card = { type = "enum", values = "givex, pay_safe_card" } +upi = { type = "enum", values = "upi_collect, upi_intent" } +wallet = { type = "enum", values = "amazon_pay, apple_pay, google_pay, paypal, ali_pay, ali_pay_hk, dana, mb_way, mobile_pay, samsung_pay, twint, vipps, touch_n_go, swish, we_chat_pay, go_pay, gcash, momo, kakao_pay, cashapp, mifinity, paze" } +voucher = { type = "enum", values = "boleto, efecty, pago_efectivo, red_compra, red_pagos, indomaret, alfamart, oxxo, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy" } +bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, multibanco, pix, pse, permata_bank_transfer, bca_bank_transfer, bni_va, bri_va, cimb_va, danamon_va, mandiri_va, local_bank_transfer, instant_bank_transfer" } +bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } +customer_device_display_size = { type = "enum", values = "size320x568, size375x667, size390x844, size414x896, size428x926, size768x1024, size834x1112, size834x1194, size1024x1366, size1280x720, size1366x768, size1440x900, size1920x1080, size2560x1440, size3840x2160, size500x600, size600x400, size360x640, size412x915, size800x1280" } +customer_device_type = { type = "enum", values = "mobile, tablet, desktop, gaming_console" } +customer_device_platform = { type = "enum", values = "web, android, ios" } +bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } +crypto = { type = "enum", values = "crypto_currency" } +reward = { type = "enum", values = "evoucher, classic_reward" } +card_redirect = { type = "enum", values = "knet, benefit, momo_atm, card_redirect" } +real_time_payment = { type = "enum", values = "fps, duit_now, prompt_pay, viet_qr" } +open_banking = { type = "enum", values = "open_banking_pis" } +mobile_payment = { type = "enum", values = "direct_carrier_billing" } +payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } +card_type = { type = "enum", values = "debit, credit" } +card = { type = "enum", values = "debit, credit" } +payment_card_bin = { type = "udf", exact_length = 6, regex = "^[0-9]{6}$" } +issuer_name = { type = "str_value", min_length = 1 } +payment_card_type = { type = "enum", values = "CREDIT, DEBIT" } +mandate_acceptance_type = { type = "enum", values = "online, offline" } +mandate_type = { type = "enum", values = "single_use, multi_use" } +card_network = { type = "enum", values = "visa, VISA, Visa, visaCard, mastercard, MASTERCARD, MasterCard, masterCard, mastercardCard, master_card, Master_card, Master_Card, Master Card, Mastercard, american_express, AMERICANEXPRESS, AmericanExpress, americanExpress, americanExpressCard, amex, AMEX, Amex, jcb, JCB, Jcb, diners_club, DINERSCLUB, DinersClub, dinersClub, dinersClubCard, discover, DISCOVER, Discover, discoverCard, cartes_bancaires, CARTESBANCAIRES, CartesBancaires, cartesBancaires, union_pay, UNIONPAY, UnionPay, unionPay, interac, INTERAC, Interac, rupay, RUPAY, RuPay, ruPay, maestro, MAESTRO, Maestro, star, STAR, Star, pulse, PULSE, Pulse, accel, ACCEL, Accel, nyce, NYCE, Nyce" } +payment_type = { type = "enum", values = "normal, new_mandate, setup_mandate, recurring_mandate, non_mandate" } +payment_method_type = { type = "enum", values = "ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, boleto, bca_bank_transfer, bni_va, bri_va, card, card_redirect, cimb_va, classic_reward, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eft, eps, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, multibanco, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, paypal, paze, pix, pay_safe_card, przelewy24, prompt_pay, pse, red_compra, red_pagos, samsung_pay, sepa, sepa_bank_transfer, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, direct_carrier_billing, instant_bank_transfer" } +authentication_type = { type = "enum", values = "three_ds, no_three_ds" } +capture_methods = { type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic" } +setup_future_usage = { type = "enum", values = "on_session, off_session" } +payment_card_network = { type = "enum", values = "visa, mastercard, american_express, jcb, diners_club, discover, cartes_bancaires, union_pay, interac, rupay, maestro" } +amount = { type = "integer", min = 0 } +login_date = { type = "str_value" } +currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +payment_card_issuer_country = { type = "enum", values = "AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, US" } + +card_bin = { type = "str_value", exact_length = 6, regex = "^[0-9]{6}$" } +extended_card_bin = { type = "str_value", exact_length = 8, regex = "^[0-9]{8}$" } +capture_method = { type = "enum", values = "automatic, manual" } +new_customer = { type = "udf" } +udf1 = { type = "str_value" } order_udf1 = { type = "global_ref" } -payment_methodType = { type = "enum", values = "CARD, UPI, NB" } -payment_cardBrand = { type = "enum", values = "VISA, MASTERCARD, AMEX, RUPAY, DINERS" } -payment_cardBin = { type = "global_ref" } -payment_cardType = { type = "enum", values = "CREDIT, DEBIT" } -payment_cardIssuerCountry = { type = "enum", values = "INDIA, US, UK, SINGAPORE" } -payment_paymentMethod = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } -payment_paymentSource = { type = "enum", values = "net.one97.paytm, @paytm" } -txn_isEmi = { type = "enum", values = "true, false" } +payment_payment_method = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } +payment_payment_source = { type = "enum", values = "net.one97.paytm, @paytm" } +txn_is_emi = { type = "enum", values = "true, false" } +transaction_initiator = { type = "enum", values = "customer, merchant" } +network_token = { type = "enum", values = "network_token" } +card_discovery = { type = "enum", values = "manual, saved_card, click_to_pay" } + [debit_routing_config] fraud_check_fee = 1.0 @@ -104,3 +146,599 @@ merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 4.0 } merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 21.3125 } merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 15.0 } merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 15.0 } + +[pm_filters.default] +google_pay = { country = "AL,DZ,AS,AO,AG,AR,AU,AT,AZ,BH,BY,BE,BR,BG,CA,CL,CO,HR,CZ,DK,DO,EG,EE,FI,FR,DE,GR,HK,HU,IN,ID,IE,IL,IT,JP,JO,KZ,KE,KW,LV,LB,LT,LU,MY,MX,NL,NZ,NO,OM,PK,PA,PE,PH,PL,PT,QA,RO,RU,SA,SG,SK,ZA,ES,LK,SE,CH,TW,TH,TR,UA,AE,GB,US,UY,VN" } +apple_pay = { country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US,KR,VN,MA,ZA,VA,CL,SV,GT,HN,PA", currency = "AED,AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" } +paypal = { currency = "AUD,BRL,CAD,CHF,CNY,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,MYR,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD" } +klarna = { country = "AT,BE,DK,FI,FR,DE,IE,IT,NL,NO,ES,SE,GB,US,CA", currency = "USD,GBP,EUR,CHF,DKK,SEK,NOK,AUD,PLN,CAD" } +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "US,CA,GB,AU,NZ", currency = "GBP,AUD,NZD,CAD,USD" } +giropay = { country = "DE", currency = "EUR" } +eps = { country = "AT", currency = "EUR" } +sofort = { country = "ES,GB,SE,AT,NL,DE,CH,BE,FR,FI,IT,PL", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } + +[pm_filters.stripe] +google_pay = { country = "AU, AT, BE, BR, BG, CA, HR, CZ, DK, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IT, JP, LV, KE, LT, LU, MY, MX, NL, NZ, NO, PL, PT, RO, SG, SK, ZA, ES, SE, CH, TH, AE, GB, US, GI, LI, MT, CY, PH, IS, AR, CL, KR, IL"} +apple_pay = { country = "AU, AT, BE, BR, BG, CA, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, HK, IE, IT, JP, LV, LI, LT, LU, MT, MY, MX, NL, NZ, NO, PL, PT, RO, SK, SG, SI, ZA, ES, SE, CH, GB, AE, US" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,CAD,CHF,CZK,DKK,EUR,GBP,NOK,NZD,PLN,SEK,USD" } +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,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ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"} +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "US,CA,GB,AU,NZ,FR,ES", currency = "USD,CAD,GBP,AUD,NZD" } +cashapp = { country = "US", currency = "USD" } +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +multibanco = { country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GI,GR,HU,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB", currency = "EUR" } +ach = { country = "US", currency = "USD" } +revolut_pay = { currency = "EUR,GBP" } +sepa = {country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GI,GR,HU,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB,IS,LI", currency="EUR"} +bacs = { country = "GB", currency = "GBP" } +becs = { country = "AU", currency = "AUD" } +sofort = {country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IS,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE", currency = "EUR" } +blik = {country="PL", currency = "PLN"} +bancontact_card = { country = "BE", currency = "EUR" } +przelewy24 = { country = "PL", currency = "EUR,PLN" } +online_banking_fpx = { country = "MY", currency = "MYR" } +amazon_pay = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW,US", currency = "USD,AUD,GBP,DKK,EUR,HKD,JPY,NZD,NOK,ZAR,SEK,CHF" } +we_chat_pay = { country = "CN", currency = "CNY,AUD,CAD,EUR,GBP,HKD,JPY,SGD,USD,DKK,NOK,SEK,CHF" } +ali_pay = {country = "CN", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,MYR,NZD,SGD,USD"} + +[pm_filters.volt] +open_banking = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "GBP,EUR,DKK,NOK,PLN,SEK" } +open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "GBP" } + +[pm_filters.razorpay] +upi_collect = { country = "IN", currency = "INR" } + +[pm_filters.phonepe] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } + +[pm_filters.paytm] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } + +[pm_filters.hyperpg] +credit = { currency = "INR,USD,GBP,EUR" } +debit = { currency = "INR,USD,GBP,EUR" } + +[pm_filters.plaid] +open_banking_pis = { currency = "EUR,GBP" } + +[pm_filters.adyen] +google_pay = { country = "AT, AU, BE, BG, CA, HR, CZ, EE, FI, FR, DE, GR, HK, DK, HU, IE, IT, LV, LT, LU, NL, NO, PL, PT, RO, SK, ES, SE, CH, GB, US, NZ, SG", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, GG, HU, IE, IM, IT, LV, LI, LT, LU, MT, NL, NO, PL, PT, RO, SK, SI, SE, ES, CH, GB, US, PR, CA, AU, HK, NZ, SG", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, CHF, UAH, ARS, BRL, CLP, COP, CRC, DOP, GTQ, HNL, MXN, PAB, USD, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, ILS, QAR, SAR, AED, CAD" } +paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" } +mobile_pay = { country = "DK,FI", currency = "DKK,SEK,NOK,EUR" } +ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" } +we_chat_pay = { country = "AU,NZ,CN,JP,HK,SG,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,LI,MT,SI,GR,PT,IT,CA,US", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,NZD,SGD,USD" } +mb_way = { country = "PT", currency = "EUR" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD" } +affirm = { country = "US", currency = "USD" } +afterpay_clearpay = { country = "AU,NZ,ES,GB,FR,IT,CA,US", currency = "GBP" } +pay_bright = { country = "CA", currency = "CAD" } +walley = { country = "SE,NO,DK,FI", currency = "DKK,EUR,NOK,SEK" } +giropay = { country = "DE", currency = "EUR" } +eps = { country = "AT", currency = "EUR" } +sofort = { not_available_flows = { capture_method = "manual" }, country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR" } +ideal = { not_available_flows = { capture_method = "manual" }, country = "NL", currency = "EUR" } +blik = { country = "PL", currency = "PLN" } +trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +online_banking_czech_republic = { country = "CZ", currency = "EUR,CZK" } +online_banking_finland = { country = "FI", currency = "EUR" } +online_banking_poland = { country = "PL", currency = "PLN" } +online_banking_slovakia = { country = "SK", currency = "EUR,CZK" } +bancontact_card = { country = "BE", currency = "EUR" } +ach = { country = "US", currency = "USD" } +bacs = { country = "GB", currency = "GBP" } +sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR" } +ali_pay_hk = { country = "HK", currency = "HKD" } +bizum = { country = "ES", currency = "EUR" } +go_pay = { country = "ID", currency = "IDR" } +kakao_pay = { country = "KR", currency = "KRW" } +momo = { country = "VN", currency = "VND" } +gcash = { country = "PH", currency = "PHP" } +online_banking_fpx = { country = "MY", currency = "MYR" } +online_banking_thailand = { country = "TH", currency = "THB" } +touch_n_go = { country = "MY", currency = "MYR" } +atome = { country = "MY,SG", currency = "MYR,SGD" } +swish = { country = "SE", currency = "SEK" } +permata_bank_transfer = { country = "ID", currency = "IDR" } +bca_bank_transfer = { country = "ID", currency = "IDR" } +bni_va = { country = "ID", currency = "IDR" } +bri_va = { country = "ID", currency = "IDR" } +cimb_va = { country = "ID", currency = "IDR" } +danamon_va = { country = "ID", currency = "IDR" } +mandiri_va = { country = "ID", currency = "IDR" } +alfamart = { country = "ID", currency = "IDR" } +indomaret = { country = "ID", currency = "IDR" } +open_banking_uk = { country = "GB", currency = "GBP" } +oxxo = { country = "MX", currency = "MXN" } +pay_safe_card = { country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,AE,GB,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU" } +seven_eleven = { country = "JP", currency = "JPY" } +lawson = { country = "JP", currency = "JPY" } +mini_stop = { country = "JP", currency = "JPY" } +family_mart = { country = "JP", currency = "JPY" } +seicomart = { country = "JP", currency = "JPY" } +pay_easy = { country = "JP", currency = "JPY" } +pix = { country = "BR", currency = "BRL" } +boleto = { country = "BR", currency = "BRL" } + +[pm_filters.affirm] +affirm = { country = "CA,US", currency = "CAD,USD" } + +[pm_filters.airwallex] +credit = { country = "AU,HK,SG,NZ,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +debit = { country = "AU,HK,SG,NZ,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AZ, BH, BR, BG, CA, CL, CO, CZ, DK, DO, EG, HK, HU, ID, IL, JP, JO, KZ, KE, KW, LB, MY, MX, OM, PK, PA, PE, PH, PL, QA, RO, SA, SG, ZA, LK, SE, TW, TH, TR, UA, AE, UY, VN, AT, BE, HR, EE, FI, FR, DE, GR, IE, IT, LV, LT, LU, NL, PL, PT, SK, ES, SE, RO, BG", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +paypal = { currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,JPY,MYR,MXN,NOK,NZD,PHP,PLN,GBP,RUB,SGD,SEK,CHF,THB,USD" } +klarna = { currency = "EUR, DKK, NOK, PLN, SEK, CHF, GBP, USD, CZK" } +trustly = {currency="DKK, EUR, GBP, NOK, PLN, SEK" } +blik = { country="PL" , currency = "PLN" } +ideal = { country="NL" , currency = "EUR" } +atome = { country = "SG, MY" , currency = "SGD, MYR" } +skrill = { country="AL, DZ, AD, AR, AM, AW, AU, AT, AZ, BS, BD, BE, BJ, BO, BA, BW, BR, BN, BG, KH, CM, CA, CL, CN, CX, CO, CR , HR, CW, CY, CZ, DK, DM, DO, EC, EG, EE , FK, FI, GE, DE, GH, GI, GR, GP, GU, GT, GG, HK, HU, IS, IN, ID , IQ, IE, IM, IL, IT, JE , KZ, KE , KR, KW, KG, LV , LS, LI, LT, LU , MK, MG, MY, MV, MT, MU, YT, MX, MD, MC, MN, ME, MA, NA, NP, NZ, NI, NE, NO, PK , PA, PY, PE, PH, PL, PT, PR, QA, RO , SM , SA, SN , SG, SX, SK, SI, ZA, SS, ES, LK, SE, CH, TW, TZ, TH, TN, AE, GB, UM, UY, VN, VG, VI, US" , currency = "EUR, GBP, USD" } +indonesian_bank_transfer = { country="ID" , currency = "IDR" } + +[pm_filters.elavon] +credit = { country = "US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,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TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } + +[pm_filters.xendit] +credit = { country = "ID,PH", currency = "IDR,PHP,USD,SGD,MYR" } +debit = { country = "ID,PH", currency = "IDR,PHP,USD,SGD,MYR" } +qris = {currency = "IDR" } + +[pm_filters.tsys] +credit = { country = "NA", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL, BYN, KPW, STN, MRU, VES" } +debit = { country = "NA", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL, BYN, KPW, STN, MRU, VES" } + +[pm_filters.billwerk] +credit = { country = "DE, DK, FR, SE", currency = "DKK, NOK" } +debit = { country = "DE, DK, FR, SE", currency = "DKK, NOK" } + +[pm_filters.fiservemea] +credit = { country = "DE, FR, IT, NL, PL, ES, ZA, GB, AE", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +debit = { country = "DE, FR, IT, NL, PL, ES, ZA, GB, AE", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } + +[pm_filters.getnet] +credit = { country = "AR, BR, CL, MX, UY, ES, PT, DE, IT, FR, NL, BE, AT, PL, CH, GB, IE, LU, DK, SE, NO, FI, IN, AE", currency = "ARS, BRL, CLP, MXN, UYU, EUR, PLN, CHF, GBP, DKK, SEK, NOK, INR, AED" } + +[pm_filters.hipay] +credit = { country = "GB, CH, SE, DK, NO, PL, CZ, US, CA, JP, HK, AU, ZA", currency = "EUR, GBP, CHF, SEK, DKK, NOK, PLN, CZK, USD, CAD, JPY, HKD, AUD, ZAR" } +debit = { country = "GB, CH, SE, DK, NO, PL, CZ, US, CA, JP, HK, AU, ZA", currency = "EUR, GBP, CHF, SEK, DKK, NOK, PLN, CZK, USD, CAD, JPY, HKD, AUD, ZAR" } + +[pm_filters.moneris] +credit = { country = "AE, AF, AL, AO, AR, AT, AU, AW, AZ, BA, BB, BD, BE, BG, BH, BI, BM, BN, BO, BR, BT, BY, BZ, CH, CL, CN, CO, CR, CU, CV, CY, CZ, DE, DJ, DK, DO, DZ, EE, EG, ES, FI, FJ, FR, GB, GE, GI, GM, GN, GR, GT, GY, HK, HN, HR, HT, HU, ID, IE, IL, IN, IS, IT, JM, JO, JP, KE, KM, KR, KW, KY, KZ, LA, LK, LR, LS, LV, LT, LU, MA, MD, MG, MK, MO, MR, MT, MU, MV, MW, MX, MY, MZ, NA, NG, NI, NL, NO, NP, NZ, OM, PE, PG, PK, PL, PT, PY, QA, RO, RS, RU, RW, SA, SB, SC, SE, SG, SH, SI, SK, SL, SR, SV, SZ, TH, TJ, TM, TN, TR, TT, TW, TZ, UG, US, UY, UZ, VN, VU, WS, ZA, ZM", currency = "AED, AFN, ALL, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BTN, BYN, BZD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GEL, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JOD, JPY, KES, KMF, KRW, KWD, KYD, KZT, LAK, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SRD, SVC, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VND, VUV, WST, XCD, XOF, XPF, ZAR, ZMW" } +debit = { country = "AE, AF, AL, AO, AR, AT, AU, AW, AZ, BA, BB, BD, BE, BG, BH, BI, BM, BN, BO, BR, BT, BY, BZ, CH, CL, CN, CO, CR, CU, CV, CY, CZ, DE, DJ, DK, DO, DZ, EE, EG, ES, FI, FJ, FR, GB, GE, GI, GM, GN, GR, GT, GY, HK, HN, HR, HT, HU, ID, IE, IL, IN, IS, IT, JM, JO, JP, KE, KM, KR, KW, KY, KZ, LA, LK, LR, LS, LV, LT, LU, MA, MD, MG, MK, MO, MR, MT, MU, MV, MW, MX, MY, MZ, NA, NG, NI, NL, NO, NP, NZ, OM, PE, PG, PK, PL, PT, PY, QA, RO, RS, RU, RW, SA, SB, SC, SE, SG, SH, SI, SK, SL, SR, SV, SZ, TH, TJ, TM, TN, TR, TT, TW, TZ, UG, US, UY, UZ, VN, VU, WS, ZA, ZM", currency = "AED, AFN, ALL, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BTN, BYN, BZD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GEL, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JOD, JPY, KES, KMF, KRW, KWD, KYD, KZT, LAK, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SRD, SVC, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VND, VUV, WST, XCD, XOF, XPF, ZAR, ZMW" } + +[pm_filters.opennode] +crypto_currency = { country = "US, CA, GB, AU, BR, MX, SG, PH, NZ, ZA, JP, AT, BE, HR, CY, EE, FI, FR, DE, GR, IE, IT, LV, LT, LU, MT, NL, PT, SK, SI, ES", currency = "USD, CAD, GBP, AUD, BRL, MXN, SGD, PHP, NZD, ZAR, JPY, EUR" } + +[pm_filters.bambora] +credit = { country = "US,CA", currency = "USD" } +debit = { country = "US,CA", currency = "USD" } + +[pm_filters.bankofamerica] +credit = { country = "AF,AL,DZ,AD,AO,AI,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BA,BW,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CO,KM,CD,CG,CK,CR,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MG,MW,MY,MV,ML,MT,MH,MR,MU,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PL,PT,PR,QA,CG,RO,RW,KN,LC,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SO,ZA,GS,ES,LK,SR,SJ,SZ,SE,CH,TW,TJ,TZ,TH,TL,TG,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UY,UZ,VU,VE,VN,VG,WF,YE,ZM,ZW", currency = "USD" } +debit = { country = "AF,AL,DZ,AD,AO,AI,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,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ZA,KR,ES,SE,CH,TW,AE,GB,US,UY,VN,VA", currency = "USD" } +samsung_pay = { country = "AU,BH,BR,CA,CN,DK,FI,FR,DE,HK,IN,IT,JP,KZ,KR,KW,MY,NZ,NO,OM,QA,SA,SG,ZA,ES,SE,CH,TW,AE,GB,US", currency = "USD" } + +[pm_filters.cybersource] +credit = { currency = "USD,GBP,EUR,PLN,SEK,XOF,CAD,KWD,QAR" } +debit = { currency = "USD,GBP,EUR,PLN,SEK,XOF,CAD,KWD,QAR" } +apple_pay = { currency = "ARS, CAD, CLP, COP, CNY, EUR, HKD, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, GBP, AED, USD, PLN, SEK" } +google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" } +samsung_pay = { currency = "USD,GBP,EUR,SEK" } +paze = { currency = "USD,SEK" } + +[pm_filters.barclaycard] +credit = { currency = "USD,GBP,EUR,PLN,SEK" } +debit = { currency = "USD,GBP,EUR,PLN,SEK" } +google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" } +apple_pay = { currency = "ARS, CAD, CLP, COP, CNY, EUR, HKD, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, GBP, AED, USD, PLN, SEK" } + + +[pm_filters.globepay] +ali_pay = { country = "GB",currency = "GBP,CNY" } +we_chat_pay = { country = "GB",currency = "GBP,CNY" } + + +[pm_filters.itaubank] +pix = { country = "BR", currency = "BRL" } + +[pm_filters.nexinets] +credit = { country = "DE",currency = "EUR" } +debit = { country = "DE",currency = "EUR" } +ideal = { country = "DE",currency = "EUR" } +giropay = { country = "DE",currency = "EUR" } +sofort = { country = "DE",currency = "EUR" } +eps = { country = "DE",currency = "EUR" }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Y,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } +giropay = { currency = "EUR" } +ideal = { currency = "EUR" } +sofort = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } +eps = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } +apple_pay = { country = "AU,AT,BY,BE,BR,BG,CA,CN,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HK,HU,IS,IE,IM,IL,IT,JP,JE,KZ,LV,LI,LT,LU,MO,MT,MC,NL,NZ,NO,PL,PT,RO,RU,SM,SA,S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BD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +google_pay = { country = "AL,DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, CA, BG, CL, CO, HR, DK, DO, EE, EG, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, SA, SG, SK, ZA, ES, LK, SE, CH, TH, TW, TR, UA, AE, US, UY, VN", currency = "AED, ALL, AOA, AUD, AZN, BGN, BHD, BRL, CAD, CHF, CLP, COP, CZK, DKK, DOP, DZD, EGP, EUR, GBP, HKD, HUF, IDR, ILS, INR, JPY, KES, KWD, KZT, LKR, MXN, MYR, NOK, NZD, OMR, PAB, PEN, PHP, PKR, PLN, QAR, RON, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, UYU, VND, XCD, ZAR" } +apple_pay = { country = "AM,US, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" } + +[pm_filters.checkbook] +ach = { country = "US", currency = "USD" } + +[pm_filters.nexixpay] +credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU,AU,BR,US", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" } +debit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU,AU,BR,US", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,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MD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW" } + +[pm_filters.iatapay] +upi_collect = { country = "IN", currency = "INR" } +upi_intent = { country = "IN", currency = "INR" } +ideal = { country = "NL", currency = "EUR" } +local_bank_redirect = { country = "AT,BE,EE,FI,FR,DE,IE,IT,LV,LT,LU,NL,PT,ES,GB,IN,HK,SG,TH,BR,MX,GH,VN,MY,PH,JO,AU,CO", currency = "EUR,GBP,INR,HKD,SGD,THB,BRL,MXN,GHS,VND,MYR,PHP,JOD,AUD,COP" } +duit_now = { country = "MY", currency = "MYR" } +fps = { country = "GB", currency = "GBP" } +prompt_pay = { country = "TH", currency = "THB" } +viet_qr = { country = "VN", currency = "VND" } + +[pm_filters.coinbase] +crypto_currency = { country = "ZA,US,BR,CA,TR,SG,VN,GB,DE,FR,ES,PT,IT,NL,AU" } + +[pm_filters.novalnet] +credit = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,CL,CN,CO,CR,CU,CY,CZ,DE,DJ,DK,DO,DZ,EE,EG,ET,ES,FI,FJ,FR,GB,GE,GH,GI,GM,GR,GT,GY,HK,HN,HR,HU,ID,IE,IL,IN,IS,IT,JM,JO,JP,KE,KH,KR,KW,KY,KZ,LB,LK,LT,LV,LY,MA,MC,MD,ME,MG,MK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H,PK,PL,PT,PY,QA,RO,RS,RU,RW,SA,SB,SC,SE,SG,SH,SI,SK,SL,SO,SM,SR,ST,SV,SY,TH,TJ,TN,TO,TR,TW,TZ,UA,UG,US,UY,UZ,VE,VA,VN,VU,WS,CF,AG,DM,GD,KN,LC,VC,YE,ZA,ZM", currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,GBP,GEL,GHS,GIP,GMD,GTQ,GYD,HKD,HNL,HRK,HUF,IDR,ILS,INR,ISK,JMD,JOD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,LYD,MAD,MDL,MGA,MKD,MNT,MOP,MVR,MWK,MXN,MYR,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STN,SVC,SYP,THB,TJS,TND,TOP,TRY,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,YER,ZAR,ZMW" } +apple_pay = { country = "EG, MA, ZA, CN, HK, JP, MY, MN, SG, KR, VN, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, GE, DE, GR, GL, HU, IS, IE, IT, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, CA, US, BH, IL, JO, KW, OM, QA, SA, AE, AR, BR, CL, CO, CR, SV, GT, MX, PY, PE, UY, BS, DO, AM, KZ, NZ", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, AZN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } +google_pay = { country = "AO, EG, KE, ZA, AR, BR, CL, CO, MX, PE, UY, AG, DO, AE, TR, SA, QA, OM, LB, KW, JO, IL, BH, KZ, VN, TH, SG, MY, JP, HK, LK, IN, US, CA, GB, UA, CH, SE, ES, SK, PT, RO, PL, NO, NL, LU, LT, LV, IE, IT, HU, GR, DE, FR, FI, EE, DK, CZ, HR, BG, BE, AT, AL", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +paypal = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,CL,CN,CO,CR,CU,CY,CZ,DE,DJ,DK,DO,DZ,EE,EG,ET,ES,FI,FJ,FR,GB,GE,GH,GI,GM,GR,GT,GY,HK,HN,HR,HU,ID,IE,IL,IN,IS,IT,JM,JO,JP,KE,KH,KR,KW,KY,KZ,LB,LK,LT,LV,LY,MA,MC,MD,ME,MG,MK,MN,MO,MT,MV,MW,MX,MY,NG,NI,NO,NP,NL,NZ,OM,PA,PE,PG,PH,PK,PL,PT,PY,QA,RO,RS,RU,RW,SA,SB,SC,SE,SG,SH,SI,SK,SL,SO,SM,SR,ST,SV,SY,TH,TJ,TN,TO,TR,TW,TZ,UA,UG,US,UY,UZ,VE,VA,VN,VU,WS,CF,AG,DM,GD,KN,LC,VC,YE,ZA,ZM", currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,GBP,GEL,GHS,GIP,GMD,GTQ,GYD,HKD,HNL,HRK,HUF,IDR,ILS,INR,ISK,JMD,JOD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,LYD,MAD,MDL,MGA,MKD,MNT,MOP,MVR,MWK,MXN,MYR,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STN,SVC,SYP,THB,TJS,TND,TOP,TRY,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,YER,ZAR,ZMW" } +sepa = {country = "FR, IT, GR, BE, BG, FI, EE, HR, IE, DE, DK, LT, LV, MT, LU, AT, NL, PT, RO, PL, SK, SE, ES, SI, HU, CZ, CY, GB, LI, NO, IS, MC, CH, YT, PM, SM", currency="EUR"} +sepa_guaranteed_debit = {country = "AT, CH, DE", currency="EUR"} + +[pm_filters.braintree] +credit = { country = "AD,AT,AU,BE,BG,CA,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GG,GI,GR,HK,HR,HU,IE,IM,IT,JE,LI,LT,LU,LV,MT,MC,MY,NL,NO,NZ,PL,PT,RO,SE,SG,SI,SK,SM,US", currency = "AED,AMD,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CHF,CLP,CNY,COP,CRC,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,ISK,JMD,JPY,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GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" } +apple_pay = { currency = "USD, CAD" } + +[pm_filters.helcim] +credit = { country = "US, CA", currency = "USD, CAD" } +debit = { country = "US, CA", currency = "USD, CAD" } + +[pm_filters.globalpay] +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,SZ,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,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N,KPW,NOK,TOP,PKR,MOP,UYU,PHP,GBP,BWP,QAR,GTQ,ZAR,OMR,KHR,RON,MVR,IDR,RUB,RWF,SHP,SAR,RSD,SCR,SGD,PEN,SBD,KGS,SOS,TJS,SSP,LKR,SDG,SRD,SEK,CHF,SYP,BDT,WST,TZS,KZT,TTD,MNT,TND,TRY,TMT,AED,UGX,USD,UZS,VUV,KRW,YER,JPY,CNY,ZMW,ZWL,PLN,CLF,STD,CUC" } +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +sofort = { country = "AT,BE,DE,ES,IT,NL", currency = "EUR" } + +[pm_filters.jpmorgan] +debit = { country = "CA, GB, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, EUR, GBP, AUD, NZD, SGD, CAD, JPY, HKD, KRW, TWD, MXN, BRL, DKK, NOK, ZAR, SEK, CHF, CZK, PLN, TRY, AFN, ALL, DZD, AOA, ARS, AMD, AWG, AZN, BSD, BDT, BBD, BYN, BZD, BMD, BOB, BAM, BWP, BND, BGN, BIF, BTN, XOF, XAF, XPF, KHR, CVE, KYD, CLP, CNY, COP, KMF, CDF, CRC, HRK, DJF, DOP, XCD, EGP, ETB, FKP, FJD, GMD, GEL, GHS, GIP, GTQ, GYD, HTG, HNL, HUF, ISK, INR, IDR, ILS, JMD, KZT, KES, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRU, MUR, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, PGK, NIO, NGN, PKR, PAB, PYG, PEN, PHP, QAR, RON, RWF, SHP, WST, STN, SAR, RSD, SCR, SLL, SBD, SOS, LKR, SRD, SZL, TJS, TZS, THB, TOP, TTD, UGX, UAH, AED, UYU, UZS, VUV, VND, YER, ZMW" } +credit = { country = "CA, GB, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, EUR, GBP, AUD, NZD, SGD, CAD, JPY, HKD, KRW, TWD, MXN, BRL, DKK, NOK, ZAR, SEK, CHF, CZK, PLN, TRY, AFN, ALL, DZD, AOA, ARS, AMD, AWG, AZN, BSD, BDT, BBD, BYN, BZD, BMD, BOB, BAM, BWP, BND, BGN, BIF, BTN, XOF, XAF, XPF, KHR, CVE, KYD, CLP, CNY, COP, KMF, CDF, CRC, HRK, DJF, DOP, XCD, EGP, ETB, FKP, FJD, GMD, GEL, GHS, GIP, GTQ, GYD, HTG, HNL, HUF, ISK, INR, IDR, ILS, JMD, KZT, KES, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRU, MUR, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, PGK, NIO, NGN, PKR, PAB, PYG, PEN, PHP, QAR, RON, RWF, SHP, WST, STN, SAR, RSD, SCR, SLL, SBD, SOS, LKR, SRD, SZL, TJS, TZS, THB, TOP, TTD, UGX, UAH, AED, UYU, UZS, VUV, VND, YER, ZMW" } + +[pm_filters.bitpay] +crypto_currency = { country = "US, CA, GB, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, AUD, CAD, GBP, MXN, NZD, CHF, EUR"} + +[pm_filters.paybox] +debit = { country = "FR", currency = "CAD, AUD, EUR, USD" } +credit = { country = "FR", currency = "CAD, AUD, EUR, USD" } + +[pm_filters.payload] +debit = { currency = "USD,CAD" } +credit = { currency = "USD,CAD" } +ach = { currency = "USD,CAD" } + + +[pm_filters.digitalvirgo] +direct_carrier_billing = {country = "MA, CM, ZA, EG, SN, DZ, TN, ML, GN, GH, LY, GA, CG, MG, BW, SD, NG, ID, SG, AZ, TR, FR, ES, PL, GB, PT, DE, IT, BE, IE, SK, GR, NL, CH, BR, MX, AR, CL, AE, IQ, KW, BH, SA, QA, PS, JO, OM, RU" , currency = "MAD, XOF, XAF, ZAR, EGP, DZD, TND, GNF, GHS, LYD, XAF, CDF, MGA, BWP, SDG, NGN, IDR, SGD, RUB, AZN, TRY, EUR, PLN, GBP, CHF, BRL, MXN, ARS, CLP, AED, IQD, KWD, BHD, SAR, QAR, ILS, JOD, OMR" } + +[pm_filters.payu] +debit = { country = "AE, AF, AL, AM, CW, AO, AR, AU, AW, AZ, BA, BB, BG, BH, BI, BM, BN, BO, BR, BS, BW, BY, BZ, CA, CD, LI, CL, CN, CO, CR, CV, CZ, DJ, DK, DO, DZ, EG, ET, AD, FJ, FK, GG, GE, GH, GI, GM, GN, GT, GY, HK, HN, HR, HT, HU, ID, IL, IQ, IS, JM, JO, JP, KG, KH, KM, KR, KW, KY, KZ, LA, LB, LR, LS, MA, MD, MG, MK, MN, MO, MR, MV, MW, MX, MY, MZ, NA, NG, NI, BV, CK, OM, PA, PE, PG, PL, PY, QA, RO, RS, RW, SA, SB, SC, SE, SG, SH, SO, SR, SV, SZ, TH, TJ, TM, TN, TO, TR, TT, TW, TZ, UG, AS, UY, UZ, VE, VN, VU, WS, CM, AI, BJ, PF, YE, ZA, ZM, ZW", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IQD, ISK, JMD, JOD, JPY, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LRD, LSL, MAD, MDL, MGA, MKD, MNT, MOP, MRU, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NZD, OMR, PAB, PEN, PGK, PLN, PYG, QAR, RON, RSD, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SOS, SRD, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +credit = { country = "AE, AF, AL, AM, CW, AO, AR, AU, AW, AZ, BA, BB, BG, BH, BI, BM, BN, BO, BR, BS, BW, BY, BZ, CA, CD, LI, CL, CN, CO, CR, CV, CZ, DJ, DK, DO, DZ, EG, ET, AD, FJ, FK, GG, GE, GH, GI, GM, GN, GT, GY, HK, HN, HR, HT, HU, ID, IL, IQ, IS, JM, JO, JP, KG, KH, KM, KR, KW, KY, KZ, LA, LB, LR, LS, MA, MD, MG, MK, MN, MO, MR, MV, MW, MX, MY, MZ, NA, NG, NI, BV, CK, OM, PA, PE, PG, PL, PY, QA, RO, RS, RW, SA, SB, SC, SE, SG, SH, SO, SR, SV, SZ, TH, TJ, TM, TN, TO, TR, TT, TW, TZ, UG, AS, UY, UZ, VE, VN, VU, WS, CM, AI, BJ, PF, YE, ZA, ZM, ZW", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IQD, ISK, JMD, JOD, JPY, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LRD, LSL, MAD, MDL, MGA, MKD, MNT, MOP, MRU, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NZD, OMR, PAB, PEN, PGK, PLN, PYG, QAR, RON, RSD, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SOS, SRD, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +google_pay = { country = "AL, DZ, AS, AO, AR, AU, AZ, BH, BY, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, HK, HU, ID, IN, IL, JP, JO, KZ, KW, LB, MY, MX, OM, PA, PE, PL, QA, RO, SA, SG, SE, TW, TH, TR, AE, UY, VN", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PAB, PEN, PLN, QAR, RON, SAR, SGD, ZAR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } + +[pm_filters.klarna] +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,EUR,EUR,CAD,CZK,DKK,EUR,EUR,EUR,EUR,EUR,EUR,EUR,NZD,NOK,PLN,EUR,EUR,SEK,CHF,GBP,USD" } + +[pm_filters.flexiti] +flexiti = { country = "CA", currency = "CAD" } + +[pm_filters.mifinity] +mifinity = { country = "BR,CN,SG,MY,DE,CH,DK,GB,ES,AD,GI,FI,FR,GR,HR,IT,JP,MX,AR,CO,CL,PE,VE,UY,PY,BO,EC,GT,HN,SV,NI,CR,PA,DO,CU,PR,NL,NO,PL,PT,SE,RU,TR,TW,HK,MO,AX,AL,DZ,AS,AO,AI,AG,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BE,BZ,BJ,BM,BT,BQ,BA,BW,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CX,CC,KM,CG,CK,CI,CW,CY,CZ,DJ,DM,EG,GQ,ER,EE,ET,FK,FO,FJ,GF,PF,TF,GA,GM,GE,GH,GL,GD,GP,GU,GG,GN,GW,GY,HT,HM,VA,IS,IN,ID,IE,IM,IL,JE,JO,KZ,KE,KI,KW,KG,LA,LV,LB,LS,LI,LT,LU,MK,MG,MW,MV,ML,MT,MH,MQ,MR,MU,YT,FM,MD,MC,MN,ME,MS,MA,MZ,NA,NR,NP,NC,NZ,NE,NG,NU,NF,MP,OM,PK,PW,PS,PG,PH,PN,QA,RE,RO,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SX,SK,SI,SB,SO,ZA,GS,KR,LK,SR,SJ,SZ,TH,TL,TG,TK,TO,TT,TN,TM,TC,TV,UG,UA,AE,UZ,VU,VN,VG,VI,WF,EH,ZM", currency = "AUD,CAD,CHF,CNY,CZK,DKK,EUR,GBP,INR,JPY,NOK,NZD,PLN,RUB,SEK,ZAR,USD,EGP,UYU,UZS" } + +[pm_filters.zen] +credit = { not_available_flows = { capture_method = "manual" } } +debit = { not_available_flows = { capture_method = "manual" } } +boleto = { country = "BR", currency = "BRL" } +efecty = { country = "CO", currency = "COP" } +multibanco = { country = "PT", currency = "EUR" } +pago_efectivo = { country = "PE", currency = "PEN" } +pse = { country = "CO", currency = "COP" } +pix = { country = "BR", currency = "BRL" } +red_compra = { country = "CL", currency = "CLP" } +red_pagos = { country = "UY", currency = "UYU" } + +[pm_filters.zsl] +local_bank_transfer = { country = "CN", currency = "CNY" } + +[pm_filters.aci] +credit = { country = "AD,AE,AT,BE,BG,CH,CN,CO,CR,CY,CZ,DE,DK,DO,EE,EG,ES,ET,FI,FR,GB,GH,GI,GR,GT,HN,HK,HR,HU,ID,IE,IS,IT,JP,KH,LA,LI,LT,LU,LY,MK,MM,MX,MY,MZ,NG,NZ,OM,PA,PE,PK,PL,PT,QA,RO,SA,SN,SE,SI,SK,SV,TH,UA,US,UY,VN,ZM", currency = "AED,ALL,ARS,BGN,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,EGP,EUR,GBP,GHS,HKD,HNL,HRK,HUF,IDR,ILS,ISK,JPY,KHR,KPW,LAK,LKR,MAD,MKD,MMK,MXN,MYR,MZN,NGN,NOK,NZD,OMR,PAB,PEN,PHP,PKR,PLN,QAR,RON,RSD,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,UYU,VND,ZAR,ZMW" } +debit = { country = "AD,AE,AT,BE,BG,CH,CN,CO,CR,CY,CZ,DE,DK,DO,EE,EG,ES,ET,FI,FR,GB,GH,GI,GR,GT,HN,HK,HR,HU,ID,IE,IS,IT,JP,KH,LA,LI,LT,LU,LY,MK,MM,MX,MY,MZ,NG,NZ,OM,PA,PE,PK,PL,PT,QA,RO,SA,SN,SE,SI,SK,SV,TH,UA,US,UY,VN,ZM", currency = "AED,ALL,ARS,BGN,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,EGP,EUR,GBP,GHS,HKD,HNL,HRK,HUF,IDR,ILS,ISK,JPY,KHR,KPW,LAK,LKR,MAD,MKD,MMK,MXN,MYR,MZN,NGN,NOK,NZD,OMR,PAB,PEN,PHP,PKR,PLN,QAR,RON,RSD,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,UYU,VND,ZAR,ZMW" } +mb_way = { country = "EE,ES,PT", currency = "EUR" } +ali_pay = { country = "CN", currency = "CNY" } +eps = { country = "AT", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +sofort = { country = "AT,BE,CH,DE,ES,GB,IT,NL,PL", currency = "CHF,EUR,GBP,HUF,PLN"} +interac = { country = "CA", currency = "CAD,USD"} +przelewy24 = { country = "PL", currency = "CZK,EUR,GBP,PLN" } +trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" } + +[pm_filters.gigadat] +interac = { currency = "CAD"} + +[pm_filters.loonio] +interac = { currency = "CAD"} + +[pm_filters.dlocal] +oxxo = { currency = "MXN" } + +[pm_filters.mollie] +eps = { country = "AT", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +przelewy24 = { country = "PL", currency = "PLN,EUR" } +klarna = { country = "DE,AT,NL,BE,FR,GB,IT,ES,PT,SE,DK,FI,NO,CH,IR,CZ,PL,GR,SK", currency = "EUR,GBP,DKK,SEK,NOK,CHF,PLN,CZK" } + +[pm_filters.redsys] +credit = { currency = "AUD,BGN,CAD,CHF,COP,CZK,DKK,EUR,GBP,HRK,HUF,ILS,INR,JPY,MYR,NOK,NZD,PEN,PLN,RUB,SAR,SEK,SGD,THB,USD,ZAR", country="ES" } +debit = { currency = "AUD,BGN,CAD,CHF,COP,CZK,DKK,EUR,GBP,HRK,HUF,ILS,INR,JPY,MYR,NOK,NZD,PEN,PLN,RUB,SAR,SEK,SGD,THB,USD,ZAR", country="ES" } + +[pm_filters.stax] +credit = { country = "US", currency = "USD" } +debit = { country = "US", currency = "USD" } +ach = { country = "US", currency = "USD" } + +[pm_filters.prophetpay] +card_redirect = { country = "US", currency = "USD" } + +[pm_filters.multisafepay] +credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,CV,KH,CM,CA,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,L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,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "AED,AUD,BRL,CAD,CHF,CLP,CNY,COP,CZK,DKK,EUR,GBP,HKD,HRK,HUF,ILS,INR,ISK,JPY,KRW,MXN,MYR,NOK,NZD,PEN,PLN,RON,RUB,SEK,SGD,TRY,TWD,USD,ZAR", not_available_flows = { capture_method = "manual" } } +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "AED, AUD, BRL, CAD, CHF, CLP, COP, CZK, DKK, EUR, GBP, HKD, HRK, HUF, ILS, INR, JPY, MXN, MYR, NOK, NZD, PEN, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, TWD, UAH, USD, ZAR" } +paypal = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,CV,KH,CM,CA,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "AUD,BRL,CAD,CHF,CZK,DKK,EUR,GBP,HKD,HRK,HUF,JPY,MXN,MYR,NOK,NZD,PHP,PLN,RUB,SEK,SGD,THB,TRY,TWD,USD" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +klarna = { country = "AT,BE,DK,FI,FR,DE,IT,NL,NO,PT,ES,SE,GB", currency = "DKK,EUR,GBP,NOK,SEK" } +trustly = { country = "AT,CZ,DK,EE,FI,DE,LV,LT,NL,NO,PL,PT,ES,SE,GB" , currency = "EUR,GBP,SEK"} +ali_pay = { currency = "EUR,USD" } +we_chat_pay = { currency = "EUR"} +eps = { country = "AT" , currency = "EUR" } +mb_way = { country = "PT" , currency = "EUR" } +sofort = { country = "AT,BE,FR,DE,IT,PL,ES,CH,GB" , currency = "EUR"} + +[pm_filters.cashtocode] +classic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CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +google_pay = { country = "US", currency = "USD" } +apple_pay = { country = "US", currency = "USD" } +ach = { country = "US", currency = "USD" } + +[pm_filters.trustpay] +credit = { not_available_flows = { capture_method = "manual" } } +debit = { not_available_flows = { capture_method = "manual" } } +instant_bank_transfer = { country = "CZ,SK,GB,AT,DE,IT", currency = "CZK, EUR, GBP" } +instant_bank_transfer_poland = { country = "PL", currency = "PLN" } +instant_bank_transfer_finland = { country = "FI", currency = "EUR" } +sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,GB", currency = "EUR" } + +[pm_filters.tesouro] +credit = { country = "AF,AL,DZ,AD,AO,AI,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BA,BW,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CO,KM,CD,CG,CK,CR,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,SV,GQ,ER,EE,ET,FK,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,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } +apple_pay = { currency = "USD" } +google_pay = { currency = "USD" } + +[pm_filters.authorizedotnet] +credit = {currency = "CAD,USD"} +debit = {currency = "CAD,USD"} +google_pay = {currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"} +apple_pay = {currency = "EUR,GBP,ISK,USD,AUD,CAD,BRL,CLP,COP,CRC,CZK,DKK,EGP,GEL,GHS,GTQ,HNL,HKD,HUF,ILS,INR,JPY,KZT,KRW,KWD,MAD,MXN,MYR,NOK,NZD,PEN,PLN,PYG,QAR,RON,SAR,SEK,SGD,THB,TWD,UAH,AED,VND,ZAR"} +paypal = {currency = "AUD,BRL,CAD,CHF,CNY,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,MYR,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD"} + +[pm_filters.dwolla] +ach = { country = "US", currency = "USD" } + +[pm_filters.worldpay] +debit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,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, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "DZD, AOA, USD, XCD, ARS, AUD, AZN, EUR, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "EG, MA, ZA, AU, CN, HK, JP, MO, MY, MN, NZ, SG, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, CZ, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IE, IS, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US, PR", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } + +[pm_filters.worldpayxml] +debit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,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MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US,UZ,VU,VE,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" } + +[pm_filters.worldpaymodular] +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "DZD, AOA, USD, XCD, ARS, AUD, AZN, EUR, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } +apple_pay = { country = "EG, MA, ZA, AU, CN, HK, JP, MO, MY, MN, NZ, SG, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, CZ, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IE, IS, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US, PR", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } + +[pm_filters.calida] +bluecode = { country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,SK,SI,ES,SE,IS,LI,NO", currency = "EUR" } + +[file_upload_config] +bucket_name = "" +region = "" + +[pm_filters.forte] +credit = { country = "US, CA", currency = "CAD,USD"} +debit = { country = "US, CA", currency = "CAD,USD"} + +[pm_filters.nordea] +sepa = { country = "DK,FI,NO,SE", currency = "DKK,EUR,NOK,SEK" } + +[pm_filters.fiuu] +duit_now = { country = "MY", currency = "MYR" } +apple_pay = { country = "MY", currency = "MYR" } +google_pay = { country = "MY", currency = "MYR" } +online_banking_fpx = { country = "MY", currency = "MYR" } +credit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PHP,SGD,THB,TWD,VND" } +debit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PHP,SGD,THB,TWD,VND" } + +[pm_filters.inespay] +sepa = { country = "ES", currency = "EUR"} + +[pm_filters.bluesnap] +credit = { country = "AD,AE,AG,AL,AM,AO,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BJ,BN,BO,BR,BS,BT,BW,BY,BZ,CA,CD,CF,CG,CH,CI,CL,CM,CN,CO,CR,CV,CY,CZ,DE,DK,DJ,DM,DO,DZ,EC,EE,EG,ER,ES,ET,FI,FJ,FM,FR,GA,GB,GD,GE,GG,GH,GM,GN,GQ,GR,GT,GW,GY,HN,HR,HT,HU,ID,IE,IL,IN,IS,IT,JM,JP,JO,KE,KG,KH,KI,KM,KN,KR,KW,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,MA,MC,MD,ME,MG,MH,MK,ML,MM,MN,MR,MT,MU,MV,MW,MX,MY,MZ,NA,NE,NG,NI,NL,NO,NP,NR,NZ,OM,PA,PE,PG,PH,PK,PL,PS,PT,PW,PY,QA,RO,RS,RW,SA,SB,SC,SE,SG,SI,SK,SL,SM,SN,SO,SR,SS,ST,SV,SZ,TD,TG,TH,TJ,TL,TM,TN,TO,TR,TT,TV,TZ,UA,UG,US,UY,UZ,VA,VC,VE,VN,VU,WS,ZA,ZM,ZW", currency = "AED,AFN,ALL,AMD,ANG,ARS,AUD,AWG,BAM,BBD,BGN,BHD,BMD,BND,BOB,BRL,BSD,BWP,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,FJD,GBP,GEL,GIP,GTQ,HKD,HUF,IDR,ILS,INR,ISK,JMD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MUR,MWK,MXN,MYR,NAD,NGN,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PLN,PKR,QAR,RON,RSD,RUB,SAR,SCR,SDG,SEK,SGD,THB,TND,TRY,TTD,TWD,TZS,UAH,USD,UYU,UZS,VND,XAF,XCD,XOF,ZAR"} +google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND"} +apple_pay = { country = "EG, MA, ZA, AU, HK, JP, MO, MY, MN, NZ, SG, KR, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT , KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, UY, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MYR, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, IS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D,ME,MK,AL,BA,RS,UA", currency = "AUD,BRL,CAD,CHF,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD" } + + +[pm_filters.amazonpay] +amazon_pay = { country = "US", currency = "USD" } + +[pm_filters.rapyd] +apple_pay = { country = "BR, CA, CL, CO, DO, SV, MX, PE, PT, US, AT, BE, BG, HR, CY, CZ, DO, DK, EE, FI, FR, GE, DE, GR, GL, HU, IS, IE, IL, IT, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, RO, SM, SK, SI, ZA, ES, SE, CH, GB, VA, AU, HK, JP, MY, NZ, SG, KR, TW, VN", currency = "AMD, AUD, BGN, BRL, BYN, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DOP, EUR, GBP, GEL, GTQ, HUF, ISK, JPY, KRW, MDL, MXN, MYR, NOK, PAB, PEN, PLN, PYG, RON, RSD, SEK, SGD, TWD, UAH, USD, UYU, VND, ZAR" } +google_pay = { country = "BR, CA, CL, CO, DO, MX, PE, PT, US, AT, BE, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IL, IT, LV, LT, LU, NZ, NO, GB, PL, RO, RU, SK, ZA, ES, SE, CH, TR, AU, HK, IN, ID, JP, MY, PH, SG, TW, TH, VN", currency = "AUD, BGN, BRL, BYN, CAD, CHF, CLP, COP, CZK, DKK, DOP, EUR, GBP, HUF, IDR, JPY, KES, MXN, MYR, NOK, PAB, PEN, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, TWD, UAH, USD, UYU, VND, ZAR" } +credit = { country = "AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,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U,ID,IE,IL,IN,IS,IT,JM,JP,JO,KE,KG,KH,KI,KM,KN,KR,KW,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,MA,MC,MD,ME,MG,MH,MK,ML,MM,MN,MR,MT,MU,MV,MW,MX,MY,MZ,NA,NE,NG,NI,NL,NO,NP,NR,NZ,OM,PA,PE,PG,PH,PK,PL,PS,PT,PW,PY,QA,RO,RS,RW,SA,SB,SC,SE,SG,SI,SK,SL,SM,SN,SO,SR,SS,ST,SV,SZ,TD,TG,TH,TJ,TL,TM,TN,TO,TR,TT,TV,TZ,UA,UG,US,UY,UZ,VA,VC,VE,VN,VU,WS,ZA,ZM,ZW", currency = "AED,AUD,BDT,BGN,BND,BOB,BRL,BWP,CAD,CHF,CNY,COP,CZK,DKK,EGP,EUR,FJD,GBP,GEL,GHS,HKD,HRK,HUF,IDR,ILS,INR,IQD,IRR,ISK,JPY,KES,KRW,KWD,KZT,LAK,LKR,MAD,MDL,MMK,MOP,MXN,MYR,MZN,NAD,NGN,NOK,NPR,NZD,PEN,PHP,PKR,PLN,QAR,RON,RSD,RUB,RWF,SAR,SCR,SEK,SGD,SLL,THB,TRY,TWD,TZS,UAH,UGX,USD,UYU,VND,XAF,XOF,ZAR,ZMW,MWK" } + +[pm_filters.gocardless] +ach = { country = "US", currency = "USD" } +becs = { country = "AU", currency = "AUD" } +sepa = { country = "AU,AT,BE,BG,CA,HR,CY,CZ,DK,FI,FR,DE,HU,IT,LU,MT,NL,NZ,NO,PL,PT,IE,RO,SK,SI,ZA,ES,SE,CH,GB", currency = "GBP,EUR,SEK,DKK,AUD,NZD,CAD" } + +[pm_filters.powertranz] +credit = { country = "AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY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N,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } + +[pm_filters.shift4] +eps = { country = "AT", currency = "EUR" } +giropay = { country = "DE", currency = "EUR" } +ideal = { country = "NL", currency = "EUR" } +sofort = { country = "AT,BE,CH,DE,ES,FI,FR,GB,IT,NL,PL,SE", currency = "CHF,EUR" } +credit = { country = "AD,AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IM,IN,IO,IQ,IR,IS,IT,JE,JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,LY,MA,MC,MD,ME,MF,MG,MH,MK,ML,MM,MN,MO,MP,MQ,MR,MS,MT,MU,MV,MW,MX,MY,MZ,NA,NC,NE,NF,NG,NI,NL,NO,NP,NR,NU,NZ,OM,PA,PE,PF,PG,PH,PK,PL,PM,PN,PR,PS,PT,PW,PY,QA,RE,RO,RS,RU,RW,SA,SB,SC,SD,SE,SG,SH,SI,SJ,SK,SL,SM,SN,SO,SR,SS,ST,SV,SX,SY,SZ,TC,TD,TF,TG,TH,TJ,TL,TM,TN,TO,TR,TT,TV,TW,TZ,UA,U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W,ZWL" } +boleto = { country = "BR", currency = "BRL" } +trustly = { currency = "CZK,DKK,EUR,GBP,NOK,SEK" } +ali_pay = { country = "CN", currency = "CNY" } +we_chat_pay = { country = "CN", currency = "CNY" } +klarna = { currency = "EUR,GBP,CHF,SEK" } +blik = { country = "PL", currency = "PLN" } +crypto_currency = { currency = "USD,GBP,AED" } +paysera = { currency = "EUR" } +skrill = { currency = "USD" } + +[pm_filters.placetopay] +credit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"} +debit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"} + +[pm_filters.coingate] +crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" } + +[pm_filters.paystack] +eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" } + +[pm_filters.santander] +pix = { country = "BR", currency = "BRL" } +boleto = { country = "BR", currency = "BRL" } + +[pm_filters.boku] +dana = { country = "ID", currency = "IDR" } +gcash = { country = "PH", currency = "PHP" } +go_pay = { country = "ID", currency = "IDR" } +kakao_pay = { country = "KR", currency = "KRW" } +momo = { country = "VN", currency = "VND" } + +[pm_filters.nmi] +credit = { country = "EG,ZA,BH,CY,HK,IN,ID,IL,JP,JO,KW,MY,PK,PH,SA,SG,KR,TW,TH,TR,AE,VN,AL,AD,AM,AT,AZ,BY,BE,BA,BG,HR,CZ,DK,EE,FI,FR,GE,DE,GR,HU,IS,IE,IT,KZ,LV,LI,LT,LU,MT,MD,MC,ME,NL,MK,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,TR,GB,VA,AG,BS,BB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CY,CZ,DE,DK,EE,ES,FI,FR,GB,GE,GR,HR,HU,IE,IS,IT,KZ,LI,LT,LU,LV,MC,MD,ME,MK,MT,NL,NO,PL,PT,RO,RU,SE,SI,SK,SM,TR,UA,VA", currency = "BHD,BIF,CHF,DJF,EUR,GBP,GNF,IQD,ISK,JPY,JOD,KMF,KRW,KWD,LYD,OMR,PYG,RWF,TND,UGX,USD,VND,VUV,XAF,XOF,XPF" } +debit = { country = "AL,AD,AM,AT,AZ,BY,BE,BA,BG,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GE,GR,HR,HU,IE,IS,IT,KZ,LI,LT,LU,LV,MC,MD,ME,MK,MT,NL,NO,PL,PT,RO,RU,SE,SI,SK,SM,TR,UA,VA", currency = "BHD,BIF,CHF,DJF,EUR,GBP,GNF,IQD,ISK,JPY,JOD,KMF,KRW,KWD,LYD,OMR,PYG,RWF,TND,UGX,USD,VND,VUV,XAF,XOF,XPF" } + +[pm_filters.payme] +credit = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } +debit = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } +apple_pay = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } + +[pm_filters.paysafe] +apple_pay = {country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,PM,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,NL,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VA,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "ARS,AUD,AZN,BHD,BOB,BAM,BRL,BGN,CAD,CLP,CNY,COP,CRC,HRK,CZK,DKK,DOP,XCD,EGP,ETB,EUR,FJD,GEL,GTQ,HTG,HNL,HKD,HUF,INR,IDR,JMD,JPY,JOD,KZT,KES,KRW,KWD,LBP,LYD,MWK,MUR,MXN,MDL,MAD,ILS,NZD,NGN,NOK,OMR,PKR,PAB,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SAR,RSD,SGD,ZAR,LKR,SEK,CHF,SYP,TWD,THB,TTD,TND,TRY,UAH,AED,UYU,USD,VND" } + +[pm_filters.payjustnow] +payjustnow = { country = "ZA", currency = "ZAR" } + +[pm_filters.payjustnowinstore] +payjustnow = { country = "ZA", currency = "ZAR" } diff --git a/decision-engine.postman_collection.json b/decision-engine.postman_collection.json new file mode 100644 index 00000000..3a03b1bd --- /dev/null +++ b/decision-engine.postman_collection.json @@ -0,0 +1,368 @@ +{ + "info": { + "name": "Decision Engine", + "description": "Postman collection for juspay/decision-engine — a payment gateway routing service.\n\nBase URL: http://localhost:8080\n\nQuick start:\n1. Create a merchant account (Merchant / Create)\n2. Call POST /decide-gateway with a payment payload\n3. Record the outcome via POST /update-gateway-score", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "variable": [ + { + "key": "baseUrl", + "value": "http://localhost:8080", + "type": "string" + }, + { + "key": "merchantId", + "value": "test_merchant", + "type": "string" + } + ], + "item": [ + { + "name": "Health", + "item": [ + { + "name": "Health Check", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/health", + "host": ["{{baseUrl}}"], + "path": ["health"] + }, + "description": "Returns {\"message\":\"Health is good\"} when the service is up." + } + } + ] + }, + { + "name": "Merchant Account", + "item": [ + { + "name": "Create Merchant", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/merchant-account/create", + "host": ["{{baseUrl}}"], + "path": ["merchant-account", "create"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"merchant_id\": \"{{merchantId}}\",\n \"gateway_success_rate_based_decider_input\": null\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Register a new merchant. Must be done before calling /decide-gateway." + } + }, + { + "name": "Get Merchant", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/merchant-account/{{merchantId}}", + "host": ["{{baseUrl}}"], + "path": ["merchant-account", "{{merchantId}}"] + }, + "description": "Fetch a merchant's configuration by merchant_id." + } + }, + { + "name": "Delete Merchant", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/merchant-account/{{merchantId}}", + "host": ["{{baseUrl}}"], + "path": ["merchant-account", "{{merchantId}}"] + }, + "description": "Delete a merchant account." + } + } + ] + }, + { + "name": "Gateway Decision", + "item": [ + { + "name": "Decide Gateway (v2 — recommended)", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/decide-gateway", + "host": ["{{baseUrl}}"], + "path": ["decide-gateway"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"merchantId\": \"{{merchantId}}\",\n \"paymentInfo\": {\n \"paymentId\": \"pay_001\",\n \"amount\": 1000.0,\n \"currency\": \"USD\",\n \"country\": \"US\",\n \"customerId\": \"cust_123\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"authType\": \"THREE_DS\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"cardIssuerBankName\": \"HDFC\",\n \"preferredGateway\": null,\n \"paymentSource\": null,\n \"isEmi\": false,\n \"emiBank\": null,\n \"emiTenure\": null,\n \"metadata\": null,\n \"internalMetadata\": null,\n \"udfs\": null\n },\n \"eligibleGatewayList\": [\"stripe\", \"paypal\", \"adyen\"],\n \"rankingAlgorithm\": \"SrBasedRouting\",\n \"eliminationEnabled\": false\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Core routing decision API (v2). Returns the best gateway from eligible_gateway_list.\n\nranking_algorithm options: SrBasedRouting | PlBasedRouting | NtwBasedRouting\n\nResponse includes:\n- decided_gateway: the selected gateway name\n- routing_approach: e.g. SR_SELECTION_V3_ROUTING, PRIORITY_LOGIC\n- gateway_priority_map: scores for each eligible gateway\n- routing_dimension: dimension used for SR scoring (e.g. CARD_BRAND, AUTH_TYPE)" + } + }, + { + "name": "Decision Gateway (v1 — full payload)", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/decision_gateway", + "host": ["{{baseUrl}}"], + "path": ["decision_gateway"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"orderReference\": {\n \"orderId\": \"order_001\",\n \"amount\": 1000.0,\n \"currency\": \"USD\",\n \"merchantId\": \"{{merchantId}}\",\n \"status\": \"NEW\",\n \"orderType\": \"ORDER_PAYMENT\",\n \"customerId\": \"cust_123\",\n \"preferredGateway\": null,\n \"metadata\": null,\n \"udfs\": {}\n },\n \"txnDetail\": {\n \"txnId\": \"txn_001\",\n \"orderId\": \"order_001\",\n \"merchantId\": \"{{merchantId}}\",\n \"status\": \"PENDING_VBV\",\n \"type\": \"ORDER_PAYMENT\",\n \"txnUuid\": \"pay_001\",\n \"gateway\": \"stripe\"\n },\n \"txnCardInfo\": {\n \"id\": \"card_001\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"authType\": \"THREE_DS\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"dateCreated\": \"2026-03-31T00:00:00Z\"\n },\n \"merchantAccount\": {\n \"merchantId\": \"{{merchantId}}\",\n \"gatewaySuccessRateBasedDeciderInput\": null\n },\n \"enforceGatewayList\": [\"stripe\", \"paypal\", \"adyen\"],\n \"priorityLogicScript\": null,\n \"priorityLogicOutput\": null\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Legacy full-payload decision endpoint. Prefer /decide-gateway (v2) for new integrations." + } + }, + { + "name": "Hybrid Routing", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/routing/hybrid", + "host": ["{{baseUrl}}"], + "path": ["routing", "hybrid"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"static_routing_request\": {\n \"created_by\": \"{{merchantId}}\",\n \"fallback_output\": null,\n \"parameters\": {\n \"payment_method\": \"card\",\n \"currency\": \"USD\",\n \"country\": \"US\"\n }\n },\n \"dynamic_routing_request\": {\n \"merchant_id\": \"{{merchantId}}\",\n \"payment_info\": {\n \"payment_id\": \"pay_001\",\n \"amount\": 1000.0,\n \"currency\": \"USD\",\n \"payment_type\": \"ORDER_PAYMENT\",\n \"payment_method_type\": \"CARD\",\n \"payment_method\": \"CREDIT\"\n },\n \"eligible_gateway_list\": [\"stripe\", \"paypal\", \"adyen\"],\n \"ranking_algorithm\": \"SrBasedRouting\",\n \"elimination_enabled\": false\n }\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Combines static rule-based routing with dynamic SR-based routing. Returns merged results from both engines." + } + } + ] + }, + { + "name": "Score Feedback", + "item": [ + { + "name": "Update Gateway Score", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/update-gateway-score", + "host": ["{{baseUrl}}"], + "path": ["update-gateway-score"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"merchantId\": \"{{merchantId}}\",\n \"gateway\": \"stripe\",\n \"paymentId\": \"pay_001\",\n \"status\": \"CHARGED\",\n \"gatewayReferenceId\": \"stripe_ref_001\",\n \"enforceDynamicRoutingFailure\": false,\n \"txnLatency\": {\n \"gatewayLatency\": 120.5\n }\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Feed transaction outcome back to update the success rate model.\n\nstatus options: CHARGED | AUTHENTICATION_FAILED | AUTHORIZATION_FAILED | JUSPAY_DECLINED | AUTO_REFUNDED | COD_INITIATED | STARTED | PENDING_VBV | CAPTURE_FAILED | VOID_FAILED | VOID_INITIATED | CAPTURE_INITIATED\n\nCall this after every transaction to keep SR scores accurate." + } + }, + { + "name": "Update Score (legacy)", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/update-score", + "host": ["{{baseUrl}}"], + "path": ["update-score"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"txn_detail\": {\n \"txnId\": \"txn_001\",\n \"orderId\": \"order_001\",\n \"merchantId\": \"{{merchantId}}\",\n \"status\": \"CHARGED\",\n \"type\": \"ORDER_PAYMENT\",\n \"txnUuid\": \"pay_001\",\n \"gateway\": \"stripe\",\n \"dateCreated\": \"2026-03-31T00:00:00Z\",\n \"txnAmount\": { \"value\": 1000, \"currency\": \"USD\" },\n \"txnObjectType\": \"ORDER_PAYMENT\",\n \"sourceObject\": \"CREDIT\",\n \"isEmi\": false\n },\n \"txn_card_info\": {\n \"id\": \"card_001\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"authType\": \"THREE_DS\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"dateCreated\": \"2026-03-31T00:00:00Z\"\n },\n \"log_message\": \"Transaction completed\",\n \"enforce_dynaic_routing_failure\": false,\n \"txn_latency\": {\n \"gatewayLatency\": 120.5\n }\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Legacy score update endpoint using the full txn_detail / txn_card_info structure. Prefer /update-gateway-score for new integrations." + } + } + ] + }, + { + "name": "Routing Rules (Euclid)", + "item": [ + { + "name": "Create Routing Rule", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/routing/create", + "host": ["{{baseUrl}}"], + "path": ["routing", "create"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"My Priority Rule\",\n \"description\": \"Route US card payments: Stripe first, Adyen fallback\",\n \"created_by\": \"{{merchantId}}\",\n \"algorithm_for\": \"Payment\",\n \"algorithm\": {\n \"type\": \"priority\",\n \"data\": [\n { \"connector\": \"stripe\", \"merchant_connector_id\": null },\n { \"connector\": \"adyen\", \"merchant_connector_id\": null }\n ]\n }\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Create a routing rule in the Euclid rules engine.\n\nalgorithm.type options:\n- \"single\": always route to one connector\n- \"priority\": ordered fallback list\n- \"volume_split\": percentage-based split across connectors\n- \"advanced\": conditional AST-based logic\n\nalgorithm_for options: Payment | Payout | ThreeDsAuthentication" + } + }, + { + "name": "Activate Routing Rule", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/routing/activate", + "host": ["{{baseUrl}}"], + "path": ["routing", "activate"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"created_by\": \"{{merchantId}}\",\n \"routing_algorithm_id\": \"\"\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Activate a previously created routing rule for a merchant. Only one rule can be active at a time per merchant." + } + }, + { + "name": "List Routing Rules", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{baseUrl}}/routing/list/{{merchantId}}", + "host": ["{{baseUrl}}"], + "path": ["routing", "list", "{{merchantId}}"] + }, + "description": "List all routing rules created by a merchant." + } + }, + { + "name": "Get Active Routing Rule", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{baseUrl}}/routing/list/active/{{merchantId}}", + "host": ["{{baseUrl}}"], + "path": ["routing", "list", "active", "{{merchantId}}"] + }, + "description": "Get the currently active routing rule for a merchant." + } + }, + { + "name": "Evaluate Routing Rule", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/routing/evaluate", + "host": ["{{baseUrl}}"], + "path": ["routing", "evaluate"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"created_by\": \"{{merchantId}}\",\n \"fallback_output\": [\n { \"connector\": \"stripe\", \"merchant_connector_id\": null }\n ],\n \"parameters\": {\n \"payment_method\": \"card\",\n \"currency\": \"USD\",\n \"country\": \"US\",\n \"amount\": 1000\n }\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Test/dry-run the active routing rule for a merchant with given payment parameters. Returns the connector(s) the rule would select." + } + }, + { + "name": "Configure SR Dimensions", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/config-sr-dimension", + "host": ["{{baseUrl}}"], + "path": ["config-sr-dimension"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"merchant_id\": \"{{merchantId}}\",\n \"dimensions\": [\"CARD_BRAND\", \"AUTH_TYPE\", \"CURRENCY\"]\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Configure which dimensions to use when computing success rates for a merchant.\n\nPossible dimensions: CARD_BRAND | AUTH_TYPE | CURRENCY | PAYMENT_METHOD | CARD_TYPE | CARD_ISIN | COUNTRY" + } + } + ] + }, + { + "name": "Rule Configuration (service config)", + "item": [ + { + "name": "Create Rule Config", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/rule/create", + "host": ["{{baseUrl}}"], + "path": ["rule", "create"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"merchant_id\": \"{{merchantId}}\",\n \"config\": {\n \"type\": \"successRate\",\n \"data\": {\n \"defaultBucketSize\": 20,\n \"defaultLatencyThreshold\": null,\n \"defaultHedgingPercent\": null\n }\n }\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Create a service-level rule config (e.g. SR thresholds, elimination settings).\n\nconfig options: SuccessRate | Elimination | DebitRouting" + } + }, + { + "name": "Get Rule Config", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/rule/get", + "host": ["{{baseUrl}}"], + "path": ["rule", "get"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"merchant_id\": \"{{merchantId}}\",\n \"algorithm\": \"successRate\"\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Retrieve a specific rule config for a merchant.\n\nalgorithm options: SuccessRate | Elimination | DebitRouting" + } + }, + { + "name": "Update Rule Config", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/rule/update", + "host": ["{{baseUrl}}"], + "path": ["rule", "update"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"merchant_id\": \"{{merchantId}}\",\n \"config\": {\n \"type\": \"successRate\",\n \"data\": {\n \"defaultBucketSize\": 30,\n \"defaultHedgingPercent\": 0.1\n }\n }\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Update an existing rule config." + } + }, + { + "name": "Delete Rule Config", + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { + "raw": "{{baseUrl}}/rule/delete", + "host": ["{{baseUrl}}"], + "path": ["rule", "delete"] + }, + "body": { + "mode": "raw", + "raw": "{\n \"merchant_id\": \"{{merchantId}}\",\n \"algorithm\": \"successRate\"\n}", + "options": { "raw": { "language": "json" } } + }, + "description": "Delete a rule config for a merchant." + } + } + ] + } + ] +} diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 00000000..545cb75b --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,29 @@ +# Local development override - adds live code reloading for backend +services: + open-router-pg-local: + build: + context: . + dockerfile: Dockerfile.postgres + args: + - BUILDKIT_INLINE_CACHE=1 + profiles: + - local-postgres + - local-dev + container_name: open-router-pg-local + restart: unless-stopped + ports: + - "8080:8080" + - "9094:9094" + depends_on: + postgresql: + condition: service_healthy + redis: + condition: service_healthy + db-migrator-postgres: + condition: service_completed_successfully + volumes: + - ./config/docker-configuration.toml:/local/config/development.toml + networks: + - open-router-network + environment: + - GROOVY_RUNNER_HOST=host.docker.internal:8085 diff --git a/docker-compose.yaml b/docker-compose.yaml index 3410d43a..b6fe531d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,20 +1,28 @@ services: - open-router: - image: ghcr.io/juspay/decision-engine:v1.2.1 + # ========================================== + # PROFILE: postgres (Basic PostgreSQL + Redis) + # ========================================== + # ========================================== + # PROFILE: postgres (Basic PostgreSQL + Redis) + # ========================================== + open-router-pg: + image: ghcr.io/juspay/decision-engine/postgres:v1.3.3 pull_policy: always platform: linux/amd64 - container_name: open-router + container_name: open-router-pg + profiles: + - postgres + - dashboard-postgres restart: unless-stopped ports: - "8080:8080" + - "9094:9094" depends_on: - mysql: + postgresql: condition: service_healthy redis: condition: service_healthy - groovy-runner: - condition: service_healthy - routing-config: + db-migrator-postgres: condition: service_completed_successfully volumes: - ./config/docker-configuration.toml:/local/config/development.toml @@ -23,20 +31,16 @@ services: environment: - GROOVY_RUNNER_HOST=host.docker.internal:8085 - open-router-local: - build: - context: . - dockerfile: Dockerfile - cache_from: - - decision-engine-open-router-local:latest - labels: - - "com.docker.compose.watchfile=Dockerfile" - - "com.docker.compose.watchfile=src/" - - "com.docker.compose.watchfile=Cargo.toml" - - "com.docker.compose.watchfile=Cargo.lock" - image: decision-engine-open-router-local:latest + # ========================================== + # PROFILE: mysql (Basic MySQL + Redis) + # ========================================== + open-router: + image: ghcr.io/juspay/decision-engine:v1.3.3 + pull_policy: always platform: linux/amd64 container_name: open-router + profiles: + - mysql restart: unless-stopped ports: - "8080:8080" @@ -45,8 +49,6 @@ services: condition: service_healthy redis: condition: service_healthy - groovy-runner-local: - condition: service_healthy routing-config: condition: service_completed_successfully volumes: @@ -56,61 +58,54 @@ services: environment: - GROOVY_RUNNER_HOST=host.docker.internal:8085 - open-router-local-pg: - build: - context: . - dockerfile: Dockerfile.postgres - cache_from: - - decision-engine-open-router-local-pg:latest - labels: - - "com.docker.compose.watchfile=Dockerfile.postgres" - - "com.docker.compose.watchfile=src/" - - "com.docker.compose.watchfile=Cargo.toml" - - "com.docker.compose.watchfile=Cargo.lock" - image: decision-engine-open-router-local-pg:latest - platform: linux/amd64 - container_name: open-router + # ========================================== + # PROFILE: dashboard-postgres (PG + Redis + Dashboard) + # ========================================== + nginx: + image: nginx:alpine + profiles: + - dashboard-postgres + - dashboard-mysql + container_name: open-router-nginx restart: unless-stopped ports: - - "8080:8080" - - "9094:9094" - depends_on: - postgresql: - condition: service_healthy - redis: - condition: service_healthy - groovy-runner-local: - condition: service_healthy + - "8081:80" volumes: - - ./config/docker-configuration.toml:/local/config/development.toml + - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + - ./website/dist:/usr/share/nginx/html/dashboard:ro + depends_on: + - open-router-pg + - mintlify-docs networks: - open-router-network - environment: - - GROOVY_RUNNER_HOST=host.docker.internal:8085 - open-router-pg: - image: ghcr.io/juspay/decision-engine/postgres:v1.2.1 - pull_policy: always - platform: linux/amd64 - container_name: open-router-pg + mintlify-docs: + build: + context: . + dockerfile: Dockerfile.docs + profiles: + - dashboard-postgres + - dashboard-mysql + container_name: mintlify-docs restart: unless-stopped - ports: - - "8080:8080" - - "9094:9094" - depends_on: - db-migrator-postgres: - condition: service_completed_successfully - groovy-runner-local: - condition: service_healthy - volumes: - - ./config/docker-configuration.toml:/local/config/development.toml + expose: + - "3000" networks: - open-router-network - environment: - - GROOVY_RUNNER_HOST=host.docker.internal:8085 + healthcheck: + test: ["CMD-SHELL", "wget -qO- http://localhost:3000 > /dev/null 2>&1 || exit 1"] + interval: 10s + timeout: 10s + retries: 10 + start_period: 60s + # ========================================== + # Supporting Services with Profiles + # ========================================== prometheus: image: prom/prometheus:latest + profiles: + - monitoring networks: - open-router-network volumes: @@ -121,6 +116,8 @@ services: grafana: image: grafana/grafana:latest + profiles: + - monitoring ports: - "3000:3000" networks: @@ -131,7 +128,6 @@ services: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_BASIC_ENABLED=false volumes: - # - ./config/grafana.ini:/etc/grafana/grafana.ini - ./config/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yml groovy-runner: @@ -139,6 +135,8 @@ services: pull_policy: always platform: linux/amd64 container_name: groovy-runner + profiles: + - groovy restart: unless-stopped ports: - "8085:8085" @@ -163,7 +161,9 @@ services: - "com.docker.compose.watchfile=groovy.Dockerfile" - "com.docker.compose.watchfile=src/Runner.groovy" platform: linux/amd64 - container_name: groovy-runner + container_name: groovy-runner-local + profiles: + - groovy-local restart: unless-stopped ports: - "8085:8085" @@ -176,63 +176,86 @@ services: retries: 5 start_period: 10s + # ========================================== + # Core Infrastructure (Pulled when needed) + # ========================================== mysql: image: mysql:8.0 container_name: open-router-mysql + profiles: + - mysql + - dashboard-mysql restart: unless-stopped environment: - - MYSQL_ROOT_PASSWORD=root - - MYSQL_DATABASE=jdb - volumes: - - mysql-data:/var/lib/mysql + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: jdb + MYSQL_USER: db_user + MYSQL_PASSWORD: db_pass ports: - "3306:3306" + volumes: + - mysql-data:/var/lib/mysql networks: - open-router-network healthcheck: - test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot"] - interval: 5s - timeout: 10s - retries: 10 + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s - postgresql: - image: postgres:latest - container_name: open-router-postgres - restart: unless-stopped + postgresql: + image: postgres:16 + container_name: open-router-postgres + profiles: + - postgres + - dashboard-postgres + restart: unless-stopped environment: - - POSTGRES_USER=db_user - - POSTGRES_PASSWORD=db_pass - - POSTGRES_DB=decision_engine_db - volumes: - - postgres-data:/var/lib/postgresql/data - ports: + POSTGRES_USER: db_user + POSTGRES_PASSWORD: db_pass + POSTGRES_DB: decision_engine_db + ports: - "5432:5432" + volumes: + - postgres-data:/var/lib/postgresql networks: - - open-router-network + - open-router-network healthcheck: - test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] - interval: 5s - retries: 3 - start_period: 5s - timeout: 5s + test: ["CMD-SHELL", "pg_isready -U db_user -d decision_engine_db"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s redis: - image: redis:7 + image: redis:7-alpine container_name: open-router-redis + profiles: + - postgres + - dashboard-postgres + - mysql + - dashboard-mysql + restart: unless-stopped ports: - "6379:6379" + volumes: + - redis-data:/data networks: - open-router-network healthcheck: - test: ["CMD-SHELL", "redis-cli ping | grep '^PONG$'"] - interval: 5s + test: ["CMD", "redis-cli", "ping"] + interval: 10s + timeout: 5s retries: 5 start_period: 5s - timeout: 5s db-migrator: image: mysql:8.0 container_name: db-migrator + profiles: + - mysql + - dashboard-mysql depends_on: mysql: condition: service_healthy @@ -242,10 +265,13 @@ services: entrypoint: ["/bin/sh", "-c", "for sql_file in $$(find /app/migrations -name 'up.sql' -type f | sort); do echo \"Running migration: $$sql_file\"; mysql -h mysql -uroot -proot jdb < \"$$sql_file\"; done"] networks: - open-router-network - + db-migrator-postgres: image: rust:latest - container_name: db-migrator + container_name: db-migrator-postgres + profiles: + - postgres + - dashboard-postgres depends_on: postgresql: condition: service_healthy @@ -262,6 +288,9 @@ services: routing-config: image: python:3.10-slim container_name: routing-config + profiles: + - mysql + - dashboard-mysql depends_on: mysql: condition: service_healthy diff --git a/docs/api-reference/contract.md b/docs/api-reference/contract.md deleted file mode 100644 index fa056339..00000000 --- a/docs/api-reference/contract.md +++ /dev/null @@ -1,393 +0,0 @@ -# Contract Routing API Contracts - -## Overview - -The Contract Score Calculator service provides endpoints for routing payments based on contractual obligations and targets with payment processors. This service is a key component of the Dynamo routing system, helping ensure that payment volumes are distributed according to business agreements while maintaining efficient processing. - -## Service Definition - -```protobuf -service ContractScoreCalculator { - rpc FetchContractScore (CalContractScoreRequest) returns (CalContractScoreResponse); - rpc UpdateContract (UpdateContractRequest) returns (UpdateContractResponse); - rpc InvalidateContract (InvalidateContractRequest) returns (InvalidateContractResponse); -} -``` - -## Authentication - -All endpoints require authentication. Authentication is handled via metadata in the gRPC request. The service supports multi-tenancy, which means contract data is isolated per tenant. - -- Authentication requires an `x-api-key` header with a valid API key -- The `x-tenant-id` header is required to specify the tenant context -- Tenant ID is extracted from request metadata -- All operations verify tenant permissions before processing -- Multi-tenancy can be enabled/disabled via configuration - -## Endpoints - -### 1. FetchContractScore - -Calculates and returns contract-based routing scores for the provided processors. - -#### Request: `CalContractScoreRequest` - -```protobuf -message CalContractScoreRequest { - string id = 1; // Entity identifier - string params = 2; // Additional parameters for contract calculation - repeated string labels = 3; // Labels (processors) to calculate scores for - CalContractScoreConfig config = 4; // Configuration for calculation -} - -message CalContractScoreConfig { - repeated double constants = 1; // Constants used in score calculation algorithm - TimeScale time_scale = 2; // Time scale for contract calculation -} - -message TimeScale { - enum Scale { - Day = 0; // Daily time scale - Month = 1; // Monthly time scale - } - Scale time_scale = 1; // Selected time scale -} -``` - -#### Response: `CalContractScoreResponse` - -```protobuf -message CalContractScoreResponse { - repeated ScoreData labels_with_score = 1; // Contract scores for each label -} - -message ScoreData { - double score = 1; // Contract score (higher values indicate higher priority) - string label = 2; // Label (processor) identifier - uint64 current_count = 3; // Current transaction count for this processor -} -``` - -#### Behavior - -- Calculates contract scores based on processor targets and current usage -- Scores are influenced by how far each processor is from meeting its target -- Higher scores indicate processors that need more transactions to meet targets -- Additional parameters can influence the scoring algorithm -- Returns current transaction counts alongside scores for transparency - -#### Process Flow - -1. Extract tenant ID from request metadata -2. Validate the request parameters -3. Extract entity ID, parameters, and processor labels -4. Convert the configuration to internal contract score settings -5. Calculate contract scores for each processor based on current transaction counts and targets -6. Return detailed score data for each processor - ---- - -### 2. UpdateContract - -Updates the contract information for specific processors, affecting future contract-based routing decisions. - -#### Request: `UpdateContractRequest` - -```protobuf -message UpdateContractRequest { - string id = 1; // Entity identifier - string params = 2; // Additional parameters - repeated LabelInformation labels_information = 3; // Contract information for processors -} - -message LabelInformation { - string label = 1; // Processor identifier - uint64 target_count = 2; // Target transaction count in contract - uint64 target_time = 3; // Time period for the target (in seconds) - uint64 current_count = 4; // Current transaction count -} -``` - -#### Response: `UpdateContractResponse` - -```protobuf -message UpdateContractResponse { - enum UpdationStatus { - CONTRACT_UPDATION_SUCCEEDED = 0; - CONTRACT_UPDATION_FAILED = 1; - } - UpdationStatus status = 1; // Status of the update operation -} -``` - -#### Behavior - -- Updates contract information for the specified processors -- Stores target counts, time periods, and current transaction counts -- Enables the system to calculate routing scores based on contract fulfillment -- Contract data is tenant-specific for multi-tenant deployments -- Returns the status of the update operation - -#### Process Flow - -1. Extract tenant ID from request metadata -2. Validate the request parameters -3. Extract entity ID, parameters, and contract information for processors -4. Convert the provided data to internal contract map format -5. Update contract information for all specified processors -6. Return success/failure status of the operation - ---- - -### 3. InvalidateContract - -Invalidates all contract data for a specific entity, effectively resetting its contract-based routing state. - -#### Request: `InvalidateContractRequest` - -```protobuf -message InvalidateContractRequest { - string id = 1; // Entity identifier to invalidate -} -``` - -#### Response: `InvalidateContractResponse` - -```protobuf -message InvalidateContractResponse { - enum InvalidationStatus { - CONTRACT_INVALIDATION_SUCCEEDED = 0; - CONTRACT_INVALIDATION_FAILED = 1; - } - InvalidationStatus status = 1; // Status of the invalidation operation -} -``` - -#### Behavior - -- Removes all contract data for the specified entity -- This effectively resets the contract-based routing for this entity -- Useful when contracts are renewed or significantly changed -- Does not affect contract data for other entities -- Returns the status of the invalidation operation - -#### Process Flow - -1. Extract tenant ID from request metadata -2. Validate the request parameters -3. Extract entity ID to invalidate -4. Remove all contract data for the entity within the tenant context -5. Return success/failure status of the operation - -## Error Handling - -All endpoints return standard gRPC status codes: - -| Status Code | Description | When Used | -|-------------|-------------|-----------| -| `OK (0)` | Operation completed successfully | Normal successful operation | -| `NOT_FOUND (5)` | Required resource not found | Missing configuration, entity not found | -| `INVALID_ARGUMENT (3)` | Validation failed | Invalid or missing required parameters | -| `UNAUTHENTICATED (16)` | Authentication failed | Invalid or missing authentication credentials | -| `PERMISSION_DENIED (7)` | Authenticated user lacks permission | User not authorized for the operation | -| `INTERNAL (13)` | Internal server error | Unexpected errors during processing | - -## Multi-tenancy Support - -The service supports multi-tenancy with the following behavior: - -- All contract data is isolated per tenant with no cross-tenant data access -- Tenant ID is extracted from request metadata -- Each tenant has its own contract settings and transaction counts -- Multi-tenancy can be disabled in configuration via `is_multi_tenancy_enabled` flag -- When disabled, a default tenant ID is used - -## Performance Considerations - -- **Efficient Scoring Algorithm**: The contract score calculation is optimized for performance -- **Persistent Storage**: Contract data is stored efficiently for quick access -- **Parallel Processing**: The system can handle multiple contract score calculations simultaneously -- **Request Validation**: Validates requests early to fail fast and save processing resources -- **Rust Implementation**: Implementation is in Rust for maximum efficiency and safety -- **Error Handling**: Comprehensive error handling with detailed context - -## Example Usage - -### Fetch Contract Score Example - -```json -// Request -{ - "id": "merchant_123", - "params": "{\"payment_type\":\"card\"}", - "labels": ["processor_A", "processor_B", "processor_C"], - "config": { - "constants": [0.75, 1.25, 0.5], - "time_scale": { - "time_scale": "Month" - } - } -} - -// Response -{ - "labels_with_score": [ - { - "score": 0.85, - "label": "processor_B", - "current_count": 7520 - }, - { - "score": 0.65, - "label": "processor_A", - "current_count": 12450 - }, - { - "score": 0.42, - "label": "processor_C", - "current_count": 9870 - } - ] -} -``` - -### Update Contract Example - -```json -// Request -{ - "id": "merchant_123", - "params": "{\"payment_type\":\"card\"}", - "labels_information": [ - { - "label": "processor_A", - "target_count": 15000, - "target_time": 2592000, - "current_count": 12450 - }, - { - "label": "processor_B", - "target_count": 10000, - "target_time": 2592000, - "current_count": 7520 - }, - { - "label": "processor_C", - "target_count": 12000, - "target_time": 2592000, - "current_count": 9870 - } - ] -} - -// Response -{ - "status": "CONTRACT_UPDATION_SUCCEEDED" -} -``` - -### Invalidate Contract Example - -```json -// Request -{ - "id": "merchant_123" -} - -// Response -{ - "status": "CONTRACT_INVALIDATION_SUCCEEDED" -} -``` - -## Integration Notes - -- All requests should include appropriate authentication metadata -- JSON parameters in the `params` field should be properly escaped -- Contract targets should be set realistically based on historical processing volumes -- Target times should align with billing cycles (typically monthly) -- Contract-based routing works best when combined with success rate and elimination routing -- Maintain proper error handling for all API calls -- Consider resetting contracts at the beginning of each billing cycle - -## gRPCurl Examples - -The following examples demonstrate how to call the Contract Score Calculator API endpoints using gRPCurl. These examples assume the service is running on localhost at port 9000. - -### FetchContractScore - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123", - "params": "{\"payment_type\":\"card\"}", - "labels": ["processor_A", "processor_B", "processor_C"], - "config": { - "constants": [0.75, 1.25, 0.5], - "time_scale": { - "time_scale": "Month" - } - } -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ -localhost:9000 contract_routing.ContractScoreCalculator/FetchContractScore -``` - -### UpdateContract - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123", - "params": "{\"payment_type\":\"card\"}", - "labels_information": [ - { - "label": "processor_A", - "target_count": 15000, - "target_time": 2592000, - "current_count": 12450 - }, - { - "label": "processor_B", - "target_count": 10000, - "target_time": 2592000, - "current_count": 7520 - }, - { - "label": "processor_C", - "target_count": 12000, - "target_time": 2592000, - "current_count": 9870 - } - ] -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ -localhost:9000 contract_routing.ContractScoreCalculator/UpdateContract -``` - -### InvalidateContract - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123" -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ -localhost:9000 contract_routing.ContractScoreCalculator/InvalidateContract -``` - -### Listing Available Methods - -To discover available methods on the service: - -```bash -grpcurl -plaintext localhost:9000 list contract_routing.ContractScoreCalculator -``` - -### Viewing Method Details - -To see detailed information about a specific method: - -```bash -grpcurl -plaintext localhost:9000 describe contract_routing.ContractScoreCalculator.FetchContractScore -``` diff --git a/docs/api-reference/elimination.md b/docs/api-reference/elimination.md deleted file mode 100644 index 0a89a8a8..00000000 --- a/docs/api-reference/elimination.md +++ /dev/null @@ -1,404 +0,0 @@ -# Elimination Routing API Contracts - -## Overview - -The Elimination Analyser service provides endpoints for identifying and filtering out underperforming payment processors. This service is a critical component of the Dynamo routing system, helping improve payment success rates by preventing routing to processors with consistently high failure rates. - -## Service Definition - -```protobuf -service EliminationAnalyser { - rpc GetEliminationStatus (EliminationRequest) returns (EliminationResponse); - rpc UpdateEliminationBucket (UpdateEliminationBucketRequest) returns (UpdateEliminationBucketResponse); - rpc InvalidateBucket (InvalidateBucketRequest) returns (InvalidateBucketResponse); -} -``` - -## Authentication - -All endpoints require authentication. Authentication is handled via metadata in the gRPC request. The service supports multi-tenancy, which means elimination data is isolated per tenant. - -- Authentication requires an `x-api-key` header with a valid API key -- The `x-tenant-id` header is required to specify the tenant context -- Tenant ID is extracted from request metadata -- All operations verify tenant permissions before processing -- Multi-tenancy can be enabled/disabled via configuration - -## Endpoints - -### 1. GetEliminationStatus - -Determines which processors should be eliminated from routing consideration based on historical performance data. - -#### Request: `EliminationRequest` - -```protobuf -message EliminationRequest { - string id = 1; // Entity identifier - string params = 2; // Additional parameters for elimination analysis - repeated string labels = 3; // Labels (processors) to check for elimination - EliminationBucketConfig config = 4; // Configuration for elimination buckets -} - -message EliminationBucketConfig { - uint64 bucket_size = 1; // Maximum failures allowed before elimination - uint64 bucket_leak_interval_in_secs = 2; // Time interval after which failures are "forgotten" -} -``` - -#### Response: `EliminationResponse` - -```protobuf -message EliminationResponse { - repeated LabelWithStatus labels_with_status = 1; // Elimination status for each label -} - -message LabelWithStatus { - string label = 1; // Label identifier - EliminationInformation elimination_information = 2; // Elimination details -} - -message EliminationInformation { - BucketInformation entity = 1; // Entity-specific elimination information - BucketInformation global = 2; // Global elimination information -} - -message BucketInformation { - bool is_eliminated = 1; // Whether the processor should be eliminated - repeated string bucket_name = 2; // Bucket identifiers that triggered elimination -} -``` - -#### Behavior - -- Evaluates each processor (label) against failure thresholds at both entity and global levels -- Returns elimination status for each processor along with the specific buckets triggering elimination -- A processor can be eliminated at entity level, global level, or both -- Bucket information provides context about which failure conditions were met - -#### Process Flow - -1. Extract tenant ID from request metadata -2. Validate the request parameters -3. Extract entity ID, parameters, and processor labels -4. Convert the configuration to internal elimination bucket settings -5. Perform elimination analysis for each processor -6. Return detailed elimination status for each processor - ---- - -### 2. UpdateEliminationBucket - -Updates the failure records for specific processors, affecting future elimination decisions. - -#### Request: `UpdateEliminationBucketRequest` - -```protobuf -message UpdateEliminationBucketRequest { - string id = 1; // Entity identifier - string params = 2; // Additional parameters - repeated LabelWithBucketName labels_with_bucket_name = 3; // Processors with bucket information - EliminationBucketConfig config = 4; // Configuration for elimination buckets -} - -message LabelWithBucketName { - string label = 1; // Processor identifier - string bucket_name = 2; // Bucket to update (failure type) -} - -message EliminationBucketConfig { - uint64 bucket_size = 1; // Maximum failures allowed before elimination - uint64 bucket_leak_interval_in_secs = 2; // Time interval after which failures are "forgotten" -} -``` - -#### Response: `UpdateEliminationBucketResponse` - -```protobuf -message UpdateEliminationBucketResponse { - enum UpdationStatus { - BUCKET_UPDATION_SUCCEEDED = 0; - BUCKET_UPDATION_FAILED = 1; - } - UpdationStatus status = 1; // Status of the update operation -} -``` - -#### Behavior - -- Updates failure records for the specified processors and buckets -- Each bucket represents a specific failure type or condition -- Uses a "leaky bucket" algorithm where failures are counted until thresholds are met -- After the specified leak interval, failures are gradually removed from consideration -- Failure to update any processor's bucket will result in a failed status - -#### Process Flow - -1. Extract tenant ID from request metadata -2. Validate the request parameters -3. Extract entity ID, parameters, and processor-bucket mapping -4. Convert the configuration to internal elimination bucket settings -5. Update the elimination buckets for each processor -6. Return success/failure status of the operation - ---- - -### 3. InvalidateBucket - -Invalidates all elimination bucket data for a specific entity, effectively resetting its processor elimination history. - -#### Request: `InvalidateBucketRequest` - -```protobuf -message InvalidateBucketRequest { - string id = 1; // Entity identifier to invalidate -} -``` - -#### Response: `InvalidateBucketResponse` - -```protobuf -message InvalidateBucketResponse { - enum InvalidationStatus { - BUCKET_INVALIDATION_SUCCEEDED = 0; - BUCKET_INVALIDATION_FAILED = 1; - } - InvalidationStatus status = 1; // Status of the invalidation operation -} -``` - -#### Behavior - -- Removes all elimination bucket data for the specified entity -- This effectively resets the elimination status for all processors associated with the entity -- Useful for handling significant processor changes or clearing problematic data -- Does not affect global elimination data - -#### Process Flow - -1. Extract tenant ID from request metadata -2. Validate the request parameters -3. Extract entity ID to invalidate -4. Remove all elimination bucket data for the entity -5. Return success/failure status of the operation - -## Error Handling - -All endpoints return standard gRPC status codes: - -| Status Code | Description | When Used | -|-------------|-------------|-----------| -| `OK (0)` | Operation completed successfully | Normal successful operation | -| `NOT_FOUND (5)` | Required resource not found | Missing configuration, entity not found | -| `INVALID_ARGUMENT (3)` | Validation failed | Invalid or missing required parameters | -| `UNAUTHENTICATED (16)` | Authentication failed | Invalid or missing authentication credentials | -| `PERMISSION_DENIED (7)` | Authenticated user lacks permission | User not authorized for the operation | -| `INTERNAL (13)` | Internal server error | Unexpected errors during processing | - -## Multi-tenancy Support - -The service supports multi-tenancy with the following behavior: - -- All elimination data is isolated per tenant with no cross-tenant data access -- Tenant ID is extracted from request metadata -- Each tenant has its own elimination buckets and configurations -- Multi-tenancy can be disabled in configuration via `is_multi_tenancy_enabled` flag -- When disabled, a default tenant ID is used - -## Performance Considerations - -- **Leaky Bucket Algorithm**: Efficiently tracks failures without unlimited growth of data -- **Time-based Processing**: Automatically ages out old failures based on configuration -- **Optimized Storage**: Buckets are stored efficiently to minimize memory usage -- **Concurrent Processing**: Handles multiple elimination checks in parallel -- **Rust Implementation**: Implementation is in Rust for maximum efficiency and safety -- **Request Validation**: Validates requests early to fail fast and save processing resources - -## Example Usage - -### Get Elimination Status Example - -```json -// Request -{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels": ["processor_A", "processor_B", "processor_C"], - "config": { - "bucket_size": 5, - "bucket_leak_interval_in_secs": 3600 - } -} - -// Response -{ - "labels_with_status": [ - { - "label": "processor_A", - "elimination_information": { - "entity": { - "is_eliminated": false, - "bucket_name": [] - }, - "global": { - "is_eliminated": false, - "bucket_name": [] - } - } - }, - { - "label": "processor_B", - "elimination_information": { - "entity": { - "is_eliminated": true, - "bucket_name": ["authentication_failure"] - }, - "global": { - "is_eliminated": false, - "bucket_name": [] - } - } - }, - { - "label": "processor_C", - "elimination_information": { - "entity": { - "is_eliminated": true, - "bucket_name": ["network_error"] - }, - "global": { - "is_eliminated": true, - "bucket_name": ["network_error", "timeout"] - } - } - } - ] -} -``` - -### Update Elimination Bucket Example - -```json -// Request -{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels_with_bucket_name": [ - { - "label": "processor_A", - "bucket_name": "authentication_failure" - }, - { - "label": "processor_B", - "bucket_name": "network_error" - } - ], - "config": { - "bucket_size": 5, - "bucket_leak_interval_in_secs": 3600 - } -} - -// Response -{ - "status": "BUCKET_UPDATION_SUCCEEDED" -} -``` - -### Invalidate Bucket Example - -```json -// Request -{ - "id": "merchant_123" -} - -// Response -{ - "status": "BUCKET_INVALIDATION_SUCCEEDED" -} -``` - -## Integration Notes - -- All requests should include appropriate authentication metadata -- JSON parameters in the `params` field should be properly escaped -- Bucket names should represent meaningful failure categories for better analytics -- Consider the bucket_size and leak interval carefully based on traffic patterns -- Very small bucket sizes may lead to premature elimination -- Very large leak intervals may keep processors eliminated for too long -- Maintain proper error handling for all API calls - -## gRPCurl Examples - -The following examples demonstrate how to call the Elimination Analyser API endpoints using gRPCurl. These examples assume the service is running on localhost at port 9000. - -### GetEliminationStatus - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels": ["processor_A", "processor_B", "processor_C"], - "config": { - "bucket_size": 5, - "bucket_leak_interval_in_secs": 3600 - } -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ -localhost:9000 elimination.EliminationAnalyser/GetEliminationStatus -``` - -### UpdateEliminationBucket - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels_with_bucket_name": [ - { - "label": "processor_A", - "bucket_name": "authentication_failure" - }, - { - "label": "processor_B", - "bucket_name": "network_error" - } - ], - "config": { - "bucket_size": 5, - "bucket_leak_interval_in_secs": 3600 - } -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ -localhost:9000 elimination.EliminationAnalyser/UpdateEliminationBucket -``` - -### InvalidateBucket - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123" -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ -localhost:9000 elimination.EliminationAnalyser/InvalidateBucket -``` - -### Listing Available Methods - -To discover available methods on the service: - -```bash -grpcurl -plaintext localhost:9000 list elimination.EliminationAnalyser -``` - -### Viewing Method Details - -To see detailed information about a specific method: - -```bash -grpcurl -plaintext localhost:9000 describe elimination.EliminationAnalyser.GetEliminationStatus -``` diff --git a/docs/api-reference/endpoint/activateRoutingRule.mdx b/docs/api-reference/endpoint/activateRoutingRule.mdx new file mode 100644 index 00000000..16c99020 --- /dev/null +++ b/docs/api-reference/endpoint/activateRoutingRule.mdx @@ -0,0 +1,4 @@ +--- +title: "Activate Routing Rule" +openapi: "POST /routing/activate" +--- diff --git a/docs/api-reference/endpoint/createMerchant.mdx b/docs/api-reference/endpoint/createMerchant.mdx new file mode 100644 index 00000000..65411968 --- /dev/null +++ b/docs/api-reference/endpoint/createMerchant.mdx @@ -0,0 +1,4 @@ +--- +title: "Create Merchant" +openapi: "POST /merchant-account/create" +--- diff --git a/docs/api-reference/endpoint/createRoutingRule.mdx b/docs/api-reference/endpoint/createRoutingRule.mdx new file mode 100644 index 00000000..353ee9fc --- /dev/null +++ b/docs/api-reference/endpoint/createRoutingRule.mdx @@ -0,0 +1,4 @@ +--- +title: "Create Routing Rule" +openapi: "POST /routing/create" +--- diff --git a/docs/api-reference/endpoint/createRuleConfig.mdx b/docs/api-reference/endpoint/createRuleConfig.mdx new file mode 100644 index 00000000..08b4b20c --- /dev/null +++ b/docs/api-reference/endpoint/createRuleConfig.mdx @@ -0,0 +1,4 @@ +--- +title: "Create Rule Config" +openapi: "POST /rule/create" +--- diff --git a/docs/api-reference/endpoint/decideGateway.mdx b/docs/api-reference/endpoint/decideGateway.mdx new file mode 100644 index 00000000..d954c5fb --- /dev/null +++ b/docs/api-reference/endpoint/decideGateway.mdx @@ -0,0 +1,4 @@ +--- +title: "Decide Gateway" +openapi: "POST /decide-gateway" +--- diff --git a/docs/api-reference/endpoint/deleteMerchant.mdx b/docs/api-reference/endpoint/deleteMerchant.mdx new file mode 100644 index 00000000..934ba803 --- /dev/null +++ b/docs/api-reference/endpoint/deleteMerchant.mdx @@ -0,0 +1,4 @@ +--- +title: "Delete Merchant" +openapi: "DELETE /merchant-account/{merchantId}" +--- diff --git a/docs/api-reference/endpoint/deleteRuleConfig.mdx b/docs/api-reference/endpoint/deleteRuleConfig.mdx new file mode 100644 index 00000000..64a58043 --- /dev/null +++ b/docs/api-reference/endpoint/deleteRuleConfig.mdx @@ -0,0 +1,4 @@ +--- +title: "Delete Rule Config" +openapi: "POST /rule/delete" +--- diff --git a/docs/api-reference/endpoint/evaluateRoutingRule.mdx b/docs/api-reference/endpoint/evaluateRoutingRule.mdx new file mode 100644 index 00000000..a6569396 --- /dev/null +++ b/docs/api-reference/endpoint/evaluateRoutingRule.mdx @@ -0,0 +1,4 @@ +--- +title: "Evaluate Routing Rule" +openapi: "POST /routing/evaluate" +--- diff --git a/docs/api-reference/endpoint/getActiveRoutingRule.mdx b/docs/api-reference/endpoint/getActiveRoutingRule.mdx new file mode 100644 index 00000000..1619bffc --- /dev/null +++ b/docs/api-reference/endpoint/getActiveRoutingRule.mdx @@ -0,0 +1,4 @@ +--- +title: "Get Active Routing Rule" +openapi: "POST /routing/list/active/{created_by}" +--- diff --git a/docs/api-reference/endpoint/getMerchant.mdx b/docs/api-reference/endpoint/getMerchant.mdx new file mode 100644 index 00000000..05ad50f7 --- /dev/null +++ b/docs/api-reference/endpoint/getMerchant.mdx @@ -0,0 +1,4 @@ +--- +title: "Get Merchant" +openapi: "GET /merchant-account/{merchantId}" +--- diff --git a/docs/api-reference/endpoint/getRuleConfig.mdx b/docs/api-reference/endpoint/getRuleConfig.mdx new file mode 100644 index 00000000..f4ed063b --- /dev/null +++ b/docs/api-reference/endpoint/getRuleConfig.mdx @@ -0,0 +1,4 @@ +--- +title: "Get Rule Config" +openapi: "POST /rule/get" +--- diff --git a/docs/api-reference/endpoint/healthCheck.mdx b/docs/api-reference/endpoint/healthCheck.mdx new file mode 100644 index 00000000..8f7349b3 --- /dev/null +++ b/docs/api-reference/endpoint/healthCheck.mdx @@ -0,0 +1,4 @@ +--- +title: "Health Check" +openapi: "GET /health" +--- diff --git a/docs/api-reference/endpoint/listRoutingRules.mdx b/docs/api-reference/endpoint/listRoutingRules.mdx new file mode 100644 index 00000000..c9c79ef5 --- /dev/null +++ b/docs/api-reference/endpoint/listRoutingRules.mdx @@ -0,0 +1,4 @@ +--- +title: "List Routing Rules" +openapi: "POST /routing/list/{merchantId}" +--- diff --git a/docs/api-reference/endpoint/updateGatewayScore.mdx b/docs/api-reference/endpoint/updateGatewayScore.mdx new file mode 100644 index 00000000..d6b5a1e9 --- /dev/null +++ b/docs/api-reference/endpoint/updateGatewayScore.mdx @@ -0,0 +1,4 @@ +--- +title: "Update Gateway Score" +openapi: "POST /update-gateway-score" +--- diff --git a/docs/api-reference/endpoint/updateRuleConfig.mdx b/docs/api-reference/endpoint/updateRuleConfig.mdx new file mode 100644 index 00000000..5fa04701 --- /dev/null +++ b/docs/api-reference/endpoint/updateRuleConfig.mdx @@ -0,0 +1,4 @@ +--- +title: "Update Rule Config" +openapi: "POST /rule/update" +--- diff --git a/docs/api-reference/success-rate.md b/docs/api-reference/success-rate.md deleted file mode 100644 index baa073f2..00000000 --- a/docs/api-reference/success-rate.md +++ /dev/null @@ -1,485 +0,0 @@ -# Success Rate API Contracts - -## Overview - -The Success Rate Calculator service provides endpoints for calculating, updating, and managing success rates for payment routing decisions. This service is a core component of the Dynamo routing system, helping optimize payment flows by directing transactions to processors with the highest historical success rates. - -## Service Definition - -```protobuf -service SuccessRateCalculator { - rpc FetchSuccessRate (CalSuccessRateRequest) returns (CalSuccessRateResponse); - rpc UpdateSuccessRateWindow (UpdateSuccessRateWindowRequest) returns (UpdateSuccessRateWindowResponse); - rpc InvalidateWindows (InvalidateWindowsRequest) returns (InvalidateWindowsResponse); - rpc FetchEntityAndGlobalSuccessRate (CalGlobalSuccessRateRequest) returns (CalGlobalSuccessRateResponse); -} -``` - -## Authentication - -All endpoints require authentication. Authentication is handled via metadata in the gRPC request. The service supports multi-tenancy, which means data and routing decisions are isolated per tenant. - -- Authentication is performed using the `Authenticate` trait -- Authentication requires an `x-api-key` header with a valid API key -- The `x-tenant-id` header is required to specify the tenant context -- Tenant and merchant IDs are extracted from authentication info -- All operations verify authentication before processing - -## Endpoints - -### 1. FetchSuccessRate - -Calculates and returns success rates for a specific entity and its associated labels. - -#### Request: `CalSuccessRateRequest` - -```protobuf -message CalSuccessRateRequest { - string id = 1; // Entity identifier - string params = 2; // Additional parameters for success rate calculation - repeated string labels = 3; // Labels to calculate success rates for - CalSuccessRateConfig config = 4; // Configuration for calculation -} - -message CalSuccessRateConfig { - uint32 min_aggregates_size = 1; // Minimum number of data points required - double default_success_rate = 2; // Default rate to use if insufficient data - optional SuccessRateSpecificityLevel specificity_level = 3; // ENTITY or GLOBAL level -} - -enum SuccessRateSpecificityLevel { - ENTITY = 0; - GLOBAL = 1; -} -``` - -#### Response: `CalSuccessRateResponse` - -```protobuf -message CalSuccessRateResponse { - repeated LabelWithScore labels_with_score = 1; // Success rates for each label -} - -message LabelWithScore { - double score = 1; // Success rate score (0.0 to 1.0) - string label = 2; // Label identifier -} -``` - -#### Behavior - -- Returns calculated success rates for requested labels based on historical data -- If insufficient data exists for a label, uses the default success rate -- Applied specificity level determines if entity-specific or global data is used -- Success rates are returned as scores between 0.0 and 1.0 (or as percentages) -- Labels are returned in descending order of scores - -#### Process Flow - -1. Authenticate the request and extract tenant/merchant information -2. Fetch configuration settings for the tenant -3. Extract tenant ID from request (for multi-tenancy support) -4. Validate the request parameters -5. Extract entity ID, parameters, and labels -6. Calculate success rates based on historical data -7. Return the scores with associated labels - -#### Metrics - -- `SUCCESS_BASED_ROUTING_REQUEST`: Counts total requests -- `SUCCESS_BASED_ROUTING_DECISION_REQUEST_TIME`: Measures processing time -- `SUCCESS_BASED_ROUTING_SUCCESSFUL_RESPONSE_COUNT`: Counts successful responses - ---- - -### 2. UpdateSuccessRateWindow - -Updates the success/failure status for a set of labels, affecting future routing decisions. - -#### Request: `UpdateSuccessRateWindowRequest` - -```protobuf -message UpdateSuccessRateWindowRequest { - string id = 1; // Entity identifier - string params = 2; // Additional parameters - repeated LabelWithStatus labels_with_status = 3; // Entity-specific labels with success/failure status - UpdateSuccessRateWindowConfig config = 4; // Update configuration - repeated LabelWithStatus global_labels_with_status = 5; // Global labels with success/failure status -} - -message LabelWithStatus { - string label = 1; // Label identifier - bool status = 2; // Success (true) or failure (false) status -} - -message UpdateSuccessRateWindowConfig { - uint32 max_aggregates_size = 1; // Maximum size of aggregation window - CurrentBlockThreshold current_block_threshold = 2; // Threshold configuration -} - -message CurrentBlockThreshold { - optional uint64 duration_in_mins = 1; // Duration-based threshold in minutes - uint64 max_total_count = 2; // Count-based threshold -} -``` - -#### Response: `UpdateSuccessRateWindowResponse` - -```protobuf -message UpdateSuccessRateWindowResponse { - enum UpdationStatus { - WINDOW_UPDATION_SUCCEEDED = 0; - WINDOW_UPDATION_FAILED = 1; - } - UpdationStatus status = 1; // Status of the update operation -} -``` - -#### Behavior - -- Updates both entity-specific and global success rate windows -- Applies the provided status (success/failure) to each label -- Maintains a sliding window of transaction results based on configuration -- Will return failure status if either entity or global updates fail -- Uses configured thresholds to determine when to rotate windows - -#### Process Flow - -1. Authenticate the request and extract tenant/merchant information -2. Fetch configuration settings for the tenant -3. Extract tenant ID from request (for multi-tenancy support) -4. Validate the request parameters -5. Extract entity ID, parameters, and label status information -6. Update the entity-specific success rate window -7. Set the specificity level to Global -8. Update the global success rate window -9. Return success/failure status of the operation - -#### Metrics - -- `SUCCESS_BASED_ROUTING_UPDATE_WINDOW_DECISION_REQUEST_TIME`: Measures processing time -- `SUCCESS_BASED_ROUTING_UPDATE_WINDOW_COUNT`: Counts window update requests - ---- - -### 3. InvalidateWindows - -Invalidates success rate windows for a specific entity, effectively resetting its success rate history. - -#### Request: `InvalidateWindowsRequest` - -```protobuf -message InvalidateWindowsRequest { - string id = 1; // Entity identifier to invalidate -} -``` - -#### Response: `InvalidateWindowsResponse` - -```protobuf -message InvalidateWindowsResponse { - enum InvalidationStatus { - WINDOW_INVALIDATION_SUCCEEDED = 0; - WINDOW_INVALIDATION_FAILED = 1; - } - InvalidationStatus status = 1; // Status of the invalidation operation -} -``` - -#### Behavior - -- Removes all success rate window data for the specified entity -- This effectively resets the success rate calculation for this entity -- Useful for handling significant processor changes or clearing problematic data -- Does not affect global success rate data - -#### Process Flow - -1. Authenticate the request -2. Extract tenant ID from request (for multi-tenancy support) -3. Validate the request parameters -4. Extract entity ID to invalidate -5. Remove all success rate window data for the entity -6. Return success/failure status of the operation - ---- - -### 4. FetchEntityAndGlobalSuccessRate - -Fetches both entity-specific and global success rates in a single request. - -#### Request: `CalGlobalSuccessRateRequest` - -```protobuf -message CalGlobalSuccessRateRequest { - string entity_id = 1; // Entity identifier - string entity_params = 2; // Entity-specific parameters - repeated string entity_labels = 3; // Labels for entity-specific calculation - repeated string global_labels = 4; // Labels for global calculation - CalGlobalSuccessRateConfig config = 5; // Configuration -} - -message CalGlobalSuccessRateConfig { - uint32 entity_min_aggregates_size = 1; // Minimum aggregates for entity calculation - double entity_default_success_rate = 2; // Default success rate for entity -} -``` - -#### Response: `CalGlobalSuccessRateResponse` - -```protobuf -message CalGlobalSuccessRateResponse { - repeated LabelWithScore entity_scores_with_labels = 1; // Entity-specific success rates - repeated LabelWithScore global_scores_with_labels = 2; // Global success rates -} -``` - -#### Behavior - -- Performs parallel calculation of both entity and global success rates -- Allows for comparison between entity-specific and global performance -- Useful for analytics and decision-making about routing strategies -- Returns both sets of scores ordered by success rate - -#### Process Flow - -1. Authenticate the request -2. Extract tenant ID from request (for multi-tenancy support) -3. Validate the request parameters -4. Extract entity ID, parameters, and labels for both entity and global calculations -5. Create entity-specific and global configurations -6. Perform both calculations in parallel using tokio::try_join! -7. Format the results into the response structure -8. Return both sets of success rates - -#### Metrics - -- `SUCCESS_BASED_ROUTING_METRICS_REQUEST`: Counts metrics requests -- `SUCCESS_BASED_ROUTING_METRICS_DECISION_REQUEST_TIME`: Measures processing time -- `SUCCESS_BASED_ROUTING__METRICS_SUCCESSFUL_RESPONSE_COUNT`: Counts successful responses - -## Error Handling - -All endpoints return standard gRPC status codes: - -| Status Code | Description | When Used | -| ----------------------- | ----------------------------------- | --------------------------------------------- | -| `OK (0)` | Operation completed successfully | Normal successful operation | -| `NOT_FOUND (5)` | Required resource not found | Missing configuration, entity not found | -| `INVALID_ARGUMENT (3)` | Validation failed | Invalid or missing required parameters | -| `UNAUTHENTICATED (16)` | Authentication failed | Invalid or missing authentication credentials | -| `PERMISSION_DENIED (7)` | Authenticated user lacks permission | User not authorized for the operation | -| `INTERNAL (13)` | Internal server error | Unexpected errors during processing | - -## Multi-tenancy Support - -The service supports multi-tenancy with the following behavior: - -- All data is isolated per tenant with no cross-tenant data access -- Tenant ID is extracted from request metadata using authentication info -- Each tenant has its own success rate windows and calculations -- Multi-tenancy can be disabled in configuration via `is_multi_tenancy_enabled` flag -- When disabled, a default tenant ID is used - -## Performance Considerations - -- **Optimized Processing**: The service is optimized for high throughput and low latency -- **Caching**: Success rate calculations are cached for performance -- **Efficient Storage**: Windows are stored efficiently to minimize memory usage -- **Metrics Collection**: Comprehensive metrics are collected for performance monitoring -- **Rust Implementation**: Implementation is in Rust for maximum efficiency and safety -- **Parallel Processing**: Uses concurrent processing where appropriate (e.g., in FetchEntityAndGlobalSuccessRate) -- **Request Validation**: Validates requests early to fail fast and save processing resources - -## Example Usage - -### Fetch Success Rate Example - -```json -// Request -{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels": ["processor_A", "processor_B", "processor_C"], - "config": { - "min_aggregates_size": 10, - "default_success_rate": 0.5, - "specificity_level": "ENTITY" - } -} - -// Response -{ - "labels_with_score": [ - {"score": 0.95, "label": "processor_A"}, - {"score": 0.82, "label": "processor_B"}, - {"score": 0.73, "label": "processor_C"} - ] -} -``` - -### Update Success Rate Window Example - -```json -// Request -{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels_with_status": [ - {"label": "processor_A", "status": true}, - {"label": "processor_B", "status": false} - ], - "global_labels_with_status": [ - {"label": "processor_A", "status": true}, - {"label": "processor_B", "status": false} - ], - "config": { - "max_aggregates_size": 100, - "current_block_threshold": { - "duration_in_mins": 60, - "max_total_count": 1000 - } - } -} - -// Response -{ - "status": "WINDOW_UPDATION_SUCCEEDED" -} -``` - -### Invalidate Windows Example - -```json -// Request -{ - "id": "merchant_123" -} - -// Response -{ - "status": "WINDOW_INVALIDATION_SUCCEEDED" -} -``` - -### Fetch Entity and Global Success Rate Example - -```json -// Request -{ - "entity_id": "merchant_123", - "entity_params": "{\"payment_method\":\"card\"}", - "entity_labels": ["processor_A", "processor_B", "processor_C"], - "global_labels": ["processor_A", "processor_B", "processor_C", "processor_D"], - "config": { - "entity_min_aggregates_size": 10, - "entity_default_success_rate": 0.5 - } -} - -// Response -{ - "entity_scores_with_labels": [ - {"score": 0.95, "label": "processor_A"}, - {"score": 0.82, "label": "processor_B"}, - {"score": 0.73, "label": "processor_C"} - ], - "global_scores_with_labels": [ - {"score": 0.92, "label": "processor_A"}, - {"score": 0.85, "label": "processor_C"}, - {"score": 0.78, "label": "processor_B"}, - {"score": 0.70, "label": "processor_D"} - ] -} -``` - -## Integration Notes - -- All requests should include appropriate authentication metadata -- JSON parameters in the `params` field should be properly escaped -- Review metrics to monitor system performance -- Consider implementing client-side retries for transient failures -- Cache routing decisions where appropriate to improve performance -- Maintain proper error handling for all API calls - -## gRPCurl Examples - -The following examples demonstrate how to call the Success Rate API endpoints using gRPCurl. These examples assume the service is running on localhost at port 9000. -We wouldn't require configs as Dynamo will automatically fetch that from he specified profile. - -### FetchSuccessRate - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels": ["processor_A", "processor_B", "processor_C"], -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ --H 'x-profile-id: profile_id' \ -localhost:9000 success_rate.SuccessRateCalculator/FetchSuccessRate -``` - -### UpdateSuccessRateWindow - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels_with_status": [ - {"label": "processor_A", "status": true}, - {"label": "processor_B", "status": false} - ], - "global_labels_with_status": [ - {"label": "processor_A", "status": true}, - {"label": "processor_B", "status": false} - ] -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ --H 'x-profile-id: profile_id' \ -localhost:9000 success_rate.SuccessRateCalculator/UpdateSuccessRateWindow -``` - -### InvalidateWindows - -```bash -grpcurl -plaintext -d '{ - "id": "merchant_123" -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ -localhost:9000 success_rate.SuccessRateCalculator/InvalidateWindows -``` - -### FetchEntityAndGlobalSuccessRate - -```bash -grpcurl -plaintext -d '{ - "entity_id": "merchant_123", - "entity_params": "{\"payment_method\":\"card\"}", - "entity_labels": ["processor_A", "processor_B", "processor_C"], - "global_labels": ["processor_A", "processor_B", "processor_C", "processor_D"] -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ --H 'x-profile-id: profile_id' \ -localhost:9000 success_rate.SuccessRateCalculator/FetchEntityAndGlobalSuccessRate -``` - -### Listing Available Methods - -To discover available methods on the service: - -```bash -grpcurl -plaintext localhost:9000 list success_rate.SuccessRateCalculator -``` - -### Viewing Method Details - -To see detailed information about a specific method: - -```bash -grpcurl -plaintext localhost:9000 describe success_rate.SuccessRateCalculator.FetchSuccessRate -``` diff --git a/docs/introduction.mdx b/docs/introduction.mdx new file mode 100644 index 00000000..cb9130b6 --- /dev/null +++ b/docs/introduction.mdx @@ -0,0 +1,90 @@ +--- +title: "Decision Engine" +description: "Open-source payment gateway routing service by Juspay" +--- + +## What is Decision Engine? + +Decision Engine is a real-time payment gateway routing service. Given a payment and a list of eligible gateways, it returns the **optimal gateway** to route to — using live success-rate scoring, rule-based logic, and automatic failure elimination. + +## How it works + +``` +Your Payment Orchestrator + ↓ +POST /decide-gateway ←── payment context + eligible gateways + ↓ +┌─────────────────────────────────────┐ +│ Filter Phase (25+ filters) │ +│ currency · card brand · auth type │ +│ EMI · payment method · surcharge │ +├─────────────────────────────────────┤ +│ Score Phase │ +│ success rate v3 · elimination │ +│ contract scores · outage detection │ +└─────────────────────────────────────┘ + ↓ +{ "decided_gateway": "stripe", ... } +``` + +## Quick start + +**1. Create a merchant** + +```bash +curl -X POST http://localhost:8080/merchant-account/create \ + -H "Content-Type: application/json" \ + -d '{"merchant_id": "my_merchant"}' +``` + +**2. Route a payment** + +```bash +curl -X POST http://localhost:8080/decide-gateway \ + -H "Content-Type: application/json" \ + -d '{ + "merchantId": "my_merchant", + "paymentInfo": { + "paymentId": "pay_001", + "amount": 1000.0, + "currency": "USD", + "paymentType": "ORDER_PAYMENT", + "paymentMethodType": "CARD", + "paymentMethod": "CREDIT" + }, + "eligibleGatewayList": ["stripe", "paypal", "adyen"], + "rankingAlgorithm": "SrBasedRouting", + "eliminationEnabled": false + }' +``` + +**3. Record the outcome** + +```bash +curl -X POST http://localhost:8080/update-gateway-score \ + -H "Content-Type: application/json" \ + -d '{ + "merchantId": "my_merchant", + "gateway": "stripe", + "paymentId": "pay_001", + "status": "CHARGED" + }' +``` + +## Routing algorithms + +| Algorithm | Description | +|-----------|-------------| +| `SrBasedRouting` | Ranks gateways by real-time success rate. Default. | +| `PlBasedRouting` | Uses merchant-defined priority logic rules | +| `NtwBasedRouting` | Network-based routing for debit cards | + +## Running locally + +```bash +docker compose --profile dashboard-postgres up -d +curl http://localhost:8080/health +# {"message":"Health is good"} +``` + +**Dashboard**: http://localhost:8081/dashboard/ diff --git a/docs/local-setup.md b/docs/local-setup.md new file mode 100644 index 00000000..fb778113 --- /dev/null +++ b/docs/local-setup.md @@ -0,0 +1,350 @@ +# Local Development Setup Guide + +Complete guide for setting up Decision Engine locally with Docker, Kubernetes (Helm), or from source. + +## Table of Contents + +- [Prerequisites](#prerequisites) +- [Quick Start](#quick-start) +- [Docker Compose Profiles](#docker-compose-profiles) +- [Setup Modes](#setup-modes) + - [1. PostgreSQL with Dashboard (Recommended)](#1-postgresql-with-dashboard-recommended) + - [2. PostgreSQL Only](#2-postgresql-only) + - [3. MySQL with Dashboard](#3-mysql-with-dashboard) + - [4. MySQL Only](#4-mysql-only) + - [5. With Monitoring](#5-with-monitoring) +- [Optional Components](#optional-components) +- [Configuration](#configuration) +- [Verifying Installation](#verifying-installation) +- [Troubleshooting](#troubleshooting) + +--- + +## Prerequisites + +### Common Requirements + +| Tool | Version | Purpose | +|------|---------|---------| +| Git | 2.0+ | Clone repository | +| Docker | 20.0+ | Container runtime | +| Docker Compose | 2.0+ | Multi-container orchestration | + +### Platform-Specific Dependencies + +#### Ubuntu/Debian + +```bash +sudo apt-get update +sudo apt-get install -y pkg-config libssl-dev protobuf-compiler libpq-dev curl git +``` + +#### macOS + +```bash +brew install pkg-config openssl protobuf postgresql curl git +``` + +--- + +## Quick Start + +```bash +git clone https://github.com/juspay/decision-engine.git +cd decision-engine +docker compose --profile dashboard-postgres up -d +``` + +Access: +- **API**: http://localhost:8080/health +- **Dashboard**: http://localhost:8081/dashboard/ +- **Documentation**: http://localhost:8081/introduction + +--- + +## Docker Compose Profiles + +Profiles control which services are started. **You must specify at least one profile** - nothing runs by default. + +| Profile | Database | Dashboard | Redis | Services Started | +|---------|----------|-----------|-------|------------------| +| `postgres` | PostgreSQL | ❌ | ✅ | 4 services | +| `dashboard-postgres` | PostgreSQL | ✅ | ✅ | 6 services | +| `mysql` | MySQL | ❌ | ✅ | 5 services | +| `dashboard-mysql` | MySQL | ✅ | ✅ | 7 services | +| `monitoring` | N/A | Grafana | N/A | Prometheus + Grafana | +| `groovy` | N/A | N/A | N/A | Groovy Runner (optional) | + +### Combining Profiles + +```bash +# PostgreSQL + Dashboard + Monitoring +docker compose --profile dashboard-postgres --profile monitoring up -d + +# PostgreSQL + Groovy Runner +docker compose --profile postgres --profile groovy up -d + +# MySQL + Dashboard + Monitoring + Groovy +docker compose --profile dashboard-mysql --profile monitoring --profile groovy up -d +``` + +--- + +## Setup Modes + +### 1. PostgreSQL with Dashboard (Recommended) + +Best for local development with web UI and documentation. + +```bash +docker compose --profile dashboard-postgres up -d +``` + +**Services:** +| Service | Port | Description | +|---------|------|-------------| +| Decision Engine API | 8080 | Main REST API | +| Nginx Proxy | 8081 | Dashboard + Docs proxy | +| PostgreSQL | 5432 | Primary database | +| Redis | 6379 | Cache store | +| Mintlify Docs | 3000 (internal) | Documentation site | +| DB Migrator | N/A | Runs migrations | + +**URLs:** +- API: http://localhost:8080/health +- Dashboard: http://localhost:8081/dashboard/ +- Docs: http://localhost:8081/introduction + +### 2. PostgreSQL Only + +Lightweight setup for API-only testing. + +```bash +docker compose --profile postgres up -d +``` + +**Services:** +| Service | Port | Description | +|---------|------|-------------| +| Decision Engine API | 8080 | Main REST API | +| PostgreSQL | 5432 | Primary database | +| Redis | 6379 | Cache store | +| DB Migrator | N/A | Runs migrations | + +**URL:** http://localhost:8080/health + +### 3. MySQL with Dashboard + +Alternative database with full UI stack. + +```bash +docker compose --profile dashboard-mysql up -d +``` + +**Services:** +| Service | Port | Description | +|---------|------|-------------| +| Decision Engine API | 8080 | Main REST API | +| Nginx Proxy | 8081 | Dashboard + Docs proxy | +| MySQL | 3306 | Primary database | +| Redis | 6379 | Cache store | +| Mintlify Docs | 3000 (internal) | Documentation site | +| DB Migrator | N/A | MySQL migrations | +| Routing Config | N/A | Initial config setup | + +### 4. MySQL Only + +MySQL backend without dashboard. + +```bash +docker compose --profile mysql up -d +``` + +### 5. With Monitoring + +Add Prometheus metrics and Grafana dashboards to any profile. + +```bash +# With PostgreSQL dashboard +docker compose --profile dashboard-postgres --profile monitoring up -d + +# With MySQL only +docker compose --profile mysql --profile monitoring up -d +``` + +**Additional Services:** +| Service | Port | Description | +|---------|------|-------------| +| Prometheus | 9090 | Metrics collection | +| Grafana | 3000 | Visualization dashboards | + +--- + +## Optional Components + +### Groovy Runner + +Enables Groovy scripting support (needed for dynamic routing rules). + +```bash +# Add to any profile +docker compose --profile postgres --profile groovy up -d +``` + +**Profile:** `groovy` (pre-built image) or `groovy-local` (build from source) + +**Port:** 8085 + +--- + +## Configuration + +### Environment Variables + +Set in `docker-compose.yaml` or create `.env` file: + +```bash +# Database URLs +export DATABASE_URL="postgresql://db_user:db_pass@localhost:5432/decision_engine_db" + +# Groovy Runner (if using) +export GROOVY_RUNNER_HOST="host.docker.internal:8085" +``` + +### Configuration Files + +| File | Purpose | +|------|---------| +| `config/development.toml` | Local development settings | +| `config/docker-configuration.toml` | Docker deployment settings | + +--- + +## Verifying Installation + +### Health Check + +```bash +curl http://localhost:8080/health +``` + +Expected: `{"message":"Health is good"}` + +### API Test + +```bash +curl -X POST http://localhost:8080/decide-gateway \ + -H "Content-Type: application/json" \ + -d '{ + "merchantId": "test_merchant1", + "eligibleGatewayList": ["stripe", "adyen"], + "paymentInfo": { + "paymentId": "test_123", + "amount": 100.50, + "currency": "USD" + } + }' +``` + +### Dashboard Access + +Open browser to: http://localhost:8081/dashboard/ + +--- + +## Troubleshooting + +### Port Already in Use + +**Error:** `Port 8080 is already in use` + +**Solution:** +```bash +lsof -ti:8080 | xargs kill -9 +# or change ports in docker-compose.yaml +``` + +### Container Conflicts + +**Error:** `container name "X" is already in use` + +**Solution:** +```bash +docker compose --profile down +docker system prune -f +docker compose --profile up -d +``` + +### Database Connection Failed + +**Error:** `Connection refused` or `database does not exist` + +**Solutions:** + +1. Check database is running: + ```bash + docker ps | grep postgres + ``` + +2. Verify migrations ran: + ```bash + docker logs db-migrator-postgres + ``` + +3. Restart with fresh state: + ```bash + docker compose --profile postgres down -v + docker compose --profile postgres up -d + ``` + +### Dashboard Shows Old Version + +The `website/dist` folder contains old build artifacts. + +**Solution:** +```bash +cd website +npm install +npm run build +cd .. +docker restart open-router-nginx +``` + +### Profile Not Found + +**Error:** `service "X" has neither an image nor a build context` + +**Cause:** Missing profile flag + +**Solution:** Always specify a profile: +```bash +# Wrong +docker compose up -d + +# Correct +docker compose --profile postgres up -d +``` + +--- + +## Stopping Services + +```bash +# Stop specific profile +docker compose --profile dashboard-postgres down + +# Stop all profiles and remove volumes +docker compose --profile dashboard-postgres --profile monitoring down -v + +# Clean up everything +docker system prune -af --volumes +``` + +--- + +## Next Steps + +- [API Reference](api-reference.md) +- [Configuration Guide](configuration.md) +- [MySQL Setup Guide](setup-guide-mysql.md) +- [PostgreSQL Setup Guide](setup-guide-postgres.md) diff --git a/docs/logo/dark.svg b/docs/logo/dark.svg new file mode 100644 index 00000000..57d3d833 --- /dev/null +++ b/docs/logo/dark.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/logo/light.svg b/docs/logo/light.svg new file mode 100644 index 00000000..57d3d833 --- /dev/null +++ b/docs/logo/light.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/mint.json b/docs/mint.json new file mode 100644 index 00000000..408ae864 --- /dev/null +++ b/docs/mint.json @@ -0,0 +1,73 @@ +{ + "$schema": "https://mintlify.com/schema.json", + "name": "Decision Engine", + "logo": { + "dark": "/logo/dark.svg", + "light": "/logo/light.svg" + }, + "favicon": "/favicon.svg", + "colors": { + "primary": "#0069ED", + "light": "#4D9CFF", + "dark": "#0050B4" + }, + "openapi": ["openapi.json"], + "api": { + "baseUrl": "http://localhost:8080", + "playground": { + "mode": "show" + } + }, + "navigation": [ + { + "group": "Overview", + "pages": ["introduction"] + }, + { + "group": "Health", + "pages": ["api-reference/endpoint/healthCheck"] + }, + { + "group": "Gateway Decision", + "pages": [ + "api-reference/endpoint/decideGateway" + ] + }, + { + "group": "Score Feedback", + "pages": [ + "api-reference/endpoint/updateGatewayScore" + ] + }, + { + "group": "Merchant Account", + "pages": [ + "api-reference/endpoint/createMerchant", + "api-reference/endpoint/getMerchant", + "api-reference/endpoint/deleteMerchant" + ] + }, + { + "group": "Routing Rules", + "pages": [ + "api-reference/endpoint/createRoutingRule", + "api-reference/endpoint/activateRoutingRule", + "api-reference/endpoint/listRoutingRules", + "api-reference/endpoint/getActiveRoutingRule", + "api-reference/endpoint/evaluateRoutingRule" + ] + }, + { + "group": "Rule Configuration", + "pages": [ + "api-reference/endpoint/createRuleConfig", + "api-reference/endpoint/getRuleConfig", + "api-reference/endpoint/updateRuleConfig", + "api-reference/endpoint/deleteRuleConfig" + ] + } + ], + "footerSocials": { + "github": "https://github.com/juspay/decision-engine" + } +} diff --git a/docs/openapi.json b/docs/openapi.json new file mode 100644 index 00000000..4c29ee3e --- /dev/null +++ b/docs/openapi.json @@ -0,0 +1,815 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Decision Engine", + "description": "Open-source payment gateway routing service by Juspay. Selects the optimal payment processor for each transaction in real-time using success-rate scoring, rule-based routing, and elimination logic.", + "version": "1.2.1", + "contact": { + "name": "Juspay", + "url": "https://github.com/juspay/decision-engine" + }, + "license": { + "name": "AGPL-3.0", + "url": "https://www.gnu.org/licenses/agpl-3.0.html" + } + }, + "servers": [ + { + "url": "http://localhost:8080", + "description": "Local development" + } + ], + "tags": [ + { "name": "Health", "description": "Service liveness check" }, + { "name": "Gateway Decision", "description": "Core routing decision APIs" }, + { "name": "Score Feedback", "description": "Feed transaction outcomes back to improve SR scoring" }, + { "name": "Merchant Account", "description": "Merchant configuration management" }, + { "name": "Routing Rules", "description": "Euclid declarative routing rules engine" }, + { "name": "Rule Configuration", "description": "Service-level SR/elimination config" } + ], + "paths": { + "/health": { + "get": { + "operationId": "healthCheck", + "tags": ["Health"], + "summary": "Health check", + "description": "Returns a simple health status. Use this to verify the service is running.", + "responses": { + "200": { + "description": "Service is healthy", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HealthResponse" }, + "example": { "message": "Health is good" } + } + } + } + } + } + }, + "/decide-gateway": { + "post": { + "operationId": "decideGateway", + "tags": ["Gateway Decision"], + "summary": "Decide gateway", + "description": "Core routing decision API. Given a payment context and a list of eligible gateways, returns the optimal gateway to route to.\n\nThe engine applies a sequence of filters (currency, card brand, auth type, EMI, etc.) then scores remaining gateways using success rate history, elimination status, and contract obligations.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/DecideGatewayRequest" }, + "examples": { + "sr_routing": { + "summary": "SR-based routing", + "value": { + "merchantId": "test_merchant", + "paymentInfo": { + "paymentId": "pay_001", + "amount": 1000.0, + "currency": "USD", + "country": "US", + "customerId": "cust_123", + "paymentType": "ORDER_PAYMENT", + "paymentMethodType": "CARD", + "paymentMethod": "CREDIT", + "authType": "THREE_DS", + "cardIsin": "411111" + }, + "eligibleGatewayList": ["stripe", "paypal", "adyen"], + "rankingAlgorithm": "SrBasedRouting", + "eliminationEnabled": false + } + }, + "debit_routing": { + "summary": "Debit/network-based routing", + "value": { + "merchantId": "test_merchant", + "paymentInfo": { + "paymentId": "pay_002", + "amount": 500.0, + "currency": "USD", + "paymentType": "ORDER_PAYMENT", + "paymentMethodType": "CARD", + "paymentMethod": "DEBIT" + }, + "eligibleGatewayList": ["stripe", "braintree"], + "rankingAlgorithm": "NtwBasedRouting", + "eliminationEnabled": false + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Gateway decision result", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/DecidedGateway" }, + "example": { + "decided_gateway": "stripe", + "routing_approach": "SR_SELECTION_V3_ROUTING", + "gateway_priority_map": { "stripe": 0.94, "adyen": 0.87, "paypal": 0.72 }, + "routing_dimension": "CARD_BRAND", + "routing_dimension_level": "visa", + "reset_approach": "NoReset", + "is_scheduled_outage": false, + "is_rust_based_decider": true, + "latency": 8 + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorResponse" } + } + } + } + } + } + }, + "/update-gateway-score": { + "post": { + "operationId": "updateGatewayScore", + "tags": ["Score Feedback"], + "summary": "Update gateway score", + "description": "Feed a transaction outcome back into the success-rate model. Call this after every transaction so the engine has accurate SR data for future routing decisions.\n\nA `CHARGED` status increases the gateway's SR; failure statuses (`AUTHENTICATION_FAILED`, `AUTHORIZATION_FAILED`, etc.) decrease it.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/UpdateGatewayScoreRequest" }, + "example": { + "merchantId": "test_merchant", + "gateway": "stripe", + "paymentId": "pay_001", + "status": "CHARGED", + "gatewayReferenceId": "stripe_ref_001", + "enforceDynamicRoutingFailure": false + } + } + } + }, + "responses": { + "200": { + "description": "Score updated", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/UpdateScoreResponse" }, + "example": { "message": "Score updated", "merchant_id": "test_merchant", "gateway": "stripe", "payment_id": "pay_001" } + } + } + } + } + } + }, + "/merchant-account/create": { + "post": { + "operationId": "createMerchant", + "tags": ["Merchant Account"], + "summary": "Create merchant", + "description": "Register a new merchant account. The merchant ID is the primary identifier used in all subsequent routing and scoring calls.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/CreateMerchantRequest" }, + "example": { "merchant_id": "my_merchant", "gateway_success_rate_based_decider_input": null } + } + } + }, + "responses": { + "200": { + "description": "Merchant created", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/MerchantAccount" }, + "example": { "message": "Merchant created", "merchant_id": "my_merchant", "gateway_success_rate_based_decider_input": null } + } + } + } + } + } + }, + "/merchant-account/{merchantId}": { + "get": { + "operationId": "getMerchant", + "tags": ["Merchant Account"], + "summary": "Get merchant", + "description": "Retrieve a merchant account by ID.", + "parameters": [ + { + "name": "merchantId", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "example": "my_merchant" + } + ], + "responses": { + "200": { + "description": "Merchant account", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/MerchantAccount" } + } + } + }, + "404": { + "description": "Merchant not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorResponse" } + } + } + } + } + }, + "delete": { + "operationId": "deleteMerchant", + "tags": ["Merchant Account"], + "summary": "Delete merchant", + "description": "Delete a merchant account and all associated routing configuration.", + "parameters": [ + { + "name": "merchantId", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "example": "my_merchant" + } + ], + "responses": { + "200": { + "description": "Merchant deleted", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/DeleteResponse" } + } + } + } + } + } + }, + "/routing/create": { + "post": { + "operationId": "createRoutingRule", + "tags": ["Routing Rules"], + "summary": "Create routing rule", + "description": "Create a new Euclid declarative routing rule for a merchant. Supports `advanced` (full Euclid DSL), `priority` (ordered gateway list), `single` (fixed gateway), and `volume_split` (percentage-based distribution) algorithm types.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/CreateRoutingRuleRequest" }, + "examples": { + "priority": { + "summary": "Priority-based rule", + "value": { + "name": "default-priority", + "description": "Route to stripe first, fallback to paypal", + "created_by": "test_merchant", + "algorithm_for": "payment", + "algorithm": { + "type": "priority", + "data": [ + { "gateway_name": "stripe", "gateway_id": null }, + { "gateway_name": "paypal", "gateway_id": null }, + { "gateway_name": "adyen", "gateway_id": null } + ] + } + } + }, + "volume_split": { + "summary": "Volume split rule", + "value": { + "name": "ab-test-split", + "description": "", + "created_by": "test_merchant", + "algorithm_for": "payment", + "algorithm": { + "type": "volume_split", + "data": [ + { "split": 70, "connectors": [{ "gateway_name": "stripe", "gateway_id": null }] }, + { "split": 30, "connectors": [{ "gateway_name": "paypal", "gateway_id": null }] } + ] + } + } + }, + "single": { + "summary": "Single connector rule", + "value": { + "name": "always-stripe", + "description": "Always route to stripe", + "created_by": "test_merchant", + "algorithm_for": "payment", + "algorithm": { + "type": "single", + "data": { "gateway_name": "stripe", "gateway_id": null } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Routing rule created", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RoutingRule" } + } + } + } + } + } + }, + "/routing/activate": { + "post": { + "operationId": "activateRoutingRule", + "tags": ["Routing Rules"], + "summary": "Activate routing rule", + "description": "Activate a routing rule by ID for a merchant. Only one rule can be active at a time — activating a new rule deactivates the previous one.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ActivateRoutingRuleRequest" }, + "example": { + "created_by": "test_merchant", + "routing_algorithm_id": "rule_abc123" + } + } + } + }, + "responses": { + "200": { + "description": "Rule activated", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RoutingRule" } + } + } + } + } + } + }, + "/routing/list/{merchantId}": { + "post": { + "operationId": "listRoutingRules", + "tags": ["Routing Rules"], + "summary": "List routing rules", + "description": "List all routing rules for a merchant.", + "parameters": [ + { + "name": "merchantId", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "example": "test_merchant" + } + ], + "responses": { + "200": { + "description": "List of routing rules", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { "$ref": "#/components/schemas/RoutingRule" } + } + } + } + } + } + } + }, + "/routing/list/active/{created_by}": { + "post": { + "operationId": "getActiveRoutingRule", + "tags": ["Routing Rules"], + "summary": "Get active routing rule", + "description": "Retrieve the currently active routing rule for a merchant.", + "parameters": [ + { + "name": "created_by", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "example": "test_merchant" + } + ], + "responses": { + "200": { + "description": "Active routing rule", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RoutingRule" } + } + } + }, + "404": { + "description": "No active rule", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorResponse" } + } + } + } + } + } + }, + "/routing/evaluate": { + "post": { + "operationId": "evaluateRoutingRule", + "tags": ["Routing Rules"], + "summary": "Evaluate routing rule", + "description": "Evaluate the active routing rule for a merchant against a payment context. Returns the ordered list of gateways selected by the rule without consuming SR data.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/EvaluateRoutingRequest" }, + "example": { + "merchantId": "test_merchant", + "paymentInfo": { + "paymentId": "pay_001", + "amount": 1000.0, + "currency": "USD", + "paymentType": "ORDER_PAYMENT", + "paymentMethodType": "CARD", + "paymentMethod": "CREDIT" + } + } + } + } + }, + "responses": { + "200": { + "description": "Evaluation result with ordered gateway list", + "content": { + "application/json": { + "schema": { "type": "object" } + } + } + } + } + } + }, + "/rule/create": { + "post": { + "operationId": "createRuleConfig", + "tags": ["Rule Configuration"], + "summary": "Create rule config", + "description": "Create a service-level configuration for `successRate` or `elimination` scoring. Controls the time window, minimum data thresholds, and other parameters used in SR computation.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RuleConfigRequest" }, + "examples": { + "success_rate": { + "summary": "Success rate config", + "value": { + "merchant_id": "test_merchant", + "config": { + "type": "successRate", + "data": { + "defaultBucketSize": 20, + "defaultLatencyThreshold": null, + "defaultHedgingPercent": null + } + } + } + }, + "elimination": { + "summary": "Elimination config", + "value": { + "merchant_id": "test_merchant", + "config": { + "type": "elimination", + "data": { + "bucketSize": 5, + "eliminationThreshold": 0.2 + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Rule config created", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RuleConfigResponse" } + } + } + } + } + } + }, + "/rule/get": { + "post": { + "operationId": "getRuleConfig", + "tags": ["Rule Configuration"], + "summary": "Get rule config", + "description": "Retrieve an existing rule configuration by merchant and type.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RuleConfigGetRequest" }, + "example": { + "merchant_id": "test_merchant", + "algorithm": "successRate" + } + } + } + }, + "responses": { + "200": { + "description": "Rule config", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RuleConfigResponse" } + } + } + } + } + } + }, + "/rule/update": { + "post": { + "operationId": "updateRuleConfig", + "tags": ["Rule Configuration"], + "summary": "Update rule config", + "description": "Update an existing rule configuration.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RuleConfigRequest" }, + "example": { + "merchant_id": "test_merchant", + "config": { + "type": "successRate", + "data": { + "defaultBucketSize": 30, + "defaultHedgingPercent": 0.1 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Rule config updated", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RuleConfigResponse" } + } + } + } + } + } + }, + "/rule/delete": { + "post": { + "operationId": "deleteRuleConfig", + "tags": ["Rule Configuration"], + "summary": "Delete rule config", + "description": "Delete a rule configuration.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RuleConfigGetRequest" }, + "example": { + "merchant_id": "test_merchant", + "algorithm": "successRate" + } + } + } + }, + "responses": { + "200": { + "description": "Rule config deleted", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/DeleteResponse" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HealthResponse": { + "type": "object", + "properties": { + "message": { "type": "string", "example": "Health is good" } + } + }, + "ErrorResponse": { + "type": "object", + "properties": { + "error": { "type": "string" }, + "message": { "type": "string" } + } + }, + "DeleteResponse": { + "type": "object", + "properties": { + "message": { "type": "string" } + } + }, + "PaymentInfo": { + "type": "object", + "required": ["paymentId", "amount", "currency", "paymentType", "paymentMethodType", "paymentMethod"], + "properties": { + "paymentId": { "type": "string", "example": "pay_001" }, + "amount": { "type": "number", "format": "float", "example": 1000.0 }, + "currency": { "type": "string", "example": "USD" }, + "country": { "type": "string", "example": "US" }, + "customerId": { "type": "string", "example": "cust_123" }, + "paymentType": { "type": "string", "enum": ["ORDER_PAYMENT", "MANDATE_PAYMENT"], "example": "ORDER_PAYMENT" }, + "paymentMethodType": { "type": "string", "enum": ["CARD", "UPI", "WALLET", "NETBANKING"], "example": "CARD" }, + "paymentMethod": { "type": "string", "enum": ["CREDIT", "DEBIT"], "example": "CREDIT" }, + "authType": { "type": "string", "enum": ["THREE_DS", "NO_THREE_DS"], "example": "THREE_DS" }, + "cardIsin": { "type": "string", "example": "411111" } + } + }, + "DecideGatewayRequest": { + "type": "object", + "required": ["merchantId", "paymentInfo", "eligibleGatewayList", "rankingAlgorithm"], + "properties": { + "merchantId": { "type": "string", "example": "test_merchant" }, + "paymentInfo": { "$ref": "#/components/schemas/PaymentInfo" }, + "eligibleGatewayList": { + "type": "array", + "items": { "type": "string" }, + "example": ["stripe", "paypal", "adyen"] + }, + "rankingAlgorithm": { + "type": "string", + "enum": ["SrBasedRouting", "PlBasedRouting", "NtwBasedRouting"], + "example": "SrBasedRouting" + }, + "eliminationEnabled": { "type": "boolean", "default": false } + } + }, + "DecidedGateway": { + "type": "object", + "properties": { + "decided_gateway": { "type": "string", "example": "stripe" }, + "routing_approach": { "type": "string", "example": "SR_SELECTION_V3_ROUTING" }, + "gateway_priority_map": { + "type": "object", + "additionalProperties": { "type": "number" }, + "example": { "stripe": 0.94, "adyen": 0.87, "paypal": 0.72 } + }, + "routing_dimension": { "type": "string" }, + "routing_dimension_level": { "type": "string" }, + "reset_approach": { "type": "string" }, + "is_scheduled_outage": { "type": "boolean" }, + "is_rust_based_decider": { "type": "boolean" }, + "latency": { "type": "number" } + } + }, + "UpdateGatewayScoreRequest": { + "type": "object", + "required": ["merchantId", "gateway", "paymentId", "status"], + "properties": { + "merchantId": { "type": "string", "example": "test_merchant" }, + "gateway": { "type": "string", "example": "stripe" }, + "paymentId": { "type": "string", "example": "pay_001" }, + "status": { + "type": "string", + "enum": ["CHARGED", "AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "JUSPAY_DECLINED", "FAILURE"], + "example": "CHARGED" + }, + "gatewayReferenceId": { "type": "string", "example": "stripe_ref_001" }, + "enforceDynamicRoutingFailure": { "type": "boolean", "default": false } + } + }, + "UpdateScoreResponse": { + "type": "object", + "properties": { + "message": { "type": "string" }, + "merchant_id": { "type": "string" }, + "gateway": { "type": "string" }, + "payment_id": { "type": "string" } + } + }, + "CreateMerchantRequest": { + "type": "object", + "required": ["merchant_id"], + "properties": { + "merchant_id": { "type": "string", "example": "my_merchant" }, + "gateway_success_rate_based_decider_input": { "type": "string", "nullable": true } + } + }, + "MerchantAccount": { + "type": "object", + "properties": { + "message": { "type": "string" }, + "merchant_id": { "type": "string", "example": "my_merchant" }, + "gateway_success_rate_based_decider_input": { "type": "string", "nullable": true } + } + }, + "CreateRoutingRuleRequest": { + "type": "object", + "required": ["name", "created_by", "algorithm"], + "properties": { + "name": { "type": "string", "example": "default-priority" }, + "description": { "type": "string", "example": "" }, + "created_by": { "type": "string", "example": "test_merchant" }, + "algorithm_for": { + "type": "string", + "enum": ["payment", "payout", "three_ds_authentication"], + "default": "payment" + }, + "algorithm": { "$ref": "#/components/schemas/RoutingAlgorithm" } + } + }, + "RoutingAlgorithm": { + "type": "object", + "required": ["type", "data"], + "properties": { + "type": { + "type": "string", + "enum": ["priority", "single", "volume_split", "advanced"], + "example": "priority" + }, + "data": { + "description": "Depends on type: array of ConnectorInfo ({gateway_name, gateway_id}) for `priority`; single ConnectorInfo for `single`; array of {split, connectors} for `volume_split`; Euclid AST Program for `advanced`" + } + } + }, + "ActivateRoutingRuleRequest": { + "type": "object", + "required": ["created_by", "routing_algorithm_id"], + "properties": { + "created_by": { "type": "string", "example": "test_merchant" }, + "routing_algorithm_id": { "type": "string", "example": "rule_abc123" } + } + }, + "RoutingRule": { + "type": "object", + "properties": { + "rule_id": { "type": "string", "nullable": true, "example": "rule_abc123" }, + "name": { "type": "string" }, + "description": { "type": "string" }, + "created_by": { "type": "string", "example": "test_merchant" }, + "algorithm_for": { "type": "string" }, + "algorithm": { "$ref": "#/components/schemas/RoutingAlgorithm" } + } + }, + "EvaluateRoutingRequest": { + "type": "object", + "required": ["merchantId", "paymentInfo"], + "properties": { + "merchantId": { "type": "string", "example": "test_merchant" }, + "paymentInfo": { "$ref": "#/components/schemas/PaymentInfo" } + } + }, + "RuleConfigRequest": { + "type": "object", + "required": ["merchant_id", "config"], + "properties": { + "merchant_id": { "type": "string", "example": "test_merchant" }, + "config": { + "type": "object", + "description": "Tagged config variant. `type` is `successRate`, `elimination`, or `debitRouting`. `data` holds the variant-specific fields." + } + } + }, + "RuleConfigGetRequest": { + "type": "object", + "required": ["merchant_id", "algorithm"], + "properties": { + "merchant_id": { "type": "string", "example": "test_merchant" }, + "algorithm": { "type": "string", "enum": ["successRate", "elimination", "debitRouting"], "example": "successRate" } + } + }, + "RuleConfigResponse": { + "type": "object", + "properties": { + "merchant_id": { "type": "string" }, + "config": { "type": "object" } + } + } + } + } +} diff --git a/helm-charts/Chart.lock b/helm-charts/Chart.lock index d2744324..ec96fdf4 100644 --- a/helm-charts/Chart.lock +++ b/helm-charts/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: postgresql repository: https://charts.bitnami.com/bitnami - version: 12.5.9 + version: 18.5.14 - name: mysql repository: https://charts.bitnami.com/bitnami - version: 13.0.0 + version: 13.0.4 - name: redis repository: https://charts.bitnami.com/bitnami - version: 17.11.8 -digest: sha256:a30a5d9f1cd2bdc84f9f36f3909d75b6702b996ad454cff2737cd738303b6420 -generated: "2025-06-04T21:08:21.265499+05:30" + version: 25.3.9 +digest: sha256:9d54be26fed3d4599bdc5426e4a22ede83361404744e227266b41bee4b7d3ffd +generated: "2026-03-31T14:29:48.785567+05:30" diff --git a/helm-charts/Chart.yaml b/helm-charts/Chart.yaml index aa8323d7..ecb6082d 100644 --- a/helm-charts/Chart.yaml +++ b/helm-charts/Chart.yaml @@ -6,14 +6,14 @@ version: 0.1.0 appVersion: "1.0.0" dependencies: - name: postgresql - version: ~12.5.5 + version: ~18.5.14 repository: https://charts.bitnami.com/bitnami condition: postgresql.enabled - name: mysql - version: ~13.0.0 + version: ~13.0.4 repository: https://charts.bitnami.com/bitnami condition: mysql.enabled - name: redis - version: ~17.11.3 + version: ~25.3.9 repository: https://charts.bitnami.com/bitnami condition: redis.enabled diff --git a/helm-charts/charts/mysql-13.0.0.tgz b/helm-charts/charts/mysql-13.0.0.tgz deleted file mode 100644 index ab18090b6a018e8e753eca54911c374e7b6edb1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67931 zcmY(KQ8HR_ftn#$2A5l(9rS zxTuSC#?`kOh_FvODb+^PJjZB**dIiW0u?$~qh$4bcd(kD=d7{&+u^fQwRY&`dT z*5yvu>#6tYb*Az<`x;~S+UoWu;yQaf`?du@sKaa3`j%dro+^Ohy5}o>oWL=Y(Sz}e z?4~&p;Z@4~hnX`wSm*a5M1IimDd2dfb=M~wFnf=B>dW`Izk4$!xj4yje;bUSk_))i zx$@Em-1A9;>H^Ew3lo3xp&TH7-NICYD73@8Tzn7tE*hMLEZtE-Ey_p9>{|LEYOuixWt=S#`HaFc)A_sj8Q$NTPfh%FDG z?xuIM-i*_4?_ih+x*)_p}s()nAW2Jo1pm^+;#GQ-Gr17hy;_&uR1T z4L*w)%beg9OcJ(L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0)~VoF-*Q`8WhK|y7p}Cb60^U^S#7VnGPvZ@%Bwl_ zKa;GOUgpXCmw*lWpTqrL$^L)uaAW^}E6-ig|M)q?An8L05os~OS*4VB9Iu=@9$^qI zmln%5l9}AhV-5Vjn_YC}w>oC=p~|B7TQqZ|I5HAi@)1nO47F76IPy{@o2Vaw%`3bf z*REZrzm(CBV`fRIvYTrG2Xo}BI@kDH6tl}HY$s&5pOR|fmxDnlJJ}@&)a|6w&w(OS5NF8aOF2sd*ORK1p$W)0m2<{Hy~%F*dv!Ol`wS8`lQ z+NE8{-{TrMiK)z9jFp%ze9=_w9nb2xn~CT-IbGT2y0)nm^EJ=}du#FqlS}28 z8c3#sBqq)>H|e3S+;7{iqwO=t`M)m^7>@^eJg)^vlmE}*uABdDzt=n5od0j*x!dRe z6`cJv)y{SFTYzsqlRd41Z8n0vfZA8LIXDLya0OQ^ts7eLF-{LkMd4BWzzogpRF|mNoo}aJecCZE9i(LJ3vtPD}1rK75d0*7TqN0^$O)R+CFJ#wm zyok54bUPRExYVBhQ=VM@^BUG$``dV9K`n3_zgEi^hlSjl<;!}fW_j}$Ic4iNfBD?o zd*joP|4DFlxSCil0aR1`$DJM5{-d|Iv%iu5ZsWNF@*lCl?>OFAa31$R!1598<~J0> z3o}`dCgLC>b~=i<91F;d?2b=PUdlYI_4Xi=pt%>r2`Il7Lt^J2{wiI8=-Ww#Y?8n6 zFEJ$OfqXCr}zj`lIaYEke~ zr=*KIa#Oq0u`lZCX>x#t@_+!PFy>>yYr&9RqZS$PMBwDuyqE+^ds&Fd!;yrl3L=l0 zd#OG1quL5M#JOxxV8d>$qrY7Yvv_*A?|zrv;Y^h~`~@&Hd(T)2faCS4;i3&&b#Y(B0 WXY*{H&9iw{{rn#iRR%o(k_P}Btc6|x diff --git a/helm-charts/charts/mysql-13.0.4.tgz b/helm-charts/charts/mysql-13.0.4.tgz new file mode 100644 index 0000000000000000000000000000000000000000..12c0e3b631a9bf21aa472220b1e118bfa59d013c GIT binary pat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X6 z^VQ?aCm_S7v#cA}g*59#-7+xw_t|ui%FubM0{6+Qr*(nsX1($WPS}aX_$NG{Rs9*$vF>`(XPi<<&#iVSqZ`^rcr@g z#PK{RUVsVJ7`p6@5{yysBpvsYt63)1g!7^)ayGOM%$1CHE?VgZc&X8@cxSGEOHLA$ z=rbS!Y#f@h!}e@fY)^0H`dhVXlE?;LWSSJM$A*g#t9Mo}%kMP{vLON&rj5i712 zd>0Q#QeOk4^n|0au*?5`^RRPvkcqpS0 z(iwqf1p4-a+da=#=k#)Yy@E6IK!L^;iESLjKBH2Ukek^v4TB@bRO%iNTgZLr>E&(6Y%m_yZf5xXb|vShrwh7-xO( z1Obfn(;1jU##xpEv+%_mOfV}g-S8p+F90IOPo-D8c`!=G$!Ioq&BhmB)D%{PDH?&* zxC1AcY5aTd=5L3s-~ZhF;%|Td`12PZKkhVwJp(RBS8^HQCULhJ zK6(b{3;IOzM$~CeaGz)g2bujLLf{3ovjGoSm#(gxtz49y2liA+AOLwH{xMdU#}E z%Fr6njc`TMZ-RCJG;|cVJ46qPsgKc=%@dQ#$e}ITtEEHD9@Xw$Jvt|Ihyeq_qSz0F(y+cTuK_ literal 0 HcmV?d00001 diff --git a/helm-charts/charts/postgresql-12.5.9.tgz b/helm-charts/charts/postgresql-12.5.9.tgz deleted file mode 100644 index 490097c4322306eac3ef62ff70342e34684ac6a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56602 zcmV)NK)1giiwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0POwyb{jX+D2nHAJq3PrW?P!ArbtP)6Rt1c?=Y0&Xhj!(qMXd^ znOQQ}4U&kOjShg8%t`zP=aJ4komV&uw{DK7^?(768Mp1wwA0yV=@jwLUs0Vy9pOa_@ z0E%M5Fqg=Pk9!9P6iqSXbm4W|0rBq;ZDVpU#yo;^>rYR9;2j=zJ{%q$x8rEKbB7iWga&f_vJb64c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ahc^-4t0q^SyBfmf;O57BLqe! z2XZuCe21KgG?9X&5uLiD{SPfXKYAWLkDdqq{J#JI0RR8pgMR-2HV6Q? CMWihN diff --git a/helm-charts/charts/redis-25.3.9.tgz b/helm-charts/charts/redis-25.3.9.tgz new file mode 100644 index 0000000000000000000000000000000000000000..4a38878391c59e80ff48f6d3dd95067bd8e42a3c GIT binary patch literal 104348 zcmV)RK(oIeiwFP!00000|Lnc%cH>5tE_io;${{ra2#A>KZ2 zw>V9c)Qh2uZ{Yvy^7X>2+IsXr^naJx$45*t&3|v?#p$Chg9h{e^|yOp!Tf)<_tn=g z^ZyhnH~+n8JdVPpFN5au|MlCwm-&B^R5t&q98Ur-mCHI1n$Q0?Z};|I=Km>D{rq2h zf#3I1KMEhR78=k0-kaB7efu*1Pmy^3m%ZcjX#x8G!v8%{D$f7dOHvsxcNsLFe<1&F zUgrNPQgQxcISKrpx734Rf%$*?_VvsBKSe6eeA723vuqHK=H#wq>DTP9_n^3nGDK6Nq6DU5T-m_C}CjUu=Tt3OZ(0n2b?t=${-qU9R750_T%yChacNx z1g+B>$+0IgX-sV4i5$fla|0&WJLQTD(sTZ(UVPoT7(7PS~4cqvWgcAb) z{s~BhTGd#z=cTy##MPay2@1Z)Q^XGkkr+w%*C~C%Y_0h2pa0yoew##z4@U_6x^I3>z2QIqxd~NaL%lS}Ri=I`t+eurKc6-$JxR=#AyRJ}c=r zA+BYNr@+2=)Bfsh`z!S;mE0G4)3x5T`%&+cjN5*+d*!E4k-w|z*(b>}%{8Hqv0@vW zZ#Nq>plc~>ffjzT`aib6Y40^?fGVl1-5i0lNd0lI{kmy8rn>3|^|7^-ahck(_5!~r z!vt5v0Z0WS+2Uak6+eVbLpVV9MIz&C$hhH6{ExZ^*L(2iP+wZ6Mgz!R`>SuE>wTH@VtBF` z-Ghwrw3kkS5kh2uA|^gmg*5>$0}X*Fka~WI`9M-icEreoWefieV6gBXV2-duedr8K zf1mztZ*GhtL`(BlYOKgyZTLMLkN(oX3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@+(D*sl~e%PE2*Z*NPKUW9<5IVrsQO2|7$AV?R1fEw;~?Fw0=VxN7o~ z@!ZKFqn%0Y;<*|mmSacxePI7Dj+hFfs+vR={}9`PW>7)d^2cB^vsXur9qAl$oi$RH zr{JRT%JelLU?4BFF2SB{i%Dbkk#kfjZ`2ibFgQIUE>1C3e2uNB7-*$`hG9LFH_!|7 zf1D(JjFc4Q(h*zN_gUH(rpgqqhRC<@Vk0E!Txf*PstyxFtd&ju_=kfm_@*Kum;3agGPeJ{S!^T|S0o)0C<4<)(5 zo`RYiR4P$Z;0QTUT3(NPbav@P$mwd?#a!hM4q>vn82t}oV0@-XF_MQ0Dio!5e~hXm zbZ;k$&eYb=cMFSw6fsZ^MGy|zF(EdqYm>+|=M~Hmm#Y(&REM9N&}t0DZ9HLeu)qJ0 z#QAbKVip|MyNsWr3Aem~nWdjVEMsjJFw/dev/null || true) + if [ -n "$pid" ]; then + local cmd + cmd=$(ps -p $pid -o command= 2>/dev/null || echo "unknown process") + ports_in_use+=("$port") + pids_to_kill+=("$pid") + echo " [!] Port $port is in use by PID $pid" + echo " Command: $cmd" + fi + done + + if [ ${#pids_to_kill[@]} -gt 0 ]; then + echo "" + echo "==========================================" + echo " WARNING: Found processes on ports ${ports_in_use[*]}" + echo " These processes will be killed to proceed." + echo "==========================================" + echo "" + echo "Press Enter to continue and kill these processes, or Ctrl+C to abort..." + read -r + + echo "" + echo "Killing processes..." + for pid in "${pids_to_kill[@]}"; do + kill $pid 2>/dev/null || true + echo " Killed PID $pid" + done + + sleep 1 + + for port in "${PORTS[@]}"; do + local pid + pid=$(lsof -t -i :$port 2>/dev/null || true) + if [ -n "$pid" ]; then + kill -9 $pid 2>/dev/null || true + echo " Force killed PID $pid on port $port" + fi + done + + echo "Done. All ports cleared." + echo "" + else + echo "No processes found on ports ${PORTS[*]}." + echo "" + fi +} + +cleanup() { + echo "" + echo "Stopping services..." + if [ -n "$SERVER_PID" ]; then + kill $SERVER_PID 2>/dev/null || true + fi + if [ -n "$DASHBOARD_PID" ]; then + kill $DASHBOARD_PID 2>/dev/null || true + fi + exit 0 +} + +trap cleanup SIGINT SIGTERM + +check_and_kill_ports + +echo "Starting Decision Engine server..." +cargo run --no-default-features --features postgres & +SERVER_PID=$! + +echo "Installing dashboard dependencies..." +cd "$SCRIPT_DIR/website" +npm install --silent + +echo "Starting dashboard..." +npm run dev & +DASHBOARD_PID=$! + +cd "$SCRIPT_DIR" + +echo "" +echo "==========================================" +echo " Decision Engine is starting up!" +echo "==========================================" +echo "" +echo " Server: http://localhost:8080" +echo " Dashboard: http://localhost:5173/dashboard/" +echo "" +echo "==========================================" +echo "" + +wait $SERVER_PID $DASHBOARD_PID diff --git a/src/app.rs b/src/app.rs index 27970110..28fc50ee 100644 --- a/src/app.rs +++ b/src/app.rs @@ -253,6 +253,10 @@ where .route( "/config-sr-dimension", axum::routing::post(crate::euclid::handlers::routing_rules::config_sr_dimensions), + ) + .route( + "/config/routing-keys", + axum::routing::get(crate::euclid::handlers::routing_rules::get_routing_config), ); let router = router.route("/update-score", post(routes::update_score::update_score)); let router = router.route( diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index 3a1fd42d..53ef57b4 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -864,3 +864,34 @@ pub(crate) fn extract_connectors_for_eligibility(output: &Output) -> Vec Result, ContainerError> { + let timer = metrics::API_LATENCY_HISTOGRAM + .with_label_values(&["get_routing_config"]) + .start_timer(); + metrics::API_REQUEST_TOTAL_COUNTER + .with_label_values(&["get_routing_config"]) + .inc(); + + let tenant_state = get_tenant_app_state().await; + + // Clone the routing config to return it + let config = tenant_state + .config + .routing_config + .clone() + .ok_or_else(|| EuclidErrors::GlobalRoutingConfigsUnavailable)?; + + metrics::API_REQUEST_COUNTER + .with_label_values(&["get_routing_config", "success"]) + .inc(); + timer.observe_duration(); + + logger::info!("Successfully served routing config"); + + Ok(Json(config)) +} diff --git a/website/dist/assets/index-CT0UhhRt.js b/website/dist/assets/index-CT0UhhRt.js new file mode 100644 index 00000000..8ba1cad5 --- /dev/null +++ b/website/dist/assets/index-CT0UhhRt.js @@ -0,0 +1,328 @@ +var ST=Object.defineProperty;var OT=(e,t,r)=>t in e?ST(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ob=(e,t,r)=>OT(e,typeof t!="symbol"?t+"":t,r);function jT(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var gc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pj={exports:{}},tp={},hj={exports:{}},$e={};/** + * @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 Qu=Symbol.for("react.element"),AT=Symbol.for("react.portal"),ET=Symbol.for("react.fragment"),kT=Symbol.for("react.strict_mode"),PT=Symbol.for("react.profiler"),CT=Symbol.for("react.provider"),TT=Symbol.for("react.context"),NT=Symbol.for("react.forward_ref"),$T=Symbol.for("react.suspense"),RT=Symbol.for("react.memo"),IT=Symbol.for("react.lazy"),sb=Symbol.iterator;function MT(e){return e===null||typeof e!="object"?null:(e=sb&&e[sb]||e["@@iterator"],typeof e=="function"?e:null)}var mj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vj=Object.assign,yj={};function Ss(e,t,r){this.props=e,this.context=t,this.refs=yj,this.updater=r||mj}Ss.prototype.isReactComponent={};Ss.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ss.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gj(){}gj.prototype=Ss.prototype;function Wg(e,t,r){this.props=e,this.context=t,this.refs=yj,this.updater=r||mj}var Hg=Wg.prototype=new gj;Hg.constructor=Wg;vj(Hg,Ss.prototype);Hg.isPureReactComponent=!0;var lb=Array.isArray,xj=Object.prototype.hasOwnProperty,Gg={current:null},bj={key:!0,ref:!0,__self:!0,__source:!0};function wj(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)xj.call(t,n)&&!bj.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,W=R[q];if(0>>1;qi(Ae,L))xei(We,Ae)?(R[q]=We,R[xe]=L,q=xe):(R[q]=Ae,R[he]=L,q=he);else if(xei(We,L))R[q]=We,R[xe]=L,q=xe;else break e}}return F}function i(R,F){var L=R.sortIndex-F.sortIndex;return L!==0?L:R.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,c=null,p=3,h=!1,b=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(R){for(var F=r(u);F!==null;){if(F.callback===null)n(u);else if(F.startTime<=R)n(u),F.sortIndex=F.expirationTime,t(l,F);else break;F=r(u)}}function S(R){if(v=!1,w(R),!b)if(r(l)!==null)b=!0,V(x);else{var F=r(u);F!==null&&U(S,F.startTime-R)}}function x(R,F){b=!1,v&&(v=!1,y(A),A=-1),h=!0;var L=p;try{for(w(F),c=r(l);c!==null&&(!(c.expirationTime>F)||R&&!N());){var q=c.callback;if(typeof q=="function"){c.callback=null,p=c.priorityLevel;var W=q(c.expirationTime<=F);F=e.unstable_now(),typeof W=="function"?c.callback=W:c===r(l)&&n(l),w(F)}else n(l);c=r(l)}if(c!==null)var Y=!0;else{var he=r(u);he!==null&&U(S,he.startTime-F),Y=!1}return Y}finally{c=null,p=L,h=!1}}var _=!1,O=null,A=-1,E=5,$=-1;function N(){return!(e.unstable_now()-$R||125q?(R.sortIndex=L,t(u,R),r(l)===null&&R===r(u)&&(v?(y(A),A=-1):v=!0,U(S,L-q))):(R.sortIndex=W,t(l,R),b||h||(b=!0,V(x))),R},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(R){var F=p;return function(){var L=p;p=F;try{return R.apply(this,arguments)}finally{p=L}}}})(Aj);jj.exports=Aj;var qT=jj.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 XT=j,Rr=qT;function X(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qm=Object.prototype.hasOwnProperty,YT=/^[: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]*$/,cb={},fb={};function ZT(e){return Qm.call(fb,e)?!0:Qm.call(cb,e)?!1:YT.test(e)?fb[e]=!0:(cb[e]=!0,!1)}function QT(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function JT(e,t,r,n){if(t===null||typeof t>"u"||QT(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ht[e]=new fr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ht[t]=new fr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ht[e]=new fr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ht[e]=new fr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ht[e]=new fr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ht[e]=new fr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ht[e]=new fr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ht[e]=new fr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ht[e]=new fr(e,5,!1,e.toLowerCase(),null,!1,!1)});var qg=/[\-:]([a-z])/g;function Xg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(qg,Xg);Ht[t]=new fr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(qg,Xg);Ht[t]=new fr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(qg,Xg);Ht[t]=new fr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ht[e]=new fr(e,1,!1,e.toLowerCase(),null,!1,!1)});Ht.xlinkHref=new fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ht[e]=new fr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Yg(e,t,r,n){var i=Ht.hasOwnProperty(t)?Ht[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` +`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Eh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ml(e):""}function eN(e){switch(e.tag){case 5:return ml(e.type);case 16:return ml("Lazy");case 13:return ml("Suspense");case 19:return ml("SuspenseList");case 0:case 2:case 15:return e=kh(e.type,!1),e;case 11:return e=kh(e.type.render,!1),e;case 1:return e=kh(e.type,!0),e;default:return""}}function rv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case lo:return"Fragment";case so:return"Portal";case Jm:return"Profiler";case Zg:return"StrictMode";case ev:return"Suspense";case tv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pj:return(e.displayName||"Context")+".Consumer";case kj:return(e._context.displayName||"Context")+".Provider";case Qg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jg:return t=e.displayName||null,t!==null?t:rv(e.type)||"Memo";case wi:t=e._payload,e=e._init;try{return rv(e(t))}catch{}}return null}function tN(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rv(t);case 8:return t===Zg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Gi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rN(e){var t=Tj(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wc(e){e._valueTracker||(e._valueTracker=rN(e))}function Nj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Tj(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function yf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function nv(e,t){var r=t.checked;return yt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function pb(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Gi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $j(e,t){t=t.checked,t!=null&&Yg(e,"checked",t,!1)}function iv(e,t){$j(e,t);var r=Gi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?av(e,t.type,r):t.hasOwnProperty("defaultValue")&&av(e,t.type,Gi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hb(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function av(e,t,r){(t!=="number"||yf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var vl=Array.isArray;function Eo(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=_c.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ol={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},nN=["Webkit","ms","Moz","O"];Object.keys(Ol).forEach(function(e){nN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ol[t]=Ol[e]})});function Dj(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ol.hasOwnProperty(e)&&Ol[e]?(""+t).trim():t+"px"}function Lj(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Dj(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var iN=yt({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 lv(e,t){if(t){if(iN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function uv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cv=null;function e0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fv=null,ko=null,Po=null;function yb(e){if(e=tc(e)){if(typeof fv!="function")throw Error(X(280));var t=e.stateNode;t&&(t=op(t),fv(e.stateNode,e.type,t))}}function Bj(e){ko?Po?Po.push(e):Po=[e]:ko=e}function Fj(){if(ko){var e=ko,t=Po;if(Po=ko=null,yb(e),t)for(e=0;e>>=0,e===0?32:31-(mN(e)/vN|0)|0}var Sc=64,Oc=4194304;function yl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wf(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=yl(s):(a&=o,a!==0&&(n=yl(a)))}else o=r&~i,o!==0?n=yl(o):a!==0&&(n=yl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Ju(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=r}function bN(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Al),Ab=" ",Eb=!1;function oA(e,t){switch(e){case"keyup":return qN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uo=!1;function YN(e,t){switch(e){case"compositionend":return sA(t);case"keypress":return t.which!==32?null:(Eb=!0,Ab);case"textInput":return e=t.data,e===Ab&&Eb?null:e;default:return null}}function ZN(e,t){if(uo)return e==="compositionend"||!l0&&oA(e,t)?(e=iA(),af=a0=Ci=null,uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Tb(r)}}function fA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dA(){for(var e=window,t=yf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yf(e.document)}return t}function u0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function o$(e){var t=dA(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&fA(r.ownerDocument.documentElement,r)){if(n!==null&&u0(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=Nb(r,a);var o=Nb(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,co=null,yv=null,kl=null,gv=!1;function $b(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;gv||co==null||co!==yf(n)||(n=co,"selectionStart"in n&&u0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),kl&&Zl(kl,n)||(kl=n,n=Of(yv,"onSelect"),0ho||(e.current=Ov[ho],Ov[ho]=null,ho--)}function nt(e,t){ho++,Ov[ho]=e.current,e.current=t}var Ki={},nr=ea(Ki),gr=ea(!1),Na=Ki;function Fo(e,t){var r=e.type.contextTypes;if(!r)return Ki;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xr(e){return e=e.childContextTypes,e!=null}function Af(){ut(gr),ut(nr)}function Fb(e,t,r){if(nr.current!==Ki)throw Error(X(168));nt(nr,t),nt(gr,r)}function wA(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(X(108,tN(e)||"Unknown",i));return yt({},r,n)}function Ef(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ki,Na=nr.current,nt(nr,e),nt(gr,gr.current),!0}function zb(e,t,r){var n=e.stateNode;if(!n)throw Error(X(169));r?(e=wA(e,t,Na),n.__reactInternalMemoizedMergedChildContext=e,ut(gr),ut(nr),nt(nr,e)):ut(gr),nt(gr,r)}var Un=null,sp=!1,Uh=!1;function _A(e){Un===null?Un=[e]:Un.push(e)}function g$(e){sp=!0,_A(e)}function ta(){if(!Uh&&Un!==null){Uh=!0;var e=0,t=Ge;try{var r=Un;for(Ge=1;e>=o,i-=o,Wn=1<<32-pn(t)+i|r<A?(E=O,O=null):E=O.sibling;var $=p(y,O,w[A],S);if($===null){O===null&&(O=E);break}e&&O&&$.alternate===null&&t(y,O),m=a($,m,A),_===null?x=$:_.sibling=$,_=$,O=E}if(A===w.length)return r(y,O),ct&&da(y,A),x;if(O===null){for(;AA?(E=O,O=null):E=O.sibling;var N=p(y,O,$.value,S);if(N===null){O===null&&(O=E);break}e&&O&&N.alternate===null&&t(y,O),m=a(N,m,A),_===null?x=N:_.sibling=N,_=N,O=E}if($.done)return r(y,O),ct&&da(y,A),x;if(O===null){for(;!$.done;A++,$=w.next())$=c(y,$.value,S),$!==null&&(m=a($,m,A),_===null?x=$:_.sibling=$,_=$);return ct&&da(y,A),x}for(O=n(y,O);!$.done;A++,$=w.next())$=h(O,y,A,$.value,S),$!==null&&(e&&$.alternate!==null&&O.delete($.key===null?A:$.key),m=a($,m,A),_===null?x=$:_.sibling=$,_=$);return e&&O.forEach(function(P){return t(y,P)}),ct&&da(y,A),x}function g(y,m,w,S){if(typeof w=="object"&&w!==null&&w.type===lo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case bc:e:{for(var x=w.key,_=m;_!==null;){if(_.key===x){if(x=w.type,x===lo){if(_.tag===7){r(y,_.sibling),m=i(_,w.props.children),m.return=y,y=m;break e}}else if(_.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===wi&&Wb(x)===_.type){r(y,_.sibling),m=i(_,w.props),m.ref=el(y,_,w),m.return=y,y=m;break e}r(y,_);break}else t(y,_);_=_.sibling}w.type===lo?(m=Ea(w.props.children,y.mode,S,w.key),m.return=y,y=m):(S=pf(w.type,w.key,w.props,null,y.mode,S),S.ref=el(y,m,w),S.return=y,y=S)}return o(y);case so:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){r(y,m.sibling),m=i(m,w.children||[]),m.return=y,y=m;break e}else{r(y,m);break}else t(y,m);m=m.sibling}m=Yh(w,y.mode,S),m.return=y,y=m}return o(y);case wi:return _=w._init,g(y,m,_(w._payload),S)}if(vl(w))return b(y,m,w,S);if(Xs(w))return v(y,m,w,S);Tc(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(r(y,m.sibling),m=i(m,w),m.return=y,y=m):(r(y,m),m=Xh(w,y.mode,S),m.return=y,y=m),o(y)):r(y,m)}return g}var Uo=AA(!0),EA=AA(!1),Cf=ea(null),Tf=null,yo=null,p0=null;function h0(){p0=yo=Tf=null}function m0(e){var t=Cf.current;ut(Cf),e._currentValue=t}function Ev(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function To(e,t){Tf=e,p0=yo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mr=!0),e.firstContext=null)}function Zr(e){var t=e._currentValue;if(p0!==e)if(e={context:e,memoizedValue:t,next:null},yo===null){if(Tf===null)throw Error(X(308));yo=e,Tf.dependencies={lanes:0,firstContext:e}}else yo=yo.next=e;return t}var xa=null;function v0(e){xa===null?xa=[e]:xa.push(e)}function kA(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,v0(t)):(r.next=i.next,i.next=r),t.interleaved=r,ri(e,n)}function ri(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var _i=!1;function y0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function PA(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Li(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,De&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ri(e,r)}return i=n.interleaved,i===null?(t.next=t,v0(n)):(t.next=i.next,i.next=t),n.interleaved=t,ri(e,r)}function sf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,r0(e,r)}}function Hb(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Nf(e,t,r,n){var i=e.updateQueue;_i=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var c=i.baseState;o=0,f=u=l=null,s=a;do{var p=s.lane,h=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var b=e,v=s;switch(p=t,h=r,v.tag){case 1:if(b=v.payload,typeof b=="function"){c=b.call(h,c,p);break e}c=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=v.payload,p=typeof b=="function"?b.call(h,c,p):b,p==null)break e;c=yt({},c,p);break e;case 2:_i=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,l=c):f=f.next=h,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Ia|=o,e.lanes=o,e.memoizedState=c}}function Gb(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Wh.transition;Wh.transition={};try{e(!1),t()}finally{Ge=r,Wh.transition=n}}function GA(){return Qr().memoizedState}function _$(e,t,r){var n=Fi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},KA(e))qA(t,r);else if(r=kA(e,t,r,n),r!==null){var i=ur();hn(r,e,n,i),XA(r,t,n)}}function S$(e,t,r){var n=Fi(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(KA(e))qA(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,mn(s,o)){var l=t.interleaved;l===null?(i.next=i,v0(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=kA(e,t,i,n),r!==null&&(i=ur(),hn(r,e,n,i),XA(r,t,n))}}function KA(e){var t=e.alternate;return e===mt||t!==null&&t===mt}function qA(e,t){Pl=Rf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function XA(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,r0(e,r)}}var If={readContext:Zr,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},O$={readContext:Zr,useCallback:function(e,t){return Sn().memoizedState=[e,t===void 0?null:t],e},useContext:Zr,useEffect:qb,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,uf(4194308,4,zA.bind(null,t,e),r)},useLayoutEffect:function(e,t){return uf(4194308,4,e,t)},useInsertionEffect:function(e,t){return uf(4,2,e,t)},useMemo:function(e,t){var r=Sn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Sn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=_$.bind(null,mt,e),[n.memoizedState,e]},useRef:function(e){var t=Sn();return e={current:e},t.memoizedState=e},useState:Kb,useDebugValue:j0,useDeferredValue:function(e){return Sn().memoizedState=e},useTransition:function(){var e=Kb(!1),t=e[0];return e=w$.bind(null,e[1]),Sn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=mt,i=Sn();if(ct){if(r===void 0)throw Error(X(407));r=r()}else{if(r=t(),Bt===null)throw Error(X(349));Ra&30||$A(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,qb(IA.bind(null,n,a,e),[e]),n.flags|=2048,au(9,RA.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Sn(),t=Bt.identifierPrefix;if(ct){var r=Hn,n=Wn;r=(n&~(1<<32-pn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[jn]=t,e[eu]=n,aE(e,t,!1,!1),t.stateNode=e;e:{switch(o=uv(r,n),r){case"dialog":at("cancel",e),at("close",e),i=n;break;case"iframe":case"object":case"embed":at("load",e),i=n;break;case"video":case"audio":for(i=0;iHo&&(t.flags|=128,n=!0,tl(a,!1),t.lanes=4194304)}else{if(!n)if(e=$f(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),tl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ct)return Yt(t),null}else 2*wt()-a.renderingStartTime>Ho&&r!==1073741824&&(t.flags|=128,n=!0,tl(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=wt(),t.sibling=null,r=pt.current,nt(pt,n?r&1|2:r&1),t):(Yt(t),null);case 22:case 23:return T0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Er&1073741824&&(Yt(t),t.subtreeFlags&6&&(t.flags|=8192)):Yt(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function N$(e,t){switch(f0(t),t.tag){case 1:return xr(t.type)&&Af(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vo(),ut(gr),ut(nr),b0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return x0(t),null;case 13:if(ut(pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));zo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(pt),null;case 4:return Vo(),null;case 10:return m0(t.type._context),null;case 22:case 23:return T0(),null;case 24:return null;default:return null}}var $c=!1,er=!1,$$=typeof WeakSet=="function"?WeakSet:Set,se=null;function go(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){gt(e,t,n)}else r.current=null}function Mv(e,t,r){try{r()}catch(n){gt(e,t,n)}}var a1=!1;function R$(e,t){if(xv=_f,e=dA(),u0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,c=e,p=null;t:for(;;){for(var h;c!==r||i!==0&&c.nodeType!==3||(s=o+i),c!==a||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)p=c,c=h;for(;;){if(c===e)break t;if(p===r&&++u===i&&(s=o),p===a&&++f===n&&(l=o),(h=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(bv={focusedElem:e,selectionRange:r},_f=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var v=b.memoizedProps,g=b.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:sn(t.type,v),g);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(S){gt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return b=a1,a1=!1,b}function Cl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Mv(t,r,a)}i=i.next}while(i!==n)}}function cp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Dv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function lE(e){var t=e.alternate;t!==null&&(e.alternate=null,lE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jn],delete t[eu],delete t[Sv],delete t[v$],delete t[y$])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function uE(e){return e.tag===5||e.tag===3||e.tag===4}function o1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jf));else if(n!==4&&(e=e.child,e!==null))for(Lv(e,t,r),e=e.sibling;e!==null;)Lv(e,t,r),e=e.sibling}function Bv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Bv(e,t,r),e=e.sibling;e!==null;)Bv(e,t,r),e=e.sibling}var Vt=null,ln=!1;function xi(e,t,r){for(r=r.child;r!==null;)cE(e,t,r),r=r.sibling}function cE(e,t,r){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(rp,r)}catch{}switch(r.tag){case 5:er||go(r,t);case 6:var n=Vt,i=ln;Vt=null,xi(e,t,r),Vt=n,ln=i,Vt!==null&&(ln?(e=Vt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Vt.removeChild(r.stateNode));break;case 18:Vt!==null&&(ln?(e=Vt,r=r.stateNode,e.nodeType===8?zh(e.parentNode,r):e.nodeType===1&&zh(e,r),Xl(e)):zh(Vt,r.stateNode));break;case 4:n=Vt,i=ln,Vt=r.stateNode.containerInfo,ln=!0,xi(e,t,r),Vt=n,ln=i;break;case 0:case 11:case 14:case 15:if(!er&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Mv(r,t,o),i=i.next}while(i!==n)}xi(e,t,r);break;case 1:if(!er&&(go(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){gt(r,t,s)}xi(e,t,r);break;case 21:xi(e,t,r);break;case 22:r.mode&1?(er=(n=er)||r.memoizedState!==null,xi(e,t,r),er=n):xi(e,t,r);break;default:xi(e,t,r)}}function s1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new $$),t.forEach(function(n){var i=V$.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function nn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=wt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*M$(n/1960))-n,10e?16:e,Ti===null)var n=!1;else{if(e=Ti,Ti=null,Lf=0,De&6)throw Error(X(331));var i=De;for(De|=4,se=e.current;se!==null;){var a=se,o=a.child;if(se.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lwt()-P0?Aa(e,0):k0|=r),br(e,t)}function gE(e,t){t===0&&(e.mode&1?(t=Oc,Oc<<=1,!(Oc&130023424)&&(Oc=4194304)):t=1);var r=ur();e=ri(e,t),e!==null&&(Ju(e,t,r),br(e,r))}function U$(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),gE(e,r)}function V$(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(X(314))}n!==null&&n.delete(t),gE(e,r)}var xE;xE=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||gr.current)mr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return mr=!1,C$(e,t,r);mr=!!(e.flags&131072)}else mr=!1,ct&&t.flags&1048576&&SA(t,Pf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;cf(e,t),e=t.pendingProps;var i=Fo(t,nr.current);To(t,r),i=_0(null,t,n,e,i,r);var a=S0();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xr(n)?(a=!0,Ef(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,y0(t),i.updater=up,t.stateNode=i,i._reactInternals=t,Pv(t,n,e,r),t=Nv(null,t,n,!0,a,r)):(t.tag=0,ct&&a&&c0(t),ir(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(cf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=H$(n),e=sn(n,e),i){case 0:t=Tv(null,t,n,e,r);break e;case 1:t=r1(null,t,n,e,r);break e;case 11:t=e1(null,t,n,e,r);break e;case 14:t=t1(null,t,n,sn(n.type,e),r);break e}throw Error(X(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),Tv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),r1(e,t,n,i,r);case 3:e:{if(rE(t),e===null)throw Error(X(387));n=t.pendingProps,a=t.memoizedState,i=a.element,PA(e,t),Nf(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Wo(Error(X(423)),t),t=n1(e,t,n,r,i);break e}else if(n!==i){i=Wo(Error(X(424)),t),t=n1(e,t,n,r,i);break e}else for(Tr=Di(t.stateNode.containerInfo.firstChild),Nr=t,ct=!0,cn=null,r=EA(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(zo(),n===i){t=ni(e,t,r);break e}ir(e,t,n,r)}t=t.child}return t;case 5:return CA(t),e===null&&Av(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,wv(n,i)?o=null:a!==null&&wv(n,a)&&(t.flags|=32),tE(e,t),ir(e,t,o,r),t.child;case 6:return e===null&&Av(t),null;case 13:return nE(e,t,r);case 4:return g0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Uo(t,null,n,r):ir(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),e1(e,t,n,i,r);case 7:return ir(e,t,t.pendingProps,r),t.child;case 8:return ir(e,t,t.pendingProps.children,r),t.child;case 12:return ir(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,nt(Cf,n._currentValue),n._currentValue=o,a!==null)if(mn(a.value,o)){if(a.children===i.children&&!gr.current){t=ni(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Yn(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Ev(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(X(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Ev(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}ir(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,To(t,r),i=Zr(i),n=n(i),t.flags|=1,ir(e,t,n,r),t.child;case 14:return n=t.type,i=sn(n,t.pendingProps),i=sn(n.type,i),t1(e,t,n,i,r);case 15:return JA(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),cf(e,t),t.tag=1,xr(n)?(e=!0,Ef(t)):e=!1,To(t,r),YA(t,n,i),Pv(t,n,i,r),Nv(null,t,n,!0,e,r);case 19:return iE(e,t,r);case 22:return eE(e,t,r)}throw Error(X(156,t.tag))};function bE(e,t){return Kj(e,t)}function W$(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,r,n){return new W$(e,t,r,n)}function $0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function H$(e){if(typeof e=="function")return $0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qg)return 11;if(e===Jg)return 14}return 2}function zi(e,t){var r=e.alternate;return r===null?(r=Kr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function pf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")$0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case lo:return Ea(r.children,i,a,t);case Zg:o=8,i|=8;break;case Jm:return e=Kr(12,r,t,i|2),e.elementType=Jm,e.lanes=a,e;case ev:return e=Kr(13,r,t,i),e.elementType=ev,e.lanes=a,e;case tv:return e=Kr(19,r,t,i),e.elementType=tv,e.lanes=a,e;case Cj:return dp(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kj:o=10;break e;case Pj:o=9;break e;case Qg:o=11;break e;case Jg:o=14;break e;case wi:o=16,n=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=Kr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Ea(e,t,r,n){return e=Kr(7,e,n,t),e.lanes=r,e}function dp(e,t,r,n){return e=Kr(22,e,n,t),e.elementType=Cj,e.lanes=r,e.stateNode={isHidden:!1},e}function Xh(e,t,r){return e=Kr(6,e,null,t),e.lanes=r,e}function Yh(e,t,r){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function G$(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ch(0),this.expirationTimes=Ch(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ch(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function R0(e,t,r,n,i,a,o,s,l){return e=new G$(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Kr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},y0(a),e}function K$(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(OE)}catch(e){console.error(e)}}OE(),Oj.exports=Mr;var bo=Oj.exports,m1=bo;Zm.createRoot=m1.createRoot,Zm.hydrateRoot=m1.hydrateRoot;/** + * @remix-run/router v1.23.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function su(){return su=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function L0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function J$(){return Math.random().toString(36).substr(2,8)}function y1(e,t){return{usr:e.state,key:e.key,idx:t}}function Wv(e,t,r,n){return r===void 0&&(r=null),su({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?As(t):t,{state:r,key:t&&t.key||n||J$()})}function zf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function As(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function eR(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Ni.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(su({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){s=Ni.Pop;let g=f(),y=g==null?null:g-u;u=g,l&&l({action:s,location:v.location,delta:y})}function p(g,y){s=Ni.Push;let m=Wv(v.location,g,y);u=f()+1;let w=y1(m,u),S=v.createHref(m);try{o.pushState(w,"",S)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;i.location.assign(S)}a&&l&&l({action:s,location:v.location,delta:1})}function h(g,y){s=Ni.Replace;let m=Wv(v.location,g,y);u=f();let w=y1(m,u),S=v.createHref(m);o.replaceState(w,"",S),a&&l&&l({action:s,location:v.location,delta:0})}function b(g){let y=i.location.origin!=="null"?i.location.origin:i.location.href,m=typeof g=="string"?g:zf(g);return m=m.replace(/ $/,"%20"),vt(y,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,y)}let v={get action(){return s},get location(){return e(i,o)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(v1,c),l=g,()=>{i.removeEventListener(v1,c),l=null}},createHref(g){return t(i,g)},createURL:b,encodeLocation(g){let y=b(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:h,go(g){return o.go(g)}};return v}var g1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(g1||(g1={}));function tR(e,t,r){return r===void 0&&(r="/"),rR(e,t,r)}function rR(e,t,r,n){let i=typeof t=="string"?As(t):t,a=Go(i.pathname||"/",r);if(a==null)return null;let o=jE(e);nR(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(vt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Ui([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(vt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),jE(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:cR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of AE(a.path))i(a,o,l)}),t}function AE(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=AE(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function nR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:fR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const iR=/^:[\w-]+$/,aR=3,oR=2,sR=1,lR=10,uR=-2,x1=e=>e==="*";function cR(e,t){let r=e.split("/"),n=r.length;return r.some(x1)&&(n+=uR),t&&(n+=oR),r.filter(i=>!x1(i)).reduce((i,a)=>i+(iR.test(a)?aR:a===""?sR:lR),n)}function fR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function dR(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=f;if(p==="*"){let v=s[c]||"";o=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const b=s[c];return h&&!b?u[p]=void 0:u[p]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function pR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),L0(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function hR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return L0(!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 Go(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const mR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vR=e=>mR.test(e);function yR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?As(e):e,a;if(r)if(vR(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),L0(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=b1(r.substring(1),"/"):a=b1(r,t)}else a=t;return{pathname:a,search:bR(n),hash:wR(i)}}function b1(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Zh(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function gR(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function B0(e,t){let r=gR(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function F0(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=As(e):(i=su({},e),vt(!i.pathname||!i.pathname.includes("?"),Zh("?","pathname","search",i)),vt(!i.pathname||!i.pathname.includes("#"),Zh("#","pathname","hash",i)),vt(!i.search||!i.search.includes("#"),Zh("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let c=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),c-=1;i.pathname=p.join("/")}s=c>=0?t[c]:"/"}let l=yR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Ui=e=>e.join("/").replace(/\/\/+/g,"/"),xR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _R(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const EE=["post","put","patch","delete"];new Set(EE);const SR=["get",...EE];new Set(SR);/** + * React Router v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),j.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let c=F0(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Ui([t,c.pathname])),(f.replace?n.replace:n.push)(c,f.state,f)},[t,n,o,a,e])}const AR=j.createContext(null);function ER(e){let t=j.useContext(di).outlet;return t&&j.createElement(AR.Provider,{value:e},t)}function bp(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=j.useContext(fi),{matches:i}=j.useContext(di),{pathname:a}=ks(),o=JSON.stringify(B0(i,n.v7_relativeSplatPath));return j.useMemo(()=>F0(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function kR(e,t){return PR(e,t)}function PR(e,t,r,n){Es()||vt(!1);let{navigator:i}=j.useContext(fi),{matches:a}=j.useContext(di),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=ks(),f;if(t){var c;let g=typeof t=="string"?As(t):t;l==="/"||(c=g.pathname)!=null&&c.startsWith(l)||vt(!1),f=g}else f=u;let p=f.pathname||"/",h=p;if(l!=="/"){let g=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(g.length).join("/")}let b=tR(e,{pathname:h}),v=RR(b&&b.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:Ui([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:Ui([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),a,r,n);return t&&v?j.createElement(gp.Provider,{value:{location:lu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Ni.Pop}},v):v}function CR(){let e=LR(),t=_R(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:i},r):null,null)}const TR=j.createElement(CR,null);class NR extends j.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?j.createElement(di.Provider,{value:this.props.routeContext},j.createElement(PE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $R(e){let{routeContext:t,match:r,children:n}=e,i=j.useContext(yp);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(di.Provider,{value:t},n)}function RR(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);f>=0||vt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,c,p)=>{let h,b=!1,v=null,g=null;r&&(h=s&&c.route.id?s[c.route.id]:void 0,v=c.route.errorElement||TR,l&&(u<0&&p===0?(FR("route-fallback"),b=!0,g=null):u===p&&(b=!0,g=c.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=v:b?w=g:c.route.Component?w=j.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=f,j.createElement($R,{match:c,routeContext:{outlet:f,matches:y,isDataRoute:r!=null},children:w})};return r&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?j.createElement(NR,{location:r.location,revalidation:r.revalidation,component:v,error:h,children:m(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):m()},null)}var TE=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(TE||{}),NE=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}(NE||{});function IR(e){let t=j.useContext(yp);return t||vt(!1),t}function MR(e){let t=j.useContext(kE);return t||vt(!1),t}function DR(e){let t=j.useContext(di);return t||vt(!1),t}function $E(e){let t=DR(),r=t.matches[t.matches.length-1];return r.route.id||vt(!1),r.route.id}function LR(){var e;let t=j.useContext(PE),r=MR(),n=$E();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function BR(){let{router:e}=IR(TE.UseNavigateStable),t=$E(NE.UseNavigateStable),r=j.useRef(!1);return CE(()=>{r.current=!0}),j.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,lu({fromRouteId:t},a)))},[e,t])}const w1={};function FR(e,t,r){w1[e]||(w1[e]=!0)}function zR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function UR(e){let{to:t,replace:r,state:n,relative:i}=e;Es()||vt(!1);let{future:a,static:o}=j.useContext(fi),{matches:s}=j.useContext(di),{pathname:l}=ks(),u=xp(),f=F0(t,B0(s,a.v7_relativeSplatPath),l,i==="path"),c=JSON.stringify(f);return j.useEffect(()=>u(JSON.parse(c),{replace:r,state:n,relative:i}),[u,c,i,r,n]),null}function VR(e){return ER(e.context)}function _n(e){vt(!1)}function WR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Ni.Pop,navigator:a,static:o=!1,future:s}=e;Es()&&vt(!1);let l=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:l,navigator:a,static:o,future:lu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=As(n));let{pathname:f="/",search:c="",hash:p="",state:h=null,key:b="default"}=n,v=j.useMemo(()=>{let g=Go(f,l);return g==null?null:{location:{pathname:g,search:c,hash:p,state:h,key:b},navigationType:i}},[l,f,c,p,h,b,i]);return v==null?null:j.createElement(fi.Provider,{value:u},j.createElement(gp.Provider,{children:r,value:v}))}function HR(e){let{children:t,location:r}=e;return kR(Gv(t),r)}new Promise(()=>{});function Gv(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,i)=>{if(!j.isValidElement(n))return;let a=[...t,i];if(n.type===j.Fragment){r.push.apply(r,Gv(n.props.children,a));return}n.type!==_n&&vt(!1),!n.props.index||!n.props.children||vt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Gv(n.props.children,a)),r.push(o)}),r}/** + * React Router DOM v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Uf(){return Uf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function GR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KR(e,t){return e.button===0&&(!t||t==="_self")&&!GR(e)}const qR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],XR=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],YR="6";try{window.__reactRouterVersion=YR}catch{}const ZR=j.createContext({isTransitioning:!1}),QR="startTransition",_1=zT[QR];function JR(e){let{basename:t,children:r,future:n,window:i}=e,a=j.useRef();a.current==null&&(a.current=Q$({window:i,v5Compat:!0}));let o=a.current,[s,l]=j.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=j.useCallback(c=>{u&&_1?_1(()=>l(c)):l(c)},[l,u]);return j.useLayoutEffect(()=>o.listen(f),[o,f]),j.useEffect(()=>zR(n),[n]),j.createElement(WR,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const eI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rI=j.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:c}=t,p=RE(t,qR),{basename:h}=j.useContext(fi),b,v=!1;if(typeof u=="string"&&tI.test(u)&&(b=u,eI))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),x=Go(S.pathname,h);S.origin===w.origin&&x!=null?u=x+S.search+S.hash:v=!0}catch{}let g=OR(u,{relative:i}),y=aI(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:c});function m(w){n&&n(w),w.defaultPrevented||y(w)}return j.createElement("a",Uf({},p,{href:b||g,onClick:v||a?n:m,ref:r,target:l}))}),nI=j.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:o=!1,style:s,to:l,viewTransition:u,children:f}=t,c=RE(t,XR),p=bp(l,{relative:c.relative}),h=ks(),b=j.useContext(kE),{navigator:v,basename:g}=j.useContext(fi),y=b!=null&&oI(p)&&u===!0,m=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;i||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&g&&(S=Go(S,g)||S);const x=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!o&&w.startsWith(m)&&w.charAt(x)==="/",O=S!=null&&(S===m||!o&&S.startsWith(m)&&S.charAt(m.length)==="/"),A={isActive:_,isPending:O,isTransitioning:y},E=_?n:void 0,$;typeof a=="function"?$=a(A):$=[a,_?"active":null,O?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let N=typeof s=="function"?s(A):s;return j.createElement(rI,Uf({},c,{"aria-current":E,className:$,ref:r,style:N,to:l,viewTransition:u}),typeof f=="function"?f(A):f)});var Kv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Kv||(Kv={}));var S1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(S1||(S1={}));function iI(e){let t=j.useContext(yp);return t||vt(!1),t}function aI(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=xp(),u=ks(),f=bp(e,{relative:o});return j.useCallback(c=>{if(KR(c,r)){c.preventDefault();let p=n!==void 0?n:zf(u)===zf(f);l(e,{replace:p,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function oI(e,t){t===void 0&&(t={});let r=j.useContext(ZR);r==null&&vt(!1);let{basename:n}=iI(Kv.useViewTransitionState),i=bp(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=Go(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Go(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Hv(i.pathname,o)!=null||Hv(i.pathname,a)!=null}/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var sI={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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ye=(e,t)=>{const r=j.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>j.createElement("svg",{ref:f,...sI,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:["lucide",`lucide-${lI(e)}`,s].join(" "),...u},[...t.map(([c,p])=>j.createElement(c,p)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** + * @license lucide-react v0.363.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=Ye("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uI=Ye("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cI=Ye("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fI=Ye("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xl=Ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bl=Ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dI=Ye("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pI=Ye("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hI=Ye("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jh=Ye("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mI=Ye("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wp=Ye("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vI=Ye("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yI=Ye("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gI=Ye("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.363.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=Ye("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bI=Ye("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wI=Ye("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IE=Ye("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vf=Ye("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mc=Ye("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qi=Ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _I=Ye("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SI=Ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OI=Ye("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ii=Ye("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ME=Ye("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jI=Ye("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"}]]);function AI(){return d.jsxs("aside",{className:"w-64 shrink-0 flex flex-col h-screen bg-white dark:bg-black border-r border-slate-200 dark:border-[#151515] relative z-20 transition-colors duration-300",children:[d.jsxs("div",{className:"h-20 px-6 flex items-center gap-3.5 border-b border-slate-200 dark:border-[#151515] transition-colors duration-300",children:[d.jsx("div",{className:"w-9 h-9 bg-brand-500 dark:bg-black border border-brand-600 dark:border-[#2a2a2e] rounded-xl flex items-center justify-center shadow-sm",children:d.jsx(jI,{size:18,className:"text-white",strokeWidth:2})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[16px] font-bold tracking-widest text-slate-900 dark:text-white leading-tight uppercase",children:"Decision"}),d.jsx("p",{className:"text-[10px] uppercase text-brand-600 dark:text-[#66666e] tracking-wider leading-tight font-semibold",children:"Engine"})]})]}),d.jsxs("nav",{className:"flex-1 px-4 py-8 space-y-1 overflow-y-auto",children:[d.jsx(la,{to:"/",icon:xI,end:!0,children:"Overview"}),d.jsx(la,{to:"/decisions",icon:SI,children:"Decision Explorer"}),d.jsx("div",{className:"pt-8 pb-3 px-3 flex items-center gap-2",children:d.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-slate-400 dark:text-[#66666e]",children:"Routing"})}),d.jsx(la,{to:"/routing",icon:vI,end:!0,children:"Routing Hub"}),d.jsx(la,{to:"/routing/sr",icon:ME,indent:!0,children:"Auth-Rate Based"}),d.jsx(la,{to:"/routing/rules",icon:cI,indent:!0,children:"Rule-Based (Euclid)"}),d.jsx(la,{to:"/routing/volume",icon:Vf,indent:!0,children:"Volume Split"}),d.jsx(la,{to:"/routing/debit",icon:IE,indent:!0,children:"Debit Routing"})]}),d.jsx("div",{className:"px-6 py-5 border-t border-slate-200 dark:border-[#151515] bg-slate-50 dark:bg-black transition-colors duration-300",children:d.jsx("span",{className:"text-[11px] text-slate-500 dark:text-[#66666e] font-medium tracking-wide",children:"v1.2.1"})})]})}function la({to:e,icon:t,children:r,end:n,indent:i}){return d.jsx(nI,{to:e,end:n,className:({isActive:a})=>`group relative flex items-center gap-3 px-4 py-3 rounded-[14px] text-[14px] font-medium transition-all duration-200 ${i?"ml-3 w-[calc(100%-12px)]":""} ${a?"bg-slate-100 text-brand-600 dark:bg-[#151518] dark:text-white shadow-sm":"text-slate-500 hover:text-slate-900 hover:bg-slate-50 dark:text-[#888891] dark:hover:text-white dark:hover:bg-[#0c0c0e]"}`,children:({isActive:a})=>d.jsxs(d.Fragment,{children:[d.jsx(t,{size:18,className:`transition-colors duration-200 ${a?"text-brand-600 dark:text-white":"text-slate-400 dark:text-[#55555e] group-hover:text-slate-600 dark:group-hover:text-white"}`,strokeWidth:a?2.5:2}),d.jsx("span",{className:"flex-1",children:r})]})})}const EI={},O1=e=>{let t;const r=new Set,n=(f,c)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=c??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(b=>b(t,h))}},i=()=>t,l={setState:n,getState:i,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(EI?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,i,l);return l},kI=e=>e?O1(e):O1;var DE={exports:{}},LE={},BE={exports:{}},FE={};/** + * @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 Ko=j;function PI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var CI=typeof Object.is=="function"?Object.is:PI,TI=Ko.useState,NI=Ko.useEffect,$I=Ko.useLayoutEffect,RI=Ko.useDebugValue;function II(e,t){var r=t(),n=TI({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return $I(function(){i.value=r,i.getSnapshot=t,em(i)&&a({inst:i})},[e,r,t]),NI(function(){return em(i)&&a({inst:i}),e(function(){em(i)&&a({inst:i})})},[e]),RI(r),r}function em(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!CI(e,r)}catch{return!0}}function MI(e,t){return t()}var DI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?MI:II;FE.useSyncExternalStore=Ko.useSyncExternalStore!==void 0?Ko.useSyncExternalStore:DI;BE.exports=FE;var qv=BE.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.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 _p=j,LI=qv;function BI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var FI=typeof Object.is=="function"?Object.is:BI,zI=LI.useSyncExternalStore,UI=_p.useRef,VI=_p.useEffect,WI=_p.useMemo,HI=_p.useDebugValue;LE.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=UI(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=WI(function(){function l(h){if(!u){if(u=!0,f=h,h=n(h),i!==void 0&&o.hasValue){var b=o.value;if(i(b,h))return c=b}return c=h}if(b=c,FI(f,h))return b;var v=n(h);return i!==void 0&&i(b,v)?(f=h,b):(f=h,c=v)}var u=!1,f,c,p=r===void 0?null:r;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,r,n,i]);var s=zI(e,a[0],a[1]);return VI(function(){o.hasValue=!0,o.value=s},[s]),HI(s),s};DE.exports=LE;var GI=DE.exports;const KI=Ke(GI),zE={},{useDebugValue:qI}=T,{useSyncExternalStoreWithSelector:XI}=KI;let j1=!1;const YI=e=>e;function ZI(e,t=YI,r){(zE?"production":void 0)!=="production"&&r&&!j1&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),j1=!0);const n=XI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return qI(n),n}const QI=e=>{(zE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?kI(e):e,r=(n,i)=>ZI(t,n,i);return Object.assign(r,t),r},JI=e=>QI,eM={};function tM(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var a;const o=l=>l===null?null:JSON.parse(l,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(o):o(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const uu=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return uu(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return uu(n)(r)}}}},rM=(e,t)=>(r,n,i)=>{let a={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},o=!1;const s=new Set,l=new Set;let u;try{u=a.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...g)},n,i);const f=uu(a.serialize),c=()=>{const g=a.partialize({...n()});let y;const m=f({state:g,version:a.version}).then(w=>u.setItem(a.name,w)).catch(w=>{y=w});if(y)throw y;return m},p=i.setState;i.setState=(g,y)=>{p(g,y),c()};const h=e((...g)=>{r(...g),c()},n,i);let b;const v=()=>{var g;if(!u)return;o=!1,s.forEach(m=>m(n()));const y=((g=a.onRehydrateStorage)==null?void 0:g.call(a,n()))||void 0;return uu(u.getItem.bind(u))(a.name).then(m=>{if(m)return a.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return a.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var w;return b=a.merge(m,(w=n())!=null?w:h),r(b,!0),c()}).then(()=>{y==null||y(b,void 0),o=!0,l.forEach(m=>m(b))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:g=>{a={...a,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},v(),b||h},nM=(e,t)=>(r,n,i)=>{let a={storage:tM(()=>localStorage),partialize:v=>v,version:0,merge:(v,g)=>({...g,...v}),...t},o=!1;const s=new Set,l=new Set;let u=a.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const f=()=>{const v=a.partialize({...n()});return u.setItem(a.name,{state:v,version:a.version})},c=i.setState;i.setState=(v,g)=>{c(v,g),f()};const p=e((...v)=>{r(...v),f()},n,i);i.getInitialState=()=>p;let h;const b=()=>{var v,g;if(!u)return;o=!1,s.forEach(m=>{var w;return m((w=n())!=null?w:p)});const y=((g=a.onRehydrateStorage)==null?void 0:g.call(a,(v=n())!=null?v:p))||void 0;return uu(u.getItem.bind(u))(a.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return[!0,a.migrate(m.state,m.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var w;const[S,x]=m;if(h=a.merge(x,(w=n())!=null?w:p),r(h,!0),S)return f()}).then(()=>{y==null||y(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:v=>{a={...a,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>b(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},a.skipHydration||b(),h||p},iM=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((eM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),rM(e,t)):nM(e,t),aM=iM,ra=JI()(aM(e=>({merchantId:"",setMerchantId:t=>{console.log(` +[STORE] Merchant ID changed: "${t}"`),e({merchantId:t})}}),{name:"merchant-store"}));function oM(e,t,r){console.log(` +`+"=".repeat(80)),console.log(`[API REQUEST] ${new Date().toISOString()}`),console.log(`Method: ${e}`),console.log(`Path: ${t}`),r!==void 0&&console.log("Body:",JSON.stringify(r,null,2)),console.log("=".repeat(80))}function sM(e,t,r,n){console.log(` +`+"-".repeat(80)),console.log(`[API RESPONSE] ${new Date().toISOString()}`),console.log(`Path: ${e}`),console.log(`Status: ${t} ${r}`),console.log("Response Body:",n),console.log("-".repeat(80)+` +`)}function A1(e,t){console.log(` +`+"!".repeat(80)),console.log(`[API ERROR] ${new Date().toISOString()}`),console.log(`Path: ${e}`),t instanceof Error?(console.log("Error:",t.message),console.log("Stack:",t.stack)):console.log("Error:",t),console.log("!".repeat(80)+` +`)}async function UE(e,t){const r=(t==null?void 0:t.method)||"GET",n=t!=null&&t.body?JSON.parse(t.body):void 0;oM(r,e,n);try{const i=await fetch(e,{headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t}),a=await i.text();let o;try{const s=JSON.parse(a);o=JSON.stringify(s,null,2)}catch{o=a}if(sM(e,i.status,i.statusText,o),!i.ok){const s=new Error(`API error ${i.status}: ${a}`);throw A1(e,s),s}return a.trim()?JSON.parse(a):void 0}catch(i){throw A1(e,i),i}}async function ft(e,t){return UE(e,{method:"POST",body:t!==void 0?JSON.stringify(t):void 0})}async function lM(e){return UE(e)}function uM(){const{merchantId:e,setMerchantId:t}=ra(),[r,n]=j.useState(e),[i,a]=j.useState(!1),[o,s]=j.useState(()=>localStorage.getItem("theme")==="dark");j.useEffect(()=>{const u=window.document.documentElement;o?(u.classList.add("dark"),localStorage.setItem("theme","dark")):(u.classList.remove("dark"),localStorage.setItem("theme","light"))},[o]);async function l(){const u=r.trim();if(u){t(u),a(!0);try{await ft("/merchant-account/create",{merchant_id:u,gateway_success_rate_based_decider_input:null})}catch{}finally{a(!1)}}}return d.jsxs("header",{className:"h-[76px] bg-white dark:bg-black border-b border-slate-200 dark:border-[#151515] flex items-center justify-between px-8 shrink-0 relative z-10 transition-colors duration-300",children:[d.jsx("div",{}),d.jsxs("div",{className:"flex items-center gap-6",children:[d.jsxs("div",{className:"relative",children:[d.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&l(),placeholder:"Set Merchant ID",className:"w-72 bg-slate-50 dark:bg-[#0f0f11] border border-slate-200 dark:border-[#222222] rounded-full px-4 py-2 text-sm text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-[#66666e] focus:outline-none focus:border-slate-400 dark:focus:border-[#444444] transition-colors"}),d.jsx("button",{onClick:l,disabled:i,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-slate-400 hover:text-brand-500 dark:text-[#66666e] dark:hover:text-white transition-colors",children:i?d.jsx(bI,{size:16,className:"animate-spin"}):d.jsx(uI,{size:16})})]}),e&&d.jsxs("div",{className:"flex items-center gap-2 pl-6 ml-2 border-l border-slate-200 dark:border-[#222222] transition-colors duration-300",children:[d.jsx(fI,{size:16,className:"text-brand-500 dark:text-[#66666e]"}),d.jsx("span",{className:"text-sm text-slate-800 dark:text-white font-medium",children:e})]}),d.jsx("button",{onClick:()=>s(!o),className:"p-2.5 rounded-full bg-slate-100 text-slate-600 hover:bg-slate-200 dark:bg-[#151515] dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#222222] transition-colors duration-200","aria-label":"Toggle theme",children:o?d.jsx(OI,{size:18}):d.jsx(wI,{size:18})})]})]})}function cM(){return d.jsxs("div",{className:"flex h-screen overflow-hidden bg-[#f8fafc] text-slate-900 dark:bg-[#000000] dark:text-white relative transition-colors duration-300",children:[d.jsx("div",{className:"aurora-top"}),d.jsx(AI,{}),d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[d.jsx(uM,{}),d.jsx("main",{className:"flex-1 overflow-y-auto p-8 relative",children:d.jsx(VR,{})})]})]})}const VE=0,WE=1,HE=2,E1=3;var k1=Object.prototype.hasOwnProperty;function Xv(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&Xv(e[n],t[n]););return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(k1.call(e,r)&&++n&&!k1.call(t,r)||!(r in t)||!Xv(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const Vn=new WeakMap,Gn=()=>{},tr=Gn(),Yv=Object,Re=e=>e===tr,An=e=>typeof e=="function",Xi=(e,t)=>({...e,...t}),GE=e=>An(e.then),tm={},Dc={},z0="undefined",nc=typeof window!=z0,Zv=typeof document!=z0,fM=nc&&"Deno"in window,dM=()=>nc&&typeof window.requestAnimationFrame!=z0,KE=(e,t)=>{const r=Vn.get(e);return[()=>!Re(t)&&e.get(t)||tm,n=>{if(!Re(t)){const i=e.get(t);t in Dc||(Dc[t]=i),r[5](t,Xi(i,n),i||tm)}},r[6],()=>!Re(t)&&t in Dc?Dc[t]:!Re(t)&&e.get(t)||tm]};let Qv=!0;const pM=()=>Qv,[Jv,ey]=nc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Gn,Gn],hM=()=>{const e=Zv&&document.visibilityState;return Re(e)||e!=="hidden"},mM=e=>(Zv&&document.addEventListener("visibilitychange",e),Jv("focus",e),()=>{Zv&&document.removeEventListener("visibilitychange",e),ey("focus",e)}),vM=e=>{const t=()=>{Qv=!0,e()},r=()=>{Qv=!1};return Jv("online",t),Jv("offline",r),()=>{ey("online",t),ey("offline",r)}},yM={isOnline:pM,isVisible:hM},gM={initFocus:mM,initReconnect:vM},P1=!T.useId,$o=!nc||fM,xM=e=>dM()?window.requestAnimationFrame(e):setTimeout(e,1),rm=$o?j.useEffect:j.useLayoutEffect,nm=typeof navigator<"u"&&navigator.connection,C1=!$o&&nm&&(["slow-2g","2g"].includes(nm.effectiveType)||nm.saveData),Lc=new WeakMap,bM=e=>Yv.prototype.toString.call(e),im=(e,t)=>e===`[object ${t}]`;let wM=0;const ty=e=>{const t=typeof e,r=bM(e),n=im(r,"Date"),i=im(r,"RegExp"),a=im(r,"Object");let o,s;if(Yv(e)===e&&!n&&!i){if(o=Lc.get(e),o)return o;if(o=++wM+"~",Lc.set(e,o),Array.isArray(e)){for(o="@",s=0;s{if(An(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ty(e):"",[e,t]};let _M=0;const ry=()=>++_M;async function qE(...e){const[t,r,n,i]=e,a=Xi({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let l=a.optimisticData;const u=p=>typeof s=="function"?s(p):s!==!1,f=a.throwOnError;if(An(r)){const p=r,h=[],b=t.keys();for(const v of b)!/^\$(inf|sub)\$/.test(v)&&p(t.get(v)._k)&&h.push(v);return Promise.all(h.map(c))}return c(r);async function c(p){const[h]=U0(p);if(!h)return;const[b,v]=KE(t,h),[g,y,m,w]=Vn.get(t),S=()=>{const D=g[h];return(An(a.revalidate)?a.revalidate(b().data,p):a.revalidate!==!1)&&(delete m[h],delete w[h],D&&D[0])?D[0](HE).then(()=>b().data):b().data};if(e.length<3)return S();let x=n,_,O=!1;const A=ry();y[h]=[A,0];const E=!Re(l),$=b(),N=$.data,P=$._c,I=Re(P)?N:P;if(E&&(l=An(l)?l(I,N):l,v({data:l,_c:I})),An(x))try{x=x(I)}catch(D){_=D,O=!0}if(x&&GE(x))if(x=await x.catch(D=>{_=D,O=!0}),A!==y[h][0]){if(O)throw _;return x}else O&&E&&u(_)&&(o=!0,v({data:I,_c:tr}));if(o&&!O)if(An(o)){const D=o(x,I);v({data:D,error:tr,_c:tr})}else v({data:x,error:tr,_c:tr});if(y[h][1]=ry(),Promise.resolve(S()).then(()=>{v({_c:tr})}),O){if(f)throw _;return}return x}}const T1=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},SM=(e,t)=>{if(!Vn.has(e)){const r=Xi(gM,t),n=Object.create(null),i=qE.bind(tr,e);let a=Gn;const o=Object.create(null),s=(f,c)=>{const p=o[f]||[];return o[f]=p,p.push(c),()=>p.splice(p.indexOf(c),1)},l=(f,c,p)=>{e.set(f,c);const h=o[f];if(h)for(const b of h)b(c,p)},u=()=>{if(!Vn.has(e)&&(Vn.set(e,[n,Object.create(null),Object.create(null),Object.create(null),i,l,s]),!$o)){const f=r.initFocus(setTimeout.bind(tr,T1.bind(tr,n,VE))),c=r.initReconnect(setTimeout.bind(tr,T1.bind(tr,n,WE)));a=()=>{f&&f(),c&&c(),Vn.delete(e)}}};return u(),[e,i,u,a]}return[e,Vn.get(e)[4]]},OM=(e,t,r,n,i)=>{const a=r.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!Re(a)&&o>a||setTimeout(n,s,i)},jM=Xv,[XE,AM]=SM(new Map),EM=Xi({onLoadingSlow:Gn,onSuccess:Gn,onError:Gn,onErrorRetry:OM,onDiscarded:Gn,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:C1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:C1?5e3:3e3,compare:jM,isPaused:()=>!1,cache:XE,mutate:AM,fallback:{}},yM),kM=(e,t)=>{const r=Xi(e,t);if(t){const{use:n,fallback:i}=e,{use:a,fallback:o}=t;n&&a&&(r.use=n.concat(a)),i&&o&&(r.fallback=Xi(i,o))}return r},PM=j.createContext({}),CM="$inf$",YE=nc&&window.__SWR_DEVTOOLS_USE__,TM=YE?window.__SWR_DEVTOOLS_USE__:[],NM=()=>{YE&&(window.__SWR_DEVTOOLS_REACT__=T)},$M=e=>An(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],RM=()=>{const e=j.useContext(PM);return j.useMemo(()=>Xi(EM,e),[e])},IM=e=>(t,r,n)=>e(t,r&&((...a)=>{const[o]=U0(t),[,,,s]=Vn.get(XE);if(o.startsWith(CM))return r(...a);const l=s[o];return Re(l)?r(...a):(delete s[o],l)}),n),MM=TM.concat(IM),DM=e=>function(...r){const n=RM(),[i,a,o]=$M(r),s=kM(n,o);let l=e;const{use:u}=s,f=(u||[]).concat(MM);for(let c=f.length;c--;)l=f[c](l);return l(i,a||s.fetcher||null,s)},LM=(e,t,r)=>{const n=t[e]||(t[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i>=0&&(n[i]=n[n.length-1],n.pop())}};NM();const am=T.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),om={dedupe:!0},N1=Promise.resolve(tr),BM=()=>Gn,FM=(e,t,r)=>{const{cache:n,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:p,strictServerPrefetchWarning:h}=r,[b,v,g,y]=Vn.get(n),[m,w]=U0(e),S=j.useRef(!1),x=j.useRef(!1),_=j.useRef(m),O=j.useRef(t),A=j.useRef(r),E=()=>A.current,$=()=>E().isVisible()&&E().isOnline(),[N,P,I,D]=KE(n,m),B=j.useRef({}).current,V=Re(o)?Re(r.fallback)?tr:r.fallback[m]:o,U=(de,fe)=>{for(const je in B){const ke=je;if(ke==="data"){if(!i(de[ke],fe[ke])&&(!Re(de[ke])||!i(xe,fe[ke])))return!1}else if(fe[ke]!==de[ke])return!1}return!0},R=!S.current,F=j.useMemo(()=>{const de=N(),fe=D(),je=C=>{const M=Xi(C);return delete M._k,(()=>{if(!m||!t||E().isPaused())return!1;if(R&&!Re(s))return s;const te=Re(V)?M.data:V;return Re(te)||l})()?{isValidating:!0,isLoading:!0,...M}:M},ke=je(de),Ze=de===fe?ke:je(fe);let ze=ke;return[()=>{const C=je(N());return U(C,ze)?(ze.data=C.data,ze.isLoading=C.isLoading,ze.isValidating=C.isValidating,ze.error=C.error,ze):(ze=C,C)},()=>Ze]},[n,m]),L=qv.useSyncExternalStore(j.useCallback(de=>I(m,(fe,je)=>{U(je,fe)||de()}),[n,m]),F[0],F[1]),q=b[m]&&b[m].length>0,W=L.data,Y=Re(W)?V&&GE(V)?am(V):V:W,he=L.error,Ae=j.useRef(Y),xe=p?Re(W)?Re(Ae.current)?Y:Ae.current:W:Y,We=m&&Re(Y),Me=j.useRef(null);!$o&&qv.useSyncExternalStore(BM,()=>(Me.current=!1,Me),()=>(Me.current=!0,Me));const Z=Me.current;h&&Z&&!a&&We&&console.warn(`Missing pre-initiated data for serialized key "${m}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const ne=!m||!t||E().isPaused()||q&&!Re(he)?!1:R&&!Re(s)?s:a?Re(Y)?!1:l:Re(Y)||l,pe=R&&ne,k=Re(L.isValidating)?pe:L.isValidating,H=Re(L.isLoading)?pe:L.isLoading,K=j.useCallback(async de=>{const fe=O.current;if(!m||!fe||x.current||E().isPaused())return!1;let je,ke,Ze=!0;const ze=de||{},C=!g[m]||!ze.dedupe,M=()=>P1?!x.current&&m===_.current&&S.current:m===_.current,z={isValidating:!1,isLoading:!1},te=()=>{P(z)},ee=()=>{const re=g[m];re&&re[1]===ke&&delete g[m]},Q={isValidating:!0};Re(N().data)&&(Q.isLoading=!0);try{if(C&&(P(Q),r.loadingTimeout&&Re(N().data)&&setTimeout(()=>{Ze&&M()&&E().onLoadingSlow(m,r)},r.loadingTimeout),g[m]=[fe(w),ry()]),[je,ke]=g[m],je=await je,C&&setTimeout(ee,r.dedupingInterval),!g[m]||g[m][1]!==ke)return C&&M()&&E().onDiscarded(m),!1;z.error=tr;const re=v[m];if(!Re(re)&&(ke<=re[0]||ke<=re[1]||re[1]===0))return te(),C&&M()&&E().onDiscarded(m),!1;const ve=N().data;z.data=i(ve,je)?ve:je,C&&M()&&E().onSuccess(je,m,r)}catch(re){ee();const ve=E(),{shouldRetryOnError:Se}=ve;ve.isPaused()||(z.error=re,C&&M()&&(ve.onError(re,m,ve),(Se===!0||An(Se)&&Se(re))&&(!E().revalidateOnFocus||!E().revalidateOnReconnect||$())&&ve.onErrorRetry(re,m,ve,St=>{const Gt=b[m];Gt&&Gt[0]&&Gt[0](E1,St)},{retryCount:(ze.retryCount||0)+1,dedupe:!0})))}return Ze=!1,te(),!0},[m,n]),me=j.useCallback((...de)=>qE(n,_.current,...de),[]);if(rm(()=>{O.current=t,A.current=r,Re(W)||(Ae.current=W)}),rm(()=>{if(!m)return;const de=K.bind(tr,om);let fe=0;E().revalidateOnFocus&&(fe=Date.now()+E().focusThrottleInterval);const ke=LM(m,b,(Ze,ze={})=>{if(Ze==VE){const C=Date.now();E().revalidateOnFocus&&C>fe&&$()&&(fe=C+E().focusThrottleInterval,de())}else if(Ze==WE)E().revalidateOnReconnect&&$()&&de();else{if(Ze==HE)return K();if(Ze==E1)return K(ze)}});return x.current=!1,_.current=m,S.current=!0,P({_k:w}),ne&&(g[m]||(Re(Y)||$o?de():xM(de))),()=>{x.current=!0,ke()}},[m]),rm(()=>{let de;function fe(){const ke=An(u)?u(N().data):u;ke&&de!==-1&&(de=setTimeout(je,ke))}function je(){!N().error&&(f||E().isVisible())&&(c||E().isOnline())?K(om).then(fe):fe()}return fe(),()=>{de&&(clearTimeout(de),de=-1)}},[u,f,c,m]),j.useDebugValue(xe),a){if(!P1&&$o&&We)throw new Error("Fallback data is required when using Suspense in SSR.");We&&(O.current=t,A.current=r,x.current=!1);const de=y[m],fe=!Re(de)&&We?me(de):N1;if(am(fe),!Re(he)&&We)throw he;const je=We?K(om):N1;!Re(xe)&&We&&(je.status="fulfilled",je.value=!0),am(je)}return{mutate:me,get data(){return B.data=!0,xe},get error(){return B.error=!0,he},get isValidating(){return B.isValidating=!0,k},get isLoading(){return B.isLoading=!0,H}}},vn=DM(FM);function Te({children:e,className:t="",onClick:r}){return d.jsx("div",{className:`glass-panel rounded-[20px] ${r?"glass-panel-hover cursor-pointer":""} ${t}`,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:e})}function et({children:e,className:t=""}){return d.jsx("div",{className:`px-6 py-5 border-b border-slate-200 dark:border-[#1c1c1f] bg-slate-50 dark:bg-[#0c0c0e] rounded-t-[20px] ${t}`,children:e})}function Ne({children:e,className:t=""}){return d.jsx("div",{className:`px-6 py-5 ${t}`,children:e})}const zM={green:"bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20",gray:"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8",blue:"bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20",red:"bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20",orange:"bg-orange-500/10 text-orange-400 ring-1 ring-inset ring-orange-500/20",purple:"bg-purple-500/10 text-purple-400 ring-1 ring-inset ring-purple-500/20"};function Qt({variant:e="gray",children:t}){return d.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${zM[e]}`,children:t})}function UM(){const[e,t]=j.useState("loading");return j.useEffect(()=>{console.log(` +[HEALTH CHECK] ${new Date().toISOString()}`),console.log("Fetching: GET /health"),fetch("/health").then(r=>{console.log(`[HEALTH CHECK] Response: ${r.status} ${r.statusText}`),t(r.ok?"up":"down")}).catch(r=>{console.log(`[HEALTH CHECK ERROR] ${r.message}`),t("down")})},[]),e}function VM(){var l,u;const e=xp(),{merchantId:t}=ra(),r=UM(),{data:n}=vn(t?`/routing/list/active/${t}`:null,()=>ft(`/routing/list/active/${t}`),{shouldRetryOnError:!1}),{data:i,error:a}=vn(t?["/rule/get","successRate",t]:null,()=>ft("/rule/get",{merchant_id:t,algorithm:"successRate"})),o=n&&n.length>0?n[0]:null,s=(n||[]).some(f=>{var c;return((c=f.algorithm_data||f.algorithm)==null?void 0:c.type)==="advanced"});return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Overview"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Decision Engine routing health and status"})]}),!t&&d.jsxs("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 flex items-center gap-2 text-sm text-yellow-800",children:[d.jsx(dI,{size:16}),"Set your Merchant ID in the top bar to load configuration."]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[d.jsx(Te,{children:d.jsxs(Ne,{className:"flex items-center gap-3",children:[r==="up"?d.jsx(pI,{className:"text-green-500",size:24}):r==="down"?d.jsx(hI,{className:"text-red-500",size:24}):d.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-gray-200 border-t-gray-500 animate-spin"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500",children:"API Health"}),d.jsx("p",{className:"text-sm font-medium",children:r==="up"?"Healthy":r==="down"?"Down":"Checking..."})]})]})}),d.jsx(Te,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:d.jsxs(Ne,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Active Routing Rule"}),t?o?d.jsxs("div",{children:[d.jsx(Qt,{variant:"green",children:"Active"}),d.jsx("p",{className:"text-sm font-medium mt-1 truncate",children:o.name}),d.jsx("p",{className:"text-xs text-slate-400",children:(l=o.algorithm_data||o.algorithm)==null?void 0:l.type})]}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})}),d.jsx(Te,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/sr"),children:d.jsxs(Ne,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Auth-Rate Config"}),t?a?d.jsx(Qt,{variant:"gray",children:"Not Configured"}):i!=null&&i.data?d.jsx(Qt,{variant:"green",children:"Configured"}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})}),d.jsx(Te,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/rules"),children:d.jsxs(Ne,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Rule-Based Routing"}),t?s?d.jsx(Qt,{variant:"green",children:"Configured"}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})})]}),o&&d.jsxs(Te,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Routing Configuration"})}),d.jsx(Ne,{children:d.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Name"}),d.jsx("dd",{className:"font-medium",children:o.name})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Type"}),d.jsx("dd",{className:"font-medium capitalize",children:(u=o.algorithm_data||o.algorithm)==null?void 0:u.type})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Algorithm For"}),d.jsx("dd",{className:"font-medium capitalize",children:o.algorithm_for})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"ID"}),d.jsx("dd",{className:"font-mono text-xs text-slate-600",children:o.id})]})]})})]})]})}function WM(){const e=xp(),{merchantId:t}=ra(),{data:r}=vn(t?`/routing/list/active/${t}`:null,()=>ft(`/routing/list/active/${t}`)),{data:n}=vn(t?["/rule/get","successRate",t]:null,()=>ft("/rule/get",{merchant_id:t,algorithm:"successRate"})),i=[{id:"sr",title:"Auth-Rate Based Routing",description:"Dynamically route to the best-performing gateway based on real-time authorization rates.",icon:ME,route:"/routing/sr",algorithmType:"successRate",checkConfigured:()=>{var a;return!!((a=n==null?void 0:n.config)!=null&&a.data)}},{id:"rules",title:"Rule-Based Routing",description:"Declarative Euclid DSL rules to route payments based on conditions and attributes.",icon:gI,route:"/routing/rules",algorithmType:"advanced",checkConfigured:()=>(r||[]).some(a=>{var o;return((o=a.algorithm_data||a.algorithm)==null?void 0:o.type)==="advanced"})},{id:"volume",title:"Volume Split",description:"Distribute payment traffic across gateways by configurable percentage splits.",icon:Vf,route:"/routing/volume",algorithmType:"volume_split",checkConfigured:()=>(r||[]).some(a=>{var o;return((o=a.algorithm_data||a.algorithm)==null?void 0:o.type)==="volume_split"})},{id:"debit",title:"Network Routing",description:"Optimise debit network fees with acquirer-aware network-based routing.",icon:mI,route:"/routing/debit",algorithmType:"debitRouting",checkConfigured:()=>!1}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Routing Hub"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Click on any routing strategy to configure"})]}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:i.map(a=>{const o=a.icon,s=a.checkConfigured();return d.jsx(Te,{className:"flex flex-col hover:border-brand-300 cursor-pointer transition-all hover:shadow-md",onClick:()=>e(a.route),children:d.jsxs(Ne,{className:"flex-1 flex flex-col gap-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"p-2 bg-brand-50 rounded-lg border border-[#1c2d50]",children:d.jsx(o,{size:20,className:"text-brand-500"})}),d.jsx(Qt,{variant:s?"green":"gray",children:s?"Configured":"Not Configured"})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-slate-900",children:a.title}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:a.description})]}),d.jsx("div",{className:"mt-auto pt-2",children:d.jsx("span",{className:"text-sm text-brand-600 font-medium",children:s?"Manage →":"Setup →"})})]})},a.id)})})]})}var ic=e=>e.type==="checkbox",wa=e=>e instanceof Date,pr=e=>e==null;const ZE=e=>typeof e=="object";var _t=e=>!pr(e)&&!Array.isArray(e)&&ZE(e)&&!wa(e),HM=e=>_t(e)&&e.target?ic(e.target)?e.target.checked:e.target.value:e,GM=(e,t)=>t.split(".").some((r,n,i)=>!isNaN(Number(r))&&e.has(i.slice(0,n).join("."))),KM=e=>{const t=e.constructor&&e.constructor.prototype;return _t(t)&&t.hasOwnProperty("isPrototypeOf")},V0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ot(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(V0&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(_t(e)&&KM(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=ot(e[i]));return n}var Sp=e=>/^\w*$/.test(e),Qe=e=>e===void 0,Op=e=>Array.isArray(e)?e.filter(Boolean):[],W0=e=>Op(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(e,t,r)=>{if(!t||!_t(e))return r;const n=(Sp(t)?[t]:W0(t)).reduce((i,a)=>pr(i)?i:i[a],e);return Qe(n)||n===e?Qe(e[t])?r:e[t]:n},On=e=>typeof e=="boolean",fn=e=>typeof e=="function",Ve=(e,t,r)=>{let n=-1;const i=Sp(t)?[t]:W0(t),a=i.length,o=a-1;for(;++nT.useContext(JE);var XM=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Hr.all&&(t._proxyFormState[o]=!n||Hr.all),e[o]}});return i};const ek=typeof window<"u"?T.useLayoutEffect:T.useEffect;var ar=e=>typeof e=="string",YM=(e,t,r,n,i)=>ar(e)?(n&&t.watch.add(e),ae(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),ae(r,a))):(n&&(t.watchAll=!0),r),ny=e=>pr(e)||!ZE(e);function Pi(e,t,r=new WeakSet){if(ny(e)||ny(t))return Object.is(e,t);if(wa(e)&&wa(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const o=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const s=t[a];if(wa(o)&&wa(s)||(_t(o)||Array.isArray(o))&&(_t(s)||Array.isArray(s))?!Pi(o,s,r):!Object.is(o,s))return!1}}return!0}const ZM=T.createContext(null);ZM.displayName="HookFormContext";var tk=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},vr=e=>Array.isArray(e)?e:[e],$1=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}};function rk(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],a=t[n];if(i&&_t(i)&&a){const o=rk(i,a);_t(o)&&(r[n]=o)}else e[n]&&(r[n]=a)}return r}var Zt=e=>_t(e)&&!Object.keys(e).length,H0=e=>e.type==="file",Wf=e=>{if(!V0)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},nk=e=>e.type==="select-multiple",G0=e=>e.type==="radio",QM=e=>G0(e)||ic(e),lm=e=>Wf(e)&&e.isConnected;function JM(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(fn(e[t]))return!0;return!1};function ik(e){return Array.isArray(e)||_t(e)&&!tD(e)}function iy(e,t={}){for(const r in e){const n=e[r];ik(n)?(t[r]=Array.isArray(n)?[]:{},iy(n,t[r])):Qe(n)||(t[r]=!0)}return t}function wl(e,t,r){r||(r=iy(t));for(const n in e){const i=e[n];if(ik(i))Qe(t)||ny(r[n])?r[n]=iy(i,Array.isArray(i)?[]:{}):wl(i,pr(t)?{}:t[n],r[n]);else{const a=t[n];r[n]=!Pi(i,a)}}return r}const R1={value:!1,isValid:!1},I1={value:!0,isValid:!0};var ak=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Qe(e[0].attributes.value)?Qe(e[0].value)||e[0].value===""?I1:{value:e[0].value,isValid:!0}:I1:R1}return R1},ok=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Qe(e)?e:t?e===""?NaN:e&&+e:r&&ar(e)?new Date(e):n?n(e):e;const M1={isValid:!1,value:null};var sk=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,M1):M1;function D1(e){const t=e.ref;return H0(t)?t.files:G0(t)?sk(e.refs).value:nk(t)?[...t.selectedOptions].map(({value:r})=>r):ic(t)?ak(e.refs).value:ok(Qe(t.value)?e.ref.value:t.value,e)}var rD=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,nD=(e,t,r,n)=>{const i={};for(const a of e){const o=ae(t,a);o&&Ve(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Hf=e=>e instanceof RegExp,nl=e=>Qe(e)?e:Hf(e)?e.source:_t(e)?Hf(e.value)?e.value.source:e.value:e,wo=e=>({isOnSubmit:!e||e===Hr.onSubmit,isOnBlur:e===Hr.onBlur,isOnChange:e===Hr.onChange,isOnAll:e===Hr.all,isOnTouch:e===Hr.onTouched});const L1="AsyncFunction";var iD=e=>!!e&&!!e.validate&&!!(fn(e.validate)&&e.validate.constructor.name===L1||_t(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===L1)),aD=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ay=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ro=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=ae(e,i);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Ro(s,t))break}else if(_t(s)&&Ro(s,t))break}}};function B1(e,t,r){const n=ae(e,r);if(n||Sp(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=ae(t,a),s=ae(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};i.pop()}return{name:r}}var oD=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return Zt(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||Hr.all))},sD=(e,t,r)=>!e||!t||e===t||vr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),lD=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,uD=(e,t)=>!Op(ae(e,t)).length&&bt(e,t),lk=(e,t,r)=>{const n=vr(ae(e,r));return Ve(n,QE,t[r]),Ve(e,r,n),e};function F1(e,t,r="validate"){if(ar(e)||Array.isArray(e)&&e.every(ar)||On(e)&&!e)return{type:r,message:ar(e)?e:"",ref:t}}var ro=e=>_t(e)&&!Hf(e)?e:{value:e,message:""},oy=async(e,t,r,n,i,a)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:f,min:c,max:p,pattern:h,validate:b,name:v,valueAsNumber:g,mount:y}=e._f,m=ae(r,v);if(!y||t.has(v))return{};const w=s?s[0]:o,S=P=>{i&&w.reportValidity&&(w.setCustomValidity(On(P)?"":P||""),w.reportValidity())},x={},_=G0(o),O=ic(o),A=_||O,E=(g||H0(o))&&Qe(o.value)&&Qe(m)||Wf(o)&&o.value===""||m===""||Array.isArray(m)&&!m.length,$=tk.bind(null,v,n,x),N=(P,I,D,B=on.maxLength,V=on.minLength)=>{const U=P?I:D;x[v]={type:P?B:V,message:U,ref:o,...$(P?B:V,U)}};if(a?!Array.isArray(m)||!m.length:l&&(!A&&(E||pr(m))||On(m)&&!m||O&&!ak(s).isValid||_&&!sk(s).isValid)){const{value:P,message:I}=ar(l)?{value:!!l,message:l}:ro(l);if(P&&(x[v]={type:on.required,message:I,ref:w,...$(on.required,I)},!n))return S(I),x}if(!E&&(!pr(c)||!pr(p))){let P,I;const D=ro(p),B=ro(c);if(!pr(m)&&!isNaN(m)){const V=o.valueAsNumber||m&&+m;pr(D.value)||(P=V>D.value),pr(B.value)||(I=Vnew Date(new Date().toDateString()+" "+L),R=o.type=="time",F=o.type=="week";ar(D.value)&&m&&(P=R?U(m)>U(D.value):F?m>D.value:V>new Date(D.value)),ar(B.value)&&m&&(I=R?U(m)+P.value,B=!pr(I.value)&&m.length<+I.value;if((D||B)&&(N(D,P.message,I.message),!n))return S(x[v].message),x}if(h&&!E&&ar(m)){const{value:P,message:I}=ro(h);if(Hf(P)&&!m.match(P)&&(x[v]={type:on.pattern,message:I,ref:o,...$(on.pattern,I)},!n))return S(I),x}if(b){if(fn(b)){const P=await b(m,r),I=F1(P,w);if(I&&(x[v]={...I,...$(on.validate,I.message)},!n))return S(I.message),x}else if(_t(b)){let P={};for(const I in b){if(!Zt(P)&&!n)break;const D=F1(await b[I](m,r),w,I);D&&(P={...D,...$(I,D.message)},S(D.message),n&&(x[v]=P))}if(!Zt(P)&&(x[v]={ref:w,...P},!n))return x}}return S(!0),x};const cD={mode:Hr.onSubmit,reValidateMode:Hr.onChange,shouldFocusError:!0};function fD(e={}){let t={...cD,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:fn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=_t(t.defaultValues)||_t(t.values)?ot(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ot(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},c={...f};let p={...c};const h={array:$1(),state:$1()},b=t.criteriaMode===Hr.all,v=C=>M=>{clearTimeout(u),u=setTimeout(C,M)},g=async C=>{if(!o.keepIsValid&&!t.disabled&&(c.isValid||p.isValid||C)){let M;t.resolver?(M=Zt((await E()).errors),y()):M=await P({fields:n,onlyCheckValid:!0,eventType:to.VALID}),M!==r.isValid&&h.state.next({isValid:M})}},y=(C,M)=>{!t.disabled&&(c.isValidating||c.validatingFields||p.isValidating||p.validatingFields)&&((C||Array.from(s.mount)).forEach(z=>{z&&(M?Ve(r.validatingFields,z,M):bt(r.validatingFields,z))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Zt(r.validatingFields)}))},m=C=>{const M=wl(i,a),z=rD(C);Ve(r.dirtyFields,z,ae(M,z))},w=(C,M=[],z,te,ee=!0,Q=!0)=>{if(te&&z&&!t.disabled){if(o.action=!0,Q&&Array.isArray(ae(n,C))){const re=z(ae(n,C),te.argA,te.argB);ee&&Ve(n,C,re)}if(Q&&Array.isArray(ae(r.errors,C))){const re=z(ae(r.errors,C),te.argA,te.argB);ee&&Ve(r.errors,C,re),uD(r.errors,C)}if((c.touchedFields||p.touchedFields)&&Q&&Array.isArray(ae(r.touchedFields,C))){const re=z(ae(r.touchedFields,C),te.argA,te.argB);ee&&Ve(r.touchedFields,C,re)}(c.dirtyFields||p.dirtyFields)&&m(C),h.state.next({name:C,isDirty:D(C,M),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ve(a,C,M)},S=(C,M)=>{Ve(r.errors,C,M),h.state.next({errors:r.errors})},x=C=>{r.errors=C,h.state.next({errors:r.errors,isValid:!1})},_=(C,M,z,te)=>{const ee=ae(n,C);if(ee){const Q=ae(a,C,Qe(z)?ae(i,C):z);Qe(Q)||te&&te.defaultChecked||M?Ve(a,C,M?Q:D1(ee._f)):U(C,Q),o.mount&&!o.action&&g()}},O=(C,M,z,te,ee)=>{let Q=!1,re=!1;const ve={name:C};if(!t.disabled){if(!z||te){(c.isDirty||p.isDirty)&&(re=r.isDirty,r.isDirty=ve.isDirty=D(),Q=re!==ve.isDirty);const Se=Pi(ae(i,C),M);re=!!ae(r.dirtyFields,C),Se?bt(r.dirtyFields,C):Ve(r.dirtyFields,C,!0),ve.dirtyFields=r.dirtyFields,Q=Q||(c.dirtyFields||p.dirtyFields)&&re!==!Se}if(z){const Se=ae(r.touchedFields,C);Se||(Ve(r.touchedFields,C,z),ve.touchedFields=r.touchedFields,Q=Q||(c.touchedFields||p.touchedFields)&&Se!==z)}Q&&ee&&h.state.next(ve)}return Q?ve:{}},A=(C,M,z,te)=>{const ee=ae(r.errors,C),Q=(c.isValid||p.isValid)&&On(M)&&r.isValid!==M;if(t.delayError&&z?(l=v(()=>S(C,z)),l(t.delayError)):(clearTimeout(u),l=null,z?Ve(r.errors,C,z):bt(r.errors,C)),(z?!Pi(ee,z):ee)||!Zt(te)||Q){const re={...te,...Q&&On(M)?{isValid:M}:{},errors:r.errors,name:C};r={...r,...re},h.state.next(re)}},E=async C=>(y(C,!0),await t.resolver(a,t.context,nD(C||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),$=async C=>{const{errors:M}=await E(C);if(y(C),C)for(const z of C){const te=ae(M,z);te?Ve(r.errors,z,te):bt(r.errors,z)}else r.errors=M;return M},N=async({name:C,eventType:M})=>{if(e.validate){const z=await e.validate({formValues:a,formState:r,name:C,eventType:M});if(_t(z))for(const te in z)z[te]&&xe(`${sm}.${te}`,{message:ar(z.message)?z.message:"",type:on.validate});else ar(z)||!z?xe(sm,{message:z||"",type:on.validate}):Ae(sm);return z}return!0},P=async({fields:C,onlyCheckValid:M,name:z,eventType:te,context:ee={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(ee.runRootValidation=!0,!await N({name:z,eventType:te})&&(ee.valid=!1,M)))return ee.valid;for(const Q in C){const re=C[Q];if(re){const{_f:ve,...Se}=re;if(ve){const St=s.array.has(ve.name),Gt=re._f&&iD(re._f);Gt&&c.validatingFields&&y([ve.name],!0);const Kt=await oy(re,s.disabled,a,b,t.shouldUseNativeValidation&&!M,St);if(Gt&&c.validatingFields&&y([ve.name]),Kt[ve.name]&&(ee.valid=!1,M)||(!M&&(ae(Kt,ve.name)?St?lk(r.errors,Kt,ve.name):Ve(r.errors,ve.name,Kt[ve.name]):bt(r.errors,ve.name)),e.shouldUseNativeValidation&&Kt[ve.name]))break}!Zt(Se)&&await P({context:ee,onlyCheckValid:M,fields:Se,name:Q,eventType:te})}}return ee.valid},I=()=>{for(const C of s.unMount){const M=ae(n,C);M&&(M._f.refs?M._f.refs.every(z=>!lm(z)):!lm(M._f.ref))&&ne(C)}s.unMount=new Set},D=(C,M)=>!t.disabled&&(C&&M&&Ve(a,C,M),!Pi(Y(),i)),B=(C,M,z)=>YM(C,s,{...o.mount?a:Qe(M)?i:ar(C)?{[C]:M}:M},z,M),V=C=>Op(ae(o.mount?a:i,C,t.shouldUnregister?ae(i,C,[]):[])),U=(C,M,z={})=>{const te=ae(n,C);let ee=M;if(te){const Q=te._f;Q&&(!Q.disabled&&Ve(a,C,ok(M,Q)),ee=Wf(Q.ref)&&pr(M)?"":M,nk(Q.ref)?[...Q.ref.options].forEach(re=>re.selected=ee.includes(re.value)):Q.refs?ic(Q.ref)?Q.refs.forEach(re=>{(!re.defaultChecked||!re.disabled)&&(Array.isArray(ee)?re.checked=!!ee.find(ve=>ve===re.value):re.checked=ee===re.value||!!ee)}):Q.refs.forEach(re=>re.checked=re.value===ee):H0(Q.ref)?Q.ref.value="":(Q.ref.value=ee,Q.ref.type||h.state.next({name:C,values:ot(a)})))}(z.shouldDirty||z.shouldTouch)&&O(C,ee,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&W(C)},R=(C,M,z)=>{for(const te in M){if(!M.hasOwnProperty(te))return;const ee=M[te],Q=C+"."+te,re=ae(n,Q);(s.array.has(C)||_t(ee)||re&&!re._f)&&!wa(ee)?R(Q,ee,z):U(Q,ee,z)}},F=(C,M,z={})=>{const te=ae(n,C),ee=s.array.has(C),Q=ot(M);Ve(a,C,Q),ee?(h.array.next({name:C,values:ot(a)}),(c.isDirty||c.dirtyFields||p.isDirty||p.dirtyFields)&&z.shouldDirty&&(m(C),h.state.next({name:C,dirtyFields:r.dirtyFields,isDirty:D(C,Q)}))):te&&!te._f&&!pr(Q)?R(C,Q,z):U(C,Q,z),ay(C,s)?h.state.next({...r,name:C,values:ot(a)}):h.state.next({name:o.mount?C:void 0,values:ot(a)})},L=async C=>{o.mount=!0;const M=C.target;let z=M.name,te=!0;const ee=ae(n,z),Q=Se=>{te=Number.isNaN(Se)||wa(Se)&&isNaN(Se.getTime())||Pi(Se,ae(a,z,Se))},re=wo(t.mode),ve=wo(t.reValidateMode);if(ee){let Se,St;const Gt=M.type?D1(ee._f):HM(C),Kt=C.type===to.BLUR||C.type===to.FOCUS_OUT,Ws=!aD(ee._f)&&!e.validate&&!t.resolver&&!ae(r.errors,z)&&!ee._f.deps||lD(Kt,ae(r.touchedFields,z),r.isSubmitted,ve,re),Qa=ay(z,s,Kt);Ve(a,z,Gt),Kt?(!M||!M.readOnly)&&(ee._f.onBlur&&ee._f.onBlur(C),l&&l(0)):ee._f.onChange&&ee._f.onChange(C);const Hs=O(z,Gt,Kt),mc=!Zt(Hs)||Qa;if(!Kt&&h.state.next({name:z,type:C.type,values:ot(a)}),Ws)return(c.isValid||p.isValid)&&(t.mode==="onBlur"?Kt&&g():Kt||g()),mc&&h.state.next({name:z,...Qa?{}:Hs});if(!t.resolver&&e.validate&&await N({name:z,eventType:C.type}),!Kt&&Qa&&h.state.next({...r}),t.resolver){const{errors:vc}=await E([z]);if(y([z]),Q(Gt),te){const Sh=B1(r.errors,n,z),yc=B1(vc,n,Sh.name||z);Se=yc.error,z=yc.name,St=Zt(vc)}}else y([z],!0),Se=(await oy(ee,s.disabled,a,b,t.shouldUseNativeValidation))[z],y([z]),Q(Gt),te&&(Se?St=!1:(c.isValid||p.isValid)&&(St=await P({fields:n,onlyCheckValid:!0,name:z,eventType:C.type})));te&&(ee._f.deps&&(!Array.isArray(ee._f.deps)||ee._f.deps.length>0)&&W(ee._f.deps),A(z,St,Se,Hs))}},q=(C,M)=>{if(ae(r.errors,M)&&C.focus)return C.focus(),1},W=async(C,M={})=>{let z,te;const ee=vr(C);if(t.resolver){const Q=await $(Qe(C)?C:ee);z=Zt(Q),te=C?!ee.some(re=>ae(Q,re)):z}else C?(te=(await Promise.all(ee.map(async Q=>{const re=ae(n,Q);return await P({fields:re&&re._f?{[Q]:re}:re,eventType:to.TRIGGER})}))).every(Boolean),!(!te&&!r.isValid)&&g()):te=z=await P({fields:n,name:C,eventType:to.TRIGGER});return h.state.next({...!ar(C)||(c.isValid||p.isValid)&&z!==r.isValid?{}:{name:C},...t.resolver||!C?{isValid:z}:{},errors:r.errors}),M.shouldFocus&&!te&&Ro(n,q,C?ee:s.mount),te},Y=(C,M)=>{let z={...o.mount?a:i};return M&&(z=rk(M.dirtyFields?r.dirtyFields:r.touchedFields,z)),Qe(C)?z:ar(C)?ae(z,C):C.map(te=>ae(z,te))},he=(C,M)=>({invalid:!!ae((M||r).errors,C),isDirty:!!ae((M||r).dirtyFields,C),error:ae((M||r).errors,C),isValidating:!!ae(r.validatingFields,C),isTouched:!!ae((M||r).touchedFields,C)}),Ae=C=>{const M=C?vr(C):void 0;M==null||M.forEach(z=>bt(r.errors,z)),M?M.forEach(z=>{h.state.next({name:z,errors:r.errors})}):h.state.next({errors:{}})},xe=(C,M,z)=>{const te=(ae(n,C,{_f:{}})._f||{}).ref,ee=ae(r.errors,C)||{},{ref:Q,message:re,type:ve,...Se}=ee;Ve(r.errors,C,{...Se,...M,ref:te}),h.state.next({name:C,errors:r.errors,isValid:!1}),z&&z.shouldFocus&&te&&te.focus&&te.focus()},We=(C,M)=>fn(C)?h.state.subscribe({next:z=>"values"in z&&C(B(void 0,M),z)}):B(C,M,!0),Me=C=>h.state.subscribe({next:M=>{sD(C.name,M.name,C.exact)&&oD(M,C.formState||c,ke,C.reRenderRoot)&&C.callback({values:{...a},...r,...M,defaultValues:i})}}).unsubscribe,Z=C=>(o.mount=!0,p={...p,...C.formState},Me({...C,formState:{...f,...C.formState}})),ne=(C,M={})=>{for(const z of C?vr(C):s.mount)s.mount.delete(z),s.array.delete(z),M.keepValue||(bt(n,z),bt(a,z)),!M.keepError&&bt(r.errors,z),!M.keepDirty&&bt(r.dirtyFields,z),!M.keepTouched&&bt(r.touchedFields,z),!M.keepIsValidating&&bt(r.validatingFields,z),!t.shouldUnregister&&!M.keepDefaultValue&&bt(i,z);h.state.next({values:ot(a)}),h.state.next({...r,...M.keepDirty?{isDirty:D()}:{}}),!M.keepIsValid&&g()},pe=({disabled:C,name:M})=>{if(On(C)&&o.mount||C||s.disabled.has(M)){const ee=s.disabled.has(M)!==!!C;C?s.disabled.add(M):s.disabled.delete(M),ee&&o.mount&&!o.action&&g()}},k=(C,M={})=>{let z=ae(n,C);const te=On(M.disabled)||On(t.disabled),ee=!s.registerName.has(C)&&z&&!z._f.mount;return Ve(n,C,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:C}},name:C,mount:!0,...M}}),s.mount.add(C),z&&!ee?pe({disabled:On(M.disabled)?M.disabled:t.disabled,name:C}):_(C,!0,M.value),{...te?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:nl(M.min),max:nl(M.max),minLength:nl(M.minLength),maxLength:nl(M.maxLength),pattern:nl(M.pattern)}:{},name:C,onChange:L,onBlur:L,ref:Q=>{if(Q){s.registerName.add(C),k(C,M),s.registerName.delete(C),z=ae(n,C);const re=Qe(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ve=QM(re),Se=z._f.refs||[];if(ve?Se.find(St=>St===re):re===z._f.ref)return;Ve(n,C,{_f:{...z._f,...ve?{refs:[...Se.filter(lm),re,...Array.isArray(ae(i,C))?[{}]:[]],ref:{type:re.type,name:C}}:{ref:re}}}),_(C,!1,void 0,re)}else z=ae(n,C,{}),z._f&&(z._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(GM(s.array,C)&&o.action)&&s.unMount.add(C)}}},H=()=>t.shouldFocusError&&Ro(n,q,s.mount),K=C=>{On(C)&&(h.state.next({disabled:C}),Ro(n,(M,z)=>{const te=ae(n,z);te&&(M.disabled=te._f.disabled||C,Array.isArray(te._f.refs)&&te._f.refs.forEach(ee=>{ee.disabled=te._f.disabled||C}))},0,!1))},me=(C,M)=>async z=>{let te;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let ee=ot(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:Q,values:re}=await E();y(),r.errors=Q,ee=ot(re)}else await P({fields:n,eventType:to.SUBMIT});if(s.disabled.size)for(const Q of s.disabled)bt(ee,Q);if(bt(r.errors,QE),Zt(r.errors)){h.state.next({errors:{}});try{await C(ee,z)}catch(Q){te=Q}}else M&&await M({...r.errors},z),H(),setTimeout(H);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Zt(r.errors)&&!te,submitCount:r.submitCount+1,errors:r.errors}),te)throw te},_e=(C,M={})=>{ae(n,C)&&(Qe(M.defaultValue)?F(C,ot(ae(i,C))):(F(C,M.defaultValue),Ve(i,C,ot(M.defaultValue))),M.keepTouched||bt(r.touchedFields,C),M.keepDirty||(bt(r.dirtyFields,C),r.isDirty=M.defaultValue?D(C,ot(ae(i,C))):D()),M.keepError||(bt(r.errors,C),c.isValid&&g()),h.state.next({...r}))},de=(C,M={})=>{const z=C?ot(C):i,te=ot(z),ee=Zt(C),Q=ee?i:te;if(M.keepDefaultValues||(i=z),!M.keepValues){if(M.keepDirtyValues){const re=new Set([...s.mount,...Object.keys(wl(i,a))]);for(const ve of Array.from(re)){const Se=ae(r.dirtyFields,ve),St=ae(a,ve),Gt=ae(Q,ve);Se&&!Qe(St)?Ve(Q,ve,St):!Se&&!Qe(Gt)&&F(ve,Gt)}}else{if(V0&&Qe(C))for(const re of s.mount){const ve=ae(n,re);if(ve&&ve._f){const Se=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(Wf(Se)){const St=Se.closest("form");if(St){St.reset();break}}}}if(M.keepFieldsRef)for(const re of s.mount)F(re,ae(Q,re));else n={}}a=t.shouldUnregister?M.keepDefaultValues?ot(i):{}:ot(Q),h.array.next({values:{...Q}}),h.state.next({values:{...Q}})}s={mount:M.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!c.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!Zt(Q),o.watch=!!t.shouldUnregister,o.keepIsValid=!!M.keepIsValid,o.action=!1,M.keepErrors||(r.errors={}),h.state.next({submitCount:M.keepSubmitCount?r.submitCount:0,isDirty:ee?!1:M.keepDirty?r.isDirty:!!(M.keepDefaultValues&&!Pi(C,i)),isSubmitted:M.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ee?{}:M.keepDirtyValues?M.keepDefaultValues&&a?wl(i,a):r.dirtyFields:M.keepDefaultValues&&C?wl(i,C):M.keepDirty?r.dirtyFields:{},touchedFields:M.keepTouched?r.touchedFields:{},errors:M.keepErrors?r.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},fe=(C,M)=>de(fn(C)?C(a):C,{...t.resetOptions,...M}),je=(C,M={})=>{const z=ae(n,C),te=z&&z._f;if(te){const ee=te.refs?te.refs[0]:te.ref;ee.focus&&setTimeout(()=>{ee.focus(),M.shouldSelect&&fn(ee.select)&&ee.select()})}},ke=C=>{r={...r,...C}},ze={control:{register:k,unregister:ne,getFieldState:he,handleSubmit:me,setError:xe,_subscribe:Me,_runSchema:E,_updateIsValidating:y,_focusError:H,_getWatch:B,_getDirty:D,_setValid:g,_setFieldArray:w,_setDisabledField:pe,_setErrors:x,_getFieldArray:V,_reset:de,_resetDefaultValues:()=>fn(t.defaultValues)&&t.defaultValues().then(C=>{fe(C,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:K,_subjects:h,_proxyFormState:c,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(C){o=C},get _defaultValues(){return i},get _names(){return s},set _names(C){s=C},get _formState(){return r},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:Z,trigger:W,register:k,handleSubmit:me,watch:We,setValue:F,getValues:Y,reset:fe,resetField:_e,clearErrors:Ae,unregister:ne,setError:xe,setFocus:je,getFieldState:he};return{...ze,formControl:ze}}var bi=()=>{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 r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},um=(e,t,r={})=>r.shouldFocus||Qe(r.shouldFocus)?r.focusName||`${e}.${Qe(r.focusIndex)?t:r.focusIndex}.`:"",cm=(e,t)=>[...e,...vr(t)],fm=e=>Array.isArray(e)?e.map(()=>{}):void 0;function dm(e,t,r){return[...e.slice(0,t),...vr(r),...e.slice(t)]}var pm=(e,t,r)=>Array.isArray(e)?(Qe(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],hm=(e,t)=>[...vr(t),...vr(e)];function dD(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return Op(n).length?n:[]}var mm=(e,t)=>Qe(t)?[]:dD(e,vr(t).sort((r,n)=>r-n)),vm=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},z1=(e,t,r)=>(e[t]=r,e);function pD(e){const t=qM(),{control:r=t,name:n,keyName:i="id",shouldUnregister:a,rules:o}=e,[s,l]=T.useState(r._getFieldArray(n)),u=T.useRef(r._getFieldArray(n).map(bi)),f=T.useRef(!1);r._names.array.add(n),T.useMemo(()=>o&&s.length>=0&&r.register(n,o),[r,n,s.length,o]),ek(()=>r._subjects.array.subscribe({next:({values:S,name:x})=>{if(x===n||!x){const _=ae(S,n);Array.isArray(_)&&(l(_),u.current=_.map(bi))}}}).unsubscribe,[r,n]);const c=T.useCallback(S=>{f.current=!0,r._setFieldArray(n,S)},[r,n]),p=(S,x)=>{const _=vr(ot(S)),O=cm(r._getFieldArray(n),_);r._names.focus=um(n,O.length-1,x),u.current=cm(u.current,_.map(bi)),c(O),l(O),r._setFieldArray(n,O,cm,{argA:fm(S)})},h=(S,x)=>{const _=vr(ot(S)),O=hm(r._getFieldArray(n),_);r._names.focus=um(n,0,x),u.current=hm(u.current,_.map(bi)),c(O),l(O),r._setFieldArray(n,O,hm,{argA:fm(S)})},b=S=>{const x=mm(r._getFieldArray(n),S);u.current=mm(u.current,S),c(x),l(x),!Array.isArray(ae(r._fields,n))&&Ve(r._fields,n,void 0),r._setFieldArray(n,x,mm,{argA:S})},v=(S,x,_)=>{const O=vr(ot(x)),A=dm(r._getFieldArray(n),S,O);r._names.focus=um(n,S,_),u.current=dm(u.current,S,O.map(bi)),c(A),l(A),r._setFieldArray(n,A,dm,{argA:S,argB:fm(x)})},g=(S,x)=>{const _=r._getFieldArray(n);vm(_,S,x),vm(u.current,S,x),c(_),l(_),r._setFieldArray(n,_,vm,{argA:S,argB:x},!1)},y=(S,x)=>{const _=r._getFieldArray(n);pm(_,S,x),pm(u.current,S,x),c(_),l(_),r._setFieldArray(n,_,pm,{argA:S,argB:x},!1)},m=(S,x)=>{const _=ot(x),O=z1(r._getFieldArray(n),S,_);u.current=[...O].map((A,E)=>!A||E===S?bi():u.current[E]),c(O),l([...O]),r._setFieldArray(n,O,z1,{argA:S,argB:_},!0,!1)},w=S=>{const x=vr(ot(S));u.current=x.map(bi),c([...x]),l([...x]),r._setFieldArray(n,[...x],_=>_,{},!0,!1)};return T.useEffect(()=>{if(r._state.action=!1,ay(n,r._names)&&r._subjects.state.next({...r._formState}),f.current&&(!wo(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!wo(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{r._updateIsValidating([n]);const x=ae(S.errors,n),_=ae(r._formState.errors,n);(_?!x&&_.type||x&&(_.type!==x.type||_.message!==x.message):x&&x.type)&&(x?Ve(r._formState.errors,n,x):bt(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=ae(r._fields,n);S&&S._f&&!(wo(r._options.reValidateMode).isOnSubmit&&wo(r._options.mode).isOnSubmit)&&oy(S,r._names.disabled,r._formValues,r._options.criteriaMode===Hr.all,r._options.shouldUseNativeValidation,!0).then(x=>!Zt(x)&&r._subjects.state.next({errors:lk(r._formState.errors,x,n)}))}r._subjects.state.next({name:n,values:ot(r._formValues)}),r._names.focus&&Ro(r._fields,(S,x)=>{if(r._names.focus&&x.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),f.current=!1},[s,n,r]),T.useEffect(()=>(!ae(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(x,_)=>{const O=ae(r._fields,x);O&&O._f&&(O._f.mount=_)};r._options.shouldUnregister||a?r.unregister(n):S(n,!1)}),[n,r,i,a]),{swap:T.useCallback(g,[c,n,r]),move:T.useCallback(y,[c,n,r]),prepend:T.useCallback(h,[c,n,r]),append:T.useCallback(p,[c,n,r]),remove:T.useCallback(b,[c,n,r]),insert:T.useCallback(v,[c,n,r]),update:T.useCallback(m,[c,n,r]),replace:T.useCallback(w,[c,n,r]),fields:T.useMemo(()=>s.map((S,x)=>({...S,[i]:u.current[x]||bi()})),[s,i])}}function hD(e={}){const t=T.useRef(void 0),r=T.useRef(void 0),[n,i]=T.useState({isDirty:!1,isValidating:!1,isLoading:fn(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:fn(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!fn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=fD(e);t.current={...s,formState:n}}const a=t.current.control;return a._options=e,ek(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(s=>({...s,isReady:!0})),a._formState.isReady=!0,o},[a]),T.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),T.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),T.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),T.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),T.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==n.isDirty&&a._subjects.state.next({isDirty:o})}},[a,n.isDirty]),T.useEffect(()=>{var o;e.values&&!Pi(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((o=a._options.resetOptions)===null||o===void 0)&&o.keepIsValid||a._setValid(),r.current=e.values,i(s=>({...s}))):a._resetDefaultValues()},[a,e.values]),T.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=T.useMemo(()=>XM(n,a),[a,n]),t.current}const U1=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ae(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},uk=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?U1(n.ref,r,e):n.refs&&n.refs.forEach(i=>U1(i,r,e))}},mD=(e,t)=>{t.shouldUseNativeValidation&&uk(e,t);const r={};for(const n in e){const i=ae(t.fields,n),a=Object.assign(e[n]||{},{ref:i&&i.ref});if(vD(t.names||Object.keys(e),n)){const o=Object.assign({},ae(r,n));Ve(o,"root",a),Ve(r,n,o)}else Ve(r,n,a)}return r},vD=(e,t)=>e.some(r=>r.startsWith(t+"."));var yD=function(e,t){for(var r={};e.length;){var n=e[0],i=n.code,a=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:a,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(c){return e.push(c)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=tk(o,t,r,i,u?[].concat(u,n.message):n.message)}e.shift()}return r},gD=function(e,t,r){return r===void 0&&(r={}),function(n,i,a){try{return Promise.resolve(function(o,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return a.shouldUseNativeValidation&&uk({},a),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:mD(yD(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}},Be;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Be||(Be={}));var V1;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(V1||(V1={}));const ue=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Si=e=>{switch(typeof e){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return Number.isNaN(e)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(e)?ue.array:e===null?ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ue.promise:typeof Map<"u"&&e instanceof Map?ue.map:typeof Set<"u"&&e instanceof Set?ue.set:typeof Date<"u"&&e instanceof Date?ue.date:ue.object;default:return ue.unknown}},J=Be.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 ai extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];r[a]=r[a]||[],r[a].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ai.create=e=>new ai(e);const sy=(e,t)=>{let r;switch(e.code){case J.invalid_type:e.received===ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case J.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Be.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:r=`Unrecognized key(s) in object: ${Be.joinValues(e.keys,", ")}`;break;case J.invalid_union:r="Invalid input";break;case J.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Be.joinValues(e.options)}`;break;case J.invalid_enum_value:r=`Invalid enum value. Expected ${Be.joinValues(e.options)}, received '${e.received}'`;break;case J.invalid_arguments:r="Invalid function arguments";break;case J.invalid_return_type:r="Invalid function return type";break;case J.invalid_date:r="Invalid date";break;case J.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Be.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case J.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case J.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case J.custom:r="Invalid input";break;case J.invalid_intersection_types:r="Intersection results could not be merged";break;case J.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case J.not_finite:r="Number must be finite";break;default:r=t.defaultError,Be.assertNever(e)}return{message:r}};let xD=sy;function bD(){return xD}const wD=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function oe(e,t){const r=bD(),n=wD({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===sy?void 0:sy].filter(i=>!!i)});e.common.issues.push(n)}class Ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return be;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const a=await i.key,o=await i.value;n.push({key:a,value:o})}return Ir.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return be;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}}const be=Object.freeze({status:"aborted"}),_l=e=>({status:"dirty",value:e}),en=e=>({status:"valid",value:e}),W1=e=>e.status==="aborted",H1=e=>e.status==="dirty",qo=e=>e.status==="valid",Gf=e=>typeof Promise<"u"&&e instanceof Promise;var ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ce||(ce={}));class Yi{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}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 G1=(e,t)=>{if(qo(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 r=new ai(e.common.issues);return this._error=r,this._error}}};function Pe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,s)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:i}}class Le{get description(){return this._def.description}_getType(t){return Si(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ir,ctx:{common:t.parent.common,data:t.data,parsedType:Si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Gf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)},i=this._parseSync({data:t,path:n.path,parent:n});return G1(n,i)}"~validate"(t){var n,i;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return qo(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(i=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>qo(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Gf(i)?i:Promise.resolve(i));return G1(n,a)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const o=t(i),s=()=>a.addIssue({code:J.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Fa({schema:this,typeName:we.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:r=>this["~validate"](r)}}optional(){return Vi.create(this,this._def)}nullable(){return Zo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tn.create(this)}promise(){return Yf.create(this,this._def)}or(t){return qf.create([this,t],this._def)}and(t){return Xf.create(this,t,this._def)}transform(t){return new Fa({...Pe(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new uy({...Pe(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new WD({typeName:we.ZodBranded,type:this,...Pe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new cy({...Pe(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return K0.create(this,t)}readonly(){return fy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _D=/^c[^\s-]{8,}$/i,SD=/^[0-9a-z]+$/,OD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-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[0-9])$/,ID=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ck="((\\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])))",DD=new RegExp(`^${ck}$`);function fk(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function LD(e){return new RegExp(`^${fk(e)}$`)}function BD(e){let t=`${ck}T${fk(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function FD(e,t){return!!((t==="v4"||!t)&&TD.test(e)||(t==="v6"||!t)&&$D.test(e))}function zD(e,t){if(!ED.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function UD(e,t){return!!((t==="v4"||!t)&&ND.test(e)||(t==="v6"||!t)&&RD.test(e))}class Kn extends Le{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){const a=this._getOrReturnCtx(t);return oe(a,{code:J.invalid_type,expected:ue.string,received:a.parsedType}),be}const n=new Ir;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,s=t.data.lengtht.test(i),{validation:r,code:J.invalid_string,...ce.errToObj(n)})}_addCheck(t){return new Kn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ce.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ce.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ce.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ce.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==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ce.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ce.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ce.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ce.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...ce.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ce.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ce.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ce.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ce.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ce.errToObj(r)})}nonempty(t){return this.min(1,ce.errToObj(t))}trim(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Kn({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Kn({checks:[],typeName:we.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Pe(e)});function VD(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return a%o/10**i}class Da extends Le{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)!==ue.number){const a=this._getOrReturnCtx(t);return oe(a,{code:J.invalid_type,expected:ue.number,received:a.parsedType}),be}let n;const i=new Ir;for(const a of this._def.checks)a.kind==="int"?Be.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:J.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:J.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?VD(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),oe(n,{code:J.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:J.not_finite,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ce.toString(r))}setLimit(t,r,n,i){return new Da({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ce.toString(i)}]})}_addCheck(t){return new Da({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Be.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew Da({checks:[],typeName:we.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class La extends Le{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)!==ue.bigint)return this._getInvalidInput(t);let n;const i=new Ir;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:J.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:J.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return oe(r,{code:J.invalid_type,expected:ue.bigint,received:r.parsedType}),be}gte(t,r){return this.setLimit("min",t,!0,ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ce.toString(r))}setLimit(t,r,n,i){return new La({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ce.toString(i)}]})}_addCheck(t){return new La({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew La({checks:[],typeName:we.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Pe(e)});class Kf extends Le{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.boolean,received:n.parsedType}),be}return en(t.data)}}Kf.create=e=>new Kf({typeName:we.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class Xo extends Le{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){const a=this._getOrReturnCtx(t);return oe(a,{code:J.invalid_type,expected:ue.date,received:a.parsedType}),be}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return oe(a,{code:J.invalid_date}),be}const n=new Ir;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Be.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Xo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ce.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ce.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Xo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:we.ZodDate,...Pe(e)});class K1 extends Le{_parse(t){if(this._getType(t)!==ue.symbol){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.symbol,received:n.parsedType}),be}return en(t.data)}}K1.create=e=>new K1({typeName:we.ZodSymbol,...Pe(e)});class q1 extends Le{_parse(t){if(this._getType(t)!==ue.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.undefined,received:n.parsedType}),be}return en(t.data)}}q1.create=e=>new q1({typeName:we.ZodUndefined,...Pe(e)});class X1 extends Le{_parse(t){if(this._getType(t)!==ue.null){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.null,received:n.parsedType}),be}return en(t.data)}}X1.create=e=>new X1({typeName:we.ZodNull,...Pe(e)});class Y1 extends Le{constructor(){super(...arguments),this._any=!0}_parse(t){return en(t.data)}}Y1.create=e=>new Y1({typeName:we.ZodAny,...Pe(e)});class Z1 extends Le{constructor(){super(...arguments),this._unknown=!0}_parse(t){return en(t.data)}}Z1.create=e=>new Z1({typeName:we.ZodUnknown,...Pe(e)});class Zi extends Le{_parse(t){const r=this._getOrReturnCtx(t);return oe(r,{code:J.invalid_type,expected:ue.never,received:r.parsedType}),be}}Zi.create=e=>new Zi({typeName:we.ZodNever,...Pe(e)});class Q1 extends Le{_parse(t){if(this._getType(t)!==ue.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.void,received:n.parsedType}),be}return en(t.data)}}Q1.create=e=>new Q1({typeName:we.ZodVoid,...Pe(e)});class Tn extends Le{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ue.array)return oe(r,{code:J.invalid_type,expected:ue.array,received:r.parsedType}),be;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,s=r.data.lengthi.maxLength.value&&(oe(r,{code:J.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new Yi(r,o,r.path,s)))).then(o=>Ir.mergeArray(n,o));const a=[...r.data].map((o,s)=>i.type._parseSync(new Yi(r,o,r.path,s)));return Ir.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new Tn({...this._def,minLength:{value:t,message:ce.toString(r)}})}max(t,r){return new Tn({...this._def,maxLength:{value:t,message:ce.toString(r)}})}length(t,r){return new Tn({...this._def,exactLength:{value:t,message:ce.toString(r)}})}nonempty(t){return this.min(1,t)}}Tn.create=(e,t)=>new Tn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Pe(t)});function ao(e){if(e instanceof jt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Vi.create(ao(n))}return new jt({...e._def,shape:()=>t})}else return e instanceof Tn?new Tn({...e._def,type:ao(e.element)}):e instanceof Vi?Vi.create(ao(e.unwrap())):e instanceof Zo?Zo.create(ao(e.unwrap())):e instanceof Ba?Ba.create(e.items.map(t=>ao(t))):e}class jt extends Le{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(),r=Be.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ue.object){const u=this._getOrReturnCtx(t);return oe(u,{code:J.invalid_type,expected:ue.object,received:u.parsedType}),be}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Zi&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const f=a[u],c=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new Yi(i,c,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Zi){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")s.length>0&&(oe(i,{code:J.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of s){const c=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new Yi(i,c,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const c=await f.key,p=await f.value;u.push({key:c,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>Ir.mergeObjectSync(n,u)):Ir.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return ce.errToObj,new jt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,o;const i=((o=(a=this._def).errorMap)==null?void 0:o.call(a,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:ce.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new jt({...this._def,unknownKeys:"strip"})}passthrough(){return new jt({...this._def,unknownKeys:"passthrough"})}extend(t){return new jt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new jt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new jt({...this._def,catchall:t})}pick(t){const r={};for(const n of Be.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new jt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Be.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new jt({...this._def,shape:()=>r})}deepPartial(){return ao(this)}partial(t){const r={};for(const n of Be.objectKeys(this.shape)){const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new jt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Be.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Vi;)a=a._def.innerType;r[n]=a}return new jt({...this._def,shape:()=>r})}keyof(){return dk(Be.objectKeys(this.shape))}}jt.create=(e,t)=>new jt({shape:()=>e,unknownKeys:"strip",catchall:Zi.create(),typeName:we.ZodObject,...Pe(t)});jt.strictCreate=(e,t)=>new jt({shape:()=>e,unknownKeys:"strict",catchall:Zi.create(),typeName:we.ZodObject,...Pe(t)});jt.lazycreate=(e,t)=>new jt({shape:e,unknownKeys:"strip",catchall:Zi.create(),typeName:we.ZodObject,...Pe(t)});class qf extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new ai(s.ctx.common.issues));return oe(r,{code:J.invalid_union,unionErrors:o}),be}if(r.common.async)return Promise.all(n.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new ai(l));return oe(r,{code:J.invalid_union,unionErrors:s}),be}}get options(){return this._def.options}}qf.create=(e,t)=>new qf({options:e,typeName:we.ZodUnion,...Pe(t)});function ly(e,t){const r=Si(e),n=Si(t);if(e===t)return{valid:!0,data:e};if(r===ue.object&&n===ue.object){const i=Be.objectKeys(t),a=Be.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...t};for(const s of a){const l=ly(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===ue.array&&n===ue.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a{if(W1(a)||W1(o))return be;const s=ly(a.value,o.value);return s.valid?((H1(a)||H1(o))&&r.dirty(),{status:r.value,value:s.data}):(oe(n,{code:J.invalid_intersection_types}),be)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Xf.create=(e,t,r)=>new Xf({left:e,right:t,typeName:we.ZodIntersection,...Pe(r)});class Ba extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.array)return oe(n,{code:J.invalid_type,expected:ue.array,received:n.parsedType}),be;if(n.data.lengththis._def.items.length&&(oe(n,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Yi(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Ir.mergeArray(r,o)):Ir.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Ba({...this._def,rest:t})}}Ba.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ba({items:e,typeName:we.ZodTuple,rest:null,...Pe(t)})};class J1 extends Le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.map)return oe(n,{code:J.invalid_type,expected:ue.map,received:n.parsedType}),be;const i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:i._parse(new Yi(n,s,n.path,[u,"key"])),value:a._parse(new Yi(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return be;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return be;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}}J1.create=(e,t,r)=>new J1({valueType:t,keyType:e,typeName:we.ZodMap,...Pe(r)});class cu extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.set)return oe(n,{code:J.invalid_type,expected:ue.set,received:n.parsedType}),be;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(oe(n,{code:J.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return be;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>a._parse(new Yi(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new cu({...this._def,minSize:{value:t,message:ce.toString(r)}})}max(t,r){return new cu({...this._def,maxSize:{value:t,message:ce.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}cu.create=(e,t)=>new cu({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...Pe(t)});class ew extends Le{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ew.create=(e,t)=>new ew({getter:e,typeName:we.ZodLazy,...Pe(t)});class tw extends Le{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return oe(r,{received:r.data,code:J.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}tw.create=(e,t)=>new tw({value:e,typeName:we.ZodLiteral,...Pe(t)});function dk(e,t){return new Yo({values:e,typeName:we.ZodEnum,...Pe(t)})}class Yo extends Le{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{expected:Be.joinValues(n),received:r.parsedType,code:J.invalid_type}),be}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{received:r.data,code:J.invalid_enum_value,options:n}),be}return en(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Yo.create(t,{...this._def,...r})}exclude(t,r=this._def){return Yo.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Yo.create=dk;class rw extends Le{_parse(t){const r=Be.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ue.string&&n.parsedType!==ue.number){const i=Be.objectValues(r);return oe(n,{expected:Be.joinValues(i),received:n.parsedType,code:J.invalid_type}),be}if(this._cache||(this._cache=new Set(Be.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Be.objectValues(r);return oe(n,{received:n.data,code:J.invalid_enum_value,options:i}),be}return en(t.data)}get enum(){return this._def.values}}rw.create=(e,t)=>new rw({values:e,typeName:we.ZodNativeEnum,...Pe(t)});class Yf extends Le{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.promise&&r.common.async===!1)return oe(r,{code:J.invalid_type,expected:ue.promise,received:r.parsedType}),be;const n=r.parsedType===ue.promise?r.data:Promise.resolve(r.data);return en(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Yf.create=(e,t)=>new Yf({type:e,typeName:we.ZodPromise,...Pe(t)});class Fa extends Le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{oe(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return be;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?be:l.status==="dirty"||r.value==="dirty"?_l(l.value):l});{if(r.value==="aborted")return be;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?be:s.status==="dirty"||r.value==="dirty"?_l(s.value):s}}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?be:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?be:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!qo(o))return be;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>qo(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):be);Be.assertNever(i)}}Fa.create=(e,t,r)=>new Fa({schema:e,typeName:we.ZodEffects,effect:t,...Pe(r)});Fa.createWithPreprocess=(e,t,r)=>new Fa({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...Pe(r)});class Vi extends Le{_parse(t){return this._getType(t)===ue.undefined?en(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Vi.create=(e,t)=>new Vi({innerType:e,typeName:we.ZodOptional,...Pe(t)});class Zo extends Le{_parse(t){return this._getType(t)===ue.null?en(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Zo.create=(e,t)=>new Zo({innerType:e,typeName:we.ZodNullable,...Pe(t)});class uy extends Le{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ue.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}uy.create=(e,t)=>new uy({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Pe(t)});class cy extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Gf(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ai(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ai(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}cy.create=(e,t)=>new cy({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Pe(t)});class nw extends Le{_parse(t){if(this._getType(t)!==ue.nan){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.nan,received:n.parsedType}),be}return{status:"valid",value:t.data}}}nw.create=e=>new nw({typeName:we.ZodNaN,...Pe(e)});class WD extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class K0 extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?be:a.status==="dirty"?(r.dirty(),_l(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?be:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new K0({in:t,out:r,typeName:we.ZodPipeline})}}class fy extends Le{_parse(t){const r=this._def.innerType._parse(t),n=i=>(qo(i)&&(i.value=Object.freeze(i.value)),i);return Gf(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}fy.create=(e,t)=>new fy({innerType:e,typeName:we.ZodReadonly,...Pe(t)});var we;(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"})(we||(we={}));const iw=Kn.create,$l=Da.create;La.create;Kf.create;Xo.create;Zi.create;const HD=Tn.create,pk=jt.create;qf.create;Xf.create;Ba.create;Yo.create;Yf.create;Vi.create;Zo.create;const Rl=Fa.createWithPreprocess,hk={string:e=>Kn.create({...e,coerce:!0}),number:e=>Da.create({...e,coerce:!0}),boolean:e=>Kf.create({...e,coerce:!0}),bigint:e=>La.create({...e,coerce:!0}),date:e=>Xo.create({...e,coerce:!0})},GD={primary:"bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white",ghost:"text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]",danger:"bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]"},KD={sm:"px-4 py-1.5 text-xs font-semibold",md:"px-5 py-2.5 text-sm font-semibold"};function ht({variant:e="primary",size:t="md",className:r="",...n}){return d.jsx("button",{className:`relative inline-flex items-center justify-center gap-2 rounded-full transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/50 focus:ring-offset-1 focus:ring-offset-transparent focus:border-transparent ${GD[e]} ${KD[t]} ${r}`,...n,children:n.children})}function Qo({error:e}){return e?d.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/8 px-4 py-3 text-sm text-red-400 font-mono",children:e}):null}function En({size:e=20}){return d.jsxs("svg",{className:"animate-spin text-brand-500",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}const qD={payment_method:{type:"enum",values:["card","bank_debit","bank_transfer"]},amount:{type:"integer",values:[]},currency:{type:"enum",values:["USD","EUR","GBP","INR","JPY","CAD","AUD","SGD","AED"]},payment_type:{type:"enum",values:["normal","new_mandate","setup_mandate","recurring_mandate","non_mandate"]},card_network:{type:"enum",values:["visa","mastercard","amex","jcb","diners_club","discover","cartes_bancaires","union_pay","interac","rupay","maestro"]},authentication_type:{type:"enum",values:["three_ds","no_three_ds"]},card_type:{type:"enum",values:["debit","credit"]},card:{type:"enum",values:["debit","credit"]}},XD={SR_SELECTION_V3_ROUTING:"bg-blue-100 text-blue-800",PRIORITY_LOGIC:"bg-purple-100 text-purple-800",NTW_BASED_ROUTING:"bg-green-100 text-green-800",SR_SELECTION_V3_ROUTING_WITH_HEDGING:"bg-orange-100 text-orange-800",HEDGING:"bg-orange-100 text-orange-800"},YD=["card","card_redirect","pay_later","wallet","bank_redirect","bank_transfer","crypto","bank_debit","reward","real_time_payment","upi","voucher","gift_card","open_banking","mobile_payment"],ZD={card:["credit","debit"],bank_debit:["ach","sepa","bacs","becs"],bank_transfer:["ach","sepa","sepa_bank_transfer","bacs","multibanco","pix","pse","permata_bank_transfer","bca_bank_transfer","bni_va","bri_va","cimb_va","danamon_va","mandiri_va","local_bank_transfer","instant_bank_transfer"],wallet:["amazon_pay","apple_pay","google_pay","paypal","ali_pay","ali_pay_hk","dana","mb_way","mobile_pay","samsung_pay","twint","vipps","touch_n_go","swish","we_chat_pay","go_pay","gcash","momo","kakao_pay","cashapp","mifinity","paze"],pay_later:["affirm","alma","afterpay_clearpay","klarna","pay_bright","atome","walley"],upi:["upi_collect","upi_intent"],voucher:["boleto","efecty","pago_efectivo","red_compra","red_pagos","indomaret","alfamart","oxxo","seven_eleven","lawson","mini_stop","family_mart","seicomart","pay_easy"],bank_redirect:["giropay","ideal","sofort","eft","eps","bancontact_card","blik","local_bank_redirect","online_banking_thailand","online_banking_czech_republic","online_banking_finland","online_banking_fpx","online_banking_poland","online_banking_slovakia","przelewy24","trustly","bizum","interac","open_banking_uk","open_banking_pis"],gift_card:["givex","pay_safe_card"],card_redirect:["knet","benefit","momo_atm","card_redirect"],real_time_payment:["fps","duit_now","prompt_pay","viet_qr"],crypto:["crypto_currency"],reward:["evoucher","classic_reward"],open_banking:["open_banking_pis"],mobile_payment:["direct_carrier_billing"]},QD=pk({paymentMethodType:iw().min(1),paymentMethod:iw().min(1),bucketSize:hk.number().int().positive(),hedgingPercent:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),latencyThreshold:Rl(e=>e===""||e===null?null:Number(e),$l().nullable())}),JD=pk({defaultBucketSize:hk.number().int().positive(),defaultSuccessRate:Rl(e=>e===""||e===null?null:Number(e),$l().min(0).max(1).nullable()),defaultLatencyThreshold:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),defaultHedgingPercent:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),subLevelInputConfig:HD(QD)});function eL(){var I,D,B,V,U;const{merchantId:e}=ra(),[t,r]=j.useState(!1),[n,i]=j.useState(null),[a,o]=j.useState(!1),[s,l]=j.useState(!1),[u,f]=j.useState(!1),[c,p]=j.useState(null),{data:h,isLoading:b,mutate:v}=vn(e?["rule-sr",e]:null,()=>ft("/rule/get",{merchant_id:e,algorithm:"successRate"}),{shouldRetryOnError:!1}),{register:g,control:y,handleSubmit:m,reset:w,watch:S,formState:{errors:x}}=hD({resolver:gD(JD),defaultValues:{defaultBucketSize:200,defaultSuccessRate:.5,defaultLatencyThreshold:null,defaultHedgingPercent:null,subLevelInputConfig:[]}});j.useEffect(()=>{var R;if((R=h==null?void 0:h.config)!=null&&R.data){const F=h.config.data;w({defaultBucketSize:F.defaultBucketSize??200,defaultSuccessRate:F.defaultSuccessRate??.5,defaultLatencyThreshold:F.defaultLatencyThreshold??null,defaultHedgingPercent:F.defaultHedgingPercent??null,subLevelInputConfig:F.subLevelInputConfig??[]})}},[h,w]);const{fields:_,append:O,remove:A}=pD({control:y,name:"subLevelInputConfig"}),E=S("subLevelInputConfig");async function $(){try{await ft("/merchant-account/create",{merchant_id:e,gateway_success_rate_based_decider_input:null})}catch{}}async function N(R){if(!e){i("Set a Merchant ID first.");return}r(!0),i(null),o(!1);try{await $(),await ft(h?"/rule/update":"/rule/create",{merchant_id:e,config:{type:"successRate",data:{defaultBucketSize:R.defaultBucketSize,defaultSuccessRate:R.defaultSuccessRate,defaultLatencyThreshold:R.defaultLatencyThreshold,defaultHedgingPercent:R.defaultHedgingPercent,subLevelInputConfig:R.subLevelInputConfig.length>0?R.subLevelInputConfig:null}}}),o(!0),v()}catch(F){i(F instanceof Error?F.message:String(F))}finally{r(!1)}}async function P(){if(e){f(!0),p(null);try{await ft("/rule/delete",{merchant_id:e,algorithm:"successRate"}),v(void 0,{revalidate:!1})}catch(R){p(R instanceof Error?R.message:String(R))}finally{f(!1)}}}return d.jsxs("div",{className:"space-y-6 max-w-5xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Auth-Rate Based Routing"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure success-rate based gateway routing"})]}),!e&&d.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-800",children:"Set a Merchant ID in the top bar to load and save configuration."}),e&&!b&&d.jsxs(Te,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Configuration Status"}),d.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(I=h==null?void 0:h.config)!=null&&I.data?"Success Rate routing is configured and active":"No Success Rate configuration found"})]}),d.jsx(Qt,{variant:(D=h==null?void 0:h.config)!=null&&D.data?"green":"gray",children:(B=h==null?void 0:h.config)!=null&&B.data?"Active":"Not Configured"})]}),((V=h==null?void 0:h.config)==null?void 0:V.data)&&d.jsxs(Ne,{className:"border-t border-slate-100 dark:border-[#222226]",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Last Modified:"}),d.jsx("span",{className:"ml-1 font-medium",children:h.modified_at?new Date(h.modified_at).toLocaleString():"Unknown"})]}),d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>{confirm("Are you sure you want to clear the Success Rate configuration? This will disable SR-based routing.")&&P()},disabled:u,children:[d.jsx(ii,{size:14,className:"mr-1"}),u?"Clearing...":"Clear Configuration"]})]}),c&&d.jsx("p",{className:"text-xs text-red-500 mt-2",children:c})]})]}),b?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx(En,{})}):d.jsxs("form",{onSubmit:m(N),className:"space-y-6",children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Success Rate Config"})}),d.jsxs(Ne,{className:"overflow-x-auto p-0",children:[d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-200 dark:border-[#1c1c24] bg-slate-50 dark:bg-[#0a0a0f]",children:[d.jsx("th",{className:"px-4 py-2",children:"Payment Method Type"}),d.jsx("th",{className:"px-4 py-2",children:"Payment Method"}),d.jsx("th",{className:"px-4 py-2",children:"Bucket Size"}),d.jsx("th",{className:"px-4 py-2",children:"Success Rate"}),d.jsx("th",{className:"px-4 py-2",children:"Hedging %"}),d.jsx("th",{className:"px-4 py-2",children:"Latency Threshold (ms)"}),d.jsx("th",{className:"px-4 py-2"})]})}),d.jsxs("tbody",{children:[d.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] bg-brand-50/50 dark:bg-[#151518]",children:[d.jsx("td",{className:"px-4 py-2 text-slate-500 italic",children:"Default"}),d.jsx("td",{className:"px-4 py-2 text-slate-400",children:"—"}),d.jsxs("td",{className:"px-4 py-2",children:[d.jsx("input",{type:"number",...g("defaultBucketSize"),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"}),x.defaultBucketSize&&d.jsx("p",{className:"text-xs text-red-500 mt-0.5",children:x.defaultBucketSize.message})]}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",...g("defaultSuccessRate"),placeholder:"0.5",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",...g("defaultHedgingPercent"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...g("defaultLatencyThreshold"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2"})]}),_.map((R,F)=>{var W;const L=((W=E==null?void 0:E[F])==null?void 0:W.paymentMethodType)||"",q=ZD[L]||[];return d.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[d.jsx("td",{className:"px-4 py-2",children:d.jsx("select",{...g(`subLevelInputConfig.${F}.paymentMethodType`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:YD.map(Y=>d.jsx("option",{value:Y,children:Y},Y))})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("select",{...g(`subLevelInputConfig.${F}.paymentMethod`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(q.length?q:["credit","debit"]).map(Y=>d.jsx("option",{value:Y,children:Y},Y))})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...g(`subLevelInputConfig.${F}.bucketSize`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",...g(`subLevelInputConfig.${F}.hedgingPercent`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...g(`subLevelInputConfig.${F}.latencyThreshold`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("button",{type:"button",onClick:()=>A(F),className:"text-slate-400 hover:text-red-500",children:d.jsx(ii,{size:14})})})]},R.id)})]})]}),d.jsx("div",{className:"px-4 py-3",children:d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>O({paymentMethodType:"card",paymentMethod:"credit",bucketSize:20,hedgingPercent:null,latencyThreshold:null}),children:[d.jsx(qi,{size:14})," Add Level"]})})]})]}),d.jsx(Qo,{error:n}),a&&d.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-4 py-3 text-sm text-emerald-400",children:"Configuration saved successfully."}),((U=h==null?void 0:h.config)==null?void 0:U.data)&&d.jsxs(Te,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Current Active Configuration"}),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!s),children:[d.jsx(wp,{size:14,className:"mr-1"}),s?"Hide":"View"]})]}),s&&d.jsx(Ne,{children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-4",children:[d.jsxs("div",{className:"border-b border-slate-200 dark:border-[#222226] pb-3",children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Default Settings"}),d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultBucketSize})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Success Rate:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultSuccessRate??"Not set"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultHedgingPercent??"Not set"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),d.jsxs("p",{className:"font-medium",children:[h.config.data.defaultLatencyThreshold??"Not set"," ms"]})]})]})]}),h.config.data.subLevelInputConfig&&h.config.data.subLevelInputConfig.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Sub-Level Configurations"}),d.jsx("div",{className:"space-y-2",children:h.config.data.subLevelInputConfig.map((R,F)=>d.jsx("div",{className:"bg-slate-50 dark:bg-[#151518] rounded-lg p-3",children:d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Payment Type:"}),d.jsx("p",{className:"font-medium capitalize",children:R.paymentMethodType})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Payment Method:"}),d.jsx("p",{className:"font-medium",children:R.paymentMethod})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),d.jsx("p",{className:"font-medium",children:R.bucketSize})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),d.jsx("p",{className:"font-medium",children:R.hedgingPercent??"Default"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),d.jsxs("p",{className:"font-medium",children:[R.latencyThreshold??"Default"," ms"]})]})]})},F))})]}),d.jsxs("div",{className:"border-t border-gray-200 pt-3",children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Raw Configuration (JSON)"}),d.jsx("pre",{className:"bg-slate-900 dark:bg-[#0f0f11] text-slate-100 border border-transparent dark:border-[#222226] rounded-lg p-3 text-xs overflow-auto max-h-64",children:JSON.stringify(h.config,null,2)})]})]})})]}),d.jsx(ht,{type:"submit",disabled:t||!e,children:t?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Saving…"]}):"Save Configuration"})]})]})}function tL(){for(var e=arguments.length,t=new Array(e),r=0;rn=>{t.forEach(i=>i(n))},t)}const jp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ps(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function q0(e){return"nodeType"in e}function wr(e){var t,r;return e?Ps(e)?e:q0(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function X0(e){const{Document:t}=wr(e);return e instanceof t}function ac(e){return Ps(e)?!1:e instanceof wr(e).HTMLElement}function mk(e){return e instanceof wr(e).SVGElement}function Cs(e){return e?Ps(e)?e.document:q0(e)?X0(e)?e:ac(e)||mk(e)?e.ownerDocument:document:document:document}const Rn=jp?j.useLayoutEffect:j.useEffect;function Y0(e){const t=j.useRef(e);return Rn(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i{e.current=setInterval(n,i)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function fu(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return Rn(()=>{r.current!==e&&(r.current=e)},t),r}function oc(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Zf(e){const t=Y0(e),r=j.useRef(null),n=j.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function dy(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let gm={};function sc(e,t){return j.useMemo(()=>{if(t)return t;const r=gm[e]==null?0:gm[e]+1;return gm[e]=r,e+"-"+r},[e,t])}function vk(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i{const s=Object.entries(o);for(const[l,u]of s){const f=a[l];f!=null&&(a[l]=f+e*u)}return a},{...t})}}const Io=vk(1),du=vk(-1);function nL(e){return"clientX"in e&&"clientY"in e}function Z0(e){if(!e)return!1;const{KeyboardEvent:t}=wr(e.target);return t&&e instanceof t}function iL(e){if(!e)return!1;const{TouchEvent:t}=wr(e.target);return t&&e instanceof t}function py(e){if(iL(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return nL(e)?{x:e.clientX,y:e.clientY}:null}const pu=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[pu.Translate.toString(e),pu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),aw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function aL(e){return e.matches(aw)?e:e.querySelector(aw)}const oL={display:"none"};function sL(e){let{id:t,value:r}=e;return T.createElement("div",{id:t,style:oL},r)}function lL(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return T.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function uL(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const yk=j.createContext(null);function cL(e){const t=j.useContext(yk);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function fL(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.useCallback(n=>{let{type:i,event:a}=n;e.forEach(o=>{var s;return(s=o[i])==null?void 0:s.call(o,a)})},[e]),t]}const dL={draggable:` + To pick up a draggable item, press the space bar. + While dragging, use the arrow keys to move the item. + Press space again to drop the item in its new position, or press escape to cancel. + `},pL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function hL(e){let{announcements:t=pL,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=dL}=e;const{announce:a,announcement:o}=uL(),s=sc("DndLiveRegion"),[l,u]=j.useState(!1);if(j.useEffect(()=>{u(!0)},[]),cL(j.useMemo(()=>({onDragStart(c){let{active:p}=c;a(t.onDragStart({active:p}))},onDragMove(c){let{active:p,over:h}=c;t.onDragMove&&a(t.onDragMove({active:p,over:h}))},onDragOver(c){let{active:p,over:h}=c;a(t.onDragOver({active:p,over:h}))},onDragEnd(c){let{active:p,over:h}=c;a(t.onDragEnd({active:p,over:h}))},onDragCancel(c){let{active:p,over:h}=c;a(t.onDragCancel({active:p,over:h}))}}),[a,t])),!l)return null;const f=T.createElement(T.Fragment,null,T.createElement(sL,{id:n,value:i.draggable}),T.createElement(lL,{id:s,announcement:o}));return r?bo.createPortal(f,r):f}var Tt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Tt||(Tt={}));function Qf(){}function ow(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function mL(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const yn=Object.freeze({x:0,y:0});function gk(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xk(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function vL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function sw(e){let{left:t,top:r,height:n,width:i}=e;return[{x:t,y:r},{x:t+i,y:r},{x:t,y:r+n},{x:t+i,y:r+n}]}function bk(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function lw(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const yL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=lw(t,t.left,t.top),a=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=gk(lw(l),i);a.push({id:s,data:{droppableContainer:o,value:u}})}}return a.sort(xk)},gL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=sw(t),a=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=sw(l),f=i.reduce((p,h,b)=>p+gk(u[b],h),0),c=Number((f/4).toFixed(4));a.push({id:s,data:{droppableContainer:o,value:c}})}}return a.sort(xk)};function xL(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-n,s=a-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:o}=a,s=r.get(o);if(s){const l=xL(s,t);l>0&&i.push({id:o,data:{droppableContainer:a,value:l}})}}return i.sort(vL)};function wL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function wk(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:yn}function _L(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a({...o,top:o.top+e*s.y,bottom:o.bottom+e*s.y,left:o.left+e*s.x,right:o.right+e*s.x}),{...r})}}const SL=_L(1);function OL(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function jL(e,t,r){const n=OL(t);if(!n)return e;const{scaleX:i,scaleY:a,x:o,y:s}=n,l=e.left-o-(1-i)*parseFloat(r),u=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=i?e.width/i:e.width,c=a?e.height/a:e.height;return{width:f,height:c,top:u,right:l+f,bottom:u+c,left:l}}const AL={ignoreTransform:!1};function Ts(e,t){t===void 0&&(t=AL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=wr(e).getComputedStyle(e);u&&(r=jL(r,u,f))}const{top:n,left:i,width:a,height:o,bottom:s,right:l}=r;return{top:n,left:i,width:a,height:o,bottom:s,right:l}}function uw(e){return Ts(e,{ignoreTransform:!0})}function EL(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function kL(e,t){return t===void 0&&(t=wr(e).getComputedStyle(e)),t.position==="fixed"}function PL(e,t){t===void 0&&(t=wr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function Ap(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(X0(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!ac(i)||mk(i)||r.includes(i))return r;const a=wr(e).getComputedStyle(i);return i!==e&&PL(i,a)&&r.push(i),kL(i,a)?r:n(i.parentNode)}return e?n(e):r}function _k(e){const[t]=Ap(e,1);return t??null}function xm(e){return!jp||!e?null:Ps(e)?e:q0(e)?X0(e)||e===Cs(e).scrollingElement?window:ac(e)?e:null:null}function Sk(e){return Ps(e)?e.scrollX:e.scrollLeft}function Ok(e){return Ps(e)?e.scrollY:e.scrollTop}function hy(e){return{x:Sk(e),y:Ok(e)}}var Dt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Dt||(Dt={}));function jk(e){return!jp||!e?!1:e===document.scrollingElement}function Ak(e){const t={x:0,y:0},r=jk(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const CL={x:.2,y:.2};function TL(e,t,r,n,i){let{top:a,left:o,right:s,bottom:l}=r;n===void 0&&(n=10),i===void 0&&(i=CL);const{isTop:u,isBottom:f,isLeft:c,isRight:p}=Ak(e),h={x:0,y:0},b={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!u&&a<=t.top+v.height?(h.y=Dt.Backward,b.y=n*Math.abs((t.top+v.height-a)/v.height)):!f&&l>=t.bottom-v.height&&(h.y=Dt.Forward,b.y=n*Math.abs((t.bottom-v.height-l)/v.height)),!p&&s>=t.right-v.width?(h.x=Dt.Forward,b.x=n*Math.abs((t.right-v.width-s)/v.width)):!c&&o<=t.left+v.width&&(h.x=Dt.Backward,b.x=n*Math.abs((t.left+v.width-o)/v.width)),{direction:h,speed:b}}function NL(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:o}=window;return{top:0,left:0,right:a,bottom:o,width:a,height:o}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ek(e){return e.reduce((t,r)=>Io(t,hy(r)),yn)}function $L(e){return e.reduce((t,r)=>t+Sk(r),0)}function RL(e){return e.reduce((t,r)=>t+Ok(r),0)}function IL(e,t){if(t===void 0&&(t=Ts),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);_k(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ML=[["x",["left","right"],$L],["y",["top","bottom"],RL]];class Q0{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Ap(r),i=Ek(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,o,s]of ML)for(const l of o)Object.defineProperty(this,l,{get:()=>{const u=s(n),f=i[a]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Il{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function DL(e){const{EventTarget:t}=wr(e);return e instanceof t?e:Cs(e)}function bm(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ur;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ur||(Ur={}));function cw(e){e.preventDefault()}function LL(e){e.stopPropagation()}var Ie;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ie||(Ie={}));const kk={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter,Ie.Tab]},BL=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ie.Right:return{...r,x:r.x+25};case Ie.Left:return{...r,x:r.x-25};case Ie.Down:return{...r,y:r.y+25};case Ie.Up:return{...r,y:r.y-25}}};class J0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Il(Cs(r)),this.windowListeners=new Il(wr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ur.Resize,this.handleCancel),this.windowListeners.add(Ur.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ur.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&IL(n),r(yn)}handleKeyDown(t){if(Z0(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=kk,coordinateGetter:o=BL,scrollBehavior:s="smooth"}=i,{code:l}=t;if(a.end.includes(l)){this.handleEnd(t);return}if(a.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,f=u?{x:u.left,y:u.top}:yn;this.referenceCoordinates||(this.referenceCoordinates=f);const c=o(t,{active:r,context:n.current,currentCoordinates:f});if(c){const p=du(c,f),h={x:0,y:0},{scrollableAncestors:b}=n.current;for(const v of b){const g=t.code,{isTop:y,isRight:m,isLeft:w,isBottom:S,maxScroll:x,minScroll:_}=Ak(v),O=NL(v),A={x:Math.min(g===Ie.Right?O.right-O.width/2:O.right,Math.max(g===Ie.Right?O.left:O.left+O.width/2,c.x)),y:Math.min(g===Ie.Down?O.bottom-O.height/2:O.bottom,Math.max(g===Ie.Down?O.top:O.top+O.height/2,c.y))},E=g===Ie.Right&&!m||g===Ie.Left&&!w,$=g===Ie.Down&&!S||g===Ie.Up&&!y;if(E&&A.x!==c.x){const N=v.scrollLeft+p.x,P=g===Ie.Right&&N<=x.x||g===Ie.Left&&N>=_.x;if(P&&!p.y){v.scrollTo({left:N,behavior:s});return}P?h.x=v.scrollLeft-N:h.x=g===Ie.Right?v.scrollLeft-x.x:v.scrollLeft-_.x,h.x&&v.scrollBy({left:-h.x,behavior:s});break}else if($&&A.y!==c.y){const N=v.scrollTop+p.y,P=g===Ie.Down&&N<=x.y||g===Ie.Up&&N>=_.y;if(P&&!p.x){v.scrollTo({top:N,behavior:s});return}P?h.y=v.scrollTop-N:h.y=g===Ie.Down?v.scrollTop-x.y:v.scrollTop-_.y,h.y&&v.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,Io(du(c,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}J0.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=kk,onActivation:i}=t,{active:a}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function fw(e){return!!(e&&"distance"in e)}function dw(e){return!!(e&&"delay"in e)}class ex{constructor(t,r,n){var i;n===void 0&&(n=DL(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:o}=a;this.props=t,this.events=r,this.document=Cs(o),this.documentListeners=new Il(this.document),this.listeners=new Il(n),this.windowListeners=new Il(wr(o)),this.initialCoordinates=(i=py(a))!=null?i:yn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ur.Resize,this.handleCancel),this.windowListeners.add(Ur.DragStart,cw),this.windowListeners.add(Ur.VisibilityChange,this.handleCancel),this.windowListeners.add(Ur.ContextMenu,cw),this.documentListeners.add(Ur.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dw(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(fw(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ur.Click,LL,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ur.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:o,options:{activationConstraint:s}}=a;if(!i)return;const l=(r=py(t))!=null?r:yn,u=du(i,l);if(!n&&s){if(fw(s)){if(s.tolerance!=null&&bm(u,s.tolerance))return this.handleCancel();if(bm(u,s.distance))return this.handleStart()}if(dw(s)&&bm(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ie.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const FL={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tx extends ex{constructor(t){const{event:r}=t,n=Cs(r.target);super(t,FL,n)}}tx.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const zL={move:{name:"mousemove"},end:{name:"mouseup"}};var my;(function(e){e[e.RightClick=2]="RightClick"})(my||(my={}));class UL extends ex{constructor(t){super(t,zL,Cs(t.event.target))}}UL.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===my.RightClick?!1:(n==null||n({event:r}),!0)}}];const wm={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class VL extends ex{constructor(t){super(t,wm)}static setup(){return window.addEventListener(wm.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(wm.move.name,t)};function t(){}}}VL.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var Ml;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ml||(Ml={}));var Jf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Jf||(Jf={}));function WL(e){let{acceleration:t,activator:r=Ml.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:o=5,order:s=Jf.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:c,threshold:p}=e;const h=GL({delta:c,disabled:!a}),[b,v]=rL(),g=j.useRef({x:0,y:0}),y=j.useRef({x:0,y:0}),m=j.useMemo(()=>{switch(r){case Ml.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ml.DraggableRect:return i}},[r,i,l]),w=j.useRef(null),S=j.useCallback(()=>{const _=w.current;if(!_)return;const O=g.current.x*y.current.x,A=g.current.y*y.current.y;_.scrollBy(O,A)},[]),x=j.useMemo(()=>s===Jf.TreeOrder?[...u].reverse():u,[s,u]);j.useEffect(()=>{if(!a||!u.length||!m){v();return}for(const _ of x){if((n==null?void 0:n(_))===!1)continue;const O=u.indexOf(_),A=f[O];if(!A)continue;const{direction:E,speed:$}=TL(_,A,m,t,p);for(const N of["x","y"])h[N][E[N]]||($[N]=0,E[N]=0);if($.x>0||$.y>0){v(),w.current=_,b(S,o),g.current=$,y.current=E;return}}g.current={x:0,y:0},y.current={x:0,y:0},v()},[t,S,n,v,a,o,JSON.stringify(m),JSON.stringify(h),b,u,x,f,JSON.stringify(p)])}const HL={x:{[Dt.Backward]:!1,[Dt.Forward]:!1},y:{[Dt.Backward]:!1,[Dt.Forward]:!1}};function GL(e){let{delta:t,disabled:r}=e;const n=dy(t);return oc(i=>{if(r||!n||!i)return HL;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Dt.Backward]:i.x[Dt.Backward]||a.x===-1,[Dt.Forward]:i.x[Dt.Forward]||a.x===1},y:{[Dt.Backward]:i.y[Dt.Backward]||a.y===-1,[Dt.Forward]:i.y[Dt.Forward]||a.y===1}}},[r,t,n])}function KL(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return oc(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function qL(e,t){return j.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...a]},[]),[e,t])}var hu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hu||(hu={}));var vy;(function(e){e.Optimized="optimized"})(vy||(vy={}));const pw=new Map;function XL(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,o]=j.useState(null),{frequency:s,measure:l,strategy:u}=i,f=j.useRef(e),c=g(),p=fu(c),h=j.useCallback(function(y){y===void 0&&(y=[]),!p.current&&o(m=>m===null?y:m.concat(y.filter(w=>!m.includes(w))))},[p]),b=j.useRef(null),v=oc(y=>{if(c&&!r)return pw;if(!y||y===pw||f.current!==e||a!=null){const m=new Map;for(let w of e){if(!w)continue;if(a&&a.length>0&&!a.includes(w.id)&&w.rect.current){m.set(w.id,w.rect.current);continue}const S=w.node.current,x=S?new Q0(l(S),S):null;w.rect.current=x,x&&m.set(w.id,x)}return m}return y},[e,a,r,c,l]);return j.useEffect(()=>{f.current=e},[e]),j.useEffect(()=>{c||h()},[r,c]),j.useEffect(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),j.useEffect(()=>{c||typeof s!="number"||b.current!==null||(b.current=setTimeout(()=>{h(),b.current=null},s))},[s,c,h,...n]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:a!=null};function g(){switch(u){case hu.Always:return!1;case hu.BeforeDragging:return r;default:return!r}}}function Pk(e,t){return oc(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function YL(e,t){return Pk(e,t)}function ZL(e){let{callback:t,disabled:r}=e;const n=Y0(t),i=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return j.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ep(e){let{callback:t,disabled:r}=e;const n=Y0(t),i=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return j.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function QL(e){return new Q0(Ts(e),e)}function hw(e,t,r){t===void 0&&(t=QL);const[n,i]=j.useState(null);function a(){i(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=ZL({callback(l){if(e)for(const u of l){const{type:f,target:c}=u;if(f==="childList"&&c instanceof HTMLElement&&c.contains(e)){a();break}}}}),s=Ep({callback:a});return Rn(()=>{a(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),n}function JL(e){const t=Pk(e);return wk(e,t)}const mw=[];function e4(e){const t=j.useRef(e),r=oc(n=>e?n&&n!==mw&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ap(e):mw,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function t4(e){const[t,r]=j.useState(null),n=j.useRef(e),i=j.useCallback(a=>{const o=xm(a.target);o&&r(s=>s?(s.set(o,hy(o)),new Map(s)):null)},[]);return j.useEffect(()=>{const a=n.current;if(e!==a){o(a);const s=e.map(l=>{const u=xm(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,hy(u)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{o(e),o(a)};function o(s){s.forEach(l=>{const u=xm(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,o)=>Io(a,o),yn):Ek(e):yn,[e,t])}function vw(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==yn;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?du(e,r.current):yn}function r4(e){j.useEffect(()=>{if(!jp)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function n4(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=o=>{a(o,t)},r},{}),[e,t])}function Ck(e){return j.useMemo(()=>e?EL(e):null,[e])}const yw=[];function i4(e,t){t===void 0&&(t=Ts);const[r]=e,n=Ck(r?wr(r):null),[i,a]=j.useState(yw);function o(){a(()=>e.length?e.map(l=>jk(l)?n:new Q0(t(l),l)):yw)}const s=Ep({callback:o});return Rn(()=>{s==null||s.disconnect(),o(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),i}function a4(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ac(t)?t:e}function o4(e){let{measure:t}=e;const[r,n]=j.useState(null),i=j.useCallback(u=>{for(const{target:f}of u)if(ac(f)){n(c=>{const p=t(f);return c?{...c,width:p.width,height:p.height}:p});break}},[t]),a=Ep({callback:i}),o=j.useCallback(u=>{const f=a4(u);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[s,l]=Zf(o);return j.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const s4=[{sensor:tx,options:{}},{sensor:J0,options:{}}],l4={current:{}},hf={draggable:{measure:uw},droppable:{measure:uw,strategy:hu.WhileDragging,frequency:vy.Optimized},dragOverlay:{measure:Ts}};class Dl extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const u4={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:hf,measureDroppableContainers:Qf,windowRect:null,measuringScheduled:!1},c4={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qf,draggableNodes:new Map,over:null,measureDroppableContainers:Qf},kp=j.createContext(c4),Tk=j.createContext(u4);function f4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dl}}}function d4(e,t){switch(t.type){case Tt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Tt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Tt.DragEnd:case Tt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Tt.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new Dl(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case Tt.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const o=new Dl(e.droppable.containers);return o.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Tt.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new Dl(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function p4(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=j.useContext(kp),a=dy(n),o=dy(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&a&&o!=null){if(!Z0(a)||document.activeElement===a.target)return;const s=i.get(o);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const c=aL(f);if(c){c.focus();break}}})}},[n,t,i,o,a]),null}function h4(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function m4(e){return j.useMemo(()=>({draggable:{...hf.draggable,...e==null?void 0:e.draggable},droppable:{...hf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...hf.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function v4(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=j.useRef(!1),{x:o,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Rn(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=r(u),c=wk(f,n);if(o||(c.x=0),s||(c.y=0),a.current=!0,Math.abs(c.x)>0||Math.abs(c.y)>0){const p=_k(u);p&&p.scrollBy({top:c.y,left:c.x})}},[t,o,s,n,r])}const Nk=j.createContext({...yn,scaleX:1,scaleY:1});var Oi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Oi||(Oi={}));const y4=j.memo(function(t){var r,n,i,a;let{id:o,accessibility:s,autoScroll:l=!0,children:u,sensors:f=s4,collisionDetection:c=bL,measuring:p,modifiers:h,...b}=t;const v=j.useReducer(d4,void 0,f4),[g,y]=v,[m,w]=fL(),[S,x]=j.useState(Oi.Uninitialized),_=S===Oi.Initialized,{draggable:{active:O,nodes:A,translate:E},droppable:{containers:$}}=g,N=O!=null?A.get(O):null,P=j.useRef({initial:null,translated:null}),I=j.useMemo(()=>{var qt;return O!=null?{id:O,data:(qt=N==null?void 0:N.data)!=null?qt:l4,rect:P}:null},[O,N]),D=j.useRef(null),[B,V]=j.useState(null),[U,R]=j.useState(null),F=fu(b,Object.values(b)),L=sc("DndDescribedBy",o),q=j.useMemo(()=>$.getEnabled(),[$]),W=m4(p),{droppableRects:Y,measureDroppableContainers:he,measuringScheduled:Ae}=XL(q,{dragging:_,dependencies:[E.x,E.y],config:W.droppable}),xe=KL(A,O),We=j.useMemo(()=>U?py(U):null,[U]),Me=yc(),Z=YL(xe,W.draggable.measure);v4({activeNode:O!=null?A.get(O):null,config:Me.layoutShiftCompensation,initialRect:Z,measure:W.draggable.measure});const ne=hw(xe,W.draggable.measure,Z),pe=hw(xe?xe.parentElement:null),k=j.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),H=$.getNodeFor((r=k.current.over)==null?void 0:r.id),K=o4({measure:W.dragOverlay.measure}),me=(n=K.nodeRef.current)!=null?n:xe,_e=_?(i=K.rect)!=null?i:ne:null,de=!!(K.nodeRef.current&&K.rect),fe=JL(de?null:ne),je=Ck(me?wr(me):null),ke=e4(_?H??xe:null),Ze=i4(ke),ze=h4(h,{transform:{x:E.x-fe.x,y:E.y-fe.y,scaleX:1,scaleY:1},activatorEvent:U,active:I,activeNodeRect:ne,containerNodeRect:pe,draggingNodeRect:_e,over:k.current.over,overlayNodeRect:K.rect,scrollableAncestors:ke,scrollableAncestorRects:Ze,windowRect:je}),C=We?Io(We,E):null,M=t4(ke),z=vw(M),te=vw(M,[ne]),ee=Io(ze,z),Q=_e?SL(_e,ze):null,re=I&&Q?c({active:I,collisionRect:Q,droppableRects:Y,droppableContainers:q,pointerCoordinates:C}):null,ve=bk(re,"id"),[Se,St]=j.useState(null),Gt=de?ze:Io(ze,te),Kt=wL(Gt,(a=Se==null?void 0:Se.rect)!=null?a:null,ne),Ws=j.useRef(null),Qa=j.useCallback((qt,Sr)=>{let{sensor:Or,options:vi}=Sr;if(D.current==null)return;const Lr=A.get(D.current);if(!Lr)return;const jr=qt.nativeEvent,xn=new Or({active:D.current,activeNode:Lr,event:jr,options:vi,context:k,onAbort(zt){if(!A.get(zt))return;const{onDragAbort:bn}=F.current,Ln={id:zt};bn==null||bn(Ln),m({type:"onDragAbort",event:Ln})},onPending(zt,yi,bn,Ln){if(!A.get(zt))return;const{onDragPending:Ks}=F.current,gi={id:zt,constraint:yi,initialCoordinates:bn,offset:Ln};Ks==null||Ks(gi),m({type:"onDragPending",event:gi})},onStart(zt){const yi=D.current;if(yi==null)return;const bn=A.get(yi);if(!bn)return;const{onDragStart:Ln}=F.current,Gs={activatorEvent:jr,active:{id:yi,data:bn.data,rect:P}};bo.unstable_batchedUpdates(()=>{Ln==null||Ln(Gs),x(Oi.Initializing),y({type:Tt.DragStart,initialCoordinates:zt,active:yi}),m({type:"onDragStart",event:Gs}),V(Ws.current),R(jr)})},onMove(zt){y({type:Tt.DragMove,coordinates:zt})},onEnd:Ja(Tt.DragEnd),onCancel:Ja(Tt.DragCancel)});Ws.current=xn;function Ja(zt){return async function(){const{active:bn,collisions:Ln,over:Gs,scrollAdjustedTranslate:Ks}=k.current;let gi=null;if(bn&&Ks){const{cancelDrop:qs}=F.current;gi={activatorEvent:jr,active:bn,collisions:Ln,delta:Ks,over:Gs},zt===Tt.DragEnd&&typeof qs=="function"&&await Promise.resolve(qs(gi))&&(zt=Tt.DragCancel)}D.current=null,bo.unstable_batchedUpdates(()=>{y({type:zt}),x(Oi.Uninitialized),St(null),V(null),R(null),Ws.current=null;const qs=zt===Tt.DragEnd?"onDragEnd":"onDragCancel";if(gi){const Oh=F.current[qs];Oh==null||Oh(gi),m({type:qs,event:gi})}})}}},[A]),Hs=j.useCallback((qt,Sr)=>(Or,vi)=>{const Lr=Or.nativeEvent,jr=A.get(vi);if(D.current!==null||!jr||Lr.dndKit||Lr.defaultPrevented)return;const xn={active:jr};qt(Or,Sr.options,xn)===!0&&(Lr.dndKit={capturedBy:Sr.sensor},D.current=vi,Qa(Or,Sr))},[A,Qa]),mc=qL(f,Hs);r4(f),Rn(()=>{ne&&S===Oi.Initializing&&x(Oi.Initialized)},[ne,S]),j.useEffect(()=>{const{onDragMove:qt}=F.current,{active:Sr,activatorEvent:Or,collisions:vi,over:Lr}=k.current;if(!Sr||!Or)return;const jr={active:Sr,activatorEvent:Or,collisions:vi,delta:{x:ee.x,y:ee.y},over:Lr};bo.unstable_batchedUpdates(()=>{qt==null||qt(jr),m({type:"onDragMove",event:jr})})},[ee.x,ee.y]),j.useEffect(()=>{const{active:qt,activatorEvent:Sr,collisions:Or,droppableContainers:vi,scrollAdjustedTranslate:Lr}=k.current;if(!qt||D.current==null||!Sr||!Lr)return;const{onDragOver:jr}=F.current,xn=vi.get(ve),Ja=xn&&xn.rect.current?{id:xn.id,rect:xn.rect.current,data:xn.data,disabled:xn.disabled}:null,zt={active:qt,activatorEvent:Sr,collisions:Or,delta:{x:Lr.x,y:Lr.y},over:Ja};bo.unstable_batchedUpdates(()=>{St(Ja),jr==null||jr(zt),m({type:"onDragOver",event:zt})})},[ve]),Rn(()=>{k.current={activatorEvent:U,active:I,activeNode:xe,collisionRect:Q,collisions:re,droppableRects:Y,draggableNodes:A,draggingNode:me,draggingNodeRect:_e,droppableContainers:$,over:Se,scrollableAncestors:ke,scrollAdjustedTranslate:ee},P.current={initial:_e,translated:Q}},[I,xe,re,Q,A,me,_e,Y,$,Se,ke,ee]),WL({...Me,delta:E,draggingRect:Q,pointerCoordinates:C,scrollableAncestors:ke,scrollableAncestorRects:Ze});const vc=j.useMemo(()=>({active:I,activeNode:xe,activeNodeRect:ne,activatorEvent:U,collisions:re,containerNodeRect:pe,dragOverlay:K,draggableNodes:A,droppableContainers:$,droppableRects:Y,over:Se,measureDroppableContainers:he,scrollableAncestors:ke,scrollableAncestorRects:Ze,measuringConfiguration:W,measuringScheduled:Ae,windowRect:je}),[I,xe,ne,U,re,pe,K,A,$,Y,Se,he,ke,Ze,W,Ae,je]),Sh=j.useMemo(()=>({activatorEvent:U,activators:mc,active:I,activeNodeRect:ne,ariaDescribedById:{draggable:L},dispatch:y,draggableNodes:A,over:Se,measureDroppableContainers:he}),[U,mc,I,ne,y,L,A,Se,he]);return T.createElement(yk.Provider,{value:w},T.createElement(kp.Provider,{value:Sh},T.createElement(Tk.Provider,{value:vc},T.createElement(Nk.Provider,{value:Kt},u)),T.createElement(p4,{disabled:(s==null?void 0:s.restoreFocus)===!1})),T.createElement(hL,{...s,hiddenTextDescribedById:L}));function yc(){const qt=(B==null?void 0:B.autoScrollEnabled)===!1,Sr=typeof l=="object"?l.enabled===!1:l===!1,Or=_&&!qt&&!Sr;return typeof l=="object"?{...l,enabled:Or}:{enabled:Or}}}),g4=j.createContext(null),gw="button",x4="Draggable";function b4(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=sc(x4),{activators:o,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:c,over:p}=j.useContext(kp),{role:h=gw,roleDescription:b="draggable",tabIndex:v=0}=i??{},g=(l==null?void 0:l.id)===t,y=j.useContext(g?Nk:g4),[m,w]=Zf(),[S,x]=Zf(),_=n4(o,t),O=fu(r);Rn(()=>(c.set(t,{id:t,key:a,node:m,activatorNode:S,data:O}),()=>{const E=c.get(t);E&&E.key===a&&c.delete(t)}),[c,t]);const A=j.useMemo(()=>({role:h,tabIndex:v,"aria-disabled":n,"aria-pressed":g&&h===gw?!0:void 0,"aria-roledescription":b,"aria-describedby":f.draggable}),[n,h,v,g,b,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:A,isDragging:g,listeners:n?void 0:_,node:m,over:p,setNodeRef:w,setActivatorNodeRef:x,transform:y}}function w4(){return j.useContext(Tk)}const _4="Droppable",S4={timeout:25};function O4(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=sc(_4),{active:o,dispatch:s,over:l,measureDroppableContainers:u}=j.useContext(kp),f=j.useRef({disabled:r}),c=j.useRef(!1),p=j.useRef(null),h=j.useRef(null),{disabled:b,updateMeasurementsFor:v,timeout:g}={...S4,...i},y=fu(v??n),m=j.useCallback(()=>{if(!c.current){c.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),h.current=null},g)},[g]),w=Ep({callback:m,disabled:b||!o}),S=j.useCallback((A,E)=>{w&&(E&&(w.unobserve(E),c.current=!1),A&&w.observe(A))},[w]),[x,_]=Zf(S),O=fu(t);return j.useEffect(()=>{!w||!x.current||(w.disconnect(),c.current=!1,w.observe(x.current))},[x,w]),j.useEffect(()=>(s({type:Tt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:x,rect:p,data:O}}),()=>s({type:Tt.UnregisterDroppable,key:a,id:n})),[n]),j.useEffect(()=>{r!==f.current.disabled&&(s({type:Tt.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,s]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===n,node:x,over:l,setNodeRef:_}}function rx(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function j4(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function Bc(e){return e!==null&&e>=0}function A4(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=rx(t,n,r),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Fc={scaleX:1,scaleY:1},k4=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:o}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(i===r){const u=a[o];return u?{x:0,y:rr&&i<=o?{x:0,y:-s.height-l,...Fc}:i=o?{x:0,y:s.height+l,...Fc}:{x:0,y:0,...Fc}};function P4(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?rn.map(_=>typeof _=="object"&&"id"in _?_.id:_),[n]),b=o!=null,v=o?h.indexOf(o.id):-1,g=u?h.indexOf(u.id):-1,y=j.useRef(h),m=!A4(h,y.current),w=g!==-1&&v===-1||m,S=E4(a);Rn(()=>{m&&b&&f(h)},[m,h,b,f]),j.useEffect(()=>{y.current=h},[h]);const x=j.useMemo(()=>({activeIndex:v,containerId:c,disabled:S,disableTransforms:w,items:h,overIndex:g,useDragOverlay:p,sortedRects:j4(h,l),strategy:i}),[v,c,S.draggable,S.droppable,w,h,g,l,p,i]);return T.createElement(Ik.Provider,{value:x},t)}const T4=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return rx(r,n,i).indexOf(t)},N4=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!n||s!==a&&i===o?!1:r?!0:o!==i&&t===l},$4={duration:200,easing:"ease"},Mk="transform",R4=pu.Transition.toString({property:Mk,duration:0,easing:"linear"}),I4={roleDescription:"sortable"};function M4(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,o]=j.useState(null),s=j.useRef(r);return Rn(()=>{if(!t&&r!==s.current&&n.current){const l=i.current;if(l){const u=Ts(n.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&o(f)}}r!==s.current&&(s.current=r)},[t,r,n,i]),j.useEffect(()=>{a&&o(null)},[a]),a}function D4(e){let{animateLayoutChanges:t=N4,attributes:r,disabled:n,data:i,getNewIndex:a=T4,id:o,strategy:s,resizeObserverConfig:l,transition:u=$4}=e;const{items:f,containerId:c,activeIndex:p,disabled:h,disableTransforms:b,sortedRects:v,overIndex:g,useDragOverlay:y,strategy:m}=j.useContext(Ik),w=L4(n,h),S=f.indexOf(o),x=j.useMemo(()=>({sortable:{containerId:c,index:S,items:f},...i}),[c,i,S,f]),_=j.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:O,node:A,isOver:E,setNodeRef:$}=O4({id:o,data:x,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...l}}),{active:N,activatorEvent:P,activeNodeRect:I,attributes:D,setNodeRef:B,listeners:V,isDragging:U,over:R,setActivatorNodeRef:F,transform:L}=b4({id:o,data:x,attributes:{...I4,...r},disabled:w.draggable}),q=tL($,B),W=!!N,Y=W&&!b&&Bc(p)&&Bc(g),he=!y&&U,Ae=he&&Y?L:null,We=Y?Ae??(s??m)({rects:v,activeNodeRect:I,activeIndex:p,overIndex:g,index:S}):null,Me=Bc(p)&&Bc(g)?a({id:o,items:f,activeIndex:p,overIndex:g}):S,Z=N==null?void 0:N.id,ne=j.useRef({activeId:Z,items:f,newIndex:Me,containerId:c}),pe=f!==ne.current.items,k=t({active:N,containerId:c,isDragging:U,isSorting:W,id:o,index:S,items:f,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:u,wasDragging:ne.current.activeId!=null}),H=M4({disabled:!k,index:S,node:A,rect:O});return j.useEffect(()=>{W&&ne.current.newIndex!==Me&&(ne.current.newIndex=Me),c!==ne.current.containerId&&(ne.current.containerId=c),f!==ne.current.items&&(ne.current.items=f)},[W,Me,c,f]),j.useEffect(()=>{if(Z===ne.current.activeId)return;if(Z&&!ne.current.activeId){ne.current.activeId=Z;return}const me=setTimeout(()=>{ne.current.activeId=Z},50);return()=>clearTimeout(me)},[Z]),{active:N,activeIndex:p,attributes:D,data:x,rect:O,index:S,newIndex:Me,items:f,isOver:E,isSorting:W,isDragging:U,listeners:V,node:A,overIndex:g,over:R,setNodeRef:q,setActivatorNodeRef:F,setDroppableNodeRef:$,setDraggableNodeRef:B,transform:H??We,transition:K()};function K(){if(H||pe&&ne.current.newIndex===S)return R4;if(!(he&&!Z0(P)||!u)&&(W||k))return pu.Transition.toString({...u,property:Mk})}}function L4(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function ed(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const B4=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],F4=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(B4.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];a.getEnabled().forEach(c=>{if(!c||c!=null&&c.disabled)return;const p=i.get(c.id);if(p)switch(e.code){case Ie.Down:n.topp.top&&l.push(c);break;case Ie.Left:n.left>p.left&&l.push(c);break;case Ie.Right:n.left1&&(f=u[1].id),f!=null){const c=a.get(r.id),p=a.get(f),h=p?i.get(p.id):null,b=p==null?void 0:p.node.current;if(b&&h&&c&&p){const g=Ap(b).some((_,O)=>s[O]!==_),y=Dk(c,p),m=z4(c,p),w=g||!y?{x:0,y:0}:{x:m?n.width-h.width:0,y:m?n.height-h.height:0},S={x:h.left,y:h.top};return w.x&&w.y?S:du(S,w)}}}};function Dk(e,t){return!ed(e)||!ed(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function z4(e,t){return!ed(e)||!ed(t)||!Dk(e,t)?!1:e.data.current.sortable.index{const n={key:t,type:r.data_type.toLowerCase()};return r.values&&(n.values=r.values.split(",").map(i=>i.trim())),r.min_value!==void 0&&(n.min_value=r.min_value),r.max_value!==void 0&&(n.max_value=r.max_value),r.min_length!==void 0&&(n.min_length=r.min_length),r.max_length!==void 0&&(n.max_length=r.max_length),r.exact_length!==void 0&&(n.exact_length=r.exact_length),r.regex&&(n.regex=r.regex),n})}function V4(){const{data:e,error:t,isLoading:r}=vn("/config/routing-keys",lM,{refreshInterval:0,revalidateOnFocus:!1}),n=U4(e||null),i=n.reduce((o,s)=>(o[s.key]=s,o),{}),a={};return n.forEach(o=>{a[o.key]={type:o.type,values:o.values||[]}}),{config:e,keys:n,keysByName:i,routingKeysConfig:a,isLoading:r,error:t,getKeyValues:o=>{var s;return((s=i[o])==null?void 0:s.values)||[]},isIntegerKey:o=>{var s;return((s=i[o])==null?void 0:s.type)==="integer"},isEnumKey:o=>{var s;return((s=i[o])==null?void 0:s.type)==="enum"}}}const W4={"==":"equal","!=":"not_equal",">":"greater_than","<":"less_than",">=":"greater_than_equal","<=":"less_than_equal"};function H4({id:e,name:t,onRemove:r}){const{attributes:n,listeners:i,setNodeRef:a,transform:o,transition:s}=D4({id:e}),l={transform:pu.Transform.toString(o),transition:s};return d.jsxs("div",{ref:a,style:l,className:"flex items-center gap-2 bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] rounded-lg px-2 py-1.5",children:[d.jsx("span",{...n,...i,className:"cursor-grab text-slate-400",children:d.jsx(yI,{size:14})}),d.jsx("span",{className:"text-sm flex-1 font-mono",children:t}),d.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:d.jsx(ii,{size:12})})]})}function Lk({gateways:e,onChange:t}){const[r,n]=j.useState(""),i=mL(ow(tx),ow(J0,{coordinateGetter:F4}));function a(s){const{active:l,over:u}=s;if(u&&l.id!==u.id){const f=e.findIndex(p=>p.id===l.id),c=e.findIndex(p=>p.id===u.id);t(rx(e,f,c))}}function o(){r.trim()&&(t([...e,{id:crypto.randomUUID(),name:r.trim()}]),n(""))}return d.jsxs("div",{className:"space-y-2",children:[d.jsx(y4,{sensors:i,collisionDetection:yL,onDragEnd:a,children:d.jsx(C4,{items:e.map(s=>s.id),strategy:k4,children:e.map((s,l)=>d.jsx(H4,{id:s.id,name:`${l+1}. ${s.name}`,onRemove:()=>t(e.filter(u=>u.id!==s.id))},s.id))})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:r,onChange:s=>n(s.target.value),onKeyDown:s=>s.key==="Enter"&&(s.preventDefault(),o()),placeholder:"gateway name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs(ht,{type:"button",size:"sm",variant:"secondary",onClick:o,children:[d.jsx(qi,{size:13})," Add"]})]})]})}function Bk({gateways:e,onChange:t}){const[r,n]=j.useState(""),i=e.reduce((o,s)=>o+s.split,0);function a(){r.trim()&&(t([...e,{id:crypto.randomUUID(),name:r.trim(),split:0}]),n(""))}return d.jsxs("div",{className:"space-y-2",children:[e.map(o=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-mono w-24 truncate",children:o.name}),d.jsx("input",{type:"range",min:0,max:100,value:o.split,onChange:s=>t(e.map(l=>l.id===o.id?{...l,split:Number(s.target.value)}:l)),className:"flex-1 accent-brand-500"}),d.jsxs("span",{className:"text-sm w-10 text-right",children:[o.split,"%"]}),d.jsx("button",{type:"button",onClick:()=>t(e.filter(s=>s.id!==o.id)),className:"text-red-400 hover:text-red-600",children:d.jsx(ii,{size:12})})]},o.id)),d.jsxs("div",{className:`text-xs font-medium ${i===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",i,"% ",i!==100&&"(must equal 100)"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:r,onChange:o=>n(o.target.value),onKeyDown:o=>o.key==="Enter"&&(o.preventDefault(),a()),placeholder:"gateway name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs(ht,{type:"button",size:"sm",variant:"secondary",onClick:a,children:[d.jsx(qi,{size:13})," Add"]})]})]})}function G4({row:e,onChange:t,onRemove:r,routingKeys:n}){var l;const i=n[e.lhs],a=(i==null?void 0:i.type)==="enum",s=(i==null?void 0:i.type)==="integer"?[">","<",">=","<=","==","!="]:["==","!="];return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("select",{value:e.lhs,onChange:u=>t({...e,lhs:u.target.value,value:"",operator:"=="}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:Object.keys(n).map(u=>d.jsx("option",{value:u,children:u},u))}),d.jsx("select",{value:e.operator,onChange:u=>t({...e,operator:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:s.map(u=>d.jsx("option",{value:u,children:u},u))}),a?d.jsxs("select",{value:e.value,onChange:u=>t({...e,value:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:[d.jsx("option",{value:"",children:"select..."}),(((l=n[e.lhs])==null?void 0:l.values)||[]).map(u=>d.jsx("option",{value:u,children:u},u))]}):d.jsx("input",{type:"number",value:e.value,onChange:u=>t({...e,value:u.target.value}),placeholder:"value",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none"}),d.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:d.jsx(ii,{size:12})})]})}function K4({block:e,onChange:t,onRemove:r,routingKeys:n}){var f;const[i,a]=j.useState(!1),o=Object.keys(n)[0]||"payment_method",l=(((f=n[o])==null?void 0:f.values)||[])[0]||"";function u(){t({...e,conditions:[...e.conditions,{id:crypto.randomUUID(),lhs:o,operator:"==",value:l}]})}return d.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#0d0d12] rounded-t-xl cursor-pointer",onClick:()=>a(!i),children:[d.jsx("input",{value:e.name,onChange:c=>{c.stopPropagation(),t({...e,name:c.target.value})},onClick:c=>c.stopPropagation(),placeholder:"Rule name",className:"bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),r()},className:"text-red-400 hover:text-red-600",children:d.jsx(ii,{size:14})}),i?d.jsx(xl,{size:14}):d.jsx(bl,{size:14})]})]}),!i&&d.jsxs("div",{className:"px-4 py-3 space-y-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"CONDITIONS"}),d.jsxs("div",{className:"space-y-2",children:[e.conditions.map(c=>d.jsx(G4,{row:c,routingKeys:n,onChange:p=>t({...e,conditions:e.conditions.map(h=>h.id===c.id?p:h)}),onRemove:()=>t({...e,conditions:e.conditions.filter(p=>p.id!==c.id)})},c.id)),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:u,children:[d.jsx(qi,{size:12})," Add Condition"]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"OUTPUT"}),d.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(c=>d.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[d.jsx("input",{type:"radio",checked:e.outputType===c,onChange:()=>t({...e,outputType:c}),className:"accent-brand-500"}),c==="priority"?"Priority":"Volume Split"]},c))}),e.outputType==="priority"?d.jsx(Lk,{gateways:e.priorityGateways,onChange:c=>t({...e,priorityGateways:c})}):d.jsx(Bk,{gateways:e.volumeGateways,onChange:c=>t({...e,volumeGateways:c})})]})]})]})}function q4(e,t,r){function n(a,o,s){return a==="priority"?{priority:o.map(l=>({gateway_name:l.name,gateway_id:null}))}:{volume_split:s.map(l=>({split:l.split,output:{gateway_name:l.name,gateway_id:null}}))}}function i(a){return a==="priority"?"priority":"volume_split"}return{globals:{},default_selection:n(t.type,t.priorityGateways,t.volumeGateways),rules:e.map(a=>({name:a.name,routing_type:i(a.outputType),output:n(a.outputType,a.priorityGateways,a.volumeGateways),statements:[{condition:a.conditions.map(o=>{var s,l;return{lhs:o.lhs,comparison:W4[o.operator]||o.operator,value:{type:((s=r[o.lhs])==null?void 0:s.type)==="integer"?"number":"enum_variant",value:((l=r[o.lhs])==null?void 0:l.type)==="integer"?Number(o.value):o.value},metadata:{}}})}]}))}}function X4(){const{merchantId:e}=ra(),{routingKeysConfig:t}=V4(),r=Object.keys(t).length>0?t:qD,[n,i]=j.useState(""),[a,o]=j.useState(""),[s,l]=j.useState([]),[u,f]=j.useState({type:"priority",priorityGateways:[],volumeGateways:[]}),[c,p]=j.useState(!1),[h,b]=j.useState(!1),[v,g]=j.useState(null),[y,m]=j.useState(null),[w,S]=j.useState(!1),[x,_]=j.useState(null),[O,A]=j.useState(!1),[E,$]=j.useState(new Set),{data:N,mutate:P}=vn(e?`/routing/list/${e}`:null,()=>ft(`/routing/list/${e}`)),{data:I}=vn(e?`/routing/list/active/${e}`:null,()=>ft(`/routing/list/active/${e}`)),D=new Set((I||[]).map(L=>L.id)),B=q4(s,u,r);async function V(L){if(L.preventDefault(),!e){g("Set a Merchant ID first.");return}if(!n.trim()){g("Rule name is required.");return}b(!0),g(null),m(null);try{const q=await ft("/routing/create",{name:n.trim(),description:a,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:B}});m(q.id),P()}catch(q){g(String(q))}finally{b(!1)}}async function U(L){if(e){S(!0),_(null),A(!1);try{await ft("/routing/activate",{created_by:e,routing_algorithm_id:L}),A(!0),P()}catch(q){_(String(q))}finally{S(!1)}}}function R(L){$(q=>{const W=new Set(q);return W.has(L)?W.delete(L):W.add(L),W})}function F(){l(L=>[...L,{id:crypto.randomUUID(),name:`Rule ${L.length+1}`,conditions:[],outputType:"priority",priorityGateways:[],volumeGateways:[]}])}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Rule-Based Routing"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Create Euclid DSL declarative routing rules"})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[d.jsxs("div",{className:"lg:col-span-1 space-y-3",children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Existing Rules"})}),d.jsx(Ne,{className:"p-0",children:e?N?N.length===0?d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"No rules yet."}):d.jsx("table",{className:"w-full text-sm",children:d.jsx("tbody",{children:N.map(L=>{const q=D.has(L.id),W=E.has(L.id),Y=L.algorithm_data||L.algorithm;return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"border-b border-slate-100 dark:border-[#222226] last:border-0",children:[d.jsxs("td",{className:"px-4 py-3",children:[d.jsx("p",{className:"font-medium truncate",children:L.name}),d.jsx("p",{className:"text-xs text-slate-400 capitalize",children:Y==null?void 0:Y.type})]}),d.jsx("td",{className:"px-2 py-3",children:d.jsx(Qt,{variant:q?"green":"gray",children:q?"Active":"Inactive"})}),d.jsx("td",{className:"px-2 py-3",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsxs(ht,{size:"sm",variant:"ghost",onClick:()=>R(L.id),children:[d.jsx(wp,{size:14,className:"mr-1"}),W?"Hide":"View"]}),!q&&d.jsx(ht,{size:"sm",variant:"ghost",onClick:()=>U(L.id),disabled:w,children:"Activate"})]})})]},L.id),W&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"ID:"})," ",L.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Description:"})," ",L.description||"N/A"]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Algorithm For:"})," ",L.algorithm_for]}),L.created_at&&d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",new Date(L.created_at).toLocaleString()]}),d.jsxs("div",{children:[d.jsx("strong",{children:"Configuration:"}),d.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(Y,null,2)})]})]})})})]})})})}):d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Loading..."}):d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Set merchant ID to load rules."})})]}),x&&d.jsx(Qo,{error:x}),O&&d.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400",children:"Rule activated successfully."})]}),d.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[d.jsx("form",{onSubmit:V,className:"space-y-4",children:d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Rule Builder"})}),d.jsxs(Ne,{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rule Name *"}),d.jsx("input",{value:n,onChange:L=>i(L.target.value),placeholder:"my-rule",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),d.jsx("input",{value:a,onChange:L=>o(L.target.value),placeholder:"Optional description",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Rules"}),s.map(L=>d.jsx(K4,{block:L,routingKeys:r,onChange:q=>l(W=>W.map(Y=>Y.id===L.id?q:Y)),onRemove:()=>l(q=>q.filter(W=>W.id!==L.id))},L.id)),d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:F,children:[d.jsx(qi,{size:14})," Add Rule Block"]})]}),d.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl px-4 py-3",children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"DEFAULT SELECTION (Fallback)"}),d.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(L=>d.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[d.jsx("input",{type:"radio",checked:u.type===L,onChange:()=>f({...u,type:L}),className:"accent-brand-500"}),L==="priority"?"Priority":"Volume Split"]},L))}),u.type==="priority"?d.jsx(Lk,{gateways:u.priorityGateways,onChange:L=>f({...u,priorityGateways:L})}):d.jsx(Bk,{gateways:u.volumeGateways,onChange:L=>f({...u,volumeGateways:L})})]}),d.jsx(Qo,{error:v}),y&&d.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400 flex items-center justify-between",children:[d.jsxs("span",{children:["Rule created (ID: ",y,")"]}),d.jsx(ht,{type:"button",size:"sm",onClick:()=>U(y),disabled:w,children:"Activate Now"})]}),d.jsxs("div",{className:"flex gap-3",children:[d.jsx(ht,{type:"submit",disabled:h,children:h?"Creating...":"Create Rule"}),d.jsx(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>p(!c),children:c?"Hide JSON":"Preview JSON"})]})]})]})}),c&&d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"JSON Preview"})}),d.jsx(Ne,{children:d.jsx("pre",{className:"text-xs text-slate-600 overflow-auto max-h-64 bg-[#07070b] rounded-lg p-4 font-mono border border-slate-200 dark:border-[#1c1c24]",children:JSON.stringify({name:n,description:a,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:B}},null,2)})})]})]})]})]})}function Fk(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var q5=K5,X5=Cp;function Y5(e,t){var r=this.__data__,n=X5(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Z5=Y5,Q5=R5,J5=U5,eB=H5,tB=q5,rB=Z5;function Is(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},_a=function(t){return za(t)&&t.indexOf("%")===t.length-1},ie=function(t){return _6(t)&&!uc(t)},A6=function(t){return Ce(t)},$t=function(t){return ie(t)||za(t)},E6=0,cc=function(t){var r=++E6;return"".concat(t||"").concat(r)},sr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ie(t)&&!za(t))return n;var a;if(_a(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return uc(a)&&(a=n),i&&a>r&&(a=r),a},oo=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},k6=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function I6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Cw={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Zn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Tw=null,Om=null,hx=function e(t){if(t===Tw&&Array.isArray(Om))return Om;var r=[];return j.Children.forEach(t,function(n){Ce(n)||(y6.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Om=r,Tw=t,r};function Yr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Zn(i)}):n=[Zn(t)],hx(e).forEach(function(i){var a=$r(i,"type.displayName")||$r(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function kr(e,t){var r=Yr(e,t);return r&&r[0]}var Nw=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!ie(n)||n<=0||!ie(i)||i<=0)},M6=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],D6=function(t){return t&&t.type&&za(t.type)&&M6.indexOf(t.type)>=0},L6=function(t,r,n,i){var a,o=(a=Sm==null?void 0:Sm[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Oe(t)&&(i&&o.includes(r)||T6.includes(r))||n&&px.includes(r)},ge=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(j.isValidElement(t)&&(i=t.props),!$s(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;L6((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},xy=function e(t,r){if(t===r)return!0;var n=j.Children.count(t);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return $w(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function V6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wy(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=U6(e,z6),f=i||{width:r,height:n,x:0,y:0},c=Ee("recharts-surface",a);return T.createElement("svg",by({},ge(u,!0,"svg"),{className:c,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),T.createElement("title",null,s),T.createElement("desc",null,l),t)}var W6=["children","className"];function _y(){return _y=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function G6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var He=T.forwardRef(function(e,t){var r=e.children,n=e.className,i=H6(e,W6),a=Ee("recharts-layer",n);return T.createElement("g",_y({className:a},ge(i,!0),{ref:t}),r)}),Qn=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:X6(e,t,r)}var Z6=Y6,Q6="\\ud800-\\udfff",J6="\\u0300-\\u036f",eF="\\ufe20-\\ufe2f",tF="\\u20d0-\\u20ff",rF=J6+eF+tF,nF="\\ufe0e\\ufe0f",iF="\\u200d",aF=RegExp("["+iF+Q6+rF+nF+"]");function oF(e){return aF.test(e)}var Jk=oF;function sF(e){return e.split("")}var lF=sF,e2="\\ud800-\\udfff",uF="\\u0300-\\u036f",cF="\\ufe20-\\ufe2f",fF="\\u20d0-\\u20ff",dF=uF+cF+fF,pF="\\ufe0e\\ufe0f",hF="["+e2+"]",Sy="["+dF+"]",Oy="\\ud83c[\\udffb-\\udfff]",mF="(?:"+Sy+"|"+Oy+")",t2="[^"+e2+"]",r2="(?:\\ud83c[\\udde6-\\uddff]){2}",n2="[\\ud800-\\udbff][\\udc00-\\udfff]",vF="\\u200d",i2=mF+"?",a2="["+pF+"]?",yF="(?:"+vF+"(?:"+[t2,r2,n2].join("|")+")"+a2+i2+")*",gF=a2+i2+yF,xF="(?:"+[t2+Sy+"?",Sy,r2,n2,hF].join("|")+")",bF=RegExp(Oy+"(?="+Oy+")|"+xF+gF,"g");function wF(e){return e.match(bF)||[]}var _F=wF,SF=lF,OF=Jk,jF=_F;function AF(e){return OF(e)?jF(e):SF(e)}var EF=AF,kF=Z6,PF=Jk,CF=EF,TF=Kk;function NF(e){return function(t){t=TF(t);var r=PF(t)?CF(t):void 0,n=r?r[0]:t.charAt(0),i=r?kF(r,1).join(""):t.slice(1);return n[e]()+i}}var $F=NF,RF=$F,IF=RF("toUpperCase"),MF=IF;const Wp=Ke(MF);function rt(e){return function(){return e}}const o2=Math.cos,rd=Math.sin,gn=Math.sqrt,nd=Math.PI,Hp=2*nd,jy=Math.PI,Ay=2*jy,ha=1e-6,DF=Ay-ha;function s2(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return s2;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iha)if(!(Math.abs(c*l-u*f)>ha)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,b=i-s,v=l*l+u*u,g=h*h+b*b,y=Math.sqrt(v),m=Math.sqrt(p),w=a*Math.tan((jy-Math.acos((v+p-g)/(2*y*m)))/2),S=w/m,x=w/y;Math.abs(S-1)>ha&&this._append`L${t+S*f},${r+S*c}`,this._append`A${a},${a},0,0,${+(c*h>f*b)},${this._x1=t+x*l},${this._y1=r+x*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,f=r+l,c=1^o,p=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>ha||Math.abs(this._y1-f)>ha)&&this._append`L${u},${f}`,n&&(p<0&&(p=p%Ay+Ay),p>DF?this._append`A${n},${n},0,1,${c},${t-s},${r-l}A${n},${n},0,1,${c},${this._x1=u},${this._y1=f}`:p>ha&&this._append`A${n},${n},0,${+(p>=jy)},${c},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function mx(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new BF(t)}function vx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function l2(e){this._context=e}l2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Gp(e){return new l2(e)}function u2(e){return e[0]}function c2(e){return e[1]}function f2(e,t){var r=rt(!0),n=null,i=Gp,a=null,o=mx(s);e=typeof e=="function"?e:e===void 0?u2:rt(e),t=typeof t=="function"?t:t===void 0?c2:rt(t);function s(l){var u,f=(l=vx(l)).length,c,p=!1,h;for(n==null&&(a=i(h=o())),u=0;u<=f;++u)!(u=h;--b)s.point(w[b],S[b]);s.lineEnd(),s.areaEnd()}y&&(w[p]=+e(g,p,c),S[p]=+t(g,p,c),s.point(n?+n(g,p,c):w[p],r?+r(g,p,c):S[p]))}if(m)return s=null,m+""||null}function f(){return f2().defined(i).curve(o).context(a)}return u.x=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),n=null,u):e},u.x0=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),u):e},u.x1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:rt(+c),u):n},u.y=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),r=null,u):t},u.y0=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),u):t},u.y1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:rt(+c),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(c){return arguments.length?(i=typeof c=="function"?c:rt(!!c),u):i},u.curve=function(c){return arguments.length?(o=c,a!=null&&(s=o(a)),u):o},u.context=function(c){return arguments.length?(c==null?a=s=null:s=o(a=c),u):a},u}class d2{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function FF(e){return new d2(e,!0)}function zF(e){return new d2(e,!1)}const yx={draw(e,t){const r=gn(t/nd);e.moveTo(r,0),e.arc(0,0,r,0,Hp)}},UF={draw(e,t){const r=gn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},p2=gn(1/3),VF=p2*2,WF={draw(e,t){const r=gn(t/VF),n=r*p2;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},HF={draw(e,t){const r=gn(t),n=-r/2;e.rect(n,n,r,r)}},GF=.8908130915292852,h2=rd(nd/10)/rd(7*nd/10),KF=rd(Hp/10)*h2,qF=-o2(Hp/10)*h2,XF={draw(e,t){const r=gn(t*GF),n=KF*r,i=qF*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Hp*a/5,s=o2(o),l=rd(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},jm=gn(3),YF={draw(e,t){const r=-gn(t/(jm*3));e.moveTo(0,r*2),e.lineTo(-jm*r,-r),e.lineTo(jm*r,-r),e.closePath()}},Br=-.5,Fr=gn(3)/2,Ey=1/gn(12),ZF=(Ey/2+1)*3,QF={draw(e,t){const r=gn(t/ZF),n=r/2,i=r*Ey,a=n,o=r*Ey+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Br*n-Fr*i,Fr*n+Br*i),e.lineTo(Br*a-Fr*o,Fr*a+Br*o),e.lineTo(Br*s-Fr*l,Fr*s+Br*l),e.lineTo(Br*n+Fr*i,Br*i-Fr*n),e.lineTo(Br*a+Fr*o,Br*o-Fr*a),e.lineTo(Br*s+Fr*l,Br*l-Fr*s),e.closePath()}};function JF(e,t){let r=null,n=mx(i);e=typeof e=="function"?e:rt(e||yx),t=typeof t=="function"?t:rt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:rt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:rt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function id(){}function ad(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function m2(e){this._context=e}m2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ad(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ez(e){return new m2(e)}function v2(e){this._context=e}v2.prototype={areaStart:id,areaEnd:id,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tz(e){return new v2(e)}function y2(e){this._context=e}y2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rz(e){return new y2(e)}function g2(e){this._context=e}g2.prototype={areaStart:id,areaEnd:id,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function nz(e){return new g2(e)}function Iw(e){return e<0?-1:1}function Mw(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Iw(a)+Iw(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Dw(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Am(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function od(e){this._context=e}od.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Am(this,this._t0,Dw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Am(this,Dw(this,r=Mw(this,e,t)),r);break;default:Am(this,this._t0,r=Mw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function x2(e){this._context=new b2(e)}(x2.prototype=Object.create(od.prototype)).point=function(e,t){od.prototype.point.call(this,t,e)};function b2(e){this._context=e}b2.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function iz(e){return new od(e)}function az(e){return new x2(e)}function w2(e){this._context=e}w2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Lw(e),i=Lw(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function sz(e){return new Kp(e,.5)}function lz(e){return new Kp(e,0)}function uz(e){return new Kp(e,1)}function Jo(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function cz(e,t){return e[t]}function fz(e){const t=[];return t.key=e,t}function dz(){var e=rt([]),t=ky,r=Jo,n=cz;function i(a){var o=Array.from(e.apply(this,arguments),fz),s,l=o.length,u=-1,f;for(const c of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wz(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var _2={symbolCircle:yx,symbolCross:UF,symbolDiamond:WF,symbolSquare:HF,symbolStar:XF,symbolTriangle:YF,symbolWye:QF},_z=Math.PI/180,Sz=function(t){var r="symbol".concat(Wp(t));return _2[r]||yx},Oz=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*_z;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},jz=function(t,r){_2["symbol".concat(Wp(t))]=r},gx=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=bz(t,vz),u=Fw(Fw({},l),{},{type:n,size:a,sizeType:s}),f=function(){var g=Sz(n),y=JF().type(g).size(Oz(a,s,n));return y()},c=u.className,p=u.cx,h=u.cy,b=ge(u,!0);return p===+p&&h===+h&&a===+a?T.createElement("path",Py({},b,{className:Ee("recharts-symbols",c),transform:"translate(".concat(p,", ").concat(h,")"),d:f()})):null};gx.registerSymbol=jz;function es(e){"@babel/helpers - typeof";return es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},es(e)}function Cy(){return Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var m=h.inactive?u:h.color;return T.createElement("li",Cy({className:g,style:c,key:"legend-item-".concat(b)},Ua(n.props,h,b)),T.createElement(wy,{width:o,height:o,viewBox:f,style:p},n.renderIcon(h)),T.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},v?v(y,h,b):y))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return T.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(j.PureComponent);vu(xx,"displayName","Legend");vu(xx,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Iz=Tp;function Mz(){this.__data__=new Iz,this.size=0}var Dz=Mz;function Lz(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Bz=Lz;function Fz(e){return this.__data__.get(e)}var zz=Fz;function Uz(e){return this.__data__.has(e)}var Vz=Uz,Wz=Tp,Hz=ox,Gz=sx,Kz=200;function qz(e,t){var r=this.__data__;if(r instanceof Wz){var n=r.__data__;if(!Hz||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var c=-1,p=!0,h=r&v8?new d8:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=bU}var Sx=wU,_U=pi,SU=Sx,OU=hi,jU="[object Arguments]",AU="[object Array]",EU="[object Boolean]",kU="[object Date]",PU="[object Error]",CU="[object Function]",TU="[object Map]",NU="[object Number]",$U="[object Object]",RU="[object RegExp]",IU="[object Set]",MU="[object String]",DU="[object WeakMap]",LU="[object ArrayBuffer]",BU="[object DataView]",FU="[object Float32Array]",zU="[object Float64Array]",UU="[object Int8Array]",VU="[object Int16Array]",WU="[object Int32Array]",HU="[object Uint8Array]",GU="[object Uint8ClampedArray]",KU="[object Uint16Array]",qU="[object Uint32Array]",st={};st[FU]=st[zU]=st[UU]=st[VU]=st[WU]=st[HU]=st[GU]=st[KU]=st[qU]=!0;st[jU]=st[AU]=st[LU]=st[EU]=st[BU]=st[kU]=st[PU]=st[CU]=st[TU]=st[NU]=st[$U]=st[RU]=st[IU]=st[MU]=st[DU]=!1;function XU(e){return OU(e)&&SU(e.length)&&!!st[_U(e)]}var YU=XU;function ZU(e){return function(t){return e(t)}}var $2=ZU,cd={exports:{}};cd.exports;(function(e,t){var r=zk,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(cd,cd.exports);var QU=cd.exports,JU=YU,eV=$2,Kw=QU,qw=Kw&&Kw.isTypedArray,tV=qw?eV(qw):JU,R2=tV,rV=aU,nV=wx,iV=_r,aV=N2,oV=_x,sV=R2,lV=Object.prototype,uV=lV.hasOwnProperty;function cV(e,t){var r=iV(e),n=!r&&nV(e),i=!r&&!n&&aV(e),a=!r&&!n&&!i&&sV(e),o=r||n||i||a,s=o?rV(e.length,String):[],l=s.length;for(var u in e)(t||uV.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||oV(u,l)))&&s.push(u);return s}var fV=cV,dV=Object.prototype;function pV(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||dV;return e===r}var hV=pV;function mV(e,t){return function(r){return e(t(r))}}var I2=mV,vV=I2,yV=vV(Object.keys,Object),gV=yV,xV=hV,bV=gV,wV=Object.prototype,_V=wV.hasOwnProperty;function SV(e){if(!xV(e))return bV(e);var t=[];for(var r in Object(e))_V.call(e,r)&&r!="constructor"&&t.push(r);return t}var OV=SV,jV=ix,AV=Sx;function EV(e){return e!=null&&AV(e.length)&&!jV(e)}var qp=EV,kV=fV,PV=OV,CV=qp;function TV(e){return CV(e)?kV(e):PV(e)}var Ox=TV,NV=K8,$V=nU,RV=Ox;function IV(e){return NV(e,RV,$V)}var MV=IV,Xw=MV,DV=1,LV=Object.prototype,BV=LV.hasOwnProperty;function FV(e,t,r,n,i,a){var o=r&DV,s=Xw(e),l=s.length,u=Xw(t),f=u.length;if(l!=f&&!o)return!1;for(var c=l;c--;){var p=s[c];if(!(o?p in t:BV.call(t,p)))return!1}var h=a.get(e),b=a.get(t);if(h&&b)return h==t&&b==e;var v=!0;a.set(e,t),a.set(t,e);for(var g=o;++c-1}var BW=LW;function FW(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=tH){var u=t?null:JW(e);if(u)return eH(u);o=!1,i=QW,l=new XW}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yH(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gH(e){return e.value}function xH(e,t){if(T.isValidElement(e))return T.cloneElement(e,t);if(typeof e=="function")return T.createElement(e,t);t.ref;var r=vH(t,lH);return T.createElement(xx,r)}var f_=1,ka=function(e){function t(){var r;uH(this,t);for(var n=arguments.length,i=new Array(n),a=0;af_||Math.abs(i.height-this.lastBoundingBox.height)>f_)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Bn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,c,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();c={left:((u||0)-h.width)/2}}else c=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var b=this.getBBoxSnapshot();p={top:((f||0)-b.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Bn(Bn({},c),p)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,c=Bn(Bn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return T.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(h){n.wrapperNode=h}},xH(a,Bn(Bn({},this.props),{},{payload:z2(f,u,gH)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Bn(Bn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&ie(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(j.PureComponent);Xp(ka,"displayName","Legend");Xp(ka,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var d_=lc,bH=wx,wH=_r,p_=d_?d_.isConcatSpreadable:void 0;function _H(e){return wH(e)||bH(e)||!!(p_&&e&&e[p_])}var SH=_H,OH=C2,jH=SH;function W2(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=jH),i||(i=[]);++a0&&r(s)?t>1?W2(s,t-1,r,n,i):OH(i,s):n||(i[i.length]=s)}return i}var H2=W2;function AH(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var EH=AH,kH=EH,PH=kH(),CH=PH,TH=CH,NH=Ox;function $H(e,t){return e&&TH(e,t,NH)}var G2=$H,RH=qp;function IH(e,t){return function(r,n){if(r==null)return r;if(!RH(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var XH=qH,Cm=ux,YH=cx,ZH=ia,QH=K2,JH=WH,e7=$2,t7=XH,r7=Bs,n7=_r;function i7(e,t,r){t.length?t=Cm(t,function(a){return n7(a)?function(o){return YH(o,a.length===1?a[0]:a)}:a}):t=[r7];var n=-1;t=Cm(t,e7(ZH));var i=QH(e,function(a,o,s){var l=Cm(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return JH(i,function(a,o){return t7(a,o,r)})}var a7=i7;function o7(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var s7=o7,l7=s7,m_=Math.max;function u7(e,t,r){return t=m_(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=m_(n.length-t,0),o=Array(a);++i0){if(++t>=x7)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var S7=_7,O7=g7,j7=S7,A7=j7(O7),E7=A7,k7=Bs,P7=c7,C7=E7;function T7(e,t){return C7(P7(e,t,k7),e+"")}var N7=T7,$7=ax,R7=qp,I7=_x,M7=na;function D7(e,t,r){if(!M7(r))return!1;var n=typeof t;return(n=="number"?R7(r)&&I7(t,r.length):n=="string"&&t in r)?$7(r[t],e):!1}var Yp=D7,L7=H2,B7=a7,F7=N7,y_=Yp,z7=F7(function(e,t){if(e==null)return[];var r=t.length;return r>1&&y_(e,t[0],t[1])?t=[]:r>2&&y_(t[0],t[1],t[2])&&(t=[t[0]]),B7(e,L7(t,1),[])}),U7=z7;const Ex=Ke(U7);function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function Ly(){return Ly=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(al,"-left"),ie(r)&&t&&ie(t.x)&&r=t.y),"".concat(al,"-top"),ie(n)&&t&&ie(t.y)&&nv?Math.max(f,l[n]):Math.max(c,l[n])}function nG(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function iG(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,c;return o.height>0&&o.width>0&&r?(f=b_({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),c=b_({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=nG({translateX:f,translateY:c,useTranslate3d:s})):u=tG,{cssProperties:u,cssClasses:rG({translateX:f,translateY:c,coordinate:r})}}function rs(e){"@babel/helpers - typeof";return rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(e)}function w_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function __(e){for(var t=1;tS_||Math.abs(n.height-this.state.lastBoundingBox.height)>S_)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,f=i.coordinate,c=i.hasPayload,p=i.isAnimationActive,h=i.offset,b=i.position,v=i.reverseDirection,g=i.useTranslate3d,y=i.viewBox,m=i.wrapperStyle,w=iG({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:b,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:y}),S=w.cssClasses,x=w.cssProperties,_=__(__({transition:p&&a?"transform ".concat(s,"ms ").concat(l):void 0},x),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&c?"visible":"hidden",position:"absolute",top:0,left:0},m);return T.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(A){n.wrapperNode=A}},u)}}])}(j.PureComponent),hG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Fs={isSsr:hG()};function ns(e){"@babel/helpers - typeof";return ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(e)}function O_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function j_(e){for(var t=1;t0;return T.createElement(pG,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:a,coordinate:f,hasPayload:_,offset:h,position:g,reverseDirection:y,useTranslate3d:m,viewBox:w,wrapperStyle:S},OG(u,j_(j_({},this.props),{},{payload:x})))}}])}(j.PureComponent);kx(Pr,"displayName","Tooltip");kx(Pr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Fs.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var jG=Mn,AG=function(){return jG.Date.now()},EG=AG,kG=/\s/;function PG(e){for(var t=e.length;t--&&kG.test(e.charAt(t)););return t}var CG=PG,TG=CG,NG=/^\s+/;function $G(e){return e&&e.slice(0,TG(e)+1).replace(NG,"")}var RG=$G,IG=RG,A_=na,MG=Ns,E_=NaN,DG=/^[-+]0x[0-9a-f]+$/i,LG=/^0b[01]+$/i,BG=/^0o[0-7]+$/i,FG=parseInt;function zG(e){if(typeof e=="number")return e;if(MG(e))return E_;if(A_(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=A_(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=IG(e);var r=LG.test(e);return r||BG.test(e)?FG(e.slice(2),r?2:8):DG.test(e)?E_:+e}var J2=zG,UG=na,Nm=EG,k_=J2,VG="Expected a function",WG=Math.max,HG=Math.min;function GG(e,t,r){var n,i,a,o,s,l,u=0,f=!1,c=!1,p=!0;if(typeof e!="function")throw new TypeError(VG);t=k_(t)||0,UG(r)&&(f=!!r.leading,c="maxWait"in r,a=c?WG(k_(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p);function h(_){var O=n,A=i;return n=i=void 0,u=_,o=e.apply(A,O),o}function b(_){return u=_,s=setTimeout(y,t),f?h(_):o}function v(_){var O=_-l,A=_-u,E=t-O;return c?HG(E,a-A):E}function g(_){var O=_-l,A=_-u;return l===void 0||O>=t||O<0||c&&A>=a}function y(){var _=Nm();if(g(_))return m(_);s=setTimeout(y,v(_))}function m(_){return s=void 0,p&&n?h(_):(n=i=void 0,o)}function w(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:m(Nm())}function x(){var _=Nm(),O=g(_);if(n=arguments,i=this,l=_,O){if(s===void 0)return b(l);if(c)return clearTimeout(s),s=setTimeout(y,t),h(l)}return s===void 0&&(s=setTimeout(y,t)),o}return x.cancel=w,x.flush=S,x}var KG=GG,qG=KG,XG=na,YG="Expected a function";function ZG(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(YG);return XG(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),qG(e,t,{leading:n,maxWait:t,trailing:i})}var QG=ZG;const eP=Ke(QG);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function P_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(I=eP(I,v,{trailing:!0,leading:!1}));var D=new ResizeObserver(I),B=x.current.getBoundingClientRect(),V=B.width,U=B.height;return N(V,U),D.observe(x.current),function(){D.disconnect()}},[N,v]);var P=j.useMemo(function(){var I=E.containerWidth,D=E.containerHeight;if(I<0||D<0)return null;Qn(_a(o)||_a(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),Qn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var B=_a(o)?I:o,V=_a(l)?D:l;r&&r>0&&(B?V=B/r:V&&(B=V*r),p&&V>p&&(V=p)),Qn(B>0||V>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,B,V,o,l,f,c,r);var U=!Array.isArray(h)&&Zn(h.type).endsWith("Chart");return T.Children.map(h,function(R){return T.isValidElement(R)?j.cloneElement(R,Wc({width:B,height:V},U?{style:Wc({height:"100%",width:"100%",maxHeight:V,maxWidth:B},R.props.style)}:{})):R})},[r,h,l,p,c,f,E,o]);return T.createElement("div",{id:g?"".concat(g):void 0,className:Ee("recharts-responsive-container",y),style:Wc(Wc({},S),{},{width:o,height:l,minWidth:f,minHeight:c,maxHeight:p}),ref:x},P)}),Pa=function(t){return null};Pa.displayName="Cell";function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function T_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Uy(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Fs.isSsr)return{width:0,height:0};var n=dK(r),i=JSON.stringify({text:t,copyStyle:n});if(no.widthCache[i])return no.widthCache[i];try{var a=document.getElementById(N_);a||(a=document.createElement("span"),a.setAttribute("id",N_),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Uy(Uy({},fK),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return no.widthCache[i]=l,++no.cacheCount>cK&&(no.cacheCount=0,no.widthCache={}),l}catch{return{width:0,height:0}}},pK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function hd(e,t){return yK(e)||vK(e,t)||mK(e,t)||hK()}function hK(){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 mK(e,t){if(e){if(typeof e=="string")return $_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $_(e,t)}}function $_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function B_(e,t){return IK(e)||RK(e,t)||$K(e,t)||NK()}function NK(){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 $K(e,t){if(e){if(typeof e=="string")return F_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F_(e,t)}}function F_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return B.reduce(function(V,U){var R=U.word,F=U.width,L=V[V.length-1];if(L&&(i==null||a||L.width+F+nU.width?V:U})};if(!f)return h;for(var v="…",g=function(B){var V=c.slice(0,B),U=iP({breakAll:u,style:l,children:V+v}).wordsWithComputedWidth,R=p(U),F=R.length>o||b(R).width>Number(i);return[F,R]},y=0,m=c.length-1,w=0,S;y<=m&&w<=c.length-1;){var x=Math.floor((y+m)/2),_=x-1,O=g(_),A=B_(O,2),E=A[0],$=A[1],N=g(x),P=B_(N,1),I=P[0];if(!E&&!I&&(y=x+1),E&&I&&(m=x-1),!E&&I){S=$;break}w++}return S||h},z_=function(t){var r=Ce(t)?[]:t.toString().split(nP);return[{words:r}]},DK=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Fs.isSsr){var l,u,f=iP({breakAll:o,children:i,style:a});if(f){var c=f.wordsWithComputedWidth,p=f.spaceWidth;l=c,u=p}else return z_(i);return MK({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return z_(i)},U_="#808080",Va=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,c=f===void 0?!1:f,p=t.textAnchor,h=p===void 0?"start":p,b=t.verticalAnchor,v=b===void 0?"end":b,g=t.fill,y=g===void 0?U_:g,m=L_(t,PK),w=j.useMemo(function(){return DK({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:c,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,c,m.style,m.width]),S=m.dx,x=m.dy,_=m.angle,O=m.className,A=m.breakAll,E=L_(m,CK);if(!$t(n)||!$t(a))return null;var $=n+(ie(S)?S:0),N=a+(ie(x)?x:0),P;switch(v){case"start":P=$m("calc(".concat(u,")"));break;case"middle":P=$m("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:P=$m("calc(".concat(w.length-1," * -").concat(s,")"));break}var I=[];if(c){var D=w[0].width,B=m.width;I.push("scale(".concat((ie(B)?B/D:1)/D,")"))}return _&&I.push("rotate(".concat(_,", ").concat($,", ").concat(N,")")),I.length&&(E.transform=I.join(" ")),T.createElement("text",Vy({},ge(E,!0),{x:$,y:N,className:Ee("recharts-text",O),textAnchor:h,fill:y.includes("url")?U_:y}),w.map(function(V,U){var R=V.words.join(A?"":" ");return T.createElement("tspan",{x:$,dy:U===0?P:s,key:"".concat(R,"-").concat(U)},R)}))};function Wi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function LK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Px(e){let t,r,n;e.length!==2?(t=Wi,r=(s,l)=>Wi(e(s),l),n=(s,l)=>e(s)-l):(t=e===Wi||e===LK?e:BK,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[c],l)<0?u=c+1:f=c}while(u>>1;r(s[c],l)<=0?u=c+1:f=c}while(uu&&n(s[c-1],l)>-n(s[c],l)?c-1:c}return{left:i,center:o,right:a}}function BK(){return 0}function aP(e){return e===null?NaN:+e}function*FK(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const zK=Px(Wi),fc=zK.right;Px(aP).center;class V_ extends Map{constructor(t,r=WK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(W_(this,t))}has(t){return super.has(W_(this,t))}set(t,r){return super.set(UK(this,t),r)}delete(t){return super.delete(VK(this,t))}}function W_({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function UK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function VK({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function WK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function HK(e=Wi){if(e===Wi)return oP;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function oP(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const GK=Math.sqrt(50),KK=Math.sqrt(10),qK=Math.sqrt(2);function md(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=GK?10:a>=KK?5:a>=qK?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function G_(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function sP(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?oP:HK(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),c=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*c*(l-c)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*c/l+p)),b=Math.min(n,Math.floor(t+(l-u)*c/l+p));sP(e,t,h,b,i)}const a=e[t];let o=r,s=n;for(ol(e,r,t),i(e[n],a)>0&&ol(e,r,n);o0;)--s}i(e[r],a)===0?ol(e,r,s):(++s,ol(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function ol(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function XK(e,t,r){if(e=Float64Array.from(FK(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return G_(e);if(t>=1)return H_(e);var n,i=(n-1)*t,a=Math.floor(i),o=H_(sP(e,a).subarray(0,a+1)),s=G_(e.subarray(a+1));return o+(s-o)*(i-a)}}function YK(e,t,r=aP){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function ZK(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Gc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Gc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=JK.exec(e))?new yr(t[1],t[2],t[3],1):(t=eq.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tq.exec(e))?Gc(t[1],t[2],t[3],t[4]):(t=rq.exec(e))?Gc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nq.exec(e))?J_(t[1],t[2]/100,t[3]/100,1):(t=iq.exec(e))?J_(t[1],t[2]/100,t[3]/100,t[4]):K_.hasOwnProperty(e)?Y_(K_[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function Y_(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function Gc(e,t,r,n){return n<=0&&(e=t=r=NaN),new yr(e,t,r,n)}function sq(e){return e instanceof dc||(e=ju(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function qy(e,t,r,n){return arguments.length===1?sq(e):new yr(e,t,r,n??1)}function yr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Tx(yr,qy,uP(dc,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Su:Math.pow(Su,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Ca(this.r),Ca(this.g),Ca(this.b),yd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Z_,formatHex:Z_,formatHex8:lq,formatRgb:Q_,toString:Q_}));function Z_(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function lq(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function Q_(){const e=yd(this.opacity);return`${e===1?"rgb(":"rgba("}${Ca(this.r)}, ${Ca(this.g)}, ${Ca(this.b)}${e===1?")":`, ${e})`}`}function yd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ca(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sa(e){return e=Ca(e),(e<16?"0":"")+e.toString(16)}function J_(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new dn(e,t,r,n)}function cP(e){if(e instanceof dn)return new dn(e.h,e.s,e.l,e.opacity);if(e instanceof dc||(e=ju(e)),!e)return new dn;if(e instanceof dn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new dn(o,s,l,e.opacity)}function uq(e,t,r,n){return arguments.length===1?cP(e):new dn(e,t,r,n??1)}function dn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Tx(dn,uq,uP(dc,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Su:Math.pow(Su,e),new dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new yr(Rm(e>=240?e-240:e+120,i,n),Rm(e,i,n),Rm(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new dn(eS(this.h),Kc(this.s),Kc(this.l),yd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=yd(this.opacity);return`${e===1?"hsl(":"hsla("}${eS(this.h)}, ${Kc(this.s)*100}%, ${Kc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function eS(e){return e=(e||0)%360,e<0?e+360:e}function Kc(e){return Math.max(0,Math.min(1,e||0))}function Rm(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Nx=e=>()=>e;function cq(e,t){return function(r){return e+r*t}}function fq(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function dq(e){return(e=+e)==1?fP:function(t,r){return r-t?fq(t,r,e):Nx(isNaN(t)?r:t)}}function fP(e,t){var r=t-e;return r?cq(e,r):Nx(isNaN(e)?t:e)}const tS=function e(t){var r=dq(t);function n(i,a){var o=r((i=qy(i)).r,(a=qy(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=fP(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function pq(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:gd(n,i)})),r=Im.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Oq(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?jq:Oq,l=u=null,c}function c(p){return p==null||isNaN(p=+p)?a:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return c.invert=function(p){return o(i((u||(u=s(t,e.map(n),gd)))(p)))},c.domain=function(p){return arguments.length?(e=Array.from(p,xd),f()):e.slice()},c.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},c.rangeRound=function(p){return t=Array.from(p),r=$x,f()},c.clamp=function(p){return arguments.length?(o=p?!0:lr,f()):o!==lr},c.interpolate=function(p){return arguments.length?(r=p,f()):r},c.unknown=function(p){return arguments.length?(a=p,c):a},function(p,h){return n=p,i=h,f()}}function Rx(){return Zp()(lr,lr)}function Aq(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function bd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function is(e){return e=bd(Math.abs(e)),e?e[1]:NaN}function Eq(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function kq(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Pq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=Pq.exec(e)))throw new Error("invalid format: "+e);var t;return new Ix({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Au.prototype=Ix.prototype;function Ix(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ix.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Cq(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var wd;function Tq(e,t){var r=bd(e,t);if(!r)return wd=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(wd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+bd(e,Math.max(0,t+a-1))[0]}function nS(e,t){var r=bd(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const iS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Aq,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>nS(e*100,t),r:nS,s:Tq,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function aS(e){return e}var oS=Array.prototype.map,sS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nq(e){var t=e.grouping===void 0||e.thousands===void 0?aS:Eq(oS.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?aS:kq(oS.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(c,p){c=Au(c);var h=c.fill,b=c.align,v=c.sign,g=c.symbol,y=c.zero,m=c.width,w=c.comma,S=c.precision,x=c.trim,_=c.type;_==="n"?(w=!0,_="g"):iS[_]||(S===void 0&&(S=12),x=!0,_="g"),(y||h==="0"&&b==="=")&&(y=!0,h="0",b="=");var O=(p&&p.prefix!==void 0?p.prefix:"")+(g==="$"?r:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),A=(g==="$"?n:/[%p]/.test(_)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),E=iS[_],$=/[defgprs%]/.test(_);S=S===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function N(P){var I=O,D=A,B,V,U;if(_==="c")D=E(P)+D,P="";else{P=+P;var R=P<0||1/P<0;if(P=isNaN(P)?l:E(Math.abs(P),S),x&&(P=Cq(P)),R&&+P==0&&v!=="+"&&(R=!1),I=(R?v==="("?v:s:v==="-"||v==="("?"":v)+I,D=(_==="s"&&!isNaN(P)&&wd!==void 0?sS[8+wd/3]:"")+D+(R&&v==="("?")":""),$){for(B=-1,V=P.length;++BU||U>57){D=(U===46?i+P.slice(B+1):P.slice(B))+D,P=P.slice(0,B);break}}}w&&!y&&(P=t(P,1/0));var F=I.length+P.length+D.length,L=F>1)+I+P+D+L.slice(F);break;default:P=L+I+P+D;break}return a(P)}return N.toString=function(){return c+""},N}function f(c,p){var h=Math.max(-8,Math.min(8,Math.floor(is(p)/3)))*3,b=Math.pow(10,-h),v=u((c=Au(c),c.type="f",c),{suffix:sS[8+h/3]});return function(g){return v(b*g)}}return{format:u,formatPrefix:f}}var qc,Mx,dP;$q({thousands:",",grouping:[3],currency:["$",""]});function $q(e){return qc=Nq(e),Mx=qc.format,dP=qc.formatPrefix,qc}function Rq(e){return Math.max(0,-is(Math.abs(e)))}function Iq(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(is(t)/3)))*3-is(Math.abs(e)))}function Mq(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,is(t)-is(e))+1}function pP(e,t,r,n){var i=Gy(e,t,r),a;switch(n=Au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Iq(i,o))&&(n.precision=a),dP(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Mq(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Rq(i))&&(n.precision=a-(n.type==="%")*2);break}}return Mx(n)}function aa(e){var t=e.domain;return e.ticks=function(r){var n=t();return Wy(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return pP(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,f=10;for(s0;){if(u=Hy(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function _d(){var e=Rx();return e.copy=function(){return pc(e,_d())},rn.apply(e,arguments),aa(e)}function hP(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,xd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return hP(e).unknown(t)},e=arguments.length?Array.from(e,xd):[0,1],aa(r)}function mP(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function zq(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function cS(e){return(t,r)=>-e(-t,r)}function Dx(e){const t=e(lS,uS),r=t.domain;let n=10,i,a;function o(){return i=zq(n),a=Fq(n),r()[0]<0?(i=cS(i),a=cS(a),e(Dq,Lq)):e(lS,uS),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const c=f0){for(;p<=h;++p)for(b=1;bf)break;y.push(v)}}else for(;p<=h;++p)for(b=n-1;b>=1;--b)if(v=p>0?b/a(-p):b*a(p),!(vf)break;y.push(v)}y.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Au(l)).precision==null&&(l.trim=!0),l=Mx(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let c=f/a(Math.round(i(f)));return c*nr(mP(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function vP(){const e=Dx(Zp()).domain([1,10]);return e.copy=()=>pc(e,vP()).base(e.base()),rn.apply(e,arguments),e}function fS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function dS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Lx(e){var t=1,r=e(fS(t),dS(t));return r.constant=function(n){return arguments.length?e(fS(t=+n),dS(t)):t},aa(r)}function yP(){var e=Lx(Zp());return e.copy=function(){return pc(e,yP()).constant(e.constant())},rn.apply(e,arguments)}function pS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Uq(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Vq(e){return e<0?-e*e:e*e}function Bx(e){var t=e(lr,lr),r=1;function n(){return r===1?e(lr,lr):r===.5?e(Uq,Vq):e(pS(r),pS(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},aa(t)}function Fx(){var e=Bx(Zp());return e.copy=function(){return pc(e,Fx()).exponent(e.exponent())},rn.apply(e,arguments),e}function Wq(){return Fx.apply(null,arguments).exponent(.5)}function hS(e){return Math.sign(e)*e*e}function Hq(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function gP(){var e=Rx(),t=[0,1],r=!1,n;function i(a){var o=Hq(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(hS(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,xd)).map(hS)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return gP(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},rn.apply(i,arguments),aa(i)}function xP(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return bP().domain([e,t]).range(i).unknown(a)},rn.apply(aa(o),arguments)}function wP(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[fc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return wP().domain(e).range(t).unknown(r)},rn.apply(i,arguments)}const Mm=new Date,Dm=new Date;function Rt(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uRt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Mm.setTime(+a),Dm.setTime(+o),e(Mm),e(Dm),Math.floor(r(Mm,Dm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Sd=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Sd.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Sd);Sd.range;const qn=1e3,qr=qn*60,Xn=qr*60,oi=Xn*24,zx=oi*7,mS=oi*30,Lm=oi*365,Oa=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*qn)},(e,t)=>(t-e)/qn,e=>e.getUTCSeconds());Oa.range;const Ux=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qn)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getMinutes());Ux.range;const Vx=Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getUTCMinutes());Vx.range;const Wx=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qn-e.getMinutes()*qr)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getHours());Wx.range;const Hx=Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getUTCHours());Hx.range;const hc=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qr)/oi,e=>e.getDate()-1);hc.range;const Qp=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/oi,e=>e.getUTCDate()-1);Qp.range;const _P=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/oi,e=>Math.floor(e/oi));_P.range;function Xa(e){return Rt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*qr)/zx)}const Jp=Xa(0),Od=Xa(1),Gq=Xa(2),Kq=Xa(3),as=Xa(4),qq=Xa(5),Xq=Xa(6);Jp.range;Od.range;Gq.range;Kq.range;as.range;qq.range;Xq.range;function Ya(e){return Rt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/zx)}const eh=Ya(0),jd=Ya(1),Yq=Ya(2),Zq=Ya(3),os=Ya(4),Qq=Ya(5),Jq=Ya(6);eh.range;jd.range;Yq.range;Zq.range;os.range;Qq.range;Jq.range;const Gx=Rt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Gx.range;const Kx=Rt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Kx.range;const si=Rt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});si.range;const li=Rt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());li.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});li.range;function SP(e,t,r,n,i,a){const o=[[Oa,1,qn],[Oa,5,5*qn],[Oa,15,15*qn],[Oa,30,30*qn],[a,1,qr],[a,5,5*qr],[a,15,15*qr],[a,30,30*qr],[i,1,Xn],[i,3,3*Xn],[i,6,6*Xn],[i,12,12*Xn],[n,1,oi],[n,2,2*oi],[r,1,zx],[t,1,mS],[t,3,3*mS],[e,1,Lm]];function s(u,f,c){const p=fg).right(o,p);if(h===o.length)return e.every(Gy(u/Lm,f/Lm,c));if(h===0)return Sd.every(Math.max(Gy(u,f,c),1));const[b,v]=o[p/o[h-1][2]53)return null;"w"in k||(k.w=1),"Z"in k?(K=Fm(sl(k.y,0,1)),me=K.getUTCDay(),K=me>4||me===0?jd.ceil(K):jd(K),K=Qp.offset(K,(k.V-1)*7),k.y=K.getUTCFullYear(),k.m=K.getUTCMonth(),k.d=K.getUTCDate()+(k.w+6)%7):(K=Bm(sl(k.y,0,1)),me=K.getDay(),K=me>4||me===0?Od.ceil(K):Od(K),K=hc.offset(K,(k.V-1)*7),k.y=K.getFullYear(),k.m=K.getMonth(),k.d=K.getDate()+(k.w+6)%7)}else("W"in k||"U"in k)&&("w"in k||(k.w="u"in k?k.u%7:"W"in k?1:0),me="Z"in k?Fm(sl(k.y,0,1)).getUTCDay():Bm(sl(k.y,0,1)).getDay(),k.m=0,k.d="W"in k?(k.w+6)%7+k.W*7-(me+5)%7:k.w+k.U*7-(me+6)%7);return"Z"in k?(k.H+=k.Z/100|0,k.M+=k.Z%100,Fm(k)):Bm(k)}}function A(Z,ne,pe,k){for(var H=0,K=ne.length,me=pe.length,_e,de;H=me)return-1;if(_e=ne.charCodeAt(H++),_e===37){if(_e=ne.charAt(H++),de=x[_e in vS?ne.charAt(H++):_e],!de||(k=de(Z,pe,k))<0)return-1}else if(_e!=pe.charCodeAt(k++))return-1}return k}function E(Z,ne,pe){var k=u.exec(ne.slice(pe));return k?(Z.p=f.get(k[0].toLowerCase()),pe+k[0].length):-1}function $(Z,ne,pe){var k=h.exec(ne.slice(pe));return k?(Z.w=b.get(k[0].toLowerCase()),pe+k[0].length):-1}function N(Z,ne,pe){var k=c.exec(ne.slice(pe));return k?(Z.w=p.get(k[0].toLowerCase()),pe+k[0].length):-1}function P(Z,ne,pe){var k=y.exec(ne.slice(pe));return k?(Z.m=m.get(k[0].toLowerCase()),pe+k[0].length):-1}function I(Z,ne,pe){var k=v.exec(ne.slice(pe));return k?(Z.m=g.get(k[0].toLowerCase()),pe+k[0].length):-1}function D(Z,ne,pe){return A(Z,t,ne,pe)}function B(Z,ne,pe){return A(Z,r,ne,pe)}function V(Z,ne,pe){return A(Z,n,ne,pe)}function U(Z){return o[Z.getDay()]}function R(Z){return a[Z.getDay()]}function F(Z){return l[Z.getMonth()]}function L(Z){return s[Z.getMonth()]}function q(Z){return i[+(Z.getHours()>=12)]}function W(Z){return 1+~~(Z.getMonth()/3)}function Y(Z){return o[Z.getUTCDay()]}function he(Z){return a[Z.getUTCDay()]}function Ae(Z){return l[Z.getUTCMonth()]}function xe(Z){return s[Z.getUTCMonth()]}function We(Z){return i[+(Z.getUTCHours()>=12)]}function Me(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var ne=_(Z+="",w);return ne.toString=function(){return Z},ne},parse:function(Z){var ne=O(Z+="",!1);return ne.toString=function(){return Z},ne},utcFormat:function(Z){var ne=_(Z+="",S);return ne.toString=function(){return Z},ne},utcParse:function(Z){var ne=O(Z+="",!0);return ne.toString=function(){return Z},ne}}}var vS={"-":"",_:" ",0:"0"},Ft=/^\s*\d+/,aX=/^%/,oX=/[\\^$*+?|[\]().{}]/g;function Fe(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function lX(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function uX(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function cX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function fX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function dX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function yS(e,t,r){var n=Ft.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function gS(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function pX(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function hX(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function mX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function xS(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function vX(e,t,r){var n=Ft.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function bS(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function yX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function gX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function xX(e,t,r){var n=Ft.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function bX(e,t,r){var n=Ft.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function wX(e,t,r){var n=aX.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function _X(e,t,r){var n=Ft.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function SX(e,t,r){var n=Ft.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function wS(e,t){return Fe(e.getDate(),t,2)}function OX(e,t){return Fe(e.getHours(),t,2)}function jX(e,t){return Fe(e.getHours()%12||12,t,2)}function AX(e,t){return Fe(1+hc.count(si(e),e),t,3)}function OP(e,t){return Fe(e.getMilliseconds(),t,3)}function EX(e,t){return OP(e,t)+"000"}function kX(e,t){return Fe(e.getMonth()+1,t,2)}function PX(e,t){return Fe(e.getMinutes(),t,2)}function CX(e,t){return Fe(e.getSeconds(),t,2)}function TX(e){var t=e.getDay();return t===0?7:t}function NX(e,t){return Fe(Jp.count(si(e)-1,e),t,2)}function jP(e){var t=e.getDay();return t>=4||t===0?as(e):as.ceil(e)}function $X(e,t){return e=jP(e),Fe(as.count(si(e),e)+(si(e).getDay()===4),t,2)}function RX(e){return e.getDay()}function IX(e,t){return Fe(Od.count(si(e)-1,e),t,2)}function MX(e,t){return Fe(e.getFullYear()%100,t,2)}function DX(e,t){return e=jP(e),Fe(e.getFullYear()%100,t,2)}function LX(e,t){return Fe(e.getFullYear()%1e4,t,4)}function BX(e,t){var r=e.getDay();return e=r>=4||r===0?as(e):as.ceil(e),Fe(e.getFullYear()%1e4,t,4)}function FX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Fe(t/60|0,"0",2)+Fe(t%60,"0",2)}function _S(e,t){return Fe(e.getUTCDate(),t,2)}function zX(e,t){return Fe(e.getUTCHours(),t,2)}function UX(e,t){return Fe(e.getUTCHours()%12||12,t,2)}function VX(e,t){return Fe(1+Qp.count(li(e),e),t,3)}function AP(e,t){return Fe(e.getUTCMilliseconds(),t,3)}function WX(e,t){return AP(e,t)+"000"}function HX(e,t){return Fe(e.getUTCMonth()+1,t,2)}function GX(e,t){return Fe(e.getUTCMinutes(),t,2)}function KX(e,t){return Fe(e.getUTCSeconds(),t,2)}function qX(e){var t=e.getUTCDay();return t===0?7:t}function XX(e,t){return Fe(eh.count(li(e)-1,e),t,2)}function EP(e){var t=e.getUTCDay();return t>=4||t===0?os(e):os.ceil(e)}function YX(e,t){return e=EP(e),Fe(os.count(li(e),e)+(li(e).getUTCDay()===4),t,2)}function ZX(e){return e.getUTCDay()}function QX(e,t){return Fe(jd.count(li(e)-1,e),t,2)}function JX(e,t){return Fe(e.getUTCFullYear()%100,t,2)}function eY(e,t){return e=EP(e),Fe(e.getUTCFullYear()%100,t,2)}function tY(e,t){return Fe(e.getUTCFullYear()%1e4,t,4)}function rY(e,t){var r=e.getUTCDay();return e=r>=4||r===0?os(e):os.ceil(e),Fe(e.getUTCFullYear()%1e4,t,4)}function nY(){return"+0000"}function SS(){return"%"}function OS(e){return+e}function jS(e){return Math.floor(+e/1e3)}var io,kP,PP;iY({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function iY(e){return io=iX(e),kP=io.format,io.parse,PP=io.utcFormat,io.utcParse,io}function aY(e){return new Date(e)}function oY(e){return e instanceof Date?+e:+new Date(+e)}function qx(e,t,r,n,i,a,o,s,l,u){var f=Rx(),c=f.invert,p=f.domain,h=u(".%L"),b=u(":%S"),v=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),m=u("%b %d"),w=u("%B"),S=u("%Y");function x(_){return(l(_)<_?h:s(_)<_?b:o(_)<_?v:a(_)<_?g:n(_)<_?i(_)<_?y:m:r(_)<_?w:S)(_)}return f.invert=function(_){return new Date(c(_))},f.domain=function(_){return arguments.length?p(Array.from(_,oY)):p().map(aY)},f.ticks=function(_){var O=p();return e(O[0],O[O.length-1],_??10)},f.tickFormat=function(_,O){return O==null?x:u(O)},f.nice=function(_){var O=p();return(!_||typeof _.range!="function")&&(_=t(O[0],O[O.length-1],_??10)),_?p(mP(O,_)):f},f.copy=function(){return pc(f,qx(e,t,r,n,i,a,o,s,l,u))},f}function sY(){return rn.apply(qx(rX,nX,si,Gx,Jp,hc,Wx,Ux,Oa,kP).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function lY(){return rn.apply(qx(eX,tX,li,Kx,eh,Qp,Hx,Vx,Oa,PP).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function th(){var e=0,t=1,r,n,i,a,o=lr,s=!1,l;function u(c){return c==null||isNaN(c=+c)?l:o(i===0?.5:(c=(a(c)-r)*i,s?Math.max(0,Math.min(1,c)):c))}u.domain=function(c){return arguments.length?([e,t]=c,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(c){return arguments.length?(s=!!c,u):s},u.interpolator=function(c){return arguments.length?(o=c,u):o};function f(c){return function(p){var h,b;return arguments.length?([h,b]=p,o=c(h,b),u):[o(0),o(1)]}}return u.range=f(zs),u.rangeRound=f($x),u.unknown=function(c){return arguments.length?(l=c,u):l},function(c){return a=c,r=c(e),n=c(t),i=r===n?0:1/(n-r),u}}function oa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function CP(){var e=aa(th()(lr));return e.copy=function(){return oa(e,CP())},mi.apply(e,arguments)}function TP(){var e=Dx(th()).domain([1,10]);return e.copy=function(){return oa(e,TP()).base(e.base())},mi.apply(e,arguments)}function NP(){var e=Lx(th());return e.copy=function(){return oa(e,NP()).constant(e.constant())},mi.apply(e,arguments)}function Xx(){var e=Bx(th());return e.copy=function(){return oa(e,Xx()).exponent(e.exponent())},mi.apply(e,arguments)}function uY(){return Xx.apply(null,arguments).exponent(.5)}function $P(){var e=[],t=lr;function r(n){if(n!=null&&!isNaN(n=+n))return t((fc(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Wi),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>XK(e,a/n))},r.copy=function(){return $P(t).domain(e)},mi.apply(r,arguments)}function rh(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=lr,f,c=!1,p;function h(v){return isNaN(v=+v)?p:(v=.5+((v=+f(v))-a)*(n*vt}var DP=pY,hY=nh,mY=DP,vY=Bs;function yY(e){return e&&e.length?hY(e,vY,mY):void 0}var gY=yY;const ih=Ke(gY);function xY(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};le.decimalPlaces=le.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*lt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};le.dividedBy=le.div=function(e){return Jn(this,new this.constructor(e))};le.dividedToIntegerBy=le.idiv=function(e){var t=this,r=t.constructor;return Je(Jn(t,new r(e),0,1),r.precision)};le.equals=le.eq=function(e){return!this.cmp(e)};le.exponent=function(){return Et(this)};le.greaterThan=le.gt=function(e){return this.cmp(e)>0};le.greaterThanOrEqualTo=le.gte=function(e){return this.cmp(e)>=0};le.isInteger=le.isint=function(){return this.e>this.d.length-2};le.isNegative=le.isneg=function(){return this.s<0};le.isPositive=le.ispos=function(){return this.s>0};le.isZero=function(){return this.s===0};le.lessThan=le.lt=function(e){return this.cmp(e)<0};le.lessThanOrEqualTo=le.lte=function(e){return this.cmp(e)<1};le.logarithm=le.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Cr))throw Error(Jr+"NaN");if(r.s<1)throw Error(Jr+(r.s?"NaN":"-Infinity"));return r.eq(Cr)?new n(0):(dt=!1,t=Jn(Eu(r,a),Eu(e,a),a),dt=!0,Je(t,i))};le.minus=le.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?UP(t,e):FP(t,(e.s=-e.s,e))};le.modulo=le.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Jr+"NaN");return r.s?(dt=!1,t=Jn(r,e,0,1).times(e),dt=!0,r.minus(t)):Je(new n(r),i)};le.naturalExponential=le.exp=function(){return zP(this)};le.naturalLogarithm=le.ln=function(){return Eu(this)};le.negated=le.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};le.plus=le.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?FP(t,e):UP(t,(e.s=-e.s,e))};le.precision=le.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ta+e);if(t=Et(i)+1,n=i.d.length-1,r=n*lt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};le.squareRoot=le.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Jr+"NaN")}for(e=Et(s),dt=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=kn(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Vs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Jn(s,a,o+2)).times(.5),kn(a.d).slice(0,o)===(t=kn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Je(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return dt=!0,Je(n,r)};le.times=le.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,c=f.constructor,p=f.d,h=(e=new c(e)).d;if(!f.s||!e.s)return new c(0);for(e.s*=f.s,r=f.e+e.e,l=p.length,u=h.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+h[n]*p[i-n-1]+t,a[i--]=s%It|0,t=s/It|0;a[i]=(a[i]+t)%It|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,dt?Je(e,c.precision):e};le.toDecimalPlaces=le.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(In(e,0,Us),t===void 0?t=n.rounding:In(t,0,8),Je(r,e+Et(r)+1,t))};le.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Wa(n,!0):(In(e,0,Us),t===void 0?t=i.rounding:In(t,0,8),n=Je(new i(n),e+1,t),r=Wa(n,!0,e+1)),r};le.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Wa(i):(In(e,0,Us),t===void 0?t=a.rounding:In(t,0,8),n=Je(new a(i),e+Et(i)+1,t),r=Wa(n.abs(),!1,e+Et(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};le.toInteger=le.toint=function(){var e=this,t=e.constructor;return Je(new t(e),Et(e)+1,t.rounding)};le.toNumber=function(){return+this};le.toPower=le.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(Cr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Jr+"Infinity");return s}if(s.eq(Cr))return s;if(n=l.precision,e.eq(Cr))return Je(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=BP){for(i=new l(Cr),t=Math.ceil(n/lt+4),dt=!1;r%2&&(i=i.times(s),kS(i.d,t)),r=Vs(r/2),r!==0;)s=s.times(s),kS(s.d,t);return dt=!0,e.s<0?new l(Cr).div(i):Je(i,n)}}else if(a<0)throw Error(Jr+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,dt=!1,i=e.times(Eu(s,n+u)),dt=!0,i=zP(i),i.s=a,i};le.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Et(i),n=Wa(i,r<=a.toExpNeg||r>=a.toExpPos)):(In(e,1,Us),t===void 0?t=a.rounding:In(t,0,8),i=Je(new a(i),e,t),r=Et(i),n=Wa(i,e<=r||r<=a.toExpNeg,e)),n};le.toSignificantDigits=le.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(In(e,1,Us),t===void 0?t=n.rounding:In(t,0,8)),Je(new n(r),e,t)};le.toString=le.valueOf=le.val=le.toJSON=le[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Et(e),r=e.constructor;return Wa(e,t<=r.toExpNeg||t>=r.toExpPos)};function FP(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,c=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),dt?Je(t,c):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(c/lt),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/It|0,l[a]%=It;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,dt?Je(t,c):t}function In(e,t,r){if(e!==~~e||er)throw Error(Ta+e)}function kn(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,f,c,p,h,b,v,g,y,m,w,S,x,_,O,A,E=n.constructor,$=n.s==i.s?1:-1,N=n.d,P=i.d;if(!n.s)return new E(n);if(!i.s)throw Error(Jr+"Division by zero");for(l=n.e-i.e,O=P.length,x=N.length,h=new E($),b=h.d=[],u=0;P[u]==(N[u]||0);)++u;if(P[u]>(N[u]||0)&&--l,a==null?m=a=E.precision:o?m=a+(Et(n)-Et(i))+1:m=a,m<0)return new E(0);if(m=m/lt+2|0,u=0,O==1)for(f=0,P=P[0],m++;(u1&&(P=e(P,f),N=e(N,f),O=P.length,x=N.length),S=O,v=N.slice(0,O),g=v.length;g=It/2&&++_;do f=0,s=t(P,v,O,g),s<0?(y=v[0],O!=g&&(y=y*It+(v[1]||0)),f=y/_|0,f>1?(f>=It&&(f=It-1),c=e(P,f),p=c.length,g=v.length,s=t(c,v,p,g),s==1&&(f--,r(c,O16)throw Error(Zx+Et(e));if(!e.s)return new f(Cr);for(dt=!1,s=c,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(va(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(Cr),f.precision=s;;){if(i=Je(i.times(e),s),r=r.times(++l),o=a.plus(Jn(i,r,s)),kn(o.d).slice(0,s)===kn(a.d).slice(0,s)){for(;u--;)a=Je(a.times(a),s);return f.precision=c,t==null?(dt=!0,Je(a,c)):a}a=o}}function Et(e){for(var t=e.e*lt,r=e.d[0];r>=10;r/=10)t++;return t}function zm(e,t,r){if(t>e.LN10.sd())throw dt=!0,r&&(e.precision=r),Error(Jr+"LN10 precision limit exceeded");return Je(new e(e.LN10),t)}function Ai(e){for(var t="";e--;)t+="0";return t}function Eu(e,t){var r,n,i,a,o,s,l,u,f,c=1,p=10,h=e,b=h.d,v=h.constructor,g=v.precision;if(h.s<1)throw Error(Jr+(h.s?"NaN":"-Infinity"));if(h.eq(Cr))return new v(0);if(t==null?(dt=!1,u=g):u=t,h.eq(10))return t==null&&(dt=!0),zm(v,u);if(u+=p,v.precision=u,r=kn(b),n=r.charAt(0),a=Et(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=kn(h.d),n=r.charAt(0),c++;a=Et(h),n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=zm(v,u+2,g).times(a+""),h=Eu(new v(n+"."+r.slice(1)),u-p).plus(l),v.precision=g,t==null?(dt=!0,Je(h,g)):h;for(s=o=h=Jn(h.minus(Cr),h.plus(Cr),u),f=Je(h.times(h),u),i=3;;){if(o=Je(o.times(f),u),l=s.plus(Jn(o,new v(i),u)),kn(l.d).slice(0,u)===kn(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(zm(v,u+2,g).times(a+""))),s=Jn(s,new v(c),u),v.precision=g,t==null?(dt=!0,Je(s,g)):s;s=l,i+=2}}function ES(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Vs(r/lt),e.d=[],n=(r+1)%lt,r<0&&(n+=lt),nAd||e.e<-Ad))throw Error(Zx+r)}else e.s=0,e.e=0,e.d=[0];return e}function Je(e,t,r){var n,i,a,o,s,l,u,f,c=e.d;for(o=1,a=c[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=lt,i=t,u=c[f=0];else{if(f=Math.ceil((n+1)/lt),a=c.length,f>=a)return e;for(u=a=c[f],o=1;a>=10;a/=10)o++;n%=lt,i=n-lt+o}if(r!==void 0&&(a=va(10,o-i-1),s=u/a%10|0,l=t<0||c[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/va(10,o-i):0:c[f-1])%10&1||r==(e.s<0?8:7))),t<1||!c[0])return l?(a=Et(e),c.length=1,t=t-a-1,c[0]=va(10,(lt-t%lt)%lt),e.e=Vs(-t/lt)||0):(c.length=1,c[0]=e.e=e.s=0),e;if(n==0?(c.length=f,a=1,f--):(c.length=f+1,a=va(10,lt-n),c[f]=i>0?(u/va(10,o-i)%va(10,i)|0)*a:0),l)for(;;)if(f==0){(c[0]+=a)==It&&(c[0]=1,++e.e);break}else{if(c[f]+=a,c[f]!=It)break;c[f--]=0,a=1}for(n=c.length;c[--n]===0;)c.pop();if(dt&&(e.e>Ad||e.e<-Ad))throw Error(Zx+Et(e));return e}function UP(e,t){var r,n,i,a,o,s,l,u,f,c,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),dt?Je(t,h):t;if(l=e.d,c=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=c.length):(r=c,n=u,s=l.length),i=Math.max(Math.ceil(h/lt),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=c.length,f=i0;--i)l[s++]=0;for(i=c.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Ai(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ai(-i-1)+a,r&&(n=r-o)>0&&(a+=Ai(n))):i>=o?(a+=Ai(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Ai(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Ai(n))),e.s<0?"-"+a:a}function kS(e,t){if(e.length>t)return e.length=t,!0}function VP(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ta+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return ES(o,a.toString())}else if(typeof a!="string")throw Error(Ta+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,FY.test(a))ES(o,a);else throw Error(Ta+a)}if(i.prototype=le,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=VP,i.config=i.set=zY,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Ta+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ta+r+": "+n);return this}var Qx=VP(BY);Cr=new Qx(1);const Xe=Qx;function UY(e){return GY(e)||HY(e)||WY(e)||VY()}function VY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WY(e,t){if(e){if(typeof e=="string")return Zy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zy(e,t)}}function HY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function GY(e){if(Array.isArray(e))return Zy(e)}function Zy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,PS(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function sZ(e){if(Array.isArray(e))return e}function qP(e){var t=ku(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function XP(e,t,r){if(e.lte(0))return new Xe(0);var n=lh.getDigitCount(e.toNumber()),i=new Xe(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Xe(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Xe(Math.ceil(l))}function lZ(e,t,r){var n=1,i=new Xe(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Xe(10).pow(lh.getDigitCount(e)-1),i=new Xe(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Xe(Math.floor(e)))}else e===0?i=new Xe(Math.floor((t-1)/2)):r||(i=new Xe(Math.floor(e)));var o=Math.floor((t-1)/2),s=YY(XY(function(l){return i.add(new Xe(l-o).mul(n)).toNumber()}),Qy);return s(0,t)}function YP(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Xe(0),tickMin:new Xe(0),tickMax:new Xe(0)};var a=XP(new Xe(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Xe(0):(o=new Xe(e).add(t).div(2),o=o.sub(new Xe(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Xe(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?YP(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Xe(s).mul(a)),tickMax:o.add(new Xe(l).mul(a))})}function uZ(e){var t=ku(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=qP([r,n]),l=ku(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var c=f===1/0?[u].concat(eg(Qy(0,i-1).map(function(){return 1/0}))):[].concat(eg(Qy(0,i-1).map(function(){return-1/0})),[f]);return r>n?Jy(c):c}if(u===f)return lZ(u,i,a);var p=YP(u,f,o,a),h=p.step,b=p.tickMin,v=p.tickMax,g=lh.rangeStep(b,v.add(new Xe(.1).mul(h)),h);return r>n?Jy(g):g}function cZ(e,t){var r=ku(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=qP([n,i]),s=ku(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),c=XP(new Xe(u).sub(l).div(f-1),a,0),p=[].concat(eg(lh.rangeStep(new Xe(l),new Xe(u).sub(new Xe(.99).mul(c)),c)),[u]);return n>i?Jy(p):p}var fZ=GP(uZ),dZ=GP(cZ),pZ="Invariant failed";function Ha(e,t){throw new Error(pZ)}var hZ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ss(e){"@babel/helpers - typeof";return ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ss(e)}function Ed(){return Ed=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SZ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,c=i[u].coordinate,p=u>=s-1?i[0].coordinate:i[u+1].coordinate,h=void 0;if(or(c-f)!==or(p-c)){var b=[];if(or(p-c)===or(l[1]-l[0])){h=p;var v=c+l[1]-l[0];b[0]=Math.min(v,(v+f)/2),b[1]=Math.max(v,(v+f)/2)}else{h=f;var g=p+l[1]-l[0];b[0]=Math.min(c,(g+c)/2),b[1]=Math.max(c,(g+c)/2)}var y=[Math.min(c,(h+c)/2),Math.max(c,(h+c)/2)];if(t>y[0]&&t<=y[1]||t>=b[0]&&t<=b[1]){o=i[u].index;break}}else{var m=Math.min(f,p),w=Math.max(f,p);if(t>(m+c)/2&&t<=(w+c)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},Jx=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?xt(xt({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},FZ=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(y&&y.length){var m=y[0].type.defaultProps,w=m!==void 0?xt(xt({},m),y[0].props):y[0].props,S=w.barSize,x=w[g];o[x]||(o[x]=[]);var _=Ce(S)?r:S;o[x].push({item:y[0],stackList:y.slice(1),barSize:Ce(_)?void 0:sr(_,n,0)})}}return o},zZ=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=sr(r,i,0,!0),f,c=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=i/l,b=o.reduce(function(S,x){return S+x.barSize||0},0);b+=(l-1)*u,b>=i&&(b-=(l-1)*u,u=0),b>=i&&h>0&&(p=!0,h*=.9,b=l*h);var v=(i-b)/2>>0,g={offset:v-u,size:0};f=o.reduce(function(S,x){var _={item:x.item,position:{offset:g.offset+g.size+u,size:p?h:x.barSize}},O=[].concat(NS(S),[_]);return g=O[O.length-1].position,x.stackList&&x.stackList.length&&x.stackList.forEach(function(A){O.push({item:A,position:g})}),O},c)}else{var y=sr(n,i,0,!0);i-2*y-(l-1)*u<=0&&(u=0);var m=(i-2*y-(l-1)*u)/l;m>1&&(m>>=0);var w=s===+s?Math.min(m,s):m;f=o.reduce(function(S,x,_){var O=[].concat(NS(S),[{item:x.item,position:{offset:y+(m+u)*_+(m-w)/2,size:w}}]);return x.stackList&&x.stackList.length&&x.stackList.forEach(function(A){O.push({item:A,position:O[O.length-1].position})}),O},c)}return f},UZ=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=eC({children:a,legendWidth:l});if(u){var f=i||{},c=f.width,p=f.height,h=u.align,b=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&b==="middle")&&h!=="center"&&ie(t[h]))return xt(xt({},t),{},Lo({},h,t[h]+(c||0)));if((v==="horizontal"||v==="vertical"&&h==="center")&&b!=="middle"&&ie(t[b]))return xt(xt({},t),{},Lo({},b,t[b]+(p||0)))}return t},VZ=function(t,r,n){return Ce(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},tC=function(t,r,n,i,a){var o=r.props.children,s=Yr(o,uh).filter(function(u){return VZ(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var c=rr(f,n);if(Ce(c))return u;var p=Array.isArray(c)?[ah(c),ih(c)]:[c,c],h=l.reduce(function(b,v){var g=rr(f,v,0),y=p[0]-Math.abs(Array.isArray(g)?g[0]:g),m=p[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(y,b[0]),Math.max(m,b[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},WZ=function(t,r,n,i,a){var o=r.map(function(s){return tC(t,s,n,a,i)}).filter(function(s){return!Ce(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},rC=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&tC(t,l,u,i)||Fl(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,c=u.length;f=2?or(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(c){var p=a?a.indexOf(c):c;return{coordinate:i(p)+u,value:c,offset:u}});return f.filter(function(c){return!uc(c.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(c,p){return{coordinate:i(c)+u,value:c,index:p,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(c){return{coordinate:i(c)+u,value:c,offset:u}}):i.domain().map(function(c,p){return{coordinate:i(c)+u,value:a?a[c]:c,index:p,offset:u}})},Um=new WeakMap,Xc=function(t,r){if(typeof r!="function")return t;Um.has(t)||Um.set(t,new WeakMap);var n=Um.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},iC=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:_u(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:_d(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Bl(),realScaleType:"point"}:a==="category"?{scale:_u(),realScaleType:"band"}:{scale:_d(),realScaleType:"linear"};if(za(i)){var l="scale".concat(Wp(i));return{scale:(AS[l]||Bl)(),realScaleType:AS[l]?l:"point"}}return Oe(i)?{scale:i}:{scale:Bl(),realScaleType:"point"}},RS=1e-4,aC=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-RS,o=Math.max(i[0],i[1])+RS,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},HZ=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},qZ=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},XZ={sign:KZ,expand:pz,none:Jo,silhouette:hz,wiggle:mz,positive:qZ},YZ=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=XZ[n],o=dz().keys(i).value(function(s,l){return+rr(s,l,0)}).order(ky).offset(a);return o(t)},ZZ=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(c,p){var h,b=(h=p.type)!==null&&h!==void 0&&h.defaultProps?xt(xt({},p.type.defaultProps),p.props):p.props,v=b.stackId,g=b.hide;if(g)return c;var y=b[n],m=c[y]||{hasStack:!1,stackGroups:{}};if($t(v)){var w=m.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(p),m.hasStack=!0,m.stackGroups[v]=w}else m.stackGroups[cc("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[p]};return xt(xt({},c),{},Lo({},y,m))},l),f={};return Object.keys(u).reduce(function(c,p){var h=u[p];if(h.hasStack){var b={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(v,g){var y=h.stackGroups[g];return xt(xt({},v),{},Lo({},g,{numericAxisId:n,cateAxisId:i,items:y.items,stackedData:YZ(t,y.items,a)}))},b)}return xt(xt({},c),{},Lo({},p,h))},f)},oC=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=fZ(u,a,s);return t.domain([ah(f),ih(f)]),{niceTicks:f}}if(a&&i==="number"){var c=t.domain(),p=dZ(c,a,s);return{niceTicks:p}}return null},IS=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=rr(o,r.dataKey,r.domain[s]);return Ce(l)?null:r.scale(l)-a/2+i},QZ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},JZ=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?xt(xt({},t.type.defaultProps),t.props):t.props,a=i.stackId;if($t(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},eQ=function(t){return t.reduce(function(r,n){return[ah(n.concat([r[0]]).filter(ie)),ih(n.concat([r[1]]).filter(ie))]},[1/0,-1/0])},sC=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var c=eQ(f.slice(r,n+1));return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},MS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,DS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ig=function(t,r,n){if(Oe(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(ie(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(MS.test(t[0])){var a=+MS.exec(t[0])[1];i[0]=r[0]-a}else Oe(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(ie(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(DS.test(t[1])){var o=+DS.exec(t[1])[1];i[1]=r[1]+o}else Oe(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Pd=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Ex(r,function(c){return c.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},uQ=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=sr(t.cx,o,o/2),c=sr(t.cy,s,s/2),p=cC(o,s,n),h=sr(t.innerRadius,p,0),b=sr(t.outerRadius,p,p*.8),v=Object.keys(r);return v.reduce(function(g,y){var m=r[y],w=m.domain,S=m.reversed,x;if(Ce(m.range))i==="angleAxis"?x=[l,u]:i==="radiusAxis"&&(x=[h,b]),S&&(x=[x[1],x[0]]);else{x=m.range;var _=x,O=nQ(_,2);l=O[0],u=O[1]}var A=iC(m,a),E=A.realScaleType,$=A.scale;$.domain(w).range(x),aC($);var N=oC($,zn(zn({},m),{},{realScaleType:E})),P=zn(zn(zn({},m),N),{},{range:x,radius:b,realScaleType:E,scale:$,cx:f,cy:c,innerRadius:h,outerRadius:b,startAngle:l,endAngle:u});return zn(zn({},g),{},uC({},y,P))},{})},cQ=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},fQ=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=cQ({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:lQ(u),angleInRadian:u}},dQ=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},pQ=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},zS=function(t,r){var n=t.x,i=t.y,a=fQ({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=dQ(r),c=f.startAngle,p=f.endAngle,h=s,b;if(c<=p){for(;h>p;)h-=360;for(;h=c&&h<=p}else{for(;h>c;)h-=360;for(;h=p&&h<=c}return b?zn(zn({},r),{},{radius:o,angle:pQ(h,r)}):null},fC=function(t){return!j.isValidElement(t)&&!Oe(t)&&typeof t!="boolean"?t.className:""};function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var hQ=["offset"];function mQ(e){return xQ(e)||gQ(e)||yQ(e)||vQ()}function vQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yQ(e,t){if(e){if(typeof e=="string")return ag(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ag(e,t)}}function gQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xQ(e){if(Array.isArray(e))return ag(e)}function ag(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function US(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pt(e){for(var t=1;t=0?1:-1,w,S;i==="insideStart"?(w=h+m*o,S=v):i==="insideEnd"?(w=b-m*o,S=!v):i==="end"&&(w=b+m*o,S=v),S=y<=0?S:!S;var x=it(u,f,g,w),_=it(u,f,g,w+(S?1:-1)*359),O="M".concat(x.x,",").concat(x.y,` + A`).concat(g,",").concat(g,",0,1,").concat(S?0:1,`, + `).concat(_.x,",").concat(_.y),A=Ce(t.id)?cc("recharts-radial-line-"):t.id;return T.createElement("text",$u({},n,{dominantBaseline:"central",className:Ee("recharts-radial-bar-label",s)}),T.createElement("defs",null,T.createElement("path",{id:A,d:O})),T.createElement("textPath",{xlinkHref:"#".concat(A)},r))},kQ=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,f=a.startAngle,c=a.endAngle,p=(f+c)/2;if(i==="outside"){var h=it(o,s,u+n,p),b=h.x,v=h.y;return{x:b,y:v,textAnchor:b>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+u)/2,y=it(o,s,g,p),m=y.x,w=y.y;return{x:m,y:w,textAnchor:"middle",verticalAnchor:"middle"}},PQ=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,c=f>=0?1:-1,p=c*i,h=c>0?"end":"start",b=c>0?"start":"end",v=u>=0?1:-1,g=v*i,y=v>0?"end":"start",m=v>0?"start":"end";if(a==="top"){var w={x:s+u/2,y:l-c*i,textAnchor:"middle",verticalAnchor:h};return Pt(Pt({},w),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+f+p,textAnchor:"middle",verticalAnchor:b};return Pt(Pt({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var x={x:s-g,y:l+f/2,textAnchor:y,verticalAnchor:"middle"};return Pt(Pt({},x),n?{width:Math.max(x.x-n.x,0),height:f}:{})}if(a==="right"){var _={x:s+u+g,y:l+f/2,textAnchor:m,verticalAnchor:"middle"};return Pt(Pt({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return a==="insideLeft"?Pt({x:s+g,y:l+f/2,textAnchor:m,verticalAnchor:"middle"},O):a==="insideRight"?Pt({x:s+u-g,y:l+f/2,textAnchor:y,verticalAnchor:"middle"},O):a==="insideTop"?Pt({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:b},O):a==="insideBottom"?Pt({x:s+u/2,y:l+f-p,textAnchor:"middle",verticalAnchor:h},O):a==="insideTopLeft"?Pt({x:s+g,y:l+p,textAnchor:m,verticalAnchor:b},O):a==="insideTopRight"?Pt({x:s+u-g,y:l+p,textAnchor:y,verticalAnchor:b},O):a==="insideBottomLeft"?Pt({x:s+g,y:l+f-p,textAnchor:m,verticalAnchor:h},O):a==="insideBottomRight"?Pt({x:s+u-g,y:l+f-p,textAnchor:y,verticalAnchor:h},O):$s(a)&&(ie(a.x)||_a(a.x))&&(ie(a.y)||_a(a.y))?Pt({x:s+sr(a.x,u),y:l+sr(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):Pt({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},CQ=function(t){return"cx"in t&&ie(t.cx)};function Lt(e){var t=e.offset,r=t===void 0?5:t,n=bQ(e,hQ),i=Pt({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,c=f===void 0?"":f,p=i.textBreakAll;if(!a||Ce(s)&&Ce(l)&&!j.isValidElement(u)&&!Oe(u))return null;if(j.isValidElement(u))return j.cloneElement(u,i);var h;if(Oe(u)){if(h=j.createElement(u,i),j.isValidElement(h))return h}else h=jQ(i);var b=CQ(a),v=ge(i,!0);if(b&&(o==="insideStart"||o==="insideEnd"||o==="end"))return EQ(i,h,v);var g=b?kQ(i):PQ(i);return T.createElement(Va,$u({className:Ee("recharts-label",c)},v,g,{breakAll:p}),h)}Lt.displayName="Label";var dC=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,c=t.x,p=t.y,h=t.top,b=t.left,v=t.width,g=t.height,y=t.clockWise,m=t.labelViewBox;if(m)return m;if(ie(v)&&ie(g)){if(ie(c)&&ie(p))return{x:c,y:p,width:v,height:g};if(ie(h)&&ie(b))return{x:h,y:b,width:v,height:g}}return ie(c)&&ie(p)?{x:c,y:p,width:0,height:0}:ie(r)&&ie(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:y}:t.viewBox?t.viewBox:{}},TQ=function(t,r){return t?t===!0?T.createElement(Lt,{key:"label-implicit",viewBox:r}):$t(t)?T.createElement(Lt,{key:"label-implicit",viewBox:r,value:t}):j.isValidElement(t)?t.type===Lt?j.cloneElement(t,{key:"label-implicit",viewBox:r}):T.createElement(Lt,{key:"label-implicit",content:t,viewBox:r}):Oe(t)?T.createElement(Lt,{key:"label-implicit",content:t,viewBox:r}):$s(t)?T.createElement(Lt,$u({viewBox:r},t,{key:"label-implicit"})):null:null},NQ=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=dC(t),o=Yr(i,Lt).map(function(l,u){return j.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=TQ(t.label,r||a);return[s].concat(mQ(o))};Lt.parseViewBox=dC;Lt.renderCallByParent=NQ;function $Q(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var RQ=$Q;const IQ=Ke(RQ);function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}var MQ=["valueAccessor"],DQ=["data","dataKey","clockWise","id","textBreakAll"];function LQ(e){return UQ(e)||zQ(e)||FQ(e)||BQ()}function BQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FQ(e,t){if(e){if(typeof e=="string")return og(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return og(e,t)}}function zQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UQ(e){if(Array.isArray(e))return og(e)}function og(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function GQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var KQ=function(t){return Array.isArray(t.value)?IQ(t.value):t.value};function Hi(e){var t=e.valueAccessor,r=t===void 0?KQ:t,n=HS(e,MQ),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=HS(n,DQ);return!i||!i.length?null:T.createElement(He,{className:"recharts-label-list"},i.map(function(f,c){var p=Ce(a)?r(f,c):rr(f&&f.payload,a),h=Ce(s)?{}:{id:"".concat(s,"-").concat(c)};return T.createElement(Lt,Td({},ge(f,!0),u,h,{parentViewBox:f.parentViewBox,value:p,textBreakAll:l,viewBox:Lt.parseViewBox(Ce(o)?f:WS(WS({},f),{},{clockWise:o})),key:"label-".concat(c),index:c}))}))}Hi.displayName="LabelList";function qQ(e,t){return e?e===!0?T.createElement(Hi,{key:"labelList-implicit",data:t}):T.isValidElement(e)||Oe(e)?T.createElement(Hi,{key:"labelList-implicit",data:t,content:e}):$s(e)?T.createElement(Hi,Td({data:t},e,{key:"labelList-implicit"})):null:null}function XQ(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Yr(n,Hi).map(function(o,s){return j.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=qQ(e.label,t);return[a].concat(LQ(i))}Hi.renderCallByParent=XQ;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, + `).concat(c.x,",").concat(c.y,` + `);if(i>0){var h=it(r,n,i,o),b=it(r,n,i,u);p+="L ".concat(b.x,",").concat(b.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, + `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},eJ=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,c=or(f-u),p=Yc({cx:r,cy:n,radius:a,angle:u,sign:c,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,b=p.lineTangency,v=p.theta,g=Yc({cx:r,cy:n,radius:a,angle:f,sign:-c,cornerRadius:o,cornerIsExternal:l}),y=g.circleTangency,m=g.lineTangency,w=g.theta,S=l?Math.abs(u-f):Math.abs(u-f)-v-w;if(S<0)return s?"M ".concat(b.x,",").concat(b.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):pC({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var x="M ".concat(b.x,",").concat(b.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(h.x,",").concat(h.y,` + A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(c<0),",").concat(y.x,",").concat(y.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(m.x,",").concat(m.y,` + `);if(i>0){var _=Yc({cx:r,cy:n,radius:i,angle:u,sign:c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=_.circleTangency,A=_.lineTangency,E=_.theta,$=Yc({cx:r,cy:n,radius:i,angle:f,sign:-c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),N=$.circleTangency,P=$.lineTangency,I=$.theta,D=l?Math.abs(u-f):Math.abs(u-f)-E-I;if(D<0&&o===0)return"".concat(x,"L").concat(r,",").concat(n,"Z");x+="L".concat(P.x,",").concat(P.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(N.x,",").concat(N.y,` + A`).concat(i,",").concat(i,",0,").concat(+(D>180),",").concat(+(c>0),",").concat(O.x,",").concat(O.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(A.x,",").concat(A.y,"Z")}else x+="L".concat(r,",").concat(n,"Z");return x},tJ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},hC=function(t){var r=KS(KS({},tJ),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,c=r.endAngle,p=r.className;if(o0&&Math.abs(f-c)<360?g=eJ({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,b/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:c}):g=pC({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:c}),T.createElement("path",sg({},ge(r,!0),{className:h,d:g,role:"img"}))};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;thJ.call(e,t));function Za(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const yJ="__v",gJ="__o",xJ="_owner",{getOwnPropertyDescriptor:QS,keys:JS}=Object;function bJ(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e),new Uint8Array(t))}function wJ(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function _J(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function SJ(e,t){return Za(e.getTime(),t.getTime())}function OJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function jJ(e,t){return e===t}function eO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let f=!1,c=0;for(;(s=u.next())&&!s.done;){if(i[c]){c++;continue}const p=o.value,h=s.value;if(r.equals(p[0],h[0],l,c,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){f=i[c]=!0;break}c++}if(!f)return!1;l++}return!0}const AJ=Za;function EJ(e,t,r){const n=JS(e);let i=n.length;if(JS(t).length!==i)return!1;for(;i-- >0;)if(!gC(e,t,r,n[i]))return!1;return!0}function dl(e,t,r){const n=ZS(e);let i=n.length;if(ZS(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!gC(e,t,r,a)||(o=QS(e,a),s=QS(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function kJ(e,t){return Za(e.valueOf(),t.valueOf())}function PJ(e,t){return e.source===t.source&&e.flags===t.flags}function tO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function Nd(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function CJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function gC(e,t,r,n){return(n===xJ||n===gJ||n===yJ)&&(e.$$typeof||t.$$typeof)?!0:vJ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const TJ="[object ArrayBuffer]",NJ="[object Arguments]",$J="[object Boolean]",RJ="[object DataView]",IJ="[object Date]",MJ="[object Error]",DJ="[object Map]",LJ="[object Number]",BJ="[object Object]",FJ="[object RegExp]",zJ="[object Set]",UJ="[object String]",VJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},WJ="[object URL]",HJ=Object.prototype.toString;function GJ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:c,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:b}){return function(g,y,m){if(g===y)return!0;if(g==null||y==null)return!1;const w=typeof g;if(w!==typeof y)return!1;if(w!=="object")return w==="number"?s(g,y,m):w==="function"?a(g,y,m):!1;const S=g.constructor;if(S!==y.constructor)return!1;if(S===Object)return l(g,y,m);if(Array.isArray(g))return t(g,y,m);if(S===Date)return n(g,y,m);if(S===RegExp)return f(g,y,m);if(S===Map)return o(g,y,m);if(S===Set)return c(g,y,m);const x=HJ.call(g);if(x===IJ)return n(g,y,m);if(x===FJ)return f(g,y,m);if(x===DJ)return o(g,y,m);if(x===zJ)return c(g,y,m);if(x===BJ)return typeof g.then!="function"&&typeof y.then!="function"&&l(g,y,m);if(x===WJ)return h(g,y,m);if(x===MJ)return i(g,y,m);if(x===NJ)return l(g,y,m);if(VJ[x])return p(g,y,m);if(x===TJ)return e(g,y,m);if(x===RJ)return r(g,y,m);if(x===$J||x===LJ||x===UJ)return u(g,y,m);if(b){let _=b[x];if(!_){const O=mJ(g);O&&(_=b[O])}if(_)return _(g,y,m)}return!1}}function KJ({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:bJ,areArraysEqual:r?dl:wJ,areDataViewsEqual:_J,areDatesEqual:SJ,areErrorsEqual:OJ,areFunctionsEqual:jJ,areMapsEqual:r?Vm(eO,dl):eO,areNumbersEqual:AJ,areObjectsEqual:r?dl:EJ,arePrimitiveWrappersEqual:kJ,areRegExpsEqual:PJ,areSetsEqual:r?Vm(tO,dl):tO,areTypedArraysEqual:r?Vm(Nd,dl):Nd,areUrlsEqual:CJ,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=Qc(n.areArraysEqual),a=Qc(n.areMapsEqual),o=Qc(n.areObjectsEqual),s=Qc(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function qJ(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function XJ({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const YJ=sa();sa({strict:!0});sa({circular:!0});sa({circular:!0,strict:!0});sa({createInternalComparator:()=>Za});sa({strict:!0,createInternalComparator:()=>Za});sa({circular:!0,createInternalComparator:()=>Za});sa({circular:!0,createInternalComparator:()=>Za,strict:!0});function sa(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=KJ(e),o=GJ(a),s=r?r(o):qJ(o);return XJ({circular:t,comparator:o,createState:n,equals:s,strict:i})}function ZJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function rO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):ZJ(i)};requestAnimationFrame(n)}function cg(e){"@babel/helpers - typeof";return cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cg(e)}function QJ(e){return ree(e)||tee(e)||eee(e)||JJ()}function JJ(){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 eee(e,t){if(e){if(typeof e=="string")return nO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nO(e,t)}}function nO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:y<0?0:y},v=function(y){for(var m=y>1?1:y,w=m,S=0;S<8;++S){var x=c(w)-m,_=h(w);if(Math.abs(x-m)<$d||_<$d)return p(w);w=b(w-x/_)}return p(w)};return v.isStepper=!1,v},gee=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(f,c,p){var h=-(f-c)*n,b=p*a,v=p+(h-b)*s/1e3,g=p*s/1e3+f;return Math.abs(g-c)<$d&&Math.abs(v)<$d?[c,0]:[g,v]};return l.isStepper=!0,l.dt=s,l},xee=function(){for(var t=arguments.length,r=new Array(t),n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $ee(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Wm(e){return Dee(e)||Mee(e)||Iee(e)||Ree()}function Ree(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iee(e,t){if(e){if(typeof e=="string")return mg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mg(e,t)}}function Mee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dee(e){if(Array.isArray(e))return mg(e)}function mg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Id(e){return Id=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Id(e)}var ui=function(e){Uee(r,e);var t=Vee(r);function r(n,i){var a;Lee(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,c=o.steps,p=o.children,h=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(gg(a)),a.changeStyle=a.changeStyle.bind(gg(a)),!s||h<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:f}),yg(a);if(c&&c.length)a.state={style:c[0].style};else if(u){if(typeof p=="function")return a.state={style:u},yg(a);a.state={style:l?Sl({},l,u):u}}else a.state={style:{}};return a}return Fee(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,c=a.from,p=this.state.style;if(s){if(!o){var h={style:l?Sl({},l,f):f};this.state&&p&&(l&&p[l]!==f||!l&&p!==f)&&this.setState(h);return}if(!(YJ(i.to,f)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=b||u?c:i.to;if(this.state&&p){var g={style:l?Sl({},l,v):v};(l&&p[l]!==v||!l&&p!==v)&&this.setState(g)}this.runAnimation(an(an({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,f=i.begin,c=i.onAnimationEnd,p=i.onAnimationStart,h=Cee(o,s,xee(u),l,this.changeStyle),b=function(){a.stopJSAnimation=h()};this.manager.start([p,f,b,l,c])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,c=u.duration,p=c===void 0?0:c,h=function(v,g,y){if(y===0)return v;var m=g.duration,w=g.easing,S=w===void 0?"ease":w,x=g.style,_=g.properties,O=g.onAnimationEnd,A=y>0?o[y-1]:g,E=_||Object.keys(x);if(typeof S=="function"||S==="spring")return[].concat(Wm(v),[a.runJSAnimation.bind(a,{from:A.style,to:x,duration:m,easing:S}),m]);var $=oO(E,m,S),N=an(an(an({},A.style),x),{},{transition:$});return[].concat(Wm(v),[N,m,O]).filter(see)};return this.manager.start([l].concat(Wm(o.reduce(h,[f,Math.max(p,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=nee());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,c=i.onAnimationEnd,p=i.steps,h=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(i);return}if(p.length>1){this.runStepAnimation(i);return}var v=s?Sl({},s,l):l,g=oO(Object.keys(v),o,u);b.start([f,a,an(an({},v),{},{transition:g}),o,c])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Nee(i,Tee),u=j.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var c=function(h){var b=h.props,v=b.style,g=v===void 0?{}:v,y=b.className,m=j.cloneElement(h,an(an({},l),{},{style:an(an({},g),f),className:y}));return m};return u===1?c(j.Children.only(a)):T.createElement("div",null,j.Children.map(a,function(p){return c(p)}))}}]),r}(j.PureComponent);ui.displayName="Animate";ui.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ui.propTypes={from:Ue.oneOfType([Ue.object,Ue.string]),to:Ue.oneOfType([Ue.object,Ue.string]),attributeName:Ue.string,duration:Ue.number,begin:Ue.number,easing:Ue.oneOfType([Ue.string,Ue.func]),steps:Ue.arrayOf(Ue.shape({duration:Ue.number.isRequired,style:Ue.object.isRequired,easing:Ue.oneOfType([Ue.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ue.func]),properties:Ue.arrayOf("string"),onAnimationEnd:Ue.func})),children:Ue.oneOfType([Ue.node,Ue.func]),isActive:Ue.bool,canBegin:Ue.bool,onAnimationEnd:Ue.func,shouldReAnimate:Ue.bool,onAnimationStart:Ue.func,onAnimationReStart:Ue.func};function Bu(e){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function Md(){return Md=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var c=[0,0,0,0],p=0,h=4;po?o:a[p];f="M".concat(t,",").concat(r+s*c[0]),c[0]>0&&(f+="A ".concat(c[0],",").concat(c[0],",0,0,").concat(u,",").concat(t+l*c[0],",").concat(r)),f+="L ".concat(t+n-l*c[1],",").concat(r),c[1]>0&&(f+="A ".concat(c[1],",").concat(c[1],",0,0,").concat(u,`, + `).concat(t+n,",").concat(r+s*c[1])),f+="L ".concat(t+n,",").concat(r+i-s*c[2]),c[2]>0&&(f+="A ".concat(c[2],",").concat(c[2],",0,0,").concat(u,`, + `).concat(t+n-l*c[2],",").concat(r+i)),f+="L ".concat(t+l*c[3],",").concat(r+i),c[3]>0&&(f+="A ".concat(c[3],",").concat(c[3],",0,0,").concat(u,`, + `).concat(t,",").concat(r+i-s*c[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var b=Math.min(o,a);f="M ".concat(t,",").concat(r+s*b,` + A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+l*b,",").concat(r,` + L `).concat(t+n-l*b,",").concat(r,` + A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*b,` + L `).concat(t+n,",").concat(r+i-s*b,` + A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+n-l*b,",").concat(r+i,` + L `).concat(t+l*b,",").concat(r+i,` + A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*b," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},Jee=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),c=Math.min(o,o+l),p=Math.max(o,o+l);return n>=u&&n<=f&&i>=c&&i<=p}return!1},ete={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},eb=function(t){var r=hO(hO({},ete),t),n=j.useRef(),i=j.useState(-1),a=Hee(i,2),o=a[0],s=a[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,c=r.height,p=r.radius,h=r.className,b=r.animationEasing,v=r.animationDuration,g=r.animationBegin,y=r.isAnimationActive,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||c!==+c||f===0||c===0)return null;var w=Ee("recharts-rectangle",h);return m?T.createElement(ui,{canBegin:o>0,from:{width:f,height:c,x:l,y:u},to:{width:f,height:c,x:l,y:u},duration:v,animationEasing:b,isActive:m},function(S){var x=S.width,_=S.height,O=S.x,A=S.y;return T.createElement(ui,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:y,easing:b},T.createElement("path",Md({},ge(r,!0),{className:w,d:mO(O,A,x,_,p),ref:n})))}):T.createElement("path",Md({},ge(r,!0),{className:w,d:mO(l,u,f,c,p)}))},tte=["points","className","baseLinePoints","connectNulls"];function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vO(e){return ste(e)||ote(e)||ate(e)||ite()}function ite(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ate(e,t){if(e){if(typeof e=="string")return xg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xg(e,t)}}function ote(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ste(e){if(Array.isArray(e))return xg(e)}function xg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){yO(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),yO(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Ul=function(t,r){var n=lte(t);r&&(n=[n.reduce(function(a,o){return[].concat(vO(a),vO(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},ute=function(t,r,n){var i=Ul(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Ul(r.reverse(),n).slice(1))},cte=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=rte(t,tte);if(!r||!r.length)return null;var s=Ee("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=ute(r,i,a);return T.createElement("g",{className:s},T.createElement("path",So({},ge(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?T.createElement("path",So({},ge(o,!0),{fill:"none",d:Ul(r,a)})):null,l?T.createElement("path",So({},ge(o,!0),{fill:"none",d:Ul(i,a)})):null)}var f=Ul(r,a);return T.createElement("path",So({},ge(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function bg(){return bg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var gte=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},xte=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,c=f===void 0?0:f,p=t.height,h=p===void 0?0:p,b=t.className,v=vte(t,fte),g=dte({x:n,y:a,top:s,left:u,width:c,height:h},v);return!ie(n)||!ie(a)||!ie(c)||!ie(h)||!ie(s)||!ie(u)?null:T.createElement("path",wg({},ge(g,!0),{className:Ee("recharts-cross",b),d:gte(n,a,c,h,s,u)}))},bte=nh,wte=DP,_te=ia;function Ste(e,t){return e&&e.length?bte(e,_te(t),wte):void 0}var Ote=Ste;const jte=Ke(Ote);var Ate=nh,Ete=ia,kte=LP;function Pte(e,t){return e&&e.length?Ate(e,Ete(t),kte):void 0}var Cte=Pte;const Tte=Ke(Cte);var Nte=["cx","cy","angle","ticks","axisLine"],$te=["ticks","tick","angle","tickFormatter","stroke"];function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Rte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ite(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wO(e,t){for(var r=0;rOO?o=i==="outer"?"start":"end":a<-OO?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=fa(fa({},ge(this.props,!1)),{},{fill:"none"},ge(s,!1));if(l==="circle")return T.createElement(tb,ya({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,c=f.map(function(p){return it(i,a,o,p.coordinate)});return T.createElement(cte,ya({className:"recharts-polar-angle-axis-line"},u,{points:c}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=ge(this.props,!1),c=ge(o,!1),p=fa(fa({},f),{},{fill:"none"},ge(s,!1)),h=a.map(function(b,v){var g=n.getTickLineCoord(b),y=n.getTickTextAnchor(b),m=fa(fa(fa({textAnchor:y},f),{},{stroke:"none",fill:u},c),{},{index:v,payload:b,x:g.x2,y:g.y2});return T.createElement(He,ya({className:Ee("recharts-polar-angle-axis-tick",fC(o)),key:"tick-".concat(b.coordinate)},Ua(n.props,b,v)),s&&T.createElement("line",ya({className:"recharts-polar-angle-axis-tick-line"},p,g)),o&&t.renderTickItem(o,m,l?l(b.value,v):b.value))});return T.createElement(He,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:T.createElement(He,{className:Ee("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return T.isValidElement(n)?o=T.cloneElement(n,i):Oe(n)?o=n(i):o=T.createElement(Va,ya({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(j.PureComponent);dh(ph,"displayName","PolarAngleAxis");dh(ph,"axisType","angleAxis");dh(ph,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Yte=I2,Zte=Yte(Object.getPrototypeOf,Object),Qte=Zte,Jte=pi,ere=Qte,tre=hi,rre="[object Object]",nre=Function.prototype,ire=Object.prototype,PC=nre.toString,are=ire.hasOwnProperty,ore=PC.call(Object);function sre(e){if(!tre(e)||Jte(e)!=rre)return!1;var t=ere(e);if(t===null)return!0;var r=are.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&PC.call(r)==ore}var lre=sre;const ure=Ke(lre);var cre=pi,fre=hi,dre="[object Boolean]";function pre(e){return e===!0||e===!1||fre(e)&&cre(e)==dre}var hre=pre;const mre=Ke(hre);function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function Bd(){return Bd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:f,lowerWidth:c,height:p,x:l,y:u},duration:v,animationEasing:b,isActive:y},function(w){var S=w.upperWidth,x=w.lowerWidth,_=w.height,O=w.x,A=w.y;return T.createElement(ui,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:b},T.createElement("path",Bd({},ge(r,!0),{className:m,d:kO(O,A,S,x,_),ref:n})))}):T.createElement("g",null,T.createElement("path",Bd({},ge(r,!0),{className:m,d:kO(l,u,f,c,p)})))},Are=["option","shapeType","propTransformer","activeClassName","isActive"];function Uu(e){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function Ere(e,t){if(e==null)return{};var r=kre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function PO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fd(e){for(var t=1;t0?$r(w,"paddingAngle",0):0;if(x){var O=ji(x.endAngle-x.startAngle,w.endAngle-w.startAngle),A=tt(tt({},w),{},{startAngle:m+_,endAngle:m+O(v)+_});g.push(A),m=A.endAngle}else{var E=w.endAngle,$=w.startAngle,N=ji(0,E-$),P=N(v),I=tt(tt({},w),{},{startAngle:m+_,endAngle:m+P+_});g.push(I),m=I.endAngle}}),T.createElement(He,null,n.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!oh(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,f=i.cy,c=i.innerRadius,p=i.outerRadius,h=i.isAnimationActive,b=this.state.isAnimationFinished;if(a||!o||!o.length||!ie(u)||!ie(f)||!ie(c)||!ie(p))return null;var v=Ee("recharts-pie",s);return T.createElement(He,{tabIndex:this.props.rootTabIndex,className:v,ref:function(y){n.pieRef=y}},this.renderSectors(),l&&this.renderLabels(o),Lt.renderCallByParent(this.props,null,!1),(!h||b)&&Hi.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?m:m-1)*l,S=g-m*h-w,x=i.reduce(function(A,E){var $=rr(E,y,0);return A+(ie($)?$:0)},0),_;if(x>0){var O;_=i.map(function(A,E){var $=rr(A,y,0),N=rr(A,f,E),P=(ie($)?$:0)/x,I;E?I=O.endAngle+or(v)*l*($!==0?1:0):I=o;var D=I+or(v)*(($!==0?h:0)+P*S),B=(I+D)/2,V=(b.innerRadius+b.outerRadius)/2,U=[{name:N,value:$,payload:A,dataKey:y,type:p}],R=it(b.cx,b.cy,V,B);return O=tt(tt(tt({percent:P,cornerRadius:a,name:N,tooltipPayload:U,midAngle:B,middleRadius:V,tooltipPosition:R},A),b),{},{value:rr(A,y),startAngle:I,endAngle:D,payload:A,paddingAngle:or(v)*l}),O})}return tt(tt({},b),{},{sectors:_,data:i})});var Xre=Math.ceil,Yre=Math.max;function Zre(e,t,r,n){for(var i=-1,a=Yre(Xre((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var Qre=Zre,Jre=J2,$O=1/0,ene=17976931348623157e292;function tne(e){if(!e)return e===0?e:0;if(e=Jre(e),e===$O||e===-$O){var t=e<0?-1:1;return t*ene}return e===e?e:0}var rne=tne,nne=Qre,ine=Yp,Hm=rne;function ane(e){return function(t,r,n){return n&&typeof n!="number"&&ine(t,r,n)&&(r=n=void 0),t=Hm(t),r===void 0?(r=t,t=0):r=Hm(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),Ar(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),Ar(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ar(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ar(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ar(n,"handleSlideDragStart",function(i){var a=LO(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return xne(t,e),mne(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,c=Math.min(i,a),p=Math.max(i,a),h=t.getIndexInRange(o,c),b=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:b===f?f:b-b%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=rr(a[n],s,n);return Oe(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,f=l.width,c=l.travellerWidth,p=l.startIndex,h=l.endIndex,b=l.onChange,v=n.pageX-a;v>0?v=Math.min(v,u+f-c-s,u+f-c-o):v<0&&(v=Math.max(v,u-o,u-s));var g=this.getIndex({startX:o+v,endX:s+v});(g.startIndex!==p||g.endIndex!==h)&&b&&b(g),this.setState({startX:o+v,endX:s+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=LO(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],f=this.props,c=f.x,p=f.width,h=f.travellerWidth,b=f.onChange,v=f.gap,g=f.data,y={startX:this.state.startX,endX:this.state.endX},m=n.pageX-a;m>0?m=Math.min(m,c+p-h-u):m<0&&(m=Math.max(m,c-u)),y[o]=u+m;var w=this.getIndex(y),S=w.startIndex,x=w.endIndex,_=function(){var A=g.length-1;return o==="startX"&&(s>l?S%v===0:x%v===0)||sl?x%v===0:S%v===0)||s>l&&x===A};this.setState(Ar(Ar({},o,u+m),"brushMoveStartX",n.pageX),function(){b&&_()&&b(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],c=s.indexOf(f);if(c!==-1){var p=c+n;if(!(p===-1||p>=s.length)){var h=s[p];i==="startX"&&h>=u||i==="endX"&&h<=l||this.setState(Ar({},i,h),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return T.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,c=j.Children.only(u);return c?T.cloneElement(c,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,c=l.height,p=l.traveller,h=l.ariaLabel,b=l.data,v=l.startIndex,g=l.endIndex,y=Math.max(n,this.props.x),m=Gm(Gm({},ge(this.props,!1)),{},{x:y,y:u,width:f,height:c}),w=h||"Min value: ".concat((a=b[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=b[g])===null||o===void 0?void 0:o.name);return T.createElement(He,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(x){["ArrowLeft","ArrowRight"].includes(x.key)&&(x.preventDefault(),x.stopPropagation(),s.handleTravellerMoveKeyboard(x.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,m))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,c=Math.max(Math.abs(i-n)-u,0);return T.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:c,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,c=f.startX,p=f.endX,h=5,b={pointerEvents:"none",fill:u};return T.createElement(He,{className:"recharts-brush-texts"},T.createElement(Va,Vd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,p)-h,y:o+s/2},b),this.getTextOfTick(i)),T.createElement(Va,Vd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,p)+l+h,y:o+s/2},b),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,c=n.alwaysShowText,p=this.state,h=p.startX,b=p.endX,v=p.isTextActive,g=p.isSlideMoving,y=p.isTravellerMoving,m=p.isTravellerFocused;if(!i||!i.length||!ie(s)||!ie(l)||!ie(u)||!ie(f)||u<=0||f<=0)return null;var w=Ee("recharts-brush",a),S=T.Children.count(o)===1,x=pne("userSelect","none");return T.createElement(He,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:x},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,b),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(b,"endX"),(v||g||y||m||c)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return T.createElement(T.Fragment,null,T.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),T.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),T.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return T.isValidElement(n)?a=T.cloneElement(n,i):Oe(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,c=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Gm({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?wne({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:c}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var p=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(j.PureComponent);Ar(ps,"displayName","Brush");Ar(ps,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var _ne=Ax;function Sne(e,t){var r;return _ne(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var One=Sne,jne=E2,Ane=ia,Ene=One,kne=_r,Pne=Yp;function Cne(e,t,r){var n=kne(e)?jne:Ene;return r&&Pne(e,t,r)&&(t=void 0),n(e,Ane(t))}var Tne=Cne;const Nne=Ke(Tne);var $n=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},BO=q2;function $ne(e,t,r){t=="__proto__"&&BO?BO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Rne=$ne,Ine=Rne,Mne=G2,Dne=ia;function Lne(e,t){var r={};return t=Dne(t),Mne(e,function(n,i,a){Ine(r,i,t(n,i,a))}),r}var Bne=Lne;const Fne=Ke(Bne);function zne(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function aie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function oie(e,t){var r=e.x,n=e.y,i=iie(e,eie),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),c="".concat(t.width||i.width),p=parseInt(c,10);return pl(pl(pl(pl(pl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:p,name:t.name,radius:t.radius})}function zO(e){return T.createElement(CC,Ag({shapeType:"rectangle",propTransformer:oie,activeClassName:"recharts-active-bar"},e))}var sie=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=ie(n)||A6(n);return a?t(n,i):(a||Ha(),r)}},lie=["value","background"],MC;function hs(e){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(e)}function uie(e,t){if(e==null)return{};var r=cie(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hd(){return Hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(B)0&&Math.abs(D)0&&(I=Math.min((he||0)-(D[Ae-1]||0),I))}),Number.isFinite(I)){var B=I/P,V=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(O=B*V/2),v.padding==="no-gap"){var U=sr(t.barCategoryGap,B*V),R=B*V/2;O=R-U-(R-U)/V*U}}}i==="xAxis"?A=[n.left+(w.left||0)+(O||0),n.left+n.width-(w.right||0)-(O||0)]:i==="yAxis"?A=l==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(O||0),n.top+n.height-(w.bottom||0)-(O||0)]:A=v.range,x&&(A=[A[1],A[0]]);var F=iC(v,a,p),L=F.scale,q=F.realScaleType;L.domain(y).range(A),aC(L);var W=oC(L,un(un({},v),{},{realScaleType:q}));i==="xAxis"?(N=g==="top"&&!S||g==="bottom"&&S,E=n.left,$=c[_]-N*v.height):i==="yAxis"&&(N=g==="left"&&!S||g==="right"&&S,E=c[_]-N*v.width,$=n.top);var Y=un(un(un({},v),W),{},{realScaleType:q,x:E,y:$,scale:L,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return Y.bandSize=Pd(Y,W),!v.hide&&i==="xAxis"?c[_]+=(N?-1:1)*Y.height:v.hide||(c[_]+=(N?-1:1)*Y.width),un(un({},h),{},vh({},b,Y))},{})},FC=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},_ie=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return FC({x:r,y:n},{x:i,y:a})},zC=function(){function e(t){gie(this,e),this.scale=t}return xie(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();vh(zC,"EPS",1e-4);var rb=function(t){var r=Object.keys(t).reduce(function(n,i){return un(un({},n),{},vh({},i,zC.create(t[i])))},{});return un(un({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return Fne(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return Jne(i,function(a,o){return r[o].isInRange(a)})}})};function Sie(e){return(e%180+180)%180}var Oie=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Sie(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&oe.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function fae(e,t){return iT(e,t+1)}function dae(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,c=function(){var b=n==null?void 0:n[l];if(b===void 0)return{v:iT(n,u)};var v=l,g,y=function(){return g===void 0&&(g=r(b,v)),g},m=b.coordinate,w=l===0||Yd(e,m,y,f,s);w||(l=0,f=o,u+=1),w&&(f=m+e*(y()/2+i),l+=u)},p;u<=a.length;)if(p=c(),p)return p.v;return[]}function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function ej(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t0?h.coordinate-g*e:h.coordinate})}else a[p]=h=Jt(Jt({},h),{},{tickCoord:h.coordinate});var y=Yd(e,h.tickCoord,v,s,l);y&&(l=h.tickCoord-e*(v()/2+i),a[p]=Jt(Jt({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function yae(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],c=r(f,s-1),p=e*(f.coordinate+e*c/2-u);o[s-1]=f=Jt(Jt({},f),{},{tickCoord:p>0?f.coordinate-p*e:f.coordinate});var h=Yd(e,f.tickCoord,function(){return c},l,u);h&&(u=f.tickCoord-e*(c/2+i),o[s-1]=Jt(Jt({},f),{},{isShow:!0}))}for(var b=a?s-1:s,v=function(m){var w=o[m],S,x=function(){return S===void 0&&(S=r(w,m)),S};if(m===0){var _=e*(w.coordinate-e*x()/2-l);o[m]=w=Jt(Jt({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else o[m]=w=Jt(Jt({},w),{},{tickCoord:w.coordinate});var O=Yd(e,w.tickCoord,x,l,u);O&&(l=w.tickCoord+e*(x()/2+i),o[m]=Jt(Jt({},w),{},{isShow:!0}))},g=0;g=2?or(i[1].coordinate-i[0].coordinate):1,y=cae(a,g,h);return l==="equidistantPreserveStart"?dae(g,y,v,i,o):(l==="preserveStart"||l==="preserveStartEnd"?p=yae(g,y,v,i,o,l==="preserveStartEnd"):p=vae(g,y,v,i,o),p.filter(function(m){return m.isShow}))}var xae=["viewBox"],bae=["viewBox"],wae=["ticks"];function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _ae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Sae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rj(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!b||!b.length?null:T.createElement(He,{className:Ee("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},a&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Lt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=Ee(i.className,"recharts-cartesian-axis-tick-value");return T.isValidElement(n)?o=T.cloneElement(n,kt(kt({},i),{},{className:s})):Oe(n)?o=n(kt(kt({},i),{},{className:s})):o=T.createElement(Va,jo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(j.Component);ab(wh,"displayName","CartesianAxis");ab(wh,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function Cae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tae(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function goe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xoe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&ie(i)&&ie(a)?t.slice(i,a+1):[]};function bT(e){return e==="number"?[0,"auto"]:void 0}var Vg=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=_h(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,c=(f=u.props.data)!==null&&f!==void 0?f:r;c&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(c=c.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=c===void 0?s:c;p=yy(h,o.dataKey,i)}else p=c&&c[n]||s[n];return p?[].concat(_s(l),[lC(u,p)]):l},[])},lj=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=Toe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=BZ(o,s,u,l);if(f>=0&&u){var c=u[f]&&u[f].value,p=Vg(t,r,f,c),h=Noe(n,s,f,a);return{activeTooltipIndex:f,activeLabel:c,activePayload:p,activeCoordinate:h}}return null},$oe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,p=t.stackOffset,h=nC(f,a);return n.reduce(function(b,v){var g,y=v.type.defaultProps!==void 0?G(G({},v.type.defaultProps),v.props):v.props,m=y.type,w=y.dataKey,S=y.allowDataOverflow,x=y.allowDuplicatedCategory,_=y.scale,O=y.ticks,A=y.includeHidden,E=y[o];if(b[E])return b;var $=_h(t.data,{graphicalItems:i.filter(function(W){var Y,he=o in W.props?W.props[o]:(Y=W.type.defaultProps)===null||Y===void 0?void 0:Y[o];return he===E}),dataStartIndex:l,dataEndIndex:u}),N=$.length,P,I,D;aoe(y.domain,S,m)&&(P=ig(y.domain,null,S),h&&(m==="number"||_!=="auto")&&(D=Fl($,w,"category")));var B=bT(m);if(!P||P.length===0){var V,U=(V=y.domain)!==null&&V!==void 0?V:B;if(w){if(P=Fl($,w,m),m==="category"&&h){var R=k6(P);x&&R?(I=P,P=Ud(0,N)):x||(P=LS(U,P,v).reduce(function(W,Y){return W.indexOf(Y)>=0?W:[].concat(_s(W),[Y])},[]))}else if(m==="category")x?P=P.filter(function(W){return W!==""&&!Ce(W)}):P=LS(U,P,v).reduce(function(W,Y){return W.indexOf(Y)>=0||Y===""||Ce(Y)?W:[].concat(_s(W),[Y])},[]);else if(m==="number"){var F=WZ($,i.filter(function(W){var Y,he,Ae=o in W.props?W.props[o]:(Y=W.type.defaultProps)===null||Y===void 0?void 0:Y[o],xe="hide"in W.props?W.props.hide:(he=W.type.defaultProps)===null||he===void 0?void 0:he.hide;return Ae===E&&(A||!xe)}),w,a,f);F&&(P=F)}h&&(m==="number"||_!=="auto")&&(D=Fl($,w,"category"))}else h?P=Ud(0,N):s&&s[E]&&s[E].hasStack&&m==="number"?P=p==="expand"?[0,1]:sC(s[E].stackGroups,l,u):P=rC($,i.filter(function(W){var Y=o in W.props?W.props[o]:W.type.defaultProps[o],he="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return Y===E&&(A||!he)}),m,f,!0);if(m==="number")P=Fg(c,P,E,a,O),U&&(P=ig(U,P,S));else if(m==="category"&&U){var L=U,q=P.every(function(W){return L.indexOf(W)>=0});q&&(P=L)}}return G(G({},b),{},ye({},E,G(G({},y),{},{axisType:a,domain:P,categoricalDomain:D,duplicateDomain:I,originalDomain:(g=y.domain)!==null&&g!==void 0?g:B,isCategorical:h,layout:f})))},{})},Roe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,p=_h(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=p.length,b=nC(f,a),v=-1;return n.reduce(function(g,y){var m=y.type.defaultProps!==void 0?G(G({},y.type.defaultProps),y.props):y.props,w=m[o],S=bT("number");if(!g[w]){v++;var x;return b?x=Ud(0,h):s&&s[w]&&s[w].hasStack?(x=sC(s[w].stackGroups,l,u),x=Fg(c,x,w,a)):(x=ig(S,rC(p,n.filter(function(_){var O,A,E=o in _.props?_.props[o]:(O=_.type.defaultProps)===null||O===void 0?void 0:O[o],$="hide"in _.props?_.props.hide:(A=_.type.defaultProps)===null||A===void 0?void 0:A.hide;return E===w&&!$}),"number",f),i.defaultProps.allowDataOverflow),x=Fg(c,x,w,a)),G(G({},g),{},ye({},w,G(G({axisType:a},i.defaultProps),{},{hide:!0,orientation:$r(Poe,"".concat(a,".").concat(v%2),null),domain:x,originalDomain:S,isCategorical:b,layout:f})))}return g},{})},Ioe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,c="".concat(i,"Id"),p=Yr(f,a),h={};return p&&p.length?h=$oe(t,{axes:p,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=Roe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Moe=function(t){var r=oo(t),n=ja(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Ex(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Pd(r,n)}},uj=function(t){var r=t.children,n=t.defaultShowTooltip,i=kr(r,ps),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Doe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Zn(r&&r.type);return n&&n.indexOf("Bar")>=0})},cj=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Loe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,c=n.children,p=n.margin||{},h=kr(c,ps),b=kr(c,ka),v=Object.keys(l).reduce(function(x,_){var O=l[_],A=O.orientation;return!O.mirror&&!O.hide?G(G({},x),{},ye({},A,x[A]+O.width)):x},{left:p.left||0,right:p.right||0}),g=Object.keys(o).reduce(function(x,_){var O=o[_],A=O.orientation;return!O.mirror&&!O.hide?G(G({},x),{},ye({},A,$r(x,"".concat(A))+O.height)):x},{top:p.top||0,bottom:p.bottom||0}),y=G(G({},g),v),m=y.bottom;h&&(y.bottom+=h.props.height||ps.defaultProps.height),b&&r&&(y=UZ(y,i,n,r));var w=u-y.left-y.right,S=f-y.top-y.bottom;return G(G({brushBottom:m},y),{},{width:Math.max(w,0),height:Math.max(S,0)})},Boe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},wT=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,c=t.defaultProps,p=function(y,m){var w=m.graphicalItems,S=m.stackGroups,x=m.offset,_=m.updateId,O=m.dataStartIndex,A=m.dataEndIndex,E=y.barSize,$=y.layout,N=y.barGap,P=y.barCategoryGap,I=y.maxBarSize,D=cj($),B=D.numericAxisName,V=D.cateAxisName,U=Doe(w),R=[];return w.forEach(function(F,L){var q=_h(y.data,{graphicalItems:[F],dataStartIndex:O,dataEndIndex:A}),W=F.type.defaultProps!==void 0?G(G({},F.type.defaultProps),F.props):F.props,Y=W.dataKey,he=W.maxBarSize,Ae=W["".concat(B,"Id")],xe=W["".concat(V,"Id")],We={},Me=l.reduce(function(Ze,ze){var C=m["".concat(ze.axisType,"Map")],M=W["".concat(ze.axisType,"Id")];C&&C[M]||ze.axisType==="zAxis"||Ha();var z=C[M];return G(G({},Ze),{},ye(ye({},ze.axisType,z),"".concat(ze.axisType,"Ticks"),ja(z)))},We),Z=Me[V],ne=Me["".concat(V,"Ticks")],pe=S&&S[Ae]&&S[Ae].hasStack&&JZ(F,S[Ae].stackGroups),k=Zn(F.type).indexOf("Bar")>=0,H=Pd(Z,ne),K=[],me=U&&FZ({barSize:E,stackGroups:S,totalSize:Boe(Me,V)});if(k){var _e,de,fe=Ce(he)?I:he,je=(_e=(de=Pd(Z,ne,!0))!==null&&de!==void 0?de:fe)!==null&&_e!==void 0?_e:0;K=zZ({barGap:N,barCategoryGap:P,bandSize:je!==H?je:H,sizeList:me[xe],maxBarSize:fe}),je!==H&&(K=K.map(function(Ze){return G(G({},Ze),{},{position:G(G({},Ze.position),{},{offset:Ze.position.offset-je/2})})}))}var ke=F&&F.type&&F.type.getComposedData;ke&&R.push({props:G(G({},ke(G(G({},Me),{},{displayedData:q,props:y,dataKey:Y,item:F,bandSize:H,barPosition:K,offset:x,stackedData:pe,layout:$,dataStartIndex:O,dataEndIndex:A}))),{},ye(ye(ye({key:F.key||"item-".concat(L)},B,Me[B]),V,Me[V]),"animationId",_)),childIndex:F6(F,y.children),item:F})}),R},h=function(y,m){var w=y.props,S=y.dataStartIndex,x=y.dataEndIndex,_=y.updateId;if(!Nw({props:w}))return null;var O=w.children,A=w.layout,E=w.stackOffset,$=w.data,N=w.reverseStackOrder,P=cj(A),I=P.numericAxisName,D=P.cateAxisName,B=Yr(O,n),V=ZZ($,B,"".concat(I,"Id"),"".concat(D,"Id"),E,N),U=l.reduce(function(W,Y){var he="".concat(Y.axisType,"Map");return G(G({},W),{},ye({},he,Ioe(w,G(G({},Y),{},{graphicalItems:B,stackGroups:Y.axisType===I&&V,dataStartIndex:S,dataEndIndex:x}))))},{}),R=Loe(G(G({},U),{},{props:w,graphicalItems:B}),m==null?void 0:m.legendBBox);Object.keys(U).forEach(function(W){U[W]=f(w,U[W],R,W.replace("Map",""),r)});var F=U["".concat(D,"Map")],L=Moe(F),q=p(w,G(G({},U),{},{dataStartIndex:S,dataEndIndex:x,updateId:_,graphicalItems:B,stackGroups:V,offset:R}));return G(G({formattedGraphicalItems:q,graphicalItems:B,offset:R,stackGroups:V},L),U)},b=function(g){function y(m){var w,S,x;return goe(this,y),x=woe(this,y,[m]),ye(x,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ye(x,"accessibilityManager",new ioe),ye(x,"handleLegendBBoxUpdate",function(_){if(_){var O=x.state,A=O.dataStartIndex,E=O.dataEndIndex,$=O.updateId;x.setState(G({legendBBox:_},h({props:x.props,dataStartIndex:A,dataEndIndex:E,updateId:$},G(G({},x.state),{},{legendBBox:_}))))}}),ye(x,"handleReceiveSyncEvent",function(_,O,A){if(x.props.syncId===_){if(A===x.eventEmitterSymbol&&typeof x.props.syncMethod!="function")return;x.applySyncEvent(O)}}),ye(x,"handleBrushChange",function(_){var O=_.startIndex,A=_.endIndex;if(O!==x.state.dataStartIndex||A!==x.state.dataEndIndex){var E=x.state.updateId;x.setState(function(){return G({dataStartIndex:O,dataEndIndex:A},h({props:x.props,dataStartIndex:O,dataEndIndex:A,updateId:E},x.state))}),x.triggerSyncEvent({dataStartIndex:O,dataEndIndex:A})}}),ye(x,"handleMouseEnter",function(_){var O=x.getMouseInfo(_);if(O){var A=G(G({},O),{},{isTooltipActive:!0});x.setState(A),x.triggerSyncEvent(A);var E=x.props.onMouseEnter;Oe(E)&&E(A,_)}}),ye(x,"triggeredAfterMouseMove",function(_){var O=x.getMouseInfo(_),A=O?G(G({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};x.setState(A),x.triggerSyncEvent(A);var E=x.props.onMouseMove;Oe(E)&&E(A,_)}),ye(x,"handleItemMouseEnter",function(_){x.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),ye(x,"handleItemMouseLeave",function(){x.setState(function(){return{isTooltipActive:!1}})}),ye(x,"handleMouseMove",function(_){_.persist(),x.throttleTriggeredAfterMouseMove(_)}),ye(x,"handleMouseLeave",function(_){x.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};x.setState(O),x.triggerSyncEvent(O);var A=x.props.onMouseLeave;Oe(A)&&A(O,_)}),ye(x,"handleOuterEvent",function(_){var O=B6(_),A=$r(x.props,"".concat(O));if(O&&Oe(A)){var E,$;/.*touch.*/i.test(O)?$=x.getMouseInfo(_.changedTouches[0]):$=x.getMouseInfo(_),A((E=$)!==null&&E!==void 0?E:{},_)}}),ye(x,"handleClick",function(_){var O=x.getMouseInfo(_);if(O){var A=G(G({},O),{},{isTooltipActive:!0});x.setState(A),x.triggerSyncEvent(A);var E=x.props.onClick;Oe(E)&&E(A,_)}}),ye(x,"handleMouseDown",function(_){var O=x.props.onMouseDown;if(Oe(O)){var A=x.getMouseInfo(_);O(A,_)}}),ye(x,"handleMouseUp",function(_){var O=x.props.onMouseUp;if(Oe(O)){var A=x.getMouseInfo(_);O(A,_)}}),ye(x,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&x.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),ye(x,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&x.handleMouseDown(_.changedTouches[0])}),ye(x,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&x.handleMouseUp(_.changedTouches[0])}),ye(x,"handleDoubleClick",function(_){var O=x.props.onDoubleClick;if(Oe(O)){var A=x.getMouseInfo(_);O(A,_)}}),ye(x,"handleContextMenu",function(_){var O=x.props.onContextMenu;if(Oe(O)){var A=x.getMouseInfo(_);O(A,_)}}),ye(x,"triggerSyncEvent",function(_){x.props.syncId!==void 0&&qm.emit(Xm,x.props.syncId,_,x.eventEmitterSymbol)}),ye(x,"applySyncEvent",function(_){var O=x.props,A=O.layout,E=O.syncMethod,$=x.state.updateId,N=_.dataStartIndex,P=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)x.setState(G({dataStartIndex:N,dataEndIndex:P},h({props:x.props,dataStartIndex:N,dataEndIndex:P,updateId:$},x.state)));else if(_.activeTooltipIndex!==void 0){var I=_.chartX,D=_.chartY,B=_.activeTooltipIndex,V=x.state,U=V.offset,R=V.tooltipTicks;if(!U)return;if(typeof E=="function")B=E(R,_);else if(E==="value"){B=-1;for(var F=0;F=0){var pe,k;if(I.dataKey&&!I.allowDuplicatedCategory){var H=typeof I.dataKey=="function"?ne:"payload.".concat(I.dataKey.toString());pe=yy(F,H,B),k=L&&q&&yy(q,H,B)}else pe=F==null?void 0:F[D],k=L&&q&&q[D];if(xe||Ae){var K=_.props.activeIndex!==void 0?_.props.activeIndex:D;return[j.cloneElement(_,G(G(G({},E.props),Me),{},{activeIndex:K})),null,null]}if(!Ce(pe))return[Z].concat(_s(x.renderActivePoints({item:E,activePoint:pe,basePoint:k,childIndex:D,isRange:L})))}else{var me,_e=(me=x.getItemByXY(x.state.activeCoordinate))!==null&&me!==void 0?me:{graphicalItem:Z},de=_e.graphicalItem,fe=de.item,je=fe===void 0?_:fe,ke=de.childIndex,Ze=G(G(G({},E.props),Me),{},{activeIndex:ke});return[j.cloneElement(je,Ze),null,null]}return L?[Z,null,null]:[Z,null]}),ye(x,"renderCustomized",function(_,O,A){return j.cloneElement(_,G(G({key:"recharts-customized-".concat(A)},x.props),x.state))}),ye(x,"renderMap",{CartesianGrid:{handler:ef,once:!0},ReferenceArea:{handler:x.renderReferenceElement},ReferenceLine:{handler:ef},ReferenceDot:{handler:x.renderReferenceElement},XAxis:{handler:ef},YAxis:{handler:ef},Brush:{handler:x.renderBrush,once:!0},Bar:{handler:x.renderGraphicChild},Line:{handler:x.renderGraphicChild},Area:{handler:x.renderGraphicChild},Radar:{handler:x.renderGraphicChild},RadialBar:{handler:x.renderGraphicChild},Scatter:{handler:x.renderGraphicChild},Pie:{handler:x.renderGraphicChild},Funnel:{handler:x.renderGraphicChild},Tooltip:{handler:x.renderCursor,once:!0},PolarGrid:{handler:x.renderPolarGrid,once:!0},PolarAngleAxis:{handler:x.renderPolarAxis},PolarRadiusAxis:{handler:x.renderPolarAxis},Customized:{handler:x.renderCustomized}}),x.clipPathId="".concat((w=m.id)!==null&&w!==void 0?w:cc("recharts"),"-clip"),x.throttleTriggeredAfterMouseMove=eP(x.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),x.state={},x}return Ooe(y,g),boe(y,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,x=w.data,_=w.height,O=w.layout,A=kr(S,Pr);if(A){var E=A.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,N=Vg(this.state,x,E,$),P=this.state.tooltipTicks[E].coordinate,I=(this.state.offset.top+_)/2,D=O==="horizontal",B=D?{x:P,y:I}:{y:P,x:I},V=this.state.formattedGraphicalItems.find(function(R){var F=R.item;return F.type.name==="Scatter"});V&&(B=G(G({},B),V.props.points[E].tooltipPosition),N=V.props.points[E].tooltipPayload);var U={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:$,activePayload:N,activeCoordinate:B};this.setState(U),this.renderCursor(A),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var x,_;this.accessibilityManager.setDetails({offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){xy([kr(w.children,Pr)],[kr(this.props.children,Pr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=kr(this.props.children,Pr);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,x=S.getBoundingClientRect(),_=pK(x),O={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},A=x.width/S.offsetWidth||1,E=this.inRange(O.chartX,O.chartY,A);if(!E)return null;var $=this.state,N=$.xAxisMap,P=$.yAxisMap,I=this.getTooltipEventType(),D=lj(this.state,this.props.data,this.props.layout,E);if(I!=="axis"&&N&&P){var B=oo(N).scale,V=oo(P).scale,U=B&&B.invert?B.invert(O.chartX):null,R=V&&V.invert?V.invert(O.chartY):null;return G(G({},O),{},{xValue:U,yValue:R},D)}return D?G(G({},O),D):null}},{key:"inRange",value:function(w,S){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,O=w/x,A=S/x;if(_==="horizontal"||_==="vertical"){var E=this.state.offset,$=O>=E.left&&O<=E.left+E.width&&A>=E.top&&A<=E.top+E.height;return $?{x:O,y:A}:null}var N=this.state,P=N.angleAxisMap,I=N.radiusAxisMap;if(P&&I){var D=oo(P);return zS({x:O,y:A},D)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),x=kr(w,Pr),_={};x&&S==="axis"&&(x.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=td(this.props,this.handleOuterEvent);return G(G({},O),_)}},{key:"addListener",value:function(){qm.on(Xm,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){qm.removeListener(Xm,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,x){for(var _=this.state.formattedGraphicalItems,O=0,A=_.length;Oft(`/routing/list/active/${e}`)),n=t==null?void 0:t.find(N=>{var P;return((P=N.algorithm_data||N.algorithm)==null?void 0:P.type)==="volume_split"}),[i,a]=j.useState([{id:hl(),name:"",split:50},{id:hl(),name:"",split:50}]),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,c]=j.useState(null),[p,h]=j.useState(null),[b,v]=j.useState(!1),[g,y]=j.useState(new Set),m=i.reduce((N,P)=>N+P.split,0);function w(N,P,I){a(D=>D.map(B=>B.id===N?{...B,[P]:I}:B))}function S(){a(N=>[...N,{id:hl(),name:"",split:0}])}function x(N){a(P=>P.filter(I=>I.id!==N))}async function _(){if(!e)return c("Set a merchant ID first");if(!o.trim())return c("Enter a rule name");if(m!==100)return c(`Splits must sum to 100 (currently ${m})`);if(i.some(N=>!N.name.trim()))return c("All gateways must have names");u(!0),c(null),h(null);try{await ft("/routing/create",{rule_id:null,name:o,description:"",created_by:e,algorithm_for:"payment",metadata:null,algorithm:{type:"volume_split",data:i.map(N=>({split:N.split,output:{gateway_name:N.name.trim(),gateway_id:null}}))}}),h(`Rule "${o}" created successfully. Find it in the list below to activate.`),r(),s(""),a([{id:hl(),name:"",split:50},{id:hl(),name:"",split:50}])}catch(N){c(N instanceof Error?N.message:"Failed to create rule")}finally{u(!1)}}async function O(N){if(e)try{await ft("/routing/activate",{created_by:e,routing_algorithm_id:N}),r(),h("Rule activated.")}catch(P){c(P instanceof Error?P.message:"Failed to activate")}}function A(N){y(P=>{const I=new Set(P);return I.has(N)?I.delete(N):I.add(N),I})}const E=n?n.algorithm_data||n.algorithm:null,$=E&&"data"in E?E.data.map(N=>{var P;return{name:((P=N.output)==null?void 0:P.gateway_name)??"?",value:N.split}}):[];return d.jsxs("div",{className:"space-y-6 max-w-4xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Volume Split Routing"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Distribute payment traffic across gateways by percentage."})]}),n&&d.jsxs(Te,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Volume Split"}),d.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n.name})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Qt,{variant:"green",children:"Active"}),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:()=>v(!b),children:[d.jsx(wp,{size:14,className:"mr-1"}),b?"Hide":"View"]})]})]}),b&&d.jsxs(Ne,{children:[d.jsx(mf,{width:"100%",height:220,children:d.jsxs(_T,{children:[d.jsx(Dn,{data:$,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:N,value:P})=>`${N}: ${P}%`,labelLine:{stroke:"#45454f"},children:$.map((N,P)=>d.jsx(Pa,{fill:dj[P%dj.length]},P))}),d.jsx(Pr,{formatter:N=>`${N}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),d.jsx(ka,{wrapperStyle:{color:"#8e8ea0"}})]})}),d.jsxs("div",{className:"mt-4 text-xs text-slate-600",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"Rule ID:"})," ",n.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",n.created_at?new Date(n.created_at).toLocaleString():"Unknown"]})]})]})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"Create Volume Split Rule"})}),d.jsxs(Ne,{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Rule Name"}),d.jsx("input",{value:o,onChange:N=>s(N.target.value),placeholder:"e.g. ab-test-split",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 text-xs font-medium text-slate-500 px-1",children:[d.jsx("span",{children:"Gateway Name"}),d.jsx("span",{children:"Split %"}),d.jsx("span",{})]}),i.map(N=>d.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 items-center",children:[d.jsx("input",{value:N.name,onChange:P=>w(N.id,"name",P.target.value),placeholder:"e.g. stripe",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{type:"number",min:0,max:100,value:N.split,onChange:P=>w(N.id,"split",Number(P.target.value)),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>x(N.id),className:"text-slate-400 hover:text-red-500",children:d.jsx(ii,{size:15})})]},N.id)),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-sm text-brand-500 hover:text-brand-600",children:[d.jsx(qi,{size:14})," Add Gateway"]}),d.jsxs("span",{className:`text-xs font-medium ${m===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",m,"%",m!==100&&" (must be 100)"]})]})]}),d.jsx(Qo,{error:f}),p&&d.jsx("p",{className:"text-sm text-emerald-400",children:p}),d.jsx(ht,{onClick:_,disabled:l||!e,children:l?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Creating…"]}):"Create Rule"})]})]}),d.jsx(zoe,{merchantId:e,onActivate:O,expandedRuleIds:g,onToggleExpand:A})]})}function zoe({merchantId:e,onActivate:t,expandedRuleIds:r,onToggleExpand:n}){const{data:i,isLoading:a}=vn(e?["routing-list",e]:null,()=>ft(`/routing/list/${e}`)),o=(i==null?void 0:i.filter(s=>{var l;return((l=s.algorithm_data||s.algorithm)==null?void 0:l.type)==="volume_split"}))??[];return e?a?d.jsx("div",{className:"flex justify-center py-4",children:d.jsx(En,{})}):o.length?d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"Saved Volume Split Rules"})}),d.jsx(Ne,{className:"p-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 uppercase tracking-wider",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2",children:"Name"}),d.jsx("th",{className:"text-left px-4 py-2",children:"Split"}),d.jsx("th",{className:"px-4 py-2"})]})}),d.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:o.map(s=>{const l=s.algorithm_data||s.algorithm,u=(l==null?void 0:l.data)||[],f=r.has(s.id);return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[d.jsx("td",{className:"px-4 py-2 font-medium text-slate-800",children:s.name}),d.jsx("td",{className:"px-4 py-2 text-slate-600 text-xs",children:u.map(c=>{var p;return`${(p=c.output)==null?void 0:p.gateway_name}:${c.split}%`}).join(" | ")}),d.jsx("td",{className:"px-4 py-2 text-right",children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsxs(ht,{size:"sm",variant:"ghost",onClick:()=>n(s.id),children:[d.jsx(wp,{size:14,className:"mr-1"}),f?"Hide":"View"]}),d.jsx(ht,{size:"sm",variant:"secondary",onClick:()=>t(s.id),children:"Activate"})]})})]},s.id),f&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"ID:"})," ",s.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Description:"})," ",s.description||"N/A"]}),s.created_at&&d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",new Date(s.created_at).toLocaleString()]}),d.jsxs("div",{children:[d.jsx("strong",{children:"Configuration:"}),d.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(l,null,2)})]})]})})})]})})})]})})]}):null:null}function Uoe(){var m;const{merchantId:e}=ra(),{data:t,mutate:r,isLoading:n}=vn(e?["rule-debit",e]:null,()=>ft("/rule/get",{merchant_id:e,config:{type:"debitRouting"}})),[i,a]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,c]=j.useState(null),[p,h]=j.useState(null),b=(m=t==null?void 0:t.config)==null?void 0:m.data,v=i||(b==null?void 0:b.merchant_category_code)||"",g=o||(b==null?void 0:b.acquirer_country)||"";async function y(){if(!e)return c("Set a merchant ID first");const w={merchant_id:e,config:{type:"debitRouting",data:{merchant_category_code:v.trim(),acquirer_country:g.trim()}}};u(!0),c(null);try{await ft(t?"/rule/update":"/rule/create",w),h("Debit routing config saved."),r()}catch(S){c(S instanceof Error?S.message:"Failed to save")}finally{u(!1)}}return d.jsxs("div",{className:"space-y-6 max-w-2xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Network / Debit Routing"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Configure network-based routing to optimise processing fees for debit card transactions. The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR)."})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(IE,{size:16,className:"text-brand-500"}),d.jsx("h2",{className:"font-medium text-slate-800",children:"Debit Routing Configuration"})]})}),d.jsx(Ne,{className:"space-y-4",children:n?d.jsx("div",{className:"flex justify-center py-6",children:d.jsx(En,{})}):d.jsxs(d.Fragment,{children:[!e&&d.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar to load configuration."}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Merchant Category Code (MCC)"}),d.jsx("input",{value:v,onChange:w=>a(w.target.value),placeholder:"e.g. 5411",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"4-digit ISO MCC for your business type"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Acquirer Country"}),d.jsx("input",{value:g,onChange:w=>s(w.target.value),placeholder:"e.g. US",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"ISO 3166-1 alpha-2 country code"})]})]}),d.jsx(Qo,{error:f}),p&&d.jsx("p",{className:"text-sm text-emerald-400",children:p}),d.jsx(ht,{onClick:y,disabled:l||!e,children:l?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Saving…"]}):t?"Update Config":"Save Config"})]})})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"How Network Routing Works"})}),d.jsxs(Ne,{className:"text-sm text-slate-600 space-y-2",children:[d.jsx("p",{children:"For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee."}),d.jsxs("p",{children:["Supported networks: ",["VISA","MASTERCARD","ACCEL","NYCE","PULSE","STAR"].map(w=>d.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md mr-1 text-slate-700",children:w},w))]}),d.jsxs("p",{children:["Use the ",d.jsx("strong",{className:"text-slate-800",children:"Decision Explorer"})," to test network routing decisions with ",d.jsx("code",{className:"text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md text-brand-500",children:"NtwBasedRouting"})," algorithm."]})]})]})]})}const Voe=["CARD","UPI","WALLET","NETBANKING","interac"],Woe=["CREDIT","DEBIT","PREPAID"],Hoe=["USD","EUR","GBP","INR","SGD","AUD","CAD"],Goe=["VISA","MASTERCARD","AMEX","RUPAY","DINERS"],Koe=["THREE_DS","NO_THREE_DS"],qoe=["SR_BASED_ROUTING","PL_BASED_ROUTING","NTW_BASED_ROUTING"],Xoe={SR_BASED_ROUTING:"Success Rate Based",PL_BASED_ROUTING:"Priority List Based",NTW_BASED_ROUTING:"Network Based"};function Yoe(e){for(const[t,r]of Object.entries(XD))if(e.includes(t)||t.includes(e))return r;return"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8"}const dr=["#0069ED","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function Zoe(){const{merchantId:e}=ra(),[t,r]=j.useState("single"),[n,i]=j.useState({amount:"1000",currency:"USD",payment_method_type:"CARD",payment_method:"CREDIT",card_brand:"VISA",auth_type:"THREE_DS",eligible_gateways:"stripe, adyen",ranking_algorithm:"SR_BASED_ROUTING",elimination_enabled:!1}),[a,o]=j.useState({totalPayments:"10",successCount:"7",failureCount:"3"}),[s,l]=j.useState([{key:"payment_method_type",type:"enum_variant",value:"credit",metadataKey:""},{key:"currency",type:"enum_variant",value:"USD",metadataKey:""}]),[u,f]=j.useState([{gateway_name:"stripe",gateway_id:"mca_001"},{gateway_name:"adyen",gateway_id:"mca_002"}]),[c,p]=j.useState("100"),[h,b]=j.useState(null),[v,g]=j.useState(null),[y,m]=j.useState([]),[w,S]=j.useState([]),[x,_]=j.useState(!1),[O,A]=j.useState(null),[E,$]=j.useState(!1),[N,P]=j.useState(!1),[I,D]=j.useState(!1),[B,V]=j.useState(!1);function U(k,H){i(K=>({...K,[k]:H}))}function R(){l([...s,{key:"",type:"enum_variant",value:"",metadataKey:""}])}function F(k){l(s.filter((H,K)=>K!==k))}function L(k,H,K){l(s.map((me,_e)=>_e===k?{...me,[H]:K}:me))}function q(k,H){l(s.map((K,me)=>me===k?{...K,metadataKey:H}:K))}function W(){f([...u,{gateway_name:"",gateway_id:""}])}function Y(k){f(u.filter((H,K)=>K!==k))}function he(k,H,K){f(u.map((me,_e)=>_e===k?{...me,[H]:K}:me))}async function Ae(){if(!e)return A("Set a merchant ID in the top bar");$(!0),A(null);const k=n.eligible_gateways.split(",").map(H=>H.trim()).filter(Boolean);try{const H=await ft("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:`explorer_${Date.now()}`,amount:parseFloat(n.amount)||1e3,currency:n.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:n.payment_method_type,paymentMethod:n.payment_method,authType:n.auth_type,cardBrand:n.card_brand},eligibleGatewayList:k,rankingAlgorithm:n.ranking_algorithm,eliminationEnabled:n.elimination_enabled});b(H)}catch(H){A(H instanceof Error?H.message:"Request failed")}finally{$(!1)}}async function xe(){if(!e)return A("Set a merchant ID in the top bar");const k=parseInt(a.totalPayments)||0,H=parseInt(a.successCount)||0,K=parseInt(a.failureCount)||0;if(k<=0)return A("Total Payments must be greater than 0");if(H+K!==k)return A("Success + Failure count must equal Total Payments");_(!0),A(null),S([]);const me=n.eligible_gateways.split(",").map(fe=>fe.trim()).filter(Boolean),_e=[],de=[...Array(H).fill("CHARGED"),...Array(K).fill("FAILURE")];for(let fe=de.length-1;fe>0;fe--){const je=Math.floor(Math.random()*(fe+1));[de[fe],de[je]]=[de[je],de[fe]]}try{for(let fe=0;fe{K.key&&(K.type==="metadata_variant"?k[K.key]={type:K.type,value:{key:K.metadataKey||K.key,value:K.value}}:K.type==="number"?k[K.key]={type:K.type,value:parseFloat(K.value)||0}:k[K.key]={type:K.type,value:K.value})});const H=await ft("/routing/evaluate",{created_by:e||"test_user",fallback_output:u.filter(K=>K.gateway_name),parameters:k});if(g(H),H.output.type==="volume_split"&&H.output.splits){const K=parseInt(c)||100,me=H.output.splits.map(_e=>({name:_e.connector.gateway_name,count:Math.round(_e.split/100*K),percentage:_e.split}));m(me)}}catch(k){A(k instanceof Error?k.message:"Request failed")}finally{$(!1)}}async function Me(){$(!0),A(null),m([]);try{const k=await ft("/routing/evaluate",{created_by:e||"test_user",fallback_output:[{gateway_name:"stripe",gateway_id:"mca_001"},{gateway_name:"adyen",gateway_id:"mca_002"}],parameters:{}});if(g(k),k.output.type==="volume_split"&&k.output.splits){const H=parseInt(c)||100,K=k.output.splits.map(me=>({name:me.connector.gateway_name,count:Math.round(me.split/100*H),percentage:me.split}));m(K)}}catch(k){A(k instanceof Error?k.message:"Request failed")}finally{$(!1)}}const Z=h!=null&&h.gateway_priority_map?Object.entries(h.gateway_priority_map).sort(([,k],[,H])=>H-k).map(([k,H])=>({name:k,score:Math.round(H*1e3)/10})):[],ne=w.reduce((k,H)=>(k[H.decidedGateway]||(k[H.decidedGateway]={total:0,success:0,failure:0}),k[H.decidedGateway].total++,H.status==="CHARGED"?k[H.decidedGateway].success++:k[H.decidedGateway].failure++,k),{}),pe=y.map(k=>({name:k.name,value:k.count}));return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Decision Explorer"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split."})]}),d.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-[#1c1c24]",children:[d.jsx("button",{onClick:()=>r("single"),className:`px-4 py-2 text-sm font-medium ${t==="single"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Single Test"}),d.jsx("button",{onClick:()=>r("batch"),className:`px-4 py-2 text-sm font-medium ${t==="batch"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Batch Simulation"}),d.jsx("button",{onClick:()=>r("rule"),className:`px-4 py-2 text-sm font-medium ${t==="rule"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Rule-Based"}),d.jsx("button",{onClick:()=>r("volume"),className:`px-4 py-2 text-sm font-medium ${t==="volume"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Volume Split"})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:t==="rule"?"Rule Evaluation Parameters":t==="volume"?"Volume Split Configuration":"Payment Parameters"})}),d.jsxs(Ne,{className:"space-y-3",children:[!e&&t!=="volume"&&d.jsx("p",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar first."}),t==="rule"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Parameters"}),d.jsx("div",{className:"space-y-2",children:s.map((k,H)=>d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("input",{placeholder:"Key (e.g. payment_method_type)",value:k.key,onChange:K=>L(H,"key",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs("select",{value:k.type,onChange:K=>L(H,"type",K.target.value),className:"w-36 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:[d.jsx("option",{value:"enum_variant",children:"enum_variant"}),d.jsx("option",{value:"str_value",children:"str_value"}),d.jsx("option",{value:"number",children:"number"}),d.jsx("option",{value:"metadata_variant",children:"metadata_variant"})]}),d.jsx("button",{onClick:()=>F(H),className:"p-1.5 text-slate-400 hover:text-red-500",children:d.jsx(ii,{size:14})})]}),k.type==="metadata_variant"?d.jsxs("div",{className:"flex gap-2 items-center pl-1",children:[d.jsx("input",{placeholder:"Metadata Key",value:k.metadataKey||"",onChange:K=>q(H,K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{placeholder:"Metadata Value",value:k.value,onChange:K=>L(H,"value",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}):d.jsx("div",{className:"flex gap-2 items-center pl-1",children:d.jsx("input",{placeholder:"Value",value:k.value,onChange:K=>L(H,"value",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})})]},H))}),d.jsxs("button",{onClick:R,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[d.jsx(qi,{size:12})," Add Parameter"]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Fallback Connectors"}),d.jsx("div",{className:"space-y-2",children:u.map((k,H)=>d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("input",{placeholder:"Gateway Name",value:k.gateway_name,onChange:K=>he(H,"gateway_name",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{placeholder:"Gateway ID",value:k.gateway_id||"",onChange:K=>he(H,"gateway_id",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>Y(H),className:"p-1.5 text-slate-400 hover:text-red-500",children:d.jsx(ii,{size:14})})]},H))}),d.jsxs("button",{onClick:W,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[d.jsx(qi,{size:12})," Add Connector"]})]})]}):t==="volume"?d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Number of Payments"}),d.jsx("input",{type:"text",value:c,onChange:k=>p(k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Enter the total number of payments to visualize how they would be distributed across connectors."})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Amount"}),d.jsx("input",{value:n.amount,onChange:k=>U("amount",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Currency"}),d.jsx("select",{value:n.currency,onChange:k=>U("currency",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Hoe.map(k=>d.jsx("option",{children:k},k))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method Type"}),d.jsx("select",{value:n.payment_method_type,onChange:k=>U("payment_method_type",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Voe.map(k=>d.jsx("option",{children:k},k))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method"}),d.jsx("select",{value:n.payment_method,onChange:k=>U("payment_method",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Woe.map(k=>d.jsx("option",{children:k},k))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Card Brand"}),d.jsx("select",{value:n.card_brand,onChange:k=>U("card_brand",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Goe.map(k=>d.jsx("option",{children:k},k))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Auth Type"}),d.jsx("select",{value:n.auth_type,onChange:k=>U("auth_type",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Koe.map(k=>d.jsx("option",{children:k},k))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Eligible Gateways (comma-separated)"}),d.jsx("input",{value:n.eligible_gateways,onChange:k=>U("eligible_gateways",k.target.value),placeholder:"stripe, adyen",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Algorithm"}),d.jsx("select",{value:n.ranking_algorithm,onChange:k=>U("ranking_algorithm",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:qoe.map(k=>d.jsx("option",{value:k,children:Xoe[k]},k))})]}),d.jsx("div",{className:"flex items-end pb-1",children:d.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:n.elimination_enabled,onChange:k=>U("elimination_enabled",k.target.checked),className:"rounded"}),"Elimination enabled"]})})]}),t==="batch"&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-4 mt-4 space-y-3",children:[d.jsxs("h3",{className:"text-sm font-medium text-slate-800 flex items-center gap-2",children:[d.jsx(Qh,{size:14}),"Simulation Configuration"]}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Total Payments"}),d.jsx("input",{type:"text",value:a.totalPayments,onChange:k=>o(H=>({...H,totalPayments:k.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Success Count"}),d.jsx("input",{type:"text",value:a.successCount,onChange:k=>o(H=>({...H,successCount:k.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Failure Count"}),d.jsx("input",{type:"text",value:a.failureCount,onChange:k=>o(H=>({...H,failureCount:k.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),d.jsxs("p",{className:"text-xs text-slate-500",children:["Will run ",a.totalPayments||0," payments: ",a.successCount||0," SUCCESS, ",a.failureCount||0," FAILURE"]})]})]}),d.jsx(Qo,{error:O}),t==="rule"?d.jsx(ht,{onClick:We,disabled:E,className:"w-full justify-center",children:E?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Evaluating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Mc,{size:14})," Evaluate Rules"]})}):t==="volume"?d.jsx(ht,{onClick:Me,disabled:E,className:"w-full justify-center",children:E?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Calculating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Vf,{size:14})," Visualize Distribution"]})}):t==="batch"?d.jsx(ht,{onClick:xe,disabled:x||!e,className:"w-full justify-center",children:x?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14}),"Simulating ",w.length,"/",a.totalPayments||0,"..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Qh,{size:14})," Run Batch Simulation"]})}):d.jsx(ht,{onClick:Ae,disabled:E||!e,className:"w-full justify-center",children:E?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Running…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Mc,{size:14})," Run Decision"]})})]})]}),d.jsx("div",{className:"space-y-4",children:t==="volume"?y.length>0?d.jsxs(d.Fragment,{children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Volume Distribution Overview"})}),d.jsxs(Ne,{children:[d.jsxs("div",{className:"text-center mb-4",children:[d.jsx("p",{className:"text-3xl font-bold text-slate-900",children:c}),d.jsx("p",{className:"text-xs text-slate-500",children:"Total Payments"})]}),d.jsx("div",{className:"grid grid-cols-2 gap-4",children:y.map((k,H)=>d.jsxs("div",{className:"bg-slate-50 dark:bg-[#111114] rounded-lg p-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:dr[H%dr.length]}}),d.jsx("span",{className:"font-medium text-sm",children:k.name})]}),d.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[d.jsxs("span",{children:[k.percentage,"%"]}),d.jsxs("span",{className:"font-medium text-slate-700",children:[k.count," payments"]})]})]},H))})]})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Pie Chart"})}),d.jsx(Ne,{children:d.jsx(mf,{width:"100%",height:250,children:d.jsxs(_T,{children:[d.jsx(Dn,{data:pe,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:k,percent:H})=>`${k} ${(H*100).toFixed(0)}%`,labelLine:!1,children:pe.map((k,H)=>d.jsx(Pa,{fill:dr[H%dr.length]},`cell-${H}`))}),d.jsx(Pr,{formatter:k=>[`${k} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}})]})})})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Bar Chart"})}),d.jsx(Ne,{children:d.jsx(mf,{width:"100%",height:y.length*50+40,children:d.jsxs(fj,{data:y,layout:"vertical",margin:{left:20,right:40},children:[d.jsx(qu,{type:"number",tick:{fontSize:12,fill:"#666"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),d.jsx(Xu,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#666"},width:80,axisLine:!1,tickLine:!1}),d.jsx(Pr,{formatter:k=>[`${k} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}}),d.jsx(Qi,{dataKey:"count",radius:[0,6,6,0],children:y.map((k,H)=>d.jsx(Pa,{fill:dr[H%dr.length]},`cell-${H}`))})]})})})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Percentage Distribution"})}),d.jsxs(Ne,{children:[d.jsx("div",{className:"h-4 rounded-full overflow-hidden flex",children:y.map((k,H)=>d.jsx("div",{style:{width:`${k.percentage}%`,backgroundColor:dr[H%dr.length]},className:"h-full transition-all duration-300",title:`${k.name}: ${k.percentage}%`},H))}),d.jsx("div",{className:"flex flex-wrap gap-3 mt-3",children:y.map((k,H)=>d.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[d.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:dr[H%dr.length]}}),d.jsx("span",{className:"text-slate-600",children:k.name}),d.jsxs("span",{className:"font-medium",children:[k.percentage,"%"]})]},H))})]})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Connector Summary"})}),d.jsx(Ne,{className:"p-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2",children:"Connector"}),d.jsx("th",{className:"text-right px-4 py-2",children:"Payments"}),d.jsx("th",{className:"text-right px-4 py-2",children:"Percentage"})]})}),d.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:[y.map((k,H)=>d.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[d.jsx("td",{className:"px-4 py-2",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:dr[H%dr.length]}}),d.jsx("span",{className:"font-medium",children:k.name})]})}),d.jsx("td",{className:"px-4 py-2 text-right font-medium",children:k.count}),d.jsxs("td",{className:"px-4 py-2 text-right text-slate-500",children:[k.percentage,"%"]})]},H)),d.jsxs("tr",{className:"bg-slate-50 dark:bg-[#111114] font-medium",children:[d.jsx("td",{className:"px-4 py-2",children:"Total"}),d.jsx("td",{className:"px-4 py-2 text-right",children:c}),d.jsx("td",{className:"px-4 py-2 text-right",children:"100%"})]})]})]})})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Payment Log"})}),d.jsx(Ne,{className:"p-0 max-h-80 overflow-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500 sticky top-0",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2 w-20",children:"#"}),d.jsx("th",{className:"text-left px-4 py-2",children:"Connector"})]})}),d.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:Array.from({length:parseInt(c)||0}).map((k,H)=>{var de;let K=0,me=((de=y[0])==null?void 0:de.name)||"",_e=0;for(let fe=0;feV(k=>!k),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(Jh,{size:14}),"API Response"]}),B?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),B&&v&&d.jsx(Ne,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(v,null,2)})})]})]}):d.jsx(Te,{children:d.jsxs(Ne,{className:"py-16 text-center",children:[d.jsx(Vf,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Enter the number of payments and click "Visualize Distribution" to see how payments are split across connectors.'})]})}):t==="rule"?v?d.jsxs(d.Fragment,{children:[d.jsx(Te,{children:d.jsxs(Ne,{children:[d.jsx("div",{className:"flex items-start justify-between mb-3",children:d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Output Type"}),d.jsx("p",{className:"text-2xl font-bold text-slate-900",children:v.output.type})]})}),v.output.type==="single"&&v.output.connector&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Selected Gateway"}),d.jsx("p",{className:"text-lg font-semibold",children:v.output.connector.gateway_name}),v.output.connector.gateway_id&&d.jsxs("p",{className:"text-xs text-slate-500",children:["ID: ",v.output.connector.gateway_id]})]}),v.output.type==="priority"&&v.output.connectors&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Priority List"}),d.jsx("div",{className:"space-y-1",children:v.output.connectors.map((k,H)=>d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-500 text-white text-xs flex items-center justify-center",children:H+1}),d.jsx("span",{className:"font-medium",children:k.gateway_name}),k.gateway_id&&d.jsxs("span",{className:"text-xs text-slate-500",children:["(",k.gateway_id,")"]})]},H))})]}),v.output.type==="volume_split"&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Volume Split Result"}),d.jsx("p",{className:"text-sm text-slate-600",children:"See Volume Split tab for detailed visualization."})]})]})}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>D(k=>!k),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(Jh,{size:14}),"API Response"]}),I?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),I&&d.jsx(Ne,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(v,null,2)})})]})]}):d.jsx(Te,{children:d.jsxs(Ne,{className:"py-16 text-center",children:[d.jsx(Mc,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Configure rule parameters and click "Evaluate Rules" to test routing.'})]})}):t==="batch"?w.length>0?d.jsxs(d.Fragment,{children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Simulation Progress"})}),d.jsxs(Ne,{children:[d.jsxs("div",{className:"mb-4",children:[d.jsxs("div",{className:"flex justify-between text-xs text-slate-600 mb-1",children:[d.jsx("span",{children:"Progress"}),d.jsxs("span",{children:[Math.round(w.length/(parseInt(a.totalPayments)||1)*100),"%"]})]}),d.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:d.jsx("div",{className:"bg-brand-500 h-2 rounded-full transition-all duration-300",style:{width:`${w.length/(parseInt(a.totalPayments)||1)*100}%`}})})]}),Object.keys(ne).length>0&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-xs font-medium text-slate-700",children:"Gateway Selection Summary"}),Object.entries(ne).map(([k,H])=>d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"font-medium",children:k}),d.jsxs("div",{className:"flex gap-3 text-xs",children:[d.jsxs("span",{className:"text-emerald-600",children:[H.success," ✓"]}),d.jsxs("span",{className:"text-red-500",children:[H.failure," ✗"]}),d.jsxs("span",{className:"text-slate-500",children:["(",H.total," total)"]})]})]},k))]})]})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Transaction Log"})}),d.jsx(Ne,{className:"p-0 max-h-96 overflow-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 sticky top-0",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-3 py-2",children:"#"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Payment ID"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Gateway"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Outcome"})]})}),d.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:w.map((k,H)=>d.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16]",children:[d.jsx("td",{className:"px-3 py-2 text-slate-500",children:H+1}),d.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:k.paymentId.slice(-8)}),d.jsx("td",{className:"px-3 py-2 font-medium",children:k.decidedGateway}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(Qt,{variant:k.status==="CHARGED"?"green":"red",children:k.status})})]},k.paymentId))})]})})]})]}):d.jsx(Te,{children:d.jsxs(Ne,{className:"py-16 text-center",children:[d.jsx(Qh,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.'})]})}):h?d.jsxs(d.Fragment,{children:[d.jsx(Te,{children:d.jsxs(Ne,{children:[d.jsxs("div",{className:"flex items-start justify-between mb-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Decided Gateway"}),d.jsx("p",{className:"text-3xl font-bold text-slate-900",children:h.decided_gateway})]}),d.jsxs("div",{className:"text-right space-y-1",children:[d.jsx("div",{children:d.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Yoe(h.routing_approach)}`,children:h.routing_approach})}),h.is_scheduled_outage&&d.jsx(Qt,{variant:"red",children:"Scheduled Outage"}),h.latency!=null&&d.jsxs("p",{className:"text-xs text-slate-400",children:[h.latency,"ms"]})]})]}),h.routing_dimension&&d.jsxs("div",{className:"flex gap-4 text-sm text-slate-600 border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Dimension"}),d.jsx("p",{className:"font-medium",children:h.routing_dimension})]}),h.routing_dimension_level&&d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Level"}),d.jsx("p",{className:"font-medium",children:h.routing_dimension_level})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Reset"}),d.jsx("p",{className:"font-medium",children:h.reset_approach})]})]})]})}),Z.length>0&&d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Scores"}),d.jsxs(ht,{size:"sm",variant:"ghost",onClick:Ae,className:"text-xs",children:[d.jsx(_I,{size:12})," Refresh"]})]})}),d.jsx(Ne,{children:d.jsx(mf,{width:"100%",height:Z.length*40+20,children:d.jsxs(fj,{data:Z,layout:"vertical",margin:{left:10,right:30},children:[d.jsx(qu,{type:"number",domain:[0,100],tickFormatter:k=>`${k}%`,tick:{fontSize:11,fill:"#66667a"},axisLine:{stroke:"#1c1c24"},tickLine:!1}),d.jsx(Xu,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#8e8ea0"},width:60,axisLine:!1,tickLine:!1}),d.jsx(Pr,{formatter:k=>`${k}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),d.jsx(Qi,{dataKey:"score",radius:[0,4,4,0],children:Z.map((k,H)=>d.jsx(Pa,{fill:k.name===h.decided_gateway?"#0069ED":k.score<30?"#ef4444":k.score<60?"#f59e0b":"#10b981"},H))})]})})})]}),h.filter_wise_gateways&&d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>P(k=>!k),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:["Filter Chain",N?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),N&&d.jsx(Ne,{className:"space-y-2",children:Object.entries(h.filter_wise_gateways).map(([k,H])=>d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("span",{className:"text-xs font-mono bg-slate-100 dark:bg-[#111118] text-slate-600 rounded-md px-2 py-0.5 mt-0.5 shrink-0 border border-slate-200 dark:border-[#1c1c24]",children:k}),d.jsx("div",{className:"flex flex-wrap gap-1",children:Array.isArray(H)?H.map(K=>d.jsx("span",{className:"text-xs bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20 rounded-md px-2 py-0.5",children:K},K)):d.jsx("span",{className:"text-xs text-slate-400",children:"—"})})]},k))})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>D(k=>!k),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(Jh,{size:14}),"API Response"]}),I?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),I&&d.jsx(Ne,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(h,null,2)})})]})]}):d.jsx(Te,{children:d.jsxs(Ne,{className:"py-16 text-center",children:[d.jsx(Mc,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Fill in the parameters and click "Run Decision" to see the routing result.'})]})})})]})]})}function Qoe(){return d.jsx(HR,{children:d.jsxs(_n,{element:d.jsx(cM,{}),children:[d.jsx(_n,{index:!0,element:d.jsx(VM,{})}),d.jsx(_n,{path:"routing",element:d.jsx(WM,{})}),d.jsx(_n,{path:"routing/sr",element:d.jsx(eL,{})}),d.jsx(_n,{path:"routing/rules",element:d.jsx(X4,{})}),d.jsx(_n,{path:"routing/volume",element:d.jsx(Foe,{})}),d.jsx(_n,{path:"routing/debit",element:d.jsx(Uoe,{})}),d.jsx(_n,{path:"decisions",element:d.jsx(Zoe,{})}),d.jsx(_n,{path:"*",element:d.jsx(UR,{to:".",replace:!0})})]})})}class Joe extends j.Component{constructor(){super(...arguments);ob(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(r){return{error:r,errorInfo:null}}componentDidCatch(r,n){console.log(` +`+"!".repeat(80)),console.log("[ERROR BOUNDARY] Component Error Caught"),console.log(`Timestamp: ${new Date().toISOString()}`),console.log("Error Message:",r.message),console.log("Error Stack:",r.stack),console.log("Component Stack:",n.componentStack),console.log("!".repeat(80)+` +`),this.setState({errorInfo:n})}render(){return this.state.error?d.jsxs("div",{style:{padding:32,fontFamily:"monospace",color:"red"},children:[d.jsx("h2",{children:"Dashboard Error"}),d.jsx("pre",{children:this.state.error.message}),d.jsx("pre",{children:this.state.error.stack}),this.state.errorInfo&&d.jsxs("pre",{style:{marginTop:16,color:"darkred"},children:["Component Stack:",this.state.errorInfo.componentStack]})]}):this.props.children}}console.log(` +`+"=".repeat(80));console.log("[APP STARTUP] Dashboard initializing...");console.log(`Timestamp: ${new Date().toISOString()}`);console.log("Environment: production");console.log("Base URL: /dashboard");console.log("=".repeat(80)+` +`);window.onerror=(e,t,r,n,i)=>{console.log(` +`+"!".repeat(80)),console.log("[WINDOW ERROR]"),console.log("Message:",e),console.log("Source:",t),console.log("Line:",r,"Column:",n),i&&(console.log("Error:",i.message),console.log("Stack:",i.stack)),console.log("!".repeat(80)+` +`)};window.onunhandledrejection=e=>{console.log(` +`+"!".repeat(80)),console.log("[UNHANDLED PROMISE REJECTION]"),console.log("Reason:",e.reason),e.reason instanceof Error&&console.log("Stack:",e.reason.stack),console.log("!".repeat(80)+` +`)};Zm.createRoot(document.getElementById("root")).render(d.jsx(T.StrictMode,{children:d.jsx(Joe,{children:d.jsx(JR,{basename:"/dashboard",children:d.jsx(Qoe,{})})})})); diff --git a/website/dist/assets/index-D41MAvos.css b/website/dist/assets/index-D41MAvos.css new file mode 100644 index 00000000..bd5680e1 --- /dev/null +++ b/website/dist/assets/index-D41MAvos.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Menlo,Monaco,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html{color-scheme:light}html.dark{color-scheme:dark}html,body{font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark html,.dark body{color:#f1f5f9}html,body{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}html:is(.dark *),body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark p,.dark span,.dark h1,.dark h2,.dark h3,.dark h4,.dark h5,.dark h6{color:#f1f5f9}p,span,h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}p:is(.dark *),span:is(.dark *),h1:is(.dark *),h2:is(.dark *),h3:is(.dark *),h4:is(.dark *),h5:is(.dark *),h6:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark p.text-slate-500:is(.dark *),.dark span.text-slate-500:is(.dark *),.dark div.text-slate-500:is(.dark *){color:#64748b}p.text-slate-500:is(.dark *),span.text-slate-500:is(.dark *),div.text-slate-500:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}p.text-slate-600:is(.dark *),span.text-slate-600:is(.dark *),div.text-slate-600:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .text-slate-900,.dark .text-slate-800{color:#f1f5f9!important}.dark .text-slate-700{color:#e2e8f0!important}.dark .text-slate-600{color:#cbd5e1!important}.dark .text-slate-500{color:#94a3b8!important}.dark .text-slate-400{color:#64748b!important}.dark .text-blue-800,.dark .text-blue-700{color:#93c5fd!important}.dark .text-blue-600{color:#60a5fa!important}.dark .text-brand-500{color:#818cf8!important}.dark .bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .bg-slate-100{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1));-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.dark :where(input:not([type=checkbox]):not([type=radio]):not([type=range])),.dark :where(select),.dark :where(textarea){color:#f1f5f9}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){border-radius:9999px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::-moz-placeholder,:where(select)::-moz-placeholder,:where(textarea)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::placeholder,:where(select)::placeholder,:where(textarea)::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus,:where(select):focus,:where(textarea):focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(99 102 241 / .2)}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *),:where(select):is(.dark *),:where(textarea):is(.dark *){border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::-moz-placeholder,:where(select):is(.dark *)::-moz-placeholder,:where(textarea):is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::placeholder,:where(select):is(.dark *)::placeholder,:where(textarea):is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus:is(.dark *),:where(select):focus:is(.dark *),:where(textarea):focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 51 56 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){box-shadow:0 1px 2px #0000000d!important;font-family:Outfit,sans-serif}.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),.dark select,.dark textarea{box-shadow:none!important}.dark select option{color:#f1f5f9}select option{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}select option:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}input[type=range]{accent-color:#6366f1}input[type=range]:is(.dark *){accent-color:#fff}input[type=radio],input[type=checkbox]{height:1rem;width:1rem;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));accent-color:#6366f1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}input[type=radio]:is(.dark *),input[type=checkbox]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));accent-color:#fff}input[type=radio]{border-radius:50%}input[type=checkbox]{border-radius:4px}input[type=radio]:checked,input[type=checkbox]:checked{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}input[type=radio]:checked:is(.dark *),input[type=checkbox]:checked:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-20{z-index:20}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-\[76px\]{height:76px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-36{width:9rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-9{width:2.25rem}.w-\[calc\(100\%-12px\)\]{width:calc(100% - 12px)}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.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-\[1fr_100px_32px\]{grid-template-columns:1fr 100px 32px}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\.5{gap:.875rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#1c1c24\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(28 28 36 / var(--tw-divide-opacity, 1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-\[14px\]{border-radius:14px}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[\#1c2d50\]{--tw-border-opacity: 1;border-color:rgb(28 45 80 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-brand-600{--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity, 1))}.border-emerald-500\/20{border-color:#10b98133}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-t-gray-500{--tw-border-opacity: 1;border-top-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.bg-\[\#07070b\]{--tw-bg-opacity: 1;background-color:rgb(7 7 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#f8fafc\]{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-brand-50\/50{background-color:#eef2ff80}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-brand-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-3{padding-bottom:.75rem}.pl-1{padding-left:.25rem}.pl-6{padding-left:1.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Menlo,Monaco,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.text-\[16px\]{font-size:16px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.accent-brand-500{accent-color:#6366f1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.ring-emerald-500\/20{--tw-ring-color: rgb(16 185 129 / .2)}.ring-orange-500\/20{--tw-ring-color: rgb(249 115 22 / .2)}.ring-purple-500\/20{--tw-ring-color: rgb(168 85 247 / .2)}.ring-red-500\/20{--tw-ring-color: rgb(239 68 68 / .2)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.glass-panel{position:relative;overflow:hidden;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.glass-panel:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 26 29 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1));--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark .glass-panel-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.glass-panel-hover:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.glass-panel-hover:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #a855f7 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient:is(.dark *){--tw-gradient-from: #9b51e0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(155 81 224 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #4f46e5 var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-gradient-to: #0ea5e9 var(--tw-gradient-to-position)}.aurora-top{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#9b51e0,#4f46e5,#0ea5e9,transparent);opacity:.8;z-index:100}.dark .hover\:text-slate-900:hover{color:#f1f5f9!important}.dark .hover\:text-slate-700:hover{color:#e2e8f0!important}.dark .hover\:text-brand-500:hover{color:#818cf8!important}.dark .hover\:bg-slate-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .hover\:bg-slate-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}.group:hover .group-hover\:text-slate-600p:is(.dark *),.group:hover .group-hover\:text-slate-600 span:is(.dark *),.group:hover .group-hover\:text-slate-600 div:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .group:hover .group-hover\:text-slate-600{color:#cbd5e1!important}.last\:border-0:last-child{border-width:0px}.hover\:bg-brand-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#28282f\]:focus{--tw-border-opacity: 1;border-color:rgb(40 40 47 / var(--tw-border-opacity, 1))}.focus\:border-slate-400:focus{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-brand-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-offset-1:focus{--tw-ring-offset-width: 1px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.dark\:divide-\[\#222226\]:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(34 34 38 / var(--tw-divide-opacity, 1))}.dark\:border-\[\#151515\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 21 21 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c1f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 31 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c24\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 36 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222222\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222226\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#27272a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:border-\[\#2a2a2e\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 46 / var(--tw-border-opacity, 1))}.dark\:border-\[\#5c1c1c\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(92 28 28 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#000000\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0a0a0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c0e\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f11\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f16\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 22 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111114\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111118\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121214\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151515\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151518\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#2a0505\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(42 5 5 / var(--tw-bg-opacity, 1))}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:text-\[\#55555e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(85 85 94 / var(--tw-text-opacity, 1))}.dark\:text-\[\#66666e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(102 102 110 / var(--tw-text-opacity, 1))}.dark\:text-\[\#888891\]:is(.dark *){--tw-text-opacity: 1;color:rgb(136 136 145 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a1a1aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:hover\:bg-\[\#0c0c0e\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#121214\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#18181b\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#222222\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#380808\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(56 8 8 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-slate-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:border-\[\#444444\]:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(68 68 68 / var(--tw-border-opacity, 1))}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 768px){.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/website/dist/index.html b/website/dist/index.html new file mode 100644 index 00000000..b5bb5705 --- /dev/null +++ b/website/dist/index.html @@ -0,0 +1,14 @@ + + + + + + + Decision Engine Dashboard + + + + +
+ + diff --git a/website/index.html b/website/index.html new file mode 100644 index 00000000..4c17bd5c --- /dev/null +++ b/website/index.html @@ -0,0 +1,13 @@ + + + + + + + Decision Engine Dashboard + + +
+ + + diff --git a/website/package-lock.json b/website/package-lock.json new file mode 100644 index 00000000..c51b183d --- /dev/null +++ b/website/package-lock.json @@ -0,0 +1,3239 @@ +{ + "name": "decision-engine-dashboard", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "decision-engine-dashboard", + "version": "0.0.1", + "dependencies": { + "@dnd-kit/core": "^6.1.0", + "@dnd-kit/sortable": "^8.0.0", + "@dnd-kit/utilities": "^3.2.2", + "@hookform/resolvers": "^3.3.4", + "lucide-react": "^0.363.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-hook-form": "^7.51.0", + "react-router-dom": "^6.22.3", + "recharts": "^2.12.2", + "swr": "^2.2.5", + "zod": "^3.22.4", + "zustand": "^4.5.2" + }, + "devDependencies": { + "@types/react": "^18.2.66", + "@types/react-dom": "^18.2.22", + "@vitejs/plugin-react": "^4.2.1", + "autoprefixer": "^10.4.19", + "postcss": "^8.4.38", + "tailwindcss": "^3.4.3", + "typescript": "^5.2.2", + "vite": "^5.2.0" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", + "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", + "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", + "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz", + "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@dnd-kit/accessibility": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz", + "integrity": "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@dnd-kit/core": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz", + "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==", + "license": "MIT", + "dependencies": { + "@dnd-kit/accessibility": "^3.1.1", + "@dnd-kit/utilities": "^3.2.2", + "tslib": "^2.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@dnd-kit/sortable": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@dnd-kit/sortable/-/sortable-8.0.0.tgz", + "integrity": "sha512-U3jk5ebVXe1Lr7c2wU7SBZjcWdQP+j7peHJfCspnA81enlu88Mgd7CC8Q+pub9ubP7eKVETzJW+IBAhsqbSu/g==", + "license": "MIT", + "dependencies": { + "@dnd-kit/utilities": "^3.2.2", + "tslib": "^2.0.0" + }, + "peerDependencies": { + "@dnd-kit/core": "^6.1.0", + "react": ">=16.8.0" + } + }, + "node_modules/@dnd-kit/utilities": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@dnd-kit/utilities/-/utilities-3.2.2.tgz", + "integrity": "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@hookform/resolvers": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-3.10.0.tgz", + "integrity": "sha512-79Dv+3mDF7i+2ajj7SkypSKHhl1cbln1OGavqrsF7p6mbUv11xpqpacPsGDCTRvCSjEEIez2ef1NveSVL3b0Ag==", + "license": "MIT", + "peerDependencies": { + "react-hook-form": "^7.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@remix-run/router": { + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.2.tgz", + "integrity": "sha512-Ic6m2U/rMjTkhERIa/0ZtXJP17QUi2CbWE7cqx4J58M8aA3QTfW+2UlQ4psvTX9IO1RfNVhK3pcpdjej7L+t2w==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz", + "integrity": "sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz", + "integrity": "sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz", + "integrity": "sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz", + "integrity": "sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz", + "integrity": "sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz", + "integrity": "sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz", + "integrity": "sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz", + "integrity": "sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz", + "integrity": "sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz", + "integrity": "sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz", + "integrity": "sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz", + "integrity": "sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz", + "integrity": "sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz", + "integrity": "sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz", + "integrity": "sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz", + "integrity": "sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz", + "integrity": "sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz", + "integrity": "sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz", + "integrity": "sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz", + "integrity": "sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz", + "integrity": "sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz", + "integrity": "sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz", + "integrity": "sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz", + "integrity": "sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz", + "integrity": "sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", + "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-shape": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz", + "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.28", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz", + "integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/autoprefixer": { + "version": "10.4.27", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.27.tgz", + "integrity": "sha512-NP9APE+tO+LuJGn7/9+cohklunJsXWiaWEfV3si4Gi/XHDwVNgkwr1J3RQYFIvPy76GmJ9/bW8vyoU1LcxwKHA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.1", + "caniuse-lite": "^1.0.30001774", + "fraction.js": "^5.3.4", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.16", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.16.tgz", + "integrity": "sha512-Lyf3aK28zpsD1yQMiiHD4RvVb6UdMoo8xzG2XzFIfR9luPzOpcBlAsT/qfB1XWS1bxWT+UtE4WmQgsp297FYOA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", + "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.10.12", + "caniuse-lite": "^1.0.30001782", + "electron-to-chromium": "^1.5.328", + "node-releases": "^2.0.36", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001786", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001786.tgz", + "integrity": "sha512-4oxTZEvqmLLrERwxO76yfKM7acZo310U+v4kqexI2TL1DkkUEMT8UijrxxcnVdxR3qkVf5awGRX+4Z6aPHVKrA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", + "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js-light": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", + "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", + "license": "MIT" + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.332", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.332.tgz", + "integrity": "sha512-7OOtytmh/rINMLwaFTbcMVvYXO3AUm029X0LcyfYk0B557RlPkdpTpnH9+htMlfu5dKwOmT0+Zs2Aw+lnn6TeQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/fast-equals": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.4.0.tgz", + "integrity": "sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lucide-react": { + "version": "0.363.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.363.0.tgz", + "integrity": "sha512-AlsfPCsXQyQx7wwsIgzcKOL9LwC498LIMAo+c0Es5PkHJa33xwmYAkkSoKoJWWWSYQEStqu58/jT4tL2gi32uQ==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.37", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", + "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.5.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", + "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", + "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-hook-form": { + "version": "7.72.1", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.72.1.tgz", + "integrity": "sha512-RhwBoy2ygeVZje+C+bwJ8g0NjTdBmDlJvAUHTxRjTmSUKPYsKfMphkS2sgEMotsY03bP358yEYlnUeZy//D9Ig==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18 || ^19" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-router": { + "version": "6.30.3", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.3.tgz", + "integrity": "sha512-XRnlbKMTmktBkjCLE8/XcZFlnHvr2Ltdr1eJX4idL55/9BbORzyZEaIkBFDhFGCEWBBItsVrDxwx3gnisMitdw==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.23.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/react-router-dom": { + "version": "6.30.3", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.3.tgz", + "integrity": "sha512-pxPcv1AczD4vso7G4Z3TKcvlxK7g7TNt3/FNGMhfqyntocvYKj+GCatfigGDjbLozC4baguJ0ReCigoDJXb0ag==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.23.2", + "react-router": "6.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, + "node_modules/react-smooth": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.4.tgz", + "integrity": "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==", + "license": "MIT", + "dependencies": { + "fast-equals": "^5.0.1", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/recharts": { + "version": "2.15.4", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.15.4.tgz", + "integrity": "sha512-UT/q6fwS3c1dHbXv2uFgYJ9BMFHu3fwnd7AYZaEQhXuYQ4hgsxLvsUXzGdKeZrW5xopzDCvuA2N41WJ88I7zIw==", + "license": "MIT", + "dependencies": { + "clsx": "^2.0.0", + "eventemitter3": "^4.0.1", + "lodash": "^4.17.21", + "react-is": "^18.3.1", + "react-smooth": "^4.0.4", + "recharts-scale": "^0.4.4", + "tiny-invariant": "^1.3.1", + "victory-vendor": "^36.6.8" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/recharts-scale": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/recharts-scale/-/recharts-scale-0.4.5.tgz", + "integrity": "sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==", + "license": "MIT", + "dependencies": { + "decimal.js-light": "^2.4.1" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.1.tgz", + "integrity": "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.60.1", + "@rollup/rollup-android-arm64": "4.60.1", + "@rollup/rollup-darwin-arm64": "4.60.1", + "@rollup/rollup-darwin-x64": "4.60.1", + "@rollup/rollup-freebsd-arm64": "4.60.1", + "@rollup/rollup-freebsd-x64": "4.60.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.1", + "@rollup/rollup-linux-arm-musleabihf": "4.60.1", + "@rollup/rollup-linux-arm64-gnu": "4.60.1", + "@rollup/rollup-linux-arm64-musl": "4.60.1", + "@rollup/rollup-linux-loong64-gnu": "4.60.1", + "@rollup/rollup-linux-loong64-musl": "4.60.1", + "@rollup/rollup-linux-ppc64-gnu": "4.60.1", + "@rollup/rollup-linux-ppc64-musl": "4.60.1", + "@rollup/rollup-linux-riscv64-gnu": "4.60.1", + "@rollup/rollup-linux-riscv64-musl": "4.60.1", + "@rollup/rollup-linux-s390x-gnu": "4.60.1", + "@rollup/rollup-linux-x64-gnu": "4.60.1", + "@rollup/rollup-linux-x64-musl": "4.60.1", + "@rollup/rollup-openbsd-x64": "4.60.1", + "@rollup/rollup-openharmony-arm64": "4.60.1", + "@rollup/rollup-win32-arm64-msvc": "4.60.1", + "@rollup/rollup-win32-ia32-msvc": "4.60.1", + "@rollup/rollup-win32-x64-gnu": "4.60.1", + "@rollup/rollup-win32-x64-msvc": "4.60.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/swr": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/swr/-/swr-2.4.1.tgz", + "integrity": "sha512-2CC6CiKQtEwaEeNiqWTAw9PGykW8SR5zZX8MZk6TeAvEAnVS7Visz8WzphqgtQ8v2xz/4Q5K+j+SeMaKXeeQIA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3", + "use-sync-external-store": "^1.6.0" + }, + "peerDependencies": { + "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.19", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", + "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.6.0", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.7", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/victory-vendor": { + "version": "36.9.2", + "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz", + "integrity": "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==", + "license": "MIT AND ISC", + "dependencies": { + "@types/d3-array": "^3.0.3", + "@types/d3-ease": "^3.0.0", + "@types/d3-interpolate": "^3.0.1", + "@types/d3-scale": "^4.0.2", + "@types/d3-shape": "^3.1.0", + "@types/d3-time": "^3.0.0", + "@types/d3-timer": "^3.0.0", + "d3-array": "^3.1.6", + "d3-ease": "^3.0.1", + "d3-interpolate": "^3.0.1", + "d3-scale": "^4.0.2", + "d3-shape": "^3.1.0", + "d3-time": "^3.0.0", + "d3-timer": "^3.0.1" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zustand": { + "version": "4.5.7", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", + "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", + "license": "MIT", + "dependencies": { + "use-sync-external-store": "^1.2.2" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0.6", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } + } + } +} diff --git a/website/package.json b/website/package.json new file mode 100644 index 00000000..db3e5889 --- /dev/null +++ b/website/package.json @@ -0,0 +1,36 @@ +{ + "name": "decision-engine-dashboard", + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@dnd-kit/core": "^6.1.0", + "@dnd-kit/sortable": "^8.0.0", + "@dnd-kit/utilities": "^3.2.2", + "@hookform/resolvers": "^3.3.4", + "lucide-react": "^0.363.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-hook-form": "^7.51.0", + "react-router-dom": "^6.22.3", + "recharts": "^2.12.2", + "swr": "^2.2.5", + "zod": "^3.22.4", + "zustand": "^4.5.2" + }, + "devDependencies": { + "@types/react": "^18.2.66", + "@types/react-dom": "^18.2.22", + "@vitejs/plugin-react": "^4.2.1", + "autoprefixer": "^10.4.19", + "postcss": "^8.4.38", + "tailwindcss": "^3.4.3", + "typescript": "^5.2.2", + "vite": "^5.2.0" + } +} diff --git a/website/postcss.config.js b/website/postcss.config.js new file mode 100644 index 00000000..2e7af2b7 --- /dev/null +++ b/website/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/website/src/App.tsx b/website/src/App.tsx new file mode 100644 index 00000000..9161b15b --- /dev/null +++ b/website/src/App.tsx @@ -0,0 +1,26 @@ +import { Routes, Route, Navigate } from 'react-router-dom' +import { AppShell } from './components/layout/AppShell' +import { OverviewPage } from './components/pages/OverviewPage' +import { RoutingHubPage } from './components/pages/RoutingHubPage' +import { SRRoutingPage } from './components/pages/SRRoutingPage' +import { EuclidRulesPage } from './components/pages/EuclidRulesPage' +import { VolumeSplitPage } from './components/pages/VolumeSplitPage' +import { DebitRoutingPage } from './components/pages/DebitRoutingPage' +import { DecisionExplorerPage } from './components/pages/DecisionExplorerPage' + +export default function App() { + return ( + + }> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + + ) +} diff --git a/website/src/ErrorBoundary.tsx b/website/src/ErrorBoundary.tsx new file mode 100644 index 00000000..da6fd2bc --- /dev/null +++ b/website/src/ErrorBoundary.tsx @@ -0,0 +1,41 @@ +import { Component, ReactNode } from 'react' + +interface Props { children: ReactNode } +interface State { error: Error | null; errorInfo: React.ErrorInfo | null } + +export class ErrorBoundary extends Component { + state: State = { error: null, errorInfo: null } + + static getDerivedStateFromError(error: Error): State { + return { error, errorInfo: null } + } + + componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { + console.log('\n' + '!'.repeat(80)) + console.log('[ERROR BOUNDARY] Component Error Caught') + console.log(`Timestamp: ${new Date().toISOString()}`) + console.log('Error Message:', error.message) + console.log('Error Stack:', error.stack) + console.log('Component Stack:', errorInfo.componentStack) + console.log('!'.repeat(80) + '\n') + this.setState({ errorInfo }) + } + + render() { + if (this.state.error) { + return ( +
+

Dashboard Error

+
{this.state.error.message}
+
{this.state.error.stack}
+ {this.state.errorInfo && ( +
+              Component Stack:{this.state.errorInfo.componentStack}
+            
+ )} +
+ ) + } + return this.props.children + } +} diff --git a/website/src/components/layout/AppShell.tsx b/website/src/components/layout/AppShell.tsx new file mode 100644 index 00000000..7912a8f2 --- /dev/null +++ b/website/src/components/layout/AppShell.tsx @@ -0,0 +1,18 @@ +import { Outlet } from 'react-router-dom' +import { Sidebar } from './Sidebar' +import { TopBar } from './TopBar' + +export function AppShell() { + return ( +
) } From 40098d7c6551c31585a0e224884e5ea478b54fc4 Mon Sep 17 00:00:00 2001 From: Prajjwal kumar Date: Fri, 17 Apr 2026 15:49:14 +0530 Subject: [PATCH 93/95] fix: correct ui --- website/dist/assets/index-Bf1zG_Ya.js | 334 -------- website/dist/assets/index-CHRCH7_J.css | 1 + website/dist/assets/index-CoBYwNuH.js | 348 +++++++++ website/dist/assets/index-XOTDNfmE.css | 1 - website/dist/index.html | 4 +- website/src/components/layout/AppShell.tsx | 5 +- website/src/components/layout/Sidebar.tsx | 115 ++- website/src/components/layout/TopBar.tsx | 20 +- .../src/components/pages/AnalyticsPage.tsx | 8 +- website/src/components/pages/OverviewPage.tsx | 711 ++++++++++++++---- website/src/components/ui/Badge.tsx | 12 +- website/src/components/ui/Card.tsx | 2 +- website/src/index.css | 8 +- 13 files changed, 1024 insertions(+), 545 deletions(-) delete mode 100644 website/dist/assets/index-Bf1zG_Ya.js create mode 100644 website/dist/assets/index-CHRCH7_J.css create mode 100644 website/dist/assets/index-CoBYwNuH.js delete mode 100644 website/dist/assets/index-XOTDNfmE.css diff --git a/website/dist/assets/index-Bf1zG_Ya.js b/website/dist/assets/index-Bf1zG_Ya.js deleted file mode 100644 index 8dba3f61..00000000 --- a/website/dist/assets/index-Bf1zG_Ya.js +++ /dev/null @@ -1,334 +0,0 @@ -var U$=Object.defineProperty;var V$=(e,t,r)=>t in e?U$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var zw=(e,t,r)=>V$(e,typeof t!="symbol"?t+"":t,r);function W$(e,t){for(var r=0;rn[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"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var md=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gA={exports:{}},dh={},xA={exports:{}},He={};/** - * @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 Xc=Symbol.for("react.element"),H$=Symbol.for("react.portal"),G$=Symbol.for("react.fragment"),q$=Symbol.for("react.strict_mode"),K$=Symbol.for("react.profiler"),X$=Symbol.for("react.provider"),Y$=Symbol.for("react.context"),Z$=Symbol.for("react.forward_ref"),Q$=Symbol.for("react.suspense"),J$=Symbol.for("react.memo"),eI=Symbol.for("react.lazy"),Bw=Symbol.iterator;function tI(e){return e===null||typeof e!="object"?null:(e=Bw&&e[Bw]||e["@@iterator"],typeof e=="function"?e:null)}var bA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wA=Object.assign,_A={};function ml(e,t,r){this.props=e,this.context=t,this.refs=_A,this.updater=r||bA}ml.prototype.isReactComponent={};ml.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ml.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SA(){}SA.prototype=ml.prototype;function ux(e,t,r){this.props=e,this.context=t,this.refs=_A,this.updater=r||bA}var cx=ux.prototype=new SA;cx.constructor=ux;wA(cx,ml.prototype);cx.isPureReactComponent=!0;var Uw=Array.isArray,jA=Object.prototype.hasOwnProperty,dx={current:null},OA={key:!0,ref:!0,__self:!0,__source:!0};function kA(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)jA.call(t,n)&&!OA.hasOwnProperty(n)&&(a[n]=t[n]);var s=arguments.length-2;if(s===1)a.children=r;else if(1>>1,K=D[J];if(0>>1;Ja(be,q))uea(Ce,be)?(D[J]=Ce,D[ue]=q,J=ue):(D[J]=be,D[Q]=q,J=Q);else if(uea(Ce,q))D[J]=Ce,D[ue]=q,J=ue;else break e}}return U}function a(D,U){var q=D.sortIndex-U.sortIndex;return q!==0?q:D.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,d=null,p=3,h=!1,g=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(D){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=D)n(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=r(u)}}function S(D){if(y=!1,w(D),!g)if(r(l)!==null)g=!0,W(b);else{var U=r(u);U!==null&&V(S,U.startTime-D)}}function b(D,U){g=!1,y&&(y=!1,x(k),k=-1),h=!0;var q=p;try{for(w(U),d=r(l);d!==null&&(!(d.expirationTime>U)||D&&!T());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var K=J(d.expirationTime<=U);U=e.unstable_now(),typeof K=="function"?d.callback=K:d===r(l)&&n(l),w(U)}else n(l);d=r(l)}if(d!==null)var ae=!0;else{var Q=r(u);Q!==null&&V(S,Q.startTime-U),ae=!1}return ae}finally{d=null,p=q,h=!1}}var _=!1,O=null,k=-1,A=5,$=-1;function T(){return!(e.unstable_now()-$D||125J?(D.sortIndex=q,t(u,D),r(l)===null&&D===r(u)&&(y?(x(k),k=-1):y=!0,V(S,q-J))):(D.sortIndex=K,t(l,D),g||h||(g=!0,W(b))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var U=p;return function(){var q=p;p=U;try{return D.apply(this,arguments)}finally{p=q}}}})(CA);NA.exports=CA;var pI=NA.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 hI=j,Qr=pI;function ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dv=Object.prototype.hasOwnProperty,mI=/^[: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]*$/,Ww={},Hw={};function yI(e){return dv.call(Hw,e)?!0:dv.call(Ww,e)?!1:mI.test(e)?Hw[e]=!0:(Ww[e]=!0,!1)}function vI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function gI(e,t,r,n){if(t===null||typeof t>"u"||vI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pr(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ur={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ur[e]=new Pr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ur[t]=new Pr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ur[e]=new Pr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ur[e]=new Pr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ur[e]=new Pr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ur[e]=new Pr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ur[e]=new Pr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ur[e]=new Pr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ur[e]=new Pr(e,5,!1,e.toLowerCase(),null,!1,!1)});var px=/[\-:]([a-z])/g;function hx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(px,hx);ur[t]=new Pr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(px,hx);ur[t]=new Pr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(px,hx);ur[t]=new Pr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ur[e]=new Pr(e,1,!1,e.toLowerCase(),null,!1,!1)});ur.xlinkHref=new Pr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ur[e]=new Pr(e,1,!1,e.toLowerCase(),null,!0,!0)});function mx(e,t,r,n){var a=ur.hasOwnProperty(t)?ur[t]:null;(a!==null?a.type!==0:n||!(2s||a[o]!==i[s]){var l=` -`+a[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Cm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?su(e):""}function xI(e){switch(e.tag){case 5:return su(e.type);case 16:return su("Lazy");case 13:return su("Suspense");case 19:return su("SuspenseList");case 0:case 2:case 15:return e=Tm(e.type,!1),e;case 11:return e=Tm(e.type.render,!1),e;case 1:return e=Tm(e.type,!0),e;default:return""}}function mv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qo:return"Fragment";case Zo:return"Portal";case fv:return"Profiler";case yx:return"StrictMode";case pv:return"Suspense";case hv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case IA:return(e.displayName||"Context")+".Consumer";case $A:return(e._context.displayName||"Context")+".Provider";case vx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gx:return t=e.displayName||null,t!==null?t:mv(e.type)||"Memo";case Qa:t=e._payload,e=e._init;try{return mv(e(t))}catch{}}return null}function bI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mv(t);case 8:return t===yx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ji(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function MA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wI(e){var t=MA(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gd(e){e._valueTracker||(e._valueTracker=wI(e))}function DA(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=MA(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Sf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yv(e,t){var r=t.checked;return At({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function qw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ji(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function LA(e,t){t=t.checked,t!=null&&mx(e,"checked",t,!1)}function vv(e,t){LA(e,t);var r=ji(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gv(e,t.type,r):t.hasOwnProperty("defaultValue")&&gv(e,t.type,ji(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function gv(e,t,r){(t!=="number"||Sf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var lu=Array.isArray;function ys(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=xd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var wu={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},_I=["Webkit","ms","Moz","O"];Object.keys(wu).forEach(function(e){_I.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wu[t]=wu[e]})});function UA(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||wu.hasOwnProperty(e)&&wu[e]?(""+t).trim():t+"px"}function VA(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=UA(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var SI=At({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 wv(e,t){if(t){if(SI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function _v(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sv=null;function xx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jv=null,vs=null,gs=null;function Zw(e){if(e=Qc(e)){if(typeof jv!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=yh(t),jv(e.stateNode,e.type,t))}}function WA(e){vs?gs?gs.push(e):gs=[e]:vs=e}function HA(){if(vs){var e=vs,t=gs;if(gs=vs=null,Zw(e),t)for(e=0;e>>=0,e===0?32:31-(II(e)/RI|0)|0}var bd=64,wd=4194304;function uu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Af(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~a;s!==0?n=uu(s):(i&=o,i!==0&&(n=uu(i)))}else o=r&~a,o!==0?n=uu(o):i!==0&&(n=uu(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Yc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mn(t),e[t]=r}function FI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Su),o1=" ",s1=!1;function d2(e,t){switch(e){case"keyup":return pR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function f2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jo=!1;function mR(e,t){switch(e){case"compositionend":return f2(t);case"keypress":return t.which!==32?null:(s1=!0,o1);case"textInput":return e=t.data,e===o1&&s1?null:e;default:return null}}function yR(e,t){if(Jo)return e==="compositionend"||!Ax&&d2(e,t)?(e=u2(),lf=jx=si=null,Jo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=d1(r)}}function y2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function v2(){for(var e=window,t=Sf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Sf(e.document)}return t}function Ex(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function OR(e){var t=v2(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&y2(r.ownerDocument.documentElement,r)){if(n!==null&&Ex(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=f1(r,i);var o=f1(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,es=null,Nv=null,Ou=null,Cv=!1;function p1(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cv||es==null||es!==Sf(n)||(n=es,"selectionStart"in n&&Ex(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ou&&Yu(Ou,n)||(Ou=n,n=Nf(Nv,"onSelect"),0ns||(e.current=Dv[ns],Dv[ns]=null,ns--)}function ht(e,t){ns++,Dv[ns]=e.current,e.current=t}var Oi={},xr=Ti(Oi),Dr=Ti(!1),mo=Oi;function Cs(e,t){var r=e.type.contextTypes;if(!r)return Oi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Lr(e){return e=e.childContextTypes,e!=null}function Tf(){wt(Dr),wt(xr)}function b1(e,t,r){if(xr.current!==Oi)throw Error(ne(168));ht(xr,t),ht(Dr,r)}function k2(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(ne(108,bI(e)||"Unknown",a));return At({},r,n)}function $f(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oi,mo=xr.current,ht(xr,e),ht(Dr,Dr.current),!0}function w1(e,t,r){var n=e.stateNode;if(!n)throw Error(ne(169));r?(e=k2(e,t,mo),n.__reactInternalMemoizedMergedChildContext=e,wt(Dr),wt(xr),ht(xr,e)):wt(Dr),ht(Dr,r)}var ha=null,vh=!1,Gm=!1;function A2(e){ha===null?ha=[e]:ha.push(e)}function DR(e){vh=!0,A2(e)}function $i(){if(!Gm&&ha!==null){Gm=!0;var e=0,t=nt;try{var r=ha;for(nt=1;e>=o,a-=o,ya=1<<32-Mn(t)+a|r<k?(A=O,O=null):A=O.sibling;var $=p(x,O,w[k],S);if($===null){O===null&&(O=A);break}e&&O&&$.alternate===null&&t(x,O),m=i($,m,k),_===null?b=$:_.sibling=$,_=$,O=A}if(k===w.length)return r(x,O),_t&&qi(x,k),b;if(O===null){for(;kk?(A=O,O=null):A=O.sibling;var T=p(x,O,$.value,S);if(T===null){O===null&&(O=A);break}e&&O&&T.alternate===null&&t(x,O),m=i(T,m,k),_===null?b=T:_.sibling=T,_=T,O=A}if($.done)return r(x,O),_t&&qi(x,k),b;if(O===null){for(;!$.done;k++,$=w.next())$=d(x,$.value,S),$!==null&&(m=i($,m,k),_===null?b=$:_.sibling=$,_=$);return _t&&qi(x,k),b}for(O=n(x,O);!$.done;k++,$=w.next())$=h(O,x,k,$.value,S),$!==null&&(e&&$.alternate!==null&&O.delete($.key===null?k:$.key),m=i($,m,k),_===null?b=$:_.sibling=$,_=$);return e&&O.forEach(function(P){return t(x,P)}),_t&&qi(x,k),b}function v(x,m,w,S){if(typeof w=="object"&&w!==null&&w.type===Qo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case vd:e:{for(var b=w.key,_=m;_!==null;){if(_.key===b){if(b=w.type,b===Qo){if(_.tag===7){r(x,_.sibling),m=a(_,w.props.children),m.return=x,x=m;break e}}else if(_.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Qa&&j1(b)===_.type){r(x,_.sibling),m=a(_,w.props),m.ref=Ul(x,_,w),m.return=x,x=m;break e}r(x,_);break}else t(x,_);_=_.sibling}w.type===Qo?(m=uo(w.props.children,x.mode,S,w.key),m.return=x,x=m):(S=yf(w.type,w.key,w.props,null,x.mode,S),S.ref=Ul(x,m,w),S.return=x,x=S)}return o(x);case Zo:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){r(x,m.sibling),m=a(m,w.children||[]),m.return=x,x=m;break e}else{r(x,m);break}else t(x,m);m=m.sibling}m=ey(w,x.mode,S),m.return=x,x=m}return o(x);case Qa:return _=w._init,v(x,m,_(w._payload),S)}if(lu(w))return g(x,m,w,S);if(Dl(w))return y(x,m,w,S);Ed(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(r(x,m.sibling),m=a(m,w),m.return=x,x=m):(r(x,m),m=Jm(w,x.mode,S),m.return=x,x=m),o(x)):r(x,m)}return v}var $s=C2(!0),T2=C2(!1),Mf=Ti(null),Df=null,os=null,Tx=null;function $x(){Tx=os=Df=null}function Ix(e){var t=Mf.current;wt(Mf),e._currentValue=t}function zv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function bs(e,t){Df=e,Tx=os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ir=!0),e.firstContext=null)}function gn(e){var t=e._currentValue;if(Tx!==e)if(e={context:e,memoizedValue:t,next:null},os===null){if(Df===null)throw Error(ne(308));os=e,Df.dependencies={lanes:0,firstContext:e}}else os=os.next=e;return t}var eo=null;function Rx(e){eo===null?eo=[e]:eo.push(e)}function $2(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,Rx(t)):(r.next=a.next,a.next=r),t.interleaved=r,Pa(e,n)}function Pa(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ja=!1;function Mx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function I2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Sa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ye&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Pa(e,r)}return a=n.interleaved,a===null?(t.next=t,Rx(n)):(t.next=a.next,a.next=t),n.interleaved=t,Pa(e,r)}function cf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,wx(e,r)}}function O1(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Lf(e,t,r,n){var a=e.updateQueue;Ja=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,s=a.shared.pending;if(s!==null){a.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(i!==null){var d=a.baseState;o=0,f=u=l=null,s=i;do{var p=s.lane,h=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,y=s;switch(p=t,h=r,y.tag){case 1:if(g=y.payload,typeof g=="function"){d=g.call(h,d,p);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,p=typeof g=="function"?g.call(h,d,p):g,p==null)break e;d=At({},d,p);break e;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,l=d):f=f.next=h,o|=p;if(s=s.next,s===null){if(s=a.shared.pending,s===null)break;p=s,s=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(f===null&&(l=d),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=f,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);go|=o,e.lanes=o,e.memoizedState=d}}function k1(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Km.transition;Km.transition={};try{e(!1),t()}finally{nt=r,Km.transition=n}}function Z2(){return xn().memoizedState}function BR(e,t,r){var n=gi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Q2(e))J2(t,r);else if(r=$2(e,t,r,n),r!==null){var a=Ar();Dn(r,e,n,a),eE(r,t,n)}}function UR(e,t,r){var n=gi(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Q2(e))J2(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,r);if(a.hasEagerState=!0,a.eagerState=s,Fn(s,o)){var l=t.interleaved;l===null?(a.next=a,Rx(t)):(a.next=l.next,l.next=a),t.interleaved=a;return}}catch{}finally{}r=$2(e,t,a,n),r!==null&&(a=Ar(),Dn(r,e,n,a),eE(r,t,n))}}function Q2(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function J2(e,t){ku=zf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function eE(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,wx(e,r)}}var Bf={readContext:gn,useCallback:dr,useContext:dr,useEffect:dr,useImperativeHandle:dr,useInsertionEffect:dr,useLayoutEffect:dr,useMemo:dr,useReducer:dr,useRef:dr,useState:dr,useDebugValue:dr,useDeferredValue:dr,useTransition:dr,useMutableSource:dr,useSyncExternalStore:dr,useId:dr,unstable_isNewReconciler:!1},VR={readContext:gn,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:E1,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ff(4194308,4,G2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ff(4194308,4,e,t)},useInsertionEffect:function(e,t){return ff(4,2,e,t)},useMemo:function(e,t){var r=Wn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Wn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=BR.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:A1,useDebugValue:Wx,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=A1(!1),t=e[0];return e=zR.bind(null,e[1]),Wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,a=Wn();if(_t){if(r===void 0)throw Error(ne(407));r=r()}else{if(r=t(),nr===null)throw Error(ne(349));vo&30||L2(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,E1(z2.bind(null,n,i,e),[e]),n.flags|=2048,ac(9,F2.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Wn(),t=nr.identifierPrefix;if(_t){var r=va,n=ya;r=(n&~(1<<32-Mn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=rc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Gn]=t,e[Ju]=n,cE(e,t,!1,!1),t.stateNode=e;e:{switch(o=_v(r,n),r){case"dialog":yt("cancel",e),yt("close",e),a=n;break;case"iframe":case"object":case"embed":yt("load",e),a=n;break;case"video":case"audio":for(a=0;aMs&&(t.flags|=128,n=!0,Vl(i,!1),t.lanes=4194304)}else{if(!n)if(e=Ff(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Vl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!_t)return fr(t),null}else 2*It()-i.renderingStartTime>Ms&&r!==1073741824&&(t.flags|=128,n=!0,Vl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=It(),t.sibling=null,r=jt.current,ht(jt,n?r&1|2:r&1),t):(fr(t),null);case 22:case 23:return Yx(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Wr&1073741824&&(fr(t),t.subtreeFlags&6&&(t.flags|=8192)):fr(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function ZR(e,t){switch(Nx(t),t.tag){case 1:return Lr(t.type)&&Tf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Is(),wt(Dr),wt(xr),Fx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lx(t),null;case 13:if(wt(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));Ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return wt(jt),null;case 4:return Is(),null;case 10:return Ix(t.type._context),null;case 22:case 23:return Yx(),null;case 24:return null;default:return null}}var Nd=!1,yr=!1,QR=typeof WeakSet=="function"?WeakSet:Set,fe=null;function ss(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Nt(e,t,n)}else r.current=null}function Xv(e,t,r){try{r()}catch(n){Nt(e,t,n)}}var F1=!1;function JR(e,t){if(Tv=Ef,e=v2(),Ex(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,d=e,p=null;t:for(;;){for(var h;d!==r||a!==0&&d.nodeType!==3||(s=o+a),d!==i||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===r&&++u===a&&(s=o),p===i&&++f===n&&(l=o),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for($v={focusedElem:e,selectionRange:r},Ef=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,v=g.memoizedState,x=t.stateNode,m=x.getSnapshotBeforeUpdate(t.elementType===t.type?y:Pn(t.type,y),v);x.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(S){Nt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return g=F1,F1=!1,g}function Au(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Xv(t,r,i)}a=a.next}while(a!==n)}}function bh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Yv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function pE(e){var t=e.alternate;t!==null&&(e.alternate=null,pE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gn],delete t[Ju],delete t[Mv],delete t[RR],delete t[MR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hE(e){return e.tag===5||e.tag===3||e.tag===4}function z1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Cf));else if(n!==4&&(e=e.child,e!==null))for(Zv(e,t,r),e=e.sibling;e!==null;)Zv(e,t,r),e=e.sibling}function Qv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Qv(e,t,r),e=e.sibling;e!==null;)Qv(e,t,r),e=e.sibling}var sr=null,Nn=!1;function Ka(e,t,r){for(r=r.child;r!==null;)mE(e,t,r),r=r.sibling}function mE(e,t,r){if(Yn&&typeof Yn.onCommitFiberUnmount=="function")try{Yn.onCommitFiberUnmount(fh,r)}catch{}switch(r.tag){case 5:yr||ss(r,t);case 6:var n=sr,a=Nn;sr=null,Ka(e,t,r),sr=n,Nn=a,sr!==null&&(Nn?(e=sr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):sr.removeChild(r.stateNode));break;case 18:sr!==null&&(Nn?(e=sr,r=r.stateNode,e.nodeType===8?Hm(e.parentNode,r):e.nodeType===1&&Hm(e,r),Ku(e)):Hm(sr,r.stateNode));break;case 4:n=sr,a=Nn,sr=r.stateNode.containerInfo,Nn=!0,Ka(e,t,r),sr=n,Nn=a;break;case 0:case 11:case 14:case 15:if(!yr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Xv(r,t,o),a=a.next}while(a!==n)}Ka(e,t,r);break;case 1:if(!yr&&(ss(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Nt(r,t,s)}Ka(e,t,r);break;case 21:Ka(e,t,r);break;case 22:r.mode&1?(yr=(n=yr)||r.memoizedState!==null,Ka(e,t,r),yr=n):Ka(e,t,r);break;default:Ka(e,t,r)}}function B1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new QR),t.forEach(function(n){var a=lM.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function kn(e,t){var r=t.deletions;if(r!==null)for(var n=0;na&&(a=o),n&=~i}if(n=a,n=It()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*tM(n/1960))-n,10e?16:e,li===null)var n=!1;else{if(e=li,li=null,Wf=0,Ye&6)throw Error(ne(331));var a=Ye;for(Ye|=4,fe=e.current;fe!==null;){var i=fe,o=i.child;if(fe.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lIt()-Kx?lo(e,0):qx|=r),Fr(e,t)}function SE(e,t){t===0&&(e.mode&1?(t=wd,wd<<=1,!(wd&130023424)&&(wd=4194304)):t=1);var r=Ar();e=Pa(e,t),e!==null&&(Yc(e,t,r),Fr(e,r))}function sM(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),SE(e,r)}function lM(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ne(314))}n!==null&&n.delete(t),SE(e,r)}var jE;jE=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)Ir=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ir=!1,XR(e,t,r);Ir=!!(e.flags&131072)}else Ir=!1,_t&&t.flags&1048576&&E2(t,Rf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;pf(e,t),e=t.pendingProps;var a=Cs(t,xr.current);bs(t,r),a=Bx(null,t,n,e,a,r);var i=Ux();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Lr(n)?(i=!0,$f(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Mx(t),a.updater=xh,t.stateNode=a,a._reactInternals=t,Uv(t,n,e,r),t=Hv(null,t,n,!0,i,r)):(t.tag=0,_t&&i&&Px(t),wr(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(pf(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=cM(n),e=Pn(n,e),a){case 0:t=Wv(null,t,n,e,r);break e;case 1:t=M1(null,t,n,e,r);break e;case 11:t=I1(null,t,n,e,r);break e;case 14:t=R1(null,t,n,Pn(n.type,e),r);break e}throw Error(ne(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),Wv(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),M1(e,t,n,a,r);case 3:e:{if(sE(t),e===null)throw Error(ne(387));n=t.pendingProps,i=t.memoizedState,a=i.element,I2(e,t),Lf(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Rs(Error(ne(423)),t),t=D1(e,t,n,r,a);break e}else if(n!==a){a=Rs(Error(ne(424)),t),t=D1(e,t,n,r,a);break e}else for(Kr=mi(t.stateNode.containerInfo.firstChild),Xr=t,_t=!0,$n=null,r=T2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ts(),n===a){t=Na(e,t,r);break e}wr(e,t,n,r)}t=t.child}return t;case 5:return R2(t),e===null&&Fv(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Iv(n,a)?o=null:i!==null&&Iv(n,i)&&(t.flags|=32),oE(e,t),wr(e,t,o,r),t.child;case 6:return e===null&&Fv(t),null;case 13:return lE(e,t,r);case 4:return Dx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=$s(t,null,n,r):wr(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),I1(e,t,n,a,r);case 7:return wr(e,t,t.pendingProps,r),t.child;case 8:return wr(e,t,t.pendingProps.children,r),t.child;case 12:return wr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,ht(Mf,n._currentValue),n._currentValue=o,i!==null)if(Fn(i.value,o)){if(i.children===a.children&&!Dr.current){t=Na(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=Sa(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),zv(i.return,r,t),s.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ne(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),zv(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}wr(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,bs(t,r),a=gn(a),n=n(a),t.flags|=1,wr(e,t,n,r),t.child;case 14:return n=t.type,a=Pn(n,t.pendingProps),a=Pn(n.type,a),R1(e,t,n,a,r);case 15:return aE(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),pf(e,t),t.tag=1,Lr(n)?(e=!0,$f(t)):e=!1,bs(t,r),tE(t,n,a),Uv(t,n,a,r),Hv(null,t,n,!0,e,r);case 19:return uE(e,t,r);case 22:return iE(e,t,r)}throw Error(ne(156,t.tag))};function OE(e,t){return QA(e,t)}function uM(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,r,n){return new uM(e,t,r,n)}function Qx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cM(e){if(typeof e=="function")return Qx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vx)return 11;if(e===gx)return 14}return 2}function xi(e,t){var r=e.alternate;return r===null?(r=mn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function yf(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")Qx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Qo:return uo(r.children,a,i,t);case yx:o=8,a|=8;break;case fv:return e=mn(12,r,t,a|2),e.elementType=fv,e.lanes=i,e;case pv:return e=mn(13,r,t,a),e.elementType=pv,e.lanes=i,e;case hv:return e=mn(19,r,t,a),e.elementType=hv,e.lanes=i,e;case RA:return _h(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $A:o=10;break e;case IA:o=9;break e;case vx:o=11;break e;case gx:o=14;break e;case Qa:o=16,n=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=mn(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function uo(e,t,r,n){return e=mn(7,e,n,t),e.lanes=r,e}function _h(e,t,r,n){return e=mn(22,e,n,t),e.elementType=RA,e.lanes=r,e.stateNode={isHidden:!1},e}function Jm(e,t,r){return e=mn(6,e,null,t),e.lanes=r,e}function ey(e,t,r){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dM(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Im(0),this.expirationTimes=Im(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Im(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Jx(e,t,r,n,a,i,o,s,l){return e=new dM(e,t,r,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=mn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mx(i),e}function fM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PE)}catch(e){console.error(e)}}PE(),PA.exports=en;var us=PA.exports,X1=us;cv.createRoot=X1.createRoot,cv.hydrateRoot=X1.hydrateRoot;/** - * @remix-run/router v1.23.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function oc(){return oc=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function nb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function gM(){return Math.random().toString(36).substr(2,8)}function Z1(e,t){return{usr:e.state,key:e.key,idx:t}}function ng(e,t,r,n){return r===void 0&&(r=null),oc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gl(t):t,{state:r,key:t&&t.key||n||gM()})}function qf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function gl(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function xM(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,s=ui.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(oc({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){s=ui.Pop;let v=f(),x=v==null?null:v-u;u=v,l&&l({action:s,location:y.location,delta:x})}function p(v,x){s=ui.Push;let m=ng(y.location,v,x);u=f()+1;let w=Z1(m,u),S=y.createHref(m);try{o.pushState(w,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;a.location.assign(S)}i&&l&&l({action:s,location:y.location,delta:1})}function h(v,x){s=ui.Replace;let m=ng(y.location,v,x);u=f();let w=Z1(m,u),S=y.createHref(m);o.replaceState(w,"",S),i&&l&&l({action:s,location:y.location,delta:0})}function g(v){let x=a.location.origin!=="null"?a.location.origin:a.location.href,m=typeof v=="string"?v:qf(v);return m=m.replace(/ $/,"%20"),kt(x,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,x)}let y={get action(){return s},get location(){return e(a,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(Y1,d),l=v,()=>{a.removeEventListener(Y1,d),l=null}},createHref(v){return t(a,v)},createURL:g,encodeLocation(v){let x=g(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:h,go(v){return o.go(v)}};return y}var Q1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Q1||(Q1={}));function bM(e,t,r){return r===void 0&&(r="/"),wM(e,t,r)}function wM(e,t,r,n){let a=typeof t=="string"?gl(t):t,i=Ds(a.pathname||"/",r);if(i==null)return null;let o=NE(e);_M(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(kt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=bi([n,l.relativePath]),f=r.concat(l);i.children&&i.children.length>0&&(kt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),NE(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:PM(u,i.index),routesMeta:f})};return e.forEach((i,o)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))a(i,o);else for(let l of CE(i.path))a(i,o,l)}),t}function CE(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=CE(n.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function _M(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:NM(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const SM=/^:[\w-]+$/,jM=3,OM=2,kM=1,AM=10,EM=-2,J1=e=>e==="*";function PM(e,t){let r=e.split("/"),n=r.length;return r.some(J1)&&(n+=EM),t&&(n+=OM),r.filter(a=>!J1(a)).reduce((a,i)=>a+(SM.test(i)?jM:i===""?kM:AM),n)}function NM(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function CM(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=f;if(p==="*"){let y=s[d]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=s[d];return h&&!g?u[p]=void 0:u[p]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function TM(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),nb(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function $M(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nb(!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 Ds(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const IM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RM=e=>IM.test(e);function MM(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?gl(e):e,i;if(r)if(RM(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),nb(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=e_(r.substring(1),"/"):i=e_(r,t)}else i=t;return{pathname:i,search:FM(n),hash:zM(a)}}function e_(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function ty(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function DM(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ab(e,t){let r=DM(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ib(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=gl(e):(a=oc({},e),kt(!a.pathname||!a.pathname.includes("?"),ty("?","pathname","search",a)),kt(!a.pathname||!a.pathname.includes("#"),ty("#","pathname","hash",a)),kt(!a.search||!a.search.includes("#"),ty("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;a.pathname=p.join("/")}s=d>=0?t[d]:"/"}let l=MM(a,s),u=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const bi=e=>e.join("/").replace(/\/\/+/g,"/"),LM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function BM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const TE=["post","put","patch","delete"];new Set(TE);const UM=["get",...TE];new Set(UM);/** - * React Router v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function sc(){return sc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),j.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let d=ib(u,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:bi([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,o,i,e])}const HM=j.createContext(null);function GM(e){let t=j.useContext(za).outlet;return t&&j.createElement(HM.Provider,{value:e},t)}function Ph(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=j.useContext(Fa),{matches:a}=j.useContext(za),{pathname:i}=$o(),o=JSON.stringify(ab(a,n.v7_relativeSplatPath));return j.useMemo(()=>ib(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function qM(e,t){return KM(e,t)}function KM(e,t,r,n){xl()||kt(!1);let{navigator:a}=j.useContext(Fa),{matches:i}=j.useContext(za),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=$o(),f;if(t){var d;let v=typeof t=="string"?gl(t):t;l==="/"||(d=v.pathname)!=null&&d.startsWith(l)||kt(!1),f=v}else f=u;let p=f.pathname||"/",h=p;if(l!=="/"){let v=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=bM(e,{pathname:h}),y=JM(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},s,v.params),pathname:bi([l,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:bi([l,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,r,n);return t&&y?j.createElement(Eh.Provider,{value:{location:sc({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:ui.Pop}},y):y}function XM(){let e=nD(),t=BM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:a},r):null,null)}const YM=j.createElement(XM,null);class ZM extends j.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?j.createElement(za.Provider,{value:this.props.routeContext},j.createElement(IE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function QM(e){let{routeContext:t,match:r,children:n}=e,a=j.useContext(Ah);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(za.Provider,{value:t},n)}function JM(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(a=r)==null?void 0:a.errors;if(s!=null){let f=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||kt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,p)=>{let h,g=!1,y=null,v=null;r&&(h=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||YM,l&&(u<0&&p===0?(iD("route-fallback"),g=!0,v=null):u===p&&(g=!0,v=d.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=y:g?w=v:d.route.Component?w=j.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=f,j.createElement(QM,{match:d,routeContext:{outlet:f,matches:x,isDataRoute:r!=null},children:w})};return r&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?j.createElement(ZM,{location:r.location,revalidation:r.revalidation,component:y,error:h,children:m(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):m()},null)}var ME=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ME||{}),DE=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}(DE||{});function eD(e){let t=j.useContext(Ah);return t||kt(!1),t}function tD(e){let t=j.useContext($E);return t||kt(!1),t}function rD(e){let t=j.useContext(za);return t||kt(!1),t}function LE(e){let t=rD(),r=t.matches[t.matches.length-1];return r.route.id||kt(!1),r.route.id}function nD(){var e;let t=j.useContext(IE),r=tD(),n=LE();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function aD(){let{router:e}=eD(ME.UseNavigateStable),t=LE(DE.UseNavigateStable),r=j.useRef(!1);return RE(()=>{r.current=!0}),j.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,sc({fromRouteId:t},i)))},[e,t])}const t_={};function iD(e,t,r){t_[e]||(t_[e]=!0)}function oD(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function sD(e){let{to:t,replace:r,state:n,relative:a}=e;xl()||kt(!1);let{future:i,static:o}=j.useContext(Fa),{matches:s}=j.useContext(za),{pathname:l}=$o(),u=ed(),f=ib(t,ab(s,i.v7_relativeSplatPath),l,a==="path"),d=JSON.stringify(f);return j.useEffect(()=>u(JSON.parse(d),{replace:r,state:n,relative:a}),[u,d,a,r,n]),null}function lD(e){return GM(e.context)}function ln(e){kt(!1)}function uD(e){let{basename:t="/",children:r=null,location:n,navigationType:a=ui.Pop,navigator:i,static:o=!1,future:s}=e;xl()&&kt(!1);let l=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:l,navigator:i,static:o,future:sc({v7_relativeSplatPath:!1},s)}),[l,s,i,o]);typeof n=="string"&&(n=gl(n));let{pathname:f="/",search:d="",hash:p="",state:h=null,key:g="default"}=n,y=j.useMemo(()=>{let v=Ds(f,l);return v==null?null:{location:{pathname:v,search:d,hash:p,state:h,key:g},navigationType:a}},[l,f,d,p,h,g,a]);return y==null?null:j.createElement(Fa.Provider,{value:u},j.createElement(Eh.Provider,{children:r,value:y}))}function cD(e){let{children:t,location:r}=e;return qM(ig(t),r)}new Promise(()=>{});function ig(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,a)=>{if(!j.isValidElement(n))return;let i=[...t,a];if(n.type===j.Fragment){r.push.apply(r,ig(n.props.children,i));return}n.type!==ln&&kt(!1),!n.props.index||!n.props.children||kt(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=ig(n.props.children,i)),r.push(o)}),r}/** - * React Router DOM v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Kf(){return Kf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[a]=e[a]);return r}function dD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fD(e,t){return e.button===0&&(!t||t==="_self")&&!dD(e)}function og(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function pD(e,t){let r=og(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const hD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],mD=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],yD="6";try{window.__reactRouterVersion=yD}catch{}const vD=j.createContext({isTransitioning:!1}),gD="startTransition",r_=oI[gD];function xD(e){let{basename:t,children:r,future:n,window:a}=e,i=j.useRef();i.current==null&&(i.current=vM({window:a,v5Compat:!0}));let o=i.current,[s,l]=j.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=j.useCallback(d=>{u&&r_?r_(()=>l(d)):l(d)},[l,u]);return j.useLayoutEffect(()=>o.listen(f),[o,f]),j.useEffect(()=>oD(n),[n]),j.createElement(uD,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const bD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_D=j.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:d}=t,p=FE(t,hD),{basename:h}=j.useContext(Fa),g,y=!1;if(typeof u=="string"&&wD.test(u)&&(g=u,bD))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),b=Ds(S.pathname,h);S.origin===w.origin&&b!=null?u=b+S.search+S.hash:y=!0}catch{}let v=VM(u,{relative:a}),x=OD(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:a,viewTransition:d});function m(w){n&&n(w),w.defaultPrevented||x(w)}return j.createElement("a",Kf({},p,{href:g||v,onClick:y||i?n:m,ref:r,target:l}))}),SD=j.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:o=!1,style:s,to:l,viewTransition:u,children:f}=t,d=FE(t,mD),p=Ph(l,{relative:d.relative}),h=$o(),g=j.useContext($E),{navigator:y,basename:v}=j.useContext(Fa),x=g!=null&&AD(p)&&u===!0,m=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&v&&(S=Ds(S,v)||S);const b=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!o&&w.startsWith(m)&&w.charAt(b)==="/",O=S!=null&&(S===m||!o&&S.startsWith(m)&&S.charAt(m.length)==="/"),k={isActive:_,isPending:O,isTransitioning:x},A=_?n:void 0,$;typeof i=="function"?$=i(k):$=[i,_?"active":null,O?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(k):s;return j.createElement(_D,Kf({},d,{"aria-current":A,className:$,ref:r,style:T,to:l,viewTransition:u}),typeof f=="function"?f(k):f)});var sg;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(sg||(sg={}));var n_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(n_||(n_={}));function jD(e){let t=j.useContext(Ah);return t||kt(!1),t}function OD(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:s}=t===void 0?{}:t,l=ed(),u=$o(),f=Ph(e,{relative:o});return j.useCallback(d=>{if(fD(d,r)){d.preventDefault();let p=n!==void 0?n:qf(u)===qf(f);l(e,{replace:p,state:a,preventScrollReset:i,relative:o,viewTransition:s})}},[u,l,f,n,a,r,e,i,o,s])}function kD(e){let t=j.useRef(og(e)),r=j.useRef(!1),n=$o(),a=j.useMemo(()=>pD(n.search,r.current?null:t.current),[n.search]),i=ed(),o=j.useCallback((s,l)=>{const u=og(typeof s=="function"?s(a):s);r.current=!0,i("?"+u,l)},[i,a]);return[a,o]}function AD(e,t){t===void 0&&(t={});let r=j.useContext(vD);r==null&&kt(!1);let{basename:n}=jD(sg.useViewTransitionState),a=Ph(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Ds(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Ds(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ag(a.pathname,o)!=null||ag(a.pathname,i)!=null}/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var ED={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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const PD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const at=(e,t)=>{const r=j.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>j.createElement("svg",{ref:f,...ED,width:a,height:a,stroke:n,strokeWidth:o?Number(i)*24/Number(a):i,className:["lucide",`lucide-${PD(e)}`,s].join(" "),...u},[...t.map(([d,p])=>j.createElement(d,p)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vf=at("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ND=at("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const CD=at("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const TD=at("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $D=at("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const du=at("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fu=at("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ID=at("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const RD=at("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const MD=at("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ry=at("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const DD=at("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Nh=at("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LD=at("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const FD=at("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zD=at("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const BD=at("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UD=at("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const VD=at("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zE=at("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xf=at("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $d=at("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ki=at("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ny=at("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WD=at("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HD=at("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ca=at("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.363.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=at("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a_=at("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function GD(){return c.jsxs("aside",{className:"w-64 shrink-0 flex flex-col h-screen bg-white dark:bg-black border-r border-slate-200 dark:border-[#151515] relative z-20 transition-colors duration-300",children:[c.jsx("div",{className:"min-h-20 px-6 py-5 flex flex-col justify-center gap-2 border-b border-slate-200 dark:border-[#151515] transition-colors duration-300",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx("img",{src:"/dashboard/logo/decision-engine-light.svg",alt:"Juspay Decision Engine",className:"h-11 w-auto dark:hidden"}),c.jsx("img",{src:"/dashboard/logo/decision-engine-dark.svg",alt:"Juspay Decision Engine",className:"hidden h-11 w-auto dark:block"})]})}),c.jsxs("nav",{className:"flex-1 px-4 py-8 space-y-1 overflow-y-auto",children:[c.jsx(ua,{to:"/",icon:BD,end:!0,children:"Overview"}),c.jsx(ua,{to:"/decisions",icon:WD,children:"Decision Explorer"}),c.jsx(ua,{to:"/analytics",icon:CD,children:"Analytics"}),c.jsx(ua,{to:"/audit",icon:vf,children:"Decision Audit"}),c.jsx("div",{className:"pt-8 pb-3 px-3 flex items-center gap-2",children:c.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-slate-400 dark:text-[#66666e]",children:"Routing"})}),c.jsx(ua,{to:"/routing",icon:LD,end:!0,children:"Routing Hub"}),c.jsx(ua,{to:"/routing/sr",icon:BE,indent:!0,children:"Auth-Rate Based"}),c.jsx(ua,{to:"/routing/rules",icon:TD,indent:!0,children:"Rule-Based"}),c.jsx(ua,{to:"/routing/volume",icon:Xf,indent:!0,children:"Volume Split"}),c.jsx(ua,{to:"/routing/debit",icon:zE,indent:!0,children:"Debit Routing"})]}),c.jsx("div",{className:"px-6 py-5 border-t border-slate-200 dark:border-[#151515] bg-slate-50 dark:bg-black transition-colors duration-300",children:c.jsx("span",{className:"text-[11px] text-slate-500 dark:text-[#66666e] font-medium tracking-wide",children:"v1.4"})})]})}function ua({to:e,icon:t,children:r,end:n,indent:a}){return c.jsx(SD,{to:e,end:n,className:({isActive:i})=>`group relative flex items-center gap-3 px-4 py-3 rounded-[14px] text-[14px] font-medium transition-all duration-200 ${a?"ml-3 w-[calc(100%-12px)]":""} ${i?"bg-slate-100 text-brand-600 dark:bg-[#151518] dark:text-white shadow-sm":"text-slate-500 hover:text-slate-900 hover:bg-slate-50 dark:text-[#888891] dark:hover:text-white dark:hover:bg-[#0c0c0e]"}`,children:({isActive:i})=>c.jsxs(c.Fragment,{children:[c.jsx(t,{size:18,className:`transition-colors duration-200 ${i?"text-brand-600 dark:text-white":"text-slate-400 dark:text-[#55555e] group-hover:text-slate-600 dark:group-hover:text-white"}`,strokeWidth:i?2.5:2}),c.jsx("span",{className:"flex-1",children:r})]})})}const qD={},i_=e=>{let t;const r=new Set,n=(f,d)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(g=>g(t,h))}},a=()=>t,l={setState:n,getState:a,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(qD?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,a,l);return l},KD=e=>e?i_(e):i_;var UE={exports:{}},VE={},WE={exports:{}},HE={};/** - * @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 Ls=j;function XD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var YD=typeof Object.is=="function"?Object.is:XD,ZD=Ls.useState,QD=Ls.useEffect,JD=Ls.useLayoutEffect,eL=Ls.useDebugValue;function tL(e,t){var r=t(),n=ZD({inst:{value:r,getSnapshot:t}}),a=n[0].inst,i=n[1];return JD(function(){a.value=r,a.getSnapshot=t,ay(a)&&i({inst:a})},[e,r,t]),QD(function(){return ay(a)&&i({inst:a}),e(function(){ay(a)&&i({inst:a})})},[e]),eL(r),r}function ay(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!YD(e,r)}catch{return!0}}function rL(e,t){return t()}var nL=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?rL:tL;HE.useSyncExternalStore=Ls.useSyncExternalStore!==void 0?Ls.useSyncExternalStore:nL;WE.exports=HE;var lg=WE.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.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 Ch=j,aL=lg;function iL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oL=typeof Object.is=="function"?Object.is:iL,sL=aL.useSyncExternalStore,lL=Ch.useRef,uL=Ch.useEffect,cL=Ch.useMemo,dL=Ch.useDebugValue;VE.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=lL(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=cL(function(){function l(h){if(!u){if(u=!0,f=h,h=n(h),a!==void 0&&o.hasValue){var g=o.value;if(a(g,h))return d=g}return d=h}if(g=d,oL(f,h))return g;var y=n(h);return a!==void 0&&a(g,y)?(f=h,g):(f=h,d=y)}var u=!1,f,d,p=r===void 0?null:r;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,r,n,a]);var s=sL(e,i[0],i[1]);return uL(function(){o.hasValue=!0,o.value=s},[s]),dL(s),s};UE.exports=VE;var fL=UE.exports;const pL=rt(fL),GE={},{useDebugValue:hL}=C,{useSyncExternalStoreWithSelector:mL}=pL;let o_=!1;const yL=e=>e;function vL(e,t=yL,r){(GE?"production":void 0)!=="production"&&r&&!o_&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),o_=!0);const n=mL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return hL(n),n}const gL=e=>{(GE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?KD(e):e,r=(n,a)=>vL(t,n,a);return Object.assign(r,t),r},xL=e=>gL,bL={};function wL(e,t){let r;try{r=e()}catch{return}return{getItem:a=>{var i;const o=l=>l===null?null:JSON.parse(l,void 0),s=(i=r.getItem(a))!=null?i:null;return s instanceof Promise?s.then(o):o(s)},setItem:(a,i)=>r.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>r.removeItem(a)}}const lc=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return lc(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return lc(n)(r)}}}},_L=(e,t)=>(r,n,a)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,x)=>({...x,...v}),...t},o=!1;const s=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...v)},n,a);const f=lc(i.serialize),d=()=>{const v=i.partialize({...n()});let x;const m=f({state:v,version:i.version}).then(w=>u.setItem(i.name,w)).catch(w=>{x=w});if(x)throw x;return m},p=a.setState;a.setState=(v,x)=>{p(v,x),d()};const h=e((...v)=>{r(...v),d()},n,a);let g;const y=()=>{var v;if(!u)return;o=!1,s.forEach(m=>m(n()));const x=((v=i.onRehydrateStorage)==null?void 0:v.call(i,n()))||void 0;return lc(u.getItem.bind(u))(i.name).then(m=>{if(m)return i.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var w;return g=i.merge(m,(w=n())!=null?w:h),r(g,!0),d()}).then(()=>{x==null||x(g,void 0),o=!0,l.forEach(m=>m(g))}).catch(m=>{x==null||x(void 0,m)})};return a.persist={setOptions:v=>{i={...i,...v},v.getStorage&&(u=v.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},y(),g||h},SL=(e,t)=>(r,n,a)=>{let i={storage:wL(()=>localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},o=!1;const s=new Set,l=new Set;let u=i.storage;if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...y)},n,a);const f=()=>{const y=i.partialize({...n()});return u.setItem(i.name,{state:y,version:i.version})},d=a.setState;a.setState=(y,v)=>{d(y,v),f()};const p=e((...y)=>{r(...y),f()},n,a);a.getInitialState=()=>p;let h;const g=()=>{var y,v;if(!u)return;o=!1,s.forEach(m=>{var w;return m((w=n())!=null?w:p)});const x=((v=i.onRehydrateStorage)==null?void 0:v.call(i,(y=n())!=null?y:p))||void 0;return lc(u.getItem.bind(u))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return[!0,i.migrate(m.state,m.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var w;const[S,b]=m;if(h=i.merge(b,(w=n())!=null?w:p),r(h,!0),S)return f()}).then(()=>{x==null||x(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{x==null||x(void 0,m)})};return a.persist={setOptions:y=>{i={...i,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},i.skipHydration||g(),h||p},jL=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((bL?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),_L(e,t)):SL(e,t),OL=jL,aa=xL()(OL(e=>({merchantId:"",setMerchantId:t=>{console.log(` -[STORE] Merchant ID changed: "${t}"`),e({merchantId:t})}}),{name:"merchant-store"})),kL="public";function AL(e,t,r){console.log(` -`+"=".repeat(80)),console.log(`[API REQUEST] ${new Date().toISOString()}`),console.log(`Method: ${e}`),console.log(`Path: ${t}`),r!==void 0&&console.log("Body:",JSON.stringify(r,null,2)),console.log("=".repeat(80))}function EL(e,t,r,n){console.log(` -`+"-".repeat(80)),console.log(`[API RESPONSE] ${new Date().toISOString()}`),console.log(`Path: ${e}`),console.log(`Status: ${t} ${r}`),console.log("Response Body:",n),console.log("-".repeat(80)+` -`)}function s_(e,t){console.log(` -`+"!".repeat(80)),console.log(`[API ERROR] ${new Date().toISOString()}`),console.log(`Path: ${e}`),t instanceof Error?(console.log("Error:",t.message),console.log("Stack:",t.stack)):console.log("Error:",t),console.log("!".repeat(80)+` -`)}async function qE(e,t){const r=(t==null?void 0:t.method)||"GET",n=t!=null&&t.body?JSON.parse(t.body):void 0;AL(r,e,n);try{const a=await fetch(e,{headers:{"Content-Type":"application/json","x-tenant-id":kL,...t==null?void 0:t.headers},...t}),i=await a.text();let o;try{const s=JSON.parse(i);o=JSON.stringify(s,null,2)}catch{o=i}if(EL(e,a.status,a.statusText,o),!a.ok){const s=new Error(`API error ${a.status}: ${i}`);throw s_(e,s),s}return i.trim()?JSON.parse(i):void 0}catch(a){throw s_(e,a),a}}async function bt(e,t){return qE(e,{method:"POST",body:t!==void 0?JSON.stringify(t):void 0})}async function wi(e){return qE(e)}function PL(){const{merchantId:e,setMerchantId:t}=aa(),[r,n]=j.useState(e),[a,i]=j.useState(!1),[o,s]=j.useState(()=>localStorage.getItem("theme")==="dark");j.useEffect(()=>{const u=window.document.documentElement;o?(u.classList.add("dark"),localStorage.setItem("theme","dark")):(u.classList.remove("dark"),localStorage.setItem("theme","light"))},[o]);async function l(){const u=r.trim();if(u){t(u),i(!0);try{await bt("/merchant-account/create",{merchant_id:u,gateway_success_rate_based_decider_input:null})}catch{}finally{i(!1)}}}return c.jsxs("header",{className:"h-[76px] bg-white dark:bg-black border-b border-slate-200 dark:border-[#151515] flex items-center justify-between px-8 shrink-0 relative z-10 transition-colors duration-300",children:[c.jsx("div",{}),c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsxs("div",{className:"relative",children:[c.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&l(),placeholder:"Set Merchant ID",className:"w-72 bg-slate-50 dark:bg-[#0f0f11] border border-slate-200 dark:border-[#222222] rounded-full px-4 py-2 text-sm text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-[#66666e] focus:outline-none focus:border-slate-400 dark:focus:border-[#444444] transition-colors"}),c.jsx("button",{onClick:l,disabled:a,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-slate-400 hover:text-brand-500 dark:text-[#66666e] dark:hover:text-white transition-colors",children:a?c.jsx(UD,{size:16,className:"animate-spin"}):c.jsx(ND,{size:16})})]}),e&&c.jsxs("div",{className:"flex items-center gap-2 pl-6 ml-2 border-l border-slate-200 dark:border-[#222222] transition-colors duration-300",children:[c.jsx($D,{size:16,className:"text-brand-500 dark:text-[#66666e]"}),c.jsx("span",{className:"text-sm text-slate-800 dark:text-white font-medium",children:e})]}),c.jsx("button",{onClick:()=>s(!o),className:"p-2.5 rounded-full bg-slate-100 text-slate-600 hover:bg-slate-200 dark:bg-[#151515] dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#222222] transition-colors duration-200","aria-label":"Toggle theme",children:o?c.jsx(HD,{size:18}):c.jsx(VD,{size:18})})]})]})}function NL(){return c.jsxs("div",{className:"flex h-screen overflow-hidden bg-[#f8fafc] text-slate-900 dark:bg-[#000000] dark:text-white relative transition-colors duration-300",children:[c.jsx("div",{className:"aurora-top"}),c.jsx(GD,{}),c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[c.jsx(PL,{}),c.jsx("main",{className:"flex-1 overflow-y-auto p-8 relative",children:c.jsx(lD,{})})]})]})}const KE=0,XE=1,YE=2,l_=3;var u_=Object.prototype.hasOwnProperty;function ug(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&ug(e[n],t[n]););return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(u_.call(e,r)&&++n&&!u_.call(t,r)||!(r in t)||!ug(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const ma=new WeakMap,ga=()=>{},vr=ga(),cg=Object,qe=e=>e===vr,qn=e=>typeof e=="function",Ai=(e,t)=>({...e,...t}),ZE=e=>qn(e.then),iy={},Id={},ob="undefined",td=typeof window!=ob,dg=typeof document!=ob,CL=td&&"Deno"in window,TL=()=>td&&typeof window.requestAnimationFrame!=ob,QE=(e,t)=>{const r=ma.get(e);return[()=>!qe(t)&&e.get(t)||iy,n=>{if(!qe(t)){const a=e.get(t);t in Id||(Id[t]=a),r[5](t,Ai(a,n),a||iy)}},r[6],()=>!qe(t)&&t in Id?Id[t]:!qe(t)&&e.get(t)||iy]};let fg=!0;const $L=()=>fg,[pg,hg]=td&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ga,ga],IL=()=>{const e=dg&&document.visibilityState;return qe(e)||e!=="hidden"},RL=e=>(dg&&document.addEventListener("visibilitychange",e),pg("focus",e),()=>{dg&&document.removeEventListener("visibilitychange",e),hg("focus",e)}),ML=e=>{const t=()=>{fg=!0,e()},r=()=>{fg=!1};return pg("online",t),pg("offline",r),()=>{hg("online",t),hg("offline",r)}},DL={isOnline:$L,isVisible:IL},LL={initFocus:RL,initReconnect:ML},c_=!C.useId,_s=!td||CL,FL=e=>TL()?window.requestAnimationFrame(e):setTimeout(e,1),oy=_s?j.useEffect:j.useLayoutEffect,sy=typeof navigator<"u"&&navigator.connection,d_=!_s&&sy&&(["slow-2g","2g"].includes(sy.effectiveType)||sy.saveData),Rd=new WeakMap,zL=e=>cg.prototype.toString.call(e),ly=(e,t)=>e===`[object ${t}]`;let BL=0;const mg=e=>{const t=typeof e,r=zL(e),n=ly(r,"Date"),a=ly(r,"RegExp"),i=ly(r,"Object");let o,s;if(cg(e)===e&&!n&&!a){if(o=Rd.get(e),o)return o;if(o=++BL+"~",Rd.set(e,o),Array.isArray(e)){for(o="@",s=0;s{if(qn(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?mg(e):"",[e,t]};let UL=0;const yg=()=>++UL;async function JE(...e){const[t,r,n,a]=e,i=Ai({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const u=p=>typeof s=="function"?s(p):s!==!1,f=i.throwOnError;if(qn(r)){const p=r,h=[],g=t.keys();for(const y of g)!/^\$(inf|sub)\$/.test(y)&&p(t.get(y)._k)&&h.push(y);return Promise.all(h.map(d))}return d(r);async function d(p){const[h]=sb(p);if(!h)return;const[g,y]=QE(t,h),[v,x,m,w]=ma.get(t),S=()=>{const L=v[h];return(qn(i.revalidate)?i.revalidate(g().data,p):i.revalidate!==!1)&&(delete m[h],delete w[h],L&&L[0])?L[0](YE).then(()=>g().data):g().data};if(e.length<3)return S();let b=n,_,O=!1;const k=yg();x[h]=[k,0];const A=!qe(l),$=g(),T=$.data,P=$._c,R=qe(P)?T:P;if(A&&(l=qn(l)?l(R,T):l,y({data:l,_c:R})),qn(b))try{b=b(R)}catch(L){_=L,O=!0}if(b&&ZE(b))if(b=await b.catch(L=>{_=L,O=!0}),k!==x[h][0]){if(O)throw _;return b}else O&&A&&u(_)&&(o=!0,y({data:R,_c:vr}));if(o&&!O)if(qn(o)){const L=o(b,R);y({data:L,error:vr,_c:vr})}else y({data:b,error:vr,_c:vr});if(x[h][1]=yg(),Promise.resolve(S()).then(()=>{y({_c:vr})}),O){if(f)throw _;return}return b}}const f_=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},VL=(e,t)=>{if(!ma.has(e)){const r=Ai(LL,t),n=Object.create(null),a=JE.bind(vr,e);let i=ga;const o=Object.create(null),s=(f,d)=>{const p=o[f]||[];return o[f]=p,p.push(d),()=>p.splice(p.indexOf(d),1)},l=(f,d,p)=>{e.set(f,d);const h=o[f];if(h)for(const g of h)g(d,p)},u=()=>{if(!ma.has(e)&&(ma.set(e,[n,Object.create(null),Object.create(null),Object.create(null),a,l,s]),!_s)){const f=r.initFocus(setTimeout.bind(vr,f_.bind(vr,n,KE))),d=r.initReconnect(setTimeout.bind(vr,f_.bind(vr,n,XE)));i=()=>{f&&f(),d&&d(),ma.delete(e)}}};return u(),[e,a,u,i]}return[e,ma.get(e)[4]]},WL=(e,t,r,n,a)=>{const i=r.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!qe(i)&&o>i||setTimeout(n,s,a)},HL=ug,[eP,GL]=VL(new Map),qL=Ai({onLoadingSlow:ga,onSuccess:ga,onError:ga,onErrorRetry:WL,onDiscarded:ga,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:d_?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:d_?5e3:3e3,compare:HL,isPaused:()=>!1,cache:eP,mutate:GL,fallback:{}},DL),KL=(e,t)=>{const r=Ai(e,t);if(t){const{use:n,fallback:a}=e,{use:i,fallback:o}=t;n&&i&&(r.use=n.concat(i)),a&&o&&(r.fallback=Ai(a,o))}return r},XL=j.createContext({}),YL="$inf$",tP=td&&window.__SWR_DEVTOOLS_USE__,ZL=tP?window.__SWR_DEVTOOLS_USE__:[],QL=()=>{tP&&(window.__SWR_DEVTOOLS_REACT__=C)},JL=e=>qn(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],e3=()=>{const e=j.useContext(XL);return j.useMemo(()=>Ai(qL,e),[e])},t3=e=>(t,r,n)=>e(t,r&&((...i)=>{const[o]=sb(t),[,,,s]=ma.get(eP);if(o.startsWith(YL))return r(...i);const l=s[o];return qe(l)?r(...i):(delete s[o],l)}),n),r3=ZL.concat(t3),n3=e=>function(...r){const n=e3(),[a,i,o]=JL(r),s=KL(n,o);let l=e;const{use:u}=s,f=(u||[]).concat(r3);for(let d=f.length;d--;)l=f[d](l);return l(a,i||s.fetcher||null,s)},a3=(e,t,r)=>{const n=t[e]||(t[e]=[]);return n.push(r),()=>{const a=n.indexOf(r);a>=0&&(n[a]=n[n.length-1],n.pop())}};QL();const uy=C.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),cy={dedupe:!0},p_=Promise.resolve(vr),i3=()=>ga,o3=(e,t,r)=>{const{cache:n,compare:a,suspense:i,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:d,keepPreviousData:p,strictServerPrefetchWarning:h}=r,[g,y,v,x]=ma.get(n),[m,w]=sb(e),S=j.useRef(!1),b=j.useRef(!1),_=j.useRef(m),O=j.useRef(t),k=j.useRef(r),A=()=>k.current,$=()=>A().isVisible()&&A().isOnline(),[T,P,R,L]=QE(n,m),z=j.useRef({}).current,W=qe(o)?qe(r.fallback)?vr:r.fallback[m]:o,V=(ge,$e)=>{for(const Le in z){const Oe=Le;if(Oe==="data"){if(!a(ge[Oe],$e[Oe])&&(!qe(ge[Oe])||!a(ue,$e[Oe])))return!1}else if($e[Oe]!==ge[Oe])return!1}return!0},D=!S.current,U=j.useMemo(()=>{const ge=T(),$e=L(),Le=E=>{const M=Ai(E);return delete M._k,(()=>{if(!m||!t||A().isPaused())return!1;if(D&&!qe(s))return s;const B=qe(W)?M.data:W;return qe(B)||l})()?{isValidating:!0,isLoading:!0,...M}:M},Oe=Le(ge),Ge=ge===$e?Oe:Le($e);let H=Oe;return[()=>{const E=Le(T());return V(E,H)?(H.data=E.data,H.isLoading=E.isLoading,H.isValidating=E.isValidating,H.error=E.error,H):(H=E,E)},()=>Ge]},[n,m]),q=lg.useSyncExternalStore(j.useCallback(ge=>R(m,($e,Le)=>{V(Le,$e)||ge()}),[n,m]),U[0],U[1]),J=g[m]&&g[m].length>0,K=q.data,ae=qe(K)?W&&ZE(W)?uy(W):W:K,Q=q.error,be=j.useRef(ae),ue=p?qe(K)?qe(be.current)?ae:be.current:K:ae,Ce=m&&qe(ae),Fe=j.useRef(null);!_s&&lg.useSyncExternalStore(i3,()=>(Fe.current=!1,Fe),()=>(Fe.current=!0,Fe));const te=Fe.current;h&&te&&!i&&Ce&&console.warn(`Missing pre-initiated data for serialized key "${m}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const ie=!m||!t||A().isPaused()||J&&!qe(Q)?!1:D&&!qe(s)?s:i?qe(ae)?!1:l:qe(ae)||l,he=D&&ie,X=qe(q.isValidating)?he:q.isValidating,Ee=qe(q.isLoading)?he:q.isLoading,ve=j.useCallback(async ge=>{const $e=O.current;if(!m||!$e||b.current||A().isPaused())return!1;let Le,Oe,Ge=!0;const H=ge||{},E=!v[m]||!H.dedupe,M=()=>c_?!b.current&&m===_.current&&S.current:m===_.current,N={isValidating:!1,isLoading:!1},B=()=>{P(N)},G=()=>{const Z=v[m];Z&&Z[1]===Oe&&delete v[m]},ee={isValidating:!0};qe(T().data)&&(ee.isLoading=!0);try{if(E&&(P(ee),r.loadingTimeout&&qe(T().data)&&setTimeout(()=>{Ge&&M()&&A().onLoadingSlow(m,r)},r.loadingTimeout),v[m]=[$e(w),yg()]),[Le,Oe]=v[m],Le=await Le,E&&setTimeout(G,r.dedupingInterval),!v[m]||v[m][1]!==Oe)return E&&M()&&A().onDiscarded(m),!1;N.error=vr;const Z=y[m];if(!qe(Z)&&(Oe<=Z[0]||Oe<=Z[1]||Z[1]===0))return B(),E&&M()&&A().onDiscarded(m),!1;const me=T().data;N.data=a(me,Le)?me:Le,E&&M()&&A().onSuccess(Le,m,r)}catch(Z){G();const me=A(),{shouldRetryOnError:Te}=me;me.isPaused()||(N.error=Z,E&&M()&&(me.onError(Z,m,me),(Te===!0||qn(Te)&&Te(Z))&&(!A().revalidateOnFocus||!A().revalidateOnReconnect||$())&&me.onErrorRetry(Z,m,me,Et=>{const Tt=g[m];Tt&&Tt[0]&&Tt[0](l_,Et)},{retryCount:(H.retryCount||0)+1,dedupe:!0})))}return Ge=!1,B(),!0},[m,n]),Pe=j.useCallback((...ge)=>JE(n,_.current,...ge),[]);if(oy(()=>{O.current=t,k.current=r,qe(K)||(be.current=K)}),oy(()=>{if(!m)return;const ge=ve.bind(vr,cy);let $e=0;A().revalidateOnFocus&&($e=Date.now()+A().focusThrottleInterval);const Oe=a3(m,g,(Ge,H={})=>{if(Ge==KE){const E=Date.now();A().revalidateOnFocus&&E>$e&&$()&&($e=E+A().focusThrottleInterval,ge())}else if(Ge==XE)A().revalidateOnReconnect&&$()&&ge();else{if(Ge==YE)return ve();if(Ge==l_)return ve(H)}});return b.current=!1,_.current=m,S.current=!0,P({_k:w}),ie&&(v[m]||(qe(ae)||_s?ge():FL(ge))),()=>{b.current=!0,Oe()}},[m]),oy(()=>{let ge;function $e(){const Oe=qn(u)?u(T().data):u;Oe&&ge!==-1&&(ge=setTimeout(Le,Oe))}function Le(){!T().error&&(f||A().isVisible())&&(d||A().isOnline())?ve(cy).then($e):$e()}return $e(),()=>{ge&&(clearTimeout(ge),ge=-1)}},[u,f,d,m]),j.useDebugValue(ue),i){if(!c_&&_s&&Ce)throw new Error("Fallback data is required when using Suspense in SSR.");Ce&&(O.current=t,k.current=r,b.current=!1);const ge=x[m],$e=!qe(ge)&&Ce?Pe(ge):p_;if(uy($e),!qe(Q)&&Ce)throw Q;const Le=Ce?ve(cy):p_;!qe(ue)&&Ce&&(Le.status="fulfilled",Le.value=!0),uy(Le)}return{mutate:Pe,get data(){return z.data=!0,ue},get error(){return z.error=!0,Q},get isValidating(){return z.isValidating=!0,X},get isLoading(){return z.isLoading=!0,Ee}}},ar=n3(o3);function ke({children:e,className:t="",onClick:r}){return c.jsx("div",{className:`glass-panel rounded-[20px] ${r?"glass-panel-hover cursor-pointer":""} ${t}`,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:e})}function Xe({children:e,className:t=""}){return c.jsx("div",{className:`px-6 py-5 border-b border-slate-200 dark:border-[#1c1c1f] bg-slate-50 dark:bg-[#0c0c0e] rounded-t-[20px] ${t}`,children:e})}function Ae({children:e,className:t=""}){return c.jsx("div",{className:`px-6 py-5 ${t}`,children:e})}const s3={green:"bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20",gray:"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8",blue:"bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20",red:"bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20",orange:"bg-orange-500/10 text-orange-400 ring-1 ring-inset ring-orange-500/20",purple:"bg-purple-500/10 text-purple-400 ring-1 ring-inset ring-purple-500/20"};function _e({variant:e="gray",children:t}){return c.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${s3[e]}`,children:t})}function l3(){const[e,t]=j.useState("loading");return j.useEffect(()=>{console.log(` -[HEALTH CHECK] ${new Date().toISOString()}`),console.log("Fetching: GET /health"),fetch("/health").then(r=>{console.log(`[HEALTH CHECK] Response: ${r.status} ${r.statusText}`),t(r.ok?"up":"down")}).catch(r=>{console.log(`[HEALTH CHECK ERROR] ${r.message}`),t("down")})},[]),e}function u3(){var l,u;const e=ed(),{merchantId:t}=aa(),r=l3(),{data:n}=ar(t?`/routing/list/active/${t}`:null,()=>bt(`/routing/list/active/${t}`),{shouldRetryOnError:!1}),{data:a,error:i}=ar(t?["/rule/get","successRate",t]:null,()=>bt("/rule/get",{merchant_id:t,algorithm:"successRate"})),o=n&&n.length>0?n[0]:null,s=(n||[]).some(f=>{var d;return((d=f.algorithm_data||f.algorithm)==null?void 0:d.type)==="advanced"});return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Overview"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Decision Engine routing health and status"})]}),!t&&c.jsxs("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 flex items-center gap-2 text-sm text-yellow-800",children:[c.jsx(ID,{size:16}),"Set your Merchant ID in the top bar to load configuration."]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[c.jsx(ke,{children:c.jsxs(Ae,{className:"flex items-center gap-3",children:[r==="up"?c.jsx(RD,{className:"text-green-500",size:24}):r==="down"?c.jsx(MD,{className:"text-red-500",size:24}):c.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-gray-200 border-t-gray-500 animate-spin"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500",children:"API Health"}),c.jsx("p",{className:"text-sm font-medium",children:r==="up"?"Healthy":r==="down"?"Down":"Checking..."})]})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Active Routing Rule"}),t?o?c.jsxs("div",{children:[c.jsx(_e,{variant:"green",children:"Active"}),c.jsx("p",{className:"text-sm font-medium mt-1 truncate",children:o.name}),c.jsx("p",{className:"text-xs text-slate-400",children:(l=o.algorithm_data||o.algorithm)==null?void 0:l.type})]}):c.jsx(_e,{variant:"gray",children:"Not Configured"}):c.jsx(_e,{variant:"gray",children:"Not set"})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/sr"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Auth-Rate Config"}),t?i?c.jsx(_e,{variant:"gray",children:"Not Configured"}):a!=null&&a.data?c.jsx(_e,{variant:"green",children:"Configured"}):c.jsx(_e,{variant:"gray",children:"Not Configured"}):c.jsx(_e,{variant:"gray",children:"Not set"})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/rules"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Rule-Based Routing"}),t?s?c.jsx(_e,{variant:"green",children:"Configured"}):c.jsx(_e,{variant:"gray",children:"Not Configured"}):c.jsx(_e,{variant:"gray",children:"Not set"})]})})]}),o&&c.jsxs(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:[c.jsx(Xe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Routing Configuration"})}),c.jsx(Ae,{children:c.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Name"}),c.jsx("dd",{className:"font-medium",children:o.name})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Type"}),c.jsx("dd",{className:"font-medium capitalize",children:(u=o.algorithm_data||o.algorithm)==null?void 0:u.type})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Algorithm For"}),c.jsx("dd",{className:"font-medium capitalize",children:o.algorithm_for})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"ID"}),c.jsx("dd",{className:"font-mono text-xs text-slate-600",children:o.id})]})]})})]})]})}function c3(){const e=ed(),{merchantId:t}=aa(),{data:r}=ar(t?`/routing/list/active/${t}`:null,()=>bt(`/routing/list/active/${t}`)),{data:n}=ar(t?["/rule/get","successRate",t]:null,()=>bt("/rule/get",{merchant_id:t,algorithm:"successRate"})),a=[{id:"sr",title:"Auth-Rate Based Routing",description:"Dynamically route to the best-performing gateway based on real-time authorization rates.",icon:BE,route:"/routing/sr",algorithmType:"successRate",checkConfigured:()=>{var i;return!!((i=n==null?void 0:n.config)!=null&&i.data)}},{id:"rules",title:"Rule-Based Routing",description:"Declarative routing rules to route payments based on conditions and attributes.",icon:zD,route:"/routing/rules",algorithmType:"advanced",checkConfigured:()=>(r||[]).some(i=>{var o;return((o=i.algorithm_data||i.algorithm)==null?void 0:o.type)==="advanced"})},{id:"volume",title:"Volume Split",description:"Distribute payment traffic across gateways by configurable percentage splits.",icon:Xf,route:"/routing/volume",algorithmType:"volume_split",checkConfigured:()=>(r||[]).some(i=>{var o;return((o=i.algorithm_data||i.algorithm)==null?void 0:o.type)==="volume_split"})},{id:"debit",title:"Network Routing",description:"Optimise debit network fees with acquirer-aware network-based routing.",icon:DD,route:"/routing/debit",algorithmType:"debitRouting",checkConfigured:()=>!1}];return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Routing Hub"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Click on any routing strategy to configure"})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(i=>{const o=i.icon,s=i.checkConfigured();return c.jsx(ke,{className:"flex flex-col hover:border-brand-300 cursor-pointer transition-all hover:shadow-md",onClick:()=>e(i.route),children:c.jsxs(Ae,{className:"flex-1 flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsx("div",{className:"p-2 bg-brand-50 rounded-lg border border-[#1c2d50]",children:c.jsx(o,{size:20,className:"text-brand-500"})}),c.jsx(_e,{variant:s?"green":"gray",children:s?"Configured":"Not Configured"})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-slate-900",children:i.title}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:i.description})]}),c.jsx("div",{className:"mt-auto pt-2",children:c.jsx("span",{className:"text-sm text-brand-600 font-medium",children:s?"Manage →":"Setup →"})})]})},i.id)})})]})}var rd=e=>e.type==="checkbox",ro=e=>e instanceof Date,Tr=e=>e==null;const rP=e=>typeof e=="object";var Mt=e=>!Tr(e)&&!Array.isArray(e)&&rP(e)&&!ro(e),d3=e=>Mt(e)&&e.target?rd(e.target)?e.target.checked:e.target.value:e,f3=(e,t)=>t.split(".").some((r,n,a)=>!isNaN(Number(r))&&e.has(a.slice(0,n).join("."))),p3=e=>{const t=e.constructor&&e.constructor.prototype;return Mt(t)&&t.hasOwnProperty("isPrototypeOf")},lb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function vt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(lb&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Mt(e)&&p3(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=vt(e[a]));return n}var Th=e=>/^\w*$/.test(e),ct=e=>e===void 0,$h=e=>Array.isArray(e)?e.filter(Boolean):[],ub=e=>$h(e.replace(/["|']|\]/g,"").split(/\.|\[/)),le=(e,t,r)=>{if(!t||!Mt(e))return r;const n=(Th(t)?[t]:ub(t)).reduce((a,i)=>Tr(a)?a:a[i],e);return ct(n)||n===e?ct(e[t])?r:e[t]:n},Hn=e=>typeof e=="boolean",In=e=>typeof e=="function",tt=(e,t,r)=>{let n=-1;const a=Th(t)?[t]:ub(t),i=a.length,o=i-1;for(;++nC.useContext(aP);var m3=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const o=i;return t._proxyFormState[o]!==pn.all&&(t._proxyFormState[o]=!n||pn.all),e[o]}});return a};const iP=typeof window<"u"?C.useLayoutEffect:C.useEffect;var Sr=e=>typeof e=="string",y3=(e,t,r,n,a)=>Sr(e)?(n&&t.watch.add(e),le(r,e,a)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),le(r,i))):(n&&(t.watchAll=!0),r),vg=e=>Tr(e)||!rP(e);function ii(e,t,r=new WeakSet){if(vg(e)||vg(t))return Object.is(e,t);if(ro(e)&&ro(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const o=e[i];if(!a.includes(i))return!1;if(i!=="ref"){const s=t[i];if(ro(o)&&ro(s)||(Mt(o)||Array.isArray(o))&&(Mt(s)||Array.isArray(s))?!ii(o,s,r):!Object.is(o,s))return!1}}return!0}const v3=C.createContext(null);v3.displayName="HookFormContext";var oP=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Rr=e=>Array.isArray(e)?e:[e],h_=()=>{let e=[];return{get observers(){return e},next:a=>{for(const i of e)i.next&&i.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(i=>i!==a)}}),unsubscribe:()=>{e=[]}}};function sP(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],i=t[n];if(a&&Mt(a)&&i){const o=sP(a,i);Mt(o)&&(r[n]=o)}else e[n]&&(r[n]=i)}return r}var pr=e=>Mt(e)&&!Object.keys(e).length,cb=e=>e.type==="file",Yf=e=>{if(!lb)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lP=e=>e.type==="select-multiple",db=e=>e.type==="radio",g3=e=>db(e)||rd(e),fy=e=>Yf(e)&&e.isConnected;function x3(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(In(e[t]))return!0;return!1};function uP(e){return Array.isArray(e)||Mt(e)&&!w3(e)}function gg(e,t={}){for(const r in e){const n=e[r];uP(n)?(t[r]=Array.isArray(n)?[]:{},gg(n,t[r])):ct(n)||(t[r]=!0)}return t}function pu(e,t,r){r||(r=gg(t));for(const n in e){const a=e[n];if(uP(a))ct(t)||vg(r[n])?r[n]=gg(a,Array.isArray(a)?[]:{}):pu(a,Tr(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!ii(a,i)}}return r}const m_={value:!1,isValid:!1},y_={value:!0,isValid:!0};var cP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ct(e[0].attributes.value)?ct(e[0].value)||e[0].value===""?y_:{value:e[0].value,isValid:!0}:y_:m_}return m_},dP=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ct(e)?e:t?e===""?NaN:e&&+e:r&&Sr(e)?new Date(e):n?n(e):e;const v_={isValid:!1,value:null};var fP=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,v_):v_;function g_(e){const t=e.ref;return cb(t)?t.files:db(t)?fP(e.refs).value:lP(t)?[...t.selectedOptions].map(({value:r})=>r):rd(t)?cP(e.refs).value:dP(ct(t.value)?e.ref.value:t.value,e)}var _3=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,S3=(e,t,r,n)=>{const a={};for(const i of e){const o=le(t,i);o&&tt(a,i,o._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},Zf=e=>e instanceof RegExp,Hl=e=>ct(e)?e:Zf(e)?e.source:Mt(e)?Zf(e.value)?e.value.source:e.value:e,cs=e=>({isOnSubmit:!e||e===pn.onSubmit,isOnBlur:e===pn.onBlur,isOnChange:e===pn.onChange,isOnAll:e===pn.all,isOnTouch:e===pn.onTouched});const x_="AsyncFunction";var j3=e=>!!e&&!!e.validate&&!!(In(e.validate)&&e.validate.constructor.name===x_||Mt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===x_)),O3=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),xg=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ss=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const i=le(e,a);if(i){const{_f:o,...s}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],a)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Ss(s,t))break}else if(Mt(s)&&Ss(s,t))break}}};function b_(e,t,r){const n=le(e,r);if(n||Th(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),o=le(t,i),s=le(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(s&&s.type)return{name:i,error:s};if(s&&s.root&&s.root.type)return{name:`${i}.root`,error:s.root};a.pop()}return{name:r}}var k3=(e,t,r,n)=>{r(e);const{name:a,...i}=e;return pr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||pn.all))},A3=(e,t,r)=>!e||!t||e===t||Rr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),E3=(e,t,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:(r?n.isOnChange:a.isOnChange)?e:!0,P3=(e,t)=>!$h(le(e,t)).length&&$t(e,t),pP=(e,t,r)=>{const n=Rr(le(e,r));return tt(n,nP,t[r]),tt(e,r,n),e};function w_(e,t,r="validate"){if(Sr(e)||Array.isArray(e)&&e.every(Sr)||Hn(e)&&!e)return{type:r,message:Sr(e)?e:"",ref:t}}var Vo=e=>Mt(e)&&!Zf(e)?e:{value:e,message:""},bg=async(e,t,r,n,a,i)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:f,min:d,max:p,pattern:h,validate:g,name:y,valueAsNumber:v,mount:x}=e._f,m=le(r,y);if(!x||t.has(y))return{};const w=s?s[0]:o,S=P=>{a&&w.reportValidity&&(w.setCustomValidity(Hn(P)?"":P||""),w.reportValidity())},b={},_=db(o),O=rd(o),k=_||O,A=(v||cb(o))&&ct(o.value)&&ct(m)||Yf(o)&&o.value===""||m===""||Array.isArray(m)&&!m.length,$=oP.bind(null,y,n,b),T=(P,R,L,z=En.maxLength,W=En.minLength)=>{const V=P?R:L;b[y]={type:P?z:W,message:V,ref:o,...$(P?z:W,V)}};if(i?!Array.isArray(m)||!m.length:l&&(!k&&(A||Tr(m))||Hn(m)&&!m||O&&!cP(s).isValid||_&&!fP(s).isValid)){const{value:P,message:R}=Sr(l)?{value:!!l,message:l}:Vo(l);if(P&&(b[y]={type:En.required,message:R,ref:w,...$(En.required,R)},!n))return S(R),b}if(!A&&(!Tr(d)||!Tr(p))){let P,R;const L=Vo(p),z=Vo(d);if(!Tr(m)&&!isNaN(m)){const W=o.valueAsNumber||m&&+m;Tr(L.value)||(P=W>L.value),Tr(z.value)||(R=Wnew Date(new Date().toDateString()+" "+q),D=o.type=="time",U=o.type=="week";Sr(L.value)&&m&&(P=D?V(m)>V(L.value):U?m>L.value:W>new Date(L.value)),Sr(z.value)&&m&&(R=D?V(m)+P.value,z=!Tr(R.value)&&m.length<+R.value;if((L||z)&&(T(L,P.message,R.message),!n))return S(b[y].message),b}if(h&&!A&&Sr(m)){const{value:P,message:R}=Vo(h);if(Zf(P)&&!m.match(P)&&(b[y]={type:En.pattern,message:R,ref:o,...$(En.pattern,R)},!n))return S(R),b}if(g){if(In(g)){const P=await g(m,r),R=w_(P,w);if(R&&(b[y]={...R,...$(En.validate,R.message)},!n))return S(R.message),b}else if(Mt(g)){let P={};for(const R in g){if(!pr(P)&&!n)break;const L=w_(await g[R](m,r),w,R);L&&(P={...L,...$(R,L.message)},S(L.message),n&&(b[y]=P))}if(!pr(P)&&(b[y]={ref:w,...P},!n))return b}}return S(!0),b};const N3={mode:pn.onSubmit,reValidateMode:pn.onChange,shouldFocusError:!0};function C3(e={}){let t={...N3,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:In(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},a=Mt(t.defaultValues)||Mt(t.values)?vt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:vt(a),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...f};let p={...d};const h={array:h_(),state:h_()},g=t.criteriaMode===pn.all,y=E=>M=>{clearTimeout(u),u=setTimeout(E,M)},v=async E=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||p.isValid||E)){let M;t.resolver?(M=pr((await A()).errors),x()):M=await P({fields:n,onlyCheckValid:!0,eventType:Uo.VALID}),M!==r.isValid&&h.state.next({isValid:M})}},x=(E,M)=>{!t.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((E||Array.from(s.mount)).forEach(N=>{N&&(M?tt(r.validatingFields,N,M):$t(r.validatingFields,N))}),h.state.next({validatingFields:r.validatingFields,isValidating:!pr(r.validatingFields)}))},m=E=>{const M=pu(a,i),N=_3(E);tt(r.dirtyFields,N,le(M,N))},w=(E,M=[],N,B,G=!0,ee=!0)=>{if(B&&N&&!t.disabled){if(o.action=!0,ee&&Array.isArray(le(n,E))){const Z=N(le(n,E),B.argA,B.argB);G&&tt(n,E,Z)}if(ee&&Array.isArray(le(r.errors,E))){const Z=N(le(r.errors,E),B.argA,B.argB);G&&tt(r.errors,E,Z),P3(r.errors,E)}if((d.touchedFields||p.touchedFields)&&ee&&Array.isArray(le(r.touchedFields,E))){const Z=N(le(r.touchedFields,E),B.argA,B.argB);G&&tt(r.touchedFields,E,Z)}(d.dirtyFields||p.dirtyFields)&&m(E),h.state.next({name:E,isDirty:L(E,M),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else tt(i,E,M)},S=(E,M)=>{tt(r.errors,E,M),h.state.next({errors:r.errors})},b=E=>{r.errors=E,h.state.next({errors:r.errors,isValid:!1})},_=(E,M,N,B)=>{const G=le(n,E);if(G){const ee=le(i,E,ct(N)?le(a,E):N);ct(ee)||B&&B.defaultChecked||M?tt(i,E,M?ee:g_(G._f)):V(E,ee),o.mount&&!o.action&&v()}},O=(E,M,N,B,G)=>{let ee=!1,Z=!1;const me={name:E};if(!t.disabled){if(!N||B){(d.isDirty||p.isDirty)&&(Z=r.isDirty,r.isDirty=me.isDirty=L(),ee=Z!==me.isDirty);const Te=ii(le(a,E),M);Z=!!le(r.dirtyFields,E),Te?$t(r.dirtyFields,E):tt(r.dirtyFields,E,!0),me.dirtyFields=r.dirtyFields,ee=ee||(d.dirtyFields||p.dirtyFields)&&Z!==!Te}if(N){const Te=le(r.touchedFields,E);Te||(tt(r.touchedFields,E,N),me.touchedFields=r.touchedFields,ee=ee||(d.touchedFields||p.touchedFields)&&Te!==N)}ee&&G&&h.state.next(me)}return ee?me:{}},k=(E,M,N,B)=>{const G=le(r.errors,E),ee=(d.isValid||p.isValid)&&Hn(M)&&r.isValid!==M;if(t.delayError&&N?(l=y(()=>S(E,N)),l(t.delayError)):(clearTimeout(u),l=null,N?tt(r.errors,E,N):$t(r.errors,E)),(N?!ii(G,N):G)||!pr(B)||ee){const Z={...B,...ee&&Hn(M)?{isValid:M}:{},errors:r.errors,name:E};r={...r,...Z},h.state.next(Z)}},A=async E=>(x(E,!0),await t.resolver(i,t.context,S3(E||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),$=async E=>{const{errors:M}=await A(E);if(x(E),E)for(const N of E){const B=le(M,N);B?tt(r.errors,N,B):$t(r.errors,N)}else r.errors=M;return M},T=async({name:E,eventType:M})=>{if(e.validate){const N=await e.validate({formValues:i,formState:r,name:E,eventType:M});if(Mt(N))for(const B in N)N[B]&&ue(`${dy}.${B}`,{message:Sr(N.message)?N.message:"",type:En.validate});else Sr(N)||!N?ue(dy,{message:N||"",type:En.validate}):be(dy);return N}return!0},P=async({fields:E,onlyCheckValid:M,name:N,eventType:B,context:G={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(G.runRootValidation=!0,!await T({name:N,eventType:B})&&(G.valid=!1,M)))return G.valid;for(const ee in E){const Z=E[ee];if(Z){const{_f:me,...Te}=Z;if(me){const Et=s.array.has(me.name),Tt=Z._f&&j3(Z._f);Tt&&d.validatingFields&&x([me.name],!0);const Xt=await bg(Z,s.disabled,i,g,t.shouldUseNativeValidation&&!M,Et);if(Tt&&d.validatingFields&&x([me.name]),Xt[me.name]&&(G.valid=!1,M)||(!M&&(le(Xt,me.name)?Et?pP(r.errors,Xt,me.name):tt(r.errors,me.name,Xt[me.name]):$t(r.errors,me.name)),e.shouldUseNativeValidation&&Xt[me.name]))break}!pr(Te)&&await P({context:G,onlyCheckValid:M,fields:Te,name:ee,eventType:B})}}return G.valid},R=()=>{for(const E of s.unMount){const M=le(n,E);M&&(M._f.refs?M._f.refs.every(N=>!fy(N)):!fy(M._f.ref))&&ie(E)}s.unMount=new Set},L=(E,M)=>!t.disabled&&(E&&M&&tt(i,E,M),!ii(ae(),a)),z=(E,M,N)=>y3(E,s,{...o.mount?i:ct(M)?a:Sr(E)?{[E]:M}:M},N,M),W=E=>$h(le(o.mount?i:a,E,t.shouldUnregister?le(a,E,[]):[])),V=(E,M,N={})=>{const B=le(n,E);let G=M;if(B){const ee=B._f;ee&&(!ee.disabled&&tt(i,E,dP(M,ee)),G=Yf(ee.ref)&&Tr(M)?"":M,lP(ee.ref)?[...ee.ref.options].forEach(Z=>Z.selected=G.includes(Z.value)):ee.refs?rd(ee.ref)?ee.refs.forEach(Z=>{(!Z.defaultChecked||!Z.disabled)&&(Array.isArray(G)?Z.checked=!!G.find(me=>me===Z.value):Z.checked=G===Z.value||!!G)}):ee.refs.forEach(Z=>Z.checked=Z.value===G):cb(ee.ref)?ee.ref.value="":(ee.ref.value=G,ee.ref.type||h.state.next({name:E,values:vt(i)})))}(N.shouldDirty||N.shouldTouch)&&O(E,G,N.shouldTouch,N.shouldDirty,!0),N.shouldValidate&&K(E)},D=(E,M,N)=>{for(const B in M){if(!M.hasOwnProperty(B))return;const G=M[B],ee=E+"."+B,Z=le(n,ee);(s.array.has(E)||Mt(G)||Z&&!Z._f)&&!ro(G)?D(ee,G,N):V(ee,G,N)}},U=(E,M,N={})=>{const B=le(n,E),G=s.array.has(E),ee=vt(M);tt(i,E,ee),G?(h.array.next({name:E,values:vt(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&N.shouldDirty&&(m(E),h.state.next({name:E,dirtyFields:r.dirtyFields,isDirty:L(E,ee)}))):B&&!B._f&&!Tr(ee)?D(E,ee,N):V(E,ee,N),xg(E,s)?h.state.next({...r,name:E,values:vt(i)}):h.state.next({name:o.mount?E:void 0,values:vt(i)})},q=async E=>{o.mount=!0;const M=E.target;let N=M.name,B=!0;const G=le(n,N),ee=Te=>{B=Number.isNaN(Te)||ro(Te)&&isNaN(Te.getTime())||ii(Te,le(i,N,Te))},Z=cs(t.mode),me=cs(t.reValidateMode);if(G){let Te,Et;const Tt=M.type?g_(G._f):d3(E),Xt=E.type===Uo.BLUR||E.type===Uo.FOCUS_OUT,zi=!O3(G._f)&&!e.validate&&!t.resolver&&!le(r.errors,N)&&!G._f.deps||E3(Xt,le(r.touchedFields,N),r.isSubmitted,me,Z),Wa=xg(N,s,Xt);tt(i,N,Tt),Xt?(!M||!M.readOnly)&&(G._f.onBlur&&G._f.onBlur(E),l&&l(0)):G._f.onChange&&G._f.onChange(E);const Bi=O(N,Tt,Xt),Ui=!pr(Bi)||Wa;if(!Xt&&h.state.next({name:N,type:E.type,values:vt(i)}),zi)return(d.isValid||p.isValid)&&(t.mode==="onBlur"?Xt&&v():Xt||v()),Ui&&h.state.next({name:N,...Wa?{}:Bi});if(!t.resolver&&e.validate&&await T({name:N,eventType:E.type}),!Xt&&Wa&&h.state.next({...r}),t.resolver){const{errors:Vi}=await A([N]);if(x([N]),ee(Tt),B){const Ml=b_(r.errors,n,N),Fo=b_(Vi,n,Ml.name||N);Te=Fo.error,N=Fo.name,Et=pr(Vi)}}else x([N],!0),Te=(await bg(G,s.disabled,i,g,t.shouldUseNativeValidation))[N],x([N]),ee(Tt),B&&(Te?Et=!1:(d.isValid||p.isValid)&&(Et=await P({fields:n,onlyCheckValid:!0,name:N,eventType:E.type})));B&&(G._f.deps&&(!Array.isArray(G._f.deps)||G._f.deps.length>0)&&K(G._f.deps),k(N,Et,Te,Bi))}},J=(E,M)=>{if(le(r.errors,M)&&E.focus)return E.focus(),1},K=async(E,M={})=>{let N,B;const G=Rr(E);if(t.resolver){const ee=await $(ct(E)?E:G);N=pr(ee),B=E?!G.some(Z=>le(ee,Z)):N}else E?(B=(await Promise.all(G.map(async ee=>{const Z=le(n,ee);return await P({fields:Z&&Z._f?{[ee]:Z}:Z,eventType:Uo.TRIGGER})}))).every(Boolean),!(!B&&!r.isValid)&&v()):B=N=await P({fields:n,name:E,eventType:Uo.TRIGGER});return h.state.next({...!Sr(E)||(d.isValid||p.isValid)&&N!==r.isValid?{}:{name:E},...t.resolver||!E?{isValid:N}:{},errors:r.errors}),M.shouldFocus&&!B&&Ss(n,J,E?G:s.mount),B},ae=(E,M)=>{let N={...o.mount?i:a};return M&&(N=sP(M.dirtyFields?r.dirtyFields:r.touchedFields,N)),ct(E)?N:Sr(E)?le(N,E):E.map(B=>le(N,B))},Q=(E,M)=>({invalid:!!le((M||r).errors,E),isDirty:!!le((M||r).dirtyFields,E),error:le((M||r).errors,E),isValidating:!!le(r.validatingFields,E),isTouched:!!le((M||r).touchedFields,E)}),be=E=>{const M=E?Rr(E):void 0;M==null||M.forEach(N=>$t(r.errors,N)),M?M.forEach(N=>{h.state.next({name:N,errors:r.errors})}):h.state.next({errors:{}})},ue=(E,M,N)=>{const B=(le(n,E,{_f:{}})._f||{}).ref,G=le(r.errors,E)||{},{ref:ee,message:Z,type:me,...Te}=G;tt(r.errors,E,{...Te,...M,ref:B}),h.state.next({name:E,errors:r.errors,isValid:!1}),N&&N.shouldFocus&&B&&B.focus&&B.focus()},Ce=(E,M)=>In(E)?h.state.subscribe({next:N=>"values"in N&&E(z(void 0,M),N)}):z(E,M,!0),Fe=E=>h.state.subscribe({next:M=>{A3(E.name,M.name,E.exact)&&k3(M,E.formState||d,Oe,E.reRenderRoot)&&E.callback({values:{...i},...r,...M,defaultValues:a})}}).unsubscribe,te=E=>(o.mount=!0,p={...p,...E.formState},Fe({...E,formState:{...f,...E.formState}})),ie=(E,M={})=>{for(const N of E?Rr(E):s.mount)s.mount.delete(N),s.array.delete(N),M.keepValue||($t(n,N),$t(i,N)),!M.keepError&&$t(r.errors,N),!M.keepDirty&&$t(r.dirtyFields,N),!M.keepTouched&&$t(r.touchedFields,N),!M.keepIsValidating&&$t(r.validatingFields,N),!t.shouldUnregister&&!M.keepDefaultValue&&$t(a,N);h.state.next({values:vt(i)}),h.state.next({...r,...M.keepDirty?{isDirty:L()}:{}}),!M.keepIsValid&&v()},he=({disabled:E,name:M})=>{if(Hn(E)&&o.mount||E||s.disabled.has(M)){const G=s.disabled.has(M)!==!!E;E?s.disabled.add(M):s.disabled.delete(M),G&&o.mount&&!o.action&&v()}},X=(E,M={})=>{let N=le(n,E);const B=Hn(M.disabled)||Hn(t.disabled),G=!s.registerName.has(E)&&N&&!N._f.mount;return tt(n,E,{...N||{},_f:{...N&&N._f?N._f:{ref:{name:E}},name:E,mount:!0,...M}}),s.mount.add(E),N&&!G?he({disabled:Hn(M.disabled)?M.disabled:t.disabled,name:E}):_(E,!0,M.value),{...B?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:Hl(M.min),max:Hl(M.max),minLength:Hl(M.minLength),maxLength:Hl(M.maxLength),pattern:Hl(M.pattern)}:{},name:E,onChange:q,onBlur:q,ref:ee=>{if(ee){s.registerName.add(E),X(E,M),s.registerName.delete(E),N=le(n,E);const Z=ct(ee.value)&&ee.querySelectorAll&&ee.querySelectorAll("input,select,textarea")[0]||ee,me=g3(Z),Te=N._f.refs||[];if(me?Te.find(Et=>Et===Z):Z===N._f.ref)return;tt(n,E,{_f:{...N._f,...me?{refs:[...Te.filter(fy),Z,...Array.isArray(le(a,E))?[{}]:[]],ref:{type:Z.type,name:E}}:{ref:Z}}}),_(E,!1,void 0,Z)}else N=le(n,E,{}),N._f&&(N._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(f3(s.array,E)&&o.action)&&s.unMount.add(E)}}},Ee=()=>t.shouldFocusError&&Ss(n,J,s.mount),ve=E=>{Hn(E)&&(h.state.next({disabled:E}),Ss(n,(M,N)=>{const B=le(n,N);B&&(M.disabled=B._f.disabled||E,Array.isArray(B._f.refs)&&B._f.refs.forEach(G=>{G.disabled=B._f.disabled||E}))},0,!1))},Pe=(E,M)=>async N=>{let B;N&&(N.preventDefault&&N.preventDefault(),N.persist&&N.persist());let G=vt(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:ee,values:Z}=await A();x(),r.errors=ee,G=vt(Z)}else await P({fields:n,eventType:Uo.SUBMIT});if(s.disabled.size)for(const ee of s.disabled)$t(G,ee);if($t(r.errors,nP),pr(r.errors)){h.state.next({errors:{}});try{await E(G,N)}catch(ee){B=ee}}else M&&await M({...r.errors},N),Ee(),setTimeout(Ee);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:pr(r.errors)&&!B,submitCount:r.submitCount+1,errors:r.errors}),B)throw B},ze=(E,M={})=>{le(n,E)&&(ct(M.defaultValue)?U(E,vt(le(a,E))):(U(E,M.defaultValue),tt(a,E,vt(M.defaultValue))),M.keepTouched||$t(r.touchedFields,E),M.keepDirty||($t(r.dirtyFields,E),r.isDirty=M.defaultValue?L(E,vt(le(a,E))):L()),M.keepError||($t(r.errors,E),d.isValid&&v()),h.state.next({...r}))},ge=(E,M={})=>{const N=E?vt(E):a,B=vt(N),G=pr(E),ee=G?a:B;if(M.keepDefaultValues||(a=N),!M.keepValues){if(M.keepDirtyValues){const Z=new Set([...s.mount,...Object.keys(pu(a,i))]);for(const me of Array.from(Z)){const Te=le(r.dirtyFields,me),Et=le(i,me),Tt=le(ee,me);Te&&!ct(Et)?tt(ee,me,Et):!Te&&!ct(Tt)&&U(me,Tt)}}else{if(lb&&ct(E))for(const Z of s.mount){const me=le(n,Z);if(me&&me._f){const Te=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(Yf(Te)){const Et=Te.closest("form");if(Et){Et.reset();break}}}}if(M.keepFieldsRef)for(const Z of s.mount)U(Z,le(ee,Z));else n={}}i=t.shouldUnregister?M.keepDefaultValues?vt(a):{}:vt(ee),h.array.next({values:{...ee}}),h.state.next({values:{...ee}})}s={mount:M.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!pr(ee),o.watch=!!t.shouldUnregister,o.keepIsValid=!!M.keepIsValid,o.action=!1,M.keepErrors||(r.errors={}),h.state.next({submitCount:M.keepSubmitCount?r.submitCount:0,isDirty:G?!1:M.keepDirty?r.isDirty:!!(M.keepDefaultValues&&!ii(E,a)),isSubmitted:M.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:G?{}:M.keepDirtyValues?M.keepDefaultValues&&i?pu(a,i):r.dirtyFields:M.keepDefaultValues&&E?pu(a,E):M.keepDirty?r.dirtyFields:{},touchedFields:M.keepTouched?r.touchedFields:{},errors:M.keepErrors?r.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},$e=(E,M)=>ge(In(E)?E(i):E,{...t.resetOptions,...M}),Le=(E,M={})=>{const N=le(n,E),B=N&&N._f;if(B){const G=B.refs?B.refs[0]:B.ref;G.focus&&setTimeout(()=>{G.focus(),M.shouldSelect&&In(G.select)&&G.select()})}},Oe=E=>{r={...r,...E}},H={control:{register:X,unregister:ie,getFieldState:Q,handleSubmit:Pe,setError:ue,_subscribe:Fe,_runSchema:A,_updateIsValidating:x,_focusError:Ee,_getWatch:z,_getDirty:L,_setValid:v,_setFieldArray:w,_setDisabledField:he,_setErrors:b,_getFieldArray:W,_reset:ge,_resetDefaultValues:()=>In(t.defaultValues)&&t.defaultValues().then(E=>{$e(E,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:R,_disableForm:ve,_subjects:h,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(E){o=E},get _defaultValues(){return a},get _names(){return s},set _names(E){s=E},get _formState(){return r},get _options(){return t},set _options(E){t={...t,...E}}},subscribe:te,trigger:K,register:X,handleSubmit:Pe,watch:Ce,setValue:U,getValues:ae,reset:$e,resetField:ze,clearErrors:be,unregister:ie,setError:ue,setFocus:Le,getFieldState:Q};return{...H,formControl:H}}var Xa=()=>{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 r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},py=(e,t,r={})=>r.shouldFocus||ct(r.shouldFocus)?r.focusName||`${e}.${ct(r.focusIndex)?t:r.focusIndex}.`:"",hy=(e,t)=>[...e,...Rr(t)],my=e=>Array.isArray(e)?e.map(()=>{}):void 0;function yy(e,t,r){return[...e.slice(0,t),...Rr(r),...e.slice(t)]}var vy=(e,t,r)=>Array.isArray(e)?(ct(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],gy=(e,t)=>[...Rr(t),...Rr(e)];function T3(e,t){let r=0;const n=[...e];for(const a of t)n.splice(a-r,1),r++;return $h(n).length?n:[]}var xy=(e,t)=>ct(t)?[]:T3(e,Rr(t).sort((r,n)=>r-n)),by=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},__=(e,t,r)=>(e[t]=r,e);function $3(e){const t=h3(),{control:r=t,name:n,keyName:a="id",shouldUnregister:i,rules:o}=e,[s,l]=C.useState(r._getFieldArray(n)),u=C.useRef(r._getFieldArray(n).map(Xa)),f=C.useRef(!1);r._names.array.add(n),C.useMemo(()=>o&&s.length>=0&&r.register(n,o),[r,n,s.length,o]),iP(()=>r._subjects.array.subscribe({next:({values:S,name:b})=>{if(b===n||!b){const _=le(S,n);Array.isArray(_)&&(l(_),u.current=_.map(Xa))}}}).unsubscribe,[r,n]);const d=C.useCallback(S=>{f.current=!0,r._setFieldArray(n,S)},[r,n]),p=(S,b)=>{const _=Rr(vt(S)),O=hy(r._getFieldArray(n),_);r._names.focus=py(n,O.length-1,b),u.current=hy(u.current,_.map(Xa)),d(O),l(O),r._setFieldArray(n,O,hy,{argA:my(S)})},h=(S,b)=>{const _=Rr(vt(S)),O=gy(r._getFieldArray(n),_);r._names.focus=py(n,0,b),u.current=gy(u.current,_.map(Xa)),d(O),l(O),r._setFieldArray(n,O,gy,{argA:my(S)})},g=S=>{const b=xy(r._getFieldArray(n),S);u.current=xy(u.current,S),d(b),l(b),!Array.isArray(le(r._fields,n))&&tt(r._fields,n,void 0),r._setFieldArray(n,b,xy,{argA:S})},y=(S,b,_)=>{const O=Rr(vt(b)),k=yy(r._getFieldArray(n),S,O);r._names.focus=py(n,S,_),u.current=yy(u.current,S,O.map(Xa)),d(k),l(k),r._setFieldArray(n,k,yy,{argA:S,argB:my(b)})},v=(S,b)=>{const _=r._getFieldArray(n);by(_,S,b),by(u.current,S,b),d(_),l(_),r._setFieldArray(n,_,by,{argA:S,argB:b},!1)},x=(S,b)=>{const _=r._getFieldArray(n);vy(_,S,b),vy(u.current,S,b),d(_),l(_),r._setFieldArray(n,_,vy,{argA:S,argB:b},!1)},m=(S,b)=>{const _=vt(b),O=__(r._getFieldArray(n),S,_);u.current=[...O].map((k,A)=>!k||A===S?Xa():u.current[A]),d(O),l([...O]),r._setFieldArray(n,O,__,{argA:S,argB:_},!0,!1)},w=S=>{const b=Rr(vt(S));u.current=b.map(Xa),d([...b]),l([...b]),r._setFieldArray(n,[...b],_=>_,{},!0,!1)};return C.useEffect(()=>{if(r._state.action=!1,xg(n,r._names)&&r._subjects.state.next({...r._formState}),f.current&&(!cs(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!cs(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{r._updateIsValidating([n]);const b=le(S.errors,n),_=le(r._formState.errors,n);(_?!b&&_.type||b&&(_.type!==b.type||_.message!==b.message):b&&b.type)&&(b?tt(r._formState.errors,n,b):$t(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=le(r._fields,n);S&&S._f&&!(cs(r._options.reValidateMode).isOnSubmit&&cs(r._options.mode).isOnSubmit)&&bg(S,r._names.disabled,r._formValues,r._options.criteriaMode===pn.all,r._options.shouldUseNativeValidation,!0).then(b=>!pr(b)&&r._subjects.state.next({errors:pP(r._formState.errors,b,n)}))}r._subjects.state.next({name:n,values:vt(r._formValues)}),r._names.focus&&Ss(r._fields,(S,b)=>{if(r._names.focus&&b.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),f.current=!1},[s,n,r]),C.useEffect(()=>(!le(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(b,_)=>{const O=le(r._fields,b);O&&O._f&&(O._f.mount=_)};r._options.shouldUnregister||i?r.unregister(n):S(n,!1)}),[n,r,a,i]),{swap:C.useCallback(v,[d,n,r]),move:C.useCallback(x,[d,n,r]),prepend:C.useCallback(h,[d,n,r]),append:C.useCallback(p,[d,n,r]),remove:C.useCallback(g,[d,n,r]),insert:C.useCallback(y,[d,n,r]),update:C.useCallback(m,[d,n,r]),replace:C.useCallback(w,[d,n,r]),fields:C.useMemo(()=>s.map((S,b)=>({...S,[a]:u.current[b]||Xa()})),[s,a])}}function I3(e={}){const t=C.useRef(void 0),r=C.useRef(void 0),[n,a]=C.useState({isDirty:!1,isValidating:!1,isLoading:In(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:In(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!In(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=C3(e);t.current={...s,formState:n}}const i=t.current.control;return i._options=e,iP(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(s=>({...s,isReady:!0})),i._formState.isReady=!0,o},[i]),C.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),C.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),C.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),C.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),C.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),C.useEffect(()=>{var o;e.values&&!ii(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((o=i._options.resetOptions)===null||o===void 0)&&o.keepIsValid||i._setValid(),r.current=e.values,a(s=>({...s}))):i._resetDefaultValues()},[i,e.values]),C.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=C.useMemo(()=>m3(n,i),[i,n]),t.current}const S_=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},hP=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?S_(n.ref,r,e):n.refs&&n.refs.forEach(a=>S_(a,r,e))}},R3=(e,t)=>{t.shouldUseNativeValidation&&hP(e,t);const r={};for(const n in e){const a=le(t.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(M3(t.names||Object.keys(e),n)){const o=Object.assign({},le(r,n));tt(o,"root",i),tt(r,n,o)}else tt(r,n,i)}return r},M3=(e,t)=>e.some(r=>r.startsWith(t+"."));var D3=function(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=oP(o,t,r,a,u?[].concat(u,n.message):n.message)}e.shift()}return r},L3=function(e,t,r){return r===void 0&&(r={}),function(n,a,i){try{return Promise.resolve(function(o,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&hP({},i),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:R3(D3(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},Qe;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Qe||(Qe={}));var j_;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(j_||(j_={}));const ye=Qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ei=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}},oe=Qe.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 Ta extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ta.create=e=>new Ta(e);const wg=(e,t)=>{let r;switch(e.code){case oe.invalid_type:e.received===ye.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Qe.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${Qe.joinValues(e.keys,", ")}`;break;case oe.invalid_union:r="Invalid input";break;case oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Qe.joinValues(e.options)}`;break;case oe.invalid_enum_value:r=`Invalid enum value. Expected ${Qe.joinValues(e.options)}, received '${e.received}'`;break;case oe.invalid_arguments:r="Invalid function arguments";break;case oe.invalid_return_type:r="Invalid function return type";break;case oe.invalid_date:r="Invalid date";break;case oe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Qe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case oe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case oe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case oe.custom:r="Invalid input";break;case oe.invalid_intersection_types:r="Intersection results could not be merged";break;case oe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case oe.not_finite:r="Number must be finite";break;default:r=t.defaultError,Qe.assertNever(e)}return{message:r}};let F3=wg;function z3(){return F3}const B3=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}};function ce(e,t){const r=z3(),n=B3({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wg?void 0:wg].filter(a=>!!a)});e.common.issues.push(n)}class Jr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return Re;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return Jr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Re;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const Re=Object.freeze({status:"aborted"}),hu=e=>({status:"dirty",value:e}),wn=e=>({status:"valid",value:e}),O_=e=>e.status==="aborted",k_=e=>e.status==="dirty",Fs=e=>e.status==="valid",Qf=e=>typeof Promise<"u"&&e instanceof Promise;var xe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(xe||(xe={}));class Ei{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,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 A_=(e,t)=>{if(Fs(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 r=new Ta(e.common.issues);return this._error=r,this._error}}};function Be(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))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:(o,s)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:a}}class Ze{get description(){return this._def.description}_getType(t){return ei(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ei(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Jr,ctx:{common:t.parent.common,data:t.data,parsedType:ei(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Qf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)},a=this._parseSync({data:t,path:n.path,parent:n});return A_(n,a)}"~validate"(t){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return Fs(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>Fs(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)},a=this._parse({data:t,path:n.path,parent:n}),i=await(Qf(a)?a:Promise.resolve(a));return A_(n,i)}refine(t,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=t(a),s=()=>i.addIssue({code:oe.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new So({schema:this,typeName:Me.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:r=>this["~validate"](r)}}optional(){return _i.create(this,this._def)}nullable(){return Us.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qn.create(this)}promise(){return rp.create(this,this._def)}or(t){return ep.create([this,t],this._def)}and(t){return tp.create(this,t,this._def)}transform(t){return new So({...Be(this._def),schema:this,typeName:Me.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Sg({...Be(this._def),innerType:this,defaultValue:r,typeName:Me.ZodDefault})}brand(){return new c4({typeName:Me.ZodBranded,type:this,...Be(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new jg({...Be(this._def),innerType:this,catchValue:r,typeName:Me.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return fb.create(this,t)}readonly(){return Og.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const U3=/^c[^\s-]{8,}$/i,V3=/^[0-9a-z]+$/,W3=/^[0-9A-HJKMNP-TV-Z]{26}$/i,H3=/^[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,G3=/^[a-z0-9_-]{21}$/i,q3=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,K3=/^[-+]?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)?)??$/,X3=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Y3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let wy;const Z3=/^(?:(?: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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([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])$/,t4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,r4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mP="((\\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])))",n4=new RegExp(`^${mP}$`);function yP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function a4(e){return new RegExp(`^${yP(e)}$`)}function i4(e){let t=`${mP}T${yP(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function o4(e,t){return!!((t==="v4"||!t)&&Z3.test(e)||(t==="v6"||!t)&&J3.test(e))}function s4(e,t){if(!q3.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function l4(e,t){return!!((t==="v4"||!t)&&Q3.test(e)||(t==="v6"||!t)&&e4.test(e))}class xa extends Ze{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.string,received:i.parsedType}),Re}const n=new Jr;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,s=t.data.lengtht.test(a),{validation:r,code:oe.invalid_string,...xe.errToObj(n)})}_addCheck(t){return new xa({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...xe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...xe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...xe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...xe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...xe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...xe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...xe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...xe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...xe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...xe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...xe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...xe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...xe.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==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...xe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...xe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...xe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...xe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...xe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...xe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...xe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...xe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...xe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...xe.errToObj(r)})}nonempty(t){return this.min(1,xe.errToObj(t))}trim(){return new xa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xa({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew xa({checks:[],typeName:Me.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Be(e)});function u4(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return i%o/10**a}class bo extends Ze{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 i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.number,received:i.parsedType}),Re}let n;const a=new Jr;for(const i of this._def.checks)i.kind==="int"?Qe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?u4(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_finite,message:i.message}),a.dirty()):Qe.assertNever(i);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,a){return new bo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(a)}]})}_addCheck(t){return new bo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:xe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:xe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Qe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew bo({checks:[],typeName:Me.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class wo extends Ze{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 n;const a=new Jr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Qe.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return ce(r,{code:oe.invalid_type,expected:ye.bigint,received:r.parsedType}),Re}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,a){return new wo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(a)}]})}_addCheck(t){return new wo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew wo({checks:[],typeName:Me.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Be(e)});class Jf extends Ze{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.boolean,received:n.parsedType}),Re}return wn(t.data)}}Jf.create=e=>new Jf({typeName:Me.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class zs extends Ze{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.date,received:i.parsedType}),Re}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_date}),Re}const n=new Jr;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Qe.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new zs({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:xe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:xe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew zs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Me.ZodDate,...Be(e)});class E_ extends Ze{_parse(t){if(this._getType(t)!==ye.symbol){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.symbol,received:n.parsedType}),Re}return wn(t.data)}}E_.create=e=>new E_({typeName:Me.ZodSymbol,...Be(e)});class P_ extends Ze{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.undefined,received:n.parsedType}),Re}return wn(t.data)}}P_.create=e=>new P_({typeName:Me.ZodUndefined,...Be(e)});class N_ extends Ze{_parse(t){if(this._getType(t)!==ye.null){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.null,received:n.parsedType}),Re}return wn(t.data)}}N_.create=e=>new N_({typeName:Me.ZodNull,...Be(e)});class C_ extends Ze{constructor(){super(...arguments),this._any=!0}_parse(t){return wn(t.data)}}C_.create=e=>new C_({typeName:Me.ZodAny,...Be(e)});class T_ extends Ze{constructor(){super(...arguments),this._unknown=!0}_parse(t){return wn(t.data)}}T_.create=e=>new T_({typeName:Me.ZodUnknown,...Be(e)});class Pi extends Ze{_parse(t){const r=this._getOrReturnCtx(t);return ce(r,{code:oe.invalid_type,expected:ye.never,received:r.parsedType}),Re}}Pi.create=e=>new Pi({typeName:Me.ZodNever,...Be(e)});class $_ extends Ze{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.void,received:n.parsedType}),Re}return wn(t.data)}}$_.create=e=>new $_({typeName:Me.ZodVoid,...Be(e)});class Qn extends Ze{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==ye.array)return ce(r,{code:oe.invalid_type,expected:ye.array,received:r.parsedType}),Re;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,s=r.data.lengtha.maxLength.value&&(ce(r,{code:oe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new Ei(r,o,r.path,s)))).then(o=>Jr.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new Ei(r,o,r.path,s)));return Jr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Qn({...this._def,minLength:{value:t,message:xe.toString(r)}})}max(t,r){return new Qn({...this._def,maxLength:{value:t,message:xe.toString(r)}})}length(t,r){return new Qn({...this._def,exactLength:{value:t,message:xe.toString(r)}})}nonempty(t){return this.min(1,t)}}Qn.create=(e,t)=>new Qn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Me.ZodArray,...Be(t)});function Yo(e){if(e instanceof Lt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=_i.create(Yo(n))}return new Lt({...e._def,shape:()=>t})}else return e instanceof Qn?new Qn({...e._def,type:Yo(e.element)}):e instanceof _i?_i.create(Yo(e.unwrap())):e instanceof Us?Us.create(Yo(e.unwrap())):e instanceof _o?_o.create(e.items.map(t=>Yo(t))):e}class Lt extends Ze{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(),r=Qe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ye.object){const u=this._getOrReturnCtx(t);return ce(u,{code:oe.invalid_type,expected:ye.object,received:u.parsedType}),Re}const{status:n,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Pi&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const f=i[u],d=a.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new Ei(a,d,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof Pi){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(u==="strict")s.length>0&&(ce(a,{code:oe.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of s){const d=a.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new Ei(a,d,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const d=await f.key,p=await f.value;u.push({key:d,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>Jr.mergeObjectSync(n,u)):Jr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return xe.errToObj,new Lt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:xe.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Lt({...this._def,unknownKeys:"strip"})}passthrough(){return new Lt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Lt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Lt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Me.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Lt({...this._def,catchall:t})}pick(t){const r={};for(const n of Qe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Lt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Qe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Lt({...this._def,shape:()=>r})}deepPartial(){return Yo(this)}partial(t){const r={};for(const n of Qe.objectKeys(this.shape)){const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new Lt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Qe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof _i;)i=i._def.innerType;r[n]=i}return new Lt({...this._def,shape:()=>r})}keyof(){return vP(Qe.objectKeys(this.shape))}}Lt.create=(e,t)=>new Lt({shape:()=>e,unknownKeys:"strip",catchall:Pi.create(),typeName:Me.ZodObject,...Be(t)});Lt.strictCreate=(e,t)=>new Lt({shape:()=>e,unknownKeys:"strict",catchall:Pi.create(),typeName:Me.ZodObject,...Be(t)});Lt.lazycreate=(e,t)=>new Lt({shape:e,unknownKeys:"strip",catchall:Pi.create(),typeName:Me.ZodObject,...Be(t)});class ep extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Ta(s.ctx.common.issues));return ce(r,{code:oe.invalid_union,unionErrors:o}),Re}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(l=>new Ta(l));return ce(r,{code:oe.invalid_union,unionErrors:s}),Re}}get options(){return this._def.options}}ep.create=(e,t)=>new ep({options:e,typeName:Me.ZodUnion,...Be(t)});function _g(e,t){const r=ei(e),n=ei(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){const a=Qe.objectKeys(t),i=Qe.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(const s of i){const l=_g(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i{if(O_(i)||O_(o))return Re;const s=_g(i.value,o.value);return s.valid?((k_(i)||k_(o))&&r.dirty(),{status:r.value,value:s.data}):(ce(n,{code:oe.invalid_intersection_types}),Re)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}tp.create=(e,t,r)=>new tp({left:e,right:t,typeName:Me.ZodIntersection,...Be(r)});class _o extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return ce(n,{code:oe.invalid_type,expected:ye.array,received:n.parsedType}),Re;if(n.data.lengththis._def.items.length&&(ce(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Ei(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>Jr.mergeArray(r,o)):Jr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new _o({...this._def,rest:t})}}_o.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _o({items:e,typeName:Me.ZodTuple,rest:null,...Be(t)})};class I_ extends Ze{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.map)return ce(n,{code:oe.invalid_type,expected:ye.map,received:n.parsedType}),Re;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:a._parse(new Ei(n,s,n.path,[u,"key"])),value:i._parse(new Ei(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return Re;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return Re;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}}I_.create=(e,t,r)=>new I_({valueType:t,keyType:e,typeName:Me.ZodMap,...Be(r)});class uc extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return ce(n,{code:oe.invalid_type,expected:ye.set,received:n.parsedType}),Re;const a=this._def;a.minSize!==null&&n.data.sizea.maxSize.value&&(ce(n,{code:oe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return Re;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>i._parse(new Ei(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new uc({...this._def,minSize:{value:t,message:xe.toString(r)}})}max(t,r){return new uc({...this._def,maxSize:{value:t,message:xe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}uc.create=(e,t)=>new uc({valueType:e,minSize:null,maxSize:null,typeName:Me.ZodSet,...Be(t)});class R_ extends Ze{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}R_.create=(e,t)=>new R_({getter:e,typeName:Me.ZodLazy,...Be(t)});class M_ extends Ze{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:oe.invalid_literal,expected:this._def.value}),Re}return{status:"valid",value:t.data}}get value(){return this._def.value}}M_.create=(e,t)=>new M_({value:e,typeName:Me.ZodLiteral,...Be(t)});function vP(e,t){return new Bs({values:e,typeName:Me.ZodEnum,...Be(t)})}class Bs extends Ze{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:Qe.joinValues(n),received:r.parsedType,code:oe.invalid_type}),Re}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:oe.invalid_enum_value,options:n}),Re}return wn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Bs.create(t,{...this._def,...r})}exclude(t,r=this._def){return Bs.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Bs.create=vP;class D_ extends Ze{_parse(t){const r=Qe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){const a=Qe.objectValues(r);return ce(n,{expected:Qe.joinValues(a),received:n.parsedType,code:oe.invalid_type}),Re}if(this._cache||(this._cache=new Set(Qe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Qe.objectValues(r);return ce(n,{received:n.data,code:oe.invalid_enum_value,options:a}),Re}return wn(t.data)}get enum(){return this._def.values}}D_.create=(e,t)=>new D_({values:e,typeName:Me.ZodNativeEnum,...Be(t)});class rp extends Ze{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return ce(r,{code:oe.invalid_type,expected:ye.promise,received:r.parsedType}),Re;const n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return wn(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}rp.create=(e,t)=>new rp({type:e,typeName:Me.ZodPromise,...Be(t)});class So extends Ze{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{ce(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return Re;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?Re:l.status==="dirty"||r.value==="dirty"?hu(l.value):l});{if(r.value==="aborted")return Re;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?Re:s.status==="dirty"||r.value==="dirty"?hu(s.value):s}}if(a.type==="refinement"){const o=s=>{const l=a.refinement(s,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Re:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?Re:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fs(o))return Re;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Fs(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):Re);Qe.assertNever(a)}}So.create=(e,t,r)=>new So({schema:e,typeName:Me.ZodEffects,effect:t,...Be(r)});So.createWithPreprocess=(e,t,r)=>new So({schema:t,effect:{type:"preprocess",transform:e},typeName:Me.ZodEffects,...Be(r)});class _i extends Ze{_parse(t){return this._getType(t)===ye.undefined?wn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_i.create=(e,t)=>new _i({innerType:e,typeName:Me.ZodOptional,...Be(t)});class Us extends Ze{_parse(t){return this._getType(t)===ye.null?wn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Us.create=(e,t)=>new Us({innerType:e,typeName:Me.ZodNullable,...Be(t)});class Sg extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Sg.create=(e,t)=>new Sg({innerType:e,typeName:Me.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Be(t)});class jg extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Qf(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ta(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ta(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}jg.create=(e,t)=>new jg({innerType:e,typeName:Me.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Be(t)});class L_ extends Ze{_parse(t){if(this._getType(t)!==ye.nan){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.nan,received:n.parsedType}),Re}return{status:"valid",value:t.data}}}L_.create=e=>new L_({typeName:Me.ZodNaN,...Be(e)});class c4 extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class fb extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Re:i.status==="dirty"?(r.dirty(),hu(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Re:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new fb({in:t,out:r,typeName:Me.ZodPipeline})}}class Og extends Ze{_parse(t){const r=this._def.innerType._parse(t),n=a=>(Fs(a)&&(a.value=Object.freeze(a.value)),a);return Qf(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Og.create=(e,t)=>new Og({innerType:e,typeName:Me.ZodReadonly,...Be(t)});var Me;(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"})(Me||(Me={}));const F_=xa.create,Nu=bo.create;wo.create;Jf.create;zs.create;Pi.create;const d4=Qn.create,gP=Lt.create;ep.create;tp.create;_o.create;Bs.create;rp.create;_i.create;Us.create;const Cu=So.createWithPreprocess,xP={string:e=>xa.create({...e,coerce:!0}),number:e=>bo.create({...e,coerce:!0}),boolean:e=>Jf.create({...e,coerce:!0}),bigint:e=>wo.create({...e,coerce:!0}),date:e=>zs.create({...e,coerce:!0})},f4={primary:"bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white",ghost:"text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]",danger:"bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]"},p4={sm:"px-4 py-1.5 text-xs font-semibold",md:"px-5 py-2.5 text-sm font-semibold"};function Ie({variant:e="primary",size:t="md",className:r="",...n}){return c.jsx("button",{className:`relative inline-flex items-center justify-center gap-2 rounded-full transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/50 focus:ring-offset-1 focus:ring-offset-transparent focus:border-transparent ${f4[e]} ${p4[t]} ${r}`,...n,children:n.children})}function Gr({error:e}){return e?c.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/8 px-4 py-3 text-sm text-red-400 font-mono",children:e}):null}function mr({size:e=20}){return c.jsxs("svg",{className:"animate-spin text-brand-500",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}const h4={SR_SELECTION_V3_ROUTING:"bg-blue-100 text-blue-800",PRIORITY_LOGIC:"bg-purple-100 text-purple-800",NTW_BASED_ROUTING:"bg-green-100 text-green-800",SR_SELECTION_V3_ROUTING_WITH_HEDGING:"bg-orange-100 text-orange-800",HEDGING:"bg-orange-100 text-orange-800"},m4=["card","card_redirect","pay_later","wallet","bank_redirect","bank_transfer","crypto","bank_debit","reward","real_time_payment","upi","voucher","gift_card","open_banking","mobile_payment"],y4={card:["credit","debit"],bank_debit:["ach","sepa","bacs","becs"],bank_transfer:["ach","sepa","sepa_bank_transfer","bacs","multibanco","pix","pse","permata_bank_transfer","bca_bank_transfer","bni_va","bri_va","cimb_va","danamon_va","mandiri_va","local_bank_transfer","instant_bank_transfer"],wallet:["amazon_pay","apple_pay","google_pay","paypal","ali_pay","ali_pay_hk","dana","mb_way","mobile_pay","samsung_pay","twint","vipps","touch_n_go","swish","we_chat_pay","go_pay","gcash","momo","kakao_pay","cashapp","mifinity","paze"],pay_later:["affirm","alma","afterpay_clearpay","klarna","pay_bright","atome","walley"],upi:["upi_collect","upi_intent"],voucher:["boleto","efecty","pago_efectivo","red_compra","red_pagos","indomaret","alfamart","oxxo","seven_eleven","lawson","mini_stop","family_mart","seicomart","pay_easy"],bank_redirect:["giropay","ideal","sofort","eft","eps","bancontact_card","blik","local_bank_redirect","online_banking_thailand","online_banking_czech_republic","online_banking_finland","online_banking_fpx","online_banking_poland","online_banking_slovakia","przelewy24","trustly","bizum","interac","open_banking_uk","open_banking_pis"],gift_card:["givex","pay_safe_card"],card_redirect:["knet","benefit","momo_atm","card_redirect"],real_time_payment:["fps","duit_now","prompt_pay","viet_qr"],crypto:["crypto_currency"],reward:["evoucher","classic_reward"],open_banking:["open_banking_pis"],mobile_payment:["direct_carrier_billing"]},v4=gP({paymentMethodType:F_().min(1),paymentMethod:F_().min(1),bucketSize:xP.number().int().positive(),hedgingPercent:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),latencyThreshold:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable())}),g4=gP({defaultBucketSize:xP.number().int().positive(),defaultSuccessRate:Cu(e=>e===""||e===null?null:Number(e),Nu().min(0).max(1).nullable()),defaultLatencyThreshold:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),defaultHedgingPercent:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),subLevelInputConfig:d4(v4)});function x4(){var R,L,z,W,V;const{merchantId:e}=aa(),[t,r]=j.useState(!1),[n,a]=j.useState(null),[i,o]=j.useState(!1),[s,l]=j.useState(!1),[u,f]=j.useState(!1),[d,p]=j.useState(null),{data:h,isLoading:g,mutate:y}=ar(e?["rule-sr",e]:null,()=>bt("/rule/get",{merchant_id:e,algorithm:"successRate"}),{shouldRetryOnError:!1}),{register:v,control:x,handleSubmit:m,reset:w,watch:S,formState:{errors:b}}=I3({resolver:L3(g4),defaultValues:{defaultBucketSize:200,defaultSuccessRate:.5,defaultLatencyThreshold:null,defaultHedgingPercent:null,subLevelInputConfig:[]}});j.useEffect(()=>{var D;if((D=h==null?void 0:h.config)!=null&&D.data){const U=h.config.data;w({defaultBucketSize:U.defaultBucketSize??200,defaultSuccessRate:U.defaultSuccessRate??.5,defaultLatencyThreshold:U.defaultLatencyThreshold??null,defaultHedgingPercent:U.defaultHedgingPercent??null,subLevelInputConfig:U.subLevelInputConfig??[]})}},[h,w]);const{fields:_,append:O,remove:k}=$3({control:x,name:"subLevelInputConfig"}),A=S("subLevelInputConfig");async function $(){try{await bt("/merchant-account/create",{merchant_id:e,gateway_success_rate_based_decider_input:null})}catch{}}async function T(D){if(!e){a("Set a Merchant ID first.");return}r(!0),a(null),o(!1);try{await $(),await bt(h?"/rule/update":"/rule/create",{merchant_id:e,config:{type:"successRate",data:{defaultBucketSize:D.defaultBucketSize,defaultSuccessRate:D.defaultSuccessRate,defaultLatencyThreshold:D.defaultLatencyThreshold,defaultHedgingPercent:D.defaultHedgingPercent,subLevelInputConfig:D.subLevelInputConfig.length>0?D.subLevelInputConfig:null}}}),o(!0),y()}catch(U){a(U instanceof Error?U.message:String(U))}finally{r(!1)}}async function P(){if(e){f(!0),p(null);try{await bt("/rule/delete",{merchant_id:e,algorithm:"successRate"}),y(void 0,{revalidate:!1})}catch(D){p(D instanceof Error?D.message:String(D))}finally{f(!1)}}}return c.jsxs("div",{className:"space-y-6 max-w-5xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Auth-Rate Based Routing"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure success-rate based gateway routing"})]}),!e&&c.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-800",children:"Set a Merchant ID in the top bar to load and save configuration."}),e&&!g&&c.jsxs(ke,{children:[c.jsxs(Xe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Configuration Status"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(R=h==null?void 0:h.config)!=null&&R.data?"Success Rate routing is configured and active":"No Success Rate configuration found"})]}),c.jsx(_e,{variant:(L=h==null?void 0:h.config)!=null&&L.data?"green":"gray",children:(z=h==null?void 0:h.config)!=null&&z.data?"Active":"Not Configured"})]}),((W=h==null?void 0:h.config)==null?void 0:W.data)&&c.jsxs(Ae,{className:"border-t border-slate-100 dark:border-[#222226]",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Last Modified:"}),c.jsx("span",{className:"ml-1 font-medium",children:h.modified_at?new Date(h.modified_at).toLocaleString():"Unknown"})]}),c.jsxs(Ie,{type:"button",variant:"secondary",size:"sm",onClick:()=>{confirm("Are you sure you want to clear the Success Rate configuration? This will disable SR-based routing.")&&P()},disabled:u,children:[c.jsx(Ca,{size:14,className:"mr-1"}),u?"Clearing...":"Clear Configuration"]})]}),d&&c.jsx("p",{className:"text-xs text-red-500 mt-2",children:d})]})]}),g?c.jsx("div",{className:"flex justify-center py-12",children:c.jsx(mr,{})}):c.jsxs("form",{onSubmit:m(T),className:"space-y-6",children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Default Success Rate Config"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Base settings used when there is no payment-method-specific override."})]})}),c.jsxs(Ae,{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Bucket Size"}),c.jsx("input",{type:"number",...v("defaultBucketSize"),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"}),b.defaultBucketSize&&c.jsx("p",{className:"text-xs text-red-500",children:b.defaultBucketSize.message})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Success Rate"}),c.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",...v("defaultSuccessRate"),placeholder:"0.5",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Hedging %"}),c.jsx("input",{type:"number",step:"0.1",...v("defaultHedgingPercent"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Latency Threshold (ms)"}),c.jsx("input",{type:"number",...v("defaultLatencyThreshold"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]})]}),c.jsxs(ke,{children:[c.jsxs(Xe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Sub-Level Overrides"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Optional overrides for specific payment method type and method combinations."})]}),c.jsxs(Ie,{type:"button",variant:"secondary",size:"sm",onClick:()=>O({paymentMethodType:"card",paymentMethod:"credit",bucketSize:20,hedgingPercent:null,latencyThreshold:null}),children:[c.jsx(ki,{size:14})," Add Level"]})]}),c.jsx(Ae,{className:"overflow-x-auto p-0",children:_.length?c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-200 dark:border-[#1c1c24] bg-slate-50 dark:bg-[#0a0a0f]",children:[c.jsx("th",{className:"px-4 py-2",children:"Payment Method Type"}),c.jsx("th",{className:"px-4 py-2",children:"Payment Method"}),c.jsx("th",{className:"px-4 py-2",children:"Bucket Size"}),c.jsx("th",{className:"px-4 py-2",children:"Hedging %"}),c.jsx("th",{className:"px-4 py-2",children:"Latency Threshold (ms)"}),c.jsx("th",{className:"px-4 py-2"})]})}),c.jsx("tbody",{children:_.map((D,U)=>{var K;const q=((K=A==null?void 0:A[U])==null?void 0:K.paymentMethodType)||"",J=y4[q]||[];return c.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsx("select",{...v(`subLevelInputConfig.${U}.paymentMethodType`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:m4.map(ae=>c.jsx("option",{value:ae,children:ae},ae))})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("select",{...v(`subLevelInputConfig.${U}.paymentMethod`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(J.length?J:["credit","debit"]).map(ae=>c.jsx("option",{value:ae,children:ae},ae))})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",...v(`subLevelInputConfig.${U}.bucketSize`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",step:"0.1",...v(`subLevelInputConfig.${U}.hedgingPercent`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",...v(`subLevelInputConfig.${U}.latencyThreshold`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("button",{type:"button",onClick:()=>k(U),className:"text-slate-400 hover:text-red-500",children:c.jsx(Ca,{size:14})})})]},D.id)})})]}):c.jsx("div",{className:"px-4 py-8 text-sm text-slate-500",children:"No sub-level overrides configured. The default row above is the only active configuration."})})]}),c.jsx(Gr,{error:n}),i&&c.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-4 py-3 text-sm text-emerald-400",children:"Configuration saved successfully."}),((V=h==null?void 0:h.config)==null?void 0:V.data)&&c.jsxs(ke,{children:[c.jsxs(Xe,{className:"flex flex-row items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Current Active Configuration"}),c.jsxs(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!s),children:[c.jsx(Nh,{size:14,className:"mr-1"}),s?"Hide":"View"]})]}),s&&c.jsx(Ae,{children:c.jsxs("div",{className:"text-xs text-slate-600 space-y-4",children:[c.jsxs("div",{className:"border-b border-slate-200 dark:border-[#222226] pb-3",children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Default Settings"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultBucketSize})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Success Rate:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultSuccessRate??"Not set"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultHedgingPercent??"Not set"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),c.jsxs("p",{className:"font-medium",children:[h.config.data.defaultLatencyThreshold??"Not set"," ms"]})]})]})]}),h.config.data.subLevelInputConfig&&h.config.data.subLevelInputConfig.length>0&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Sub-Level Configurations"}),c.jsx("div",{className:"space-y-2",children:h.config.data.subLevelInputConfig.map((D,U)=>c.jsx("div",{className:"bg-slate-50 dark:bg-[#151518] rounded-lg p-3",children:c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Payment Type:"}),c.jsx("p",{className:"font-medium capitalize",children:D.paymentMethodType})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Payment Method:"}),c.jsx("p",{className:"font-medium",children:D.paymentMethod})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),c.jsx("p",{className:"font-medium",children:D.bucketSize})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),c.jsx("p",{className:"font-medium",children:D.hedgingPercent??"Default"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),c.jsxs("p",{className:"font-medium",children:[D.latencyThreshold??"Default"," ms"]})]})]})},U))})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-3",children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Raw Configuration (JSON)"}),c.jsx("pre",{className:"bg-slate-900 dark:bg-[#0f0f11] text-slate-100 border border-transparent dark:border-[#222226] rounded-lg p-3 text-xs overflow-auto max-h-64",children:JSON.stringify(h.config,null,2)})]})]})})]}),c.jsx(Ie,{type:"submit",disabled:t||!e,children:t?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Saving…"]}):"Save Configuration"})]})]})}function b4(){for(var e=arguments.length,t=new Array(e),r=0;rn=>{t.forEach(a=>a(n))},t)}const Ih=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pb(e){return"nodeType"in e}function zr(e){var t,r;return e?bl(e)?e:pb(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function hb(e){const{Document:t}=zr(e);return e instanceof t}function nd(e){return bl(e)?!1:e instanceof zr(e).HTMLElement}function bP(e){return e instanceof zr(e).SVGElement}function wl(e){return e?bl(e)?e.document:pb(e)?hb(e)?e:nd(e)||bP(e)?e.ownerDocument:document:document:document}const ra=Ih?j.useLayoutEffect:j.useEffect;function mb(e){const t=j.useRef(e);return ra(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),a=0;a{e.current=setInterval(n,a)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function cc(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return ra(()=>{r.current!==e&&(r.current=e)},t),r}function ad(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function np(e){const t=mb(e),r=j.useRef(null),n=j.useCallback(a=>{a!==r.current&&(t==null||t(a,r.current)),r.current=a},[]);return[r,n]}function kg(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let _y={};function id(e,t){return j.useMemo(()=>{if(t)return t;const r=_y[e]==null?0:_y[e]+1;return _y[e]=r,e+"-"+r},[e,t])}function wP(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a{const s=Object.entries(o);for(const[l,u]of s){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const js=wP(1),dc=wP(-1);function _4(e){return"clientX"in e&&"clientY"in e}function yb(e){if(!e)return!1;const{KeyboardEvent:t}=zr(e.target);return t&&e instanceof t}function S4(e){if(!e)return!1;const{TouchEvent:t}=zr(e.target);return t&&e instanceof t}function Ag(e){if(S4(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return _4(e)?{x:e.clientX,y:e.clientY}:null}const fc=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[fc.Translate.toString(e),fc.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),z_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function j4(e){return e.matches(z_)?e:e.querySelector(z_)}const O4={display:"none"};function k4(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:O4},r)}function A4(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:a,role:"status","aria-live":n,"aria-atomic":!0},r)}function E4(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const _P=j.createContext(null);function P4(e){const t=j.useContext(_P);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function N4(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.useCallback(n=>{let{type:a,event:i}=n;e.forEach(o=>{var s;return(s=o[a])==null?void 0:s.call(o,i)})},[e]),t]}const C4={draggable:` - To pick up a draggable item, press the space bar. - While dragging, use the arrow keys to move the item. - Press space again to drop the item in its new position, or press escape to cancel. - `},T4={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $4(e){let{announcements:t=T4,container:r,hiddenTextDescribedById:n,screenReaderInstructions:a=C4}=e;const{announce:i,announcement:o}=E4(),s=id("DndLiveRegion"),[l,u]=j.useState(!1);if(j.useEffect(()=>{u(!0)},[]),P4(j.useMemo(()=>({onDragStart(d){let{active:p}=d;i(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:h}=d;t.onDragMove&&i(t.onDragMove({active:p,over:h}))},onDragOver(d){let{active:p,over:h}=d;i(t.onDragOver({active:p,over:h}))},onDragEnd(d){let{active:p,over:h}=d;i(t.onDragEnd({active:p,over:h}))},onDragCancel(d){let{active:p,over:h}=d;i(t.onDragCancel({active:p,over:h}))}}),[i,t])),!l)return null;const f=C.createElement(C.Fragment,null,C.createElement(k4,{id:n,value:a.draggable}),C.createElement(A4,{id:s,announcement:o}));return r?us.createPortal(f,r):f}var Wt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Wt||(Wt={}));function ap(){}function B_(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function I4(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const zn=Object.freeze({x:0,y:0});function SP(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jP(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function R4(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function U_(e){let{left:t,top:r,height:n,width:a}=e;return[{x:t,y:r},{x:t+a,y:r},{x:t,y:r+n},{x:t+a,y:r+n}]}function OP(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function V_(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const M4=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=V_(t,t.left,t.top),i=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=SP(V_(l),a);i.push({id:s,data:{droppableContainer:o,value:u}})}}return i.sort(jP)},D4=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=U_(t),i=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=U_(l),f=a.reduce((p,h,g)=>p+SP(u[g],h),0),d=Number((f/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:d}})}}return i.sort(jP)};function L4(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=a-n,s=i-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=[];for(const i of n){const{id:o}=i,s=r.get(o);if(s){const l=L4(s,t);l>0&&a.push({id:o,data:{droppableContainer:i,value:l}})}}return a.sort(R4)};function z4(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function kP(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zn}function B4(e){return function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i({...o,top:o.top+e*s.y,bottom:o.bottom+e*s.y,left:o.left+e*s.x,right:o.right+e*s.x}),{...r})}}const U4=B4(1);function V4(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function W4(e,t,r){const n=V4(t);if(!n)return e;const{scaleX:a,scaleY:i,x:o,y:s}=n,l=e.left-o-(1-a)*parseFloat(r),u=e.top-s-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),f=a?e.width/a:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const H4={ignoreTransform:!1};function _l(e,t){t===void 0&&(t=H4);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=zr(e).getComputedStyle(e);u&&(r=W4(r,u,f))}const{top:n,left:a,width:i,height:o,bottom:s,right:l}=r;return{top:n,left:a,width:i,height:o,bottom:s,right:l}}function W_(e){return _l(e,{ignoreTransform:!0})}function G4(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function q4(e,t){return t===void 0&&(t=zr(e).getComputedStyle(e)),t.position==="fixed"}function K4(e,t){t===void 0&&(t=zr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const i=t[a];return typeof i=="string"?r.test(i):!1})}function Rh(e,t){const r=[];function n(a){if(t!=null&&r.length>=t||!a)return r;if(hb(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!nd(a)||bP(a)||r.includes(a))return r;const i=zr(e).getComputedStyle(a);return a!==e&&K4(a,i)&&r.push(a),q4(a,i)?r:n(a.parentNode)}return e?n(e):r}function AP(e){const[t]=Rh(e,1);return t??null}function Sy(e){return!Ih||!e?null:bl(e)?e:pb(e)?hb(e)||e===wl(e).scrollingElement?window:nd(e)?e:null:null}function EP(e){return bl(e)?e.scrollX:e.scrollLeft}function PP(e){return bl(e)?e.scrollY:e.scrollTop}function Eg(e){return{x:EP(e),y:PP(e)}}var tr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tr||(tr={}));function NP(e){return!Ih||!e?!1:e===document.scrollingElement}function CP(e){const t={x:0,y:0},r=NP(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},a=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:a,isLeft:i,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const X4={x:.2,y:.2};function Y4(e,t,r,n,a){let{top:i,left:o,right:s,bottom:l}=r;n===void 0&&(n=10),a===void 0&&(a=X4);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=CP(e),h={x:0,y:0},g={x:0,y:0},y={height:t.height*a.y,width:t.width*a.x};return!u&&i<=t.top+y.height?(h.y=tr.Backward,g.y=n*Math.abs((t.top+y.height-i)/y.height)):!f&&l>=t.bottom-y.height&&(h.y=tr.Forward,g.y=n*Math.abs((t.bottom-y.height-l)/y.height)),!p&&s>=t.right-y.width?(h.x=tr.Forward,g.x=n*Math.abs((t.right-y.width-s)/y.width)):!d&&o<=t.left+y.width&&(h.x=tr.Backward,g.x=n*Math.abs((t.left+y.width-o)/y.width)),{direction:h,speed:g}}function Z4(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:r,right:n,bottom:a}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:a,width:e.clientWidth,height:e.clientHeight}}function TP(e){return e.reduce((t,r)=>js(t,Eg(r)),zn)}function Q4(e){return e.reduce((t,r)=>t+EP(r),0)}function J4(e){return e.reduce((t,r)=>t+PP(r),0)}function e5(e,t){if(t===void 0&&(t=_l),!e)return;const{top:r,left:n,bottom:a,right:i}=t(e);AP(e)&&(a<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const t5=[["x",["left","right"],Q4],["y",["top","bottom"],J4]];class vb{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Rh(r),a=TP(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,s]of t5)for(const l of o)Object.defineProperty(this,l,{get:()=>{const u=s(n),f=a[i]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Tu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var a;(a=this.target)==null||a.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function r5(e){const{EventTarget:t}=zr(e);return e instanceof t?e:wl(e)}function jy(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var cn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(cn||(cn={}));function H_(e){e.preventDefault()}function n5(e){e.stopPropagation()}var Ke;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ke||(Ke={}));const $P={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},a5=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ke.Right:return{...r,x:r.x+25};case Ke.Left:return{...r,x:r.x-25};case Ke.Down:return{...r,y:r.y+25};case Ke.Up:return{...r,y:r.y-25}}};class gb{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Tu(wl(r)),this.windowListeners=new Tu(zr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(cn.Resize,this.handleCancel),this.windowListeners.add(cn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(cn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&e5(n),r(zn)}handleKeyDown(t){if(yb(t)){const{active:r,context:n,options:a}=this.props,{keyboardCodes:i=$P,coordinateGetter:o=a5,scrollBehavior:s="smooth"}=a,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,f=u?{x:u.left,y:u.top}:zn;this.referenceCoordinates||(this.referenceCoordinates=f);const d=o(t,{active:r,context:n.current,currentCoordinates:f});if(d){const p=dc(d,f),h={x:0,y:0},{scrollableAncestors:g}=n.current;for(const y of g){const v=t.code,{isTop:x,isRight:m,isLeft:w,isBottom:S,maxScroll:b,minScroll:_}=CP(y),O=Z4(y),k={x:Math.min(v===Ke.Right?O.right-O.width/2:O.right,Math.max(v===Ke.Right?O.left:O.left+O.width/2,d.x)),y:Math.min(v===Ke.Down?O.bottom-O.height/2:O.bottom,Math.max(v===Ke.Down?O.top:O.top+O.height/2,d.y))},A=v===Ke.Right&&!m||v===Ke.Left&&!w,$=v===Ke.Down&&!S||v===Ke.Up&&!x;if(A&&k.x!==d.x){const T=y.scrollLeft+p.x,P=v===Ke.Right&&T<=b.x||v===Ke.Left&&T>=_.x;if(P&&!p.y){y.scrollTo({left:T,behavior:s});return}P?h.x=y.scrollLeft-T:h.x=v===Ke.Right?y.scrollLeft-b.x:y.scrollLeft-_.x,h.x&&y.scrollBy({left:-h.x,behavior:s});break}else if($&&k.y!==d.y){const T=y.scrollTop+p.y,P=v===Ke.Down&&T<=b.y||v===Ke.Up&&T>=_.y;if(P&&!p.x){y.scrollTo({top:T,behavior:s});return}P?h.y=y.scrollTop-T:h.y=v===Ke.Down?y.scrollTop-b.y:y.scrollTop-_.y,h.y&&y.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,js(dc(d,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}gb.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=$P,onActivation:a}=t,{active:i}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const s=i.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function G_(e){return!!(e&&"distance"in e)}function q_(e){return!!(e&&"delay"in e)}class xb{constructor(t,r,n){var a;n===void 0&&(n=r5(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:o}=i;this.props=t,this.events=r,this.document=wl(o),this.documentListeners=new Tu(this.document),this.listeners=new Tu(n),this.windowListeners=new Tu(zr(o)),this.initialCoordinates=(a=Ag(i))!=null?a:zn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(cn.Resize,this.handleCancel),this.windowListeners.add(cn.DragStart,H_),this.windowListeners.add(cn.VisibilityChange,this.handleCancel),this.windowListeners.add(cn.ContextMenu,H_),this.documentListeners.add(cn.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(q_(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(G_(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:a}=this.props;a(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(cn.Click,n5,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(cn.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:a,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!a)return;const l=(r=Ag(t))!=null?r:zn,u=dc(a,l);if(!n&&s){if(G_(s)){if(s.tolerance!=null&&jy(u,s.tolerance))return this.handleCancel();if(jy(u,s.distance))return this.handleStart()}if(q_(s)&&jy(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const i5={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class bb extends xb{constructor(t){const{event:r}=t,n=wl(r.target);super(t,i5,n)}}bb.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const o5={move:{name:"mousemove"},end:{name:"mouseup"}};var Pg;(function(e){e[e.RightClick=2]="RightClick"})(Pg||(Pg={}));class s5 extends xb{constructor(t){super(t,o5,wl(t.event.target))}}s5.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Pg.RightClick?!1:(n==null||n({event:r}),!0)}}];const Oy={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class l5 extends xb{constructor(t){super(t,Oy)}static setup(){return window.addEventListener(Oy.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Oy.move.name,t)};function t(){}}}l5.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:a}=r;return a.length>1?!1:(n==null||n({event:r}),!0)}}];var $u;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})($u||($u={}));var ip;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ip||(ip={}));function u5(e){let{acceleration:t,activator:r=$u.Pointer,canScroll:n,draggingRect:a,enabled:i,interval:o=5,order:s=ip.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const h=d5({delta:d,disabled:!i}),[g,y]=w4(),v=j.useRef({x:0,y:0}),x=j.useRef({x:0,y:0}),m=j.useMemo(()=>{switch(r){case $u.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case $u.DraggableRect:return a}},[r,a,l]),w=j.useRef(null),S=j.useCallback(()=>{const _=w.current;if(!_)return;const O=v.current.x*x.current.x,k=v.current.y*x.current.y;_.scrollBy(O,k)},[]),b=j.useMemo(()=>s===ip.TreeOrder?[...u].reverse():u,[s,u]);j.useEffect(()=>{if(!i||!u.length||!m){y();return}for(const _ of b){if((n==null?void 0:n(_))===!1)continue;const O=u.indexOf(_),k=f[O];if(!k)continue;const{direction:A,speed:$}=Y4(_,k,m,t,p);for(const T of["x","y"])h[T][A[T]]||($[T]=0,A[T]=0);if($.x>0||$.y>0){y(),w.current=_,g(S,o),v.current=$,x.current=A;return}}v.current={x:0,y:0},x.current={x:0,y:0},y()},[t,S,n,y,i,o,JSON.stringify(m),JSON.stringify(h),g,u,b,f,JSON.stringify(p)])}const c5={x:{[tr.Backward]:!1,[tr.Forward]:!1},y:{[tr.Backward]:!1,[tr.Forward]:!1}};function d5(e){let{delta:t,disabled:r}=e;const n=kg(t);return ad(a=>{if(r||!n||!a)return c5;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[tr.Backward]:a.x[tr.Backward]||i.x===-1,[tr.Forward]:a.x[tr.Forward]||i.x===1},y:{[tr.Backward]:a.y[tr.Backward]||i.y===-1,[tr.Forward]:a.y[tr.Forward]||i.y===1}}},[r,t,n])}function f5(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return ad(a=>{var i;return t==null?null:(i=n??a)!=null?i:null},[n,t])}function p5(e,t){return j.useMemo(()=>e.reduce((r,n)=>{const{sensor:a}=n,i=a.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...i]},[]),[e,t])}var pc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(pc||(pc={}));var Ng;(function(e){e.Optimized="optimized"})(Ng||(Ng={}));const K_=new Map;function h5(e,t){let{dragging:r,dependencies:n,config:a}=t;const[i,o]=j.useState(null),{frequency:s,measure:l,strategy:u}=a,f=j.useRef(e),d=v(),p=cc(d),h=j.useCallback(function(x){x===void 0&&(x=[]),!p.current&&o(m=>m===null?x:m.concat(x.filter(w=>!m.includes(w))))},[p]),g=j.useRef(null),y=ad(x=>{if(d&&!r)return K_;if(!x||x===K_||f.current!==e||i!=null){const m=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){m.set(w.id,w.rect.current);continue}const S=w.node.current,b=S?new vb(l(S),S):null;w.rect.current=b,b&&m.set(w.id,b)}return m}return x},[e,i,r,d,l]);return j.useEffect(()=>{f.current=e},[e]),j.useEffect(()=>{d||h()},[r,d]),j.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),j.useEffect(()=>{d||typeof s!="number"||g.current!==null||(g.current=setTimeout(()=>{h(),g.current=null},s))},[s,d,h,...n]),{droppableRects:y,measureDroppableContainers:h,measuringScheduled:i!=null};function v(){switch(u){case pc.Always:return!1;case pc.BeforeDragging:return r;default:return!r}}}function IP(e,t){return ad(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function m5(e,t){return IP(e,t)}function y5(e){let{callback:t,disabled:r}=e;const n=mb(t),a=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return j.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Mh(e){let{callback:t,disabled:r}=e;const n=mb(t),a=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return j.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function v5(e){return new vb(_l(e),e)}function X_(e,t,r){t===void 0&&(t=v5);const[n,a]=j.useState(null);function i(){a(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=y5({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),s=Mh({callback:i});return ra(()=>{i(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),n}function g5(e){const t=IP(e);return kP(e,t)}const Y_=[];function x5(e){const t=j.useRef(e),r=ad(n=>e?n&&n!==Y_&&e&&t.current&&e.parentNode===t.current.parentNode?n:Rh(e):Y_,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function b5(e){const[t,r]=j.useState(null),n=j.useRef(e),a=j.useCallback(i=>{const o=Sy(i.target);o&&r(s=>s?(s.set(o,Eg(o)),new Map(s)):null)},[]);return j.useEffect(()=>{const i=n.current;if(e!==i){o(i);const s=e.map(l=>{const u=Sy(l);return u?(u.addEventListener("scroll",a,{passive:!0}),[u,Eg(u)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{o(e),o(i)};function o(s){s.forEach(l=>{const u=Sy(l);u==null||u.removeEventListener("scroll",a)})}},[a,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>js(i,o),zn):TP(e):zn,[e,t])}function Z_(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==zn;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?dc(e,r.current):zn}function w5(e){j.useEffect(()=>{if(!Ih)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function _5(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:a,handler:i}=n;return r[a]=o=>{i(o,t)},r},{}),[e,t])}function RP(e){return j.useMemo(()=>e?G4(e):null,[e])}const Q_=[];function S5(e,t){t===void 0&&(t=_l);const[r]=e,n=RP(r?zr(r):null),[a,i]=j.useState(Q_);function o(){i(()=>e.length?e.map(l=>NP(l)?n:new vb(t(l),l)):Q_)}const s=Mh({callback:o});return ra(()=>{s==null||s.disconnect(),o(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),a}function j5(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return nd(t)?t:e}function O5(e){let{measure:t}=e;const[r,n]=j.useState(null),a=j.useCallback(u=>{for(const{target:f}of u)if(nd(f)){n(d=>{const p=t(f);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),i=Mh({callback:a}),o=j.useCallback(u=>{const f=j5(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),n(f?t(f):null)},[t,i]),[s,l]=np(o);return j.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const k5=[{sensor:bb,options:{}},{sensor:gb,options:{}}],A5={current:{}},gf={draggable:{measure:W_},droppable:{measure:W_,strategy:pc.WhileDragging,frequency:Ng.Optimized},dragOverlay:{measure:_l}};class Iu extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const E5={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Iu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ap},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:gf,measureDroppableContainers:ap,windowRect:null,measuringScheduled:!1},P5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ap,draggableNodes:new Map,over:null,measureDroppableContainers:ap},Dh=j.createContext(P5),MP=j.createContext(E5);function N5(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Iu}}}function C5(e,t){switch(t.type){case Wt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Wt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Wt.DragEnd:case Wt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wt.RegisterDroppable:{const{element:r}=t,{id:n}=r,a=new Iu(e.droppable.containers);return a.set(n,r),{...e,droppable:{...e.droppable,containers:a}}}case Wt.SetDroppableDisabled:{const{id:r,key:n,disabled:a}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new Iu(e.droppable.containers);return o.set(r,{...i,disabled:a}),{...e,droppable:{...e.droppable,containers:o}}}case Wt.UnregisterDroppable:{const{id:r,key:n}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new Iu(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function T5(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:a}=j.useContext(Dh),i=kg(n),o=kg(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&i&&o!=null){if(!yb(i)||document.activeElement===i.target)return;const s=a.get(o);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=j4(f);if(d){d.focus();break}}})}},[n,t,a,o,i]),null}function $5(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((a,i)=>i({transform:a,...n}),r):r}function I5(e){return j.useMemo(()=>({draggable:{...gf.draggable,...e==null?void 0:e.draggable},droppable:{...gf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...gf.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function R5(e){let{activeNode:t,measure:r,initialRect:n,config:a=!0}=e;const i=j.useRef(!1),{x:o,y:s}=typeof a=="boolean"?{x:a,y:a}:a;ra(()=>{if(!o&&!s||!t){i.current=!1;return}if(i.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=r(u),d=kP(f,n);if(o||(d.x=0),s||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=AP(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,o,s,n,r])}const DP=j.createContext({...zn,scaleX:1,scaleY:1});var ti;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ti||(ti={}));const M5=j.memo(function(t){var r,n,a,i;let{id:o,accessibility:s,autoScroll:l=!0,children:u,sensors:f=k5,collisionDetection:d=F4,measuring:p,modifiers:h,...g}=t;const y=j.useReducer(C5,void 0,N5),[v,x]=y,[m,w]=N4(),[S,b]=j.useState(ti.Uninitialized),_=S===ti.Initialized,{draggable:{active:O,nodes:k,translate:A},droppable:{containers:$}}=v,T=O!=null?k.get(O):null,P=j.useRef({initial:null,translated:null}),R=j.useMemo(()=>{var Yt;return O!=null?{id:O,data:(Yt=T==null?void 0:T.data)!=null?Yt:A5,rect:P}:null},[O,T]),L=j.useRef(null),[z,W]=j.useState(null),[V,D]=j.useState(null),U=cc(g,Object.values(g)),q=id("DndDescribedBy",o),J=j.useMemo(()=>$.getEnabled(),[$]),K=I5(p),{droppableRects:ae,measureDroppableContainers:Q,measuringScheduled:be}=h5(J,{dragging:_,dependencies:[A.x,A.y],config:K.droppable}),ue=f5(k,O),Ce=j.useMemo(()=>V?Ag(V):null,[V]),Fe=Fo(),te=m5(ue,K.draggable.measure);R5({activeNode:O!=null?k.get(O):null,config:Fe.layoutShiftCompensation,initialRect:te,measure:K.draggable.measure});const ie=X_(ue,K.draggable.measure,te),he=X_(ue?ue.parentElement:null),X=j.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ee=$.getNodeFor((r=X.current.over)==null?void 0:r.id),ve=O5({measure:K.dragOverlay.measure}),Pe=(n=ve.nodeRef.current)!=null?n:ue,ze=_?(a=ve.rect)!=null?a:ie:null,ge=!!(ve.nodeRef.current&&ve.rect),$e=g5(ge?null:ie),Le=RP(Pe?zr(Pe):null),Oe=x5(_?Ee??ue:null),Ge=S5(Oe),H=$5(h,{transform:{x:A.x-$e.x,y:A.y-$e.y,scaleX:1,scaleY:1},activatorEvent:V,active:R,activeNodeRect:ie,containerNodeRect:he,draggingNodeRect:ze,over:X.current.over,overlayNodeRect:ve.rect,scrollableAncestors:Oe,scrollableAncestorRects:Ge,windowRect:Le}),E=Ce?js(Ce,A):null,M=b5(Oe),N=Z_(M),B=Z_(M,[ie]),G=js(H,N),ee=ze?U4(ze,H):null,Z=R&&ee?d({active:R,collisionRect:ee,droppableRects:ae,droppableContainers:J,pointerCoordinates:E}):null,me=OP(Z,"id"),[Te,Et]=j.useState(null),Tt=ge?H:js(H,B),Xt=z4(Tt,(i=Te==null?void 0:Te.rect)!=null?i:null,ie),zi=j.useRef(null),Wa=j.useCallback((Yt,Zt)=>{let{sensor:cr,options:jn}=Zt;if(L.current==null)return;const Nr=k.get(L.current);if(!Nr)return;const ut=Yt.nativeEvent,Ue=new cr({active:L.current,activeNode:Nr,event:ut,options:jn,context:X,onAbort(ot){if(!k.get(ot))return;const{onDragAbort:Ve}=U.current,rn={id:ot};Ve==null||Ve(rn),m({type:"onDragAbort",event:rn})},onPending(ot,Pt,Ve,rn){if(!k.get(ot))return;const{onDragPending:Ha}=U.current,On={id:ot,constraint:Pt,initialCoordinates:Ve,offset:rn};Ha==null||Ha(On),m({type:"onDragPending",event:On})},onStart(ot){const Pt=L.current;if(Pt==null)return;const Ve=k.get(Pt);if(!Ve)return;const{onDragStart:rn}=U.current,nn={activatorEvent:ut,active:{id:Pt,data:Ve.data,rect:P}};us.unstable_batchedUpdates(()=>{rn==null||rn(nn),b(ti.Initializing),x({type:Wt.DragStart,initialCoordinates:ot,active:Pt}),m({type:"onDragStart",event:nn}),W(zi.current),D(ut)})},onMove(ot){x({type:Wt.DragMove,coordinates:ot})},onEnd:la(Wt.DragEnd),onCancel:la(Wt.DragCancel)});zi.current=Ue;function la(ot){return async function(){const{active:Ve,collisions:rn,over:nn,scrollAdjustedTranslate:Ha}=X.current;let On=null;if(Ve&&Ha){const{cancelDrop:Ga}=U.current;On={activatorEvent:ut,active:Ve,collisions:rn,delta:Ha,over:nn},ot===Wt.DragEnd&&typeof Ga=="function"&&await Promise.resolve(Ga(On))&&(ot=Wt.DragCancel)}L.current=null,us.unstable_batchedUpdates(()=>{x({type:ot}),b(ti.Uninitialized),Et(null),W(null),D(null),zi.current=null;const Ga=ot===Wt.DragEnd?"onDragEnd":"onDragCancel";if(On){const zo=U.current[Ga];zo==null||zo(On),m({type:Ga,event:On})}})}}},[k]),Bi=j.useCallback((Yt,Zt)=>(cr,jn)=>{const Nr=cr.nativeEvent,ut=k.get(jn);if(L.current!==null||!ut||Nr.dndKit||Nr.defaultPrevented)return;const Ue={active:ut};Yt(cr,Zt.options,Ue)===!0&&(Nr.dndKit={capturedBy:Zt.sensor},L.current=jn,Wa(cr,Zt))},[k,Wa]),Ui=p5(f,Bi);w5(f),ra(()=>{ie&&S===ti.Initializing&&b(ti.Initialized)},[ie,S]),j.useEffect(()=>{const{onDragMove:Yt}=U.current,{active:Zt,activatorEvent:cr,collisions:jn,over:Nr}=X.current;if(!Zt||!cr)return;const ut={active:Zt,activatorEvent:cr,collisions:jn,delta:{x:G.x,y:G.y},over:Nr};us.unstable_batchedUpdates(()=>{Yt==null||Yt(ut),m({type:"onDragMove",event:ut})})},[G.x,G.y]),j.useEffect(()=>{const{active:Yt,activatorEvent:Zt,collisions:cr,droppableContainers:jn,scrollAdjustedTranslate:Nr}=X.current;if(!Yt||L.current==null||!Zt||!Nr)return;const{onDragOver:ut}=U.current,Ue=jn.get(me),la=Ue&&Ue.rect.current?{id:Ue.id,rect:Ue.rect.current,data:Ue.data,disabled:Ue.disabled}:null,ot={active:Yt,activatorEvent:Zt,collisions:cr,delta:{x:Nr.x,y:Nr.y},over:la};us.unstable_batchedUpdates(()=>{Et(la),ut==null||ut(ot),m({type:"onDragOver",event:ot})})},[me]),ra(()=>{X.current={activatorEvent:V,active:R,activeNode:ue,collisionRect:ee,collisions:Z,droppableRects:ae,draggableNodes:k,draggingNode:Pe,draggingNodeRect:ze,droppableContainers:$,over:Te,scrollableAncestors:Oe,scrollAdjustedTranslate:G},P.current={initial:ze,translated:ee}},[R,ue,Z,ee,k,Pe,ze,ae,$,Te,Oe,G]),u5({...Fe,delta:A,draggingRect:ee,pointerCoordinates:E,scrollableAncestors:Oe,scrollableAncestorRects:Ge});const Vi=j.useMemo(()=>({active:R,activeNode:ue,activeNodeRect:ie,activatorEvent:V,collisions:Z,containerNodeRect:he,dragOverlay:ve,draggableNodes:k,droppableContainers:$,droppableRects:ae,over:Te,measureDroppableContainers:Q,scrollableAncestors:Oe,scrollableAncestorRects:Ge,measuringConfiguration:K,measuringScheduled:be,windowRect:Le}),[R,ue,ie,V,Z,he,ve,k,$,ae,Te,Q,Oe,Ge,K,be,Le]),Ml=j.useMemo(()=>({activatorEvent:V,activators:Ui,active:R,activeNodeRect:ie,ariaDescribedById:{draggable:q},dispatch:x,draggableNodes:k,over:Te,measureDroppableContainers:Q}),[V,Ui,R,ie,x,q,k,Te,Q]);return C.createElement(_P.Provider,{value:w},C.createElement(Dh.Provider,{value:Ml},C.createElement(MP.Provider,{value:Vi},C.createElement(DP.Provider,{value:Xt},u)),C.createElement(T5,{disabled:(s==null?void 0:s.restoreFocus)===!1})),C.createElement($4,{...s,hiddenTextDescribedById:q}));function Fo(){const Yt=(z==null?void 0:z.autoScrollEnabled)===!1,Zt=typeof l=="object"?l.enabled===!1:l===!1,cr=_&&!Yt&&!Zt;return typeof l=="object"?{...l,enabled:cr}:{enabled:cr}}}),D5=j.createContext(null),J_="button",L5="Draggable";function F5(e){let{id:t,data:r,disabled:n=!1,attributes:a}=e;const i=id(L5),{activators:o,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=j.useContext(Dh),{role:h=J_,roleDescription:g="draggable",tabIndex:y=0}=a??{},v=(l==null?void 0:l.id)===t,x=j.useContext(v?DP:D5),[m,w]=np(),[S,b]=np(),_=_5(o,t),O=cc(r);ra(()=>(d.set(t,{id:t,key:i,node:m,activatorNode:S,data:O}),()=>{const A=d.get(t);A&&A.key===i&&d.delete(t)}),[d,t]);const k=j.useMemo(()=>({role:h,tabIndex:y,"aria-disabled":n,"aria-pressed":v&&h===J_?!0:void 0,"aria-roledescription":g,"aria-describedby":f.draggable}),[n,h,y,v,g,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:k,isDragging:v,listeners:n?void 0:_,node:m,over:p,setNodeRef:w,setActivatorNodeRef:b,transform:x}}function z5(){return j.useContext(MP)}const B5="Droppable",U5={timeout:25};function V5(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:a}=e;const i=id(B5),{active:o,dispatch:s,over:l,measureDroppableContainers:u}=j.useContext(Dh),f=j.useRef({disabled:r}),d=j.useRef(!1),p=j.useRef(null),h=j.useRef(null),{disabled:g,updateMeasurementsFor:y,timeout:v}={...U5,...a},x=cc(y??n),m=j.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(x.current)?x.current:[x.current]),h.current=null},v)},[v]),w=Mh({callback:m,disabled:g||!o}),S=j.useCallback((k,A)=>{w&&(A&&(w.unobserve(A),d.current=!1),k&&w.observe(k))},[w]),[b,_]=np(S),O=cc(t);return j.useEffect(()=>{!w||!b.current||(w.disconnect(),d.current=!1,w.observe(b.current))},[b,w]),j.useEffect(()=>(s({type:Wt.RegisterDroppable,element:{id:n,key:i,disabled:r,node:b,rect:p,data:O}}),()=>s({type:Wt.UnregisterDroppable,key:i,id:n})),[n]),j.useEffect(()=>{r!==f.current.disabled&&(s({type:Wt.SetDroppableDisabled,id:n,key:i,disabled:r}),f.current.disabled=r)},[n,i,r,s]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===n,node:b,over:l,setNodeRef:_}}function wb(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function W5(e,t){return e.reduce((r,n,a)=>{const i=t.get(n);return i&&(r[a]=i),r},Array(e.length))}function Md(e){return e!==null&&e>=0}function H5(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:a}=e;const i=wb(t,n,r),o=t[a],s=i[a];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Dd={scaleX:1,scaleY:1},q5=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:a,rects:i,overIndex:o}=e;const s=(t=i[r])!=null?t:n;if(!s)return null;if(a===r){const u=i[o];return u?{x:0,y:rr&&a<=o?{x:0,y:-s.height-l,...Dd}:a=o?{x:0,y:s.height+l,...Dd}:{x:0,y:0,...Dd}};function K5(e,t,r){const n=e[t],a=e[t-1],i=e[t+1];return n?rn.map(_=>typeof _=="object"&&"id"in _?_.id:_),[n]),g=o!=null,y=o?h.indexOf(o.id):-1,v=u?h.indexOf(u.id):-1,x=j.useRef(h),m=!H5(h,x.current),w=v!==-1&&y===-1||m,S=G5(i);ra(()=>{m&&g&&f(h)},[m,h,g,f]),j.useEffect(()=>{x.current=h},[h]);const b=j.useMemo(()=>({activeIndex:y,containerId:d,disabled:S,disableTransforms:w,items:h,overIndex:v,useDragOverlay:p,sortedRects:W5(h,l),strategy:a}),[y,d,S.draggable,S.droppable,w,h,v,l,p,a]);return C.createElement(zP.Provider,{value:b},t)}const Y5=e=>{let{id:t,items:r,activeIndex:n,overIndex:a}=e;return wb(r,n,a).indexOf(t)},Z5=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:a,items:i,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!n||s!==i&&a===o?!1:r?!0:o!==a&&t===l},Q5={duration:200,easing:"ease"},BP="transform",J5=fc.Transition.toString({property:BP,duration:0,easing:"linear"}),eF={roleDescription:"sortable"};function tF(e){let{disabled:t,index:r,node:n,rect:a}=e;const[i,o]=j.useState(null),s=j.useRef(r);return ra(()=>{if(!t&&r!==s.current&&n.current){const l=a.current;if(l){const u=_l(n.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&o(f)}}r!==s.current&&(s.current=r)},[t,r,n,a]),j.useEffect(()=>{i&&o(null)},[i]),i}function rF(e){let{animateLayoutChanges:t=Z5,attributes:r,disabled:n,data:a,getNewIndex:i=Y5,id:o,strategy:s,resizeObserverConfig:l,transition:u=Q5}=e;const{items:f,containerId:d,activeIndex:p,disabled:h,disableTransforms:g,sortedRects:y,overIndex:v,useDragOverlay:x,strategy:m}=j.useContext(zP),w=nF(n,h),S=f.indexOf(o),b=j.useMemo(()=>({sortable:{containerId:d,index:S,items:f},...a}),[d,a,S,f]),_=j.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:O,node:k,isOver:A,setNodeRef:$}=V5({id:o,data:b,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...l}}),{active:T,activatorEvent:P,activeNodeRect:R,attributes:L,setNodeRef:z,listeners:W,isDragging:V,over:D,setActivatorNodeRef:U,transform:q}=F5({id:o,data:b,attributes:{...eF,...r},disabled:w.draggable}),J=b4($,z),K=!!T,ae=K&&!g&&Md(p)&&Md(v),Q=!x&&V,be=Q&&ae?q:null,Ce=ae?be??(s??m)({rects:y,activeNodeRect:R,activeIndex:p,overIndex:v,index:S}):null,Fe=Md(p)&&Md(v)?i({id:o,items:f,activeIndex:p,overIndex:v}):S,te=T==null?void 0:T.id,ie=j.useRef({activeId:te,items:f,newIndex:Fe,containerId:d}),he=f!==ie.current.items,X=t({active:T,containerId:d,isDragging:V,isSorting:K,id:o,index:S,items:f,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:u,wasDragging:ie.current.activeId!=null}),Ee=tF({disabled:!X,index:S,node:k,rect:O});return j.useEffect(()=>{K&&ie.current.newIndex!==Fe&&(ie.current.newIndex=Fe),d!==ie.current.containerId&&(ie.current.containerId=d),f!==ie.current.items&&(ie.current.items=f)},[K,Fe,d,f]),j.useEffect(()=>{if(te===ie.current.activeId)return;if(te&&!ie.current.activeId){ie.current.activeId=te;return}const Pe=setTimeout(()=>{ie.current.activeId=te},50);return()=>clearTimeout(Pe)},[te]),{active:T,activeIndex:p,attributes:L,data:b,rect:O,index:S,newIndex:Fe,items:f,isOver:A,isSorting:K,isDragging:V,listeners:W,node:k,overIndex:v,over:D,setNodeRef:J,setActivatorNodeRef:U,setDroppableNodeRef:$,setDraggableNodeRef:z,transform:Ee??Ce,transition:ve()};function ve(){if(Ee||he&&ie.current.newIndex===S)return J5;if(!(Q&&!yb(P)||!u)&&(K||X))return fc.Transition.toString({...u,property:BP})}}function nF(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function op(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const aF=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],iF=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:a,droppableContainers:i,over:o,scrollableAncestors:s}}=t;if(aF.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=a.get(d.id);if(p)switch(e.code){case Ke.Down:n.topp.top&&l.push(d);break;case Ke.Left:n.left>p.left&&l.push(d);break;case Ke.Right:n.left1&&(f=u[1].id),f!=null){const d=i.get(r.id),p=i.get(f),h=p?a.get(p.id):null,g=p==null?void 0:p.node.current;if(g&&h&&d&&p){const v=Rh(g).some((_,O)=>s[O]!==_),x=UP(d,p),m=oF(d,p),w=v||!x?{x:0,y:0}:{x:m?n.width-h.width:0,y:m?n.height-h.height:0},S={x:h.left,y:h.top};return w.x&&w.y?S:dc(S,w)}}}};function UP(e,t){return!op(e)||!op(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function oF(e,t){return!op(e)||!op(t)||!UP(e,t)?!1:e.data.current.sortable.index{if(!a||typeof a!="object")return{};const i=a.keys;return i&&typeof i=="object"?i:a},r={...t(e.keys),...t((n=e.routing_config)==null?void 0:n.keys)};return Object.keys(r).length===0?[]:Object.entries(r).map(([a,i])=>{const o=(i.type||i.data_type||"str_value").toString().toLowerCase(),s={key:a,type:o};return i.values&&(s.values=Array.isArray(i.values)?i.values.map(l=>l.trim()):i.values.split(",").map(l=>l.trim())),i.min_value!==void 0&&(s.min_value=i.min_value),i.max_value!==void 0&&(s.max_value=i.max_value),i.min_length!==void 0&&(s.min_length=i.min_length),i.max_length!==void 0&&(s.max_length=i.max_length),i.exact_length!==void 0&&(s.exact_length=i.exact_length),i.regex&&(s.regex=i.regex),s})}function VP(){const{data:e,error:t,isLoading:r}=ar("/config/routing-keys",wi,{refreshInterval:0,revalidateOnFocus:!1}),n=sF(e||null),a=n.reduce((o,s)=>(o[s.key]=s,o),{}),i={};return n.forEach(o=>{i[o.key]={type:o.type,values:o.values||[]}}),{config:e,keys:n,keysByName:a,routingKeysConfig:i,isLoading:r,error:t,getKeyValues:o=>{var s;return((s=a[o])==null?void 0:s.values)||[]},isIntegerKey:o=>{var s;return((s=a[o])==null?void 0:s.type)==="integer"},isEnumKey:o=>{var s;return((s=a[o])==null?void 0:s.type)==="enum"}}}const lF={"==":"equal","!=":"not_equal",">":"greater_than","<":"less_than",">=":"greater_than_equal","<=":"less_than_equal"};function uF({id:e,name:t,onRemove:r}){const{attributes:n,listeners:a,setNodeRef:i,transform:o,transition:s}=rF({id:e}),l={transform:fc.Transform.toString(o),transition:s};return c.jsxs("div",{ref:i,style:l,className:"flex items-center gap-2 bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] rounded-lg px-2 py-1.5",children:[c.jsx("span",{...n,...a,className:"cursor-grab text-slate-400",children:c.jsx(FD,{size:14})}),c.jsx("span",{className:"text-sm flex-1 font-mono",children:t}),c.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:c.jsx(Ca,{size:12})})]})}function WP({gateways:e,onChange:t}){const[r,n]=j.useState(""),[a,i]=j.useState(""),o=I4(B_(bb),B_(gb,{coordinateGetter:iF}));function s(u){const{active:f,over:d}=u;if(d&&f.id!==d.id){const p=e.findIndex(g=>g.id===f.id),h=e.findIndex(g=>g.id===d.id);t(wb(e,p,h))}}function l(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:a.trim()}]),n(""),i(""))}return c.jsxs("div",{className:"space-y-2",children:[c.jsx(M5,{sensors:o,collisionDetection:M4,onDragEnd:s,children:c.jsx(X5,{items:e.map(u=>u.id),strategy:q5,children:e.map((u,f)=>c.jsx(uF,{id:u.id,name:`${f+1}. ${u.gatewayName}${u.gatewayId?` (${u.gatewayId})`:""}`,onRemove:()=>t(e.filter(d=>d.id!==u.id))},u.id))})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{value:a,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsxs(Ie,{type:"button",size:"sm",variant:"secondary",onClick:l,children:[c.jsx(ki,{size:13})," Add"]})]})]})}function HP({gateways:e,onChange:t}){const[r,n]=j.useState(""),[a,i]=j.useState(""),o=e.reduce((l,u)=>l+u.split,0);function s(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:a.trim(),split:0}]),n(""),i(""))}return c.jsxs("div",{className:"space-y-2",children:[e.map(l=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:l.gatewayName,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayName:u.target.value}:f)),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-32 focus:outline-none"}),c.jsx("input",{value:l.gatewayId,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayId:u.target.value}:f)),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-28 focus:outline-none"}),c.jsx("input",{type:"range",min:0,max:100,value:l.split,onChange:u=>t(e.map(f=>f.id===l.id?{...f,split:Number(u.target.value)}:f)),className:"flex-1 accent-brand-500"}),c.jsxs("span",{className:"text-sm w-10 text-right",children:[l.split,"%"]}),c.jsx("button",{type:"button",onClick:()=>t(e.filter(u=>u.id!==l.id)),className:"text-red-400 hover:text-red-600",children:c.jsx(Ca,{size:12})})]},l.id)),c.jsxs("div",{className:`text-xs font-medium ${o===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",o,"% ",o!==100&&"(must equal 100)"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{value:r,onChange:l=>n(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{value:a,onChange:l=>i(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsxs(Ie,{type:"button",size:"sm",variant:"secondary",onClick:s,children:[c.jsx(ki,{size:13})," Add"]})]})]})}function cF({row:e,onChange:t,onRemove:r,routingKeys:n}){var l;const a=n[e.lhs],i=(a==null?void 0:a.type)==="enum",s=(a==null?void 0:a.type)==="integer"?[">","<",">=","<=","==","!="]:["==","!="];return c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("select",{value:e.lhs,onChange:u=>t({...e,lhs:u.target.value,value:"",operator:"=="}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:Object.keys(n).map(u=>c.jsx("option",{value:u,children:u},u))}),c.jsx("select",{value:e.operator,onChange:u=>t({...e,operator:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:s.map(u=>c.jsx("option",{value:u,children:u},u))}),i?c.jsxs("select",{value:e.value,onChange:u=>t({...e,value:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:[c.jsx("option",{value:"",children:"select..."}),(((l=n[e.lhs])==null?void 0:l.values)||[]).map(u=>c.jsx("option",{value:u,children:u},u))]}):c.jsx("input",{type:"number",value:e.value,onChange:u=>t({...e,value:u.target.value}),placeholder:"value",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none"}),c.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:c.jsx(Ca,{size:12})})]})}function dF({block:e,onChange:t,onRemove:r,routingKeys:n}){var f;const[a,i]=j.useState(!1),o=Object.keys(n)[0]||"payment_method",l=(((f=n[o])==null?void 0:f.values)||[])[0]||"";function u(){t({...e,conditions:[...e.conditions,{id:crypto.randomUUID(),lhs:o,operator:"==",value:l}]})}return c.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#0d0d12] rounded-t-xl cursor-pointer",onClick:()=>i(!a),children:[c.jsx("input",{value:e.name,onChange:d=>{d.stopPropagation(),t({...e,name:d.target.value})},onClick:d=>d.stopPropagation(),placeholder:"Rule name",className:"bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),r()},className:"text-red-400 hover:text-red-600",children:c.jsx(Ca,{size:14})}),a?c.jsx(du,{size:14}):c.jsx(fu,{size:14})]})]}),!a&&c.jsxs("div",{className:"px-4 py-3 space-y-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"CONDITIONS"}),c.jsxs("div",{className:"space-y-2",children:[e.conditions.map(d=>c.jsx(cF,{row:d,routingKeys:n,onChange:p=>t({...e,conditions:e.conditions.map(h=>h.id===d.id?p:h)}),onRemove:()=>t({...e,conditions:e.conditions.filter(p=>p.id!==d.id)})},d.id)),c.jsxs(Ie,{type:"button",variant:"ghost",size:"sm",onClick:u,children:[c.jsx(ki,{size:12})," Add Condition"]})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"OUTPUT"}),c.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(d=>c.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[c.jsx("input",{type:"radio",checked:e.outputType===d,onChange:()=>t({...e,outputType:d}),className:"accent-brand-500"}),d==="priority"?"Priority":"Volume Split"]},d))}),e.outputType==="priority"?c.jsx(WP,{gateways:e.priorityGateways,onChange:d=>t({...e,priorityGateways:d})}):c.jsx(HP,{gateways:e.volumeGateways,onChange:d=>t({...e,volumeGateways:d})})]})]})]})}function fF(e,t,r){function n(i,o,s){return i==="priority"?{priority:o.map(l=>({gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}))}:{volume_split:s.map(l=>({split:l.split,output:{gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}}))}}function a(i){return i==="priority"?"priority":"volume_split"}return{globals:{},default_selection:n(t.type,t.priorityGateways,t.volumeGateways),rules:e.map(i=>({name:i.name,routing_type:a(i.outputType),output:n(i.outputType,i.priorityGateways,i.volumeGateways),statements:[{condition:i.conditions.map(o=>{var s,l;return{lhs:o.lhs,comparison:lF[o.operator]||o.operator,value:{type:((s=r[o.lhs])==null?void 0:s.type)==="integer"?"number":"enum_variant",value:((l=r[o.lhs])==null?void 0:l.type)==="integer"?Number(o.value):o.value},metadata:{}}})}]}))}}function pF(){const{merchantId:e}=aa(),{routingKeysConfig:t,isLoading:r,error:n}=VP(),a=t,i=Object.keys(a).length>0,o=!r&&(!i||!!n),[s,l]=j.useState(""),[u,f]=j.useState(""),[d,p]=j.useState([]),[h,g]=j.useState({type:"priority",priorityGateways:[],volumeGateways:[]}),[y,v]=j.useState(!1),[x,m]=j.useState(!1),[w,S]=j.useState(null),[b,_]=j.useState(null),[O,k]=j.useState(!1),[A,$]=j.useState(null),[T,P]=j.useState(!1),[R,L]=j.useState(new Set),{data:z,mutate:W}=ar(e?`/routing/list/${e}`:null,()=>bt(`/routing/list/${e}`)),{data:V}=ar(e?`/routing/list/active/${e}`:null,()=>bt(`/routing/list/active/${e}`)),D=new Set((V||[]).map(Q=>Q.id)),U=fF(d,h,a);async function q(Q){if(Q.preventDefault(),!e){S("Set a Merchant ID first.");return}if(o){S("Routing key config is unavailable. Ensure backend /config/routing-keys is reachable and valid.");return}if(!s.trim()){S("Rule name is required.");return}m(!0),S(null),_(null);try{const be=await bt("/routing/create",{name:s.trim(),description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:U}});_(be.id),W()}catch(be){S(String(be))}finally{m(!1)}}async function J(Q){if(e){k(!0),$(null),P(!1);try{await bt("/routing/activate",{created_by:e,routing_algorithm_id:Q}),P(!0),W()}catch(be){$(String(be))}finally{k(!1)}}}function K(Q){L(be=>{const ue=new Set(be);return ue.has(Q)?ue.delete(Q):ue.add(Q),ue})}function ae(){p(Q=>[...Q,{id:crypto.randomUUID(),name:`Rule ${Q.length+1}`,conditions:[],outputType:"priority",priorityGateways:[],volumeGateways:[]}])}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Rule-Based Routing"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Create declarative routing rules"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsxs("div",{className:"lg:col-span-1 space-y-3",children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Existing Rules"})}),c.jsx(Ae,{className:"p-0",children:e?z?z.length===0?c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"No rules yet."}):c.jsx("div",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:z.map(Q=>{const be=D.has(Q.id),ue=R.has(Q.id),Ce=Q.algorithm_data||Q.algorithm;return c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate font-medium",children:Q.name}),c.jsx("p",{className:"text-xs text-slate-400 capitalize",children:Ce==null?void 0:Ce.type})]}),c.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 sm:justify-end",children:[c.jsx(_e,{variant:be?"green":"gray",children:be?"Active":"Inactive"}),c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:()=>K(Q.id),children:[c.jsx(Nh,{size:14,className:"mr-1"}),ue?"Hide":"View"]}),!be&&c.jsx(Ie,{size:"sm",variant:"ghost",onClick:()=>J(Q.id),disabled:O,children:"Activate"})]})]}),ue&&c.jsx("div",{className:"bg-slate-50 px-4 py-3 dark:bg-[#151518]",children:c.jsxs("div",{className:"space-y-2 text-xs text-slate-600",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"ID:"})," ",Q.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Description:"})," ",Q.description||"N/A"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Algorithm For:"})," ",Q.algorithm_for]}),Q.created_at&&c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",new Date(Q.created_at).toLocaleString()]}),c.jsxs("div",{children:[c.jsx("strong",{children:"Configuration:"}),c.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-transparent bg-slate-100 p-2 text-xs dark:border-[#222226] dark:bg-[#0f0f11]",children:JSON.stringify(Ce,null,2)})]})]})})]},Q.id)})}):c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Loading..."}):c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Set merchant ID to load rules."})})]}),A&&c.jsx(Gr,{error:A}),T&&c.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400",children:"Rule activated successfully."})]}),c.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[c.jsx("form",{onSubmit:q,className:"space-y-4",children:c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Rule Builder"})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rule Name *"}),c.jsx("input",{value:s,onChange:Q=>l(Q.target.value),placeholder:"my-rule",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),c.jsx("input",{value:u,onChange:Q=>f(Q.target.value),placeholder:"Optional description",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Rules"}),r&&c.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),o&&c.jsx(Gr,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Builder is disabled until this is fixed."}),d.map(Q=>c.jsx(dF,{block:Q,routingKeys:a,onChange:be=>p(ue=>ue.map(Ce=>Ce.id===Q.id?be:Ce)),onRemove:()=>p(be=>be.filter(ue=>ue.id!==Q.id))},Q.id)),c.jsxs(Ie,{type:"button",variant:"secondary",size:"sm",onClick:ae,disabled:o,children:[c.jsx(ki,{size:14})," Add Rule Block"]})]}),c.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl px-4 py-3",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"DEFAULT SELECTION (Fallback)"}),c.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(Q=>c.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[c.jsx("input",{type:"radio",checked:h.type===Q,onChange:()=>g({...h,type:Q}),className:"accent-brand-500"}),Q==="priority"?"Priority":"Volume Split"]},Q))}),h.type==="priority"?c.jsx(WP,{gateways:h.priorityGateways,onChange:Q=>g({...h,priorityGateways:Q})}):c.jsx(HP,{gateways:h.volumeGateways,onChange:Q=>g({...h,volumeGateways:Q})})]}),c.jsx(Gr,{error:w}),b&&c.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400 flex items-center justify-between",children:[c.jsxs("span",{children:["Rule created (ID: ",b,")"]}),c.jsx(Ie,{type:"button",size:"sm",onClick:()=>J(b),disabled:O,children:"Activate Now"})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx(Ie,{type:"submit",disabled:x||o,children:x?"Creating...":"Create Rule"}),c.jsx(Ie,{type:"button",variant:"secondary",size:"sm",onClick:()=>v(!y),children:y?"Hide JSON":"Preview JSON"})]})]})]})}),y&&c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"JSON Preview"})}),c.jsx(Ae,{children:c.jsx("pre",{className:"text-xs text-slate-600 overflow-auto max-h-64 bg-[#07070b] rounded-lg p-4 font-mono border border-slate-200 dark:border-[#1c1c24]",children:JSON.stringify({name:s,description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:U}},null,2)})})]})]})]})]})}function GP(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t-1}var fB=dB,pB=Fh;function hB(e,t){var r=this.__data__,n=pB(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var mB=hB,yB=Qz,vB=oB,gB=uB,xB=fB,bB=mB;function kl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},no=function(t){return jo(t)&&t.indexOf("%")===t.length-1},re=function(t){return z8(t)&&!El(t)},W8=function(t){return Ne(t)},qt=function(t){return re(t)||jo(t)},H8=0,Ro=function(t){var r=++H8;return"".concat(t||"").concat(r)},Or=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!re(t)&&!jo(t))return n;var i;if(no(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return El(i)&&(i=n),a&&i>r&&(i=r),i},oi=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},G8=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function J8(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tg(e){"@babel/helpers - typeof";return Tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tg(e)}var dS={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ja=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},fS=null,Ey=null,$b=function e(t){if(t===fS&&Array.isArray(Ey))return Ey;var r=[];return j.Children.forEach(t,function(n){Ne(n)||(R8.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Ey=r,fS=t,r};function Zr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return ja(a)}):n=[ja(t)],$b(e).forEach(function(a){var i=Yr(a,"type.displayName")||Yr(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Hr(e,t){var r=Zr(e,t);return r&&r[0]}var pS=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!re(n)||n<=0||!re(a)||a<=0)},e6=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],t6=function(t){return t&&t.type&&jo(t.type)&&e6.indexOf(t.type)>=0},iN=function(t){return t&&Tg(t)==="object"&&"clipDot"in t},r6=function(t,r,n,a){var i,o=(i=Ay==null?void 0:Ay[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!je(t)&&(a&&o.includes(r)||X8.includes(r))||n&&Tb.includes(r)},we=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(j.isValidElement(t)&&(a=t.props),!jl(a))return null;var i={};return Object.keys(a).forEach(function(o){var s;r6((s=a)===null||s===void 0?void 0:s[o],o,r,n)&&(i[o]=a[o])}),i},$g=function e(t,r){if(t===r)return!0;var n=j.Children.count(t);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return hS(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function s6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Rg(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,s=e.title,l=e.desc,u=o6(e,i6),f=a||{width:r,height:n,x:0,y:0},d=De("recharts-surface",i);return C.createElement("svg",Ig({},we(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),C.createElement("title",null,s),C.createElement("desc",null,l),t)}var l6=["children","className"];function Mg(){return Mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var We=C.forwardRef(function(e,t){var r=e.children,n=e.className,a=u6(e,l6),i=De("recharts-layer",n);return C.createElement("g",Mg({className:i},we(a,!0),{ref:t}),r)}),Ln=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;ia?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n=n?e:p6(e,t,r)}var m6=h6,y6="\\ud800-\\udfff",v6="\\u0300-\\u036f",g6="\\ufe20-\\ufe2f",x6="\\u20d0-\\u20ff",b6=v6+g6+x6,w6="\\ufe0e\\ufe0f",_6="\\u200d",S6=RegExp("["+_6+y6+b6+w6+"]");function j6(e){return S6.test(e)}var oN=j6;function O6(e){return e.split("")}var k6=O6,sN="\\ud800-\\udfff",A6="\\u0300-\\u036f",E6="\\ufe20-\\ufe2f",P6="\\u20d0-\\u20ff",N6=A6+E6+P6,C6="\\ufe0e\\ufe0f",T6="["+sN+"]",Dg="["+N6+"]",Lg="\\ud83c[\\udffb-\\udfff]",$6="(?:"+Dg+"|"+Lg+")",lN="[^"+sN+"]",uN="(?:\\ud83c[\\udde6-\\uddff]){2}",cN="[\\ud800-\\udbff][\\udc00-\\udfff]",I6="\\u200d",dN=$6+"?",fN="["+C6+"]?",R6="(?:"+I6+"(?:"+[lN,uN,cN].join("|")+")"+fN+dN+")*",M6=fN+dN+R6,D6="(?:"+[lN+Dg+"?",Dg,uN,cN,T6].join("|")+")",L6=RegExp(Lg+"(?="+Lg+")|"+D6+M6,"g");function F6(e){return e.match(L6)||[]}var z6=F6,B6=k6,U6=oN,V6=z6;function W6(e){return U6(e)?V6(e):B6(e)}var H6=W6,G6=m6,q6=oN,K6=H6,X6=JP;function Y6(e){return function(t){t=X6(t);var r=q6(t)?K6(t):void 0,n=r?r[0]:t.charAt(0),a=r?G6(r,1).join(""):t.slice(1);return n[e]()+a}}var Z6=Y6,Q6=Z6,J6=Q6("toUpperCase"),eU=J6;const Jh=rt(eU);function pt(e){return function(){return e}}const pN=Math.cos,up=Math.sin,Un=Math.sqrt,cp=Math.PI,em=2*cp,Fg=Math.PI,zg=2*Fg,Xi=1e-6,tU=zg-Xi;function hN(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hN;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;aXi)if(!(Math.abs(d*l-u*f)>Xi)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,g=a-s,y=l*l+u*u,v=h*h+g*g,x=Math.sqrt(y),m=Math.sqrt(p),w=i*Math.tan((Fg-Math.acos((y+p-v)/(2*x*m)))/2),S=w/m,b=w/x;Math.abs(S-1)>Xi&&this._append`L${t+S*f},${r+S*d}`,this._append`A${i},${i},0,0,${+(d*h>f*g)},${this._x1=t+b*l},${this._y1=r+b*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(a),l=n*Math.sin(a),u=t+s,f=r+l,d=1^o,p=o?a-i:i-a;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Xi||Math.abs(this._y1-f)>Xi)&&this._append`L${u},${f}`,n&&(p<0&&(p=p%zg+zg),p>tU?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:p>Xi&&this._append`A${n},${n},0,${+(p>=Fg)},${d},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function Ib(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new nU(t)}function Rb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mN(e){this._context=e}mN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function tm(e){return new mN(e)}function yN(e){return e[0]}function vN(e){return e[1]}function gN(e,t){var r=pt(!0),n=null,a=tm,i=null,o=Ib(s);e=typeof e=="function"?e:e===void 0?yN:pt(e),t=typeof t=="function"?t:t===void 0?vN:pt(t);function s(l){var u,f=(l=Rb(l)).length,d,p=!1,h;for(n==null&&(i=a(h=o())),u=0;u<=f;++u)!(u=h;--g)s.point(w[g],S[g]);s.lineEnd(),s.areaEnd()}x&&(w[p]=+e(v,p,d),S[p]=+t(v,p,d),s.point(n?+n(v,p,d):w[p],r?+r(v,p,d):S[p]))}if(m)return s=null,m+""||null}function f(){return gN().defined(a).curve(o).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:pt(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:pt(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(a=typeof d=="function"?d:pt(!!d),u):a},u.curve=function(d){return arguments.length?(o=d,i!=null&&(s=o(i)),u):o},u.context=function(d){return arguments.length?(d==null?i=s=null:s=o(i=d),u):i},u}class xN{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function aU(e){return new xN(e,!0)}function iU(e){return new xN(e,!1)}const Mb={draw(e,t){const r=Un(t/cp);e.moveTo(r,0),e.arc(0,0,r,0,em)}},oU={draw(e,t){const r=Un(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},bN=Un(1/3),sU=bN*2,lU={draw(e,t){const r=Un(t/sU),n=r*bN;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},uU={draw(e,t){const r=Un(t),n=-r/2;e.rect(n,n,r,r)}},cU=.8908130915292852,wN=up(cp/10)/up(7*cp/10),dU=up(em/10)*wN,fU=-pN(em/10)*wN,pU={draw(e,t){const r=Un(t*cU),n=dU*r,a=fU*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=em*i/5,s=pN(o),l=up(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*a,l*n+s*a)}e.closePath()}},Py=Un(3),hU={draw(e,t){const r=-Un(t/(Py*3));e.moveTo(0,r*2),e.lineTo(-Py*r,-r),e.lineTo(Py*r,-r),e.closePath()}},an=-.5,on=Un(3)/2,Bg=1/Un(12),mU=(Bg/2+1)*3,yU={draw(e,t){const r=Un(t/mU),n=r/2,a=r*Bg,i=n,o=r*Bg+r,s=-i,l=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(s,l),e.lineTo(an*n-on*a,on*n+an*a),e.lineTo(an*i-on*o,on*i+an*o),e.lineTo(an*s-on*l,on*s+an*l),e.lineTo(an*n+on*a,an*a-on*n),e.lineTo(an*i+on*o,an*o-on*i),e.lineTo(an*s+on*l,an*l-on*s),e.closePath()}};function vU(e,t){let r=null,n=Ib(a);e=typeof e=="function"?e:pt(e||Mb),t=typeof t=="function"?t:pt(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:pt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:pt(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function dp(){}function fp(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function _N(e){this._context=e}_N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:fp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:fp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gU(e){return new _N(e)}function SN(e){this._context=e}SN.prototype={areaStart:dp,areaEnd:dp,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:fp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xU(e){return new SN(e)}function jN(e){this._context=e}jN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:fp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bU(e){return new jN(e)}function ON(e){this._context=e}ON.prototype={areaStart:dp,areaEnd:dp,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function wU(e){return new ON(e)}function yS(e){return e<0?-1:1}function vS(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(yS(i)+yS(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function gS(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ny(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,a+s*t,i-s,o-s*r,i,o)}function pp(e){this._context=e}pp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ny(this,this._t0,gS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ny(this,gS(this,r=vS(this,e,t)),r);break;default:Ny(this,this._t0,r=vS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function kN(e){this._context=new AN(e)}(kN.prototype=Object.create(pp.prototype)).point=function(e,t){pp.prototype.point.call(this,t,e)};function AN(e){this._context=e}AN.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function _U(e){return new pp(e)}function SU(e){return new kN(e)}function EN(e){this._context=e}EN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=xS(e),a=xS(t),i=0,o=1;o=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function OU(e){return new rm(e,.5)}function kU(e){return new rm(e,0)}function AU(e){return new rm(e,1)}function Vs(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,s=i.length;r=0;)r[t]=t;return r}function EU(e,t){return e[t]}function PU(e){const t=[];return t.key=e,t}function NU(){var e=pt([]),t=Ug,r=Vs,n=EU;function a(i){var o=Array.from(e.apply(this,arguments),PU),s,l=o.length,u=-1,f;for(const d of i)for(s=0,++u;s0){for(var r,n,a=0,i=e[0].length,o;a0){for(var r=0,n=e[t[0]],a,i=n.length;r0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var PN={symbolCircle:Mb,symbolCross:oU,symbolDiamond:lU,symbolSquare:uU,symbolStar:pU,symbolTriangle:hU,symbolWye:yU},zU=Math.PI/180,BU=function(t){var r="symbol".concat(Jh(t));return PN[r]||Mb},UU=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*zU;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},VU=function(t,r){PN["symbol".concat(Jh(t))]=r},Db=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,s=o===void 0?"area":o,l=LU(t,IU),u=wS(wS({},l),{},{type:n,size:i,sizeType:s}),f=function(){var v=BU(n),x=vU().type(v).size(UU(i,s,n));return x()},d=u.className,p=u.cx,h=u.cy,g=we(u,!0);return p===+p&&h===+h&&i===+i?C.createElement("path",Vg({},g,{className:De("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(h,")"),d:f()})):null};Db.registerSymbol=VU;function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}function Wg(){return Wg=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var m=h.inactive?u:h.color;return C.createElement("li",Wg({className:v,style:d,key:"legend-item-".concat(g)},Oo(n.props,h,g)),C.createElement(Rg,{width:o,height:o,viewBox:f,style:p},n.renderIcon(h)),C.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},y?y(x,h,g):x))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var s={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return C.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(j.PureComponent);mc(Lb,"displayName","Legend");mc(Lb,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var JU=zh;function e9(){this.__data__=new JU,this.size=0}var t9=e9;function r9(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var n9=r9;function a9(e){return this.__data__.get(e)}var i9=a9;function o9(e){return this.__data__.has(e)}var s9=o9,l9=zh,u9=Ob,c9=kb,d9=200;function f9(e,t){var r=this.__data__;if(r instanceof l9){var n=r.__data__;if(!u9||n.lengths))return!1;var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var d=-1,p=!0,h=r&I9?new N9:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=LV}var Ub=FV,zV=Ba,BV=Ub,UV=Ua,VV="[object Arguments]",WV="[object Array]",HV="[object Boolean]",GV="[object Date]",qV="[object Error]",KV="[object Function]",XV="[object Map]",YV="[object Number]",ZV="[object Object]",QV="[object RegExp]",JV="[object Set]",eW="[object String]",tW="[object WeakMap]",rW="[object ArrayBuffer]",nW="[object DataView]",aW="[object Float32Array]",iW="[object Float64Array]",oW="[object Int8Array]",sW="[object Int16Array]",lW="[object Int32Array]",uW="[object Uint8Array]",cW="[object Uint8ClampedArray]",dW="[object Uint16Array]",fW="[object Uint32Array]",gt={};gt[aW]=gt[iW]=gt[oW]=gt[sW]=gt[lW]=gt[uW]=gt[cW]=gt[dW]=gt[fW]=!0;gt[VV]=gt[WV]=gt[rW]=gt[HV]=gt[nW]=gt[GV]=gt[qV]=gt[KV]=gt[XV]=gt[YV]=gt[ZV]=gt[QV]=gt[JV]=gt[eW]=gt[tW]=!1;function pW(e){return UV(e)&&BV(e.length)&&!!gt[zV(e)]}var hW=pW;function mW(e){return function(t){return e(t)}}var zN=mW,vp={exports:{}};vp.exports;(function(e,t){var r=qP,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,s=function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(vp,vp.exports);var yW=vp.exports,vW=hW,gW=zN,ES=yW,PS=ES&&ES.isTypedArray,xW=PS?gW(PS):vW,BN=xW,bW=SV,wW=zb,_W=Br,SW=FN,jW=Bb,OW=BN,kW=Object.prototype,AW=kW.hasOwnProperty;function EW(e,t){var r=_W(e),n=!r&&wW(e),a=!r&&!n&&SW(e),i=!r&&!n&&!a&&OW(e),o=r||n||a||i,s=o?bW(e.length,String):[],l=s.length;for(var u in e)(t||AW.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||jW(u,l)))&&s.push(u);return s}var PW=EW,NW=Object.prototype;function CW(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||NW;return e===r}var TW=CW;function $W(e,t){return function(r){return e(t(r))}}var UN=$W,IW=UN,RW=IW(Object.keys,Object),MW=RW,DW=TW,LW=MW,FW=Object.prototype,zW=FW.hasOwnProperty;function BW(e){if(!DW(e))return LW(e);var t=[];for(var r in Object(e))zW.call(e,r)&&r!="constructor"&&t.push(r);return t}var UW=BW,VW=Sb,WW=Ub;function HW(e){return e!=null&&WW(e.length)&&!VW(e)}var sd=HW,GW=PW,qW=UW,KW=sd;function XW(e){return KW(e)?GW(e):qW(e)}var nm=XW,YW=dV,ZW=wV,QW=nm;function JW(e){return YW(e,QW,ZW)}var eH=JW,NS=eH,tH=1,rH=Object.prototype,nH=rH.hasOwnProperty;function aH(e,t,r,n,a,i){var o=r&tH,s=NS(e),l=s.length,u=NS(t),f=u.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var p=s[d];if(!(o?p in t:nH.call(t,p)))return!1}var h=i.get(e),g=i.get(t);if(h&&g)return h==t&&g==e;var y=!0;i.set(e,t),i.set(t,e);for(var v=o;++d-1}var rG=tG;function nG(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=gG){var u=t?null:yG(e);if(u)return vG(u);o=!1,a=mG,l=new fG}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function IG(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function RG(e){return e.value}function MG(e,t){if(C.isValidElement(e))return C.cloneElement(e,t);if(typeof e=="function")return C.createElement(e,t);t.ref;var r=$G(t,OG);return C.createElement(Lb,r)}var GS=1,Oa=function(e){function t(){var r;kG(this,t);for(var n=arguments.length,a=new Array(n),i=0;iGS||Math.abs(a.height-this.lastBoundingBox.height)>GS)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ca({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,s=a.verticalAlign,l=a.margin,u=a.chartWidth,f=a.chartHeight,d,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var h=this.getBBoxSnapshot();d={left:((u||0)-h.width)/2}}else d=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var g=this.getBBoxSnapshot();p={top:((f||0)-g.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return ca(ca({},d),p)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,s=a.height,l=a.wrapperStyle,u=a.payloadUniqBy,f=a.payload,d=ca(ca({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return C.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(h){n.wrapperNode=h}},MG(i,ca(ca({},this.props),{},{payload:XN(f,u,RG)})))}}],[{key:"getWithHeight",value:function(n,a){var i=ca(ca({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&re(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(j.PureComponent);am(Oa,"displayName","Legend");am(Oa,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var qS=od,DG=zb,LG=Br,KS=qS?qS.isConcatSpreadable:void 0;function FG(e){return LG(e)||DG(e)||!!(KS&&e&&e[KS])}var zG=FG,BG=DN,UG=zG;function QN(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=UG),a||(a=[]);++i0&&r(s)?t>1?QN(s,t-1,r,n,a):BG(a,s):n||(a[a.length]=s)}return a}var JN=QN;function VG(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++a];if(r(i[l],l,i)===!1)break}return t}}var WG=VG,HG=WG,GG=HG(),qG=GG,KG=qG,XG=nm;function YG(e,t){return e&&KG(e,t,XG)}var eC=YG,ZG=sd;function QG(e,t){return function(r,n){if(r==null)return r;if(!ZG(r))return e(r,n);for(var a=r.length,i=t?a:-1,o=Object(r);(t?i--:++it||i&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!a)return 1;if(!n&&!i&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var fq=dq,Iy=Eb,pq=Pb,hq=oa,mq=tC,yq=sq,vq=zN,gq=fq,xq=Cl,bq=Br;function wq(e,t,r){t.length?t=Iy(t,function(i){return bq(i)?function(o){return pq(o,i.length===1?i[0]:i)}:i}):t=[xq];var n=-1;t=Iy(t,vq(hq));var a=mq(e,function(i,o,s){var l=Iy(t,function(u){return u(i)});return{criteria:l,index:++n,value:i}});return yq(a,function(i,o){return gq(i,o,r)})}var _q=wq;function Sq(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var jq=Sq,Oq=jq,YS=Math.max;function kq(e,t,r){return t=YS(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=YS(n.length-t,0),o=Array(i);++a0){if(++t>=Mq)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var zq=Fq,Bq=Rq,Uq=zq,Vq=Uq(Bq),Wq=Vq,Hq=Cl,Gq=Aq,qq=Wq;function Kq(e,t){return qq(Gq(e,t,Hq),e+"")}var Xq=Kq,Yq=jb,Zq=sd,Qq=Bb,Jq=Ii;function eK(e,t,r){if(!Jq(r))return!1;var n=typeof t;return(n=="number"?Zq(r)&&Qq(t,r.length):n=="string"&&t in r)?Yq(r[t],e):!1}var im=eK,tK=JN,rK=_q,nK=Xq,QS=im,aK=nK(function(e,t){if(e==null)return[];var r=t.length;return r>1&&QS(e,t[0],t[1])?t=[]:r>2&&QS(t[0],t[1],t[2])&&(t=[t[0]]),rK(e,tK(t,1),[])}),iK=aK;const Hb=rt(iK);function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function Qg(){return Qg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(ql,"-left"),re(r)&&t&&re(t.x)&&r=t.y),"".concat(ql,"-top"),re(n)&&t&&re(t.y)&&ny?Math.max(f,l[n]):Math.max(d,l[n])}function bK(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function wK(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=tj({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),d=tj({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=bK({translateX:f,translateY:d,useTranslate3d:s})):u=gK,{cssProperties:u,cssClasses:xK({translateX:f,translateY:d,coordinate:r})}}function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function rj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nj(e){for(var t=1;taj||Math.abs(n.height-this.state.lastBoundingBox.height)>aj)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,s=a.animationDuration,l=a.animationEasing,u=a.children,f=a.coordinate,d=a.hasPayload,p=a.isAnimationActive,h=a.offset,g=a.position,y=a.reverseDirection,v=a.useTranslate3d,x=a.viewBox,m=a.wrapperStyle,w=wK({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:g,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:x}),S=w.cssClasses,b=w.cssProperties,_=nj(nj({transition:p&&i?"transform ".concat(s,"ms ").concat(l):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},m);return C.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(k){n.wrapperNode=k}},u)}}])}(j.PureComponent),CK=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ri={isSsr:CK()};function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function ij(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oj(e){for(var t=1;t0;return C.createElement(NK,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:i,coordinate:f,hasPayload:_,offset:h,position:v,reverseDirection:x,useTranslate3d:m,viewBox:w,wrapperStyle:S},BK(u,oj(oj({},this.props),{},{payload:b})))}}])}(j.PureComponent);Gb(_r,"displayName","Tooltip");Gb(_r,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ri.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var UK=ia,VK=function(){return UK.Date.now()},WK=VK,HK=/\s/;function GK(e){for(var t=e.length;t--&&HK.test(e.charAt(t)););return t}var qK=GK,KK=qK,XK=/^\s+/;function YK(e){return e&&e.slice(0,KK(e)+1).replace(XK,"")}var ZK=YK,QK=ZK,sj=Ii,JK=Sl,lj=NaN,eX=/^[-+]0x[0-9a-f]+$/i,tX=/^0b[01]+$/i,rX=/^0o[0-7]+$/i,nX=parseInt;function aX(e){if(typeof e=="number")return e;if(JK(e))return lj;if(sj(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=sj(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=QK(e);var r=tX.test(e);return r||rX.test(e)?nX(e.slice(2),r?2:8):eX.test(e)?lj:+e}var sC=aX,iX=Ii,My=WK,uj=sC,oX="Expected a function",sX=Math.max,lX=Math.min;function uX(e,t,r){var n,a,i,o,s,l,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(oX);t=uj(t)||0,iX(r)&&(f=!!r.leading,d="maxWait"in r,i=d?sX(uj(r.maxWait)||0,t):i,p="trailing"in r?!!r.trailing:p);function h(_){var O=n,k=a;return n=a=void 0,u=_,o=e.apply(k,O),o}function g(_){return u=_,s=setTimeout(x,t),f?h(_):o}function y(_){var O=_-l,k=_-u,A=t-O;return d?lX(A,i-k):A}function v(_){var O=_-l,k=_-u;return l===void 0||O>=t||O<0||d&&k>=i}function x(){var _=My();if(v(_))return m(_);s=setTimeout(x,y(_))}function m(_){return s=void 0,p&&n?h(_):(n=a=void 0,o)}function w(){s!==void 0&&clearTimeout(s),u=0,n=l=a=s=void 0}function S(){return s===void 0?o:m(My())}function b(){var _=My(),O=v(_);if(n=arguments,a=this,l=_,O){if(s===void 0)return g(l);if(d)return clearTimeout(s),s=setTimeout(x,t),h(l)}return s===void 0&&(s=setTimeout(x,t)),o}return b.cancel=w,b.flush=S,b}var cX=uX,dX=cX,fX=Ii,pX="Expected a function";function hX(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(pX);return fX(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),dX(e,t,{leading:n,maxWait:t,trailing:a})}var mX=hX;const lC=rt(mX);function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function cj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bd(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(R=lC(R,y,{trailing:!0,leading:!1}));var L=new ResizeObserver(R),z=b.current.getBoundingClientRect(),W=z.width,V=z.height;return T(W,V),L.observe(b.current),function(){L.disconnect()}},[T,y]);var P=j.useMemo(function(){var R=A.containerWidth,L=A.containerHeight;if(R<0||L<0)return null;Ln(no(o)||no(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,l),Ln(!r||r>0,"The aspect(%s) must be greater than zero.",r);var z=no(o)?R:o,W=no(l)?L:l;r&&r>0&&(z?W=z/r:W&&(z=W*r),p&&W>p&&(W=p)),Ln(z>0||W>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,z,W,o,l,f,d,r);var V=!Array.isArray(h)&&ja(h.type).endsWith("Chart");return C.Children.map(h,function(D){return C.isValidElement(D)?j.cloneElement(D,Bd({width:z,height:W},V?{style:Bd({height:"100%",width:"100%",maxHeight:W,maxWidth:z},D.props.style)}:{})):D})},[r,h,l,p,d,f,A,o]);return C.createElement("div",{id:v?"".concat(v):void 0,className:De("recharts-responsive-container",x),style:Bd(Bd({},S),{},{width:o,height:l,minWidth:f,minHeight:d,maxHeight:p}),ref:b},P)}),co=function(t){return null};co.displayName="Cell";function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}function fj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function r0(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ri.isSsr)return{width:0,height:0};var n=PX(r),a=JSON.stringify({text:t,copyStyle:n});if(Wo.widthCache[a])return Wo.widthCache[a];try{var i=document.getElementById(pj);i||(i=document.createElement("span"),i.setAttribute("id",pj),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=r0(r0({},EX),n);Object.assign(i.style,o),i.textContent="".concat(t);var s=i.getBoundingClientRect(),l={width:s.width,height:s.height};return Wo.widthCache[a]=l,++Wo.cacheCount>AX&&(Wo.cacheCount=0,Wo.widthCache={}),l}catch{return{width:0,height:0}}},NX=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function wp(e,t){return IX(e)||$X(e,t)||TX(e,t)||CX()}function CX(){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 TX(e,t){if(e){if(typeof e=="string")return hj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hj(e,t)}}function hj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bj(e,t){return QX(e)||ZX(e,t)||YX(e,t)||XX()}function XX(){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 YX(e,t){if(e){if(typeof e=="string")return wj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wj(e,t)}}function wj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(W,V){var D=V.word,U=V.width,q=W[W.length-1];if(q&&(a==null||i||q.width+U+nV.width?W:V})};if(!f)return h;for(var y="…",v=function(z){var W=d.slice(0,z),V=fC({breakAll:u,style:l,children:W+y}).wordsWithComputedWidth,D=p(V),U=D.length>o||g(D).width>Number(a);return[U,D]},x=0,m=d.length-1,w=0,S;x<=m&&w<=d.length-1;){var b=Math.floor((x+m)/2),_=b-1,O=v(_),k=bj(O,2),A=k[0],$=k[1],T=v(b),P=bj(T,1),R=P[0];if(!A&&!R&&(x=b+1),A&&R&&(m=b-1),!A&&R){S=$;break}w++}return S||h},_j=function(t){var r=Ne(t)?[]:t.toString().split(dC);return[{words:r}]},eY=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Ri.isSsr){var l,u,f=fC({breakAll:o,children:a,style:i});if(f){var d=f.wordsWithComputedWidth,p=f.spaceWidth;l=d,u=p}else return _j(a);return JX({breakAll:o,children:a,maxLines:s,style:i},l,u,r,n)}return _j(a)},Sj="#808080",ko=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,d=f===void 0?!1:f,p=t.textAnchor,h=p===void 0?"start":p,g=t.verticalAnchor,y=g===void 0?"end":g,v=t.fill,x=v===void 0?Sj:v,m=xj(t,GX),w=j.useMemo(function(){return eY({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),S=m.dx,b=m.dy,_=m.angle,O=m.className,k=m.breakAll,A=xj(m,qX);if(!qt(n)||!qt(i))return null;var $=n+(re(S)?S:0),T=i+(re(b)?b:0),P;switch(y){case"start":P=Dy("calc(".concat(u,")"));break;case"middle":P=Dy("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:P=Dy("calc(".concat(w.length-1," * -").concat(s,")"));break}var R=[];if(d){var L=w[0].width,z=m.width;R.push("scale(".concat((re(z)?z/L:1)/L,")"))}return _&&R.push("rotate(".concat(_,", ").concat($,", ").concat(T,")")),R.length&&(A.transform=R.join(" ")),C.createElement("text",n0({},we(A,!0),{x:$,y:T,className:De("recharts-text",O),textAnchor:h,fill:x.includes("url")?Sj:x}),w.map(function(W,V){var D=W.words.join(k?"":" ");return C.createElement("tspan",{x:$,dy:V===0?P:s,key:"".concat(D,"-").concat(V)},D)}))};function Si(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function tY(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function qb(e){let t,r,n;e.length!==2?(t=Si,r=(s,l)=>Si(e(s),l),n=(s,l)=>e(s)-l):(t=e===Si||e===tY?e:rY,r=e,n=e);function a(s,l,u=0,f=s.length){if(u>>1;r(s[d],l)<0?u=d+1:f=d}while(u>>1;r(s[d],l)<=0?u=d+1:f=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:a,center:o,right:i}}function rY(){return 0}function pC(e){return e===null?NaN:+e}function*nY(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const aY=qb(Si),ld=aY.right;qb(pC).center;class jj extends Map{constructor(t,r=sY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(Oj(this,t))}has(t){return super.has(Oj(this,t))}set(t,r){return super.set(iY(this,t),r)}delete(t){return super.delete(oY(this,t))}}function Oj({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function iY({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function oY({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function sY(e){return e!==null&&typeof e=="object"?e.valueOf():e}function lY(e=Si){if(e===Si)return hC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function hC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const uY=Math.sqrt(50),cY=Math.sqrt(10),dY=Math.sqrt(2);function _p(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=uY?10:i>=cY?5:i>=dY?2:1;let s,l,u;return a<0?(u=Math.pow(10,-a)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,a)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=a))return[];const s=i-a+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function Aj(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function mC(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?hC:lY(a);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(l-d)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*d/l+p)),g=Math.min(n,Math.floor(t+(l-u)*d/l+p));mC(e,t,h,g,a)}const i=e[t];let o=r,s=n;for(Kl(e,r,t),a(e[n],i)>0&&Kl(e,r,n);o0;)--s}a(e[r],i)===0?Kl(e,r,s):(++s,Kl(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Kl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function fY(e,t,r){if(e=Float64Array.from(nY(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Aj(e);if(t>=1)return kj(e);var n,a=(n-1)*t,i=Math.floor(a),o=kj(mC(e,i).subarray(0,i+1)),s=Aj(e.subarray(i+1));return o+(s-o)*(a-i)}}function pY(e,t,r=pC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),s=+r(e[i+1],i+1,e);return o+(s-o)*(a-i)}}function hY(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Vd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Vd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=yY.exec(e))?new Mr(t[1],t[2],t[3],1):(t=vY.exec(e))?new Mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gY.exec(e))?Vd(t[1],t[2],t[3],t[4]):(t=xY.exec(e))?Vd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bY.exec(e))?Ij(t[1],t[2]/100,t[3]/100,1):(t=wY.exec(e))?Ij(t[1],t[2]/100,t[3]/100,t[4]):Ej.hasOwnProperty(e)?Cj(Ej[e]):e==="transparent"?new Mr(NaN,NaN,NaN,0):null}function Cj(e){return new Mr(e>>16&255,e>>8&255,e&255,1)}function Vd(e,t,r,n){return n<=0&&(e=t=r=NaN),new Mr(e,t,r,n)}function jY(e){return e instanceof ud||(e=jc(e)),e?(e=e.rgb(),new Mr(e.r,e.g,e.b,e.opacity)):new Mr}function l0(e,t,r,n){return arguments.length===1?jY(e):new Mr(e,t,r,n??1)}function Mr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Xb(Mr,l0,vC(ud,{brighter(e){return e=e==null?Sp:Math.pow(Sp,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_c:Math.pow(_c,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mr(fo(this.r),fo(this.g),fo(this.b),jp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Tj,formatHex:Tj,formatHex8:OY,formatRgb:$j,toString:$j}));function Tj(){return`#${ao(this.r)}${ao(this.g)}${ao(this.b)}`}function OY(){return`#${ao(this.r)}${ao(this.g)}${ao(this.b)}${ao((isNaN(this.opacity)?1:this.opacity)*255)}`}function $j(){const e=jp(this.opacity);return`${e===1?"rgb(":"rgba("}${fo(this.r)}, ${fo(this.g)}, ${fo(this.b)}${e===1?")":`, ${e})`}`}function jp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ao(e){return e=fo(e),(e<16?"0":"")+e.toString(16)}function Ij(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Rn(e,t,r,n)}function gC(e){if(e instanceof Rn)return new Rn(e.h,e.s,e.l,e.opacity);if(e instanceof ud||(e=jc(e)),!e)return new Rn;if(e instanceof Rn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,s=i-a,l=(i+a)/2;return s?(t===i?o=(r-n)/s+(r0&&l<1?0:o,new Rn(o,s,l,e.opacity)}function kY(e,t,r,n){return arguments.length===1?gC(e):new Rn(e,t,r,n??1)}function Rn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Xb(Rn,kY,vC(ud,{brighter(e){return e=e==null?Sp:Math.pow(Sp,e),new Rn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_c:Math.pow(_c,e),new Rn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Mr(Ly(e>=240?e-240:e+120,a,n),Ly(e,a,n),Ly(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new Rn(Rj(this.h),Wd(this.s),Wd(this.l),jp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=jp(this.opacity);return`${e===1?"hsl(":"hsla("}${Rj(this.h)}, ${Wd(this.s)*100}%, ${Wd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Rj(e){return e=(e||0)%360,e<0?e+360:e}function Wd(e){return Math.max(0,Math.min(1,e||0))}function Ly(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Yb=e=>()=>e;function AY(e,t){return function(r){return e+r*t}}function EY(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function PY(e){return(e=+e)==1?xC:function(t,r){return r-t?EY(t,r,e):Yb(isNaN(t)?r:t)}}function xC(e,t){var r=t-e;return r?AY(e,r):Yb(isNaN(e)?t:e)}const Mj=function e(t){var r=PY(t);function n(a,i){var o=r((a=l0(a)).r,(i=l0(i)).r),s=r(a.g,i.g),l=r(a.b,i.b),u=xC(a.opacity,i.opacity);return function(f){return a.r=o(f),a.g=s(f),a.b=l(f),a.opacity=u(f),a+""}}return n.gamma=e,n}(1);function NY(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;ar&&(i=t.slice(r,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,l.push({i:o,x:Op(n,a)})),r=Fy.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function BY(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a2?UY:BY,l=u=null,d}function d(p){return p==null||isNaN(p=+p)?i:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return d.invert=function(p){return o(a((u||(u=s(t,e.map(n),Op)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,kp),f()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),r=Zb,f()},d.clamp=function(p){return arguments.length?(o=p?!0:kr,f()):o!==kr},d.interpolate=function(p){return arguments.length?(r=p,f()):r},d.unknown=function(p){return arguments.length?(i=p,d):i},function(p,h){return n=p,a=h,f()}}function Qb(){return om()(kr,kr)}function VY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ap(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ks(e){return e=Ap(Math.abs(e)),e?e[1]:NaN}function WY(e,t){return function(r,n){for(var a=r.length,i=[],o=0,s=e[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),i.push(r.substring(a-=s,a+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function HY(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var GY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Oc(e){if(!(t=GY.exec(e)))throw new Error("invalid format: "+e);var t;return new Jb({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Oc.prototype=Jb.prototype;function Jb(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Jb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function qY(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var Ep;function KY(e,t){var r=Ap(e,t);if(!r)return Ep=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(Ep=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Ap(e,Math.max(0,t+i-1))[0]}function Lj(e,t){var r=Ap(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const Fj={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:VY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Lj(e*100,t),r:Lj,s:KY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function zj(e){return e}var Bj=Array.prototype.map,Uj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XY(e){var t=e.grouping===void 0||e.thousands===void 0?zj:WY(Bj.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?zj:HY(Bj.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d,p){d=Oc(d);var h=d.fill,g=d.align,y=d.sign,v=d.symbol,x=d.zero,m=d.width,w=d.comma,S=d.precision,b=d.trim,_=d.type;_==="n"?(w=!0,_="g"):Fj[_]||(S===void 0&&(S=12),b=!0,_="g"),(x||h==="0"&&g==="=")&&(x=!0,h="0",g="=");var O=(p&&p.prefix!==void 0?p.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),k=(v==="$"?n:/[%p]/.test(_)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),A=Fj[_],$=/[defgprs%]/.test(_);S=S===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function T(P){var R=O,L=k,z,W,V;if(_==="c")L=A(P)+L,P="";else{P=+P;var D=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),S),b&&(P=qY(P)),D&&+P==0&&y!=="+"&&(D=!1),R=(D?y==="("?y:s:y==="-"||y==="("?"":y)+R,L=(_==="s"&&!isNaN(P)&&Ep!==void 0?Uj[8+Ep/3]:"")+L+(D&&y==="("?")":""),$){for(z=-1,W=P.length;++zV||V>57){L=(V===46?a+P.slice(z+1):P.slice(z))+L,P=P.slice(0,z);break}}}w&&!x&&(P=t(P,1/0));var U=R.length+P.length+L.length,q=U>1)+R+P+L+q.slice(U);break;default:P=q+R+P+L;break}return i(P)}return T.toString=function(){return d+""},T}function f(d,p){var h=Math.max(-8,Math.min(8,Math.floor(Ks(p)/3)))*3,g=Math.pow(10,-h),y=u((d=Oc(d),d.type="f",d),{suffix:Uj[8+h/3]});return function(v){return y(g*v)}}return{format:u,formatPrefix:f}}var Hd,ew,bC;YY({thousands:",",grouping:[3],currency:["$",""]});function YY(e){return Hd=XY(e),ew=Hd.format,bC=Hd.formatPrefix,Hd}function ZY(e){return Math.max(0,-Ks(Math.abs(e)))}function QY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ks(t)/3)))*3-Ks(Math.abs(e)))}function JY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ks(t)-Ks(e))+1}function wC(e,t,r,n){var a=o0(e,t,r),i;switch(n=Oc(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=QY(a,o))&&(n.precision=i),bC(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=JY(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=ZY(a))&&(n.precision=i-(n.type==="%")*2);break}}return ew(n)}function Mi(e){var t=e.domain;return e.ticks=function(r){var n=t();return a0(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return wC(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],s=n[i],l,u,f=10;for(s0;){if(u=i0(o,s,r),u===l)return n[a]=o,n[i]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Pp(){var e=Qb();return e.copy=function(){return cd(e,Pp())},Sn.apply(e,arguments),Mi(e)}function _C(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,kp),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return _C(e).unknown(t)},e=arguments.length?Array.from(e,kp):[0,1],Mi(r)}function SC(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return iMath.pow(e,t)}function aZ(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Hj(e){return(t,r)=>-e(-t,r)}function tw(e){const t=e(Vj,Wj),r=t.domain;let n=10,a,i;function o(){return a=aZ(n),i=nZ(n),r()[0]<0?(a=Hj(a),i=Hj(i),e(eZ,tZ)):e(Vj,Wj),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const d=f0){for(;p<=h;++p)for(g=1;gf)break;x.push(y)}}else for(;p<=h;++p)for(g=n-1;g>=1;--g)if(y=p>0?g/i(-p):g*i(p),!(yf)break;x.push(y)}x.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Oc(l)).precision==null&&(l.trim=!0),l=ew(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let d=f/i(Math.round(a(f)));return d*nr(SC(r(),{floor:s=>i(Math.floor(a(s))),ceil:s=>i(Math.ceil(a(s)))})),t}function jC(){const e=tw(om()).domain([1,10]);return e.copy=()=>cd(e,jC()).base(e.base()),Sn.apply(e,arguments),e}function Gj(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qj(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rw(e){var t=1,r=e(Gj(t),qj(t));return r.constant=function(n){return arguments.length?e(Gj(t=+n),qj(t)):t},Mi(r)}function OC(){var e=rw(om());return e.copy=function(){return cd(e,OC()).constant(e.constant())},Sn.apply(e,arguments)}function Kj(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iZ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oZ(e){return e<0?-e*e:e*e}function nw(e){var t=e(kr,kr),r=1;function n(){return r===1?e(kr,kr):r===.5?e(iZ,oZ):e(Kj(r),Kj(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Mi(t)}function aw(){var e=nw(om());return e.copy=function(){return cd(e,aw()).exponent(e.exponent())},Sn.apply(e,arguments),e}function sZ(){return aw.apply(null,arguments).exponent(.5)}function Xj(e){return Math.sign(e)*e*e}function lZ(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function kC(){var e=Qb(),t=[0,1],r=!1,n;function a(i){var o=lZ(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(Xj(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,kp)).map(Xj)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return kC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Sn.apply(a,arguments),Mi(a)}function AC(){var e=[],t=[],r=[],n;function a(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(i=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return EC().domain([e,t]).range(a).unknown(i)},Sn.apply(Mi(o),arguments)}function PC(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[ld(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return PC().domain(e).range(t).unknown(r)},Sn.apply(a,arguments)}const zy=new Date,By=new Date;function Kt(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),s=a.ceil(i);return i-o(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,s)=>{const l=[];if(i=a.ceil(i),s=s==null?1:Math.floor(s),!(i0))return l;let u;do l.push(u=new Date(+i)),t(i,s),e(i);while(uKt(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!i(o););else for(;--s>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(zy.setTime(+i),By.setTime(+o),e(zy),e(By),Math.floor(r(zy,By))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Np=Kt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Np.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Np);Np.range;const ba=1e3,yn=ba*60,wa=yn*60,$a=wa*24,iw=$a*7,Yj=$a*30,Uy=$a*365,io=Kt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ba)},(e,t)=>(t-e)/ba,e=>e.getUTCSeconds());io.range;const ow=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ba)},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getMinutes());ow.range;const sw=Kt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getUTCMinutes());sw.range;const lw=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ba-e.getMinutes()*yn)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getHours());lw.range;const uw=Kt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getUTCHours());uw.range;const dd=Kt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*yn)/$a,e=>e.getDate()-1);dd.range;const sm=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>e.getUTCDate()-1);sm.range;const NC=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>Math.floor(e/$a));NC.range;function Mo(e){return Kt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*yn)/iw)}const lm=Mo(0),Cp=Mo(1),uZ=Mo(2),cZ=Mo(3),Xs=Mo(4),dZ=Mo(5),fZ=Mo(6);lm.range;Cp.range;uZ.range;cZ.range;Xs.range;dZ.range;fZ.range;function Do(e){return Kt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/iw)}const um=Do(0),Tp=Do(1),pZ=Do(2),hZ=Do(3),Ys=Do(4),mZ=Do(5),yZ=Do(6);um.range;Tp.range;pZ.range;hZ.range;Ys.range;mZ.range;yZ.range;const cw=Kt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());cw.range;const dw=Kt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());dw.range;const Ia=Kt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ia.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ia.range;const Ra=Kt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ra.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ra.range;function CC(e,t,r,n,a,i){const o=[[io,1,ba],[io,5,5*ba],[io,15,15*ba],[io,30,30*ba],[i,1,yn],[i,5,5*yn],[i,15,15*yn],[i,30,30*yn],[a,1,wa],[a,3,3*wa],[a,6,6*wa],[a,12,12*wa],[n,1,$a],[n,2,2*$a],[r,1,iw],[t,1,Yj],[t,3,3*Yj],[e,1,Uy]];function s(u,f,d){const p=fv).right(o,p);if(h===o.length)return e.every(o0(u/Uy,f/Uy,d));if(h===0)return Np.every(Math.max(o0(u,f,d),1));const[g,y]=o[p/o[h-1][2]53)return null;"w"in X||(X.w=1),"Z"in X?(ve=Wy(Xl(X.y,0,1)),Pe=ve.getUTCDay(),ve=Pe>4||Pe===0?Tp.ceil(ve):Tp(ve),ve=sm.offset(ve,(X.V-1)*7),X.y=ve.getUTCFullYear(),X.m=ve.getUTCMonth(),X.d=ve.getUTCDate()+(X.w+6)%7):(ve=Vy(Xl(X.y,0,1)),Pe=ve.getDay(),ve=Pe>4||Pe===0?Cp.ceil(ve):Cp(ve),ve=dd.offset(ve,(X.V-1)*7),X.y=ve.getFullYear(),X.m=ve.getMonth(),X.d=ve.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),Pe="Z"in X?Wy(Xl(X.y,0,1)).getUTCDay():Vy(Xl(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(Pe+5)%7:X.w+X.U*7-(Pe+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,Wy(X)):Vy(X)}}function k(te,ie,he,X){for(var Ee=0,ve=ie.length,Pe=he.length,ze,ge;Ee=Pe)return-1;if(ze=ie.charCodeAt(Ee++),ze===37){if(ze=ie.charAt(Ee++),ge=b[ze in Zj?ie.charAt(Ee++):ze],!ge||(X=ge(te,he,X))<0)return-1}else if(ze!=he.charCodeAt(X++))return-1}return X}function A(te,ie,he){var X=u.exec(ie.slice(he));return X?(te.p=f.get(X[0].toLowerCase()),he+X[0].length):-1}function $(te,ie,he){var X=h.exec(ie.slice(he));return X?(te.w=g.get(X[0].toLowerCase()),he+X[0].length):-1}function T(te,ie,he){var X=d.exec(ie.slice(he));return X?(te.w=p.get(X[0].toLowerCase()),he+X[0].length):-1}function P(te,ie,he){var X=x.exec(ie.slice(he));return X?(te.m=m.get(X[0].toLowerCase()),he+X[0].length):-1}function R(te,ie,he){var X=y.exec(ie.slice(he));return X?(te.m=v.get(X[0].toLowerCase()),he+X[0].length):-1}function L(te,ie,he){return k(te,t,ie,he)}function z(te,ie,he){return k(te,r,ie,he)}function W(te,ie,he){return k(te,n,ie,he)}function V(te){return o[te.getDay()]}function D(te){return i[te.getDay()]}function U(te){return l[te.getMonth()]}function q(te){return s[te.getMonth()]}function J(te){return a[+(te.getHours()>=12)]}function K(te){return 1+~~(te.getMonth()/3)}function ae(te){return o[te.getUTCDay()]}function Q(te){return i[te.getUTCDay()]}function be(te){return l[te.getUTCMonth()]}function ue(te){return s[te.getUTCMonth()]}function Ce(te){return a[+(te.getUTCHours()>=12)]}function Fe(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var ie=_(te+="",w);return ie.toString=function(){return te},ie},parse:function(te){var ie=O(te+="",!1);return ie.toString=function(){return te},ie},utcFormat:function(te){var ie=_(te+="",S);return ie.toString=function(){return te},ie},utcParse:function(te){var ie=O(te+="",!0);return ie.toString=function(){return te},ie}}}var Zj={"-":"",_:" ",0:"0"},ir=/^\s*\d+/,_Z=/^%/,SZ=/[\\^$*+?|[\]().{}]/g;function Je(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i[t.toLowerCase(),r]))}function OZ(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function kZ(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function AZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function EZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function PZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Qj(e,t,r){var n=ir.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Jj(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function NZ(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function CZ(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function TZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function eO(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function $Z(e,t,r){var n=ir.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function tO(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function IZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function RZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function MZ(e,t,r){var n=ir.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function DZ(e,t,r){var n=ir.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function LZ(e,t,r){var n=_Z.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function FZ(e,t,r){var n=ir.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function zZ(e,t,r){var n=ir.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function rO(e,t){return Je(e.getDate(),t,2)}function BZ(e,t){return Je(e.getHours(),t,2)}function UZ(e,t){return Je(e.getHours()%12||12,t,2)}function VZ(e,t){return Je(1+dd.count(Ia(e),e),t,3)}function TC(e,t){return Je(e.getMilliseconds(),t,3)}function WZ(e,t){return TC(e,t)+"000"}function HZ(e,t){return Je(e.getMonth()+1,t,2)}function GZ(e,t){return Je(e.getMinutes(),t,2)}function qZ(e,t){return Je(e.getSeconds(),t,2)}function KZ(e){var t=e.getDay();return t===0?7:t}function XZ(e,t){return Je(lm.count(Ia(e)-1,e),t,2)}function $C(e){var t=e.getDay();return t>=4||t===0?Xs(e):Xs.ceil(e)}function YZ(e,t){return e=$C(e),Je(Xs.count(Ia(e),e)+(Ia(e).getDay()===4),t,2)}function ZZ(e){return e.getDay()}function QZ(e,t){return Je(Cp.count(Ia(e)-1,e),t,2)}function JZ(e,t){return Je(e.getFullYear()%100,t,2)}function eQ(e,t){return e=$C(e),Je(e.getFullYear()%100,t,2)}function tQ(e,t){return Je(e.getFullYear()%1e4,t,4)}function rQ(e,t){var r=e.getDay();return e=r>=4||r===0?Xs(e):Xs.ceil(e),Je(e.getFullYear()%1e4,t,4)}function nQ(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Je(t/60|0,"0",2)+Je(t%60,"0",2)}function nO(e,t){return Je(e.getUTCDate(),t,2)}function aQ(e,t){return Je(e.getUTCHours(),t,2)}function iQ(e,t){return Je(e.getUTCHours()%12||12,t,2)}function oQ(e,t){return Je(1+sm.count(Ra(e),e),t,3)}function IC(e,t){return Je(e.getUTCMilliseconds(),t,3)}function sQ(e,t){return IC(e,t)+"000"}function lQ(e,t){return Je(e.getUTCMonth()+1,t,2)}function uQ(e,t){return Je(e.getUTCMinutes(),t,2)}function cQ(e,t){return Je(e.getUTCSeconds(),t,2)}function dQ(e){var t=e.getUTCDay();return t===0?7:t}function fQ(e,t){return Je(um.count(Ra(e)-1,e),t,2)}function RC(e){var t=e.getUTCDay();return t>=4||t===0?Ys(e):Ys.ceil(e)}function pQ(e,t){return e=RC(e),Je(Ys.count(Ra(e),e)+(Ra(e).getUTCDay()===4),t,2)}function hQ(e){return e.getUTCDay()}function mQ(e,t){return Je(Tp.count(Ra(e)-1,e),t,2)}function yQ(e,t){return Je(e.getUTCFullYear()%100,t,2)}function vQ(e,t){return e=RC(e),Je(e.getUTCFullYear()%100,t,2)}function gQ(e,t){return Je(e.getUTCFullYear()%1e4,t,4)}function xQ(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ys(e):Ys.ceil(e),Je(e.getUTCFullYear()%1e4,t,4)}function bQ(){return"+0000"}function aO(){return"%"}function iO(e){return+e}function oO(e){return Math.floor(+e/1e3)}var Ho,MC,DC;wQ({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wQ(e){return Ho=wZ(e),MC=Ho.format,Ho.parse,DC=Ho.utcFormat,Ho.utcParse,Ho}function _Q(e){return new Date(e)}function SQ(e){return e instanceof Date?+e:+new Date(+e)}function fw(e,t,r,n,a,i,o,s,l,u){var f=Qb(),d=f.invert,p=f.domain,h=u(".%L"),g=u(":%S"),y=u("%I:%M"),v=u("%I %p"),x=u("%a %d"),m=u("%b %d"),w=u("%B"),S=u("%Y");function b(_){return(l(_)<_?h:s(_)<_?g:o(_)<_?y:i(_)<_?v:n(_)<_?a(_)<_?x:m:r(_)<_?w:S)(_)}return f.invert=function(_){return new Date(d(_))},f.domain=function(_){return arguments.length?p(Array.from(_,SQ)):p().map(_Q)},f.ticks=function(_){var O=p();return e(O[0],O[O.length-1],_??10)},f.tickFormat=function(_,O){return O==null?b:u(O)},f.nice=function(_){var O=p();return(!_||typeof _.range!="function")&&(_=t(O[0],O[O.length-1],_??10)),_?p(SC(O,_)):f},f.copy=function(){return cd(f,fw(e,t,r,n,a,i,o,s,l,u))},f}function jQ(){return Sn.apply(fw(xZ,bZ,Ia,cw,lm,dd,lw,ow,io,MC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function OQ(){return Sn.apply(fw(vZ,gZ,Ra,dw,um,sm,uw,sw,io,DC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function cm(){var e=0,t=1,r,n,a,i,o=kr,s=!1,l;function u(d){return d==null||isNaN(d=+d)?l:o(a===0?.5:(d=(i(d)-r)*a,s?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(s=!!d,u):s},u.interpolator=function(d){return arguments.length?(o=d,u):o};function f(d){return function(p){var h,g;return arguments.length?([h,g]=p,o=d(h,g),u):[o(0),o(1)]}}return u.range=f(Tl),u.rangeRound=f(Zb),u.unknown=function(d){return arguments.length?(l=d,u):l},function(d){return i=d,r=d(e),n=d(t),a=r===n?0:1/(n-r),u}}function Di(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function LC(){var e=Mi(cm()(kr));return e.copy=function(){return Di(e,LC())},Va.apply(e,arguments)}function FC(){var e=tw(cm()).domain([1,10]);return e.copy=function(){return Di(e,FC()).base(e.base())},Va.apply(e,arguments)}function zC(){var e=rw(cm());return e.copy=function(){return Di(e,zC()).constant(e.constant())},Va.apply(e,arguments)}function pw(){var e=nw(cm());return e.copy=function(){return Di(e,pw()).exponent(e.exponent())},Va.apply(e,arguments)}function kQ(){return pw.apply(null,arguments).exponent(.5)}function BC(){var e=[],t=kr;function r(n){if(n!=null&&!isNaN(n=+n))return t((ld(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Si),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>fY(e,i/n))},r.copy=function(){return BC(t).domain(e)},Va.apply(r,arguments)}function dm(){var e=0,t=.5,r=1,n=1,a,i,o,s,l,u=kr,f,d=!1,p;function h(y){return isNaN(y=+y)?p:(y=.5+((y=+f(y))-i)*(n*yt}var HC=NQ,CQ=fm,TQ=HC,$Q=Cl;function IQ(e){return e&&e.length?CQ(e,$Q,TQ):void 0}var RQ=IQ;const ci=rt(RQ);function MQ(e,t){return ee.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};pe.decimalPlaces=pe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};pe.dividedBy=pe.div=function(e){return ka(this,new this.constructor(e))};pe.dividedToIntegerBy=pe.idiv=function(e){var t=this,r=t.constructor;return dt(ka(t,new r(e),0,1),r.precision)};pe.equals=pe.eq=function(e){return!this.cmp(e)};pe.exponent=function(){return zt(this)};pe.greaterThan=pe.gt=function(e){return this.cmp(e)>0};pe.greaterThanOrEqualTo=pe.gte=function(e){return this.cmp(e)>=0};pe.isInteger=pe.isint=function(){return this.e>this.d.length-2};pe.isNegative=pe.isneg=function(){return this.s<0};pe.isPositive=pe.ispos=function(){return this.s>0};pe.isZero=function(){return this.s===0};pe.lessThan=pe.lt=function(e){return this.cmp(e)<0};pe.lessThanOrEqualTo=pe.lte=function(e){return this.cmp(e)<1};pe.logarithm=pe.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(qr))throw Error(bn+"NaN");if(r.s<1)throw Error(bn+(r.s?"NaN":"-Infinity"));return r.eq(qr)?new n(0):(St=!1,t=ka(kc(r,i),kc(e,i),i),St=!0,dt(t,a))};pe.minus=pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?YC(t,e):KC(t,(e.s=-e.s,e))};pe.modulo=pe.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(bn+"NaN");return r.s?(St=!1,t=ka(r,e,0,1).times(e),St=!0,r.minus(t)):dt(new n(r),a)};pe.naturalExponential=pe.exp=function(){return XC(this)};pe.naturalLogarithm=pe.ln=function(){return kc(this)};pe.negated=pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};pe.plus=pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KC(t,e):YC(t,(e.s=-e.s,e))};pe.precision=pe.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(po+e);if(t=zt(a)+1,n=a.d.length-1,r=n*xt+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};pe.squareRoot=pe.sqrt=function(){var e,t,r,n,a,i,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(bn+"NaN")}for(e=zt(s),St=!1,a=Math.sqrt(+s),a==0||a==1/0?(t=Kn(s.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Il((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(a.toString()),r=l.precision,a=o=r+3;;)if(i=n,n=i.plus(ka(s,i,o+2)).times(.5),Kn(i.d).slice(0,o)===(t=Kn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(dt(i,r+1,0),i.times(i).eq(s)){n=i;break}}else if(t!="9999")break;o+=4}return St=!0,dt(n,r)};pe.times=pe.mul=function(e){var t,r,n,a,i,o,s,l,u,f=this,d=f.constructor,p=f.d,h=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,l=p.length,u=h.length,l=0;){for(t=0,a=l+n;a>n;)s=i[a]+h[n]*p[a-n-1]+t,i[a--]=s%Jt|0,t=s/Jt|0;i[a]=(i[a]+t)%Jt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,St?dt(e,d.precision):e};pe.toDecimalPlaces=pe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(na(e,0,$l),t===void 0?t=n.rounding:na(t,0,8),dt(r,e+zt(r)+1,t))};pe.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=Eo(n,!0):(na(e,0,$l),t===void 0?t=a.rounding:na(t,0,8),n=dt(new a(n),e+1,t),r=Eo(n,!0,e+1)),r};pe.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?Eo(a):(na(e,0,$l),t===void 0?t=i.rounding:na(t,0,8),n=dt(new i(a),e+zt(a)+1,t),r=Eo(n.abs(),!1,e+zt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};pe.toInteger=pe.toint=function(){var e=this,t=e.constructor;return dt(new t(e),zt(e)+1,t.rounding)};pe.toNumber=function(){return+this};pe.toPower=pe.pow=function(e){var t,r,n,a,i,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(qr);if(s=new l(s),!s.s){if(e.s<1)throw Error(bn+"Infinity");return s}if(s.eq(qr))return s;if(n=l.precision,e.eq(qr))return dt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=s.s,o){if((r=f<0?-f:f)<=qC){for(a=new l(qr),t=Math.ceil(n/xt+4),St=!1;r%2&&(a=a.times(s),uO(a.d,t)),r=Il(r/2),r!==0;)s=s.times(s),uO(s.d,t);return St=!0,e.s<0?new l(qr).div(a):dt(a,n)}}else if(i<0)throw Error(bn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,St=!1,a=e.times(kc(s,n+u)),St=!0,a=XC(a),a.s=i,a};pe.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=zt(a),n=Eo(a,r<=i.toExpNeg||r>=i.toExpPos)):(na(e,1,$l),t===void 0?t=i.rounding:na(t,0,8),a=dt(new i(a),e,t),r=zt(a),n=Eo(a,e<=r||r<=i.toExpNeg,e)),n};pe.toSignificantDigits=pe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(na(e,1,$l),t===void 0?t=n.rounding:na(t,0,8)),dt(new n(r),e,t)};pe.toString=pe.valueOf=pe.val=pe.toJSON=pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=zt(e),r=e.constructor;return Eo(e,t<=r.toExpNeg||t>=r.toExpPos)};function KC(e,t){var r,n,a,i,o,s,l,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),St?dt(t,d):t;if(l=e.d,u=t.d,o=e.e,a=t.e,l=l.slice(),i=o-a,i){for(i<0?(n=l,i=-i,s=u.length):(n=u,a=o,s=l.length),o=Math.ceil(d/xt),s=o>s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,n=u,u=l,l=n),r=0;i;)r=(l[--i]=l[i]+u[i]+r)/Jt|0,l[i]%=Jt;for(r&&(l.unshift(r),++a),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=a,St?dt(t,d):t}function na(e,t,r){if(e!==~~e||er)throw Error(po+e)}function Kn(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;to?1:-1;else for(s=l=0;sa[s]?1:-1;break}return l}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]1;)n.shift()}return function(n,a,i,o){var s,l,u,f,d,p,h,g,y,v,x,m,w,S,b,_,O,k,A=n.constructor,$=n.s==a.s?1:-1,T=n.d,P=a.d;if(!n.s)return new A(n);if(!a.s)throw Error(bn+"Division by zero");for(l=n.e-a.e,O=P.length,b=T.length,h=new A($),g=h.d=[],u=0;P[u]==(T[u]||0);)++u;if(P[u]>(T[u]||0)&&--l,i==null?m=i=A.precision:o?m=i+(zt(n)-zt(a))+1:m=i,m<0)return new A(0);if(m=m/xt+2|0,u=0,O==1)for(f=0,P=P[0],m++;(u1&&(P=e(P,f),T=e(T,f),O=P.length,b=T.length),S=O,y=T.slice(0,O),v=y.length;v=Jt/2&&++_;do f=0,s=t(P,y,O,v),s<0?(x=y[0],O!=v&&(x=x*Jt+(y[1]||0)),f=x/_|0,f>1?(f>=Jt&&(f=Jt-1),d=e(P,f),p=d.length,v=y.length,s=t(d,y,p,v),s==1&&(f--,r(d,O16)throw Error(mw+zt(e));if(!e.s)return new f(qr);for(St=!1,s=d,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Zi(2,u))/Math.LN10*2+5|0,s+=n,r=a=i=new f(qr),f.precision=s;;){if(a=dt(a.times(e),s),r=r.times(++l),o=i.plus(ka(a,r,s)),Kn(o.d).slice(0,s)===Kn(i.d).slice(0,s)){for(;u--;)i=dt(i.times(i),s);return f.precision=d,t==null?(St=!0,dt(i,d)):i}i=o}}function zt(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function Hy(e,t,r){if(t>e.LN10.sd())throw St=!0,r&&(e.precision=r),Error(bn+"LN10 precision limit exceeded");return dt(new e(e.LN10),t)}function ri(e){for(var t="";e--;)t+="0";return t}function kc(e,t){var r,n,a,i,o,s,l,u,f,d=1,p=10,h=e,g=h.d,y=h.constructor,v=y.precision;if(h.s<1)throw Error(bn+(h.s?"NaN":"-Infinity"));if(h.eq(qr))return new y(0);if(t==null?(St=!1,u=v):u=t,h.eq(10))return t==null&&(St=!0),Hy(y,u);if(u+=p,y.precision=u,r=Kn(g),n=r.charAt(0),i=zt(h),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Kn(h.d),n=r.charAt(0),d++;i=zt(h),n>1?(h=new y("0."+r),i++):h=new y(n+"."+r.slice(1))}else return l=Hy(y,u+2,v).times(i+""),h=kc(new y(n+"."+r.slice(1)),u-p).plus(l),y.precision=v,t==null?(St=!0,dt(h,v)):h;for(s=o=h=ka(h.minus(qr),h.plus(qr),u),f=dt(h.times(h),u),a=3;;){if(o=dt(o.times(f),u),l=s.plus(ka(o,new y(a),u)),Kn(l.d).slice(0,u)===Kn(s.d).slice(0,u))return s=s.times(2),i!==0&&(s=s.plus(Hy(y,u+2,v).times(i+""))),s=ka(s,new y(d),u),y.precision=v,t==null?(St=!0,dt(s,v)):s;s=l,a+=2}}function lO(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Il(r/xt),e.d=[],n=(r+1)%xt,r<0&&(n+=xt),n$p||e.e<-$p))throw Error(mw+r)}else e.s=0,e.e=0,e.d=[0];return e}function dt(e,t,r){var n,a,i,o,s,l,u,f,d=e.d;for(o=1,i=d[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=xt,a=t,u=d[f=0];else{if(f=Math.ceil((n+1)/xt),i=d.length,f>=i)return e;for(u=i=d[f],o=1;i>=10;i/=10)o++;n%=xt,a=n-xt+o}if(r!==void 0&&(i=Zi(10,o-a-1),s=u/i%10|0,l=t<0||d[f+1]!==void 0||u%i,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?a>0?u/Zi(10,o-a):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(i=zt(e),d.length=1,t=t-i-1,d[0]=Zi(10,(xt-t%xt)%xt),e.e=Il(-t/xt)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,i=1,f--):(d.length=f+1,i=Zi(10,xt-n),d[f]=a>0?(u/Zi(10,o-a)%Zi(10,a)|0)*i:0),l)for(;;)if(f==0){(d[0]+=i)==Jt&&(d[0]=1,++e.e);break}else{if(d[f]+=i,d[f]!=Jt)break;d[f--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(St&&(e.e>$p||e.e<-$p))throw Error(mw+zt(e));return e}function YC(e,t){var r,n,a,i,o,s,l,u,f,d,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),St?dt(t,h):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=d.length):(r=d,n=u,s=l.length),a=Math.max(Math.ceil(h/xt),s)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=l.length,s=d.length,f=a0;--a)l[s++]=0;for(a=d.length;a>o;){if(l[--a]0?i=i.charAt(0)+"."+i.slice(1)+ri(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+ri(-a-1)+i,r&&(n=r-o)>0&&(i+=ri(n))):a>=o?(i+=ri(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+ri(n))):((n=a+1)0&&(a+1===o&&(i+="."),i+=ri(n))),e.s<0?"-"+i:i}function uO(e,t){if(e.length>t)return e.length=t,!0}function ZC(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(po+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return lO(o,i.toString())}else if(typeof i!="string")throw Error(po+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,nJ.test(i))lO(o,i);else throw Error(po+i)}if(a.prototype=pe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=ZC,a.config=a.set=aJ,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(po+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(po+r+": "+n);return this}var yw=ZC(rJ);qr=new yw(1);const lt=yw;function iJ(e){return uJ(e)||lJ(e)||sJ(e)||oJ()}function oJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sJ(e,t){if(e){if(typeof e=="string")return d0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d0(e,t)}}function lJ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function uJ(e){if(Array.isArray(e))return d0(e)}function d0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-o,cO(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){a=!0,i=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function jJ(e){if(Array.isArray(e))return e}function rT(e){var t=Ac(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function nT(e,t,r){if(e.lte(0))return new lt(0);var n=mm.getDigitCount(e.toNumber()),a=new lt(10).pow(n),i=e.div(a),o=n!==1?.05:.1,s=new lt(Math.ceil(i.div(o).toNumber())).add(r).mul(o),l=s.mul(a);return t?l:new lt(Math.ceil(l))}function OJ(e,t,r){var n=1,a=new lt(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new lt(10).pow(mm.getDigitCount(e)-1),a=new lt(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new lt(Math.floor(e)))}else e===0?a=new lt(Math.floor((t-1)/2)):r||(a=new lt(Math.floor(e)));var o=Math.floor((t-1)/2),s=pJ(fJ(function(l){return a.add(new lt(l-o).mul(n)).toNumber()}),f0);return s(0,t)}function aT(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new lt(0),tickMin:new lt(0),tickMax:new lt(0)};var i=nT(new lt(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new lt(0):(o=new lt(e).add(t).div(2),o=o.sub(new lt(o).mod(i)));var s=Math.ceil(o.sub(e).div(i).toNumber()),l=Math.ceil(new lt(t).sub(o).div(i).toNumber()),u=s+l+1;return u>r?aT(e,t,r,n,a+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:i,tickMin:o.sub(new lt(s).mul(i)),tickMax:o.add(new lt(l).mul(i))})}function kJ(e){var t=Ac(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),s=rT([r,n]),l=Ac(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(h0(f0(0,a-1).map(function(){return 1/0}))):[].concat(h0(f0(0,a-1).map(function(){return-1/0})),[f]);return r>n?p0(d):d}if(u===f)return OJ(u,a,i);var p=aT(u,f,o,i),h=p.step,g=p.tickMin,y=p.tickMax,v=mm.rangeStep(g,y.add(new lt(.1).mul(h)),h);return r>n?p0(v):v}function AJ(e,t){var r=Ac(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=rT([n,a]),s=Ac(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,a];if(l===u)return[l];var f=Math.max(t,2),d=nT(new lt(u).sub(l).div(f-1),i,0),p=[].concat(h0(mm.rangeStep(new lt(l),new lt(u).sub(new lt(.99).mul(d)),d)),[u]);return n>a?p0(p):p}var EJ=eT(kJ),PJ=eT(AJ),NJ="Invariant failed";function Po(e,t){throw new Error(NJ)}var CJ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Zs(e){"@babel/helpers - typeof";return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs(e)}function Ip(){return Ip=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function FJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zJ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var l=i.range,u=0;u0?a[u-1].coordinate:a[s-1].coordinate,d=a[u].coordinate,p=u>=s-1?a[0].coordinate:a[u+1].coordinate,h=void 0;if(jr(d-f)!==jr(p-d)){var g=[];if(jr(p-d)===jr(l[1]-l[0])){h=p;var y=d+l[1]-l[0];g[0]=Math.min(y,(y+f)/2),g[1]=Math.max(y,(y+f)/2)}else{h=f;var v=p+l[1]-l[0];g[0]=Math.min(d,(v+d)/2),g[1]=Math.max(d,(v+d)/2)}var x=[Math.min(d,(h+d)/2),Math.max(d,(h+d)/2)];if(t>x[0]&&t<=x[1]||t>=g[0]&&t<=g[1]){o=a[u].index;break}}else{var m=Math.min(f,p),w=Math.max(f,p);if(t>(m+d)/2&&t<=(w+d)/2){o=a[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},vw=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,o=i.stroke,s=i.fill,l;switch(a){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},nee=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},s=Object.keys(i),l=0,u=s.length;l=0});if(x&&x.length){var m=x[0].type.defaultProps,w=m!==void 0?Ct(Ct({},m),x[0].props):x[0].props,S=w.barSize,b=w[v];o[b]||(o[b]=[]);var _=Ne(S)?r:S;o[b].push({item:x[0],stackList:x.slice(1),barSize:Ne(_)?void 0:Or(_,n,0)})}}return o},aee=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=Or(r,a,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=a/l,g=o.reduce(function(S,b){return S+b.barSize||0},0);g+=(l-1)*u,g>=a&&(g-=(l-1)*u,u=0),g>=a&&h>0&&(p=!0,h*=.9,g=l*h);var y=(a-g)/2>>0,v={offset:y-u,size:0};f=o.reduce(function(S,b){var _={item:b.item,position:{offset:v.offset+v.size+u,size:p?h:b.barSize}},O=[].concat(pO(S),[_]);return v=O[O.length-1].position,b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:v})}),O},d)}else{var x=Or(n,a,0,!0);a-2*x-(l-1)*u<=0&&(u=0);var m=(a-2*x-(l-1)*u)/l;m>1&&(m>>=0);var w=s===+s?Math.min(m,s):m;f=o.reduce(function(S,b,_){var O=[].concat(pO(S),[{item:b.item,position:{offset:x+(m+u)*_+(m-w)/2,size:w}}]);return b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:O[O.length-1].position})}),O},d)}return f},iee=function(t,r,n,a){var i=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=lT({children:i,legendWidth:l});if(u){var f=a||{},d=f.width,p=f.height,h=u.align,g=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&g==="middle")&&h!=="center"&&re(t[h]))return Ct(Ct({},t),{},Es({},h,t[h]+(d||0)));if((y==="horizontal"||y==="vertical"&&h==="center")&&g!=="middle"&&re(t[g]))return Ct(Ct({},t),{},Es({},g,t[g]+(p||0)))}return t},oee=function(t,r,n){return Ne(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},uT=function(t,r,n,a,i){var o=r.props.children,s=Zr(o,fd).filter(function(u){return oee(a,i,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Rt(f,n);if(Ne(d))return u;var p=Array.isArray(d)?[pm(d),ci(d)]:[d,d],h=l.reduce(function(g,y){var v=Rt(f,y,0),x=p[0]-Math.abs(Array.isArray(v)?v[0]:v),m=p[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,g[0]),Math.max(m,g[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},see=function(t,r,n,a,i){var o=r.map(function(s){return uT(t,s,n,i,a)}).filter(function(s){return!Ne(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},cT=function(t,r,n,a,i){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&uT(t,l,u,a)||Du(t,u,n,i)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,d=u.length;f=2?jr(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var p=i?i.indexOf(d):d;return{coordinate:a(p)+u,value:d,offset:u}});return f.filter(function(d){return!El(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,p){return{coordinate:a(d)+u,value:d,index:p,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(d){return{coordinate:a(d)+u,value:d,offset:u}}):a.domain().map(function(d,p){return{coordinate:a(d)+u,value:i?i[d]:d,index:p,offset:u}})},Gy=new WeakMap,Gd=function(t,r){if(typeof r!="function")return t;Gy.has(t)||Gy.set(t,new WeakMap);var n=Gy.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},pT=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,s=t.axisType;if(a==="auto")return o==="radial"&&s==="radiusAxis"?{scale:wc(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Pp(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Mu(),realScaleType:"point"}:i==="category"?{scale:wc(),realScaleType:"band"}:{scale:Pp(),realScaleType:"linear"};if(jo(a)){var l="scale".concat(Jh(a));return{scale:(sO[l]||Mu)(),realScaleType:sO[l]?l:"point"}}return je(a)?{scale:a}:{scale:Mu(),realScaleType:"point"}},mO=1e-4,hT=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-mO,o=Math.max(a[0],a[1])+mO,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},lee=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},dee=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[o][n][0]=i,t[o][n][1]=i+s,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},fee={sign:cee,expand:CU,none:Vs,silhouette:TU,wiggle:$U,positive:dee},pee=function(t,r,n){var a=r.map(function(s){return s.props.dataKey}),i=fee[n],o=NU().keys(a).value(function(s,l){return+Rt(s,l,0)}).order(Ug).offset(i);return o(t)},hee=function(t,r,n,a,i,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(d,p){var h,g=(h=p.type)!==null&&h!==void 0&&h.defaultProps?Ct(Ct({},p.type.defaultProps),p.props):p.props,y=g.stackId,v=g.hide;if(v)return d;var x=g[n],m=d[x]||{hasStack:!1,stackGroups:{}};if(qt(y)){var w=m.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};w.items.push(p),m.hasStack=!0,m.stackGroups[y]=w}else m.stackGroups[Ro("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[p]};return Ct(Ct({},d),{},Es({},x,m))},l),f={};return Object.keys(u).reduce(function(d,p){var h=u[p];if(h.hasStack){var g={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(y,v){var x=h.stackGroups[v];return Ct(Ct({},y),{},Es({},v,{numericAxisId:n,cateAxisId:a,items:x.items,stackedData:pee(t,x.items,i)}))},g)}return Ct(Ct({},d),{},Es({},p,h))},f)},mT=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=EJ(u,i,s);return t.domain([pm(f),ci(f)]),{niceTicks:f}}if(i&&a==="number"){var d=t.domain(),p=PJ(d,i,s);return{niceTicks:p}}return null};function Mp(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ne(a[t.dataKey])){var s=sp(r,"value",a[t.dataKey]);if(s)return s.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var l=Rt(a,Ne(o)?t.dataKey:o);return Ne(l)?null:t.scale(l)}var yO=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+a:null;var l=Rt(o,r.dataKey,r.domain[s]);return Ne(l)?null:r.scale(l)-i/2+a},mee=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},yee=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(qt(i)){var o=r[i];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},vee=function(t){return t.reduce(function(r,n){return[pm(n.concat([r[0]]).filter(re)),ci(n.concat([r[1]]).filter(re))]},[1/0,-1/0])},yT=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],s=o.stackedData,l=s.reduce(function(u,f){var d=vee(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],a[0]),Math.max(l[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},vO=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gO=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,g0=function(t,r,n){if(je(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(re(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(vO.test(t[0])){var i=+vO.exec(t[0])[1];a[0]=r[0]-i}else je(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(re(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(gO.test(t[1])){var o=+gO.exec(t[1])[1];a[1]=r[1]+o}else je(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Dp=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=Hb(r,function(d){return d.coordinate}),o=1/0,s=1,l=i.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},kee=function(t,r,n,a,i){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=Or(t.cx,o,o/2),d=Or(t.cy,s,s/2),p=xT(o,s,n),h=Or(t.innerRadius,p,0),g=Or(t.outerRadius,p,p*.8),y=Object.keys(r);return y.reduce(function(v,x){var m=r[x],w=m.domain,S=m.reversed,b;if(Ne(m.range))a==="angleAxis"?b=[l,u]:a==="radiusAxis"&&(b=[h,g]),S&&(b=[b[1],b[0]]);else{b=m.range;var _=b,O=bee(_,2);l=O[0],u=O[1]}var k=pT(m,i),A=k.realScaleType,$=k.scale;$.domain(w).range(b),hT($);var T=mT($,pa(pa({},m),{},{realScaleType:A})),P=pa(pa(pa({},m),T),{},{range:b,radius:g,realScaleType:A,scale:$,cx:f,cy:d,innerRadius:h,outerRadius:g,startAngle:l,endAngle:u});return pa(pa({},v),{},gT({},x,P))},{})},Aee=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},Eee=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,s=Aee({x:n,y:a},{x:i,y:o});if(s<=0)return{radius:s};var l=(n-i)/s,u=Math.acos(l);return a>o&&(u=2*Math.PI-u),{radius:s,angle:Oee(u),angleInRadian:u}},Pee=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},Nee=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),s=Math.min(i,o);return t+s*360},_O=function(t,r){var n=t.x,a=t.y,i=Eee({x:n,y:a},r),o=i.radius,s=i.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=Pee(r),d=f.startAngle,p=f.endAngle,h=s,g;if(d<=p){for(;h>p;)h-=360;for(;h=d&&h<=p}else{for(;h>d;)h-=360;for(;h=p&&h<=d}return g?pa(pa({},r),{},{radius:o,angle:Nee(h,r)}):null},bT=function(t){return!j.isValidElement(t)&&!je(t)&&typeof t!="boolean"?t.className:""};function Cc(e){"@babel/helpers - typeof";return Cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cc(e)}var Cee=["offset"];function Tee(e){return Mee(e)||Ree(e)||Iee(e)||$ee()}function $ee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iee(e,t){if(e){if(typeof e=="string")return x0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x0(e,t)}}function Ree(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mee(e){if(Array.isArray(e))return x0(e)}function x0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function SO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ut(e){for(var t=1;t=0?1:-1,w,S;a==="insideStart"?(w=h+m*o,S=y):a==="insideEnd"?(w=g-m*o,S=!y):a==="end"&&(w=g+m*o,S=y),S=x<=0?S:!S;var b=mt(u,f,v,w),_=mt(u,f,v,w+(S?1:-1)*359),O="M".concat(b.x,",").concat(b.y,` - A`).concat(v,",").concat(v,",0,1,").concat(S?0:1,`, - `).concat(_.x,",").concat(_.y),k=Ne(t.id)?Ro("recharts-radial-line-"):t.id;return C.createElement("text",Tc({},n,{dominantBaseline:"central",className:De("recharts-radial-bar-label",s)}),C.createElement("defs",null,C.createElement("path",{id:k,d:O})),C.createElement("textPath",{xlinkHref:"#".concat(k)},r))},Hee=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,s=i.cy,l=i.innerRadius,u=i.outerRadius,f=i.startAngle,d=i.endAngle,p=(f+d)/2;if(a==="outside"){var h=mt(o,s,u+n,p),g=h.x,y=h.y;return{x:g,y,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var v=(l+u)/2,x=mt(o,s,v,p),m=x.x,w=x.y;return{x:m,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Gee=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,d=f>=0?1:-1,p=d*a,h=d>0?"end":"start",g=d>0?"start":"end",y=u>=0?1:-1,v=y*a,x=y>0?"end":"start",m=y>0?"start":"end";if(i==="top"){var w={x:s+u/2,y:l-d*a,textAnchor:"middle",verticalAnchor:h};return Ut(Ut({},w),n?{height:Math.max(l-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:s+u/2,y:l+f+p,textAnchor:"middle",verticalAnchor:g};return Ut(Ut({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(i==="left"){var b={x:s-v,y:l+f/2,textAnchor:x,verticalAnchor:"middle"};return Ut(Ut({},b),n?{width:Math.max(b.x-n.x,0),height:f}:{})}if(i==="right"){var _={x:s+u+v,y:l+f/2,textAnchor:m,verticalAnchor:"middle"};return Ut(Ut({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return i==="insideLeft"?Ut({x:s+v,y:l+f/2,textAnchor:m,verticalAnchor:"middle"},O):i==="insideRight"?Ut({x:s+u-v,y:l+f/2,textAnchor:x,verticalAnchor:"middle"},O):i==="insideTop"?Ut({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:g},O):i==="insideBottom"?Ut({x:s+u/2,y:l+f-p,textAnchor:"middle",verticalAnchor:h},O):i==="insideTopLeft"?Ut({x:s+v,y:l+p,textAnchor:m,verticalAnchor:g},O):i==="insideTopRight"?Ut({x:s+u-v,y:l+p,textAnchor:x,verticalAnchor:g},O):i==="insideBottomLeft"?Ut({x:s+v,y:l+f-p,textAnchor:m,verticalAnchor:h},O):i==="insideBottomRight"?Ut({x:s+u-v,y:l+f-p,textAnchor:x,verticalAnchor:h},O):jl(i)&&(re(i.x)||no(i.x))&&(re(i.y)||no(i.y))?Ut({x:s+Or(i.x,u),y:l+Or(i.y,f),textAnchor:"end",verticalAnchor:"end"},O):Ut({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},qee=function(t){return"cx"in t&&re(t.cx)};function rr(e){var t=e.offset,r=t===void 0?5:t,n=Dee(e,Cee),a=Ut({offset:r},n),i=a.viewBox,o=a.position,s=a.value,l=a.children,u=a.content,f=a.className,d=f===void 0?"":f,p=a.textBreakAll;if(!i||Ne(s)&&Ne(l)&&!j.isValidElement(u)&&!je(u))return null;if(j.isValidElement(u))return j.cloneElement(u,a);var h;if(je(u)){if(h=j.createElement(u,a),j.isValidElement(h))return h}else h=Uee(a);var g=qee(i),y=we(a,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Wee(a,h,y);var v=g?Hee(a):Gee(a);return C.createElement(ko,Tc({className:De("recharts-label",d)},y,v,{breakAll:p}),h)}rr.displayName="Label";var wT=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,p=t.y,h=t.top,g=t.left,y=t.width,v=t.height,x=t.clockWise,m=t.labelViewBox;if(m)return m;if(re(y)&&re(v)){if(re(d)&&re(p))return{x:d,y:p,width:y,height:v};if(re(h)&&re(g))return{x:h,y:g,width:y,height:v}}return re(d)&&re(p)?{x:d,y:p,width:0,height:0}:re(r)&&re(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:x}:t.viewBox?t.viewBox:{}},Kee=function(t,r){return t?t===!0?C.createElement(rr,{key:"label-implicit",viewBox:r}):qt(t)?C.createElement(rr,{key:"label-implicit",viewBox:r,value:t}):j.isValidElement(t)?t.type===rr?j.cloneElement(t,{key:"label-implicit",viewBox:r}):C.createElement(rr,{key:"label-implicit",content:t,viewBox:r}):je(t)?C.createElement(rr,{key:"label-implicit",content:t,viewBox:r}):jl(t)?C.createElement(rr,Tc({viewBox:r},t,{key:"label-implicit"})):null:null},Xee=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=wT(t),o=Zr(a,rr).map(function(l,u){return j.cloneElement(l,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var s=Kee(t.label,r||i);return[s].concat(Tee(o))};rr.parseViewBox=wT;rr.renderCallByParent=Xee;function Yee(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Zee=Yee;const Qee=rt(Zee);function $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}var Jee=["valueAccessor"],ete=["data","dataKey","clockWise","id","textBreakAll"];function tte(e){return ite(e)||ate(e)||nte(e)||rte()}function rte(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nte(e,t){if(e){if(typeof e=="string")return b0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b0(e,t)}}function ate(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ite(e){if(Array.isArray(e))return b0(e)}function b0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ute(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var cte=function(t){return Array.isArray(t.value)?Qee(t.value):t.value};function ea(e){var t=e.valueAccessor,r=t===void 0?cte:t,n=kO(e,Jee),a=n.data,i=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=kO(n,ete);return!a||!a.length?null:C.createElement(We,{className:"recharts-label-list"},a.map(function(f,d){var p=Ne(i)?r(f,d):Rt(f&&f.payload,i),h=Ne(s)?{}:{id:"".concat(s,"-").concat(d)};return C.createElement(rr,Fp({},we(f,!0),u,h,{parentViewBox:f.parentViewBox,value:p,textBreakAll:l,viewBox:rr.parseViewBox(Ne(o)?f:OO(OO({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}ea.displayName="LabelList";function dte(e,t){return e?e===!0?C.createElement(ea,{key:"labelList-implicit",data:t}):C.isValidElement(e)||je(e)?C.createElement(ea,{key:"labelList-implicit",data:t,content:e}):jl(e)?C.createElement(ea,Fp({data:t},e,{key:"labelList-implicit"})):null:null}function fte(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=Zr(n,ea).map(function(o,s){return j.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return a;var i=dte(e.label,t);return[i].concat(tte(a))}ea.renderCallByParent=fte;function Ic(e){"@babel/helpers - typeof";return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(e)}function w0(){return w0=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, - `).concat(d.x,",").concat(d.y,` - `);if(a>0){var h=mt(r,n,a,o),g=mt(r,n,a,u);p+="L ".concat(g.x,",").concat(g.y,` - A `).concat(a,",").concat(a,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},vte=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=jr(f-u),p=qd({cx:r,cy:n,radius:i,angle:u,sign:d,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,g=p.lineTangency,y=p.theta,v=qd({cx:r,cy:n,radius:i,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:l}),x=v.circleTangency,m=v.lineTangency,w=v.theta,S=l?Math.abs(u-f):Math.abs(u-f)-y-w;if(S<0)return s?"M ".concat(g.x,",").concat(g.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):_T({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:f});var b="M ".concat(g.x,",").concat(g.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(h.x,",").concat(h.y,` - A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(x.x,",").concat(x.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,` - `);if(a>0){var _=qd({cx:r,cy:n,radius:a,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=_.circleTangency,k=_.lineTangency,A=_.theta,$=qd({cx:r,cy:n,radius:a,angle:f,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),T=$.circleTangency,P=$.lineTangency,R=$.theta,L=l?Math.abs(u-f):Math.abs(u-f)-A-R;if(L<0&&o===0)return"".concat(b,"L").concat(r,",").concat(n,"Z");b+="L".concat(P.x,",").concat(P.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(T.x,",").concat(T.y,` - A`).concat(a,",").concat(a,",0,").concat(+(L>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(k.x,",").concat(k.y,"Z")}else b+="L".concat(r,",").concat(n,"Z");return b},gte={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ST=function(t){var r=EO(EO({},gte),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,p=r.className;if(o0&&Math.abs(f-d)<360?v=vte({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,g/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:d}):v=_T({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:f,endAngle:d}),C.createElement("path",w0({},we(r,!0),{className:h,d:v,role:"img"}))};function Rc(e){"@babel/helpers - typeof";return Rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rc(e)}function _0(){return _0=Object.assign?Object.assign.bind():function(e){for(var t=1;tCte.call(e,t));function Lo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Ite="__v",Rte="__o",Mte="_owner",{getOwnPropertyDescriptor:$O,keys:IO}=Object;function Dte(e,t){return e.byteLength===t.byteLength&&zp(new Uint8Array(e),new Uint8Array(t))}function Lte(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Fte(e,t){return e.byteLength===t.byteLength&&zp(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function zte(e,t){return Lo(e.getTime(),t.getTime())}function Bte(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ute(e,t){return e===t}function RO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let o,s,l=0;for(;(o=i.next())&&!o.done;){const u=t.entries();let f=!1,d=0;for(;(s=u.next())&&!s.done;){if(a[d]){d++;continue}const p=o.value,h=s.value;if(r.equals(p[0],h[0],l,d,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){f=a[d]=!0;break}d++}if(!f)return!1;l++}return!0}const Vte=Lo;function Wte(e,t,r){const n=IO(e);let a=n.length;if(IO(t).length!==a)return!1;for(;a-- >0;)if(!AT(e,t,r,n[a]))return!1;return!0}function eu(e,t,r){const n=TO(e);let a=n.length;if(TO(t).length!==a)return!1;let i,o,s;for(;a-- >0;)if(i=n[a],!AT(e,t,r,i)||(o=$O(e,i),s=$O(t,i),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Hte(e,t){return Lo(e.valueOf(),t.valueOf())}function Gte(e,t){return e.source===t.source&&e.flags===t.flags}function MO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let o,s;for(;(o=i.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!a[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=a[f]=!0;break}f++}if(!u)return!1}return!0}function zp(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function qte(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function AT(e,t,r,n){return(n===Mte||n===Rte||n===Ite)&&(e.$$typeof||t.$$typeof)?!0:$te(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const Kte="[object ArrayBuffer]",Xte="[object Arguments]",Yte="[object Boolean]",Zte="[object DataView]",Qte="[object Date]",Jte="[object Error]",ere="[object Map]",tre="[object Number]",rre="[object Object]",nre="[object RegExp]",are="[object Set]",ire="[object String]",ore={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},sre="[object URL]",lre=Object.prototype.toString;function ure({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:g}){return function(v,x,m){if(v===x)return!0;if(v==null||x==null)return!1;const w=typeof v;if(w!==typeof x)return!1;if(w!=="object")return w==="number"?s(v,x,m):w==="function"?i(v,x,m):!1;const S=v.constructor;if(S!==x.constructor)return!1;if(S===Object)return l(v,x,m);if(Array.isArray(v))return t(v,x,m);if(S===Date)return n(v,x,m);if(S===RegExp)return f(v,x,m);if(S===Map)return o(v,x,m);if(S===Set)return d(v,x,m);const b=lre.call(v);if(b===Qte)return n(v,x,m);if(b===nre)return f(v,x,m);if(b===ere)return o(v,x,m);if(b===are)return d(v,x,m);if(b===rre)return typeof v.then!="function"&&typeof x.then!="function"&&l(v,x,m);if(b===sre)return h(v,x,m);if(b===Jte)return a(v,x,m);if(b===Xte)return l(v,x,m);if(ore[b])return p(v,x,m);if(b===Kte)return e(v,x,m);if(b===Zte)return r(v,x,m);if(b===Yte||b===tre||b===ire)return u(v,x,m);if(g){let _=g[b];if(!_){const O=Tte(v);O&&(_=g[O])}if(_)return _(v,x,m)}return!1}}function cre({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:Dte,areArraysEqual:r?eu:Lte,areDataViewsEqual:Fte,areDatesEqual:zte,areErrorsEqual:Bte,areFunctionsEqual:Ute,areMapsEqual:r?qy(RO,eu):RO,areNumbersEqual:Vte,areObjectsEqual:r?eu:Wte,arePrimitiveWrappersEqual:Hte,areRegExpsEqual:Gte,areSetsEqual:r?qy(MO,eu):MO,areTypedArraysEqual:r?qy(zp,eu):zp,areUrlsEqual:qte,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=Xd(n.areArraysEqual),i=Xd(n.areMapsEqual),o=Xd(n.areObjectsEqual),s=Xd(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:s})}return n}function dre(e){return function(t,r,n,a,i,o,s){return e(t,r,s)}}function fre({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:a})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(s,l){return t(s,l,i)}}const pre=Li();Li({strict:!0});Li({circular:!0});Li({circular:!0,strict:!0});Li({createInternalComparator:()=>Lo});Li({strict:!0,createInternalComparator:()=>Lo});Li({circular:!0,createInternalComparator:()=>Lo});Li({circular:!0,createInternalComparator:()=>Lo,strict:!0});function Li(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=cre(e),o=ure(i),s=r?r(o):dre(o);return fre({circular:t,comparator:o,createState:n,equals:s,strict:a})}function hre(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function DO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):hre(a)};requestAnimationFrame(n)}function S0(e){"@babel/helpers - typeof";return S0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S0(e)}function mre(e){return xre(e)||gre(e)||vre(e)||yre()}function yre(){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 vre(e,t){if(e){if(typeof e=="string")return LO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LO(e,t)}}function LO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:x<0?0:x},y=function(x){for(var m=x>1?1:x,w=m,S=0;S<8;++S){var b=d(w)-m,_=h(w);if(Math.abs(b-m)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,s=o===void 0?17:o,l=function(f,d,p){var h=-(f-d)*n,g=p*i,y=p+(h-g)*s/1e3,v=p*s/1e3+f;return Math.abs(v-d)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yre(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function Ky(e){return ene(e)||Jre(e)||Qre(e)||Zre()}function Zre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qre(e,t){if(e){if(typeof e=="string")return E0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E0(e,t)}}function Jre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ene(e){if(Array.isArray(e))return E0(e)}function E0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vp(e){return Vp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vp(e)}var Bn=function(e){ine(r,e);var t=one(r);function r(n,a){var i;tne(this,r),i=t.call(this,n,a);var o=i.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,d=o.steps,p=o.children,h=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(C0(i)),i.changeStyle=i.changeStyle.bind(C0(i)),!s||h<=0)return i.state={style:{}},typeof p=="function"&&(i.state={style:f}),N0(i);if(d&&d.length)i.state={style:d[0].style};else if(u){if(typeof p=="function")return i.state={style:u},N0(i);i.state={style:l?mu({},l,u):u}}else i.state={style:{}};return i}return nne(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,s=i.canBegin,l=i.attributeName,u=i.shouldReAnimate,f=i.to,d=i.from,p=this.state.style;if(s){if(!o){var h={style:l?mu({},l,f):f};this.state&&p&&(l&&p[l]!==f||!l&&p!==f)&&this.setState(h);return}if(!(pre(a.to,f)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=g||u?d:a.to;if(this.state&&p){var v={style:l?mu({},l,y):y};(l&&p[l]!==y||!l&&p!==y)&&this.setState(v)}this.runAnimation(An(An({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,s=a.to,l=a.duration,u=a.easing,f=a.begin,d=a.onAnimationEnd,p=a.onAnimationStart,h=qre(o,s,Mre(u),l,this.changeStyle),g=function(){i.stopJSAnimation=h()};this.manager.start([p,f,g,l,d])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,s=a.begin,l=a.onAnimationStart,u=o[0],f=u.style,d=u.duration,p=d===void 0?0:d,h=function(y,v,x){if(x===0)return y;var m=v.duration,w=v.easing,S=w===void 0?"ease":w,b=v.style,_=v.properties,O=v.onAnimationEnd,k=x>0?o[x-1]:v,A=_||Object.keys(b);if(typeof S=="function"||S==="spring")return[].concat(Ky(y),[i.runJSAnimation.bind(i,{from:k.style,to:b,duration:m,easing:S}),m]);var $=BO(A,m,S),T=An(An(An({},k.style),b),{},{transition:$});return[].concat(Ky(y),[T,m,O]).filter(jre)};return this.manager.start([l].concat(Ky(o.reduce(h,[f,Math.max(p,s)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=bre());var i=a.begin,o=a.duration,s=a.attributeName,l=a.to,u=a.easing,f=a.onAnimationStart,d=a.onAnimationEnd,p=a.steps,h=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(a);return}if(p.length>1){this.runStepAnimation(a);return}var y=s?mu({},s,l):l,v=BO(Object.keys(y),o,u);g.start([f,i,An(An({},y),{},{transition:v}),o,d])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var s=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var l=Xre(a,Kre),u=j.Children.count(i),f=this.state.style;if(typeof i=="function")return i(f);if(!s||u===0||o<=0)return i;var d=function(h){var g=h.props,y=g.style,v=y===void 0?{}:y,x=g.className,m=j.cloneElement(h,An(An({},l),{},{style:An(An({},v),f),className:x}));return m};return u===1?d(j.Children.only(i)):C.createElement("div",null,j.Children.map(i,function(p){return d(p)}))}}]),r}(j.PureComponent);Bn.displayName="Animate";Bn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Bn.propTypes={from:et.oneOfType([et.object,et.string]),to:et.oneOfType([et.object,et.string]),attributeName:et.string,duration:et.number,begin:et.number,easing:et.oneOfType([et.string,et.func]),steps:et.arrayOf(et.shape({duration:et.number.isRequired,style:et.object.isRequired,easing:et.oneOfType([et.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),et.func]),properties:et.arrayOf("string"),onAnimationEnd:et.func})),children:et.oneOfType([et.node,et.func]),isActive:et.bool,canBegin:et.bool,onAnimationEnd:et.func,shouldReAnimate:et.bool,onAnimationStart:et.func,onAnimationReStart:et.func};function Lc(e){"@babel/helpers - typeof";return Lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lc(e)}function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,f;if(o>0&&i instanceof Array){for(var d=[0,0,0,0],p=0,h=4;po?o:i[p];f="M".concat(t,",").concat(r+s*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+l*d[0],",").concat(r)),f+="L ".concat(t+n-l*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, - `).concat(t+n,",").concat(r+s*d[1])),f+="L ".concat(t+n,",").concat(r+a-s*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`, - `).concat(t+n-l*d[2],",").concat(r+a)),f+="L ".concat(t+l*d[3],",").concat(r+a),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`, - `).concat(t,",").concat(r+a-s*d[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var g=Math.min(o,i);f="M ".concat(t,",").concat(r+s*g,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+l*g,",").concat(r,` - L `).concat(t+n-l*g,",").concat(r,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*g,` - L `).concat(t+n,",").concat(r+a-s*g,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n-l*g,",").concat(r+a,` - L `).concat(t+l*g,",").concat(r+a,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(r+a-s*g," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return f},yne=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(i,i+s),f=Math.max(i,i+s),d=Math.min(o,o+l),p=Math.max(o,o+l);return n>=u&&n<=f&&a>=d&&a<=p}return!1},vne={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},gw=function(t){var r=XO(XO({},vne),t),n=j.useRef(),a=j.useState(-1),i=lne(a,2),o=i[0],s=i[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,d=r.height,p=r.radius,h=r.className,g=r.animationEasing,y=r.animationDuration,v=r.animationBegin,x=r.isAnimationActive,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var w=De("recharts-rectangle",h);return m?C.createElement(Bn,{canBegin:o>0,from:{width:f,height:d,x:l,y:u},to:{width:f,height:d,x:l,y:u},duration:y,animationEasing:g,isActive:m},function(S){var b=S.width,_=S.height,O=S.x,k=S.y;return C.createElement(Bn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,isActive:x,easing:g},C.createElement("path",Wp({},we(r,!0),{className:w,d:YO(O,k,b,_,p),ref:n})))}):C.createElement("path",Wp({},we(r,!0),{className:w,d:YO(l,u,f,d,p)}))},gne=["points","className","baseLinePoints","connectNulls"];function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ZO(e){return jne(e)||Sne(e)||_ne(e)||wne()}function wne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ne(e,t){if(e){if(typeof e=="string")return T0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T0(e,t)}}function Sne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jne(e){if(Array.isArray(e))return T0(e)}function T0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){QO(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),QO(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Fu=function(t,r){var n=One(t);r&&(n=[n.reduce(function(i,o){return[].concat(ZO(i),ZO(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},kne=function(t,r,n){var a=Fu(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Fu(r.reverse(),n).slice(1))},Ane=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=xne(t,gne);if(!r||!r.length)return null;var s=De("recharts-polygon",n);if(a&&a.length){var l=o.stroke&&o.stroke!=="none",u=kne(r,a,i);return C.createElement("g",{className:s},C.createElement("path",fs({},we(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?C.createElement("path",fs({},we(o,!0),{fill:"none",d:Fu(r,i)})):null,l?C.createElement("path",fs({},we(o,!0),{fill:"none",d:Fu(a,i)})):null)}var f=Fu(r,i);return C.createElement("path",fs({},we(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function $0(){return $0=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ine(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Rne=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},Mne=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,d=f===void 0?0:f,p=t.height,h=p===void 0?0:p,g=t.className,y=$ne(t,Ene),v=Pne({x:n,y:i,top:s,left:u,width:d,height:h},y);return!re(n)||!re(i)||!re(d)||!re(h)||!re(s)||!re(u)?null:C.createElement("path",I0({},we(v,!0),{className:De("recharts-cross",g),d:Rne(n,i,d,h,s,u)}))},Dne=fm,Lne=HC,Fne=oa;function zne(e,t){return e&&e.length?Dne(e,Fne(t),Lne):void 0}var Bne=zne;const Une=rt(Bne);var Vne=fm,Wne=oa,Hne=GC;function Gne(e,t){return e&&e.length?Vne(e,Wne(t),Hne):void 0}var qne=Gne;const Kne=rt(qne);var Xne=["cx","cy","angle","ticks","axisLine"],Yne=["ticks","tick","angle","tickFormatter","stroke"];function Js(e){"@babel/helpers - typeof";return Js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Js(e)}function zu(){return zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rk(e,t){for(var r=0;rik?o=a==="outer"?"start":"end":i<-ik?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=Gi(Gi({},we(this.props,!1)),{},{fill:"none"},we(s,!1));if(l==="circle")return C.createElement(pd,Qi({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var f=this.props.ticks,d=f.map(function(p){return mt(a,i,o,p.coordinate)});return C.createElement(Ane,Qi({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,s=a.tickLine,l=a.tickFormatter,u=a.stroke,f=we(this.props,!1),d=we(o,!1),p=Gi(Gi({},f),{},{fill:"none"},we(s,!1)),h=i.map(function(g,y){var v=n.getTickLineCoord(g),x=n.getTickTextAnchor(g),m=Gi(Gi(Gi({textAnchor:x},f),{},{stroke:"none",fill:u},d),{},{index:y,payload:g,x:v.x2,y:v.y2});return C.createElement(We,Qi({className:De("recharts-polar-angle-axis-tick",bT(o)),key:"tick-".concat(g.coordinate)},Oo(n.props,g,y)),s&&C.createElement("line",Qi({className:"recharts-polar-angle-axis-tick-line"},p,v)),o&&t.renderTickItem(o,m,l?l(g.value,y):g.value))});return C.createElement(We,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:C.createElement(We,{className:De("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return C.isValidElement(n)?o=C.cloneElement(n,a):je(n)?o=n(a):o=C.createElement(ko,Qi({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(j.PureComponent);gm(xm,"displayName","PolarAngleAxis");gm(xm,"axisType","angleAxis");gm(xm,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var pae=UN,hae=pae(Object.getPrototypeOf,Object),mae=hae,yae=Ba,vae=mae,gae=Ua,xae="[object Object]",bae=Function.prototype,wae=Object.prototype,LT=bae.toString,_ae=wae.hasOwnProperty,Sae=LT.call(Object);function jae(e){if(!gae(e)||yae(e)!=xae)return!1;var t=vae(e);if(t===null)return!0;var r=_ae.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&<.call(r)==Sae}var Oae=jae;const kae=rt(Oae);var Aae=Ba,Eae=Ua,Pae="[object Boolean]";function Nae(e){return e===!0||e===!1||Eae(e)&&Aae(e)==Pae}var Cae=Nae;const Tae=rt(Cae);function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:f,lowerWidth:d,height:p,x:l,y:u},duration:y,animationEasing:g,isActive:x},function(w){var S=w.upperWidth,b=w.lowerWidth,_=w.height,O=w.x,k=w.y;return C.createElement(Bn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,easing:g},C.createElement("path",qp({},we(r,!0),{className:m,d:uk(O,k,S,b,_),ref:n})))}):C.createElement("g",null,C.createElement("path",qp({},we(r,!0),{className:m,d:uk(l,u,f,d,p)})))},Vae=["option","shapeType","propTransformer","activeClassName","isActive"];function Bc(e){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bc(e)}function Wae(e,t){if(e==null)return{};var r=Hae(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ck(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Kp(e){for(var t=1;t0?Yr(w,"paddingAngle",0):0;if(b){var O=Ht(b.endAngle-b.startAngle,w.endAngle-w.startAngle),k=ft(ft({},w),{},{startAngle:m+_,endAngle:m+O(y)+_});v.push(k),m=k.endAngle}else{var A=w.endAngle,$=w.startAngle,T=Ht(0,A-$),P=T(y),R=ft(ft({},w),{},{startAngle:m+_,endAngle:m+P+_});v.push(R),m=R.endAngle}}),C.createElement(We,null,n.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Ao(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,s=a.className,l=a.label,u=a.cx,f=a.cy,d=a.innerRadius,p=a.outerRadius,h=a.isAnimationActive,g=this.state.isAnimationFinished;if(i||!o||!o.length||!re(u)||!re(f)||!re(d)||!re(p))return null;var y=De("recharts-pie",s);return C.createElement(We,{tabIndex:this.props.rootTabIndex,className:y,ref:function(x){n.pieRef=x}},this.renderSectors(),l&&this.renderLabels(o),rr.renderCallByParent(this.props,null,!1),(!h||g)&&ea.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n=360?m:m-1)*l,S=v-m*h-w,b=a.reduce(function(k,A){var $=Rt(A,x,0);return k+(re($)?$:0)},0),_;if(b>0){var O;_=a.map(function(k,A){var $=Rt(k,x,0),T=Rt(k,f,A),P=(re($)?$:0)/b,R;A?R=O.endAngle+jr(y)*l*($!==0?1:0):R=o;var L=R+jr(y)*(($!==0?h:0)+P*S),z=(R+L)/2,W=(g.innerRadius+g.outerRadius)/2,V=[{name:T,value:$,payload:k,dataKey:x,type:p}],D=mt(g.cx,g.cy,W,z);return O=ft(ft(ft({percent:P,cornerRadius:i,name:T,tooltipPayload:V,midAngle:z,middleRadius:W,tooltipPosition:D},k),g),{},{value:Rt(k,x),startAngle:R,endAngle:L,payload:k,paddingAngle:jr(y)*l}),O})}return ft(ft({},g),{},{sectors:_,data:a})});var fie=Math.ceil,pie=Math.max;function hie(e,t,r,n){for(var a=-1,i=pie(fie((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=e,e+=r;return o}var mie=hie,yie=sC,hk=1/0,vie=17976931348623157e292;function gie(e){if(!e)return e===0?e:0;if(e=yie(e),e===hk||e===-hk){var t=e<0?-1:1;return t*vie}return e===e?e:0}var UT=gie,xie=mie,bie=im,Xy=UT;function wie(e){return function(t,r,n){return n&&typeof n!="number"&&bie(t,r,n)&&(r=n=void 0),t=Xy(t),r===void 0?(r=t,t=0):r=Xy(r),n=n===void 0?t0&&n.handleDrag(a.changedTouches[0])}),Vr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,s=a.startIndex;o==null||o({endIndex:i,startIndex:s})}),n.detachDragEndListener()}),Vr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Vr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Vr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Vr(n,"handleSlideDragStart",function(a){var i=xk(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Rie(t,e),Cie(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,d=Math.min(a,i),p=Math.max(a,i),h=t.getIndexInRange(o,d),g=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:g===f?f:g-g%l}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,s=a.dataKey,l=Rt(i[n],s,n);return je(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,s=a.endX,l=this.props,u=l.x,f=l.width,d=l.travellerWidth,p=l.startIndex,h=l.endIndex,g=l.onChange,y=n.pageX-i;y>0?y=Math.min(y,u+f-d-s,u+f-d-o):y<0&&(y=Math.max(y,u-o,u-s));var v=this.getIndex({startX:o+y,endX:s+y});(v.startIndex!==p||v.endIndex!==h)&&g&&g(v),this.setState({startX:o+y,endX:s+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=xk(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,s=a.endX,l=a.startX,u=this.state[o],f=this.props,d=f.x,p=f.width,h=f.travellerWidth,g=f.onChange,y=f.gap,v=f.data,x={startX:this.state.startX,endX:this.state.endX},m=n.pageX-i;m>0?m=Math.min(m,d+p-h-u):m<0&&(m=Math.max(m,d-u)),x[o]=u+m;var w=this.getIndex(x),S=w.startIndex,b=w.endIndex,_=function(){var k=v.length-1;return o==="startX"&&(s>l?S%y===0:b%y===0)||sl?b%y===0:S%y===0)||s>l&&b===k};this.setState(Vr(Vr({},o,u+m),"brushMoveStartX",n.pageX),function(){g&&_()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[a],d=s.indexOf(f);if(d!==-1){var p=d+n;if(!(p===-1||p>=s.length)){var h=s[p];a==="startX"&&h>=u||a==="endX"&&h<=l||this.setState(Vr({},a,h),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return C.createElement("rect",{stroke:u,fill:l,x:a,y:i,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,d=j.Children.only(u);return d?C.cloneElement(d,{x:a,y:i,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,d=l.height,p=l.traveller,h=l.ariaLabel,g=l.data,y=l.startIndex,v=l.endIndex,x=Math.max(n,this.props.x),m=Yy(Yy({},we(this.props,!1)),{},{x,y:u,width:f,height:d}),w=h||"Min value: ".concat((i=g[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return C.createElement(We,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(b){["ArrowLeft","ArrowRight"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),s.handleTravellerMoveKeyboard(b.key==="ArrowRight"?1:-1,a))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,m))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,s=i.height,l=i.stroke,u=i.travellerWidth,f=Math.min(n,a)+u,d=Math.max(Math.abs(a-n)-u,0);return C.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:d,height:s})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,p=f.endX,h=5,g={pointerEvents:"none",fill:u};return C.createElement(We,{className:"recharts-brush-texts"},C.createElement(ko,Zp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-h,y:o+s/2},g),this.getTextOfTick(a)),C.createElement(ko,Zp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+l+h,y:o+s/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,d=n.alwaysShowText,p=this.state,h=p.startX,g=p.endX,y=p.isTextActive,v=p.isSlideMoving,x=p.isTravellerMoving,m=p.isTravellerFocused;if(!a||!a.length||!re(s)||!re(l)||!re(u)||!re(f)||u<=0||f<=0)return null;var w=De("recharts-brush",i),S=C.Children.count(o)===1,b=Pie("userSelect","none");return C.createElement(We,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(g,"endX"),(y||v||x||m||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(i+s/2)-1;return C.createElement(C.Fragment,null,C.createElement("rect",{x:a,y:i,width:o,height:s,fill:l,stroke:"none"}),C.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),C.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return C.isValidElement(n)?i=C.cloneElement(n,a):je(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return Yy({prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},i&&i.length?Die({data:i,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||s!==a.prevX||l!==a.prevTravellerWidth)){a.scale.range([s,s+o-l]);var p=a.scale.domain().map(function(h){return a.scale(h)});return{prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,s=i-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>a?s=l:o=l}return a>=n[s]?s:o}}])}(j.PureComponent);Vr(nl,"displayName","Brush");Vr(nl,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Lie=Wb;function Fie(e,t){var r;return Lie(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var zie=Fie,Bie=IN,Uie=oa,Vie=zie,Wie=Br,Hie=im;function Gie(e,t,r){var n=Wie(e)?Bie:Vie;return r&&Hie(e,t,r)&&(t=void 0),n(e,Uie(t))}var qie=Gie;const Kie=rt(qie);var ta=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},bk=rC;function Xie(e,t,r){t=="__proto__"&&bk?bk(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Yie=Xie,Zie=Yie,Qie=eC,Jie=oa;function eoe(e,t){var r={};return t=Jie(t),Qie(e,function(n,a,i){Zie(r,a,t(n,a,i))}),r}var toe=eoe;const roe=rt(toe);function noe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function boe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function woe(e,t){var r=e.x,n=e.y,a=xoe(e,moe),i="".concat(r),o=parseInt(i,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||a.height),f=parseInt(u,10),d="".concat(t.width||a.width),p=parseInt(d,10);return tu(tu(tu(tu(tu({},t),a),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:p,name:t.name,radius:t.radius})}function _k(e){return C.createElement(FT,F0({shapeType:"rectangle",propTransformer:woe,activeClassName:"recharts-active-bar"},e))}var _oe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=re(n)||W8(n);return i?t(n,a):(i||Po(),r)}},Soe=["value","background"],qT;function al(e){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},al(e)}function joe(e,t){if(e==null)return{};var r=Ooe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ooe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Jp(){return Jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(z)0&&Math.abs(L)0&&(R=Math.min((Q||0)-(L[be-1]||0),R))}),Number.isFinite(R)){var z=R/P,W=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(O=z*W/2),y.padding==="no-gap"){var V=Or(t.barCategoryGap,z*W),D=z*W/2;O=D-V-(D-V)/W*V}}}a==="xAxis"?k=[n.left+(w.left||0)+(O||0),n.left+n.width-(w.right||0)-(O||0)]:a==="yAxis"?k=l==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(O||0),n.top+n.height-(w.bottom||0)-(O||0)]:k=y.range,b&&(k=[k[1],k[0]]);var U=pT(y,i,p),q=U.scale,J=U.realScaleType;q.domain(x).range(k),hT(q);var K=mT(q,Cn(Cn({},y),{},{realScaleType:J}));a==="xAxis"?(T=v==="top"&&!S||v==="bottom"&&S,A=n.left,$=d[_]-T*y.height):a==="yAxis"&&(T=v==="left"&&!S||v==="right"&&S,A=d[_]-T*y.width,$=n.top);var ae=Cn(Cn(Cn({},y),K),{},{realScaleType:J,x:A,y:$,scale:q,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return ae.bandSize=Dp(ae,K),!y.hide&&a==="xAxis"?d[_]+=(T?-1:1)*ae.height:y.hide||(d[_]+=(T?-1:1)*ae.width),Cn(Cn({},h),{},_m({},g,ae))},{})},ZT=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},Moe=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return ZT({x:r,y:n},{x:a,y:i})},QT=function(){function e(t){$oe(this,e),this.scale=t}return Ioe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(a){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();_m(QT,"EPS",1e-4);var bw=function(t){var r=Object.keys(t).reduce(function(n,a){return Cn(Cn({},n),{},_m({},a,QT.create(t[a])))},{});return Cn(Cn({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,s=i.position;return roe(a,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(a){return GT(a,function(i,o){return r[o].isInRange(i)})}})};function Doe(e){return(e%180+180)%180}var Loe=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Doe(a),o=i*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?a[i?t[o]:o]:void 0}}var Voe=Uoe,Woe=UT;function Hoe(e){var t=Woe(e),r=t%1;return t===t?r?t-r:t:0}var Goe=Hoe,qoe=KN,Koe=oa,Xoe=Goe,Yoe=Math.max;function Zoe(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Xoe(r);return a<0&&(a=Yoe(n+a,0)),qoe(e,Koe(t),a)}var Qoe=Zoe,Joe=Voe,ese=Qoe,tse=Joe(ese),rse=tse;const nse=rt(rse);var ase=YB(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),ww=j.createContext(void 0),_w=j.createContext(void 0),JT=j.createContext(void 0),e$=j.createContext({}),t$=j.createContext(void 0),r$=j.createContext(0),n$=j.createContext(0),Ak=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,f=ase(i);return C.createElement(ww.Provider,{value:n},C.createElement(_w.Provider,{value:a},C.createElement(e$.Provider,{value:i},C.createElement(JT.Provider,{value:f},C.createElement(t$.Provider,{value:o},C.createElement(r$.Provider,{value:u},C.createElement(n$.Provider,{value:l},s)))))))},ise=function(){return j.useContext(t$)},a$=function(t){var r=j.useContext(ww);r==null&&Po();var n=r[t];return n==null&&Po(),n},ose=function(){var t=j.useContext(ww);return oi(t)},sse=function(){var t=j.useContext(_w),r=nse(t,function(n){return GT(n.domain,Number.isFinite)});return r||oi(t)},i$=function(t){var r=j.useContext(_w);r==null&&Po();var n=r[t];return n==null&&Po(),n},lse=function(){var t=j.useContext(JT);return t},use=function(){return j.useContext(e$)},Sw=function(){return j.useContext(n$)},jw=function(){return j.useContext(r$)};function il(e){"@babel/helpers - typeof";return il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},il(e)}function cse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dse(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Gse(e,t){return f$(e,t+1)}function qse(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,d=function(){var g=n==null?void 0:n[l];if(g===void 0)return{v:f$(n,u)};var y=l,v,x=function(){return v===void 0&&(v=r(g,y)),v},m=g.coordinate,w=l===0||ah(e,m,x,f,s);w||(l=0,f=o,u+=1),w&&(f=m+e*(x()/2+a),l+=u)},p;u<=i.length;)if(p=d(),p)return p.v;return[]}function Gc(e){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gc(e)}function Rk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t0?h.coordinate-v*e:h.coordinate})}else i[p]=h=hr(hr({},h),{},{tickCoord:h.coordinate});var x=ah(e,h.tickCoord,y,s,l);x&&(l=h.tickCoord-e*(y()/2+a),i[p]=hr(hr({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return i}function Qse(e,t,r,n,a,i){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(i){var f=n[s-1],d=r(f,s-1),p=e*(f.coordinate+e*d/2-u);o[s-1]=f=hr(hr({},f),{},{tickCoord:p>0?f.coordinate-p*e:f.coordinate});var h=ah(e,f.tickCoord,function(){return d},l,u);h&&(u=f.tickCoord-e*(d/2+a),o[s-1]=hr(hr({},f),{},{isShow:!0}))}for(var g=i?s-1:s,y=function(m){var w=o[m],S,b=function(){return S===void 0&&(S=r(w,m)),S};if(m===0){var _=e*(w.coordinate-e*b()/2-l);o[m]=w=hr(hr({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else o[m]=w=hr(hr({},w),{},{tickCoord:w.coordinate});var O=ah(e,w.tickCoord,b,l,u);O&&(l=w.tickCoord+e*(b()/2+a),o[m]=hr(hr({},w),{},{isShow:!0}))},v=0;v=2?jr(a[1].coordinate-a[0].coordinate):1,x=Hse(i,v,h);return l==="equidistantPreserveStart"?qse(v,x,y,a,o):(l==="preserveStart"||l==="preserveStartEnd"?p=Qse(v,x,y,a,o,l==="preserveStartEnd"):p=Zse(v,x,y,a,o),p.filter(function(m){return m.isShow}))}var Jse=["viewBox"],ele=["viewBox"],tle=["ticks"];function ll(e){"@babel/helpers - typeof";return ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ll(e)}function hs(){return hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dk(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!g||!g.length?null:C.createElement(We,{className:De("recharts-cartesian-axis",u),ref:function(v){n.layerReference=v}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),rr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,s=De(a.className,"recharts-cartesian-axis-tick-value");return C.isValidElement(n)?o=C.cloneElement(n,Bt(Bt({},a),{},{className:s})):je(n)?o=n(Bt(Bt({},a),{},{className:s})):o=C.createElement(ko,hs({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(j.Component);Ew(Rl,"displayName","CartesianAxis");Ew(Rl,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var cle=["x1","y1","x2","y2","key"],dle=["offset"];function No(e){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(e)}function Lk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var yle=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,s=t.height,l=t.ry;return C.createElement("rect",{x:a,y:i,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function m$(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(je(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,s=t.key,l=Fk(t,cle),u=we(l,!1);u.offset;var f=Fk(u,dle);r=C.createElement("line",oo({},f,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:s}))}return r}function vle(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=gr(gr({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return m$(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function gle(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=gr(gr({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return m$(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function xle(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var f=s.map(function(p){return Math.round(p+a-a)}).sort(function(p,h){return p-h});a!==f[0]&&f.unshift(0);var d=f.map(function(p,h){var g=!f[h+1],y=g?a+o-p:f[h+1]-p;if(y<=0)return null;var v=h%t.length;return C.createElement("rect",{key:"react-".concat(h),y:p,x:n,height:y,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function ble(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(p){return Math.round(p+i-i)}).sort(function(p,h){return p-h});i!==f[0]&&f.unshift(0);var d=f.map(function(p,h){var g=!f[h+1],y=g?i+s-p:f[h+1]-p;if(y<=0)return null;var v=h%n.length;return C.createElement("rect",{key:"react-".concat(h),x:p,y:o,width:y,height:l,stroke:"none",fill:n[v],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var wle=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return fT(Aw(gr(gr(gr({},Rl.defaultProps),n),{},{ticks:_a(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},_le=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return fT(Aw(gr(gr(gr({},Rl.defaultProps),n),{},{ticks:_a(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Go={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function K0(e){var t,r,n,a,i,o,s=Sw(),l=jw(),u=use(),f=gr(gr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Go.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Go.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Go.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Go.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Go.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Go.verticalFill,x:re(e.x)?e.x:u.left,y:re(e.y)?e.y:u.top,width:re(e.width)?e.width:u.width,height:re(e.height)?e.height:u.height}),d=f.x,p=f.y,h=f.width,g=f.height,y=f.syncWithTicks,v=f.horizontalValues,x=f.verticalValues,m=ose(),w=sse();if(!re(h)||h<=0||!re(g)||g<=0||!re(d)||d!==+d||!re(p)||p!==+p)return null;var S=f.verticalCoordinatesGenerator||wle,b=f.horizontalCoordinatesGenerator||_le,_=f.horizontalPoints,O=f.verticalPoints;if((!_||!_.length)&&je(b)){var k=v&&v.length,A=b({yAxis:w?gr(gr({},w),{},{ticks:k?v:w.ticks}):void 0,width:s,height:l,offset:u},k?!0:y);Ln(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(No(A),"]")),Array.isArray(A)&&(_=A)}if((!O||!O.length)&&je(S)){var $=x&&x.length,T=S({xAxis:m?gr(gr({},m),{},{ticks:$?x:m.ticks}):void 0,width:s,height:l,offset:u},$?!0:y);Ln(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(No(T),"]")),Array.isArray(T)&&(O=T)}return C.createElement("g",{className:"recharts-cartesian-grid"},C.createElement(yle,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),C.createElement(vle,oo({},f,{offset:u,horizontalPoints:_,xAxis:m,yAxis:w})),C.createElement(gle,oo({},f,{offset:u,verticalPoints:O,xAxis:m,yAxis:w})),C.createElement(xle,oo({},f,{horizontalPoints:_})),C.createElement(ble,oo({},f,{verticalPoints:O})))}K0.displayName="CartesianGrid";var Sle=["type","layout","connectNulls","ref"],jle=["key"];function ul(e){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ul(e)}function zk(e,t){if(e==null)return{};var r=Ole(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ole(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Bu(){return Bu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rd){h=[].concat(qo(l.slice(0,g)),[d-y]);break}var v=h.length%2===0?[0,p]:[p];return[].concat(qo(t.repeat(l,f)),qo(h),v).map(function(x){return"".concat(x,"px")}).join(", ")}),Tn(r,"id",Ro("recharts-line-")),Tn(r,"pathRef",function(o){r.mainCurve=o}),Tn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Tn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Rle(t,e),Cle(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,s=i.xAxis,l=i.yAxis,u=i.layout,f=i.children,d=Zr(f,fd);if(!d)return null;var p=function(y,v){return{x:y.x,y:y.y,value:y.value,errorVal:Rt(y.payload,v)}},h={clipPath:n?"url(#clipPath-".concat(a,")"):null};return C.createElement(We,h,d.map(function(g){return C.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:p})}))}},{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,d=we(this.props,!1),p=we(l,!0),h=u.map(function(y,v){var x=Ur(Ur(Ur({key:"dot-".concat(v),r:3},d),p),{},{index:v,cx:y.x,cy:y.y,value:y.value,dataKey:f,payload:y.payload,points:u});return t.renderDotItem(l,x)}),g={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return C.createElement(We,Bu({className:"recharts-line-dots",key:"dots"},g),h)}},{key:"renderCurveStatically",value:function(n,a,i,o){var s=this.props,l=s.type,u=s.layout,f=s.connectNulls;s.ref;var d=zk(s,Sle),p=Ur(Ur(Ur({},we(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:f});return C.createElement(ho,Bu({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,p=o.animationEasing,h=o.animationId,g=o.animateNewValues,y=o.width,v=o.height,x=this.state,m=x.prevPoints,w=x.totalLength;return C.createElement(Bn,{begin:f,duration:d,isActive:u,easing:p,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var b=S.t;if(m){var _=m.length/s.length,O=s.map(function(P,R){var L=Math.floor(R*_);if(m[L]){var z=m[L],W=Ht(z.x,P.x),V=Ht(z.y,P.y);return Ur(Ur({},P),{},{x:W(b),y:V(b)})}if(g){var D=Ht(y*2,P.x),U=Ht(v/2,P.y);return Ur(Ur({},P),{},{x:D(b),y:U(b)})}return Ur(Ur({},P),{},{x:P.x,y:P.y})});return i.renderCurveStatically(O,n,a)}var k=Ht(0,w),A=k(b),$;if(l){var T="".concat(l).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});$=i.getStrokeDasharray(A,w,T)}else $=i.generateSimpleStrokeDasharray(w,A);return i.renderCurveStatically(s,n,a,{strokeDasharray:$})})}},{key:"renderCurve",value:function(n,a){var i=this.props,o=i.points,s=i.isAnimationActive,l=this.state,u=l.prevPoints,f=l.totalLength;return s&&o&&o.length&&(!u&&f>0||!Ao(u,o))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(o,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.xAxis,f=a.yAxis,d=a.top,p=a.left,h=a.width,g=a.height,y=a.isAnimationActive,v=a.id;if(i||!s||!s.length)return null;var x=this.state.isAnimationFinished,m=s.length===1,w=De("recharts-line",l),S=u&&u.allowDataOverflow,b=f&&f.allowDataOverflow,_=S||b,O=Ne(v)?this.id:v,k=(n=we(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=k.r,$=A===void 0?3:A,T=k.strokeWidth,P=T===void 0?2:T,R=iN(o)?o:{},L=R.clipDot,z=L===void 0?!0:L,W=$*2+P;return C.createElement(We,{className:w},S||b?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(O)},C.createElement("rect",{x:S?p:p-h/2,y:b?d:d-g/2,width:S?h:h*2,height:b?g:g*2})),!z&&C.createElement("clipPath",{id:"clipPath-dots-".concat(O)},C.createElement("rect",{x:p-W/2,y:d-W/2,width:h+W,height:g+W}))):null,!m&&this.renderCurve(_,O),this.renderErrorBar(_,O),(m||o)&&this.renderDots(_,z,O),(!y||x)&&ea.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(qo(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Ao(f,o)||!Ao(d,s))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(o,s,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.top,f=a.left,d=a.xAxis,p=a.yAxis,h=a.width,g=a.height,y=a.isAnimationActive,v=a.id;if(i||!s||!s.length)return null;var x=this.state.isAnimationFinished,m=s.length===1,w=De("recharts-area",l),S=d&&d.allowDataOverflow,b=p&&p.allowDataOverflow,_=S||b,O=Ne(v)?this.id:v,k=(n=we(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=k.r,$=A===void 0?3:A,T=k.strokeWidth,P=T===void 0?2:T,R=iN(o)?o:{},L=R.clipDot,z=L===void 0?!0:L,W=$*2+P;return C.createElement(We,{className:w},S||b?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(O)},C.createElement("rect",{x:S?f:f-h/2,y:b?u:u-g/2,width:S?h:h*2,height:b?g:g*2})),!z&&C.createElement("clipPath",{id:"clipPath-dots-".concat(O)},C.createElement("rect",{x:f-W/2,y:u-W/2,width:h+W,height:g+W}))):null,m?null:this.renderArea(_,O),(o||m)&&this.renderDots(_,z,O),(!y||x)&&ea.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(j.PureComponent);g$=Fi;Xn(Fi,"displayName","Area");Xn(Fi,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Ri.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Xn(Fi,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,o=t.props.baseValue,s=o??i;if(re(s)&&typeof s=="number")return s;var l=a==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return s==="dataMin"?d:s==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});Xn(Fi,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,p=e.offset,h=t.layout,g=u&&u.length,y=g$.getBaseValue(t,r,n,a),v=h==="horizontal",x=!1,m=d.map(function(S,b){var _;g?_=u[f+b]:(_=Rt(S,l),Array.isArray(_)?x=!0:_=[y,_]);var O=_[1]==null||g&&Rt(S,l)==null;return v?{x:Mp({axis:n,ticks:i,bandSize:s,entry:S,index:b}),y:O?null:a.scale(_[1]),value:_,payload:S}:{x:O?null:n.scale(_[1]),y:Mp({axis:a,ticks:o,bandSize:s,entry:S,index:b}),value:_,payload:S}}),w;return g||x?w=m.map(function(S){var b=Array.isArray(S.value)?S.value[0]:null;return v?{x:S.x,y:b!=null&&S.y!=null?a.scale(b):null}:{x:b!=null?n.scale(b):null,y:S.y}}):w=v?a.scale(y):n.scale(y),Za({points:m,baseLine:w,layout:h,isRange:x},p)});Xn(Fi,"renderDotItem",function(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(je(e))r=e(t);else{var n=De("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=x$(t,Lle);r=C.createElement(pd,so({},i,{key:a,className:n}))}return r});function dl(e){"@babel/helpers - typeof";return dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(e)}function qle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kle(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Iue(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Rue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mue(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&re(a)&&re(i)?t.slice(a,i+1):[]};function R$(e){return e==="number"?[0,"auto"]:void 0}var ox=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,s=Am(r,t);return n<0||!i||!i.length||n>=s.length?null:i.reduce(function(l,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=d===void 0?s:d;p=sp(h,o.dataKey,a)}else p=d&&d[n]||s[n];return p?[].concat(hl(l),[vT(u,p)]):l},[])},Yk=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=Kue(i,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=ree(o,s,u,l);if(f>=0&&u){var d=u[f]&&u[f].value,p=ox(t,r,f,d),h=Xue(n,s,f,i);return{activeTooltipIndex:f,activeLabel:d,activePayload:p,activeCoordinate:h}}return null},Yue=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,p=t.stackOffset,h=dT(f,i);return n.reduce(function(g,y){var v,x=y.type.defaultProps!==void 0?Y(Y({},y.type.defaultProps),y.props):y.props,m=x.type,w=x.dataKey,S=x.allowDataOverflow,b=x.allowDuplicatedCategory,_=x.scale,O=x.ticks,k=x.includeHidden,A=x[o];if(g[A])return g;var $=Am(t.data,{graphicalItems:a.filter(function(K){var ae,Q=o in K.props?K.props[o]:(ae=K.type.defaultProps)===null||ae===void 0?void 0:ae[o];return Q===A}),dataStartIndex:l,dataEndIndex:u}),T=$.length,P,R,L;_ue(x.domain,S,m)&&(P=g0(x.domain,null,S),h&&(m==="number"||_!=="auto")&&(L=Du($,w,"category")));var z=R$(m);if(!P||P.length===0){var W,V=(W=x.domain)!==null&&W!==void 0?W:z;if(w){if(P=Du($,w,m),m==="category"&&h){var D=G8(P);b&&D?(R=P,P=Yp(0,T)):b||(P=xO(V,P,y).reduce(function(K,ae){return K.indexOf(ae)>=0?K:[].concat(hl(K),[ae])},[]))}else if(m==="category")b?P=P.filter(function(K){return K!==""&&!Ne(K)}):P=xO(V,P,y).reduce(function(K,ae){return K.indexOf(ae)>=0||ae===""||Ne(ae)?K:[].concat(hl(K),[ae])},[]);else if(m==="number"){var U=see($,a.filter(function(K){var ae,Q,be=o in K.props?K.props[o]:(ae=K.type.defaultProps)===null||ae===void 0?void 0:ae[o],ue="hide"in K.props?K.props.hide:(Q=K.type.defaultProps)===null||Q===void 0?void 0:Q.hide;return be===A&&(k||!ue)}),w,i,f);U&&(P=U)}h&&(m==="number"||_!=="auto")&&(L=Du($,w,"category"))}else h?P=Yp(0,T):s&&s[A]&&s[A].hasStack&&m==="number"?P=p==="expand"?[0,1]:yT(s[A].stackGroups,l,u):P=cT($,a.filter(function(K){var ae=o in K.props?K.props[o]:K.type.defaultProps[o],Q="hide"in K.props?K.props.hide:K.type.defaultProps.hide;return ae===A&&(k||!Q)}),m,f,!0);if(m==="number")P=nx(d,P,A,i,O),V&&(P=g0(V,P,S));else if(m==="category"&&V){var q=V,J=P.every(function(K){return q.indexOf(K)>=0});J&&(P=q)}}return Y(Y({},g),{},Se({},A,Y(Y({},x),{},{axisType:i,domain:P,categoricalDomain:L,duplicateDomain:R,originalDomain:(v=x.domain)!==null&&v!==void 0?v:z,isCategorical:h,layout:f})))},{})},Zue=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,p=Am(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=p.length,g=dT(f,i),y=-1;return n.reduce(function(v,x){var m=x.type.defaultProps!==void 0?Y(Y({},x.type.defaultProps),x.props):x.props,w=m[o],S=R$("number");if(!v[w]){y++;var b;return g?b=Yp(0,h):s&&s[w]&&s[w].hasStack?(b=yT(s[w].stackGroups,l,u),b=nx(d,b,w,i)):(b=g0(S,cT(p,n.filter(function(_){var O,k,A=o in _.props?_.props[o]:(O=_.type.defaultProps)===null||O===void 0?void 0:O[o],$="hide"in _.props?_.props.hide:(k=_.type.defaultProps)===null||k===void 0?void 0:k.hide;return A===w&&!$}),"number",f),a.defaultProps.allowDataOverflow),b=nx(d,b,w,i)),Y(Y({},v),{},Se({},w,Y(Y({axisType:i},a.defaultProps),{},{hide:!0,orientation:Yr(Gue,"".concat(i,".").concat(y%2),null),domain:b,originalDomain:S,isCategorical:g,layout:f})))}return v},{})},Que=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(a,"Id"),p=Zr(f,i),h={};return p&&p.length?h=Yue(t,{axes:p,graphicalItems:o,axisType:a,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=Zue(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Jue=function(t){var r=oi(t),n=_a(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Hb(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Dp(r,n)}},Zk=function(t){var r=t.children,n=t.defaultShowTooltip,a=Hr(r,nl),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},ece=function(t){return!t||!t.length?!1:t.some(function(r){var n=ja(r&&r.type);return n&&n.indexOf("Bar")>=0})},Qk=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},tce=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,d=n.children,p=n.margin||{},h=Hr(d,nl),g=Hr(d,Oa),y=Object.keys(l).reduce(function(b,_){var O=l[_],k=O.orientation;return!O.mirror&&!O.hide?Y(Y({},b),{},Se({},k,b[k]+O.width)):b},{left:p.left||0,right:p.right||0}),v=Object.keys(o).reduce(function(b,_){var O=o[_],k=O.orientation;return!O.mirror&&!O.hide?Y(Y({},b),{},Se({},k,Yr(b,"".concat(k))+O.height)):b},{top:p.top||0,bottom:p.bottom||0}),x=Y(Y({},v),y),m=x.bottom;h&&(x.bottom+=h.props.height||nl.defaultProps.height),g&&r&&(x=iee(x,a,n,r));var w=u-x.left-x.right,S=f-x.top-x.bottom;return Y(Y({brushBottom:m},x),{},{width:Math.max(w,0),height:Math.max(S,0)})},rce=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Em=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,p=function(x,m){var w=m.graphicalItems,S=m.stackGroups,b=m.offset,_=m.updateId,O=m.dataStartIndex,k=m.dataEndIndex,A=x.barSize,$=x.layout,T=x.barGap,P=x.barCategoryGap,R=x.maxBarSize,L=Qk($),z=L.numericAxisName,W=L.cateAxisName,V=ece(w),D=[];return w.forEach(function(U,q){var J=Am(x.data,{graphicalItems:[U],dataStartIndex:O,dataEndIndex:k}),K=U.type.defaultProps!==void 0?Y(Y({},U.type.defaultProps),U.props):U.props,ae=K.dataKey,Q=K.maxBarSize,be=K["".concat(z,"Id")],ue=K["".concat(W,"Id")],Ce={},Fe=l.reduce(function(Ge,H){var E=m["".concat(H.axisType,"Map")],M=K["".concat(H.axisType,"Id")];E&&E[M]||H.axisType==="zAxis"||Po();var N=E[M];return Y(Y({},Ge),{},Se(Se({},H.axisType,N),"".concat(H.axisType,"Ticks"),_a(N)))},Ce),te=Fe[W],ie=Fe["".concat(W,"Ticks")],he=S&&S[be]&&S[be].hasStack&&yee(U,S[be].stackGroups),X=ja(U.type).indexOf("Bar")>=0,Ee=Dp(te,ie),ve=[],Pe=V&&nee({barSize:A,stackGroups:S,totalSize:rce(Fe,W)});if(X){var ze,ge,$e=Ne(Q)?R:Q,Le=(ze=(ge=Dp(te,ie,!0))!==null&&ge!==void 0?ge:$e)!==null&&ze!==void 0?ze:0;ve=aee({barGap:T,barCategoryGap:P,bandSize:Le!==Ee?Le:Ee,sizeList:Pe[ue],maxBarSize:$e}),Le!==Ee&&(ve=ve.map(function(Ge){return Y(Y({},Ge),{},{position:Y(Y({},Ge.position),{},{offset:Ge.position.offset-Le/2})})}))}var Oe=U&&U.type&&U.type.getComposedData;Oe&&D.push({props:Y(Y({},Oe(Y(Y({},Fe),{},{displayedData:J,props:x,dataKey:ae,item:U,bandSize:Ee,barPosition:ve,offset:b,stackedData:he,layout:$,dataStartIndex:O,dataEndIndex:k}))),{},Se(Se(Se({key:U.key||"item-".concat(q)},z,Fe[z]),W,Fe[W]),"animationId",_)),childIndex:a6(U,x.children),item:U})}),D},h=function(x,m){var w=x.props,S=x.dataStartIndex,b=x.dataEndIndex,_=x.updateId;if(!pS({props:w}))return null;var O=w.children,k=w.layout,A=w.stackOffset,$=w.data,T=w.reverseStackOrder,P=Qk(k),R=P.numericAxisName,L=P.cateAxisName,z=Zr(O,n),W=hee($,z,"".concat(R,"Id"),"".concat(L,"Id"),A,T),V=l.reduce(function(K,ae){var Q="".concat(ae.axisType,"Map");return Y(Y({},K),{},Se({},Q,Que(w,Y(Y({},ae),{},{graphicalItems:z,stackGroups:ae.axisType===R&&W,dataStartIndex:S,dataEndIndex:b}))))},{}),D=tce(Y(Y({},V),{},{props:w,graphicalItems:z}),m==null?void 0:m.legendBBox);Object.keys(V).forEach(function(K){V[K]=f(w,V[K],D,K.replace("Map",""),r)});var U=V["".concat(L,"Map")],q=Jue(U),J=p(w,Y(Y({},V),{},{dataStartIndex:S,dataEndIndex:b,updateId:_,graphicalItems:z,stackGroups:W,offset:D}));return Y(Y({formattedGraphicalItems:J,graphicalItems:z,offset:D,stackGroups:W},q),V)},g=function(v){function x(m){var w,S,b;return Rue(this,x),b=Lue(this,x,[m]),Se(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Se(b,"accessibilityManager",new wue),Se(b,"handleLegendBBoxUpdate",function(_){if(_){var O=b.state,k=O.dataStartIndex,A=O.dataEndIndex,$=O.updateId;b.setState(Y({legendBBox:_},h({props:b.props,dataStartIndex:k,dataEndIndex:A,updateId:$},Y(Y({},b.state),{},{legendBBox:_}))))}}),Se(b,"handleReceiveSyncEvent",function(_,O,k){if(b.props.syncId===_){if(k===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(O)}}),Se(b,"handleBrushChange",function(_){var O=_.startIndex,k=_.endIndex;if(O!==b.state.dataStartIndex||k!==b.state.dataEndIndex){var A=b.state.updateId;b.setState(function(){return Y({dataStartIndex:O,dataEndIndex:k},h({props:b.props,dataStartIndex:O,dataEndIndex:k,updateId:A},b.state))}),b.triggerSyncEvent({dataStartIndex:O,dataEndIndex:k})}}),Se(b,"handleMouseEnter",function(_){var O=b.getMouseInfo(_);if(O){var k=Y(Y({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseEnter;je(A)&&A(k,_)}}),Se(b,"triggeredAfterMouseMove",function(_){var O=b.getMouseInfo(_),k=O?Y(Y({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseMove;je(A)&&A(k,_)}),Se(b,"handleItemMouseEnter",function(_){b.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Se(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Se(b,"handleMouseMove",function(_){_.persist(),b.throttleTriggeredAfterMouseMove(_)}),Se(b,"handleMouseLeave",function(_){b.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};b.setState(O),b.triggerSyncEvent(O);var k=b.props.onMouseLeave;je(k)&&k(O,_)}),Se(b,"handleOuterEvent",function(_){var O=n6(_),k=Yr(b.props,"".concat(O));if(O&&je(k)){var A,$;/.*touch.*/i.test(O)?$=b.getMouseInfo(_.changedTouches[0]):$=b.getMouseInfo(_),k((A=$)!==null&&A!==void 0?A:{},_)}}),Se(b,"handleClick",function(_){var O=b.getMouseInfo(_);if(O){var k=Y(Y({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var A=b.props.onClick;je(A)&&A(k,_)}}),Se(b,"handleMouseDown",function(_){var O=b.props.onMouseDown;if(je(O)){var k=b.getMouseInfo(_);O(k,_)}}),Se(b,"handleMouseUp",function(_){var O=b.props.onMouseUp;if(je(O)){var k=b.getMouseInfo(_);O(k,_)}}),Se(b,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Se(b,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseDown(_.changedTouches[0])}),Se(b,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseUp(_.changedTouches[0])}),Se(b,"handleDoubleClick",function(_){var O=b.props.onDoubleClick;if(je(O)){var k=b.getMouseInfo(_);O(k,_)}}),Se(b,"handleContextMenu",function(_){var O=b.props.onContextMenu;if(je(O)){var k=b.getMouseInfo(_);O(k,_)}}),Se(b,"triggerSyncEvent",function(_){b.props.syncId!==void 0&&Qy.emit(Jy,b.props.syncId,_,b.eventEmitterSymbol)}),Se(b,"applySyncEvent",function(_){var O=b.props,k=O.layout,A=O.syncMethod,$=b.state.updateId,T=_.dataStartIndex,P=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)b.setState(Y({dataStartIndex:T,dataEndIndex:P},h({props:b.props,dataStartIndex:T,dataEndIndex:P,updateId:$},b.state)));else if(_.activeTooltipIndex!==void 0){var R=_.chartX,L=_.chartY,z=_.activeTooltipIndex,W=b.state,V=W.offset,D=W.tooltipTicks;if(!V)return;if(typeof A=="function")z=A(D,_);else if(A==="value"){z=-1;for(var U=0;U=0){var he,X;if(R.dataKey&&!R.allowDuplicatedCategory){var Ee=typeof R.dataKey=="function"?ie:"payload.".concat(R.dataKey.toString());he=sp(U,Ee,z),X=q&&J&&sp(J,Ee,z)}else he=U==null?void 0:U[L],X=q&&J&&J[L];if(ue||be){var ve=_.props.activeIndex!==void 0?_.props.activeIndex:L;return[j.cloneElement(_,Y(Y(Y({},A.props),Fe),{},{activeIndex:ve})),null,null]}if(!Ne(he))return[te].concat(hl(b.renderActivePoints({item:A,activePoint:he,basePoint:X,childIndex:L,isRange:q})))}else{var Pe,ze=(Pe=b.getItemByXY(b.state.activeCoordinate))!==null&&Pe!==void 0?Pe:{graphicalItem:te},ge=ze.graphicalItem,$e=ge.item,Le=$e===void 0?_:$e,Oe=ge.childIndex,Ge=Y(Y(Y({},A.props),Fe),{},{activeIndex:Oe});return[j.cloneElement(Le,Ge),null,null]}return q?[te,null,null]:[te,null]}),Se(b,"renderCustomized",function(_,O,k){return j.cloneElement(_,Y(Y({key:"recharts-customized-".concat(k)},b.props),b.state))}),Se(b,"renderMap",{CartesianGrid:{handler:Zd,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:Zd},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:Zd},YAxis:{handler:Zd},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((w=m.id)!==null&&w!==void 0?w:Ro("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=lC(b.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),b.state={},b}return Bue(x,v),Due(x,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,b=w.data,_=w.height,O=w.layout,k=Hr(S,_r);if(k){var A=k.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,T=ox(this.state,b,A,$),P=this.state.tooltipTicks[A].coordinate,R=(this.state.offset.top+_)/2,L=O==="horizontal",z=L?{x:P,y:R}:{y:P,x:R},W=this.state.formattedGraphicalItems.find(function(D){var U=D.item;return U.type.name==="Scatter"});W&&(z=Y(Y({},z),W.props.points[A].tooltipPosition),T=W.props.points[A].tooltipPayload);var V={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:$,activePayload:T,activeCoordinate:z};this.setState(V),this.renderCursor(k),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var b,_;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){$g([Hr(w.children,_r)],[Hr(this.props.children,_r)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Hr(this.props.children,_r);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return s.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,b=S.getBoundingClientRect(),_=NX(b),O={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},k=b.width/S.offsetWidth||1,A=this.inRange(O.chartX,O.chartY,k);if(!A)return null;var $=this.state,T=$.xAxisMap,P=$.yAxisMap,R=this.getTooltipEventType(),L=Yk(this.state,this.props.data,this.props.layout,A);if(R!=="axis"&&T&&P){var z=oi(T).scale,W=oi(P).scale,V=z&&z.invert?z.invert(O.chartX):null,D=W&&W.invert?W.invert(O.chartY):null;return Y(Y({},O),{},{xValue:V,yValue:D},L)}return L?Y(Y({},O),L):null}},{key:"inRange",value:function(w,S){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,O=w/b,k=S/b;if(_==="horizontal"||_==="vertical"){var A=this.state.offset,$=O>=A.left&&O<=A.left+A.width&&k>=A.top&&k<=A.top+A.height;return $?{x:O,y:k}:null}var T=this.state,P=T.angleAxisMap,R=T.radiusAxisMap;if(P&&R){var L=oi(P);return _O({x:O,y:k},L)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),b=Hr(w,_r),_={};b&&S==="axis"&&(b.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=lp(this.props,this.handleOuterEvent);return Y(Y({},O),_)}},{key:"addListener",value:function(){Qy.on(Jy,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Qy.removeListener(Jy,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,b){for(var _=this.state.formattedGraphicalItems,O=0,k=_.length;Obt(`/routing/list/active/${e}`)),n=t==null?void 0:t.find(T=>{var P;return((P=T.algorithm_data||T.algorithm)==null?void 0:P.type)==="volume_split"}),[a,i]=j.useState([{id:ru(),name:"",split:50},{id:ru(),name:"",split:50}]),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,d]=j.useState(null),[p,h]=j.useState(null),[g,y]=j.useState(!1),[v,x]=j.useState(new Set),m=a.reduce((T,P)=>T+P.split,0);function w(T,P,R){i(L=>L.map(z=>z.id===T?{...z,[P]:R}:z))}function S(){i(T=>[...T,{id:ru(),name:"",split:0}])}function b(T){i(P=>P.filter(R=>R.id!==T))}async function _(){if(!e)return d("Set a merchant ID first");if(!o.trim())return d("Enter a rule name");if(m!==100)return d(`Splits must sum to 100 (currently ${m})`);if(a.some(T=>!T.name.trim()))return d("All gateways must have names");u(!0),d(null),h(null);try{await bt("/routing/create",{rule_id:null,name:o,description:"",created_by:e,algorithm_for:"payment",metadata:null,algorithm:{type:"volume_split",data:a.map(T=>({split:T.split,output:{gateway_name:T.name.trim(),gateway_id:null}}))}}),h(`Rule "${o}" created successfully. Find it in the list below to activate.`),r(),s(""),i([{id:ru(),name:"",split:50},{id:ru(),name:"",split:50}])}catch(T){d(T instanceof Error?T.message:"Failed to create rule")}finally{u(!1)}}async function O(T){if(e)try{await bt("/routing/activate",{created_by:e,routing_algorithm_id:T}),r(),h("Rule activated.")}catch(P){d(P instanceof Error?P.message:"Failed to activate")}}function k(T){x(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})}const A=n?n.algorithm_data||n.algorithm:null,$=A&&"data"in A?A.data.map(T=>{var P;return{name:((P=T.output)==null?void 0:P.gateway_name)??"?",value:T.split}}):[];return c.jsxs("div",{className:"space-y-6 max-w-4xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Volume Split Routing"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Distribute payment traffic across gateways by percentage."})]}),n&&c.jsxs(ke,{children:[c.jsxs(Xe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Volume Split"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n.name})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_e,{variant:"green",children:"Active"}),c.jsxs(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(!g),children:[c.jsx(Nh,{size:14,className:"mr-1"}),g?"Hide":"View"]})]})]}),g&&c.jsxs(Ae,{children:[c.jsx(ks,{width:"100%",height:220,children:c.jsxs(M$,{children:[c.jsx(sa,{data:$,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:T,value:P})=>`${T}: ${P}%`,labelLine:{stroke:"#45454f"},children:$.map((T,P)=>c.jsx(co,{fill:eA[P%eA.length]},P))}),c.jsx(_r,{formatter:T=>`${T}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),c.jsx(Oa,{wrapperStyle:{color:"#8e8ea0"}})]})}),c.jsxs("div",{className:"mt-4 text-xs text-slate-600",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Rule ID:"})," ",n.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",n.created_at?new Date(n.created_at).toLocaleString():"Unknown"]})]})]})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"Create Volume Split Rule"})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Rule Name"}),c.jsx("input",{value:o,onChange:T=>s(T.target.value),placeholder:"e.g. ab-test-split",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 text-xs font-medium text-slate-500 px-1",children:[c.jsx("span",{children:"Gateway Name"}),c.jsx("span",{children:"Split %"}),c.jsx("span",{})]}),a.map(T=>c.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 items-center",children:[c.jsx("input",{value:T.name,onChange:P=>w(T.id,"name",P.target.value),placeholder:"e.g. stripe",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{type:"number",min:0,max:100,value:T.split,onChange:P=>w(T.id,"split",Number(P.target.value)),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>b(T.id),className:"text-slate-400 hover:text-red-500",children:c.jsx(Ca,{size:15})})]},T.id)),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-sm text-brand-500 hover:text-brand-600",children:[c.jsx(ki,{size:14})," Add Gateway"]}),c.jsxs("span",{className:`text-xs font-medium ${m===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",m,"%",m!==100&&" (must be 100)"]})]})]}),c.jsx(Gr,{error:f}),p&&c.jsx("p",{className:"text-sm text-emerald-400",children:p}),c.jsx(Ie,{onClick:_,disabled:l||!e,children:l?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Creating…"]}):"Create Rule"})]})]}),c.jsx(oce,{merchantId:e,onActivate:O,expandedRuleIds:v,onToggleExpand:k})]})}function oce({merchantId:e,onActivate:t,expandedRuleIds:r,onToggleExpand:n}){const{data:a,isLoading:i}=ar(e?["routing-list",e]:null,()=>bt(`/routing/list/${e}`)),o=(a==null?void 0:a.filter(s=>{var l;return((l=s.algorithm_data||s.algorithm)==null?void 0:l.type)==="volume_split"}))??[];return e?i?c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(mr,{})}):o.length?c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"Saved Volume Split Rules"})}),c.jsx(Ae,{className:"p-0",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 uppercase tracking-wider",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2",children:"Name"}),c.jsx("th",{className:"text-left px-4 py-2",children:"Split"}),c.jsx("th",{className:"px-4 py-2"})]})}),c.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:o.map(s=>{const l=s.algorithm_data||s.algorithm,u=(l==null?void 0:l.data)||[],f=r.has(s.id);return c.jsxs(c.Fragment,{children:[c.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[c.jsx("td",{className:"px-4 py-2 font-medium text-slate-800",children:s.name}),c.jsx("td",{className:"px-4 py-2 text-slate-600 text-xs",children:u.map(d=>{var p;return`${(p=d.output)==null?void 0:p.gateway_name}:${d.split}%`}).join(" | ")}),c.jsx("td",{className:"px-4 py-2 text-right",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:()=>n(s.id),children:[c.jsx(Nh,{size:14,className:"mr-1"}),f?"Hide":"View"]}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>t(s.id),children:"Activate"})]})})]},s.id),f&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:c.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"ID:"})," ",s.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Description:"})," ",s.description||"N/A"]}),s.created_at&&c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",new Date(s.created_at).toLocaleString()]}),c.jsxs("div",{children:[c.jsx("strong",{children:"Configuration:"}),c.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(l,null,2)})]})]})})})]})})})]})})]}):null:null}function sce(){var m;const{merchantId:e}=aa(),{data:t,mutate:r,isLoading:n}=ar(e?["rule-debit",e]:null,()=>bt("/rule/get",{merchant_id:e,config:{type:"debitRouting"}})),[a,i]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,d]=j.useState(null),[p,h]=j.useState(null),g=(m=t==null?void 0:t.config)==null?void 0:m.data,y=a||(g==null?void 0:g.merchant_category_code)||"",v=o||(g==null?void 0:g.acquirer_country)||"";async function x(){if(!e)return d("Set a merchant ID first");const w={merchant_id:e,config:{type:"debitRouting",data:{merchant_category_code:y.trim(),acquirer_country:v.trim()}}};u(!0),d(null);try{await bt(t?"/rule/update":"/rule/create",w),h("Debit routing config saved."),r()}catch(S){d(S instanceof Error?S.message:"Failed to save")}finally{u(!1)}}return c.jsxs("div",{className:"space-y-6 max-w-2xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Network / Debit Routing"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Configure network-based routing to optimise processing fees for debit card transactions. The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR)."})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(zE,{size:16,className:"text-brand-500"}),c.jsx("h2",{className:"font-medium text-slate-800",children:"Debit Routing Configuration"})]})}),c.jsx(Ae,{className:"space-y-4",children:n?c.jsx("div",{className:"flex justify-center py-6",children:c.jsx(mr,{})}):c.jsxs(c.Fragment,{children:[!e&&c.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar to load configuration."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Merchant Category Code (MCC)"}),c.jsx("input",{value:y,onChange:w=>i(w.target.value),placeholder:"e.g. 5411",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"4-digit ISO MCC for your business type"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Acquirer Country"}),c.jsx("input",{value:v,onChange:w=>s(w.target.value),placeholder:"e.g. US",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"ISO 3166-1 alpha-2 country code"})]})]}),c.jsx(Gr,{error:f}),p&&c.jsx("p",{className:"text-sm text-emerald-400",children:p}),c.jsx(Ie,{onClick:x,disabled:l||!e,children:l?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Saving…"]}):t?"Update Config":"Save Config"})]})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"How Network Routing Works"})}),c.jsxs(Ae,{className:"text-sm text-slate-600 space-y-2",children:[c.jsx("p",{children:"For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee."}),c.jsxs("p",{children:["Supported networks: ",["VISA","MASTERCARD","ACCEL","NYCE","PULSE","STAR"].map(w=>c.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md mr-1 text-slate-700",children:w},w))]}),c.jsxs("p",{children:["Use the ",c.jsx("strong",{className:"text-slate-800",children:"Decision Explorer"})," to test network routing decisions with ",c.jsx("code",{className:"text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md text-brand-500",children:"NtwBasedRouting"})," algorithm."]})]})]})]})}const lce=["SR_BASED_ROUTING","PL_BASED_ROUTING","NTW_BASED_ROUTING"],uce={SR_BASED_ROUTING:"Success Rate Based",PL_BASED_ROUTING:"Priority List Based",NTW_BASED_ROUTING:"Network Based"};function cce(e){for(const[t,r]of Object.entries(h4))if(e.includes(t)||t.includes(e))return r;return"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8"}const Cr=["#0069ED","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function bf(e=[]){return e.map(t=>t.trim()).filter(Boolean).map(t=>t.toUpperCase())}function tv(e=[]){return Array.from(new Set(bf(e)))}function dce(e){return function(){let r=e+=1831565813;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function fce(e,t){const r=Math.max(0,t);if(!e.length||r===0)return[];const n=[];e.forEach((l,u)=>{for(let f=0;f({connector:l.name,colorIdx:u,percentage:l.percentage})).sort((l,u)=>u.percentage-l.percentage);for(;n.lengthr&&(n.length=r);const i=e.reduce((l,u,f)=>{const d=Array.from(u.name).reduce((p,h)=>p+h.charCodeAt(0),0);return l+d+f*31+u.count*17+Math.round(u.percentage*10)},r*13),o=dce(i),s=[...n];for(let l=s.length-1;l>0;l-=1){const u=Math.floor(o()*(l+1));[s[l],s[u]]=[s[u],s[l]]}return s}function rv(e){return e==="enum"?"enum_variant":e==="integer"?"number":e==="udf"||e==="global_ref"?"metadata_variant":"str_value"}function D$(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function yu(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function un(e){return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase()):""}function vu(e){return e?e==="decision_gateway"||e==="decide_gateway"?"Decide Gateway":e==="update_gateway_score"?"Update Gateway":e==="routing_evaluate"?"Rule Evaluate":un(e):"Unknown route"}function tA(e){return e?e==="decision"?"Decide Gateway":e==="gateway_update"?"Update Gateway":e==="rule_hit"?"Rule Evaluate":e==="rule_evaluation_preview"?"Preview Result":e==="error"?"Errors":un(e):"Unknown event"}function gu(e){return e.event_stage==="gateway_decided"?"Decide Gateway":e.event_stage==="score_updated"?"Update Gateway":e.event_stage==="rule_applied"?"Rule Evaluate":e.event_stage==="preview_evaluated"||e.event_type==="rule_evaluation_preview"?"Preview Result":e.event_type==="error"?"Errors":un(e.event_stage||e.event_type)}function sx(e){return e.event_type==="decision"||e.event_stage==="gateway_decided"?"Decide Gateway":e.event_type==="rule_hit"||e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="gateway_update"||e.event_stage==="score_updated"?"Update Gateway":e.event_type==="rule_evaluation_preview"||e.event_stage==="preview_evaluated"?"Preview":"Errors"}function Qd(e){const t=(e.status||"").toUpperCase();return e.event_type==="error"||t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":e.event_type==="rule_hit"?"purple":t==="CHARGED"||t==="AUTHORIZED"||t==="SUCCESS"?"green":e.event_type==="rule_evaluation_preview"?"purple":e.event_type==="gateway_update"?"green":e.event_type==="decision"?"blue":"orange"}function rA(e){const t=(e||"").toUpperCase();return t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":t==="SUCCESS"||t==="CHARGED"||t==="AUTHORIZED"?"green":"gray"}function nA(e){return e==="Decide Gateway"?"blue":e==="Rule Evaluate"||e==="Preview"?"purple":e==="Update Gateway"?"green":e==="Errors"?"red":"gray"}function nu(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function nv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}function L$(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function pce(e,t){return`/analytics/payment-audit?${D$({scope:"current",range:"24h",page:1,page_size:25,merchant_id:e,payment_id:t})}`}function hce(e,t){return`/analytics/preview-trace?${D$({scope:"current",range:"24h",page:1,page_size:25,merchant_id:e,payment_id:t})}`}function aA(e){if(!e)return null;const t=nu(e.details_json)?e.details_json:{},r=t.response??t.response_payload??t.result??t.output??null,n=t.request??t.request_payload??t.input??t.payload??nv({payment_id:e.payment_id,request_id:e.request_id,payment_method_type:e.payment_method_type,payment_method:e.payment_method,gateway:e.gateway}),a=r??nv({event_type:e.event_type,status:e.status,error_code:e.error_code,error_message:e.error_message,score_value:e.score_value,sigma_factor:e.sigma_factor,average_latency:e.average_latency,tp99_latency:e.tp99_latency,transaction_count:e.transaction_count,rule_name:e.rule_name,routing_approach:e.routing_approach}),i=nu(r)?r:null,o=nu(i==null?void 0:i.decided_gateway)?i.decided_gateway:null,s=t.score_context??(o?o.gateway_priority_map:null)??(i?i.gateway_priority_map:null)??null,l=t.selection_reason??null,u=[{label:"Phase",value:sx(e)},{label:"Stage",value:gu(e)},{label:"Route",value:vu(e.route)},{label:"Timestamp",value:yu(e.created_at_ms)},...e.merchant_id?[{label:"Merchant",value:e.merchant_id}]:[],...e.payment_id?[{label:"Payment ID",value:e.payment_id}]:[],...e.request_id?[{label:"Request ID",value:e.request_id}]:[],...e.gateway?[{label:"Gateway",value:e.gateway}]:[],...e.status?[{label:"Status",value:un(e.status)}]:[]],f=nv(Object.fromEntries(Object.entries(t).filter(([d])=>!["request","request_payload","input","payload","response","response_payload","result","output","score_context","selection_reason"].includes(d))));return{summaryRows:u,requestPayload:nu(n)&&!Object.keys(n).length?null:n,responsePayload:nu(a)&&!Object.keys(a).length?null:a,scoreContext:s,selectionReason:l,signalRecord:Object.keys(f).length?f:null,rawEvent:{...e,details_json:e.details_json}}}function iA(e){return e?"bg-brand-600 text-white":"bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]"}function xu({title:e,body:t}){return c.jsxs("div",{className:"rounded-[22px] border border-dashed border-slate-200 bg-slate-50/80 px-6 py-12 text-center dark:border-[#1f1f26] dark:bg-[#0b0b0f]",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function oA({rows:e}){return e.length?c.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(t=>c.jsxs("div",{className:"rounded-[20px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:t.label}),c.jsx("p",{className:"mt-2 break-words text-sm text-slate-900 dark:text-white",children:t.value})]},`${t.label}-${t.value}`))}):null}function da({title:e,value:t,emptyMessage:r}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{children:c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e})}),t?c.jsx("pre",{className:"overflow-x-auto rounded-[22px] bg-slate-950 px-4 py-4 text-xs leading-6 text-slate-200",children:L$(t)}):c.jsx(xu,{title:`No ${e.toLowerCase()} captured`,body:r})]})}function mce(){var Nw,Cw,Tw,$w,Iw,Rw,Mw,Dw;const{merchantId:e}=aa(),{routingKeysConfig:t,isLoading:r,error:n}=VP(),a=Object.keys(t).length>0,i=!r&&(!a||!!n),[o,s]=j.useState("single"),[l,u]=j.useState({amount:"1000",currency:"",payment_method_type:"",payment_method:"",card_brand:"",auth_type:"",eligible_gateways:"stripe, adyen",ranking_algorithm:"SR_BASED_ROUTING",elimination_enabled:!1}),[f,d]=j.useState({totalPayments:"10",successCount:"7",failureCount:"3"}),[p,h]=j.useState([{key:"payment_method_type",type:"enum_variant",value:"",metadataKey:""},{key:"currency",type:"enum_variant",value:"",metadataKey:""}]),[g,y]=j.useState([{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}]),[v,x]=j.useState("100"),[m,w]=j.useState(null),[S,b]=j.useState(null),[_,O]=j.useState("CHARGED"),[k,A]=j.useState(null),[$,T]=j.useState([]),[P,R]=j.useState([]),[L,z]=j.useState(!1),[W,V]=j.useState(null),[D,U]=j.useState(!1),[q,J]=j.useState(!1),[K,ae]=j.useState(!1),[Q,be]=j.useState(!1),[ue,Ce]=j.useState(null),[Fe,te]=j.useState(null),[ie,he]=j.useState("summary"),[X,Ee]=j.useState(null),[ve,Pe]=j.useState(null),[ze,ge]=j.useState("summary"),[$e,Le]=j.useState("Rule Evaluation Preview"),Oe=j.useMemo(()=>Object.keys(t).sort(),[t]),Ge=j.useMemo(()=>{var I;return bf(((I=t.payment_method)==null?void 0:I.values)||[])},[t]),H=j.useMemo(()=>{var F;const I=l.payment_method_type.toLowerCase();return bf(((F=t[I])==null?void 0:F.values)||[])},[l.payment_method_type,t]),E=j.useMemo(()=>{var I;return tv(((I=t.currency)==null?void 0:I.values)||[])},[t]),M=j.useMemo(()=>{var I;return tv(((I=t.card_network)==null?void 0:I.values)||[])},[t]),N=j.useMemo(()=>{var I;return tv(((I=t.authentication_type)==null?void 0:I.values)||[])},[t]),B=e&&ue?pce(e,ue):null,G=ar(B,wi,{refreshInterval:ue?12e3:0,revalidateOnFocus:!0}),ee=e&&X?hce(e,X):null,Z=ar(ee,wi,{refreshInterval:X?12e3:0,revalidateOnFocus:!0});j.useEffect(()=>{i||r||(u(I=>{var de;const F={...I};E.length>0&&!E.includes(F.currency)&&(F.currency=E[0]),Ge.length>0&&!Ge.includes(F.payment_method_type)&&(F.payment_method_type=Ge[0]);const se=bf(((de=t[F.payment_method_type.toLowerCase()])==null?void 0:de.values)||[]);return se.length>0&&!se.includes(F.payment_method)&&(F.payment_method=se[0]),N.length>0&&!N.includes(F.auth_type)&&(F.auth_type=N[0]),M.length>0&&!M.includes(F.card_brand)&&(F.card_brand=M[0]),F}),h(I=>I.map(F=>{if(!F.key||!t[F.key])return F;const se=t[F.key],de=rv(se.type),st=se.values||[],br=de==="enum_variant"?st.includes(F.value)?F.value:st[0]||"":F.value;return{...F,type:de,value:br}})))},[i,r,t,E,Ge,N,M]),j.useEffect(()=>{if(!ue&&!X)return;const I=document.body.style.overflow,F=se=>{se.key==="Escape"&&(Ce(null),te(null),he("summary"),Ee(null),Pe(null),ge("summary"))};return document.body.style.overflow="hidden",window.addEventListener("keydown",F),()=>{document.body.style.overflow=I,window.removeEventListener("keydown",F)}},[ue,X]);function me(I,F){u(se=>({...se,[I]:F}))}function Te(){var st;if(Oe.length===0)return;const I=Oe[0],F=t[I],se=rv(F==null?void 0:F.type),de=se==="enum_variant"&&((st=F==null?void 0:F.values)==null?void 0:st[0])||"";h([...p,{key:I,type:se,value:de,metadataKey:""}])}function Et(I){h(p.filter((F,se)=>se!==I))}function Tt(I,F,se){h(p.map((de,st)=>st===I?{...de,[F]:se}:de))}function Xt(I,F){h(p.map((se,de)=>de===I?{...se,metadataKey:F}:se))}function zi(I,F){var br;const se=t[F],de=rv(se==null?void 0:se.type),st=de==="enum_variant"&&((br=se==null?void 0:se.values)==null?void 0:br[0])||"";h(p.map((Qt,qa)=>qa===I?{...Qt,key:F,type:de,value:st,metadataKey:""}:Qt))}function Wa(){y([...g,{gateway_name:"",gateway_id:""}])}function Bi(I){y(g.filter((F,se)=>se!==I))}function Ui(I,F,se){y(g.map((de,st)=>st===I?{...de,[F]:se}:de))}async function Vi(){if(!e)return V("Set a merchant ID in the top bar");if(i)return V("Routing key config unavailable. Fix /config/routing-keys and retry.");U(!0),V(null),b(null);const I=l.eligible_gateways.split(",").map(se=>se.trim()).filter(Boolean),F=`explorer_${Date.now()}`;try{const se=await bt("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:F,amount:parseFloat(l.amount)||1e3,currency:l.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:l.payment_method_type,paymentMethod:l.payment_method,authType:l.auth_type,cardBrand:l.card_brand},eligibleGatewayList:I,rankingAlgorithm:l.ranking_algorithm,eliminationEnabled:l.elimination_enabled});await bt("/update-gateway-score",{merchantId:e,gateway:se.decided_gateway,gatewayReferenceId:null,status:_,paymentId:F,enforceDynamicRoutingFailure:null}),w(se),b(F)}catch(se){V(se instanceof Error?se.message:"Request failed")}finally{U(!1)}}async function Ml(){if(!e)return V("Set a merchant ID in the top bar");if(i)return V("Routing key config unavailable. Fix /config/routing-keys and retry.");const I=parseInt(f.totalPayments)||0,F=parseInt(f.successCount)||0,se=parseInt(f.failureCount)||0;if(I<=0)return V("Total Payments must be greater than 0");if(F+se!==I)return V("Success + Failure count must equal Total Payments");z(!0),V(null),R([]);const de=l.eligible_gateways.split(",").map(Qt=>Qt.trim()).filter(Boolean),st=[],br=[...Array(F).fill("CHARGED"),...Array(se).fill("FAILURE")];for(let Qt=br.length-1;Qt>0;Qt--){const qa=Math.floor(Math.random()*(Qt+1));[br[Qt],br[qa]]=[br[qa],br[Qt]]}try{for(let Qt=0;Qt{de.key&&(de.type==="metadata_variant"?F[de.key]={type:de.type,value:{key:de.metadataKey||de.key,value:de.value}}:de.type==="number"?F[de.key]={type:de.type,value:parseFloat(de.value)||0}:F[de.key]={type:de.type,value:de.value})});const se=await bt("/routing/evaluate",{created_by:e||"test_user",payment_id:I,fallback_output:g.filter(de=>de.gateway_name),parameters:F});if(A(se),se.output.type==="volume_split"&&se.output.splits){const de=parseInt(v)||100,st=se.output.splits.map(br=>({name:br.connector.gateway_name,count:Math.round(br.split/100*de),percentage:br.split}));T(st)}}catch(F){V(F instanceof Error?F.message:"Request failed")}finally{U(!1)}}async function Yt(){U(!0),V(null),T([]);const I=`volume_preview_${Date.now()}`;try{const F=await bt("/routing/evaluate",{created_by:e||"test_user",payment_id:I,fallback_output:[{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}],parameters:{}});if(A(F),F.output.type==="volume_split"&&F.output.splits){const se=parseInt(v)||100,de=F.output.splits.map(st=>({name:st.connector.gateway_name,count:Math.round(st.split/100*se),percentage:st.split}));T(de)}}catch(F){V(F instanceof Error?F.message:"Request failed")}finally{U(!1)}}const Zt=m!=null&&m.gateway_priority_map?Object.entries(m.gateway_priority_map).sort(([,I],[,F])=>F-I).map(([I,F])=>({name:I,score:Math.round(F*1e3)/10})):[],cr=P.reduce((I,F)=>(I[F.decidedGateway]||(I[F.decidedGateway]={total:0,success:0,failure:0}),I[F.decidedGateway].total++,F.status==="CHARGED"?I[F.decidedGateway].success++:I[F.decidedGateway].failure++,I),{}),jn=$.map(I=>({name:I.name,value:I.count})),Nr=j.useMemo(()=>fce($,parseInt(v)||0),[$,v]),ut=j.useMemo(()=>{var F;const I=((F=G.data)==null?void 0:F.results)||[];return I.find(se=>se.payment_id===ue)||I[0]||null},[(Nw=G.data)==null?void 0:Nw.results,ue]),Ue=j.useMemo(()=>{var F;const I=((F=G.data)==null?void 0:F.timeline)||[];return I.find(se=>se.id===Fe)||I[0]||null},[(Cw=G.data)==null?void 0:Cw.timeline,Fe]);j.useEffect(()=>{var F,se;if(Ue!=null&&Ue.id){te(Ue.id);return}const I=(se=(F=G.data)==null?void 0:F.timeline)==null?void 0:se[0];I!=null&&I.id&&te(I.id)},[(Tw=G.data)==null?void 0:Tw.timeline,Ue==null?void 0:Ue.id]);const la=j.useMemo(()=>{var F;const I=[];for(const se of((F=G.data)==null?void 0:F.timeline)||[]){const de=sx(se),st=I[I.length-1];!st||st.phase!==de?I.push({phase:de,events:[se]}):st.events.push(se)}return I},[($w=G.data)==null?void 0:$w.timeline]),ot=j.useMemo(()=>aA(Ue),[Ue]),Pt=j.useMemo(()=>{var F;const I=((F=Z.data)==null?void 0:F.results)||[];return I.find(se=>se.payment_id===X)||I[0]||null},[(Iw=Z.data)==null?void 0:Iw.results,X]),Ve=j.useMemo(()=>{var F;const I=((F=Z.data)==null?void 0:F.timeline)||[];return I.find(se=>se.id===ve)||I[0]||null},[(Rw=Z.data)==null?void 0:Rw.timeline,ve]);j.useEffect(()=>{var F,se;if(Ve!=null&&Ve.id){Pe(Ve.id);return}const I=(se=(F=Z.data)==null?void 0:F.timeline)==null?void 0:se[0];I!=null&&I.id&&Pe(I.id)},[(Mw=Z.data)==null?void 0:Mw.timeline,Ve==null?void 0:Ve.id]);const rn=j.useMemo(()=>{var F;const I=[];for(const se of((F=Z.data)==null?void 0:F.timeline)||[]){const de=sx(se),st=I[I.length-1];!st||st.phase!==de?I.push({phase:de,events:[se]}):st.events.push(se)}return I},[(Dw=Z.data)==null?void 0:Dw.timeline]),nn=j.useMemo(()=>aA(Ve),[Ve]);function Ha(I){Ee(null),Pe(null),ge("summary"),Ce(I),te(null),he("summary")}function On(){Ce(null),te(null),he("summary")}function Ga(I,F){Ce(null),te(null),he("summary"),Le(F),Ee(I),Pe(null),ge("summary")}function zo(){Ee(null),Pe(null),ge("summary")}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Decision Explorer"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split."})]}),c.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-[#1c1c24]",children:[c.jsx("button",{onClick:()=>s("single"),className:`px-4 py-2 text-sm font-medium ${o==="single"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Single Test"}),c.jsx("button",{onClick:()=>s("batch"),className:`px-4 py-2 text-sm font-medium ${o==="batch"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Batch Simulation"}),c.jsx("button",{onClick:()=>s("rule"),className:`px-4 py-2 text-sm font-medium ${o==="rule"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Rule-Based"}),c.jsx("button",{onClick:()=>s("volume"),className:`px-4 py-2 text-sm font-medium ${o==="volume"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Volume Split"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:o==="rule"?"Rule Evaluation Parameters":o==="volume"?"Volume Split Configuration":"Payment Parameters"})}),c.jsxs(Ae,{className:"space-y-3",children:[!e&&o!=="volume"&&c.jsx("p",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar first."}),o!=="volume"&&r&&c.jsx("p",{className:"text-xs text-slate-600 bg-slate-50 border border-slate-200 rounded px-3 py-2",children:"Loading routing config from backend..."}),o!=="volume"&&i&&c.jsx(Gr,{error:"Routing config unavailable from /config/routing-keys. Parameter forms are disabled."}),o==="rule"?c.jsxs(c.Fragment,{children:[r&&c.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),i&&c.jsx(Gr,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Evaluation is disabled."}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Parameters"}),c.jsx("div",{className:"space-y-2",children:p.map((I,F)=>{var se;return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx("select",{value:I.key,onChange:de=>zi(F,de.target.value),disabled:i||r,className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Oe.length===0?c.jsx("option",{value:"",children:"No keys available"}):Oe.map(de=>c.jsx("option",{value:de,children:de},de))}),c.jsx("input",{value:I.type,readOnly:!0,className:"w-36 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>Et(F),className:"p-1.5 text-slate-400 hover:text-red-500",children:c.jsx(Ca,{size:14})})]}),I.type==="metadata_variant"?c.jsxs("div",{className:"flex gap-2 items-center pl-1",children:[c.jsx("input",{placeholder:"Metadata Key",value:I.metadataKey||"",onChange:de=>Xt(F,de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{placeholder:"Metadata Value",value:I.value,onChange:de=>Tt(F,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}):I.type==="enum_variant"?c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("select",{value:I.value,onChange:de=>Tt(F,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(((se=t[I.key])==null?void 0:se.values)||[]).map(de=>c.jsx("option",{value:de,children:de},de))})}):I.type==="number"?c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("input",{type:"number",placeholder:"Value",value:I.value,onChange:de=>Tt(F,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})}):c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("input",{placeholder:"Value",value:I.value,onChange:de=>Tt(F,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})})]},F)})}),c.jsxs("button",{onClick:Te,disabled:i||r||Oe.length===0,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[c.jsx(ki,{size:12})," Add Parameter"]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Fallback gateway_name/gateway_id"}),c.jsx("div",{className:"space-y-2",children:g.map((I,F)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx("input",{placeholder:"gateway_name",value:I.gateway_name,onChange:se=>Ui(F,"gateway_name",se.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{placeholder:"gateway_id",value:I.gateway_id||"",onChange:se=>Ui(F,"gateway_id",se.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>Bi(F),className:"p-1.5 text-slate-400 hover:text-red-500",children:c.jsx(Ca,{size:14})})]},F))}),c.jsxs("button",{onClick:Wa,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[c.jsx(ki,{size:12})," Add Gateway"]})]})]}):o==="volume"?c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Number of Payments"}),c.jsx("input",{type:"text",value:v,onChange:I=>x(I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Enter the total number of payments to visualize how they would be distributed across gateways."})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Amount"}),c.jsx("input",{value:l.amount,onChange:I=>me("amount",I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Currency"}),c.jsx("select",{value:l.currency,onChange:I=>me("currency",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:E.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method Type"}),c.jsx("select",{value:l.payment_method_type,onChange:I=>me("payment_method_type",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Ge.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method"}),c.jsx("select",{value:l.payment_method,onChange:I=>me("payment_method",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:H.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Card Brand"}),c.jsx("select",{value:l.card_brand,onChange:I=>me("card_brand",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:M.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Auth Type"}),c.jsx("select",{value:l.auth_type,onChange:I=>me("auth_type",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:N.map(I=>c.jsx("option",{children:I},I))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Eligible Gateways (comma-separated)"}),c.jsx("input",{value:l.eligible_gateways,onChange:I=>me("eligible_gateways",I.target.value),placeholder:"stripe, adyen",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Algorithm"}),c.jsx("select",{value:l.ranking_algorithm,onChange:I=>me("ranking_algorithm",I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:lce.map(I=>c.jsx("option",{value:I,children:uce[I]},I))})]}),c.jsx("div",{className:"flex items-end pb-1",children:c.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:l.elimination_enabled,onChange:I=>me("elimination_enabled",I.target.checked),className:"rounded"}),"Elimination enabled"]})})]}),o==="single"&&c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Transaction Outcome"}),c.jsxs("select",{value:_,onChange:I=>O(I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:[c.jsx("option",{value:"CHARGED",children:"Success (CHARGED)"}),c.jsx("option",{value:"FAILURE",children:"Failure (FAILURE)"})]}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"After deciding the gateway, single test will post feedback with this outcome so the payment appears in Decision Audit."})]}),o==="batch"&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-4 mt-4 space-y-3",children:[c.jsxs("h3",{className:"text-sm font-medium text-slate-800 flex items-center gap-2",children:[c.jsx(vf,{size:14}),"Simulation Configuration"]}),c.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Total Payments"}),c.jsx("input",{type:"text",value:f.totalPayments,onChange:I=>d(F=>({...F,totalPayments:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Success Count"}),c.jsx("input",{type:"text",value:f.successCount,onChange:I=>d(F=>({...F,successCount:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Failure Count"}),c.jsx("input",{type:"text",value:f.failureCount,onChange:I=>d(F=>({...F,failureCount:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),c.jsxs("p",{className:"text-xs text-slate-500",children:["Will run ",f.totalPayments||0," payments: ",f.successCount||0," SUCCESS, ",f.failureCount||0," FAILURE"]})]})]}),c.jsx(Gr,{error:W}),o==="rule"?c.jsx(Ie,{onClick:Fo,disabled:D||i,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Evaluating…"]}):c.jsxs(c.Fragment,{children:[c.jsx($d,{size:14})," Evaluate Rules"]})}):o==="volume"?c.jsx(Ie,{onClick:Yt,disabled:D,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Calculating…"]}):c.jsxs(c.Fragment,{children:[c.jsx(Xf,{size:14})," Visualize Distribution"]})}):o==="batch"?c.jsx(Ie,{onClick:Ml,disabled:L||!e||i,className:"w-full justify-center",children:L?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14}),"Simulating ",P.length,"/",f.totalPayments||0,"..."]}):c.jsxs(c.Fragment,{children:[c.jsx(vf,{size:14})," Run Batch Simulation"]})}):c.jsx(Ie,{onClick:Vi,disabled:D||!e||i,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Running…"]}):c.jsxs(c.Fragment,{children:[c.jsx($d,{size:14})," Run Single Transaction"]})})]})]}),c.jsx("div",{className:"space-y-4",children:o==="volume"?$.length>0?c.jsxs(c.Fragment,{children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Volume Distribution Overview"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Preview only. This uses the active routing rule and stores a trace for inspection."})]}),k!=null&&k.payment_id?c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>Ga(k.payment_id,"Volume Split Preview"),children:"View preview trace"}):null]})}),c.jsxs(Ae,{children:[c.jsxs("div",{className:"text-center mb-4",children:[c.jsx("p",{className:"text-3xl font-bold text-slate-900",children:v}),c.jsx("p",{className:"text-xs text-slate-500",children:"Total Payments"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4",children:$.map((I,F)=>c.jsxs("div",{className:"bg-slate-50 dark:bg-[#111114] rounded-lg p-3",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:Cr[F%Cr.length]}}),c.jsx("span",{className:"font-medium text-sm",children:I.name})]}),c.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[c.jsxs("span",{children:[I.percentage,"%"]}),c.jsxs("span",{className:"font-medium text-slate-700",children:[I.count," payments"]})]})]},F))})]})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Pie Chart"})}),c.jsx(Ae,{children:c.jsx(ks,{width:"100%",height:250,children:c.jsxs(M$,{children:[c.jsx(sa,{data:jn,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:I,percent:F})=>`${I} ${(F*100).toFixed(0)}%`,labelLine:!1,children:jn.map((I,F)=>c.jsx(co,{fill:Cr[F%Cr.length]},`cell-${F}`))}),c.jsx(_r,{formatter:I=>[`${I} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}})]})})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Bar Chart"})}),c.jsx(Ae,{children:c.jsx(ks,{width:"100%",height:$.length*50+40,children:c.jsxs(Jk,{data:$,layout:"vertical",margin:{left:20,right:40},children:[c.jsx(Ma,{type:"number",tick:{fontSize:12,fill:"#666"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),c.jsx(Da,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#666"},width:80,axisLine:!1,tickLine:!1}),c.jsx(_r,{formatter:I=>[`${I} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}}),c.jsx(Ni,{dataKey:"count",radius:[0,6,6,0],children:$.map((I,F)=>c.jsx(co,{fill:Cr[F%Cr.length]},`cell-${F}`))})]})})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Percentage Distribution"})}),c.jsxs(Ae,{children:[c.jsx("div",{className:"h-4 rounded-full overflow-hidden flex",children:$.map((I,F)=>c.jsx("div",{style:{width:`${I.percentage}%`,backgroundColor:Cr[F%Cr.length]},className:"h-full transition-all duration-300",title:`${I.name}: ${I.percentage}%`},F))}),c.jsx("div",{className:"flex flex-wrap gap-3 mt-3",children:$.map((I,F)=>c.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:Cr[F%Cr.length]}}),c.jsx("span",{className:"text-slate-600",children:I.name}),c.jsxs("span",{className:"font-medium",children:[I.percentage,"%"]})]},F))})]})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Summary"})}),c.jsx(Ae,{className:"p-0",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"}),c.jsx("th",{className:"text-right px-4 py-2",children:"Payments"}),c.jsx("th",{className:"text-right px-4 py-2",children:"Percentage"})]})}),c.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:[$.map((I,F)=>c.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:Cr[F%Cr.length]}}),c.jsx("span",{className:"font-medium",children:I.name})]})}),c.jsx("td",{className:"px-4 py-2 text-right font-medium",children:I.count}),c.jsxs("td",{className:"px-4 py-2 text-right text-slate-500",children:[I.percentage,"%"]})]},F)),c.jsxs("tr",{className:"bg-slate-50 dark:bg-[#111114] font-medium",children:[c.jsx("td",{className:"px-4 py-2",children:"Total"}),c.jsx("td",{className:"px-4 py-2 text-right",children:v}),c.jsx("td",{className:"px-4 py-2 text-right",children:"100%"})]})]})]})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Projected Sequence"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Preview-only projection based on the configured split. This is not a live payment trail."})]})}),c.jsx(Ae,{className:"p-0 max-h-80 overflow-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500 sticky top-0",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2 w-20",children:"#"}),c.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:Nr.map((I,F)=>c.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[c.jsx("td",{className:"px-4 py-1.5 text-slate-500 font-mono text-xs",children:F+1}),c.jsx("td",{className:"px-4 py-1.5",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2 h-2 rounded",style:{backgroundColor:Cr[I.colorIdx%Cr.length]}}),c.jsx("span",{className:"font-medium",children:I.connector})]})})]},`${I.connector}-${F}`))})]})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("button",{onClick:()=>be(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ry,{size:14}),"API Response"]}),Q?c.jsx(fu,{size:14}):c.jsx(du,{size:14})]})}),Q&&k&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(k,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx(Xf,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Enter the number of payments and click "Visualize Distribution" to see how payments are split across gateways.'})]})}):o==="rule"?k?c.jsxs(c.Fragment,{children:[c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Status"}),c.jsx("p",{className:"text-2xl font-bold text-slate-900",children:k.status}),c.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["output_type: ",k.output.type]})]}),k.payment_id?c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>Ga(k.payment_id,"Rule Evaluation Preview"),children:"View preview trace"}):null]}),k.output.type==="single"&&k.output.connector&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Selected gateway_name"}),c.jsx("p",{className:"text-lg font-semibold",children:k.output.connector.gateway_name}),k.output.connector.gateway_id&&c.jsxs("p",{className:"text-xs text-slate-500",children:["gateway_id: ",k.output.connector.gateway_id]})]}),k.output.type==="priority"&&k.output.connectors&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Priority gateway_name list"}),c.jsx("div",{className:"space-y-1",children:k.output.connectors.map((I,F)=>c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-500 text-white text-xs flex items-center justify-center",children:F+1}),c.jsx("span",{className:"font-medium",children:I.gateway_name}),I.gateway_id&&c.jsxs("span",{className:"text-xs text-slate-500",children:["(",I.gateway_id,")"]})]},F))})]}),k.output.type==="volume_split"&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Volume Split Result"}),c.jsx("p",{className:"text-sm text-slate-600",children:"See Volume Split tab for detailed visualization."})]})]})}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("button",{onClick:()=>ae(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ry,{size:14}),"API Response"]}),K?c.jsx(fu,{size:14}):c.jsx(du,{size:14})]})}),K&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(k,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx($d,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Configure rule parameters and click "Evaluate Rules" to test routing.'})]})}):o==="batch"?P.length>0?c.jsxs(c.Fragment,{children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Simulation Progress"})}),c.jsxs(Ae,{children:[c.jsxs("div",{className:"mb-4",children:[c.jsxs("div",{className:"flex justify-between text-xs text-slate-600 mb-1",children:[c.jsx("span",{children:"Progress"}),c.jsxs("span",{children:[Math.round(P.length/(parseInt(f.totalPayments)||1)*100),"%"]})]}),c.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:c.jsx("div",{className:"bg-brand-500 h-2 rounded-full transition-all duration-300",style:{width:`${P.length/(parseInt(f.totalPayments)||1)*100}%`}})})]}),Object.keys(cr).length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-xs font-medium text-slate-700",children:"Gateway Selection Summary"}),Object.entries(cr).map(([I,F])=>c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"font-medium",children:I}),c.jsxs("div",{className:"flex gap-3 text-xs",children:[c.jsxs("span",{className:"text-emerald-600",children:[F.success," ✓"]}),c.jsxs("span",{className:"text-red-500",children:[F.failure," ✗"]}),c.jsxs("span",{className:"text-slate-500",children:["(",F.total," total)"]})]})]},I))]})]})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Transaction Log"})}),c.jsx(Ae,{className:"p-0 max-h-96 overflow-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 sticky top-0",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-3 py-2",children:"#"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Payment ID"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Gateway"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Outcome"})]})}),c.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:P.map((I,F)=>c.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16]",children:[c.jsx("td",{className:"px-3 py-2 text-slate-500",children:F+1}),c.jsx("td",{className:"px-3 py-2",children:c.jsxs("button",{type:"button",title:I.paymentId,onClick:()=>Ha(I.paymentId),className:"group flex items-start gap-3 text-left",children:[c.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-brand-500/10 text-[11px] font-semibold uppercase tracking-[0.16em] text-brand-600 dark:text-brand-300",children:F+1}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block truncate font-mono text-xs font-semibold text-slate-900 transition group-hover:text-brand-600 dark:text-white",children:I.paymentId}),c.jsx("span",{className:"mt-1 block text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-400 transition group-hover:text-brand-500",children:"View audit"})]})]})}),c.jsx("td",{className:"px-3 py-2 font-medium",children:I.decidedGateway}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(_e,{variant:I.status==="CHARGED"?"green":"red",children:I.status})})]},I.paymentId))})]})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx(vf,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.'})]})}):m?c.jsxs(c.Fragment,{children:[c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Decided Gateway"}),c.jsx("p",{className:"text-3xl font-bold text-slate-900",children:m.decided_gateway})]}),c.jsxs("div",{className:"text-right space-y-2",children:[c.jsx("div",{children:c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${cce(m.routing_approach)}`,children:m.routing_approach})}),S?c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>Ha(S),children:"View audit"}):null,m.is_scheduled_outage&&c.jsx(_e,{variant:"red",children:"Scheduled Outage"}),S?c.jsx(_e,{variant:_==="CHARGED"?"green":"red",children:_}):null,m.latency!=null&&c.jsxs("p",{className:"text-xs text-slate-400",children:[m.latency,"ms"]})]})]}),S?c.jsxs("div",{className:"mb-3 rounded-[18px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Payment ID"}),c.jsx("p",{className:"mt-2 font-mono text-sm text-slate-900 dark:text-white",children:S}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:["Feedback recorded as ",_,". Open audit to inspect the full decide and update flow."]})]}):null,m.routing_dimension&&c.jsxs("div",{className:"flex gap-4 text-sm text-slate-600 border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Dimension"}),c.jsx("p",{className:"font-medium",children:m.routing_dimension})]}),m.routing_dimension_level&&c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Level"}),c.jsx("p",{className:"font-medium",children:m.routing_dimension_level})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Reset"}),c.jsx("p",{className:"font-medium",children:m.reset_approach})]})]})]})}),Zt.length>0&&c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Scores"}),c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:Vi,className:"text-xs",children:[c.jsx(ny,{size:12})," Refresh"]})]})}),c.jsx(Ae,{children:c.jsx(ks,{width:"100%",height:Zt.length*40+20,children:c.jsxs(Jk,{data:Zt,layout:"vertical",margin:{left:10,right:30},children:[c.jsx(Ma,{type:"number",domain:[0,100],tickFormatter:I=>`${I}%`,tick:{fontSize:11,fill:"#66667a"},axisLine:{stroke:"#1c1c24"},tickLine:!1}),c.jsx(Da,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#8e8ea0"},width:60,axisLine:!1,tickLine:!1}),c.jsx(_r,{formatter:I=>`${I}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),c.jsx(Ni,{dataKey:"score",radius:[0,4,4,0],children:Zt.map((I,F)=>c.jsx(co,{fill:I.name===m.decided_gateway?"#0069ED":I.score<30?"#ef4444":I.score<60?"#f59e0b":"#10b981"},F))})]})})})]}),m.filter_wise_gateways&&c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("button",{onClick:()=>J(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:["Filter Chain",q?c.jsx(fu,{size:14}):c.jsx(du,{size:14})]})}),q&&c.jsx(Ae,{className:"space-y-2",children:Object.entries(m.filter_wise_gateways).map(([I,F])=>c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:"text-xs font-mono bg-slate-100 dark:bg-[#111118] text-slate-600 rounded-md px-2 py-0.5 mt-0.5 shrink-0 border border-slate-200 dark:border-[#1c1c24]",children:I}),c.jsx("div",{className:"flex flex-wrap gap-1",children:Array.isArray(F)?F.map(se=>c.jsx("span",{className:"text-xs bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20 rounded-md px-2 py-0.5",children:se},se)):c.jsx("span",{className:"text-xs text-slate-400",children:"—"})})]},I))})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("button",{onClick:()=>ae(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ry,{size:14}),"API Response"]}),K?c.jsx(fu,{size:14}):c.jsx(du,{size:14})]})}),K&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(m,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx($d,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Fill in the parameters and click "Run Single Transaction" to decide a gateway, post feedback, and inspect the audit trail.'})]})})})]}),ue&&c.jsxs("div",{className:"fixed bottom-0 left-64 right-0 top-[76px] z-[130] p-8",children:[c.jsx("button",{type:"button","aria-label":"Close payment audit",className:"absolute inset-0 bg-slate-950/70 backdrop-blur-sm",onClick:On}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"decision-explorer-audit-title",className:"relative mx-auto flex h-full w-full max-w-7xl flex-col overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-2xl dark:border-[#1c1c23] dark:bg-[#09090d]",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-slate-200 bg-slate-50/90 px-6 py-5 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-[#8a8a93]",children:"Batch Simulation Audit"}),c.jsx("h2",{id:"decision-explorer-audit-title",className:"mt-2 truncate text-2xl font-semibold text-slate-900 dark:text-white",children:ue}),c.jsx("p",{className:"mt-2 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:"Inspect the exact decision trail for this simulated payment, including request payloads, API responses, score context, and the final transaction outcome."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ut!=null&&ut.latest_gateway?c.jsx(_e,{variant:"green",children:ut.latest_gateway}):null,ut!=null&&ut.latest_status?c.jsx(_e,{variant:rA(ut.latest_status),children:un(ut.latest_status)}):null,ut!=null&&ut.event_count?c.jsxs(_e,{variant:"gray",children:[ut.event_count," events"]}):null,c.jsxs(Ie,{size:"sm",variant:"secondary",onClick:()=>G.mutate(),children:[c.jsx(ny,{size:12}),"Refresh"]}),c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:On,children:[c.jsx(a_,{size:14}),"Close"]})]})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 gap-0 xl:grid-cols-[340px_minmax(0,1fr)]",children:[c.jsxs("div",{className:"flex min-h-0 flex-col border-b border-slate-200 bg-slate-50/70 xl:border-b-0 xl:border-r dark:border-[#1c1c23] dark:bg-[#08080b]",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"Audit Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Choose a step to inspect its request, response, and scoring context."})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:G.isLoading&&!G.data?c.jsxs("div",{className:"flex items-center gap-2 px-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading payment audit…"]}):G.error?c.jsx(Gr,{error:G.error.message}):la.length?c.jsx("div",{className:"space-y-4",children:la.map(I=>c.jsxs("section",{className:"space-y-2",children:[c.jsx("div",{className:"px-2",children:c.jsx(_e,{variant:nA(I.phase),children:I.phase})}),c.jsx("div",{className:"space-y-2",children:I.events.map(F=>c.jsxs("button",{type:"button",onClick:()=>{te(F.id),he("summary")},className:`w-full rounded-[22px] border px-4 py-3 text-left transition ${(Ue==null?void 0:Ue.id)===F.id?"border-brand-500/50 bg-brand-500/8":"border-slate-200 bg-white hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#0c0c10] dark:hover:border-[#2a2a31]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:gu(F)}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:yu(F.created_at_ms)})]}),c.jsx(_e,{variant:Qd(F),children:un(F.status)||tA(F.event_type)})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(_e,{variant:"gray",children:vu(F.route)}),F.gateway?c.jsx(_e,{variant:"green",children:F.gateway}):null,F.request_id?c.jsx(_e,{variant:"blue",children:"Request"}):null]})]},F.id))})]},I.phase))}):c.jsx(xu,{title:"No audit trail captured yet",body:"Run a simulated payment and gateway update first, then reopen the row once the audit payload is available."})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:Ue?gu(Ue):"Audit Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:Ue?`${vu(Ue.route)} · ${yu(Ue.created_at_ms)}`:"Select an event from the left to inspect payloads."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ue!=null&&Ue.gateway?c.jsx(_e,{variant:"green",children:Ue.gateway}):null,Ue!=null&&Ue.status?c.jsx(_e,{variant:Qd(Ue),children:un(Ue.status)}):null]})]}),c.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["summary","input","response","raw"].map(I=>c.jsx("button",{type:"button",onClick:()=>he(I),className:`rounded-full px-4 py-2 text-xs font-semibold uppercase tracking-[0.16em] transition ${iA(ie===I)}`,children:I==="raw"?"Raw JSON":un(I)},I))})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:G.isLoading&&!G.data?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading inspector…"]}):ot?c.jsxs("div",{className:"space-y-5",children:[ie==="summary"?c.jsxs(c.Fragment,{children:[c.jsx(oA,{rows:ot.summaryRows}),ot.selectionReason?c.jsxs("div",{className:"rounded-[22px] border border-slate-200 bg-slate-50/80 px-5 py-4 dark:border-[#1d1d23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Selection Reason"}),c.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-700 dark:text-slate-200",children:L$(ot.selectionReason)})]}):null,c.jsx(da,{title:"Score Context",value:ot.scoreContext,emptyMessage:"No scoring context was captured for this event."}),ot.signalRecord?c.jsx(da,{title:"Additional Signals",value:ot.signalRecord,emptyMessage:"No additional signals were captured for this event."}):null]}):null,ie==="input"?c.jsx(da,{title:"Request Payload",value:ot.requestPayload,emptyMessage:"This step did not persist a request payload."}):null,ie==="response"?c.jsx(da,{title:"Response Payload",value:ot.responsePayload,emptyMessage:"This step did not persist a response payload."}):null,ie==="raw"?c.jsx(da,{title:"Raw Event JSON",value:ot.rawEvent,emptyMessage:"No raw event payload is available."}):null]}):c.jsx(xu,{title:"Select a timeline step",body:"Choose one of the audit events on the left to inspect its request, response, and score context."})})]})]})]})]}),X&&c.jsxs("div",{className:"fixed bottom-0 left-64 right-0 top-[76px] z-[130] p-8",children:[c.jsx("button",{type:"button","aria-label":"Close preview trace",className:"absolute inset-0 bg-slate-950/70 backdrop-blur-sm",onClick:zo}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"decision-explorer-preview-title",className:"relative mx-auto flex h-full w-full max-w-7xl flex-col overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-2xl dark:border-[#1c1c23] dark:bg-[#09090d]",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-slate-200 bg-slate-50/90 px-6 py-5 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-[#8a8a93]",children:"Preview Trace"}),c.jsx("h2",{id:"decision-explorer-preview-title",className:"mt-2 truncate text-2xl font-semibold text-slate-900 dark:text-white",children:X}),c.jsxs("p",{className:"mt-2 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:[$e,". This is a preview-only trace captured from ",c.jsx("code",{className:"font-mono text-xs",children:"/routing/evaluate"}),", not a transaction outcome."]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Pt!=null&&Pt.latest_gateway?c.jsx(_e,{variant:"green",children:Pt.latest_gateway}):null,Pt!=null&&Pt.latest_status?c.jsx(_e,{variant:rA(Pt.latest_status),children:un(Pt.latest_status)}):null,Pt!=null&&Pt.event_count?c.jsxs(_e,{variant:"gray",children:[Pt.event_count," events"]}):null,c.jsxs(Ie,{size:"sm",variant:"secondary",onClick:()=>Z.mutate(),children:[c.jsx(ny,{size:12}),"Refresh"]}),c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:zo,children:[c.jsx(a_,{size:14}),"Close"]})]})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 gap-0 xl:grid-cols-[340px_minmax(0,1fr)]",children:[c.jsxs("div",{className:"flex min-h-0 flex-col border-b border-slate-200 bg-slate-50/70 xl:border-b-0 xl:border-r dark:border-[#1c1c23] dark:bg-[#08080b]",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"Preview Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Choose a preview step to inspect its request, response, and routing output."})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:Z.isLoading&&!Z.data?c.jsxs("div",{className:"flex items-center gap-2 px-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading preview trace…"]}):Z.error?c.jsx(Gr,{error:Z.error.message}):rn.length?c.jsx("div",{className:"space-y-4",children:rn.map(I=>c.jsxs("section",{className:"space-y-2",children:[c.jsx("div",{className:"px-2",children:c.jsx(_e,{variant:nA(I.phase),children:I.phase})}),c.jsx("div",{className:"space-y-2",children:I.events.map(F=>c.jsxs("button",{type:"button",onClick:()=>{Pe(F.id),ge("summary")},className:`w-full rounded-[22px] border px-4 py-3 text-left transition ${(Ve==null?void 0:Ve.id)===F.id?"border-brand-500/50 bg-brand-500/8":"border-slate-200 bg-white hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#0c0c10] dark:hover:border-[#2a2a31]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:gu(F)}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:yu(F.created_at_ms)})]}),c.jsx(_e,{variant:Qd(F),children:un(F.status)||tA(F.event_type)})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(_e,{variant:"gray",children:vu(F.route)}),F.gateway?c.jsx(_e,{variant:"green",children:F.gateway}):null]})]},F.id))})]},I.phase))}):c.jsx(xu,{title:"No preview trace captured yet",body:"Run Rule-Based or Volume Split evaluation first, then open the preview trace once the request has been logged."})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:Ve?gu(Ve):"Preview Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:Ve?`${vu(Ve.route)} · ${yu(Ve.created_at_ms)}`:"Select an event from the left to inspect the preview payload."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ve!=null&&Ve.gateway?c.jsx(_e,{variant:"green",children:Ve.gateway}):null,Ve!=null&&Ve.status?c.jsx(_e,{variant:Qd(Ve),children:un(Ve.status)}):null]})]}),c.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["summary","input","response","raw"].map(I=>c.jsx("button",{type:"button",onClick:()=>ge(I),className:`rounded-full px-4 py-2 text-xs font-semibold uppercase tracking-[0.16em] transition ${iA(ze===I)}`,children:I==="raw"?"Raw JSON":un(I)},I))})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:Z.isLoading&&!Z.data?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading preview inspector…"]}):nn?c.jsxs("div",{className:"space-y-5",children:[ze==="summary"?c.jsxs(c.Fragment,{children:[c.jsx(oA,{rows:nn.summaryRows}),c.jsx(da,{title:"Preview Signals",value:nn.signalRecord,emptyMessage:"No extra preview metadata was captured for this evaluation."})]}):null,ze==="input"?c.jsx(da,{title:"Request Payload",value:nn.requestPayload,emptyMessage:"No request payload was captured for this preview."}):null,ze==="response"?c.jsx(da,{title:"Response Payload",value:nn.responsePayload,emptyMessage:"No response payload was captured for this preview."}):null,ze==="raw"?c.jsx(da,{title:"Raw Event JSON",value:nn.rawEvent,emptyMessage:"No raw event payload is available for this preview."}):null]}):c.jsx(xu,{title:"Select a preview step",body:"Choose one of the preview events on the left to inspect its request and response payload."})})]})]})]})]})]})}const sA=[{value:"15m",label:"Last 15 mins"},{value:"1h",label:"Last 1 hour"},{value:"24h",label:"Last 1 day"},{value:"custom",label:"Custom window"}],Ya=["#0069ED","#14b8a6","#f97316","#e11d48","#8b5cf6","#22c55e"],lA={backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"14px",color:"#e8e8f4",boxShadow:"0 16px 40px rgba(0, 0, 0, 0.35)"},uA={color:"#f8fafc",fontWeight:600,marginBottom:8},cA={color:"#e2e8f0"},dA={zIndex:30,outline:"none"},fA={dimensions:{},gateways:[]},au=3,av={hits:{title:"API call counts",purpose:"Use these cards to see how much traffic each major decision-engine API handled in the selected window.",calculation:"Each request records one lightweight API-call event. The cards count those recorded calls for `/decide_gateway`, `/update_gateway`, and `/rule_evaluate`.",source:"Counts come from analytics rows persisted in `analytics_event` in Postgres."},share:{title:"Gateway share over time",purpose:"Use this to see when traffic shifted from one connector to another for the selected merchant.",calculation:"Decision events are bucketed by time and grouped by chosen connector. The chart shows how many decisions each gateway captured in each bucket.",source:"Reads persisted `decision` rows from `analytics_event` in Postgres."},sr:{title:"Connector success rate over time",purpose:"Use this to explain why a connector won routing at a given time, based on the recorded historical score trail.",calculation:"Stored `score_snapshot` events are bucketed over the selected window and averaged per connector. The line values are displayed as percentages.",source:"Reads persisted `score_snapshot` rows from `analytics_event` in Postgres. The current score state originates from Redis-backed scoring flows."}};function yce(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function iv(e,t,r,n,a){const i={scope:"current",range:t==="custom"?"1h":t,start_ms:n==null?void 0:n.start_ms,end_ms:n==null?void 0:n.end_ms,merchant_id:r,gateway:a!=null&&a.gateways.length?a.gateways.join(","):void 0};Object.entries((a==null?void 0:a.dimensions)||{}).forEach(([s,l])=>{l&&(i[s]=l)});const o=yce(i);return o?`${e}?${o}`:e}function Pw(e,t=2){if(e==null||Number.isNaN(Number(e)))return"0";const r=Number(e);return Number.isInteger(r)?r.toString():r.toFixed(t)}function F$(e){return Number.isFinite(e)?e<=1?e*100:e:0}function pA(e,t=1){return e==null||Number.isNaN(Number(e))?"0%":`${Pw(F$(Number(e)),t)}%`}function hA(e){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function Jd(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function vce(e){const t=Date.now(),r=e==="15m"?15*60*1e3:e==="1h"?60*60*1e3:24*60*60*1e3;return{start_ms:t-r,end_ms:t}}function ef(e){const t=new Date(e),r=n=>n.toString().padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}T${r(t.getHours())}:${r(t.getMinutes())}`}function mA(e){const t=new Date(e).getTime();return Number.isFinite(t)?t:null}function tf({title:e,body:t}){return c.jsxs("div",{className:"rounded-[24px] border border-dashed border-slate-200 bg-white/60 px-6 py-12 text-center dark:border-[#222227] dark:bg-[#0b0b0d]",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function rf(){return"h-11 w-full rounded-2xl border border-slate-200 bg-white px-4 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]"}function ov({content:e}){const[t,r]=j.useState(!1),n=j.useRef(null),[a,i]=j.useState({top:0,left:0,width:320});return j.useEffect(()=>{if(!t)return;function o(s){var l;(l=n.current)!=null&&l.contains(s.target)||r(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[t]),j.useLayoutEffect(()=>{if(!t||!n.current)return;const o=320,s=280,l=16,u=12;function f(){if(!n.current)return;const d=n.current.getBoundingClientRect(),p=Math.min(o,window.innerWidth-l*2),h=Math.min(Math.max(d.right-p,l),window.innerWidth-p-l),y=d.bottom+u+s>window.innerHeight-l?Math.max(d.top-s-u,l):d.bottom+u;i({top:y,left:h,width:p})}return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0)}},[t]),c.jsxs("div",{ref:n,className:"relative shrink-0",children:[c.jsx("button",{type:"button","aria-label":`About ${e.title}`,onClick:()=>r(o=>!o),className:`flex h-7 w-7 items-center justify-center rounded-full border text-xs font-semibold transition ${t?"border-brand-500/50 bg-brand-500/10 text-brand-700 dark:text-brand-200":"border-slate-200 bg-white text-slate-500 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#8a8a93] dark:hover:text-white"}`,children:"i"}),t?c.jsxs("div",{style:{position:"fixed",top:a.top,left:a.left,width:a.width},className:"z-[120] rounded-[24px] border border-slate-200 bg-white/95 p-4 shadow-2xl backdrop-blur dark:border-[#1d1d23] dark:bg-[#09090d]/95",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e.title}),c.jsxs("div",{className:"mt-3 space-y-3 text-xs leading-6 text-slate-600 dark:text-[#b3b3bd]",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Why it matters"}),c.jsx("p",{className:"mt-1",children:e.purpose})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"How it is calculated"}),c.jsx("p",{className:"mt-1",children:e.calculation})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Data source"}),c.jsx("p",{className:"mt-1",children:e.source})]})]})]}):null]})}function gce({label:e,value:t,subtitle:r}){return c.jsx(ke,{className:"h-full overflow-hidden",children:c.jsxs(Ae,{className:"flex h-full min-h-[150px] flex-col justify-between",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Endpoint hits"}),c.jsx("p",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:e})]}),c.jsxs("div",{className:"flex items-end justify-between gap-4",children:[c.jsx("p",{className:"text-5xl font-semibold tracking-tight text-slate-950 dark:text-white",children:Pw(t,0)}),c.jsx(_e,{variant:"blue",children:r})]})]})})}function xce(e){return e==="/decide_gateway"?"Decide Gateway":e==="/update_gateway"?"Update Gateway":e==="/rule_evaluate"?"Rule Evaluate":e}function bce(){var Ce,Fe,te,ie,he,X,Ee,ve,Pe,ze,ge,$e,Le,Oe,Ge;const{merchantId:e}=aa(),[t,r]=j.useState("1h"),[n,a]=j.useState(fA),[i,o]=j.useState(!1),[s,l]=j.useState(()=>ef(Date.now()-2*60*60*1e3)),[u,f]=j.useState(()=>ef(Date.now())),d=!!e,p=j.useMemo(()=>{if(t!=="custom")return;const H=mA(s),E=mA(u);if(!(H===null||E===null||E<=H))return{start_ms:H,end_ms:E}},[u,s,t]),h=d&&e&&(t!=="custom"||p)?iv("/analytics/overview",t,e,p):null,g=d&&e&&(t!=="custom"||p)?iv("/analytics/routing-stats",t,e,p):null,y=d&&e&&(t!=="custom"||p)?iv("/analytics/routing-stats",t,e,p,n):null,v={refreshInterval:1e4,revalidateOnFocus:!0,revalidateIfStale:!1},x={refreshInterval:12e3,revalidateOnFocus:!0,revalidateIfStale:!1},m={...x,keepPreviousData:!0},w=ar(h,wi,v),S=ar(g,wi,x),b=ar(y,wi,m),_=!w.data&&w.isLoading||!S.data&&S.isLoading||!b.data&&b.isLoading,O=((Ce=w.error)==null?void 0:Ce.message)||((Fe=S.error)==null?void 0:Fe.message)||((te=b.error)==null?void 0:te.message)||null,k={dimensions:((he=(ie=S.data)==null?void 0:ie.available_filters)==null?void 0:he.dimensions)||((Ee=(X=b.data)==null?void 0:X.available_filters)==null?void 0:Ee.dimensions)||[],missing_dimensions:((Pe=(ve=S.data)==null?void 0:ve.available_filters)==null?void 0:Pe.missing_dimensions)||((ge=(ze=b.data)==null?void 0:ze.available_filters)==null?void 0:ge.missing_dimensions)||[],gateways:((Le=($e=S.data)==null?void 0:$e.available_filters)==null?void 0:Le.gateways)||((Ge=(Oe=b.data)==null?void 0:Oe.available_filters)==null?void 0:Ge.gateways)||[]},A=j.useMemo(()=>new Map(k.dimensions.map(H=>[H.key,H])),[k.dimensions]);j.useEffect(()=>{a(H=>{const E=Object.fromEntries(Object.entries(H.dimensions).filter(([N,B])=>{if(!B)return!1;const G=A.get(N);return G?G.values.includes(B):!1})),M=H.gateways.filter(N=>k.gateways.includes(N));return Object.keys(E).length===Object.keys(H.dimensions).length&&Object.entries(E).every(([N,B])=>H.dimensions[N]===B)&&M.length===H.gateways.length&&M.every((N,B)=>N===H.gateways[B])?H:{dimensions:E,gateways:M}})},[A,k.gateways]),j.useEffect(()=>{k.dimensions.length<=au&&i&&o(!1)},[k.dimensions.length,i]);const $=j.useMemo(()=>{var H;return t!=="custom"?((H=sA.find(E=>E.value===t))==null?void 0:H.label)||"Selected window":p?`${Jd(p.start_ms)} to ${Jd(p.end_ms)}`:"Custom window"},[p,t]),T=j.useMemo(()=>{var E,M;const H=[{route:"/decide_gateway",count:0},{route:"/update_gateway",count:0},{route:"/rule_evaluate",count:0}];return(M=(E=w.data)==null?void 0:E.route_hits)!=null&&M.length?H.map(N=>{var B,G;return{...N,count:((G=(B=w.data)==null?void 0:B.route_hits.find(ee=>ee.route===N.route))==null?void 0:G.count)||0}}):H},[w.data]),P=j.useMemo(()=>{var M,N;const H=Array.from(new Set((((M=S.data)==null?void 0:M.gateway_share)||[]).map(B=>B.gateway))).slice(0,6),E=new Map;for(const B of((N=S.data)==null?void 0:N.gateway_share)||[]){if(!H.includes(B.gateway))continue;const G=E.get(B.bucket_ms)||{bucket_ms:B.bucket_ms};G[B.gateway]=B.count,E.set(B.bucket_ms,G)}return{gateways:H,rows:Array.from(E.values()).sort((B,G)=>B.bucket_ms-G.bucket_ms)}},[S.data]),R=j.useMemo(()=>{var M,N;const H=Array.from(new Set((((M=b.data)==null?void 0:M.sr_trend)||[]).map(B=>B.gateway))).slice(0,6),E=new Map;for(const B of((N=b.data)==null?void 0:N.sr_trend)||[]){if(!H.includes(B.gateway))continue;const G=E.get(B.bucket_ms)||{bucket_ms:B.bucket_ms};G[B.gateway]=F$(B.score_value),E.set(B.bucket_ms,G)}return{gateways:H,rows:Array.from(E.values()).sort((B,G)=>B.bucket_ms-G.bucket_ms)}},[b.data]),L=j.useMemo(()=>{if(!R.rows.length)return[];const H=R.rows[R.rows.length-1];return R.gateways.map(E=>({gateway:E,value:typeof H[E]=="number"?H[E]:null})).filter(E=>E.value!==null)},[R]),z=j.useMemo(()=>{const H=R.rows.flatMap(B=>R.gateways.map(G=>B[G]).filter(G=>typeof G=="number"));if(!H.length)return[0,100];const E=Math.min(...H),M=Math.max(...H),N=E===M?5:Math.max(2,(M-E)*.35);return[Math.max(0,Math.floor(E-N)),Math.min(100,Math.ceil(M+N))]},[R]),W=j.useMemo(()=>{const H=k.dimensions.flatMap(E=>{const M=n.dimensions[E.key];return M?[`${E.label}: ${M}`]:[]});return n.gateways.length&&H.push(n.gateways.join(", ")),H.length?H.join(" / "):"All routing dimensions"},[k.dimensions,n]),V=j.useMemo(()=>i||k.dimensions.length<=au?k.dimensions:k.dimensions.slice(0,au),[k.dimensions,i]),D=k.dimensions.length>au,U=D?k.dimensions.length-au:0,q=j.useMemo(()=>{const H=k.dimensions.flatMap(M=>{const N=n.dimensions[M.key];return N?[{key:`dimension:${M.key}`,label:`${M.label}: ${N}`}]:[]}),E=n.gateways.map(M=>({key:`gateway:${M}`,label:`Connector: ${M}`}));return[...H,...E]},[k.dimensions,n]);function J(H){if(r(H),H!=="custom"){const E=vce(H);l(ef(E.start_ms)),f(ef(E.end_ms))}}function K(){w.mutate(),S.mutate(),b.mutate()}function ae(H){a(E=>{const M=E.gateways.includes(H);return{...E,gateways:M?E.gateways.filter(N=>N!==H):[...E.gateways,H]}})}function Q(){a(fA)}function be(H){if(H.startsWith("dimension:")){ue(H.replace("dimension:",""),"");return}H.startsWith("gateway:")&&ae(H.replace("gateway:",""))}function ue(H,E){a(M=>{const N={...M.dimensions};return E?N[H]=E:delete N[H],{...M,dimensions:N}})}return d?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Analytics"}),c.jsx(_e,{variant:"green",children:e||"Current merchant"})]}),c.jsx("p",{className:"text-sm text-slate-500 dark:text-[#8a8a93]",children:"One working surface for route volume, connector share, and historical connector success rate."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(Ie,{size:"sm",variant:"ghost",onClick:K,children:"Refresh"})})]}),c.jsx(ke,{className:"overflow-visible",children:c.jsxs(Ae,{className:"flex flex-wrap items-end gap-4",children:[c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Time window"}),c.jsx("select",{value:t,onChange:H=>J(H.target.value),className:rf(),children:sA.map(H=>c.jsx("option",{value:H.value,children:H.label},H.value))})]}),t==="custom"?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Start time"}),c.jsx("input",{type:"datetime-local",value:s,onChange:H=>l(H.target.value),className:rf()})]}),c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"End time"}),c.jsx("input",{type:"datetime-local",value:u,onChange:H=>f(H.target.value),className:rf()})]})]}):null,c.jsxs("div",{className:"min-w-[220px] flex-1 rounded-[24px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#0c0c0e]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Active window"}),c.jsx("p",{className:"mt-1 text-sm font-medium text-slate-900 dark:text-white",children:$}),t==="custom"&&!p?c.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Choose an end time after the start time."}):null]})]})}),c.jsx(Gr,{error:O}),_?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading analytics…"]}):null,c.jsxs("section",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"API calls"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Counts for the three routing surfaces most operators watch first."})]}),c.jsx(ov,{content:av.hits})]}),c.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:T.map(H=>c.jsx(gce,{label:xce(H.route),value:H.count,subtitle:t==="custom"?"Custom window":$},H.route))})]}),c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Gateway share over time"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"How decision volume moved across connectors inside the selected merchant window."})]}),c.jsx(ov,{content:av.share})]})}),c.jsx(Ae,{children:P.rows.length?c.jsx("div",{className:"h-80",children:c.jsx(ks,{width:"100%",height:"100%",children:c.jsxs(ace,{data:P.rows,children:[c.jsx(K0,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),c.jsx(Ma,{dataKey:"bucket_ms",tickFormatter:hA,tick:{fontSize:11}}),c.jsx(Da,{tick:{fontSize:11}}),c.jsx(_r,{labelFormatter:H=>Jd(Number(H)),contentStyle:lA,labelStyle:uA,itemStyle:cA,wrapperStyle:dA}),c.jsx(Oa,{}),P.gateways.map((H,E)=>c.jsx(Fi,{type:"monotone",dataKey:H,stackId:"1",stroke:Ya[E%Ya.length],fill:Ya[E%Ya.length],fillOpacity:.24,name:H},H))]})})}):c.jsx(tf,{title:"No gateway share history yet",body:"Send real decide-gateway traffic in the selected window to populate connector share."})})]}),c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Connector success rate over time"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Historical connector score trend for the selected merchant window."}),c.jsxs("p",{className:"mt-2 text-xs font-medium text-slate-600 dark:text-[#b3b3bd]",children:["Active filters: ",W]})]}),c.jsx(ov,{content:av.sr})]})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-[24px] border border-slate-200 bg-slate-50/80 p-4 dark:border-[#1d1d23] dark:bg-[#0c0c0e]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Connector filters"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Narrow the success-rate line chart by the routing dimensions present for this merchant."})]}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:Q,disabled:!Object.values(n.dimensions).some(Boolean)&&!n.gateways.length,children:"Clear filters"})]}),k.dimensions.length?c.jsxs("div",{className:"mt-4 space-y-3",children:[c.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:V.map(H=>c.jsxs("label",{className:"space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:H.label}),c.jsxs("select",{value:n.dimensions[H.key]||"",onChange:E=>ue(H.key,E.target.value),className:rf(),disabled:!H.values.length,children:[c.jsxs("option",{value:"",children:["All ",H.label.toLowerCase()]}),H.values.map(E=>c.jsx("option",{value:E,children:E},E))]})]},H.key))}),D?c.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:i?"Showing all routing dimensions available for this merchant.":`${U} more routing dimension${U===1?"":"s"} available for this merchant.`}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>o(H=>!H),children:i?"Show fewer filters":"More filters"})]}):null]}):k.missing_dimensions.length?c.jsx(tf,{title:"No populated routing dimensions in this window",body:"The merchant has score history, but none of the dynamic routing dimensions have values recorded in the selected time window yet."}):null,k.missing_dimensions.length?c.jsxs("div",{className:"mt-4 rounded-2xl border border-dashed border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"No values in this window yet"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:k.missing_dimensions.map(H=>H.label).join(", ")})]}):null,q.length?c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Active filters"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:q.map(H=>c.jsxs("button",{type:"button",onClick:()=>be(H.key),className:"inline-flex items-center gap-2 rounded-full border border-brand-500/30 bg-brand-500/10 px-3 py-1.5 text-xs font-semibold text-brand-700 transition hover:bg-brand-500/15 dark:text-brand-200",children:[c.jsx("span",{children:H.label}),c.jsx("span",{"aria-hidden":"true",children:"×"})]},H.key))})]}):null,c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Connectors"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:k.gateways.length?k.gateways.map(H=>{const E=n.gateways.includes(H);return c.jsx("button",{type:"button",onClick:()=>ae(H),className:`rounded-full border px-3 py-1.5 text-xs font-semibold transition ${E?"border-brand-500/50 bg-brand-500/10 text-brand-700 dark:text-brand-200":"border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#a1a1aa] dark:hover:text-white"}`,children:H},H)}):c.jsx("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:"No connector history yet for the selected window."})})]})]}),L.length?c.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(H=>c.jsxs(_e,{variant:"blue",children:[H.gateway,": ",pA(H.value)]},H.gateway))}):null,R.rows.length?c.jsx("div",{className:"h-80",children:c.jsx(ks,{width:"100%",height:"100%",children:c.jsxs(nce,{data:R.rows,children:[c.jsx(K0,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),c.jsx(Ma,{dataKey:"bucket_ms",tickFormatter:hA,tick:{fontSize:11}}),c.jsx(Da,{domain:z,tick:{fontSize:11},tickFormatter:H=>`${Pw(Number(H),0)}%`}),c.jsx(_r,{labelFormatter:H=>Jd(Number(H)),formatter:(H,E)=>[pA(H),String(E)],contentStyle:lA,labelStyle:uA,itemStyle:cA,wrapperStyle:dA}),c.jsx(Oa,{}),R.gateways.map((H,E)=>c.jsx(hd,{type:"monotone",dataKey:H,stroke:Ya[E%Ya.length],strokeWidth:3,dot:{r:3,strokeWidth:1,fill:Ya[E%Ya.length]},activeDot:{r:5},name:H},H))]})})}):c.jsx(tf,{title:"No connector score history yet",body:"Send decide-gateway and update-gateway-score traffic in the selected window to populate connector history."})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Analytics"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Set a merchant in the top bar to load merchant-scoped analytics."})]}),c.jsx(tf,{title:"Select a merchant first",body:"The analytics surface is merchant-scoped. Use the merchant selector in the top bar to load data."})]})}const wce=["15m","1h","24h"],_ce=[{value:"",label:"Any status"},{value:"success",label:"Success"},{value:"failure",label:"Failure"}],Sce=[{value:"",label:"Any route"},{value:"decide_gateway",label:"Decide Gateway"},{value:"update_gateway_score",label:"Update Gateway"},{value:"routing_evaluate",label:"Rule Evaluate"}],jce=["summary","input","response","raw"],sv={paymentId:"",requestId:"",gateway:"",route:"",status:"",eventType:"",errorCode:""};function Uu(e){const t=e.paymentId.trim(),r=t?"":e.requestId.trim();return{paymentId:t,requestId:r,gateway:e.gateway.trim(),route:e.route,status:e.status,eventType:e.eventType,errorCode:e.errorCode.trim()}}function z$(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function yA(e,t,r,n,a){const i=Uu(a),o={scope:"current",range:e,page:r,page_size:n,merchant_id:t,payment_id:i.paymentId||void 0,request_id:i.requestId||void 0,gateway:i.gateway||void 0,route:i.route||void 0,status:i.status||void 0,event_type:i.eventType||void 0,error_code:i.errorCode||void 0},s=z$(o);return s?`/analytics/payment-audit?${s}`:"/analytics/payment-audit"}function Oce(e){return e==="15m"||e==="24h"?e:"24h"}function kce(e){return Uu({paymentId:e.get("payment_id")||"",requestId:e.get("request_id")||"",gateway:e.get("gateway")||"",route:e.get("route")||"",status:e.get("status")||"",eventType:e.get("event_type")||"",errorCode:e.get("error_code")||""})}function wf(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function Ace(e){const t=Math.max(0,Math.round((Date.now()-e)/6e4));if(t<1)return"just now";if(t<60)return`${t}m ago`;const r=Math.round(t/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Ps(e){return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase()):""}function B$(e){return e?e==="decision_gateway"||e==="decide_gateway"?"Decide Gateway":e==="update_gateway_score"?"Update Gateway":e==="routing_evaluate"?"Rule Evaluate":Ps(e):"Unknown route"}function Ece(e){return e?e==="decision"?"Decide Gateway":e==="gateway_update"?"Update Gateway":e==="rule_hit"?"Rule Evaluate":e==="error"?"Errors":Ps(e):"Unknown event"}function lx(e){return e.event_stage==="gateway_decided"?"Decide Gateway":e.event_stage==="score_updated"?"Update Gateway":e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="error"?"Errors":Ps(e.event_stage||e.event_type)}function _f(e){return e.event_type==="decision"||e.event_stage==="gateway_decided"?"Decide Gateway":e.event_type==="rule_hit"||e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="gateway_update"||e.event_stage==="score_updated"?"Update Gateway":"Errors"}function iu(e){const t=(e.status||"").toUpperCase();return e.event_type==="error"||t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":e.event_type==="rule_hit"?"purple":t==="CHARGED"||t==="AUTHORIZED"||t==="SUCCESS"||e.event_type==="gateway_update"?"green":e.event_type==="decision"?"blue":"orange"}function lv(e){const t=(e||"").toUpperCase();return t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":t==="SUCCESS"||t==="CHARGED"||t==="AUTHORIZED"?"green":t==="HIT"?"purple":"gray"}function vA(e){return e==="Decide Gateway"?"blue":e==="Rule Evaluate"?"purple":e==="Update Gateway"?"green":e==="Errors"?"red":"orange"}function ou(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function uv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}function Pce(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function Nce(e){return e?"bg-brand-600 text-white":"bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]"}function Ko(){return"h-10 rounded-2xl border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]"}function nf({label:e,value:t,helper:r}){return c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs uppercase tracking-[0.16em] text-slate-500",children:e}),c.jsx("p",{className:"mt-2 text-3xl font-semibold text-slate-900 dark:text-white",children:t}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:r})]})})}function bu({title:e,body:t}){return c.jsxs("div",{className:"rounded-2xl border border-dashed border-slate-200 dark:border-[#222227] bg-white/60 dark:bg-[#0b0b0d] px-6 py-12 text-center",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function Cce({rows:e}){return e.length?c.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(t=>c.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:t.label}),c.jsx("p",{className:"mt-2 text-sm text-slate-900 dark:text-white break-words",children:t.value})]},`${t.label}-${t.value}`))}):null}function Xo({title:e,value:t,emptyMessage:r}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{children:c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e})}),t?c.jsx("pre",{className:"overflow-x-auto rounded-2xl bg-slate-950/90 px-4 py-4 text-xs leading-6 text-slate-200",children:Pce(t)}):c.jsx(bu,{title:`No ${e.toLowerCase()} captured`,body:r})]})}function Tce(e){if(!e)return null;const t=ou(e.details_json)?e.details_json:{},r=t.response??t.response_payload??t.result??t.output??null,n=t.request??t.request_payload??t.input??t.payload??uv({payment_id:e.payment_id,request_id:e.request_id,payment_method_type:e.payment_method_type,payment_method:e.payment_method,gateway:e.gateway}),a=r??uv({event_type:e.event_type,status:e.status,error_code:e.error_code,error_message:e.error_message,score_value:e.score_value,sigma_factor:e.sigma_factor,average_latency:e.average_latency,tp99_latency:e.tp99_latency,transaction_count:e.transaction_count,rule_name:e.rule_name,routing_approach:e.routing_approach}),i=ou(r)?r:null,o=ou(i==null?void 0:i.decided_gateway)?i.decided_gateway:null,s=t.score_context??(o?o.gateway_priority_map:null)??(i?i.gateway_priority_map:null)??null,l=t.selection_reason??null,u=[{label:"Phase",value:_f(e)},{label:"Stage",value:lx(e)},{label:"Route",value:B$(e.route)},{label:"Timestamp",value:wf(e.created_at_ms)},{label:"Merchant",value:e.merchant_id||"unknown merchant"},...e.payment_id?[{label:"Payment ID",value:e.payment_id}]:[],...e.request_id?[{label:"Request ID",value:e.request_id}]:[],...e.gateway?[{label:"Gateway",value:e.gateway}]:[],...e.status?[{label:"Status",value:e.status}]:[]],f=uv(Object.fromEntries(Object.entries(t).filter(([d])=>!["request","request_payload","input","payload","response","response_payload","result","output","score_context","selection_reason"].includes(d))));return{summaryRows:u,requestPayload:ou(n)&&!Object.keys(n).length?null:n,responsePayload:ou(a)&&!Object.keys(a).length?null:a,scoreContext:s,selectionReason:l,signalRecord:Object.keys(f).length?f:null,rawEvent:{...e,details_json:e.details_json}}}function $ce(){var ie,he,X,Ee,ve,Pe,ze,ge,$e,Le,Oe,Ge,H,E,M;const{merchantId:e}=aa(),[t,r]=kD(),n=Oce(t.get("range")),a=kce(t),i=Math.max(1,Number(t.get("page")||"1")),o=t.get("selected")||"",[s,l]=j.useState(n),[u,f]=j.useState(a),[d,p]=j.useState(a),[h,g]=j.useState(i),[y,v]=j.useState(o),[x,m]=j.useState(null),[w,S]=j.useState("summary"),b=12,_=!!e,O=_&&e?yA(s,e,h,b,d):null,k=ar(O,wi,{refreshInterval:12e3,revalidateOnFocus:!0}),A=j.useMemo(()=>{var B;const N=((B=k.data)==null?void 0:B.results)||[];return N.find(G=>G.lookup_key===y)||N[0]||null},[(ie=k.data)==null?void 0:ie.results,y]);j.useEffect(()=>{var B,G;if(A!=null&&A.lookup_key){v(A.lookup_key);return}const N=(G=(B=k.data)==null?void 0:B.results)==null?void 0:G[0];N!=null&&N.lookup_key&&v(N.lookup_key)},[(he=k.data)==null?void 0:he.results,A==null?void 0:A.lookup_key]);const $=j.useMemo(()=>{if(!A)return null;const N=A.payment_id||"";return{paymentId:N,requestId:N?"":A.request_id||"",gateway:"",route:"",status:"",eventType:"",errorCode:""}},[A]),T=_&&e&&$?yA(s,e,1,50,$):null,P=ar(T,wi,{refreshInterval:12e3,revalidateOnFocus:!0}),R=j.useMemo(()=>{var B;const N=((B=P.data)==null?void 0:B.timeline)||[];return N.find(G=>G.id===x)||N[0]||null},[(X=P.data)==null?void 0:X.timeline,x]);j.useEffect(()=>{var B,G;if(R!=null&&R.id){m(R.id);return}const N=(G=(B=P.data)==null?void 0:B.timeline)==null?void 0:G[0];N!=null&&N.id&&m(N.id)},[(Ee=P.data)==null?void 0:Ee.timeline,R==null?void 0:R.id]);const L=j.useMemo(()=>{var B;const N=[];for(const G of((B=P.data)==null?void 0:B.timeline)||[]){const ee=_f(G),Z=N[N.length-1];!Z||Z.phase!==ee?N.push({phase:ee,events:[G]}):Z.events.push(G)}return N},[(ve=P.data)==null?void 0:ve.timeline]),z=j.useMemo(()=>Tce(R),[R]),W=((Pe=k.error)==null?void 0:Pe.message)||((ze=P.error)==null?void 0:ze.message)||null,V=k.isLoading||P.isLoading,D=(($e=(ge=P.data)==null?void 0:ge.timeline)==null?void 0:$e.length)||0,U=((Le=A==null?void 0:A.gateways)==null?void 0:Le.length)||0,q=A?Ace(A.last_seen_ms):"No activity";function J(N,B,G,ee){const Z=Uu(G),me=z$({range:N,page:B>1?B:void 0,payment_id:Z.paymentId||void 0,request_id:Z.requestId||void 0,gateway:Z.gateway||void 0,route:Z.route||void 0,status:Z.status||void 0,event_type:Z.eventType||void 0,error_code:Z.errorCode||void 0,selected:ee||void 0});r(me)}function K(N,B){f(G=>Uu({...G,[N]:B}))}function ae(){const B=Uu(u);g(1),f(B),p(B),J(s,1,B)}function Q(){g(1),f(sv),p(sv),J(s,1,sv)}function be(){k.mutate(),P.mutate()}function ue(N){l(N),g(1),J(N,1,d,y)}function Ce(N){v(N),J(s,h,d,N)}async function Fe(N){if(N)try{await navigator.clipboard.writeText(N)}catch{}}function te(){if(!R)return;const N=R.payment_id||"",B={paymentId:N,requestId:N?"":R.request_id||"",gateway:R.gateway||"",route:"",status:"",eventType:"",errorCode:""};f(B),p(B),g(1),J(s,1,B,y)}return _?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Decision Audit"}),c.jsx("p",{className:"mt-1 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:"Search by payment or request, then inspect the full sequence of gateway decisions, gateway updates, rule evaluations, and errors with the exact payload captured at each step."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(Ie,{size:"sm",variant:"ghost",onClick:be,children:"Refresh"})})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[wce.map(N=>c.jsx(Ie,{size:"sm",variant:s===N?"primary":"secondary",onClick:()=>ue(N),children:N},N)),c.jsx(_e,{variant:"green",children:e||"Current merchant"})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Search Decision Trail"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Use payment or request IDs when you have them. Error code, gateway, route, and status narrow operational noise quickly."})]})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[c.jsx("input",{className:Ko(),value:u.paymentId,onChange:N=>K("paymentId",N.target.value),placeholder:"Payment ID"}),c.jsx("input",{className:Ko(),value:u.requestId,onChange:N=>K("requestId",N.target.value),placeholder:"Request ID"}),c.jsx("input",{className:Ko(),value:u.gateway,onChange:N=>K("gateway",N.target.value),placeholder:"Gateway"}),c.jsx("select",{className:Ko(),value:u.route,onChange:N=>K("route",N.target.value),children:Sce.map(N=>c.jsx("option",{value:N.value,children:N.label},N.value||"all"))}),c.jsx("input",{className:Ko(),value:u.errorCode,onChange:N=>K("errorCode",N.target.value),placeholder:"Error code"}),c.jsx("select",{className:Ko(),value:u.status,onChange:N=>K("status",N.target.value),children:_ce.map(N=>c.jsx("option",{value:N.value,children:N.label},N.value||"all"))})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Ie,{size:"sm",onClick:ae,children:"Search"}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:Q,children:"Clear"})]})]})]}),c.jsx(Gr,{error:W}),V&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading decision audit data…"]}),c.jsxs("section",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsx(nf,{label:"Matching payments",value:String(((Oe=k.data)==null?void 0:Oe.total_results)||0),helper:"Results within the selected time window"}),c.jsx(nf,{label:"Timeline events",value:String(D),helper:"Captured for the selected payment"}),c.jsx(nf,{label:"Active gateways",value:String(U),helper:"Distinct gateways seen on the selected payment"}),c.jsx(nf,{label:"Latest activity",value:q,helper:"Most recent event on the selected payment"})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[360px_minmax(0,1fr)]",children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Matching Payments"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ie,{size:"sm",variant:"secondary",disabled:h<=1,onClick:()=>{const N=Math.max(1,h-1);g(N),J(s,N,d,y)},children:"Prev"}),c.jsx(Ie,{size:"sm",variant:"secondary",disabled:(((H=(Ge=k.data)==null?void 0:Ge.results)==null?void 0:H.length)||0){const N=h+1;g(N),J(s,N,d,y)},children:"Next"})]})]})}),c.jsx(Ae,{className:"space-y-3",children:(M=(E=k.data)==null?void 0:E.results)!=null&&M.length?k.data.results.map(N=>c.jsxs("button",{type:"button",onClick:()=>Ce(N.lookup_key),className:`w-full rounded-2xl border p-4 text-left transition-all ${(A==null?void 0:A.lookup_key)===N.lookup_key?"border-brand-500/50 bg-brand-500/5":"border-slate-200 hover:border-slate-300 dark:border-[#1d1d23] dark:hover:border-[#2a2a33]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:N.payment_id||N.request_id||N.lookup_key}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:[N.merchant_id||"unknown merchant"," · ",wf(N.last_seen_ms)]})]}),c.jsx(_e,{variant:lv(N.latest_status),children:Ps(N.latest_status)||"Unknown"})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[N.latest_stage?c.jsx(_e,{variant:"blue",children:N.latest_stage}):null,N.latest_gateway?c.jsx(_e,{variant:"green",children:N.latest_gateway}):null,c.jsxs(_e,{variant:"gray",children:[N.event_count," events"]})]}),N.request_id?c.jsxs("p",{className:"mt-3 truncate text-[11px] text-slate-500 dark:text-[#8a8a93]",children:["request ",N.request_id]}):null]},N.lookup_key)):c.jsx(bu,{title:"No matching payments found",body:"Try widening the time range or searching by a single payment ID, request ID, or error code."})})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_380px]",children:[c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Selected Payment Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:(A==null?void 0:A.payment_id)||(A==null?void 0:A.request_id)||"Choose a payment from the result list to inspect the timeline."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[A!=null&&A.latest_gateway?c.jsx(_e,{variant:"green",children:A.latest_gateway}):null,A!=null&&A.latest_stage?c.jsx(_e,{variant:"blue",children:A.latest_stage}):null,A!=null&&A.latest_status?c.jsx(_e,{variant:lv(A.latest_status),children:Ps(A.latest_status)}):null]})]})}),c.jsx(Ae,{children:L.length?c.jsx("div",{className:"space-y-6",children:L.map(N=>c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(_e,{variant:vA(N.phase),children:N.phase}),c.jsxs("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:[N.events.length," event",N.events.length===1?"":"s"]})]}),c.jsx("div",{className:"relative space-y-3 pl-6 before:absolute before:left-2 before:top-2 before:bottom-2 before:w-px before:bg-slate-200 dark:before:bg-[#23232a]",children:N.events.map(B=>{const G=(R==null?void 0:R.id)===B.id;return c.jsxs("button",{type:"button",onClick:()=>{m(B.id),S("summary")},className:`relative w-full rounded-[24px] border p-5 text-left shadow-sm transition ${G?"border-brand-500/50 bg-brand-500/5":"border-slate-200 bg-white/70 hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#09090b] dark:hover:border-[#2a2a33]"}`,children:[c.jsx("span",{className:`absolute -left-[25px] top-6 h-3 w-3 rounded-full ${iu(B)==="red"?"bg-red-400":iu(B)==="green"?"bg-emerald-400":iu(B)==="purple"?"bg-purple-400":iu(B)==="orange"?"bg-orange-400":"bg-blue-400"}`}),c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:lx(B)}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:[B$(B.route)," · ",wf(B.created_at_ms)]})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(_e,{variant:iu(B),children:Ece(B.event_type)}),B.status?c.jsx(_e,{variant:lv(B.status),children:Ps(B.status)}):null,B.gateway?c.jsx(_e,{variant:"green",children:B.gateway}):null]})]}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-slate-500 dark:text-[#8a8a93]",children:[B.request_id?c.jsxs("span",{children:["request ",B.request_id]}):null,B.routing_approach?c.jsxs("span",{children:["approach ",B.routing_approach]}):null,B.rule_name?c.jsxs("span",{children:["rule ",B.rule_name]}):null,B.payment_method_type?c.jsxs("span",{children:["PMT ",B.payment_method_type]}):null,B.payment_method?c.jsxs("span",{children:["method ",B.payment_method]}):null,B.error_code?c.jsxs("span",{children:["error ",B.error_code]}):null]}),B.error_message?c.jsx("p",{className:"mt-4 rounded-2xl border border-red-500/20 bg-red-500/5 px-4 py-3 text-sm text-red-300",children:B.error_message}):null]},B.id)})})]},N.phase))}):c.jsx(bu,{title:"No timeline selected yet",body:"Pick a payment from the left column to see the full transaction trail."})})]}),c.jsxs(ke,{className:"overflow-visible xl:sticky xl:top-6 xl:self-start",children:[c.jsx(Xe,{children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Event Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:R?`${lx(R)} · ${wf(R.created_at_ms)}`:"Select a timeline event to inspect the captured payload."})]}),R?c.jsx(_e,{variant:vA(_f(R)),children:_f(R)}):null]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:jce.map(N=>c.jsx(Ie,{size:"sm",variant:"secondary",className:Nce(w===N),onClick:()=>S(N),children:N==="summary"?"Summary":N==="input"?"Input":N==="response"?"Response":"Raw JSON"},N))})]})}),c.jsx(Ae,{className:"space-y-4",children:R&&z?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>S("raw"),children:"View payload"}),c.jsx(Ie,{size:"sm",variant:"secondary",disabled:!R.request_id,onClick:()=>Fe(R.request_id),children:"Copy request ID"}),c.jsx(Ie,{size:"sm",variant:"secondary",disabled:!R.payment_id,onClick:()=>Fe(R.payment_id),children:"Copy payment ID"}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:te,children:"Open related events"})]}),w==="summary"?c.jsxs("div",{className:"space-y-4",children:[c.jsx(Cce,{rows:z.summaryRows}),c.jsx(Xo,{title:"Connector score context",value:z.scoreContext,emptyMessage:"No connector score map was captured for this event."}),c.jsx(Xo,{title:"Selection reason",value:z.selectionReason,emptyMessage:"No explicit selection reason was captured for this event."}),c.jsx(Xo,{title:"Score / rule details",value:z.signalRecord,emptyMessage:"This event did not capture additional scoring or rule metadata."})]}):null,w==="input"?c.jsx(Xo,{title:"Input",value:z.requestPayload,emptyMessage:"No dedicated request payload was captured for this event."}):null,w==="response"?c.jsx(Xo,{title:"Response",value:z.responsePayload,emptyMessage:"No dedicated response payload was captured for this event."}):null,w==="raw"?c.jsx(Xo,{title:"Raw JSON",value:z.rawEvent,emptyMessage:"No raw payload is available for this event."}):null]}):c.jsx(bu,{title:"No event selected",body:"Pick a timeline step to see the request, response, transaction context, and raw payload."})})]})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Decision Audit"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Search a payment and inspect gateway decisions, gateway updates, rule evaluations, and errors in one transaction trail."})]}),c.jsx(bu,{title:"Select a merchant to start auditing payments",body:"Use the merchant selector in the top bar to load the decision trail for a merchant."})]})}function Ice(){return c.jsx(cD,{children:c.jsxs(ln,{element:c.jsx(NL,{}),children:[c.jsx(ln,{index:!0,element:c.jsx(u3,{})}),c.jsx(ln,{path:"routing",element:c.jsx(c3,{})}),c.jsx(ln,{path:"routing/sr",element:c.jsx(x4,{})}),c.jsx(ln,{path:"routing/rules",element:c.jsx(pF,{})}),c.jsx(ln,{path:"routing/volume",element:c.jsx(ice,{})}),c.jsx(ln,{path:"routing/debit",element:c.jsx(sce,{})}),c.jsx(ln,{path:"decisions",element:c.jsx(mce,{})}),c.jsx(ln,{path:"analytics",element:c.jsx(bce,{})}),c.jsx(ln,{path:"audit",element:c.jsx($ce,{})}),c.jsx(ln,{path:"*",element:c.jsx(sD,{to:".",replace:!0})})]})})}class Rce extends j.Component{constructor(){super(...arguments);zw(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(r){return{error:r,errorInfo:null}}componentDidCatch(r,n){console.log(` -`+"!".repeat(80)),console.log("[ERROR BOUNDARY] Component Error Caught"),console.log(`Timestamp: ${new Date().toISOString()}`),console.log("Error Message:",r.message),console.log("Error Stack:",r.stack),console.log("Component Stack:",n.componentStack),console.log("!".repeat(80)+` -`),this.setState({errorInfo:n})}render(){return this.state.error?c.jsxs("div",{style:{padding:32,fontFamily:"monospace",color:"red"},children:[c.jsx("h2",{children:"Dashboard Error"}),c.jsx("pre",{children:this.state.error.message}),c.jsx("pre",{children:this.state.error.stack}),this.state.errorInfo&&c.jsxs("pre",{style:{marginTop:16,color:"darkred"},children:["Component Stack:",this.state.errorInfo.componentStack]})]}):this.props.children}}console.log(` -`+"=".repeat(80));console.log("[APP STARTUP] Dashboard initializing...");console.log(`Timestamp: ${new Date().toISOString()}`);console.log("Environment: production");console.log("Base URL: /dashboard");console.log("=".repeat(80)+` -`);window.onerror=(e,t,r,n,a)=>{console.log(` -`+"!".repeat(80)),console.log("[WINDOW ERROR]"),console.log("Message:",e),console.log("Source:",t),console.log("Line:",r,"Column:",n),a&&(console.log("Error:",a.message),console.log("Stack:",a.stack)),console.log("!".repeat(80)+` -`)};window.onunhandledrejection=e=>{console.log(` -`+"!".repeat(80)),console.log("[UNHANDLED PROMISE REJECTION]"),console.log("Reason:",e.reason),e.reason instanceof Error&&console.log("Stack:",e.reason.stack),console.log("!".repeat(80)+` -`)};cv.createRoot(document.getElementById("root")).render(c.jsx(C.StrictMode,{children:c.jsx(Rce,{children:c.jsx(xD,{basename:"/dashboard",children:c.jsx(Ice,{})})})})); diff --git a/website/dist/assets/index-CHRCH7_J.css b/website/dist/assets/index-CHRCH7_J.css new file mode 100644 index 00000000..bc709df8 --- /dev/null +++ b/website/dist/assets/index-CHRCH7_J.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Menlo,Monaco,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html{color-scheme:light}html.dark{color-scheme:dark}html,body{font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark html,.dark body{color:#f1f5f9}html,body{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}html:is(.dark *),body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark p,.dark span,.dark h1,.dark h2,.dark h3,.dark h4,.dark h5,.dark h6{color:#f1f5f9}p,span,h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}p:is(.dark *),span:is(.dark *),h1:is(.dark *),h2:is(.dark *),h3:is(.dark *),h4:is(.dark *),h5:is(.dark *),h6:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark p.text-slate-500:is(.dark *),.dark span.text-slate-500:is(.dark *),.dark div.text-slate-500:is(.dark *){color:#64748b}p.text-slate-500:is(.dark *),span.text-slate-500:is(.dark *),div.text-slate-500:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}p.text-slate-600:is(.dark *),span.text-slate-600:is(.dark *),div.text-slate-600:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .text-slate-900,.dark .text-slate-800{color:#f1f5f9!important}.dark .text-slate-700{color:#e2e8f0!important}.dark .text-slate-600{color:#cbd5e1!important}.dark .text-slate-500{color:#94a3b8!important}.dark .text-slate-400{color:#64748b!important}.dark .text-blue-800,.dark .text-blue-700{color:#93c5fd!important}.dark .text-blue-600{color:#60a5fa!important}.dark .text-brand-500{color:#818cf8!important}.dark .bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .bg-slate-100{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1));-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.dark :where(input:not([type=checkbox]):not([type=radio]):not([type=range])),.dark :where(select),.dark :where(textarea){color:#f1f5f9}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){border-radius:9999px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::-moz-placeholder,:where(select)::-moz-placeholder,:where(textarea)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::placeholder,:where(select)::placeholder,:where(textarea)::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus,:where(select):focus,:where(textarea):focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(99 102 241 / .2)}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *),:where(select):is(.dark *),:where(textarea):is(.dark *){border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::-moz-placeholder,:where(select):is(.dark *)::-moz-placeholder,:where(textarea):is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::placeholder,:where(select):is(.dark *)::placeholder,:where(textarea):is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus:is(.dark *),:where(select):focus:is(.dark *),:where(textarea):focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 51 56 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){box-shadow:0 1px 2px #0000000d!important;font-family:Outfit,sans-serif}.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),.dark select,.dark textarea{box-shadow:none!important}.dark select option{color:#f1f5f9}select option{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}select option:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}input[type=range]{accent-color:#6366f1}input[type=range]:is(.dark *){accent-color:#fff}input[type=radio],input[type=checkbox]{height:1rem;width:1rem;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));accent-color:#6366f1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}input[type=radio]:is(.dark *),input[type=checkbox]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));accent-color:#fff}input[type=radio]{border-radius:50%}input[type=checkbox]{border-radius:4px}input[type=radio]:checked,input[type=checkbox]:checked{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}input[type=radio]:checked:is(.dark *),input[type=checkbox]:checked:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.-left-16{left:-4rem}.-left-\[25px\]{left:-25px}.bottom-0{bottom:0}.left-1{left:.25rem}.left-64{left:16rem}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.top-12{top:3rem}.top-6{top:1.5rem}.top-\[76px\]{top:76px}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-\[120\]{z-index:120}.z-\[130\]{z-index:130}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-80{height:20rem}.h-\[78px\]{height:78px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.min-h-0{min-height:0px}.min-h-20{min-height:5rem}.min-h-\[150px\]{min-height:150px}.min-h-\[158px\]{min-height:158px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-\[calc\(100\%-12px\)\]{width:calc(100% - 12px)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[220px\]{min-width:220px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[1380px\]{max-width:1380px}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance: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-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[1fr_100px_32px\]{grid-template-columns:1fr 100px 32px}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#1c1c24\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(28 28 36 / var(--tw-divide-opacity, 1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[16px\]{border-radius:16px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[30px\]{border-radius:30px}.rounded-\[40px\]{border-radius:40px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1c2d50\]{--tw-border-opacity: 1;border-color:rgb(28 45 80 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-brand-500\/30{border-color:#6366f14d}.border-brand-500\/50{border-color:#6366f180}.border-emerald-500\/20{border-color:#10b98133}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/10{border-color:#ffffff1a}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.bg-\[\#07070b\]{--tw-bg-opacity: 1;background-color:rgb(7 7 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#ffffff\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-brand-500\/10{background-color:#6366f11a}.bg-brand-500\/5{background-color:#6366f10d}.bg-brand-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-400{--tw-bg-opacity: 1;background-color:rgb(192 132 252 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/5{background-color:#ef44440d}.bg-sky-500\/10{background-color:#0ea5e91a}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/70{background-color:#f8fafcb3}.bg-slate-50\/80{background-color:#f8fafccc}.bg-slate-50\/90{background-color:#f8fafce6}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/\[0\.045\]{background-color:#0f172a0b}.bg-slate-900\/\[0\.04\]{background-color:#0f172a0a}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-slate-950\/70{background-color:#020617b3}.bg-slate-950\/90{background-color:#020617e6}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-white\/60{background-color:#fff9}.bg-white\/70{background-color:#ffffffb3}.bg-white\/95{background-color:#fffffff2}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.55\)\,transparent_26\%\)\]{background-image:linear-gradient(180deg,rgba(255,255,255,.55),transparent 26%)}.bg-\[radial-gradient\(circle_at_top_left\,_rgba\(59\,130\,246\,0\.05\)\,_transparent_22\%\)\,radial-gradient\(circle_at_top_right\,_rgba\(14\,165\,233\,0\.04\)\,_transparent_20\%\)\,linear-gradient\(180deg\,_rgba\(255\,255\,255\,1\)\,_rgba\(255\,255\,255\,1\)\)\]{background-image:radial-gradient(circle at top left,rgba(59,130,246,.05),transparent 22%),radial-gradient(circle at top right,rgba(14,165,233,.04),transparent 20%),linear-gradient(180deg,#fff,#fff)}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-sky-400{--tw-gradient-from: #38bdf8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(56 189 248 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-\[\#3b82f6\]\/25{--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(59 130 246 / .25) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-blue-500{--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #3b82f6 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-cyan-300{--tw-gradient-to: #67e8f9 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-7{padding:1.75rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-6{padding-left:1.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Menlo,Monaco,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.tracking-\[-0\.05em\]{letter-spacing:-.05em}.tracking-\[0\.16em\]{letter-spacing:.16em}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-brand-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.accent-brand-500{accent-color:#6366f1}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_18px_60px_-42px_rgba\(15\,23\,42\,0\.15\)\]{--tw-shadow: 0 18px 60px -42px rgba(15,23,42,.15);--tw-shadow-colored: 0 18px 60px -42px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_28px_90px_-56px_rgba\(15\,23\,42\,0\.16\)\]{--tw-shadow: 0 28px 90px -56px rgba(15,23,42,.16);--tw-shadow-colored: 0 28px 90px -56px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_6px_20px_-16px_rgba\(15\,23\,42\,0\.18\)\]{--tw-shadow: 0 6px 20px -16px rgba(15,23,42,.18);--tw-shadow-colored: 0 6px 20px -16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.7\)\,0_14px_30px_-24px_rgba\(15\,23\,42\,0\.45\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.7),0 14px 30px -24px rgba(15,23,42,.45);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color), 0 14px 30px -24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.ring-emerald-500\/20{--tw-ring-color: rgb(16 185 129 / .2)}.ring-orange-500\/20{--tw-ring-color: rgb(249 115 22 / .2)}.ring-purple-500\/20{--tw-ring-color: rgb(168 85 247 / .2)}.ring-red-500\/20{--tw-ring-color: rgb(239 68 68 / .2)}.blur{--tw-blur: blur(8px);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)}.blur-3xl{--tw-blur: blur(64px);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)}.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{--tw-backdrop-blur: blur(8px);-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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.glass-panel{position:relative;overflow:hidden;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 18px 50px -30px rgba(15,23,42,.12);--tw-shadow-colored: 0 18px 50px -30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.glass-panel:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 26 29 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1));--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.glass-panel-hover:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.glass-panel-hover:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #a855f7 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient:is(.dark *){--tw-gradient-from: #9b51e0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(155 81 224 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #4f46e5 var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-gradient-to: #0ea5e9 var(--tw-gradient-to-position)}.aurora-top{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#9b51e0,#4f46e5,#0ea5e9,transparent);opacity:.8;z-index:100}.dark .hover\:text-slate-900:hover{color:#f1f5f9!important}.dark .hover\:text-slate-700:hover{color:#e2e8f0!important}.dark .hover\:bg-slate-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .hover\:bg-slate-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}.dark .group:hover .group-hover\:text-slate-700{color:#e2e8f0!important}.dark .group:hover .group-hover\:text-brand-500{color:#818cf8!important}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:bottom-2:before{content:var(--tw-content);bottom:.5rem}.before\:left-2:before{content:var(--tw-content);left:.5rem}.before\:top-2:before{content:var(--tw-content);top:.5rem}.before\:w-px:before{content:var(--tw-content);width:1px}.before\:bg-slate-200:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[\#3b82f6\]\/35:hover{border-color:#3b82f659}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.hover\:bg-brand-500\/15:hover{background-color:#6366f126}.hover\:bg-brand-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-900\/\[0\.025\]:hover{background-color:#0f172a06}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#28282f\]:focus{--tw-border-opacity: 1;border-color:rgb(40 40 47 / var(--tw-border-opacity, 1))}.focus\:border-\[\#3b82f6\]\/30:focus{border-color:#3b82f64d}.focus\:border-brand-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-brand-500\/20:focus{--tw-ring-color: rgb(99 102 241 / .2)}.focus\:ring-brand-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-offset-1:focus{--tw-ring-offset-width: 1px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-\[\#3b82f6\]\/40:focus-visible{--tw-ring-color: rgb(59 130 246 / .4)}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width: 0px}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.dark\:divide-\[\#222226\]:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(34 34 38 / var(--tw-divide-opacity, 1))}.dark\:border-\[\#1c1c1f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 31 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c23\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 35 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c24\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 36 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1d1d23\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 29 35 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1f1f26\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 31 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222226\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222227\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 39 / var(--tw-border-opacity, 1))}.dark\:border-\[\#22262f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 38 47 / var(--tw-border-opacity, 1))}.dark\:border-\[\#232933\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(35 41 51 / var(--tw-border-opacity, 1))}.dark\:border-\[\#27272a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:border-\[\#2a303a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 48 58 / var(--tw-border-opacity, 1))}.dark\:border-\[\#5c1c1c\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(92 28 28 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#030507\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 5 7 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#06080d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(6 8 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#08080b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 8 11 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090d\]\/95:is(.dark *){background-color:#09090df2}.dark\:bg-\[\#090c12\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 12 18 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0a0a0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0a0d12\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 13 18 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b0d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b10\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 16 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c0e\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c10\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 16 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f11\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f16\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 22 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111114\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111118\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#11141b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 20 27 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#11151d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 21 29 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121214\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121720\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 23 32 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151518\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151922\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 25 34 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#161b24\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(22 27 36 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#232933\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 41 51 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#2a0505\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(42 5 5 / var(--tw-bg-opacity, 1))}.dark\:bg-brand-500\/10:is(.dark *){background-color:#6366f11a}.dark\:bg-sky-300:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(125 211 252 / var(--tw-bg-opacity, 1))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:bg-white\/\[0\.05\]:is(.dark *){background-color:#ffffff0d}.dark\:bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.02\)\,transparent_26\%\)\]:is(.dark *){background-image:linear-gradient(180deg,rgba(255,255,255,.02),transparent 26%)}.dark\:bg-\[radial-gradient\(circle_at_top_left\,_rgba\(56\,189\,248\,0\.06\)\,_transparent_22\%\)\,linear-gradient\(180deg\,_rgba\(3\,5\,7\,1\)\,_rgba\(5\,8\,12\,1\)\)\]:is(.dark *){background-image:radial-gradient(circle at top left,rgba(56,189,248,.06),transparent 22%),linear-gradient(180deg,#030507,#05080c)}.dark\:via-\[\#3b82f6\]\/30:is(.dark *){--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(59 130 246 / .3) var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:via-\[\#3b82f6\]\/35:is(.dark *){--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(59 130 246 / .35) var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:text-\[\#697387\]:is(.dark *){--tw-text-opacity: 1;color:rgb(105 115 135 / var(--tw-text-opacity, 1))}.dark\:text-\[\#6d768a\]:is(.dark *){--tw-text-opacity: 1;color:rgb(109 118 138 / var(--tw-text-opacity, 1))}.dark\:text-\[\#7a8397\]:is(.dark *){--tw-text-opacity: 1;color:rgb(122 131 151 / var(--tw-text-opacity, 1))}.dark\:text-\[\#7d879b\]:is(.dark *){--tw-text-opacity: 1;color:rgb(125 135 155 / var(--tw-text-opacity, 1))}.dark\:text-\[\#8390a7\]:is(.dark *){--tw-text-opacity: 1;color:rgb(131 144 167 / var(--tw-text-opacity, 1))}.dark\:text-\[\#8a8a93\]:is(.dark *){--tw-text-opacity: 1;color:rgb(138 138 147 / var(--tw-text-opacity, 1))}.dark\:text-\[\#8d96aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(141 150 170 / var(--tw-text-opacity, 1))}.dark\:text-\[\#98a3b8\]:is(.dark *){--tw-text-opacity: 1;color:rgb(152 163 184 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a1a1aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a6b0c3\]:is(.dark *){--tw-text-opacity: 1;color:rgb(166 176 195 / var(--tw-text-opacity, 1))}.dark\:text-\[\#aeb6c7\]:is(.dark *){--tw-text-opacity: 1;color:rgb(174 182 199 / var(--tw-text-opacity, 1))}.dark\:text-\[\#b2bdd1\]:is(.dark *){--tw-text-opacity: 1;color:rgb(178 189 209 / var(--tw-text-opacity, 1))}.dark\:text-\[\#b3b3bd\]:is(.dark *){--tw-text-opacity: 1;color:rgb(179 179 189 / var(--tw-text-opacity, 1))}.dark\:text-\[\#d5dded\]:is(.dark *){--tw-text-opacity: 1;color:rgb(213 221 237 / var(--tw-text-opacity, 1))}.dark\:text-\[\#e5e7eb\]:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-emerald-300:is(.dark *){--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.dark\:text-orange-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.dark\:text-purple-300:is(.dark *){--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-sky-300:is(.dark *){--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.dark\:text-slate-200:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark\:text-slate-300:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-\[\#6c7486\]:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(108 116 134 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-\[\#6c7486\]:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(108 116 134 / var(--tw-placeholder-opacity, 1))}.dark\:shadow-\[0_18px_60px_-42px_rgba\(0\,0\,0\,0\.7\)\]:is(.dark *){--tw-shadow: 0 18px 60px -42px rgba(0,0,0,.7);--tw-shadow-colored: 0 18px 60px -42px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\:shadow-\[0_28px_90px_-56px_rgba\(0\,0\,0\,0\.72\)\]:is(.dark *){--tw-shadow: 0 28px 90px -56px rgba(0,0,0,.72);--tw-shadow-colored: 0 28px 90px -56px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\:shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.05\)\]:is(.dark *){--tw-shadow: inset 0 1px 0 rgba(255,255,255,.05);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\:shadow-none:is(.dark *){--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\:before\:bg-\[\#23232a\]:is(.dark *):before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(35 35 42 / var(--tw-bg-opacity, 1))}.dark\:hover\:border-\[\#2a2a31\]:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 49 / var(--tw-border-opacity, 1))}.dark\:hover\:border-\[\#2a2a33\]:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 51 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-\[\#121214\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#141923\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(20 25 35 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#171b23\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 27 35 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#18181b\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#380808\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(56 8 8 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-slate-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-white\/\[0\.035\]:hover:is(.dark *){background-color:#ffffff09}.dark\:hover\:text-\[\#dbe7ff\]:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(219 231 255 / var(--tw-text-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:p-7{padding:1.75rem}.md\:p-8{padding:2rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.md\:text-7xl{font-size:4.5rem;line-height:1}.md\:text-\[4rem\]{font-size:4rem}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[1\.1fr_0\.9fr\]{grid-template-columns:1.1fr .9fr}}@media (min-width: 1280px){.xl\:sticky{position:sticky}.xl\:top-6{top:1.5rem}.xl\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[0\.86fr_1\.14fr\]{grid-template-columns:.86fr 1.14fr}.xl\:grid-cols-\[1\.02fr_0\.98fr\]{grid-template-columns:1.02fr .98fr}.xl\:grid-cols-\[1\.15fr_0\.85fr\]{grid-template-columns:1.15fr .85fr}.xl\:grid-cols-\[340px_minmax\(0\,1fr\)\]{grid-template-columns:340px minmax(0,1fr)}.xl\:grid-cols-\[360px_minmax\(0\,1fr\)\]{grid-template-columns:360px minmax(0,1fr)}.xl\:grid-cols-\[minmax\(0\,1fr\)_380px\]{grid-template-columns:minmax(0,1fr) 380px}.xl\:self-start{align-self:flex-start}.xl\:border-b-0{border-bottom-width:0px}.xl\:border-r{border-right-width:1px}} diff --git a/website/dist/assets/index-CoBYwNuH.js b/website/dist/assets/index-CoBYwNuH.js new file mode 100644 index 00000000..aa2709eb --- /dev/null +++ b/website/dist/assets/index-CoBYwNuH.js @@ -0,0 +1,348 @@ +var K$=Object.defineProperty;var X$=(e,t,r)=>t in e?K$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Bw=(e,t,r)=>X$(e,typeof t!="symbol"?t+"":t,r);function Y$(e,t){for(var r=0;rn[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"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var gd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w2={exports:{}},hh={},_2={exports:{}},He={};/** + * @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 Xc=Symbol.for("react.element"),Z$=Symbol.for("react.portal"),Q$=Symbol.for("react.fragment"),J$=Symbol.for("react.strict_mode"),eI=Symbol.for("react.profiler"),tI=Symbol.for("react.provider"),rI=Symbol.for("react.context"),nI=Symbol.for("react.forward_ref"),aI=Symbol.for("react.suspense"),iI=Symbol.for("react.memo"),oI=Symbol.for("react.lazy"),Uw=Symbol.iterator;function sI(e){return e===null||typeof e!="object"?null:(e=Uw&&e[Uw]||e["@@iterator"],typeof e=="function"?e:null)}var S2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j2=Object.assign,O2={};function ml(e,t,r){this.props=e,this.context=t,this.refs=O2,this.updater=r||S2}ml.prototype.isReactComponent={};ml.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ml.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function k2(){}k2.prototype=ml.prototype;function dx(e,t,r){this.props=e,this.context=t,this.refs=O2,this.updater=r||S2}var fx=dx.prototype=new k2;fx.constructor=dx;j2(fx,ml.prototype);fx.isPureReactComponent=!0;var Vw=Array.isArray,A2=Object.prototype.hasOwnProperty,px={current:null},E2={key:!0,ref:!0,__self:!0,__source:!0};function P2(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)A2.call(t,n)&&!E2.hasOwnProperty(n)&&(a[n]=t[n]);var s=arguments.length-2;if(s===1)a.children=r;else if(1>>1,K=L[J];if(0>>1;Ja(be,q))uea(Pe,be)?(L[J]=Pe,L[ue]=q,J=ue):(L[J]=be,L[Q]=q,J=Q);else if(uea(Pe,q))L[J]=Pe,L[ue]=q,J=ue;else break e}}return U}function a(L,U){var q=L.sortIndex-U.sortIndex;return q!==0?q:L.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,d=null,p=3,h=!1,x=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(L){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=L)n(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=r(u)}}function S(L){if(y=!1,w(L),!x)if(r(l)!==null)x=!0,W(b);else{var U=r(u);U!==null&&V(S,U.startTime-L)}}function b(L,U){x=!1,y&&(y=!1,g(k),k=-1),h=!0;var q=p;try{for(w(U),d=r(l);d!==null&&(!(d.expirationTime>U)||L&&!T());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var K=J(d.expirationTime<=U);U=e.unstable_now(),typeof K=="function"?d.callback=K:d===r(l)&&n(l),w(U)}else n(l);d=r(l)}if(d!==null)var ae=!0;else{var Q=r(u);Q!==null&&V(S,Q.startTime-U),ae=!1}return ae}finally{d=null,p=q,h=!1}}var _=!1,O=null,k=-1,A=5,I=-1;function T(){return!(e.unstable_now()-IL||125J?(L.sortIndex=q,t(u,L),r(l)===null&&L===r(u)&&(y?(g(k),k=-1):y=!0,V(S,q-J))):(L.sortIndex=K,t(l,L),x||h||(x=!0,W(b))),L},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(L){var U=p;return function(){var q=p;p=U;try{return L.apply(this,arguments)}finally{p=q}}}})(I2);$2.exports=I2;var xI=$2.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 bI=j,Qr=xI;function ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mv=Object.prototype.hasOwnProperty,wI=/^[: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]*$/,Hw={},Gw={};function _I(e){return mv.call(Gw,e)?!0:mv.call(Hw,e)?!1:wI.test(e)?Gw[e]=!0:(Hw[e]=!0,!1)}function SI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function jI(e,t,r,n){if(t===null||typeof t>"u"||SI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pr(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ur={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ur[e]=new Pr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ur[t]=new Pr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ur[e]=new Pr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ur[e]=new Pr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ur[e]=new Pr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ur[e]=new Pr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ur[e]=new Pr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ur[e]=new Pr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ur[e]=new Pr(e,5,!1,e.toLowerCase(),null,!1,!1)});var mx=/[\-:]([a-z])/g;function yx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(mx,yx);ur[t]=new Pr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(mx,yx);ur[t]=new Pr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(mx,yx);ur[t]=new Pr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ur[e]=new Pr(e,1,!1,e.toLowerCase(),null,!1,!1)});ur.xlinkHref=new Pr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ur[e]=new Pr(e,1,!1,e.toLowerCase(),null,!0,!0)});function vx(e,t,r,n){var a=ur.hasOwnProperty(t)?ur[t]:null;(a!==null?a.type!==0:n||!(2s||a[o]!==i[s]){var l=` +`+a[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Tm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ou(e):""}function OI(e){switch(e.tag){case 5:return ou(e.type);case 16:return ou("Lazy");case 13:return ou("Suspense");case 19:return ou("SuspenseList");case 0:case 2:case 15:return e=$m(e.type,!1),e;case 11:return e=$m(e.type.render,!1),e;case 1:return e=$m(e.type,!0),e;default:return""}}function xv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qo:return"Fragment";case Zo:return"Portal";case yv:return"Profiler";case gx:return"StrictMode";case vv:return"Suspense";case gv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case D2:return(e.displayName||"Context")+".Consumer";case M2:return(e._context.displayName||"Context")+".Provider";case xx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bx:return t=e.displayName||null,t!==null?t:xv(e.type)||"Memo";case Qa:t=e._payload,e=e._init;try{return xv(e(t))}catch{}}return null}function kI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xv(t);case 8:return t===gx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function _i(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function F2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function AI(e){var t=F2(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wd(e){e._valueTracker||(e._valueTracker=AI(e))}function z2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=F2(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Af(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function bv(e,t){var r=t.checked;return kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Kw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=_i(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function B2(e,t){t=t.checked,t!=null&&vx(e,"checked",t,!1)}function wv(e,t){B2(e,t);var r=_i(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?_v(e,t.type,r):t.hasOwnProperty("defaultValue")&&_v(e,t.type,_i(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function _v(e,t,r){(t!=="number"||Af(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var su=Array.isArray;function ys(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=_d.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var bu={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},EI=["Webkit","ms","Moz","O"];Object.keys(bu).forEach(function(e){EI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bu[t]=bu[e]})});function H2(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||bu.hasOwnProperty(e)&&bu[e]?(""+t).trim():t+"px"}function G2(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=H2(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var PI=kt({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 Ov(e,t){if(t){if(PI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function kv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Av=null;function wx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ev=null,vs=null,gs=null;function Qw(e){if(e=Qc(e)){if(typeof Ev!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=xh(t),Ev(e.stateNode,e.type,t))}}function q2(e){vs?gs?gs.push(e):gs=[e]:vs=e}function K2(){if(vs){var e=vs,t=gs;if(gs=vs=null,Qw(e),t)for(e=0;e>>=0,e===0?32:31-(zI(e)/BI|0)|0}var Sd=64,jd=4194304;function lu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Cf(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~a;s!==0?n=lu(s):(i&=o,i!==0&&(n=lu(i)))}else o=r&~a,o!==0?n=lu(o):i!==0&&(n=lu(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Yc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mn(t),e[t]=r}function HI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=_u),s1=" ",l1=!1;function hA(e,t){switch(e){case"keyup":return xR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jo=!1;function wR(e,t){switch(e){case"compositionend":return mA(t);case"keypress":return t.which!==32?null:(l1=!0,s1);case"textInput":return e=t.data,e===s1&&l1?null:e;default:return null}}function _R(e,t){if(Jo)return e==="compositionend"||!Px&&hA(e,t)?(e=fA(),pf=kx=si=null,Jo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=f1(r)}}function xA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bA(){for(var e=window,t=Af();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Af(e.document)}return t}function Nx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function CR(e){var t=bA(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&xA(r.ownerDocument.documentElement,r)){if(n!==null&&Nx(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=p1(r,i);var o=p1(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,es=null,Iv=null,ju=null,Rv=!1;function h1(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Rv||es==null||es!==Af(n)||(n=es,"selectionStart"in n&&Nx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ju&&Yu(ju,n)||(ju=n,n=If(Iv,"onSelect"),0ns||(e.current=Bv[ns],Bv[ns]=null,ns--)}function ht(e,t){ns++,Bv[ns]=e.current,e.current=t}var Si={},xr=Ni(Si),Dr=Ni(!1),yo=Si;function Ts(e,t){var r=e.type.contextTypes;if(!r)return Si;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Lr(e){return e=e.childContextTypes,e!=null}function Mf(){wt(Dr),wt(xr)}function w1(e,t,r){if(xr.current!==Si)throw Error(ne(168));ht(xr,t),ht(Dr,r)}function PA(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(ne(108,kI(e)||"Unknown",a));return kt({},r,n)}function Df(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Si,yo=xr.current,ht(xr,e),ht(Dr,Dr.current),!0}function _1(e,t,r){var n=e.stateNode;if(!n)throw Error(ne(169));r?(e=PA(e,t,yo),n.__reactInternalMemoizedMergedChildContext=e,wt(Dr),wt(xr),ht(xr,e)):wt(Dr),ht(Dr,r)}var ma=null,bh=!1,qm=!1;function NA(e){ma===null?ma=[e]:ma.push(e)}function VR(e){bh=!0,NA(e)}function Ci(){if(!qm&&ma!==null){qm=!0;var e=0,t=at;try{var r=ma;for(at=1;e>=o,a-=o,ga=1<<32-Mn(t)+a|r<k?(A=O,O=null):A=O.sibling;var I=p(g,O,w[k],S);if(I===null){O===null&&(O=A);break}e&&O&&I.alternate===null&&t(g,O),m=i(I,m,k),_===null?b=I:_.sibling=I,_=I,O=A}if(k===w.length)return r(g,O),_t&&Gi(g,k),b;if(O===null){for(;kk?(A=O,O=null):A=O.sibling;var T=p(g,O,I.value,S);if(T===null){O===null&&(O=A);break}e&&O&&T.alternate===null&&t(g,O),m=i(T,m,k),_===null?b=T:_.sibling=T,_=T,O=A}if(I.done)return r(g,O),_t&&Gi(g,k),b;if(O===null){for(;!I.done;k++,I=w.next())I=d(g,I.value,S),I!==null&&(m=i(I,m,k),_===null?b=I:_.sibling=I,_=I);return _t&&Gi(g,k),b}for(O=n(g,O);!I.done;k++,I=w.next())I=h(O,g,k,I.value,S),I!==null&&(e&&I.alternate!==null&&O.delete(I.key===null?k:I.key),m=i(I,m,k),_===null?b=I:_.sibling=I,_=I);return e&&O.forEach(function(P){return t(g,P)}),_t&&Gi(g,k),b}function v(g,m,w,S){if(typeof w=="object"&&w!==null&&w.type===Qo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case bd:e:{for(var b=w.key,_=m;_!==null;){if(_.key===b){if(b=w.type,b===Qo){if(_.tag===7){r(g,_.sibling),m=a(_,w.props.children),m.return=g,g=m;break e}}else if(_.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Qa&&O1(b)===_.type){r(g,_.sibling),m=a(_,w.props),m.ref=Bl(g,_,w),m.return=g,g=m;break e}r(g,_);break}else t(g,_);_=_.sibling}w.type===Qo?(m=uo(w.props.children,g.mode,S,w.key),m.return=g,g=m):(S=wf(w.type,w.key,w.props,null,g.mode,S),S.ref=Bl(g,m,w),S.return=g,g=S)}return o(g);case Zo:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){r(g,m.sibling),m=a(m,w.children||[]),m.return=g,g=m;break e}else{r(g,m);break}else t(g,m);m=m.sibling}m=ty(w,g.mode,S),m.return=g,g=m}return o(g);case Qa:return _=w._init,v(g,m,_(w._payload),S)}if(su(w))return x(g,m,w,S);if(Ml(w))return y(g,m,w,S);Cd(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(r(g,m.sibling),m=a(m,w),m.return=g,g=m):(r(g,m),m=ey(w,g.mode,S),m.return=g,g=m),o(g)):r(g,m)}return v}var Is=IA(!0),RA=IA(!1),zf=Ni(null),Bf=null,os=null,Ix=null;function Rx(){Ix=os=Bf=null}function Mx(e){var t=zf.current;wt(zf),e._currentValue=t}function Wv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function bs(e,t){Bf=e,Ix=os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ir=!0),e.firstContext=null)}function gn(e){var t=e._currentValue;if(Ix!==e)if(e={context:e,memoizedValue:t,next:null},os===null){if(Bf===null)throw Error(ne(308));os=e,Bf.dependencies={lanes:0,firstContext:e}}else os=os.next=e;return t}var Ji=null;function Dx(e){Ji===null?Ji=[e]:Ji.push(e)}function MA(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,Dx(t)):(r.next=a.next,a.next=r),t.interleaved=r,Ca(e,n)}function Ca(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ja=!1;function Lx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DA(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Oa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Xe&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Ca(e,r)}return a=n.interleaved,a===null?(t.next=t,Dx(n)):(t.next=a.next,a.next=t),n.interleaved=t,Ca(e,r)}function mf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Sx(e,r)}}function k1(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Uf(e,t,r,n){var a=e.updateQueue;Ja=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,s=a.shared.pending;if(s!==null){a.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(i!==null){var d=a.baseState;o=0,f=u=l=null,s=i;do{var p=s.lane,h=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,y=s;switch(p=t,h=r,y.tag){case 1:if(x=y.payload,typeof x=="function"){d=x.call(h,d,p);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,p=typeof x=="function"?x.call(h,d,p):x,p==null)break e;d=kt({},d,p);break e;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,l=d):f=f.next=h,o|=p;if(s=s.next,s===null){if(s=a.shared.pending,s===null)break;p=s,s=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(f===null&&(l=d),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=f,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);xo|=o,e.lanes=o,e.memoizedState=d}}function A1(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Xm.transition;Xm.transition={};try{e(!1),t()}finally{at=r,Xm.transition=n}}function eE(){return xn().memoizedState}function qR(e,t,r){var n=gi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},tE(e))rE(t,r);else if(r=MA(e,t,r,n),r!==null){var a=Ar();Dn(r,e,n,a),nE(r,t,n)}}function KR(e,t,r){var n=gi(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(tE(e))rE(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,r);if(a.hasEagerState=!0,a.eagerState=s,Fn(s,o)){var l=t.interleaved;l===null?(a.next=a,Dx(t)):(a.next=l.next,l.next=a),t.interleaved=a;return}}catch{}finally{}r=MA(e,t,a,n),r!==null&&(a=Ar(),Dn(r,e,n,a),nE(r,t,n))}}function tE(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function rE(e,t){Ou=Wf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function nE(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Sx(e,r)}}var Hf={readContext:gn,useCallback:dr,useContext:dr,useEffect:dr,useImperativeHandle:dr,useInsertionEffect:dr,useLayoutEffect:dr,useMemo:dr,useReducer:dr,useRef:dr,useState:dr,useDebugValue:dr,useDeferredValue:dr,useTransition:dr,useMutableSource:dr,useSyncExternalStore:dr,useId:dr,unstable_isNewReconciler:!1},XR={readContext:gn,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:P1,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,vf(4194308,4,XA.bind(null,t,e),r)},useLayoutEffect:function(e,t){return vf(4194308,4,e,t)},useInsertionEffect:function(e,t){return vf(4,2,e,t)},useMemo:function(e,t){var r=Wn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Wn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=qR.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:E1,useDebugValue:Gx,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=E1(!1),t=e[0];return e=GR.bind(null,e[1]),Wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,a=Wn();if(_t){if(r===void 0)throw Error(ne(407));r=r()}else{if(r=t(),ar===null)throw Error(ne(349));go&30||BA(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,P1(VA.bind(null,n,i,e),[e]),n.flags|=2048,ac(9,UA.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Wn(),t=ar.identifierPrefix;if(_t){var r=xa,n=ga;r=(n&~(1<<32-Mn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=rc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Gn]=t,e[Ju]=n,pE(e,t,!1,!1),t.stateNode=e;e:{switch(o=kv(r,n),r){case"dialog":yt("cancel",e),yt("close",e),a=n;break;case"iframe":case"object":case"embed":yt("load",e),a=n;break;case"video":case"audio":for(a=0;aDs&&(t.flags|=128,n=!0,Ul(i,!1),t.lanes=4194304)}else{if(!n)if(e=Vf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ul(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!_t)return fr(t),null}else 2*$t()-i.renderingStartTime>Ds&&r!==1073741824&&(t.flags|=128,n=!0,Ul(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$t(),t.sibling=null,r=jt.current,ht(jt,n?r&1|2:r&1),t):(fr(t),null);case 22:case 23:return Qx(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Wr&1073741824&&(fr(t),t.subtreeFlags&6&&(t.flags|=8192)):fr(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function nM(e,t){switch(Tx(t),t.tag){case 1:return Lr(t.type)&&Mf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rs(),wt(Dr),wt(xr),Bx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return zx(t),null;case 13:if(wt(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));$s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return wt(jt),null;case 4:return Rs(),null;case 10:return Mx(t.type._context),null;case 22:case 23:return Qx(),null;case 24:return null;default:return null}}var $d=!1,yr=!1,aM=typeof WeakSet=="function"?WeakSet:Set,fe=null;function ss(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Pt(e,t,n)}else r.current=null}function Jv(e,t,r){try{r()}catch(n){Pt(e,t,n)}}var z1=!1;function iM(e,t){if(Mv=Tf,e=bA(),Nx(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,d=e,p=null;t:for(;;){for(var h;d!==r||a!==0&&d.nodeType!==3||(s=o+a),d!==i||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===r&&++u===a&&(s=o),p===i&&++f===n&&(l=o),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Dv={focusedElem:e,selectionRange:r},Tf=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,v=x.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Pn(t.type,y),v);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(S){Pt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return x=z1,z1=!1,x}function ku(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Jv(t,r,i)}a=a.next}while(a!==n)}}function Sh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function eg(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function yE(e){var t=e.alternate;t!==null&&(e.alternate=null,yE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gn],delete t[Ju],delete t[zv],delete t[BR],delete t[UR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function vE(e){return e.tag===5||e.tag===3||e.tag===4}function B1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function tg(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Rf));else if(n!==4&&(e=e.child,e!==null))for(tg(e,t,r),e=e.sibling;e!==null;)tg(e,t,r),e=e.sibling}function rg(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(rg(e,t,r),e=e.sibling;e!==null;)rg(e,t,r),e=e.sibling}var sr=null,Nn=!1;function Ka(e,t,r){for(r=r.child;r!==null;)gE(e,t,r),r=r.sibling}function gE(e,t,r){if(Yn&&typeof Yn.onCommitFiberUnmount=="function")try{Yn.onCommitFiberUnmount(mh,r)}catch{}switch(r.tag){case 5:yr||ss(r,t);case 6:var n=sr,a=Nn;sr=null,Ka(e,t,r),sr=n,Nn=a,sr!==null&&(Nn?(e=sr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):sr.removeChild(r.stateNode));break;case 18:sr!==null&&(Nn?(e=sr,r=r.stateNode,e.nodeType===8?Gm(e.parentNode,r):e.nodeType===1&&Gm(e,r),Ku(e)):Gm(sr,r.stateNode));break;case 4:n=sr,a=Nn,sr=r.stateNode.containerInfo,Nn=!0,Ka(e,t,r),sr=n,Nn=a;break;case 0:case 11:case 14:case 15:if(!yr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Jv(r,t,o),a=a.next}while(a!==n)}Ka(e,t,r);break;case 1:if(!yr&&(ss(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Pt(r,t,s)}Ka(e,t,r);break;case 21:Ka(e,t,r);break;case 22:r.mode&1?(yr=(n=yr)||r.memoizedState!==null,Ka(e,t,r),yr=n):Ka(e,t,r);break;default:Ka(e,t,r)}}function U1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new aM),t.forEach(function(n){var a=hM.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function kn(e,t){var r=t.deletions;if(r!==null)for(var n=0;na&&(a=o),n&=~i}if(n=a,n=$t()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*sM(n/1960))-n,10e?16:e,li===null)var n=!1;else{if(e=li,li=null,Kf=0,Xe&6)throw Error(ne(331));var a=Xe;for(Xe|=4,fe=e.current;fe!==null;){var i=fe,o=i.child;if(fe.flags&16){var s=i.deletions;if(s!==null){for(var l=0;l$t()-Yx?lo(e,0):Xx|=r),Fr(e,t)}function kE(e,t){t===0&&(e.mode&1?(t=jd,jd<<=1,!(jd&130023424)&&(jd=4194304)):t=1);var r=Ar();e=Ca(e,t),e!==null&&(Yc(e,t,r),Fr(e,r))}function pM(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),kE(e,r)}function hM(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ne(314))}n!==null&&n.delete(t),kE(e,r)}var AE;AE=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)Ir=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ir=!1,tM(e,t,r);Ir=!!(e.flags&131072)}else Ir=!1,_t&&t.flags&1048576&&CA(t,Ff,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;gf(e,t),e=t.pendingProps;var a=Ts(t,xr.current);bs(t,r),a=Vx(null,t,n,e,a,r);var i=Wx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Lr(n)?(i=!0,Df(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Lx(t),a.updater=_h,t.stateNode=a,a._reactInternals=t,Gv(t,n,e,r),t=Xv(null,t,n,!0,i,r)):(t.tag=0,_t&&i&&Cx(t),wr(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(gf(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=yM(n),e=Pn(n,e),a){case 0:t=Kv(null,t,n,e,r);break e;case 1:t=D1(null,t,n,e,r);break e;case 11:t=R1(null,t,n,e,r);break e;case 14:t=M1(null,t,n,Pn(n.type,e),r);break e}throw Error(ne(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),Kv(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),D1(e,t,n,a,r);case 3:e:{if(cE(t),e===null)throw Error(ne(387));n=t.pendingProps,i=t.memoizedState,a=i.element,DA(e,t),Uf(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Ms(Error(ne(423)),t),t=L1(e,t,n,r,a);break e}else if(n!==a){a=Ms(Error(ne(424)),t),t=L1(e,t,n,r,a);break e}else for(Kr=mi(t.stateNode.containerInfo.firstChild),Xr=t,_t=!0,$n=null,r=RA(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($s(),n===a){t=Ta(e,t,r);break e}wr(e,t,n,r)}t=t.child}return t;case 5:return LA(t),e===null&&Vv(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Lv(n,a)?o=null:i!==null&&Lv(n,i)&&(t.flags|=32),uE(e,t),wr(e,t,o,r),t.child;case 6:return e===null&&Vv(t),null;case 13:return dE(e,t,r);case 4:return Fx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Is(t,null,n,r):wr(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),R1(e,t,n,a,r);case 7:return wr(e,t,t.pendingProps,r),t.child;case 8:return wr(e,t,t.pendingProps.children,r),t.child;case 12:return wr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,ht(zf,n._currentValue),n._currentValue=o,i!==null)if(Fn(i.value,o)){if(i.children===a.children&&!Dr.current){t=Ta(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=Oa(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),Wv(i.return,r,t),s.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ne(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Wv(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}wr(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,bs(t,r),a=gn(a),n=n(a),t.flags|=1,wr(e,t,n,r),t.child;case 14:return n=t.type,a=Pn(n,t.pendingProps),a=Pn(n.type,a),M1(e,t,n,a,r);case 15:return sE(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),gf(e,t),t.tag=1,Lr(n)?(e=!0,Df(t)):e=!1,bs(t,r),aE(t,n,a),Gv(t,n,a,r),Xv(null,t,n,!0,e,r);case 19:return fE(e,t,r);case 22:return lE(e,t,r)}throw Error(ne(156,t.tag))};function EE(e,t){return tA(e,t)}function mM(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,r,n){return new mM(e,t,r,n)}function eb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yM(e){if(typeof e=="function")return eb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xx)return 11;if(e===bx)return 14}return 2}function xi(e,t){var r=e.alternate;return r===null?(r=mn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function wf(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")eb(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Qo:return uo(r.children,a,i,t);case gx:o=8,a|=8;break;case yv:return e=mn(12,r,t,a|2),e.elementType=yv,e.lanes=i,e;case vv:return e=mn(13,r,t,a),e.elementType=vv,e.lanes=i,e;case gv:return e=mn(19,r,t,a),e.elementType=gv,e.lanes=i,e;case L2:return Oh(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case M2:o=10;break e;case D2:o=9;break e;case xx:o=11;break e;case bx:o=14;break e;case Qa:o=16,n=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=mn(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function uo(e,t,r,n){return e=mn(7,e,n,t),e.lanes=r,e}function Oh(e,t,r,n){return e=mn(22,e,n,t),e.elementType=L2,e.lanes=r,e.stateNode={isHidden:!1},e}function ey(e,t,r){return e=mn(6,e,null,t),e.lanes=r,e}function ty(e,t,r){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vM(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rm(0),this.expirationTimes=Rm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rm(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function tb(e,t,r,n,a,i,o,s,l){return e=new vM(e,t,r,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=mn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lx(i),e}function gM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TE)}catch(e){console.error(e)}}TE(),T2.exports=en;var us=T2.exports,Y1=us;hv.createRoot=Y1.createRoot,hv.hydrateRoot=Y1.hydrateRoot;/** + * @remix-run/router v1.23.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function oc(){return oc=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ib(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jM(){return Math.random().toString(36).substr(2,8)}function Q1(e,t){return{usr:e.state,key:e.key,idx:t}}function sg(e,t,r,n){return r===void 0&&(r=null),oc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gl(t):t,{state:r,key:t&&t.key||n||jM()})}function $E(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function gl(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function OM(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,s=ui.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(oc({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){s=ui.Pop;let v=f(),g=v==null?null:v-u;u=v,l&&l({action:s,location:y.location,delta:g})}function p(v,g){s=ui.Push;let m=sg(y.location,v,g);u=f()+1;let w=Q1(m,u),S=y.createHref(m);try{o.pushState(w,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;a.location.assign(S)}i&&l&&l({action:s,location:y.location,delta:1})}function h(v,g){s=ui.Replace;let m=sg(y.location,v,g);u=f();let w=Q1(m,u),S=y.createHref(m);o.replaceState(w,"",S),i&&l&&l({action:s,location:y.location,delta:0})}function x(v){let g=a.location.origin!=="null"?a.location.origin:a.location.href,m=typeof v=="string"?v:$E(v);return m=m.replace(/ $/,"%20"),zt(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let y={get action(){return s},get location(){return e(a,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(Z1,d),l=v,()=>{a.removeEventListener(Z1,d),l=null}},createHref(v){return t(a,v)},createURL:x,encodeLocation(v){let g=x(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:h,go(v){return o.go(v)}};return y}var J1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(J1||(J1={}));function kM(e,t,r){return r===void 0&&(r="/"),AM(e,t,r)}function AM(e,t,r,n){let a=typeof t=="string"?gl(t):t,i=ME(a.pathname||"/",r);if(i==null)return null;let o=IE(e);EM(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(zt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=co([n,l.relativePath]),f=r.concat(l);i.children&&i.children.length>0&&(zt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),IE(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:RM(u,i.index),routesMeta:f})};return e.forEach((i,o)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))a(i,o);else for(let l of RE(i.path))a(i,o,l)}),t}function RE(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=RE(n.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function EM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:MM(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const PM=/^:[\w-]+$/,NM=3,CM=2,TM=1,$M=10,IM=-2,e_=e=>e==="*";function RM(e,t){let r=e.split("/"),n=r.length;return r.some(e_)&&(n+=IM),t&&(n+=CM),r.filter(a=>!e_(a)).reduce((a,i)=>a+(PM.test(i)?NM:i===""?TM:$M),n)}function MM(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function DM(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=f;if(p==="*"){let y=s[d]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const x=s[d];return h&&!x?u[p]=void 0:u[p]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function FM(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ib(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function zM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ib(!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 ME(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const BM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UM=e=>BM.test(e);function VM(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?gl(e):e,i;if(r)if(UM(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),ib(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=t_(r.substring(1),"/"):i=t_(r,t)}else i=t;return{pathname:i,search:GM(n),hash:qM(a)}}function t_(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function ry(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function WM(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function DE(e,t){let r=WM(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function LE(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=gl(e):(a=oc({},e),zt(!a.pathname||!a.pathname.includes("?"),ry("?","pathname","search",a)),zt(!a.pathname||!a.pathname.includes("#"),ry("#","pathname","hash",a)),zt(!a.search||!a.search.includes("#"),ry("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;a.pathname=p.join("/")}s=d>=0?t[d]:"/"}let l=VM(a,s),u=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const co=e=>e.join("/").replace(/\/\/+/g,"/"),HM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),GM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function KM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const FE=["post","put","patch","delete"];new Set(FE);const XM=["get",...FE];new Set(XM);/** + * React Router v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function sc(){return sc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),j.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let d=LE(u,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:co([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,o,i,e])}const QM=j.createContext(null);function JM(e){let t=j.useContext(Ti).outlet;return t&&j.createElement(QM.Provider,{value:e},t)}function eD(e,t){return tD(e,t)}function tD(e,t,r,n){td()||zt(!1);let{navigator:a}=j.useContext(ed),{matches:i}=j.useContext(Ti),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=rd(),f;if(t){var d;let v=typeof t=="string"?gl(t):t;l==="/"||(d=v.pathname)!=null&&d.startsWith(l)||zt(!1),f=v}else f=u;let p=f.pathname||"/",h=p;if(l!=="/"){let v=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let x=kM(e,{pathname:h}),y=oD(x&&x.map(v=>Object.assign({},v,{params:Object.assign({},s,v.params),pathname:co([l,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:co([l,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,r,n);return t&&y?j.createElement(Nh.Provider,{value:{location:sc({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:ui.Pop}},y):y}function rD(){let e=cD(),t=KM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:a},r):null,null)}const nD=j.createElement(rD,null);class aD extends j.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?j.createElement(Ti.Provider,{value:this.props.routeContext},j.createElement(zE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function iD(e){let{routeContext:t,match:r,children:n}=e,a=j.useContext(ob);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(Ti.Provider,{value:t},n)}function oD(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(a=r)==null?void 0:a.errors;if(s!=null){let f=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||zt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,p)=>{let h,x=!1,y=null,v=null;r&&(h=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||nD,l&&(u<0&&p===0?(fD("route-fallback"),x=!0,v=null):u===p&&(x=!0,v=d.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=y:x?w=v:d.route.Component?w=j.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=f,j.createElement(iD,{match:d,routeContext:{outlet:f,matches:g,isDataRoute:r!=null},children:w})};return r&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?j.createElement(aD,{location:r.location,revalidation:r.revalidation,component:y,error:h,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var UE=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(UE||{}),VE=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}(VE||{});function sD(e){let t=j.useContext(ob);return t||zt(!1),t}function lD(e){let t=j.useContext(YM);return t||zt(!1),t}function uD(e){let t=j.useContext(Ti);return t||zt(!1),t}function WE(e){let t=uD(),r=t.matches[t.matches.length-1];return r.route.id||zt(!1),r.route.id}function cD(){var e;let t=j.useContext(zE),r=lD(),n=WE();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function dD(){let{router:e}=sD(UE.UseNavigateStable),t=WE(VE.UseNavigateStable),r=j.useRef(!1);return BE(()=>{r.current=!0}),j.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,sc({fromRouteId:t},i)))},[e,t])}const r_={};function fD(e,t,r){r_[e]||(r_[e]=!0)}function pD(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function hD(e){let{to:t,replace:r,state:n,relative:a}=e;td()||zt(!1);let{future:i,static:o}=j.useContext(ed),{matches:s}=j.useContext(Ti),{pathname:l}=rd(),u=nd(),f=LE(t,DE(s,i.v7_relativeSplatPath),l,a==="path"),d=JSON.stringify(f);return j.useEffect(()=>u(JSON.parse(d),{replace:r,state:n,relative:a}),[u,d,a,r,n]),null}function mD(e){return JM(e.context)}function ln(e){zt(!1)}function yD(e){let{basename:t="/",children:r=null,location:n,navigationType:a=ui.Pop,navigator:i,static:o=!1,future:s}=e;td()&&zt(!1);let l=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:l,navigator:i,static:o,future:sc({v7_relativeSplatPath:!1},s)}),[l,s,i,o]);typeof n=="string"&&(n=gl(n));let{pathname:f="/",search:d="",hash:p="",state:h=null,key:x="default"}=n,y=j.useMemo(()=>{let v=ME(f,l);return v==null?null:{location:{pathname:v,search:d,hash:p,state:h,key:x},navigationType:a}},[l,f,d,p,h,x,a]);return y==null?null:j.createElement(ed.Provider,{value:u},j.createElement(Nh.Provider,{children:r,value:y}))}function vD(e){let{children:t,location:r}=e;return eD(lg(t),r)}new Promise(()=>{});function lg(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,a)=>{if(!j.isValidElement(n))return;let i=[...t,a];if(n.type===j.Fragment){r.push.apply(r,lg(n.props.children,i));return}n.type!==ln&&zt(!1),!n.props.index||!n.props.children||zt(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=lg(n.props.children,i)),r.push(o)}),r}/** + * React Router DOM v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ug(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function gD(e,t){let r=ug(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const xD="6";try{window.__reactRouterVersion=xD}catch{}const bD="startTransition",n_=fI[bD];function wD(e){let{basename:t,children:r,future:n,window:a}=e,i=j.useRef();i.current==null&&(i.current=SM({window:a,v5Compat:!0}));let o=i.current,[s,l]=j.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=j.useCallback(d=>{u&&n_?n_(()=>l(d)):l(d)},[l,u]);return j.useLayoutEffect(()=>o.listen(f),[o,f]),j.useEffect(()=>pD(n),[n]),j.createElement(yD,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}var a_;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(a_||(a_={}));var i_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(i_||(i_={}));function _D(e){let t=j.useRef(ug(e)),r=j.useRef(!1),n=rd(),a=j.useMemo(()=>gD(n.search,r.current?null:t.current),[n.search]),i=nd(),o=j.useCallback((s,l)=>{const u=ug(typeof s=="function"?s(a):s);r.current=!0,i("?"+u,l)},[i,a]);return[a,o]}/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var SD={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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const et=(e,t)=>{const r=j.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>j.createElement("svg",{ref:f,...SD,width:a,height:a,stroke:n,strokeWidth:o?Number(i)*24/Number(a):i,className:["lucide",`lucide-${jD(e)}`,s].join(" "),...u},[...t.map(([d,p])=>j.createElement(d,p)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _s=et("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HE=et("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zf=et("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OD=et("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kD=et("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cu=et("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const du=et("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AD=et("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ED=et("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PD=et("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o_=et("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ny=et("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ND=et("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ch=et("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pu=et("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CD=et("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TD=et("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $D=et("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ID=et("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RD=et("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GE=et("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qf=et("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Md=et("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ji=et("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ay=et("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MD=et("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DD=et("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LD=et("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FD=et("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $a=et("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qE=et("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s_=et("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function zD(){const e=rd(),[t,r]=j.useState(null),n=t??e.pathname;return j.useLayoutEffect(()=>{if(!t)return;(e.pathname===t||e.pathname.startsWith(`${t}/`))&&r(null)},[e.pathname,t]),c.jsxs("aside",{className:"relative z-20 flex h-screen w-64 shrink-0 flex-col border-r border-slate-200 bg-white transition-colors duration-300 dark:border-[#22262f] dark:bg-[#06080d]",children:[c.jsx("div",{className:"flex min-h-20 flex-col justify-center gap-2 border-b border-slate-200 px-6 py-5 transition-colors duration-300 dark:border-[#22262f]",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx("img",{src:"/dashboard/logo/decision-engine-light.svg",alt:"Juspay Decision Engine",className:"h-11 w-auto dark:hidden"}),c.jsx("img",{src:"/dashboard/logo/decision-engine-dark.svg",alt:"Juspay Decision Engine",className:"hidden h-11 w-auto dark:block"})]})}),c.jsxs("nav",{className:"flex-1 space-y-1 overflow-y-auto px-4 py-8",children:[c.jsx(ca,{to:"/",icon:$D,end:!0,selectedPath:n,onNavigate:r,children:"Overview"}),c.jsx(ca,{to:"/decisions",icon:MD,selectedPath:n,onNavigate:r,children:"Decision Explorer"}),c.jsx(ca,{to:"/analytics",icon:Zf,selectedPath:n,onNavigate:r,children:"Analytics"}),c.jsx(ca,{to:"/audit",icon:_s,selectedPath:n,onNavigate:r,children:"Decision Audit"}),c.jsx("div",{className:"flex items-center gap-2 px-3 pb-3 pt-8",children:c.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-slate-400 dark:text-[#6d768a]",children:"Routing"})}),c.jsx(ca,{to:"/routing",icon:Pu,end:!0,selectedPath:n,onNavigate:r,children:"Routing Hub"}),c.jsx(ca,{to:"/routing/sr",icon:qE,indent:!0,selectedPath:n,onNavigate:r,children:"Auth-Rate Based"}),c.jsx(ca,{to:"/routing/rules",icon:OD,indent:!0,selectedPath:n,onNavigate:r,children:"Rule-Based"}),c.jsx(ca,{to:"/routing/volume",icon:Qf,indent:!0,selectedPath:n,onNavigate:r,children:"Volume Split"}),c.jsx(ca,{to:"/routing/debit",icon:GE,indent:!0,selectedPath:n,onNavigate:r,children:"Debit Routing"})]}),c.jsx("div",{className:"border-t border-slate-200 bg-white px-6 py-5 transition-colors duration-300 dark:border-[#22262f] dark:bg-[#0a0d12]",children:c.jsx("span",{className:"text-[11px] font-medium tracking-wide text-slate-500 dark:text-[#7d879b]",children:"v1.4"})})]})}function ca({to:e,icon:t,children:r,end:n,indent:a,selectedPath:i,onNavigate:o}){const s=nd(),l=n?i===e:i===e||i.startsWith(`${e}/`);return c.jsxs("button",{type:"button","aria-current":l?"page":void 0,onMouseDown:u=>{u.detail>0&&u.preventDefault()},onClick:u=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur(),o==null||o(e),u.currentTarget.blur(),s(e)},className:`group relative flex w-full appearance-none items-center gap-3 rounded-[16px] border-0 px-4 py-3 text-[14px] font-medium transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#3b82f6]/40 focus-visible:ring-offset-0 ${a?"ml-3 w-[calc(100%-12px)]":""} ${l?"bg-slate-900/[0.045] text-slate-950 shadow-[inset_0_1px_0_rgba(255,255,255,0.7),0_14px_30px_-24px_rgba(15,23,42,0.45)] dark:bg-[#151922] dark:text-white dark:shadow-[inset_0_1px_0_rgba(255,255,255,0.05)]":"bg-transparent text-slate-500 hover:bg-slate-900/[0.025] hover:text-slate-900 dark:text-[#8d96aa] dark:hover:bg-white/[0.035] dark:hover:text-white"}`,children:[c.jsx("span",{"aria-hidden":"true",className:`absolute left-1 top-1/2 h-8 w-1 -translate-y-1/2 rounded-full transition-all duration-150 ${l?"bg-brand-600 opacity-100 dark:bg-sky-300":"opacity-0"}`}),c.jsx(t,{size:18,className:`transition-colors duration-200 ${l?"text-brand-600 dark:text-sky-300":"text-slate-400 group-hover:text-slate-700 dark:text-[#697387] dark:group-hover:text-white"}`,strokeWidth:l?2.5:2}),c.jsx("span",{className:"flex-1 text-left",children:r})]})}const BD={},l_=e=>{let t;const r=new Set,n=(f,d)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(x=>x(t,h))}},a=()=>t,l={setState:n,getState:a,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(BD?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,a,l);return l},UD=e=>e?l_(e):l_;var KE={exports:{}},XE={},YE={exports:{}},ZE={};/** + * @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 Ls=j;function VD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var WD=typeof Object.is=="function"?Object.is:VD,HD=Ls.useState,GD=Ls.useEffect,qD=Ls.useLayoutEffect,KD=Ls.useDebugValue;function XD(e,t){var r=t(),n=HD({inst:{value:r,getSnapshot:t}}),a=n[0].inst,i=n[1];return qD(function(){a.value=r,a.getSnapshot=t,iy(a)&&i({inst:a})},[e,r,t]),GD(function(){return iy(a)&&i({inst:a}),e(function(){iy(a)&&i({inst:a})})},[e]),KD(r),r}function iy(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!WD(e,r)}catch{return!0}}function YD(e,t){return t()}var ZD=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?YD:XD;ZE.useSyncExternalStore=Ls.useSyncExternalStore!==void 0?Ls.useSyncExternalStore:ZD;YE.exports=ZE;var cg=YE.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.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 Th=j,QD=cg;function JD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var e3=typeof Object.is=="function"?Object.is:JD,t3=QD.useSyncExternalStore,r3=Th.useRef,n3=Th.useEffect,a3=Th.useMemo,i3=Th.useDebugValue;XE.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=r3(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=a3(function(){function l(h){if(!u){if(u=!0,f=h,h=n(h),a!==void 0&&o.hasValue){var x=o.value;if(a(x,h))return d=x}return d=h}if(x=d,e3(f,h))return x;var y=n(h);return a!==void 0&&a(x,y)?(f=h,x):(f=h,d=y)}var u=!1,f,d,p=r===void 0?null:r;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,r,n,a]);var s=t3(e,i[0],i[1]);return n3(function(){o.hasValue=!0,o.value=s},[s]),i3(s),s};KE.exports=XE;var o3=KE.exports;const s3=nt(o3),QE={},{useDebugValue:l3}=C,{useSyncExternalStoreWithSelector:u3}=s3;let u_=!1;const c3=e=>e;function d3(e,t=c3,r){(QE?"production":void 0)!=="production"&&r&&!u_&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),u_=!0);const n=u3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return l3(n),n}const f3=e=>{(QE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?UD(e):e,r=(n,a)=>d3(t,n,a);return Object.assign(r,t),r},p3=e=>f3,h3={};function m3(e,t){let r;try{r=e()}catch{return}return{getItem:a=>{var i;const o=l=>l===null?null:JSON.parse(l,void 0),s=(i=r.getItem(a))!=null?i:null;return s instanceof Promise?s.then(o):o(s)},setItem:(a,i)=>r.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>r.removeItem(a)}}const lc=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return lc(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return lc(n)(r)}}}},y3=(e,t)=>(r,n,a)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,g)=>({...g,...v}),...t},o=!1;const s=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...v)},n,a);const f=lc(i.serialize),d=()=>{const v=i.partialize({...n()});let g;const m=f({state:v,version:i.version}).then(w=>u.setItem(i.name,w)).catch(w=>{g=w});if(g)throw g;return m},p=a.setState;a.setState=(v,g)=>{p(v,g),d()};const h=e((...v)=>{r(...v),d()},n,a);let x;const y=()=>{var v;if(!u)return;o=!1,s.forEach(m=>m(n()));const g=((v=i.onRehydrateStorage)==null?void 0:v.call(i,n()))||void 0;return lc(u.getItem.bind(u))(i.name).then(m=>{if(m)return i.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var w;return x=i.merge(m,(w=n())!=null?w:h),r(x,!0),d()}).then(()=>{g==null||g(x,void 0),o=!0,l.forEach(m=>m(x))}).catch(m=>{g==null||g(void 0,m)})};return a.persist={setOptions:v=>{i={...i,...v},v.getStorage&&(u=v.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},y(),x||h},v3=(e,t)=>(r,n,a)=>{let i={storage:m3(()=>localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},o=!1;const s=new Set,l=new Set;let u=i.storage;if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...y)},n,a);const f=()=>{const y=i.partialize({...n()});return u.setItem(i.name,{state:y,version:i.version})},d=a.setState;a.setState=(y,v)=>{d(y,v),f()};const p=e((...y)=>{r(...y),f()},n,a);a.getInitialState=()=>p;let h;const x=()=>{var y,v;if(!u)return;o=!1,s.forEach(m=>{var w;return m((w=n())!=null?w:p)});const g=((v=i.onRehydrateStorage)==null?void 0:v.call(i,(y=n())!=null?y:p))||void 0;return lc(u.getItem.bind(u))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return[!0,i.migrate(m.state,m.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var w;const[S,b]=m;if(h=i.merge(b,(w=n())!=null?w:p),r(h,!0),S)return f()}).then(()=>{g==null||g(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{g==null||g(void 0,m)})};return a.persist={setOptions:y=>{i={...i,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},i.skipHydration||x(),h||p},g3=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((h3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),y3(e,t)):v3(e,t),x3=g3,ia=p3()(x3(e=>({merchantId:"",setMerchantId:t=>{console.log(` +[STORE] Merchant ID changed: "${t}"`),e({merchantId:t})}}),{name:"merchant-store"})),b3="public";function w3(e,t,r){console.log(` +`+"=".repeat(80)),console.log(`[API REQUEST] ${new Date().toISOString()}`),console.log(`Method: ${e}`),console.log(`Path: ${t}`),r!==void 0&&console.log("Body:",JSON.stringify(r,null,2)),console.log("=".repeat(80))}function _3(e,t,r,n){console.log(` +`+"-".repeat(80)),console.log(`[API RESPONSE] ${new Date().toISOString()}`),console.log(`Path: ${e}`),console.log(`Status: ${t} ${r}`),console.log("Response Body:",n),console.log("-".repeat(80)+` +`)}function c_(e,t){console.log(` +`+"!".repeat(80)),console.log(`[API ERROR] ${new Date().toISOString()}`),console.log(`Path: ${e}`),t instanceof Error?(console.log("Error:",t.message),console.log("Stack:",t.stack)):console.log("Error:",t),console.log("!".repeat(80)+` +`)}async function JE(e,t){const r=(t==null?void 0:t.method)||"GET",n=t!=null&&t.body?JSON.parse(t.body):void 0;w3(r,e,n);try{const a=await fetch(e,{headers:{"Content-Type":"application/json","x-tenant-id":b3,...t==null?void 0:t.headers},...t}),i=await a.text();let o;try{const s=JSON.parse(i);o=JSON.stringify(s,null,2)}catch{o=i}if(_3(e,a.status,a.statusText,o),!a.ok){const s=new Error(`API error ${a.status}: ${i}`);throw c_(e,s),s}return i.trim()?JSON.parse(i):void 0}catch(a){throw c_(e,a),a}}async function bt(e,t){return JE(e,{method:"POST",body:t!==void 0?JSON.stringify(t):void 0})}async function Qn(e){return JE(e)}function S3(){const{merchantId:e,setMerchantId:t}=ia(),[r,n]=j.useState(e),[a,i]=j.useState(!1),[o,s]=j.useState(()=>localStorage.getItem("theme")==="dark");j.useEffect(()=>{const u=window.document.documentElement;o?(u.classList.add("dark"),localStorage.setItem("theme","dark")):(u.classList.remove("dark"),localStorage.setItem("theme","light"))},[o]);async function l(){const u=r.trim();if(u){t(u),i(!0);try{await bt("/merchant-account/create",{merchant_id:u,gateway_success_rate_based_decider_input:null})}catch{}finally{i(!1)}}}return c.jsxs("header",{className:"relative z-10 flex h-[78px] shrink-0 items-center justify-between border-b border-slate-200 bg-white px-6 transition-colors duration-300 dark:border-[#22262f] dark:bg-[#06080d] md:px-8",children:[c.jsx("div",{}),c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsxs("div",{className:"relative",children:[c.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&l(),placeholder:"Set Merchant ID",className:"w-72 rounded-full border border-slate-200 bg-white px-4 py-2 text-sm text-slate-900 shadow-[0_6px_20px_-16px_rgba(15,23,42,0.18)] transition-all placeholder-slate-400 focus:outline-none focus:border-[#3b82f6]/30 dark:border-[#22262f] dark:bg-[#11141b] dark:text-white dark:placeholder-[#6c7486] dark:shadow-none"}),c.jsx("button",{onClick:l,disabled:a,className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-slate-400 transition-colors hover:text-slate-700 dark:text-[#7a8397] dark:hover:text-[#dbe7ff]",children:a?c.jsx(ID,{size:16,className:"animate-spin"}):c.jsx(HE,{size:16})})]}),e&&c.jsxs("div",{className:"ml-2 flex items-center gap-2 border-l border-slate-200 pl-6 transition-colors duration-300 dark:border-[#22262f]",children:[c.jsx(kD,{size:16,className:"text-brand-500 dark:text-sky-300"}),c.jsx("span",{className:"text-sm font-medium text-slate-800 dark:text-white",children:e})]}),c.jsx("button",{onClick:()=>s(!o),className:"rounded-full border border-slate-200 bg-white p-2.5 text-slate-600 shadow-[0_6px_20px_-16px_rgba(15,23,42,0.18)] transition-colors duration-200 hover:bg-slate-50 hover:text-slate-900 dark:border-[#22262f] dark:bg-[#11141b] dark:text-[#aeb6c7] dark:shadow-none dark:hover:bg-[#171b23] dark:hover:text-white","aria-label":"Toggle theme",children:o?c.jsx(FD,{size:18}):c.jsx(RD,{size:18})})]})]})}function j3(){return c.jsxs("div",{className:"relative flex h-screen overflow-hidden bg-[#ffffff] text-slate-900 transition-colors duration-300 dark:bg-[#030507] dark:text-white",children:[c.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_left,_rgba(59,130,246,0.05),_transparent_22%),radial-gradient(circle_at_top_right,_rgba(14,165,233,0.04),_transparent_20%),linear-gradient(180deg,_rgba(255,255,255,1),_rgba(255,255,255,1))] dark:bg-[radial-gradient(circle_at_top_left,_rgba(56,189,248,0.06),_transparent_22%),linear-gradient(180deg,_rgba(3,5,7,1),_rgba(5,8,12,1))]"}),c.jsx("div",{className:"aurora-top"}),c.jsx(zD,{}),c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[c.jsx(S3,{}),c.jsx("main",{className:"relative flex-1 overflow-y-auto p-6 md:p-8",children:c.jsx(mD,{})})]})]})}const eP=0,tP=1,rP=2,d_=3;var f_=Object.prototype.hasOwnProperty;function dg(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&dg(e[n],t[n]););return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(f_.call(e,r)&&++n&&!f_.call(t,r)||!(r in t)||!dg(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const va=new WeakMap,ba=()=>{},vr=ba(),fg=Object,qe=e=>e===vr,qn=e=>typeof e=="function",Oi=(e,t)=>({...e,...t}),nP=e=>qn(e.then),oy={},Dd={},sb="undefined",ad=typeof window!=sb,pg=typeof document!=sb,O3=ad&&"Deno"in window,k3=()=>ad&&typeof window.requestAnimationFrame!=sb,aP=(e,t)=>{const r=va.get(e);return[()=>!qe(t)&&e.get(t)||oy,n=>{if(!qe(t)){const a=e.get(t);t in Dd||(Dd[t]=a),r[5](t,Oi(a,n),a||oy)}},r[6],()=>!qe(t)&&t in Dd?Dd[t]:!qe(t)&&e.get(t)||oy]};let hg=!0;const A3=()=>hg,[mg,yg]=ad&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ba,ba],E3=()=>{const e=pg&&document.visibilityState;return qe(e)||e!=="hidden"},P3=e=>(pg&&document.addEventListener("visibilitychange",e),mg("focus",e),()=>{pg&&document.removeEventListener("visibilitychange",e),yg("focus",e)}),N3=e=>{const t=()=>{hg=!0,e()},r=()=>{hg=!1};return mg("online",t),mg("offline",r),()=>{yg("online",t),yg("offline",r)}},C3={isOnline:A3,isVisible:E3},T3={initFocus:P3,initReconnect:N3},p_=!C.useId,Ss=!ad||O3,$3=e=>k3()?window.requestAnimationFrame(e):setTimeout(e,1),sy=Ss?j.useEffect:j.useLayoutEffect,ly=typeof navigator<"u"&&navigator.connection,h_=!Ss&&ly&&(["slow-2g","2g"].includes(ly.effectiveType)||ly.saveData),Ld=new WeakMap,I3=e=>fg.prototype.toString.call(e),uy=(e,t)=>e===`[object ${t}]`;let R3=0;const vg=e=>{const t=typeof e,r=I3(e),n=uy(r,"Date"),a=uy(r,"RegExp"),i=uy(r,"Object");let o,s;if(fg(e)===e&&!n&&!a){if(o=Ld.get(e),o)return o;if(o=++R3+"~",Ld.set(e,o),Array.isArray(e)){for(o="@",s=0;s{if(qn(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?vg(e):"",[e,t]};let M3=0;const gg=()=>++M3;async function iP(...e){const[t,r,n,a]=e,i=Oi({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const u=p=>typeof s=="function"?s(p):s!==!1,f=i.throwOnError;if(qn(r)){const p=r,h=[],x=t.keys();for(const y of x)!/^\$(inf|sub)\$/.test(y)&&p(t.get(y)._k)&&h.push(y);return Promise.all(h.map(d))}return d(r);async function d(p){const[h]=lb(p);if(!h)return;const[x,y]=aP(t,h),[v,g,m,w]=va.get(t),S=()=>{const M=v[h];return(qn(i.revalidate)?i.revalidate(x().data,p):i.revalidate!==!1)&&(delete m[h],delete w[h],M&&M[0])?M[0](rP).then(()=>x().data):x().data};if(e.length<3)return S();let b=n,_,O=!1;const k=gg();g[h]=[k,0];const A=!qe(l),I=x(),T=I.data,P=I._c,R=qe(P)?T:P;if(A&&(l=qn(l)?l(R,T):l,y({data:l,_c:R})),qn(b))try{b=b(R)}catch(M){_=M,O=!0}if(b&&nP(b))if(b=await b.catch(M=>{_=M,O=!0}),k!==g[h][0]){if(O)throw _;return b}else O&&A&&u(_)&&(o=!0,y({data:R,_c:vr}));if(o&&!O)if(qn(o)){const M=o(b,R);y({data:M,error:vr,_c:vr})}else y({data:b,error:vr,_c:vr});if(g[h][1]=gg(),Promise.resolve(S()).then(()=>{y({_c:vr})}),O){if(f)throw _;return}return b}}const m_=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},D3=(e,t)=>{if(!va.has(e)){const r=Oi(T3,t),n=Object.create(null),a=iP.bind(vr,e);let i=ba;const o=Object.create(null),s=(f,d)=>{const p=o[f]||[];return o[f]=p,p.push(d),()=>p.splice(p.indexOf(d),1)},l=(f,d,p)=>{e.set(f,d);const h=o[f];if(h)for(const x of h)x(d,p)},u=()=>{if(!va.has(e)&&(va.set(e,[n,Object.create(null),Object.create(null),Object.create(null),a,l,s]),!Ss)){const f=r.initFocus(setTimeout.bind(vr,m_.bind(vr,n,eP))),d=r.initReconnect(setTimeout.bind(vr,m_.bind(vr,n,tP)));i=()=>{f&&f(),d&&d(),va.delete(e)}}};return u(),[e,a,u,i]}return[e,va.get(e)[4]]},L3=(e,t,r,n,a)=>{const i=r.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!qe(i)&&o>i||setTimeout(n,s,a)},F3=dg,[oP,z3]=D3(new Map),B3=Oi({onLoadingSlow:ba,onSuccess:ba,onError:ba,onErrorRetry:L3,onDiscarded:ba,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:h_?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:h_?5e3:3e3,compare:F3,isPaused:()=>!1,cache:oP,mutate:z3,fallback:{}},C3),U3=(e,t)=>{const r=Oi(e,t);if(t){const{use:n,fallback:a}=e,{use:i,fallback:o}=t;n&&i&&(r.use=n.concat(i)),a&&o&&(r.fallback=Oi(a,o))}return r},V3=j.createContext({}),W3="$inf$",sP=ad&&window.__SWR_DEVTOOLS_USE__,H3=sP?window.__SWR_DEVTOOLS_USE__:[],G3=()=>{sP&&(window.__SWR_DEVTOOLS_REACT__=C)},q3=e=>qn(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],K3=()=>{const e=j.useContext(V3);return j.useMemo(()=>Oi(B3,e),[e])},X3=e=>(t,r,n)=>e(t,r&&((...i)=>{const[o]=lb(t),[,,,s]=va.get(oP);if(o.startsWith(W3))return r(...i);const l=s[o];return qe(l)?r(...i):(delete s[o],l)}),n),Y3=H3.concat(X3),Z3=e=>function(...r){const n=K3(),[a,i,o]=q3(r),s=U3(n,o);let l=e;const{use:u}=s,f=(u||[]).concat(Y3);for(let d=f.length;d--;)l=f[d](l);return l(a,i||s.fetcher||null,s)},Q3=(e,t,r)=>{const n=t[e]||(t[e]=[]);return n.push(r),()=>{const a=n.indexOf(r);a>=0&&(n[a]=n[n.length-1],n.pop())}};G3();const cy=C.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),dy={dedupe:!0},y_=Promise.resolve(vr),J3=()=>ba,eL=(e,t,r)=>{const{cache:n,compare:a,suspense:i,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:d,keepPreviousData:p,strictServerPrefetchWarning:h}=r,[x,y,v,g]=va.get(n),[m,w]=lb(e),S=j.useRef(!1),b=j.useRef(!1),_=j.useRef(m),O=j.useRef(t),k=j.useRef(r),A=()=>k.current,I=()=>A().isVisible()&&A().isOnline(),[T,P,R,M]=aP(n,m),F=j.useRef({}).current,W=qe(o)?qe(r.fallback)?vr:r.fallback[m]:o,V=(ge,Ce)=>{for(const Me in F){const je=Me;if(je==="data"){if(!a(ge[je],Ce[je])&&(!qe(ge[je])||!a(ue,Ce[je])))return!1}else if(Ce[je]!==ge[je])return!1}return!0},L=!S.current,U=j.useMemo(()=>{const ge=T(),Ce=M(),Me=E=>{const D=Oi(E);return delete D._k,(()=>{if(!m||!t||A().isPaused())return!1;if(L&&!qe(s))return s;const B=qe(W)?D.data:W;return qe(B)||l})()?{isValidating:!0,isLoading:!0,...D}:D},je=Me(ge),Ge=ge===Ce?je:Me(Ce);let H=je;return[()=>{const E=Me(T());return V(E,H)?(H.data=E.data,H.isLoading=E.isLoading,H.isValidating=E.isValidating,H.error=E.error,H):(H=E,E)},()=>Ge]},[n,m]),q=cg.useSyncExternalStore(j.useCallback(ge=>R(m,(Ce,Me)=>{V(Me,Ce)||ge()}),[n,m]),U[0],U[1]),J=x[m]&&x[m].length>0,K=q.data,ae=qe(K)?W&&nP(W)?cy(W):W:K,Q=q.error,be=j.useRef(ae),ue=p?qe(K)?qe(be.current)?ae:be.current:K:ae,Pe=m&&qe(ae),Fe=j.useRef(null);!Ss&&cg.useSyncExternalStore(J3,()=>(Fe.current=!1,Fe),()=>(Fe.current=!0,Fe));const te=Fe.current;h&&te&&!i&&Pe&&console.warn(`Missing pre-initiated data for serialized key "${m}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const ie=!m||!t||A().isPaused()||J&&!qe(Q)?!1:L&&!qe(s)?s:i?qe(ae)?!1:l:qe(ae)||l,he=L&&ie,X=qe(q.isValidating)?he:q.isValidating,ke=qe(q.isLoading)?he:q.isLoading,ve=j.useCallback(async ge=>{const Ce=O.current;if(!m||!Ce||b.current||A().isPaused())return!1;let Me,je,Ge=!0;const H=ge||{},E=!v[m]||!H.dedupe,D=()=>p_?!b.current&&m===_.current&&S.current:m===_.current,N={isValidating:!1,isLoading:!1},B=()=>{P(N)},G=()=>{const Z=v[m];Z&&Z[1]===je&&delete v[m]},ee={isValidating:!0};qe(T().data)&&(ee.isLoading=!0);try{if(E&&(P(ee),r.loadingTimeout&&qe(T().data)&&setTimeout(()=>{Ge&&D()&&A().onLoadingSlow(m,r)},r.loadingTimeout),v[m]=[Ce(w),gg()]),[Me,je]=v[m],Me=await Me,E&&setTimeout(G,r.dedupingInterval),!v[m]||v[m][1]!==je)return E&&D()&&A().onDiscarded(m),!1;N.error=vr;const Z=y[m];if(!qe(Z)&&(je<=Z[0]||je<=Z[1]||Z[1]===0))return B(),E&&D()&&A().onDiscarded(m),!1;const me=T().data;N.data=a(me,Me)?me:Me,E&&D()&&A().onSuccess(Me,m,r)}catch(Z){G();const me=A(),{shouldRetryOnError:Ne}=me;me.isPaused()||(N.error=Z,E&&D()&&(me.onError(Z,m,me),(Ne===!0||qn(Ne)&&Ne(Z))&&(!A().revalidateOnFocus||!A().revalidateOnReconnect||I())&&me.onErrorRetry(Z,m,me,At=>{const Ct=x[m];Ct&&Ct[0]&&Ct[0](d_,At)},{retryCount:(H.retryCount||0)+1,dedupe:!0})))}return Ge=!1,B(),!0},[m,n]),Ae=j.useCallback((...ge)=>iP(n,_.current,...ge),[]);if(sy(()=>{O.current=t,k.current=r,qe(K)||(be.current=K)}),sy(()=>{if(!m)return;const ge=ve.bind(vr,dy);let Ce=0;A().revalidateOnFocus&&(Ce=Date.now()+A().focusThrottleInterval);const je=Q3(m,x,(Ge,H={})=>{if(Ge==eP){const E=Date.now();A().revalidateOnFocus&&E>Ce&&I()&&(Ce=E+A().focusThrottleInterval,ge())}else if(Ge==tP)A().revalidateOnReconnect&&I()&&ge();else{if(Ge==rP)return ve();if(Ge==d_)return ve(H)}});return b.current=!1,_.current=m,S.current=!0,P({_k:w}),ie&&(v[m]||(qe(ae)||Ss?ge():$3(ge))),()=>{b.current=!0,je()}},[m]),sy(()=>{let ge;function Ce(){const je=qn(u)?u(T().data):u;je&&ge!==-1&&(ge=setTimeout(Me,je))}function Me(){!T().error&&(f||A().isVisible())&&(d||A().isOnline())?ve(dy).then(Ce):Ce()}return Ce(),()=>{ge&&(clearTimeout(ge),ge=-1)}},[u,f,d,m]),j.useDebugValue(ue),i){if(!p_&&Ss&&Pe)throw new Error("Fallback data is required when using Suspense in SSR.");Pe&&(O.current=t,k.current=r,b.current=!1);const ge=g[m],Ce=!qe(ge)&&Pe?Ae(ge):y_;if(cy(Ce),!qe(Q)&&Pe)throw Q;const Me=Pe?ve(dy):y_;!qe(ue)&&Pe&&(Me.status="fulfilled",Me.value=!0),cy(Me)}return{mutate:Ae,get data(){return F.data=!0,ue},get error(){return F.error=!0,Q},get isValidating(){return F.isValidating=!0,X},get isLoading(){return F.isLoading=!0,ke}}},Ft=Z3(eL),tL={green:"bg-emerald-500/10 text-emerald-600 ring-1 ring-inset ring-emerald-500/20 dark:text-emerald-300",gray:"bg-slate-900/[0.04] text-slate-700 ring-1 ring-inset ring-slate-900/8 dark:bg-white/[0.05] dark:text-slate-300 dark:ring-white/8",blue:"bg-blue-500/10 text-blue-600 ring-1 ring-inset ring-blue-500/20 dark:text-blue-300",red:"bg-red-500/10 text-red-600 ring-1 ring-inset ring-red-500/20 dark:text-red-300",orange:"bg-orange-500/10 text-orange-600 ring-1 ring-inset ring-orange-500/20 dark:text-orange-300",purple:"bg-purple-500/10 text-purple-600 ring-1 ring-inset ring-purple-500/20 dark:text-purple-300"};function Oe({variant:e="gray",children:t}){return c.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${tL[e]}`,children:t})}function rL(){const[e,t]=j.useState("loading");return j.useEffect(()=>{fetch("/health").then(r=>t(r.ok?"up":"down")).catch(()=>t("down"))},[]),e}function Fd(e){return new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:e&&e<100?1:0}).format(e||0)}function fy(e){return e==null||Number.isNaN(e)?"0%":`${e.toFixed(e>=100?0:1)}%`}function py(e){return e?new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):"No updates yet"}function nL(e){return e==="up"?"Healthy":e==="down"?"Needs attention":"Checking"}function ya({children:e,className:t="",onClick:r}){const n="group relative overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-[0_18px_60px_-42px_rgba(15,23,42,0.15)] dark:border-[#2a303a] dark:bg-[#11151d] dark:shadow-[0_18px_60px_-42px_rgba(0,0,0,0.7)]",a=c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-[#3b82f6]/25 to-transparent dark:via-[#3b82f6]/30"}),c.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(180deg,rgba(255,255,255,0.55),transparent_26%)] dark:bg-[linear-gradient(180deg,rgba(255,255,255,0.02),transparent_26%)]"}),c.jsx("div",{className:"relative",children:e})]});return r?c.jsx("button",{type:"button",onClick:r,className:`${n} text-left transition duration-300 hover:-translate-y-0.5 hover:border-[#3b82f6]/35 hover:bg-slate-50 dark:hover:bg-[#141923] ${t}`,children:a}):c.jsx("div",{className:`${n} ${t}`,children:a})}function to({children:e}){return c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8390a7]",children:e})}function hy({label:e,value:t,detail:r}){return c.jsxs("div",{className:"rounded-[22px] border border-slate-200 bg-white px-4 py-4 dark:border-[#2a303a] dark:bg-[#161b24]",children:[c.jsx(to,{children:e}),c.jsx("p",{className:"mt-3 text-2xl font-semibold tracking-tight text-slate-950 dark:text-white",children:t}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#b2bdd1]",children:r})]})}function zd({icon:e,label:t,value:r,detail:n}){return c.jsx(ya,{className:"p-5",children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx(to,{children:t}),c.jsx("p",{className:"mt-4 text-3xl font-semibold tracking-tight text-slate-950 dark:text-white",children:r}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#b2bdd1]",children:n})]}),c.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-3 dark:border-[#2a303a] dark:bg-[#161b24]",children:c.jsx(e,{className:"h-5 w-5 text-brand-600 dark:text-sky-300"})})]})})}function aL(){return c.jsxs("div",{className:"grid gap-5 pt-8 lg:grid-cols-[1.1fr_0.9fr]",children:[c.jsxs(ya,{className:"p-7",children:[c.jsx(to,{children:"Merchant required"}),c.jsx("h2",{className:"mt-4 max-w-xl text-3xl font-semibold tracking-tight text-slate-950 dark:text-white",children:"Set a merchant in the top bar to turn this into a live overview."}),c.jsx("p",{className:"mt-4 max-w-xl text-sm leading-7 text-slate-600 dark:text-[#b2bdd1]",children:"Once selected, this page will show business-facing status: service health, active routing, request count, and the gateway currently handling the most traffic."})]}),c.jsx(ya,{className:"p-7",children:c.jsx("div",{className:"space-y-5",children:[{icon:_s,title:"System status",text:"Check whether the service is reachable."},{icon:Pu,title:"Routing setup",text:"See whether a strategy is configured."},{icon:Zf,title:"Gateway activity",text:"View recent request distribution by gateway."}].map(e=>c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-3 dark:border-[#2a303a] dark:bg-[#161b24]",children:c.jsx(e.icon,{className:"h-5 w-5 text-brand-600 dark:text-sky-300"})}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:e.title}),c.jsx("p",{className:"mt-1 text-sm leading-6 text-slate-600 dark:text-[#b2bdd1]",children:e.text})]})]},e.title))})})]})}function iL(){var S,b,_,O,k,A,I,T,P,R;const e=nd(),{merchantId:t}=ia(),r=rL(),{data:n}=Ft(t?`/routing/list/active/${t}`:null,()=>bt(`/routing/list/active/${t}`),{shouldRetryOnError:!1}),{data:a}=Ft(t?["/rule/get","successRate",t]:null,()=>bt("/rule/get",{merchant_id:t,algorithm:"successRate"}),{shouldRetryOnError:!1}),i=t?`/analytics/overview?scope=current&range=1h&merchant_id=${encodeURIComponent(t)}`:null,o=t?`/analytics/routing-stats?scope=current&range=1h&merchant_id=${encodeURIComponent(t)}`:null,s=Ft(i,Qn,{refreshInterval:15e3,revalidateOnFocus:!0,shouldRetryOnError:!1}),l=Ft(o,Qn,{refreshInterval:15e3,revalidateOnFocus:!0,shouldRetryOnError:!1}),u=(n==null?void 0:n[0])||null,f=(n||[]).some(M=>{var F;return((F=M.algorithm_data||M.algorithm)==null?void 0:F.type)==="advanced"}),d=((S=s.data)==null?void 0:S.generated_at_ms)||((b=l.data)==null?void 0:b.generated_at_ms)||void 0,h=((O=(((_=s.data)==null?void 0:_.route_hits)||[]).find(M=>M.route==="/decide_gateway"))==null?void 0:O.count)||0,x=((A=(k=s.data)==null?void 0:k.top_errors)==null?void 0:A.reduce((M,F)=>M+F.count,0))||0,y=j.useMemo(()=>{var W;const M=new Map;for(const V of((W=l.data)==null?void 0:W.gateway_share)||[])M.set(V.gateway,(M.get(V.gateway)||0)+V.count);const F=Array.from(M.values()).reduce((V,L)=>V+L,0);return Array.from(M.entries()).map(([V,L])=>({gateway:V,count:L,share:F?L/F*100:0})).sort((V,L)=>L.count-V.count)},[l.data]),v=((I=y[0])==null?void 0:I.gateway)||((R=(P=(T=s.data)==null?void 0:T.top_scores)==null?void 0:P[0])==null?void 0:R.gateway),g=[r==="up",!!u,!!(a!=null&&a.data),f].filter(Boolean).length,m=[{label:"Service health",description:r==="up"?"Service is reachable.":"Please verify service health.",state:r==="up"?"Healthy":r==="down"?"Issue":"Checking",icon:r==="up"?ED:r==="down"?PD:AD,route:void 0},{label:"Routing strategy",description:u?u.name:"No active routing configured.",state:u?"Configured":"Not set",icon:Pu,route:"/routing"},{label:"Auth-rate config",description:a!=null&&a.data?"Configured and available.":"Not configured yet.",state:a!=null&&a.data?"Configured":"Not set",icon:DD,route:"/routing/sr"},{label:"Rule-based routing",description:f?"Enabled for this merchant.":"Not enabled.",state:f?"Enabled":"Optional",icon:LD,route:"/routing/rules"}],w=t?r==="up"?{label:"System live",variant:"green"}:r==="down"?{label:"Attention needed",variant:"red"}:{label:"Checking status",variant:"gray"}:{label:"Merchant not selected",variant:"orange"};return c.jsxs("div",{className:"relative mx-auto max-w-[1380px]",children:[c.jsxs("div",{className:"pointer-events-none absolute inset-0 -z-10 overflow-hidden",children:[c.jsx("div",{className:"absolute -left-16 top-0 h-72 w-72 rounded-full bg-sky-500/10 blur-3xl dark:bg-sky-500/8"}),c.jsx("div",{className:"absolute right-0 top-12 h-80 w-80 rounded-full bg-brand-500/10 blur-3xl dark:bg-brand-500/10"})]}),c.jsxs("section",{className:"relative overflow-hidden rounded-[40px] border border-slate-200 bg-white px-5 py-5 shadow-[0_28px_90px_-56px_rgba(15,23,42,0.16)] md:px-6 md:py-6 dark:border-[#232933] dark:bg-[#090c12] dark:shadow-[0_28px_90px_-56px_rgba(0,0,0,0.72)]",children:[c.jsx("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-[#3b82f6]/25 to-transparent dark:via-[#3b82f6]/35"}),c.jsxs("header",{className:"relative flex flex-col gap-4 border-b border-slate-200 pb-5 dark:border-[#232933]",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Oe,{variant:w.variant,children:w.label}),t?c.jsx(Oe,{variant:"blue",children:t}):null,d?c.jsxs("span",{className:"text-xs font-medium uppercase tracking-[0.18em] text-slate-500 dark:text-[#7d879b]",children:["Last sync ",py(d)]}):null]}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-4xl font-semibold tracking-tight text-slate-950 md:text-[4rem] dark:text-white",children:"Overview"}),c.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-7 text-slate-600 dark:text-[#a6b0c3]",children:"Basic business-facing view of system status, setup, request volume, and gateway activity."})]})]}),t?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-5 pt-8 xl:grid-cols-[1.15fr_0.85fr]",children:[c.jsx(ya,{className:"p-6 md:p-7",children:c.jsxs("div",{className:"flex h-full flex-col justify-between",children:[c.jsxs("div",{children:[c.jsx(to,{children:"Traffic leader"}),c.jsxs("div",{className:"mt-5 flex flex-wrap items-end gap-4",children:[c.jsx("h2",{className:"text-5xl font-semibold tracking-[-0.05em] text-slate-950 md:text-7xl dark:text-white",children:(v==null?void 0:v.toUpperCase())||"--"}),c.jsxs("div",{className:"pb-2",children:[c.jsx("p",{className:"text-lg font-medium text-slate-700 dark:text-[#d5dded]",children:y[0]?fy(y[0].share):"0%"}),c.jsx("p",{className:"mt-1 text-xs uppercase tracking-[0.16em] text-slate-500 dark:text-[#8390a7]",children:"Share of recent traffic"})]})]}),c.jsx("p",{className:"mt-4 max-w-xl text-sm leading-7 text-slate-600 dark:text-[#a6b0c3]",children:u?`${u.name} is the current routing strategy for this merchant.`:"No active routing strategy is configured for this merchant yet."})]}),c.jsxs("div",{className:"mt-8 grid gap-3 sm:grid-cols-3",children:[c.jsx(hy,{label:"Requests",value:Fd(h),detail:"Last hour"}),c.jsx(hy,{label:"Setup ready",value:`${g}/4`,detail:"Core basics configured"}),c.jsx(hy,{label:"Last sync",value:d?py(d):"--",detail:"Latest refresh"})]})]})}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-1",children:[c.jsx(zd,{icon:_s,label:"System status",value:nL(r),detail:r==="up"?"Service is reachable":"Please verify service health"}),c.jsx(zd,{icon:Pu,label:"Active routing",value:(u==null?void 0:u.name)||"Not set",detail:u?"Currently selected strategy":"No routing configured yet"}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-2",children:[c.jsx(zd,{icon:o_,label:"Requests",value:Fd(h),detail:"Last hour"}),c.jsx(zd,{icon:Zf,label:"Top gateway",value:(v==null?void 0:v.toUpperCase())||"--",detail:y[0]?`${fy(y[0].share)} of traffic`:"No activity yet"})]})]})]}),c.jsxs("div",{className:"mt-6 grid gap-6 xl:grid-cols-[1.02fr_0.98fr]",children:[c.jsxs(ya,{className:"p-6",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx(to,{children:"Current setup"}),c.jsx("p",{className:"mt-2 text-sm text-slate-600 dark:text-[#a6b0c3]",children:"The status cards you can explain in a demo without technical jargon."})]}),c.jsxs(Oe,{variant:g>=3?"green":"orange",children:[g,"/4 ready"]})]}),c.jsx("div",{className:"mt-5 grid gap-4 md:grid-cols-2",children:m.map(M=>c.jsx(ya,{className:"min-h-[158px] p-5",onClick:M.route?()=>e(M.route):void 0,children:c.jsxs("div",{className:"flex h-full flex-col justify-between",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-3 dark:border-[#2a303a] dark:bg-[#161b24]",children:c.jsx(M.icon,{className:"h-5 w-5 text-brand-600 dark:text-sky-300"})}),c.jsx(Oe,{variant:M.state==="Healthy"||M.state==="Configured"||M.state==="Enabled"?"green":M.state==="Issue"?"red":M.state==="Checking"||M.state==="Optional"?"gray":"orange",children:M.state})]}),c.jsxs("div",{className:"mt-6",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:M.label}),c.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-600 dark:text-[#a6b0c3]",children:M.description})]})]})},M.label))})]}),c.jsxs(ya,{className:"p-6",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx(to,{children:"Gateway activity"}),c.jsx("p",{className:"mt-2 text-sm text-slate-600 dark:text-[#a6b0c3]",children:"Recent request distribution by gateway."})]}),c.jsx(Oe,{variant:"blue",children:"Live 1h"})]}),c.jsx("div",{className:"mt-6 space-y-4",children:y.length?y.slice(0,4).map((M,F)=>c.jsxs("div",{className:"rounded-[24px] border border-slate-200 bg-slate-50/80 p-4 dark:border-[#2a303a] dark:bg-[#121720]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:["#38bdf8","#60a5fa","#22c55e","#f59e0b"][F]||"#38bdf8"}}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:M.gateway.toUpperCase()}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#98a3b8]",children:[Fd(M.count)," requests"]})]})]}),c.jsx("p",{className:"text-sm font-medium text-slate-950 dark:text-white",children:fy(M.share)})]}),c.jsx("div",{className:"mt-4 h-2 rounded-full bg-slate-200 dark:bg-[#232933]",children:c.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-sky-400 via-blue-500 to-cyan-300",style:{width:`${Math.max(10,M.share)}%`}})})]},M.gateway)):c.jsxs("div",{className:"rounded-[24px] border border-dashed border-white/10 px-5 py-10 text-center",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:"No gateway activity yet"}),c.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-600 dark:text-[#a6b0c3]",children:"Once requests start flowing, this section will show traffic by gateway."})]})})]})]}),c.jsxs("div",{className:"mt-6 grid gap-6 xl:grid-cols-[0.86fr_1.14fr]",children:[c.jsxs(ya,{className:"p-6",children:[c.jsx(to,{children:"Quick summary"}),c.jsx("div",{className:"mt-5 space-y-4",children:[{label:"Selected merchant",value:t},{label:"Last sync",value:py(d)},{label:"Errors last hour",value:Fd(x)},{label:"Top gateway",value:(v==null?void 0:v.toUpperCase())||"No activity"}].map(M=>c.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-[20px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#2a303a] dark:bg-[#121720]",children:[c.jsx("span",{className:"text-sm text-slate-600 dark:text-[#a6b0c3]",children:M.label}),c.jsx("span",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:M.value})]},M.label))})]}),c.jsx("div",{className:"grid gap-4 md:grid-cols-3",children:[{label:"Routing Hub",text:"Configure routing strategies.",icon:Pu,route:"/routing"},{label:"Analytics",text:"Inspect request and gateway trends.",icon:Zf,route:"/analytics"},{label:"Audit Trail",text:"Review individual decision records.",icon:o_,route:"/audit"}].map(M=>c.jsx(ya,{className:"p-5",onClick:()=>e(M.route),children:c.jsxs("div",{className:"flex h-full flex-col justify-between",children:[c.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-3 dark:border-[#2a303a] dark:bg-[#161b24]",children:c.jsx(M.icon,{className:"h-5 w-5 text-brand-600 dark:text-sky-300"})}),c.jsxs("div",{className:"mt-10",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:M.label}),c.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-600 dark:text-[#a6b0c3]",children:M.text}),c.jsxs("div",{className:"mt-4 inline-flex items-center gap-2 text-sm font-medium text-brand-600 dark:text-sky-300",children:[c.jsx("span",{children:"Open"}),c.jsx(HE,{className:"h-4 w-4"})]})]})]})},M.label))})]})]}):c.jsx(aL,{})]})]})}function De({children:e,className:t="",onClick:r}){return c.jsx("div",{className:`glass-panel rounded-[20px] ${r?"glass-panel-hover cursor-pointer":""} ${t}`,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:e})}function Ze({children:e,className:t=""}){return c.jsx("div",{className:`px-6 py-5 border-b border-slate-200 dark:border-[#1c1c1f] bg-white dark:bg-[#0c0c0e] rounded-t-[20px] ${t}`,children:e})}function Le({children:e,className:t=""}){return c.jsx("div",{className:`px-6 py-5 ${t}`,children:e})}function oL(){const e=nd(),{merchantId:t}=ia(),{data:r}=Ft(t?`/routing/list/active/${t}`:null,()=>bt(`/routing/list/active/${t}`)),{data:n}=Ft(t?["/rule/get","successRate",t]:null,()=>bt("/rule/get",{merchant_id:t,algorithm:"successRate"})),a=[{id:"sr",title:"Auth-Rate Based Routing",description:"Dynamically route to the best-performing gateway based on real-time authorization rates.",icon:qE,route:"/routing/sr",algorithmType:"successRate",checkConfigured:()=>{var i;return!!((i=n==null?void 0:n.config)!=null&&i.data)}},{id:"rules",title:"Rule-Based Routing",description:"Declarative routing rules to route payments based on conditions and attributes.",icon:TD,route:"/routing/rules",algorithmType:"advanced",checkConfigured:()=>(r||[]).some(i=>{var o;return((o=i.algorithm_data||i.algorithm)==null?void 0:o.type)==="advanced"})},{id:"volume",title:"Volume Split",description:"Distribute payment traffic across gateways by configurable percentage splits.",icon:Qf,route:"/routing/volume",algorithmType:"volume_split",checkConfigured:()=>(r||[]).some(i=>{var o;return((o=i.algorithm_data||i.algorithm)==null?void 0:o.type)==="volume_split"})},{id:"debit",title:"Network Routing",description:"Optimise debit network fees with acquirer-aware network-based routing.",icon:ND,route:"/routing/debit",algorithmType:"debitRouting",checkConfigured:()=>!1}];return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Routing Hub"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Click on any routing strategy to configure"})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(i=>{const o=i.icon,s=i.checkConfigured();return c.jsx(De,{className:"flex flex-col hover:border-brand-300 cursor-pointer transition-all hover:shadow-md",onClick:()=>e(i.route),children:c.jsxs(Le,{className:"flex-1 flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsx("div",{className:"p-2 bg-brand-50 rounded-lg border border-[#1c2d50]",children:c.jsx(o,{size:20,className:"text-brand-500"})}),c.jsx(Oe,{variant:s?"green":"gray",children:s?"Configured":"Not Configured"})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-slate-900",children:i.title}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:i.description})]}),c.jsx("div",{className:"mt-auto pt-2",children:c.jsx("span",{className:"text-sm text-brand-600 font-medium",children:s?"Manage →":"Setup →"})})]})},i.id)})})]})}var id=e=>e.type==="checkbox",ro=e=>e instanceof Date,Tr=e=>e==null;const lP=e=>typeof e=="object";var Rt=e=>!Tr(e)&&!Array.isArray(e)&&lP(e)&&!ro(e),sL=e=>Rt(e)&&e.target?id(e.target)?e.target.checked:e.target.value:e,lL=(e,t)=>t.split(".").some((r,n,a)=>!isNaN(Number(r))&&e.has(a.slice(0,n).join("."))),uL=e=>{const t=e.constructor&&e.constructor.prototype;return Rt(t)&&t.hasOwnProperty("isPrototypeOf")},ub=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function vt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(ub&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Rt(e)&&uL(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=vt(e[a]));return n}var $h=e=>/^\w*$/.test(e),ct=e=>e===void 0,Ih=e=>Array.isArray(e)?e.filter(Boolean):[],cb=e=>Ih(e.replace(/["|']|\]/g,"").split(/\.|\[/)),le=(e,t,r)=>{if(!t||!Rt(e))return r;const n=($h(t)?[t]:cb(t)).reduce((a,i)=>Tr(a)?a:a[i],e);return ct(n)||n===e?ct(e[t])?r:e[t]:n},Hn=e=>typeof e=="boolean",In=e=>typeof e=="function",rt=(e,t,r)=>{let n=-1;const a=$h(t)?[t]:cb(t),i=a.length,o=i-1;for(;++nC.useContext(cP);var dL=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const o=i;return t._proxyFormState[o]!==pn.all&&(t._proxyFormState[o]=!n||pn.all),e[o]}});return a};const dP=typeof window<"u"?C.useLayoutEffect:C.useEffect;var Sr=e=>typeof e=="string",fL=(e,t,r,n,a)=>Sr(e)?(n&&t.watch.add(e),le(r,e,a)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),le(r,i))):(n&&(t.watchAll=!0),r),xg=e=>Tr(e)||!lP(e);function ii(e,t,r=new WeakSet){if(xg(e)||xg(t))return Object.is(e,t);if(ro(e)&&ro(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const o=e[i];if(!a.includes(i))return!1;if(i!=="ref"){const s=t[i];if(ro(o)&&ro(s)||(Rt(o)||Array.isArray(o))&&(Rt(s)||Array.isArray(s))?!ii(o,s,r):!Object.is(o,s))return!1}}return!0}const pL=C.createContext(null);pL.displayName="HookFormContext";var fP=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Rr=e=>Array.isArray(e)?e:[e],v_=()=>{let e=[];return{get observers(){return e},next:a=>{for(const i of e)i.next&&i.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(i=>i!==a)}}),unsubscribe:()=>{e=[]}}};function pP(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],i=t[n];if(a&&Rt(a)&&i){const o=pP(a,i);Rt(o)&&(r[n]=o)}else e[n]&&(r[n]=i)}return r}var pr=e=>Rt(e)&&!Object.keys(e).length,db=e=>e.type==="file",Jf=e=>{if(!ub)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},hP=e=>e.type==="select-multiple",fb=e=>e.type==="radio",hL=e=>fb(e)||id(e),yy=e=>Jf(e)&&e.isConnected;function mL(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(In(e[t]))return!0;return!1};function mP(e){return Array.isArray(e)||Rt(e)&&!vL(e)}function bg(e,t={}){for(const r in e){const n=e[r];mP(n)?(t[r]=Array.isArray(n)?[]:{},bg(n,t[r])):ct(n)||(t[r]=!0)}return t}function fu(e,t,r){r||(r=bg(t));for(const n in e){const a=e[n];if(mP(a))ct(t)||xg(r[n])?r[n]=bg(a,Array.isArray(a)?[]:{}):fu(a,Tr(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!ii(a,i)}}return r}const g_={value:!1,isValid:!1},x_={value:!0,isValid:!0};var yP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ct(e[0].attributes.value)?ct(e[0].value)||e[0].value===""?x_:{value:e[0].value,isValid:!0}:x_:g_}return g_},vP=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ct(e)?e:t?e===""?NaN:e&&+e:r&&Sr(e)?new Date(e):n?n(e):e;const b_={isValid:!1,value:null};var gP=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,b_):b_;function w_(e){const t=e.ref;return db(t)?t.files:fb(t)?gP(e.refs).value:hP(t)?[...t.selectedOptions].map(({value:r})=>r):id(t)?yP(e.refs).value:vP(ct(t.value)?e.ref.value:t.value,e)}var gL=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,xL=(e,t,r,n)=>{const a={};for(const i of e){const o=le(t,i);o&&rt(a,i,o._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},ep=e=>e instanceof RegExp,Wl=e=>ct(e)?e:ep(e)?e.source:Rt(e)?ep(e.value)?e.value.source:e.value:e,cs=e=>({isOnSubmit:!e||e===pn.onSubmit,isOnBlur:e===pn.onBlur,isOnChange:e===pn.onChange,isOnAll:e===pn.all,isOnTouch:e===pn.onTouched});const __="AsyncFunction";var bL=e=>!!e&&!!e.validate&&!!(In(e.validate)&&e.validate.constructor.name===__||Rt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===__)),wL=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),wg=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const js=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const i=le(e,a);if(i){const{_f:o,...s}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],a)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(js(s,t))break}else if(Rt(s)&&js(s,t))break}}};function S_(e,t,r){const n=le(e,r);if(n||$h(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),o=le(t,i),s=le(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(s&&s.type)return{name:i,error:s};if(s&&s.root&&s.root.type)return{name:`${i}.root`,error:s.root};a.pop()}return{name:r}}var _L=(e,t,r,n)=>{r(e);const{name:a,...i}=e;return pr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||pn.all))},SL=(e,t,r)=>!e||!t||e===t||Rr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),jL=(e,t,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:(r?n.isOnChange:a.isOnChange)?e:!0,OL=(e,t)=>!Ih(le(e,t)).length&&Tt(e,t),xP=(e,t,r)=>{const n=Rr(le(e,r));return rt(n,uP,t[r]),rt(e,r,n),e};function j_(e,t,r="validate"){if(Sr(e)||Array.isArray(e)&&e.every(Sr)||Hn(e)&&!e)return{type:r,message:Sr(e)?e:"",ref:t}}var Vo=e=>Rt(e)&&!ep(e)?e:{value:e,message:""},_g=async(e,t,r,n,a,i)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:f,min:d,max:p,pattern:h,validate:x,name:y,valueAsNumber:v,mount:g}=e._f,m=le(r,y);if(!g||t.has(y))return{};const w=s?s[0]:o,S=P=>{a&&w.reportValidity&&(w.setCustomValidity(Hn(P)?"":P||""),w.reportValidity())},b={},_=fb(o),O=id(o),k=_||O,A=(v||db(o))&&ct(o.value)&&ct(m)||Jf(o)&&o.value===""||m===""||Array.isArray(m)&&!m.length,I=fP.bind(null,y,n,b),T=(P,R,M,F=En.maxLength,W=En.minLength)=>{const V=P?R:M;b[y]={type:P?F:W,message:V,ref:o,...I(P?F:W,V)}};if(i?!Array.isArray(m)||!m.length:l&&(!k&&(A||Tr(m))||Hn(m)&&!m||O&&!yP(s).isValid||_&&!gP(s).isValid)){const{value:P,message:R}=Sr(l)?{value:!!l,message:l}:Vo(l);if(P&&(b[y]={type:En.required,message:R,ref:w,...I(En.required,R)},!n))return S(R),b}if(!A&&(!Tr(d)||!Tr(p))){let P,R;const M=Vo(p),F=Vo(d);if(!Tr(m)&&!isNaN(m)){const W=o.valueAsNumber||m&&+m;Tr(M.value)||(P=W>M.value),Tr(F.value)||(R=Wnew Date(new Date().toDateString()+" "+q),L=o.type=="time",U=o.type=="week";Sr(M.value)&&m&&(P=L?V(m)>V(M.value):U?m>M.value:W>new Date(M.value)),Sr(F.value)&&m&&(R=L?V(m)+P.value,F=!Tr(R.value)&&m.length<+R.value;if((M||F)&&(T(M,P.message,R.message),!n))return S(b[y].message),b}if(h&&!A&&Sr(m)){const{value:P,message:R}=Vo(h);if(ep(P)&&!m.match(P)&&(b[y]={type:En.pattern,message:R,ref:o,...I(En.pattern,R)},!n))return S(R),b}if(x){if(In(x)){const P=await x(m,r),R=j_(P,w);if(R&&(b[y]={...R,...I(En.validate,R.message)},!n))return S(R.message),b}else if(Rt(x)){let P={};for(const R in x){if(!pr(P)&&!n)break;const M=j_(await x[R](m,r),w,R);M&&(P={...M,...I(R,M.message)},S(M.message),n&&(b[y]=P))}if(!pr(P)&&(b[y]={ref:w,...P},!n))return b}}return S(!0),b};const kL={mode:pn.onSubmit,reValidateMode:pn.onChange,shouldFocusError:!0};function AL(e={}){let t={...kL,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:In(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},a=Rt(t.defaultValues)||Rt(t.values)?vt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:vt(a),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...f};let p={...d};const h={array:v_(),state:v_()},x=t.criteriaMode===pn.all,y=E=>D=>{clearTimeout(u),u=setTimeout(E,D)},v=async E=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||p.isValid||E)){let D;t.resolver?(D=pr((await A()).errors),g()):D=await P({fields:n,onlyCheckValid:!0,eventType:Uo.VALID}),D!==r.isValid&&h.state.next({isValid:D})}},g=(E,D)=>{!t.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((E||Array.from(s.mount)).forEach(N=>{N&&(D?rt(r.validatingFields,N,D):Tt(r.validatingFields,N))}),h.state.next({validatingFields:r.validatingFields,isValidating:!pr(r.validatingFields)}))},m=E=>{const D=fu(a,i),N=gL(E);rt(r.dirtyFields,N,le(D,N))},w=(E,D=[],N,B,G=!0,ee=!0)=>{if(B&&N&&!t.disabled){if(o.action=!0,ee&&Array.isArray(le(n,E))){const Z=N(le(n,E),B.argA,B.argB);G&&rt(n,E,Z)}if(ee&&Array.isArray(le(r.errors,E))){const Z=N(le(r.errors,E),B.argA,B.argB);G&&rt(r.errors,E,Z),OL(r.errors,E)}if((d.touchedFields||p.touchedFields)&&ee&&Array.isArray(le(r.touchedFields,E))){const Z=N(le(r.touchedFields,E),B.argA,B.argB);G&&rt(r.touchedFields,E,Z)}(d.dirtyFields||p.dirtyFields)&&m(E),h.state.next({name:E,isDirty:M(E,D),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else rt(i,E,D)},S=(E,D)=>{rt(r.errors,E,D),h.state.next({errors:r.errors})},b=E=>{r.errors=E,h.state.next({errors:r.errors,isValid:!1})},_=(E,D,N,B)=>{const G=le(n,E);if(G){const ee=le(i,E,ct(N)?le(a,E):N);ct(ee)||B&&B.defaultChecked||D?rt(i,E,D?ee:w_(G._f)):V(E,ee),o.mount&&!o.action&&v()}},O=(E,D,N,B,G)=>{let ee=!1,Z=!1;const me={name:E};if(!t.disabled){if(!N||B){(d.isDirty||p.isDirty)&&(Z=r.isDirty,r.isDirty=me.isDirty=M(),ee=Z!==me.isDirty);const Ne=ii(le(a,E),D);Z=!!le(r.dirtyFields,E),Ne?Tt(r.dirtyFields,E):rt(r.dirtyFields,E,!0),me.dirtyFields=r.dirtyFields,ee=ee||(d.dirtyFields||p.dirtyFields)&&Z!==!Ne}if(N){const Ne=le(r.touchedFields,E);Ne||(rt(r.touchedFields,E,N),me.touchedFields=r.touchedFields,ee=ee||(d.touchedFields||p.touchedFields)&&Ne!==N)}ee&&G&&h.state.next(me)}return ee?me:{}},k=(E,D,N,B)=>{const G=le(r.errors,E),ee=(d.isValid||p.isValid)&&Hn(D)&&r.isValid!==D;if(t.delayError&&N?(l=y(()=>S(E,N)),l(t.delayError)):(clearTimeout(u),l=null,N?rt(r.errors,E,N):Tt(r.errors,E)),(N?!ii(G,N):G)||!pr(B)||ee){const Z={...B,...ee&&Hn(D)?{isValid:D}:{},errors:r.errors,name:E};r={...r,...Z},h.state.next(Z)}},A=async E=>(g(E,!0),await t.resolver(i,t.context,xL(E||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),I=async E=>{const{errors:D}=await A(E);if(g(E),E)for(const N of E){const B=le(D,N);B?rt(r.errors,N,B):Tt(r.errors,N)}else r.errors=D;return D},T=async({name:E,eventType:D})=>{if(e.validate){const N=await e.validate({formValues:i,formState:r,name:E,eventType:D});if(Rt(N))for(const B in N)N[B]&&ue(`${my}.${B}`,{message:Sr(N.message)?N.message:"",type:En.validate});else Sr(N)||!N?ue(my,{message:N||"",type:En.validate}):be(my);return N}return!0},P=async({fields:E,onlyCheckValid:D,name:N,eventType:B,context:G={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(G.runRootValidation=!0,!await T({name:N,eventType:B})&&(G.valid=!1,D)))return G.valid;for(const ee in E){const Z=E[ee];if(Z){const{_f:me,...Ne}=Z;if(me){const At=s.array.has(me.name),Ct=Z._f&&bL(Z._f);Ct&&d.validatingFields&&g([me.name],!0);const Yt=await _g(Z,s.disabled,i,x,t.shouldUseNativeValidation&&!D,At);if(Ct&&d.validatingFields&&g([me.name]),Yt[me.name]&&(G.valid=!1,D)||(!D&&(le(Yt,me.name)?At?xP(r.errors,Yt,me.name):rt(r.errors,me.name,Yt[me.name]):Tt(r.errors,me.name)),e.shouldUseNativeValidation&&Yt[me.name]))break}!pr(Ne)&&await P({context:G,onlyCheckValid:D,fields:Ne,name:ee,eventType:B})}}return G.valid},R=()=>{for(const E of s.unMount){const D=le(n,E);D&&(D._f.refs?D._f.refs.every(N=>!yy(N)):!yy(D._f.ref))&&ie(E)}s.unMount=new Set},M=(E,D)=>!t.disabled&&(E&&D&&rt(i,E,D),!ii(ae(),a)),F=(E,D,N)=>fL(E,s,{...o.mount?i:ct(D)?a:Sr(E)?{[E]:D}:D},N,D),W=E=>Ih(le(o.mount?i:a,E,t.shouldUnregister?le(a,E,[]):[])),V=(E,D,N={})=>{const B=le(n,E);let G=D;if(B){const ee=B._f;ee&&(!ee.disabled&&rt(i,E,vP(D,ee)),G=Jf(ee.ref)&&Tr(D)?"":D,hP(ee.ref)?[...ee.ref.options].forEach(Z=>Z.selected=G.includes(Z.value)):ee.refs?id(ee.ref)?ee.refs.forEach(Z=>{(!Z.defaultChecked||!Z.disabled)&&(Array.isArray(G)?Z.checked=!!G.find(me=>me===Z.value):Z.checked=G===Z.value||!!G)}):ee.refs.forEach(Z=>Z.checked=Z.value===G):db(ee.ref)?ee.ref.value="":(ee.ref.value=G,ee.ref.type||h.state.next({name:E,values:vt(i)})))}(N.shouldDirty||N.shouldTouch)&&O(E,G,N.shouldTouch,N.shouldDirty,!0),N.shouldValidate&&K(E)},L=(E,D,N)=>{for(const B in D){if(!D.hasOwnProperty(B))return;const G=D[B],ee=E+"."+B,Z=le(n,ee);(s.array.has(E)||Rt(G)||Z&&!Z._f)&&!ro(G)?L(ee,G,N):V(ee,G,N)}},U=(E,D,N={})=>{const B=le(n,E),G=s.array.has(E),ee=vt(D);rt(i,E,ee),G?(h.array.next({name:E,values:vt(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&N.shouldDirty&&(m(E),h.state.next({name:E,dirtyFields:r.dirtyFields,isDirty:M(E,ee)}))):B&&!B._f&&!Tr(ee)?L(E,ee,N):V(E,ee,N),wg(E,s)?h.state.next({...r,name:E,values:vt(i)}):h.state.next({name:o.mount?E:void 0,values:vt(i)})},q=async E=>{o.mount=!0;const D=E.target;let N=D.name,B=!0;const G=le(n,N),ee=Ne=>{B=Number.isNaN(Ne)||ro(Ne)&&isNaN(Ne.getTime())||ii(Ne,le(i,N,Ne))},Z=cs(t.mode),me=cs(t.reValidateMode);if(G){let Ne,At;const Ct=D.type?w_(G._f):sL(E),Yt=E.type===Uo.BLUR||E.type===Uo.FOCUS_OUT,Fi=!wL(G._f)&&!e.validate&&!t.resolver&&!le(r.errors,N)&&!G._f.deps||jL(Yt,le(r.touchedFields,N),r.isSubmitted,me,Z),Wa=wg(N,s,Yt);rt(i,N,Ct),Yt?(!D||!D.readOnly)&&(G._f.onBlur&&G._f.onBlur(E),l&&l(0)):G._f.onChange&&G._f.onChange(E);const zi=O(N,Ct,Yt),Bi=!pr(zi)||Wa;if(!Yt&&h.state.next({name:N,type:E.type,values:vt(i)}),Fi)return(d.isValid||p.isValid)&&(t.mode==="onBlur"?Yt&&v():Yt||v()),Bi&&h.state.next({name:N,...Wa?{}:zi});if(!t.resolver&&e.validate&&await T({name:N,eventType:E.type}),!Yt&&Wa&&h.state.next({...r}),t.resolver){const{errors:Ui}=await A([N]);if(g([N]),ee(Ct),B){const Rl=S_(r.errors,n,N),Fo=S_(Ui,n,Rl.name||N);Ne=Fo.error,N=Fo.name,At=pr(Ui)}}else g([N],!0),Ne=(await _g(G,s.disabled,i,x,t.shouldUseNativeValidation))[N],g([N]),ee(Ct),B&&(Ne?At=!1:(d.isValid||p.isValid)&&(At=await P({fields:n,onlyCheckValid:!0,name:N,eventType:E.type})));B&&(G._f.deps&&(!Array.isArray(G._f.deps)||G._f.deps.length>0)&&K(G._f.deps),k(N,At,Ne,zi))}},J=(E,D)=>{if(le(r.errors,D)&&E.focus)return E.focus(),1},K=async(E,D={})=>{let N,B;const G=Rr(E);if(t.resolver){const ee=await I(ct(E)?E:G);N=pr(ee),B=E?!G.some(Z=>le(ee,Z)):N}else E?(B=(await Promise.all(G.map(async ee=>{const Z=le(n,ee);return await P({fields:Z&&Z._f?{[ee]:Z}:Z,eventType:Uo.TRIGGER})}))).every(Boolean),!(!B&&!r.isValid)&&v()):B=N=await P({fields:n,name:E,eventType:Uo.TRIGGER});return h.state.next({...!Sr(E)||(d.isValid||p.isValid)&&N!==r.isValid?{}:{name:E},...t.resolver||!E?{isValid:N}:{},errors:r.errors}),D.shouldFocus&&!B&&js(n,J,E?G:s.mount),B},ae=(E,D)=>{let N={...o.mount?i:a};return D&&(N=pP(D.dirtyFields?r.dirtyFields:r.touchedFields,N)),ct(E)?N:Sr(E)?le(N,E):E.map(B=>le(N,B))},Q=(E,D)=>({invalid:!!le((D||r).errors,E),isDirty:!!le((D||r).dirtyFields,E),error:le((D||r).errors,E),isValidating:!!le(r.validatingFields,E),isTouched:!!le((D||r).touchedFields,E)}),be=E=>{const D=E?Rr(E):void 0;D==null||D.forEach(N=>Tt(r.errors,N)),D?D.forEach(N=>{h.state.next({name:N,errors:r.errors})}):h.state.next({errors:{}})},ue=(E,D,N)=>{const B=(le(n,E,{_f:{}})._f||{}).ref,G=le(r.errors,E)||{},{ref:ee,message:Z,type:me,...Ne}=G;rt(r.errors,E,{...Ne,...D,ref:B}),h.state.next({name:E,errors:r.errors,isValid:!1}),N&&N.shouldFocus&&B&&B.focus&&B.focus()},Pe=(E,D)=>In(E)?h.state.subscribe({next:N=>"values"in N&&E(F(void 0,D),N)}):F(E,D,!0),Fe=E=>h.state.subscribe({next:D=>{SL(E.name,D.name,E.exact)&&_L(D,E.formState||d,je,E.reRenderRoot)&&E.callback({values:{...i},...r,...D,defaultValues:a})}}).unsubscribe,te=E=>(o.mount=!0,p={...p,...E.formState},Fe({...E,formState:{...f,...E.formState}})),ie=(E,D={})=>{for(const N of E?Rr(E):s.mount)s.mount.delete(N),s.array.delete(N),D.keepValue||(Tt(n,N),Tt(i,N)),!D.keepError&&Tt(r.errors,N),!D.keepDirty&&Tt(r.dirtyFields,N),!D.keepTouched&&Tt(r.touchedFields,N),!D.keepIsValidating&&Tt(r.validatingFields,N),!t.shouldUnregister&&!D.keepDefaultValue&&Tt(a,N);h.state.next({values:vt(i)}),h.state.next({...r,...D.keepDirty?{isDirty:M()}:{}}),!D.keepIsValid&&v()},he=({disabled:E,name:D})=>{if(Hn(E)&&o.mount||E||s.disabled.has(D)){const G=s.disabled.has(D)!==!!E;E?s.disabled.add(D):s.disabled.delete(D),G&&o.mount&&!o.action&&v()}},X=(E,D={})=>{let N=le(n,E);const B=Hn(D.disabled)||Hn(t.disabled),G=!s.registerName.has(E)&&N&&!N._f.mount;return rt(n,E,{...N||{},_f:{...N&&N._f?N._f:{ref:{name:E}},name:E,mount:!0,...D}}),s.mount.add(E),N&&!G?he({disabled:Hn(D.disabled)?D.disabled:t.disabled,name:E}):_(E,!0,D.value),{...B?{disabled:D.disabled||t.disabled}:{},...t.progressive?{required:!!D.required,min:Wl(D.min),max:Wl(D.max),minLength:Wl(D.minLength),maxLength:Wl(D.maxLength),pattern:Wl(D.pattern)}:{},name:E,onChange:q,onBlur:q,ref:ee=>{if(ee){s.registerName.add(E),X(E,D),s.registerName.delete(E),N=le(n,E);const Z=ct(ee.value)&&ee.querySelectorAll&&ee.querySelectorAll("input,select,textarea")[0]||ee,me=hL(Z),Ne=N._f.refs||[];if(me?Ne.find(At=>At===Z):Z===N._f.ref)return;rt(n,E,{_f:{...N._f,...me?{refs:[...Ne.filter(yy),Z,...Array.isArray(le(a,E))?[{}]:[]],ref:{type:Z.type,name:E}}:{ref:Z}}}),_(E,!1,void 0,Z)}else N=le(n,E,{}),N._f&&(N._f.mount=!1),(t.shouldUnregister||D.shouldUnregister)&&!(lL(s.array,E)&&o.action)&&s.unMount.add(E)}}},ke=()=>t.shouldFocusError&&js(n,J,s.mount),ve=E=>{Hn(E)&&(h.state.next({disabled:E}),js(n,(D,N)=>{const B=le(n,N);B&&(D.disabled=B._f.disabled||E,Array.isArray(B._f.refs)&&B._f.refs.forEach(G=>{G.disabled=B._f.disabled||E}))},0,!1))},Ae=(E,D)=>async N=>{let B;N&&(N.preventDefault&&N.preventDefault(),N.persist&&N.persist());let G=vt(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:ee,values:Z}=await A();g(),r.errors=ee,G=vt(Z)}else await P({fields:n,eventType:Uo.SUBMIT});if(s.disabled.size)for(const ee of s.disabled)Tt(G,ee);if(Tt(r.errors,uP),pr(r.errors)){h.state.next({errors:{}});try{await E(G,N)}catch(ee){B=ee}}else D&&await D({...r.errors},N),ke(),setTimeout(ke);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:pr(r.errors)&&!B,submitCount:r.submitCount+1,errors:r.errors}),B)throw B},ze=(E,D={})=>{le(n,E)&&(ct(D.defaultValue)?U(E,vt(le(a,E))):(U(E,D.defaultValue),rt(a,E,vt(D.defaultValue))),D.keepTouched||Tt(r.touchedFields,E),D.keepDirty||(Tt(r.dirtyFields,E),r.isDirty=D.defaultValue?M(E,vt(le(a,E))):M()),D.keepError||(Tt(r.errors,E),d.isValid&&v()),h.state.next({...r}))},ge=(E,D={})=>{const N=E?vt(E):a,B=vt(N),G=pr(E),ee=G?a:B;if(D.keepDefaultValues||(a=N),!D.keepValues){if(D.keepDirtyValues){const Z=new Set([...s.mount,...Object.keys(fu(a,i))]);for(const me of Array.from(Z)){const Ne=le(r.dirtyFields,me),At=le(i,me),Ct=le(ee,me);Ne&&!ct(At)?rt(ee,me,At):!Ne&&!ct(Ct)&&U(me,Ct)}}else{if(ub&&ct(E))for(const Z of s.mount){const me=le(n,Z);if(me&&me._f){const Ne=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(Jf(Ne)){const At=Ne.closest("form");if(At){At.reset();break}}}}if(D.keepFieldsRef)for(const Z of s.mount)U(Z,le(ee,Z));else n={}}i=t.shouldUnregister?D.keepDefaultValues?vt(a):{}:vt(ee),h.array.next({values:{...ee}}),h.state.next({values:{...ee}})}s={mount:D.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!D.keepIsValid||!!D.keepDirtyValues||!t.shouldUnregister&&!pr(ee),o.watch=!!t.shouldUnregister,o.keepIsValid=!!D.keepIsValid,o.action=!1,D.keepErrors||(r.errors={}),h.state.next({submitCount:D.keepSubmitCount?r.submitCount:0,isDirty:G?!1:D.keepDirty?r.isDirty:!!(D.keepDefaultValues&&!ii(E,a)),isSubmitted:D.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:G?{}:D.keepDirtyValues?D.keepDefaultValues&&i?fu(a,i):r.dirtyFields:D.keepDefaultValues&&E?fu(a,E):D.keepDirty?r.dirtyFields:{},touchedFields:D.keepTouched?r.touchedFields:{},errors:D.keepErrors?r.errors:{},isSubmitSuccessful:D.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},Ce=(E,D)=>ge(In(E)?E(i):E,{...t.resetOptions,...D}),Me=(E,D={})=>{const N=le(n,E),B=N&&N._f;if(B){const G=B.refs?B.refs[0]:B.ref;G.focus&&setTimeout(()=>{G.focus(),D.shouldSelect&&In(G.select)&&G.select()})}},je=E=>{r={...r,...E}},H={control:{register:X,unregister:ie,getFieldState:Q,handleSubmit:Ae,setError:ue,_subscribe:Fe,_runSchema:A,_updateIsValidating:g,_focusError:ke,_getWatch:F,_getDirty:M,_setValid:v,_setFieldArray:w,_setDisabledField:he,_setErrors:b,_getFieldArray:W,_reset:ge,_resetDefaultValues:()=>In(t.defaultValues)&&t.defaultValues().then(E=>{Ce(E,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:R,_disableForm:ve,_subjects:h,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(E){o=E},get _defaultValues(){return a},get _names(){return s},set _names(E){s=E},get _formState(){return r},get _options(){return t},set _options(E){t={...t,...E}}},subscribe:te,trigger:K,register:X,handleSubmit:Ae,watch:Pe,setValue:U,getValues:ae,reset:Ce,resetField:ze,clearErrors:be,unregister:ie,setError:ue,setFocus:Me,getFieldState:Q};return{...H,formControl:H}}var Xa=()=>{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 r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},vy=(e,t,r={})=>r.shouldFocus||ct(r.shouldFocus)?r.focusName||`${e}.${ct(r.focusIndex)?t:r.focusIndex}.`:"",gy=(e,t)=>[...e,...Rr(t)],xy=e=>Array.isArray(e)?e.map(()=>{}):void 0;function by(e,t,r){return[...e.slice(0,t),...Rr(r),...e.slice(t)]}var wy=(e,t,r)=>Array.isArray(e)?(ct(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],_y=(e,t)=>[...Rr(t),...Rr(e)];function EL(e,t){let r=0;const n=[...e];for(const a of t)n.splice(a-r,1),r++;return Ih(n).length?n:[]}var Sy=(e,t)=>ct(t)?[]:EL(e,Rr(t).sort((r,n)=>r-n)),jy=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},O_=(e,t,r)=>(e[t]=r,e);function PL(e){const t=cL(),{control:r=t,name:n,keyName:a="id",shouldUnregister:i,rules:o}=e,[s,l]=C.useState(r._getFieldArray(n)),u=C.useRef(r._getFieldArray(n).map(Xa)),f=C.useRef(!1);r._names.array.add(n),C.useMemo(()=>o&&s.length>=0&&r.register(n,o),[r,n,s.length,o]),dP(()=>r._subjects.array.subscribe({next:({values:S,name:b})=>{if(b===n||!b){const _=le(S,n);Array.isArray(_)&&(l(_),u.current=_.map(Xa))}}}).unsubscribe,[r,n]);const d=C.useCallback(S=>{f.current=!0,r._setFieldArray(n,S)},[r,n]),p=(S,b)=>{const _=Rr(vt(S)),O=gy(r._getFieldArray(n),_);r._names.focus=vy(n,O.length-1,b),u.current=gy(u.current,_.map(Xa)),d(O),l(O),r._setFieldArray(n,O,gy,{argA:xy(S)})},h=(S,b)=>{const _=Rr(vt(S)),O=_y(r._getFieldArray(n),_);r._names.focus=vy(n,0,b),u.current=_y(u.current,_.map(Xa)),d(O),l(O),r._setFieldArray(n,O,_y,{argA:xy(S)})},x=S=>{const b=Sy(r._getFieldArray(n),S);u.current=Sy(u.current,S),d(b),l(b),!Array.isArray(le(r._fields,n))&&rt(r._fields,n,void 0),r._setFieldArray(n,b,Sy,{argA:S})},y=(S,b,_)=>{const O=Rr(vt(b)),k=by(r._getFieldArray(n),S,O);r._names.focus=vy(n,S,_),u.current=by(u.current,S,O.map(Xa)),d(k),l(k),r._setFieldArray(n,k,by,{argA:S,argB:xy(b)})},v=(S,b)=>{const _=r._getFieldArray(n);jy(_,S,b),jy(u.current,S,b),d(_),l(_),r._setFieldArray(n,_,jy,{argA:S,argB:b},!1)},g=(S,b)=>{const _=r._getFieldArray(n);wy(_,S,b),wy(u.current,S,b),d(_),l(_),r._setFieldArray(n,_,wy,{argA:S,argB:b},!1)},m=(S,b)=>{const _=vt(b),O=O_(r._getFieldArray(n),S,_);u.current=[...O].map((k,A)=>!k||A===S?Xa():u.current[A]),d(O),l([...O]),r._setFieldArray(n,O,O_,{argA:S,argB:_},!0,!1)},w=S=>{const b=Rr(vt(S));u.current=b.map(Xa),d([...b]),l([...b]),r._setFieldArray(n,[...b],_=>_,{},!0,!1)};return C.useEffect(()=>{if(r._state.action=!1,wg(n,r._names)&&r._subjects.state.next({...r._formState}),f.current&&(!cs(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!cs(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{r._updateIsValidating([n]);const b=le(S.errors,n),_=le(r._formState.errors,n);(_?!b&&_.type||b&&(_.type!==b.type||_.message!==b.message):b&&b.type)&&(b?rt(r._formState.errors,n,b):Tt(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=le(r._fields,n);S&&S._f&&!(cs(r._options.reValidateMode).isOnSubmit&&cs(r._options.mode).isOnSubmit)&&_g(S,r._names.disabled,r._formValues,r._options.criteriaMode===pn.all,r._options.shouldUseNativeValidation,!0).then(b=>!pr(b)&&r._subjects.state.next({errors:xP(r._formState.errors,b,n)}))}r._subjects.state.next({name:n,values:vt(r._formValues)}),r._names.focus&&js(r._fields,(S,b)=>{if(r._names.focus&&b.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),f.current=!1},[s,n,r]),C.useEffect(()=>(!le(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(b,_)=>{const O=le(r._fields,b);O&&O._f&&(O._f.mount=_)};r._options.shouldUnregister||i?r.unregister(n):S(n,!1)}),[n,r,a,i]),{swap:C.useCallback(v,[d,n,r]),move:C.useCallback(g,[d,n,r]),prepend:C.useCallback(h,[d,n,r]),append:C.useCallback(p,[d,n,r]),remove:C.useCallback(x,[d,n,r]),insert:C.useCallback(y,[d,n,r]),update:C.useCallback(m,[d,n,r]),replace:C.useCallback(w,[d,n,r]),fields:C.useMemo(()=>s.map((S,b)=>({...S,[a]:u.current[b]||Xa()})),[s,a])}}function NL(e={}){const t=C.useRef(void 0),r=C.useRef(void 0),[n,a]=C.useState({isDirty:!1,isValidating:!1,isLoading:In(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:In(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!In(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=AL(e);t.current={...s,formState:n}}const i=t.current.control;return i._options=e,dP(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(s=>({...s,isReady:!0})),i._formState.isReady=!0,o},[i]),C.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),C.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),C.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),C.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),C.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),C.useEffect(()=>{var o;e.values&&!ii(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((o=i._options.resetOptions)===null||o===void 0)&&o.keepIsValid||i._setValid(),r.current=e.values,a(s=>({...s}))):i._resetDefaultValues()},[i,e.values]),C.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=C.useMemo(()=>dL(n,i),[i,n]),t.current}const k_=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},bP=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?k_(n.ref,r,e):n.refs&&n.refs.forEach(a=>k_(a,r,e))}},CL=(e,t)=>{t.shouldUseNativeValidation&&bP(e,t);const r={};for(const n in e){const a=le(t.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(TL(t.names||Object.keys(e),n)){const o=Object.assign({},le(r,n));rt(o,"root",i),rt(r,n,o)}else rt(r,n,i)}return r},TL=(e,t)=>e.some(r=>r.startsWith(t+"."));var $L=function(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=fP(o,t,r,a,u?[].concat(u,n.message):n.message)}e.shift()}return r},IL=function(e,t,r){return r===void 0&&(r={}),function(n,a,i){try{return Promise.resolve(function(o,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&bP({},i),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:CL($L(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},Qe;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Qe||(Qe={}));var A_;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(A_||(A_={}));const ye=Qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ei=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}},oe=Qe.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 Ia extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ia.create=e=>new Ia(e);const Sg=(e,t)=>{let r;switch(e.code){case oe.invalid_type:e.received===ye.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Qe.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${Qe.joinValues(e.keys,", ")}`;break;case oe.invalid_union:r="Invalid input";break;case oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Qe.joinValues(e.options)}`;break;case oe.invalid_enum_value:r=`Invalid enum value. Expected ${Qe.joinValues(e.options)}, received '${e.received}'`;break;case oe.invalid_arguments:r="Invalid function arguments";break;case oe.invalid_return_type:r="Invalid function return type";break;case oe.invalid_date:r="Invalid date";break;case oe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Qe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case oe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case oe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case oe.custom:r="Invalid input";break;case oe.invalid_intersection_types:r="Intersection results could not be merged";break;case oe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case oe.not_finite:r="Number must be finite";break;default:r=t.defaultError,Qe.assertNever(e)}return{message:r}};let RL=Sg;function ML(){return RL}const DL=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}};function ce(e,t){const r=ML(),n=DL({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Sg?void 0:Sg].filter(a=>!!a)});e.common.issues.push(n)}class Jr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return $e;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return Jr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return $e;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const $e=Object.freeze({status:"aborted"}),pu=e=>({status:"dirty",value:e}),wn=e=>({status:"valid",value:e}),E_=e=>e.status==="aborted",P_=e=>e.status==="dirty",Fs=e=>e.status==="valid",tp=e=>typeof Promise<"u"&&e instanceof Promise;var xe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(xe||(xe={}));class ki{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,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 N_=(e,t)=>{if(Fs(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 r=new Ia(e.common.issues);return this._error=r,this._error}}};function Be(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))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:(o,s)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:a}}class Ye{get description(){return this._def.description}_getType(t){return ei(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ei(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Jr,ctx:{common:t.parent.common,data:t.data,parsedType:ei(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(tp(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)},a=this._parseSync({data:t,path:n.path,parent:n});return N_(n,a)}"~validate"(t){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return Fs(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>Fs(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)},a=this._parse({data:t,path:n.path,parent:n}),i=await(tp(a)?a:Promise.resolve(a));return N_(n,i)}refine(t,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=t(a),s=()=>i.addIssue({code:oe.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new jo({schema:this,typeName:Ie.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:r=>this["~validate"](r)}}optional(){return bi.create(this,this._def)}nullable(){return Us.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Jn.create(this)}promise(){return ip.create(this,this._def)}or(t){return np.create([this,t],this._def)}and(t){return ap.create(this,t,this._def)}transform(t){return new jo({...Be(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Og({...Be(this._def),innerType:this,defaultValue:r,typeName:Ie.ZodDefault})}brand(){return new o5({typeName:Ie.ZodBranded,type:this,...Be(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new kg({...Be(this._def),innerType:this,catchValue:r,typeName:Ie.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return pb.create(this,t)}readonly(){return Ag.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const LL=/^c[^\s-]{8,}$/i,FL=/^[0-9a-z]+$/,zL=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BL=/^[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,UL=/^[a-z0-9_-]{21}$/i,VL=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WL=/^[-+]?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)?)??$/,HL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,GL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oy;const qL=/^(?:(?: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])$/,KL=/^(?:(?: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])$/,XL=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|::(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])$/,ZL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",JL=new RegExp(`^${wP}$`);function _P(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function e5(e){return new RegExp(`^${_P(e)}$`)}function t5(e){let t=`${wP}T${_P(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function r5(e,t){return!!((t==="v4"||!t)&&qL.test(e)||(t==="v6"||!t)&&XL.test(e))}function n5(e,t){if(!VL.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function a5(e,t){return!!((t==="v4"||!t)&&KL.test(e)||(t==="v6"||!t)&&YL.test(e))}class wa extends Ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.string,received:i.parsedType}),$e}const n=new Jr;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,s=t.data.lengtht.test(a),{validation:r,code:oe.invalid_string,...xe.errToObj(n)})}_addCheck(t){return new wa({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...xe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...xe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...xe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...xe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...xe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...xe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...xe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...xe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...xe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...xe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...xe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...xe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...xe.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==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...xe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...xe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...xe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...xe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...xe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...xe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...xe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...xe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...xe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...xe.errToObj(r)})}nonempty(t){return this.min(1,xe.errToObj(t))}trim(){return new wa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wa({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew wa({checks:[],typeName:Ie.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Be(e)});function i5(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return i%o/10**a}class wo extends Ye{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 i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.number,received:i.parsedType}),$e}let n;const a=new Jr;for(const i of this._def.checks)i.kind==="int"?Qe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?i5(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_finite,message:i.message}),a.dirty()):Qe.assertNever(i);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,a){return new wo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(a)}]})}_addCheck(t){return new wo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:xe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:xe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Qe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew wo({checks:[],typeName:Ie.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class _o extends Ye{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 n;const a=new Jr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Qe.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return ce(r,{code:oe.invalid_type,expected:ye.bigint,received:r.parsedType}),$e}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,a){return new _o({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(a)}]})}_addCheck(t){return new _o({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew _o({checks:[],typeName:Ie.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Be(e)});class rp extends Ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.boolean,received:n.parsedType}),$e}return wn(t.data)}}rp.create=e=>new rp({typeName:Ie.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class zs extends Ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.date,received:i.parsedType}),$e}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_date}),$e}const n=new Jr;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Qe.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new zs({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:xe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:xe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew zs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ie.ZodDate,...Be(e)});class C_ extends Ye{_parse(t){if(this._getType(t)!==ye.symbol){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.symbol,received:n.parsedType}),$e}return wn(t.data)}}C_.create=e=>new C_({typeName:Ie.ZodSymbol,...Be(e)});class T_ extends Ye{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.undefined,received:n.parsedType}),$e}return wn(t.data)}}T_.create=e=>new T_({typeName:Ie.ZodUndefined,...Be(e)});class $_ extends Ye{_parse(t){if(this._getType(t)!==ye.null){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.null,received:n.parsedType}),$e}return wn(t.data)}}$_.create=e=>new $_({typeName:Ie.ZodNull,...Be(e)});class I_ extends Ye{constructor(){super(...arguments),this._any=!0}_parse(t){return wn(t.data)}}I_.create=e=>new I_({typeName:Ie.ZodAny,...Be(e)});class R_ extends Ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return wn(t.data)}}R_.create=e=>new R_({typeName:Ie.ZodUnknown,...Be(e)});class Ai extends Ye{_parse(t){const r=this._getOrReturnCtx(t);return ce(r,{code:oe.invalid_type,expected:ye.never,received:r.parsedType}),$e}}Ai.create=e=>new Ai({typeName:Ie.ZodNever,...Be(e)});class M_ extends Ye{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.void,received:n.parsedType}),$e}return wn(t.data)}}M_.create=e=>new M_({typeName:Ie.ZodVoid,...Be(e)});class Jn extends Ye{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==ye.array)return ce(r,{code:oe.invalid_type,expected:ye.array,received:r.parsedType}),$e;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,s=r.data.lengtha.maxLength.value&&(ce(r,{code:oe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new ki(r,o,r.path,s)))).then(o=>Jr.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new ki(r,o,r.path,s)));return Jr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Jn({...this._def,minLength:{value:t,message:xe.toString(r)}})}max(t,r){return new Jn({...this._def,maxLength:{value:t,message:xe.toString(r)}})}length(t,r){return new Jn({...this._def,exactLength:{value:t,message:xe.toString(r)}})}nonempty(t){return this.min(1,t)}}Jn.create=(e,t)=>new Jn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...Be(t)});function Yo(e){if(e instanceof Dt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=bi.create(Yo(n))}return new Dt({...e._def,shape:()=>t})}else return e instanceof Jn?new Jn({...e._def,type:Yo(e.element)}):e instanceof bi?bi.create(Yo(e.unwrap())):e instanceof Us?Us.create(Yo(e.unwrap())):e instanceof So?So.create(e.items.map(t=>Yo(t))):e}class Dt extends Ye{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(),r=Qe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ye.object){const u=this._getOrReturnCtx(t);return ce(u,{code:oe.invalid_type,expected:ye.object,received:u.parsedType}),$e}const{status:n,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ai&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const f=i[u],d=a.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new ki(a,d,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof Ai){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(u==="strict")s.length>0&&(ce(a,{code:oe.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of s){const d=a.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new ki(a,d,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const d=await f.key,p=await f.value;u.push({key:d,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>Jr.mergeObjectSync(n,u)):Jr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return xe.errToObj,new Dt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:xe.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Dt({...this._def,unknownKeys:"strip"})}passthrough(){return new Dt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Dt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Dt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ie.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Dt({...this._def,catchall:t})}pick(t){const r={};for(const n of Qe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Dt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Qe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Dt({...this._def,shape:()=>r})}deepPartial(){return Yo(this)}partial(t){const r={};for(const n of Qe.objectKeys(this.shape)){const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new Dt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Qe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof bi;)i=i._def.innerType;r[n]=i}return new Dt({...this._def,shape:()=>r})}keyof(){return SP(Qe.objectKeys(this.shape))}}Dt.create=(e,t)=>new Dt({shape:()=>e,unknownKeys:"strip",catchall:Ai.create(),typeName:Ie.ZodObject,...Be(t)});Dt.strictCreate=(e,t)=>new Dt({shape:()=>e,unknownKeys:"strict",catchall:Ai.create(),typeName:Ie.ZodObject,...Be(t)});Dt.lazycreate=(e,t)=>new Dt({shape:e,unknownKeys:"strip",catchall:Ai.create(),typeName:Ie.ZodObject,...Be(t)});class np extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Ia(s.ctx.common.issues));return ce(r,{code:oe.invalid_union,unionErrors:o}),$e}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(l=>new Ia(l));return ce(r,{code:oe.invalid_union,unionErrors:s}),$e}}get options(){return this._def.options}}np.create=(e,t)=>new np({options:e,typeName:Ie.ZodUnion,...Be(t)});function jg(e,t){const r=ei(e),n=ei(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){const a=Qe.objectKeys(t),i=Qe.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(const s of i){const l=jg(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i{if(E_(i)||E_(o))return $e;const s=jg(i.value,o.value);return s.valid?((P_(i)||P_(o))&&r.dirty(),{status:r.value,value:s.data}):(ce(n,{code:oe.invalid_intersection_types}),$e)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ap.create=(e,t,r)=>new ap({left:e,right:t,typeName:Ie.ZodIntersection,...Be(r)});class So extends Ye{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return ce(n,{code:oe.invalid_type,expected:ye.array,received:n.parsedType}),$e;if(n.data.lengththis._def.items.length&&(ce(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new ki(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>Jr.mergeArray(r,o)):Jr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new So({...this._def,rest:t})}}So.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new So({items:e,typeName:Ie.ZodTuple,rest:null,...Be(t)})};class D_ extends Ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.map)return ce(n,{code:oe.invalid_type,expected:ye.map,received:n.parsedType}),$e;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:a._parse(new ki(n,s,n.path,[u,"key"])),value:i._parse(new ki(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return $e;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return $e;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}}D_.create=(e,t,r)=>new D_({valueType:t,keyType:e,typeName:Ie.ZodMap,...Be(r)});class uc extends Ye{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return ce(n,{code:oe.invalid_type,expected:ye.set,received:n.parsedType}),$e;const a=this._def;a.minSize!==null&&n.data.sizea.maxSize.value&&(ce(n,{code:oe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return $e;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>i._parse(new ki(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new uc({...this._def,minSize:{value:t,message:xe.toString(r)}})}max(t,r){return new uc({...this._def,maxSize:{value:t,message:xe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}uc.create=(e,t)=>new uc({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...Be(t)});class L_ extends Ye{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}L_.create=(e,t)=>new L_({getter:e,typeName:Ie.ZodLazy,...Be(t)});class F_ extends Ye{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:oe.invalid_literal,expected:this._def.value}),$e}return{status:"valid",value:t.data}}get value(){return this._def.value}}F_.create=(e,t)=>new F_({value:e,typeName:Ie.ZodLiteral,...Be(t)});function SP(e,t){return new Bs({values:e,typeName:Ie.ZodEnum,...Be(t)})}class Bs extends Ye{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:Qe.joinValues(n),received:r.parsedType,code:oe.invalid_type}),$e}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:oe.invalid_enum_value,options:n}),$e}return wn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Bs.create(t,{...this._def,...r})}exclude(t,r=this._def){return Bs.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Bs.create=SP;class z_ extends Ye{_parse(t){const r=Qe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){const a=Qe.objectValues(r);return ce(n,{expected:Qe.joinValues(a),received:n.parsedType,code:oe.invalid_type}),$e}if(this._cache||(this._cache=new Set(Qe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Qe.objectValues(r);return ce(n,{received:n.data,code:oe.invalid_enum_value,options:a}),$e}return wn(t.data)}get enum(){return this._def.values}}z_.create=(e,t)=>new z_({values:e,typeName:Ie.ZodNativeEnum,...Be(t)});class ip extends Ye{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return ce(r,{code:oe.invalid_type,expected:ye.promise,received:r.parsedType}),$e;const n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return wn(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ip.create=(e,t)=>new ip({type:e,typeName:Ie.ZodPromise,...Be(t)});class jo extends Ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{ce(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return $e;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?$e:l.status==="dirty"||r.value==="dirty"?pu(l.value):l});{if(r.value==="aborted")return $e;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?$e:s.status==="dirty"||r.value==="dirty"?pu(s.value):s}}if(a.type==="refinement"){const o=s=>{const l=a.refinement(s,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?$e:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?$e:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fs(o))return $e;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Fs(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):$e);Qe.assertNever(a)}}jo.create=(e,t,r)=>new jo({schema:e,typeName:Ie.ZodEffects,effect:t,...Be(r)});jo.createWithPreprocess=(e,t,r)=>new jo({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...Be(r)});class bi extends Ye{_parse(t){return this._getType(t)===ye.undefined?wn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bi.create=(e,t)=>new bi({innerType:e,typeName:Ie.ZodOptional,...Be(t)});class Us extends Ye{_parse(t){return this._getType(t)===ye.null?wn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Us.create=(e,t)=>new Us({innerType:e,typeName:Ie.ZodNullable,...Be(t)});class Og extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Og.create=(e,t)=>new Og({innerType:e,typeName:Ie.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Be(t)});class kg extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return tp(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ia(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ia(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}kg.create=(e,t)=>new kg({innerType:e,typeName:Ie.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Be(t)});class B_ extends Ye{_parse(t){if(this._getType(t)!==ye.nan){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.nan,received:n.parsedType}),$e}return{status:"valid",value:t.data}}}B_.create=e=>new B_({typeName:Ie.ZodNaN,...Be(e)});class o5 extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class pb extends Ye{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?$e:i.status==="dirty"?(r.dirty(),pu(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?$e:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new pb({in:t,out:r,typeName:Ie.ZodPipeline})}}class Ag extends Ye{_parse(t){const r=this._def.innerType._parse(t),n=a=>(Fs(a)&&(a.value=Object.freeze(a.value)),a);return tp(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Ag.create=(e,t)=>new Ag({innerType:e,typeName:Ie.ZodReadonly,...Be(t)});var Ie;(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"})(Ie||(Ie={}));const U_=wa.create,Nu=wo.create;_o.create;rp.create;zs.create;Ai.create;const s5=Jn.create,jP=Dt.create;np.create;ap.create;So.create;Bs.create;ip.create;bi.create;Us.create;const Cu=jo.createWithPreprocess,OP={string:e=>wa.create({...e,coerce:!0}),number:e=>wo.create({...e,coerce:!0}),boolean:e=>rp.create({...e,coerce:!0}),bigint:e=>_o.create({...e,coerce:!0}),date:e=>zs.create({...e,coerce:!0})},l5={primary:"bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white",ghost:"text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]",danger:"bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]"},u5={sm:"px-4 py-1.5 text-xs font-semibold",md:"px-5 py-2.5 text-sm font-semibold"};function Te({variant:e="primary",size:t="md",className:r="",...n}){return c.jsx("button",{className:`relative inline-flex items-center justify-center gap-2 rounded-full transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/50 focus:ring-offset-1 focus:ring-offset-transparent focus:border-transparent ${l5[e]} ${u5[t]} ${r}`,...n,children:n.children})}function Gr({error:e}){return e?c.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/8 px-4 py-3 text-sm text-red-400 font-mono",children:e}):null}function mr({size:e=20}){return c.jsxs("svg",{className:"animate-spin text-brand-500",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}const c5={SR_SELECTION_V3_ROUTING:"bg-blue-100 text-blue-800",PRIORITY_LOGIC:"bg-purple-100 text-purple-800",NTW_BASED_ROUTING:"bg-green-100 text-green-800",SR_SELECTION_V3_ROUTING_WITH_HEDGING:"bg-orange-100 text-orange-800",HEDGING:"bg-orange-100 text-orange-800"},d5=["card","card_redirect","pay_later","wallet","bank_redirect","bank_transfer","crypto","bank_debit","reward","real_time_payment","upi","voucher","gift_card","open_banking","mobile_payment"],f5={card:["credit","debit"],bank_debit:["ach","sepa","bacs","becs"],bank_transfer:["ach","sepa","sepa_bank_transfer","bacs","multibanco","pix","pse","permata_bank_transfer","bca_bank_transfer","bni_va","bri_va","cimb_va","danamon_va","mandiri_va","local_bank_transfer","instant_bank_transfer"],wallet:["amazon_pay","apple_pay","google_pay","paypal","ali_pay","ali_pay_hk","dana","mb_way","mobile_pay","samsung_pay","twint","vipps","touch_n_go","swish","we_chat_pay","go_pay","gcash","momo","kakao_pay","cashapp","mifinity","paze"],pay_later:["affirm","alma","afterpay_clearpay","klarna","pay_bright","atome","walley"],upi:["upi_collect","upi_intent"],voucher:["boleto","efecty","pago_efectivo","red_compra","red_pagos","indomaret","alfamart","oxxo","seven_eleven","lawson","mini_stop","family_mart","seicomart","pay_easy"],bank_redirect:["giropay","ideal","sofort","eft","eps","bancontact_card","blik","local_bank_redirect","online_banking_thailand","online_banking_czech_republic","online_banking_finland","online_banking_fpx","online_banking_poland","online_banking_slovakia","przelewy24","trustly","bizum","interac","open_banking_uk","open_banking_pis"],gift_card:["givex","pay_safe_card"],card_redirect:["knet","benefit","momo_atm","card_redirect"],real_time_payment:["fps","duit_now","prompt_pay","viet_qr"],crypto:["crypto_currency"],reward:["evoucher","classic_reward"],open_banking:["open_banking_pis"],mobile_payment:["direct_carrier_billing"]},p5=jP({paymentMethodType:U_().min(1),paymentMethod:U_().min(1),bucketSize:OP.number().int().positive(),hedgingPercent:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),latencyThreshold:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable())}),h5=jP({defaultBucketSize:OP.number().int().positive(),defaultSuccessRate:Cu(e=>e===""||e===null?null:Number(e),Nu().min(0).max(1).nullable()),defaultLatencyThreshold:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),defaultHedgingPercent:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),subLevelInputConfig:s5(p5)});function m5(){var R,M,F,W,V;const{merchantId:e}=ia(),[t,r]=j.useState(!1),[n,a]=j.useState(null),[i,o]=j.useState(!1),[s,l]=j.useState(!1),[u,f]=j.useState(!1),[d,p]=j.useState(null),{data:h,isLoading:x,mutate:y}=Ft(e?["rule-sr",e]:null,()=>bt("/rule/get",{merchant_id:e,algorithm:"successRate"}),{shouldRetryOnError:!1}),{register:v,control:g,handleSubmit:m,reset:w,watch:S,formState:{errors:b}}=NL({resolver:IL(h5),defaultValues:{defaultBucketSize:200,defaultSuccessRate:.5,defaultLatencyThreshold:null,defaultHedgingPercent:null,subLevelInputConfig:[]}});j.useEffect(()=>{var L;if((L=h==null?void 0:h.config)!=null&&L.data){const U=h.config.data;w({defaultBucketSize:U.defaultBucketSize??200,defaultSuccessRate:U.defaultSuccessRate??.5,defaultLatencyThreshold:U.defaultLatencyThreshold??null,defaultHedgingPercent:U.defaultHedgingPercent??null,subLevelInputConfig:U.subLevelInputConfig??[]})}},[h,w]);const{fields:_,append:O,remove:k}=PL({control:g,name:"subLevelInputConfig"}),A=S("subLevelInputConfig");async function I(){try{await bt("/merchant-account/create",{merchant_id:e,gateway_success_rate_based_decider_input:null})}catch{}}async function T(L){if(!e){a("Set a Merchant ID first.");return}r(!0),a(null),o(!1);try{await I(),await bt(h?"/rule/update":"/rule/create",{merchant_id:e,config:{type:"successRate",data:{defaultBucketSize:L.defaultBucketSize,defaultSuccessRate:L.defaultSuccessRate,defaultLatencyThreshold:L.defaultLatencyThreshold,defaultHedgingPercent:L.defaultHedgingPercent,subLevelInputConfig:L.subLevelInputConfig.length>0?L.subLevelInputConfig:null}}}),o(!0),y()}catch(U){a(U instanceof Error?U.message:String(U))}finally{r(!1)}}async function P(){if(e){f(!0),p(null);try{await bt("/rule/delete",{merchant_id:e,algorithm:"successRate"}),y(void 0,{revalidate:!1})}catch(L){p(L instanceof Error?L.message:String(L))}finally{f(!1)}}}return c.jsxs("div",{className:"space-y-6 max-w-5xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Auth-Rate Based Routing"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure success-rate based gateway routing"})]}),!e&&c.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-800",children:"Set a Merchant ID in the top bar to load and save configuration."}),e&&!x&&c.jsxs(De,{children:[c.jsxs(Ze,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Configuration Status"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(R=h==null?void 0:h.config)!=null&&R.data?"Success Rate routing is configured and active":"No Success Rate configuration found"})]}),c.jsx(Oe,{variant:(M=h==null?void 0:h.config)!=null&&M.data?"green":"gray",children:(F=h==null?void 0:h.config)!=null&&F.data?"Active":"Not Configured"})]}),((W=h==null?void 0:h.config)==null?void 0:W.data)&&c.jsxs(Le,{className:"border-t border-slate-100 dark:border-[#222226]",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Last Modified:"}),c.jsx("span",{className:"ml-1 font-medium",children:h.modified_at?new Date(h.modified_at).toLocaleString():"Unknown"})]}),c.jsxs(Te,{type:"button",variant:"secondary",size:"sm",onClick:()=>{confirm("Are you sure you want to clear the Success Rate configuration? This will disable SR-based routing.")&&P()},disabled:u,children:[c.jsx($a,{size:14,className:"mr-1"}),u?"Clearing...":"Clear Configuration"]})]}),d&&c.jsx("p",{className:"text-xs text-red-500 mt-2",children:d})]})]}),x?c.jsx("div",{className:"flex justify-center py-12",children:c.jsx(mr,{})}):c.jsxs("form",{onSubmit:m(T),className:"space-y-6",children:[c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Default Success Rate Config"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Base settings used when there is no payment-method-specific override."})]})}),c.jsxs(Le,{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Bucket Size"}),c.jsx("input",{type:"number",...v("defaultBucketSize"),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"}),b.defaultBucketSize&&c.jsx("p",{className:"text-xs text-red-500",children:b.defaultBucketSize.message})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Success Rate"}),c.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",...v("defaultSuccessRate"),placeholder:"0.5",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Hedging %"}),c.jsx("input",{type:"number",step:"0.1",...v("defaultHedgingPercent"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Latency Threshold (ms)"}),c.jsx("input",{type:"number",...v("defaultLatencyThreshold"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]})]}),c.jsxs(De,{children:[c.jsxs(Ze,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Sub-Level Overrides"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Optional overrides for specific payment method type and method combinations."})]}),c.jsxs(Te,{type:"button",variant:"secondary",size:"sm",onClick:()=>O({paymentMethodType:"card",paymentMethod:"credit",bucketSize:20,hedgingPercent:null,latencyThreshold:null}),children:[c.jsx(ji,{size:14})," Add Level"]})]}),c.jsx(Le,{className:"overflow-x-auto p-0",children:_.length?c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-200 dark:border-[#1c1c24] bg-slate-50 dark:bg-[#0a0a0f]",children:[c.jsx("th",{className:"px-4 py-2",children:"Payment Method Type"}),c.jsx("th",{className:"px-4 py-2",children:"Payment Method"}),c.jsx("th",{className:"px-4 py-2",children:"Bucket Size"}),c.jsx("th",{className:"px-4 py-2",children:"Hedging %"}),c.jsx("th",{className:"px-4 py-2",children:"Latency Threshold (ms)"}),c.jsx("th",{className:"px-4 py-2"})]})}),c.jsx("tbody",{children:_.map((L,U)=>{var K;const q=((K=A==null?void 0:A[U])==null?void 0:K.paymentMethodType)||"",J=f5[q]||[];return c.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsx("select",{...v(`subLevelInputConfig.${U}.paymentMethodType`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:d5.map(ae=>c.jsx("option",{value:ae,children:ae},ae))})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("select",{...v(`subLevelInputConfig.${U}.paymentMethod`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(J.length?J:["credit","debit"]).map(ae=>c.jsx("option",{value:ae,children:ae},ae))})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",...v(`subLevelInputConfig.${U}.bucketSize`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",step:"0.1",...v(`subLevelInputConfig.${U}.hedgingPercent`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",...v(`subLevelInputConfig.${U}.latencyThreshold`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("button",{type:"button",onClick:()=>k(U),className:"text-slate-400 hover:text-red-500",children:c.jsx($a,{size:14})})})]},L.id)})})]}):c.jsx("div",{className:"px-4 py-8 text-sm text-slate-500",children:"No sub-level overrides configured. The default row above is the only active configuration."})})]}),c.jsx(Gr,{error:n}),i&&c.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-4 py-3 text-sm text-emerald-400",children:"Configuration saved successfully."}),((V=h==null?void 0:h.config)==null?void 0:V.data)&&c.jsxs(De,{children:[c.jsxs(Ze,{className:"flex flex-row items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Current Active Configuration"}),c.jsxs(Te,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!s),children:[c.jsx(Ch,{size:14,className:"mr-1"}),s?"Hide":"View"]})]}),s&&c.jsx(Le,{children:c.jsxs("div",{className:"text-xs text-slate-600 space-y-4",children:[c.jsxs("div",{className:"border-b border-slate-200 dark:border-[#222226] pb-3",children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Default Settings"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultBucketSize})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Success Rate:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultSuccessRate??"Not set"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultHedgingPercent??"Not set"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),c.jsxs("p",{className:"font-medium",children:[h.config.data.defaultLatencyThreshold??"Not set"," ms"]})]})]})]}),h.config.data.subLevelInputConfig&&h.config.data.subLevelInputConfig.length>0&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Sub-Level Configurations"}),c.jsx("div",{className:"space-y-2",children:h.config.data.subLevelInputConfig.map((L,U)=>c.jsx("div",{className:"bg-slate-50 dark:bg-[#151518] rounded-lg p-3",children:c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Payment Type:"}),c.jsx("p",{className:"font-medium capitalize",children:L.paymentMethodType})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Payment Method:"}),c.jsx("p",{className:"font-medium",children:L.paymentMethod})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),c.jsx("p",{className:"font-medium",children:L.bucketSize})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),c.jsx("p",{className:"font-medium",children:L.hedgingPercent??"Default"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),c.jsxs("p",{className:"font-medium",children:[L.latencyThreshold??"Default"," ms"]})]})]})},U))})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-3",children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Raw Configuration (JSON)"}),c.jsx("pre",{className:"bg-slate-900 dark:bg-[#0f0f11] text-slate-100 border border-transparent dark:border-[#222226] rounded-lg p-3 text-xs overflow-auto max-h-64",children:JSON.stringify(h.config,null,2)})]})]})})]}),c.jsx(Te,{type:"submit",disabled:t||!e,children:t?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Saving…"]}):"Save Configuration"})]})]})}function y5(){for(var e=arguments.length,t=new Array(e),r=0;rn=>{t.forEach(a=>a(n))},t)}const Rh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function hb(e){return"nodeType"in e}function zr(e){var t,r;return e?xl(e)?e:hb(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function mb(e){const{Document:t}=zr(e);return e instanceof t}function od(e){return xl(e)?!1:e instanceof zr(e).HTMLElement}function kP(e){return e instanceof zr(e).SVGElement}function bl(e){return e?xl(e)?e.document:hb(e)?mb(e)?e:od(e)||kP(e)?e.ownerDocument:document:document:document}const na=Rh?j.useLayoutEffect:j.useEffect;function yb(e){const t=j.useRef(e);return na(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),a=0;a{e.current=setInterval(n,a)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function cc(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return na(()=>{r.current!==e&&(r.current=e)},t),r}function sd(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function op(e){const t=yb(e),r=j.useRef(null),n=j.useCallback(a=>{a!==r.current&&(t==null||t(a,r.current)),r.current=a},[]);return[r,n]}function Eg(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let ky={};function ld(e,t){return j.useMemo(()=>{if(t)return t;const r=ky[e]==null?0:ky[e]+1;return ky[e]=r,e+"-"+r},[e,t])}function AP(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a{const s=Object.entries(o);for(const[l,u]of s){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const Os=AP(1),dc=AP(-1);function g5(e){return"clientX"in e&&"clientY"in e}function vb(e){if(!e)return!1;const{KeyboardEvent:t}=zr(e.target);return t&&e instanceof t}function x5(e){if(!e)return!1;const{TouchEvent:t}=zr(e.target);return t&&e instanceof t}function Pg(e){if(x5(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return g5(e)?{x:e.clientX,y:e.clientY}:null}const fc=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[fc.Translate.toString(e),fc.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),V_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function b5(e){return e.matches(V_)?e:e.querySelector(V_)}const w5={display:"none"};function _5(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:w5},r)}function S5(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:a,role:"status","aria-live":n,"aria-atomic":!0},r)}function j5(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const EP=j.createContext(null);function O5(e){const t=j.useContext(EP);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function k5(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.useCallback(n=>{let{type:a,event:i}=n;e.forEach(o=>{var s;return(s=o[a])==null?void 0:s.call(o,i)})},[e]),t]}const A5={draggable:` + To pick up a draggable item, press the space bar. + While dragging, use the arrow keys to move the item. + Press space again to drop the item in its new position, or press escape to cancel. + `},E5={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function P5(e){let{announcements:t=E5,container:r,hiddenTextDescribedById:n,screenReaderInstructions:a=A5}=e;const{announce:i,announcement:o}=j5(),s=ld("DndLiveRegion"),[l,u]=j.useState(!1);if(j.useEffect(()=>{u(!0)},[]),O5(j.useMemo(()=>({onDragStart(d){let{active:p}=d;i(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:h}=d;t.onDragMove&&i(t.onDragMove({active:p,over:h}))},onDragOver(d){let{active:p,over:h}=d;i(t.onDragOver({active:p,over:h}))},onDragEnd(d){let{active:p,over:h}=d;i(t.onDragEnd({active:p,over:h}))},onDragCancel(d){let{active:p,over:h}=d;i(t.onDragCancel({active:p,over:h}))}}),[i,t])),!l)return null;const f=C.createElement(C.Fragment,null,C.createElement(_5,{id:n,value:a.draggable}),C.createElement(S5,{id:s,announcement:o}));return r?us.createPortal(f,r):f}var Ht;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Ht||(Ht={}));function sp(){}function W_(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function N5(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const zn=Object.freeze({x:0,y:0});function PP(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function NP(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function C5(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function H_(e){let{left:t,top:r,height:n,width:a}=e;return[{x:t,y:r},{x:t+a,y:r},{x:t,y:r+n},{x:t+a,y:r+n}]}function CP(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function G_(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const T5=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=G_(t,t.left,t.top),i=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=PP(G_(l),a);i.push({id:s,data:{droppableContainer:o,value:u}})}}return i.sort(NP)},$5=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=H_(t),i=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=H_(l),f=a.reduce((p,h,x)=>p+PP(u[x],h),0),d=Number((f/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:d}})}}return i.sort(NP)};function I5(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=a-n,s=i-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=[];for(const i of n){const{id:o}=i,s=r.get(o);if(s){const l=I5(s,t);l>0&&a.push({id:o,data:{droppableContainer:i,value:l}})}}return a.sort(C5)};function M5(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function TP(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zn}function D5(e){return function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i({...o,top:o.top+e*s.y,bottom:o.bottom+e*s.y,left:o.left+e*s.x,right:o.right+e*s.x}),{...r})}}const L5=D5(1);function F5(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function z5(e,t,r){const n=F5(t);if(!n)return e;const{scaleX:a,scaleY:i,x:o,y:s}=n,l=e.left-o-(1-a)*parseFloat(r),u=e.top-s-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),f=a?e.width/a:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const B5={ignoreTransform:!1};function wl(e,t){t===void 0&&(t=B5);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=zr(e).getComputedStyle(e);u&&(r=z5(r,u,f))}const{top:n,left:a,width:i,height:o,bottom:s,right:l}=r;return{top:n,left:a,width:i,height:o,bottom:s,right:l}}function q_(e){return wl(e,{ignoreTransform:!0})}function U5(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function V5(e,t){return t===void 0&&(t=zr(e).getComputedStyle(e)),t.position==="fixed"}function W5(e,t){t===void 0&&(t=zr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const i=t[a];return typeof i=="string"?r.test(i):!1})}function Mh(e,t){const r=[];function n(a){if(t!=null&&r.length>=t||!a)return r;if(mb(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!od(a)||kP(a)||r.includes(a))return r;const i=zr(e).getComputedStyle(a);return a!==e&&W5(a,i)&&r.push(a),V5(a,i)?r:n(a.parentNode)}return e?n(e):r}function $P(e){const[t]=Mh(e,1);return t??null}function Ay(e){return!Rh||!e?null:xl(e)?e:hb(e)?mb(e)||e===bl(e).scrollingElement?window:od(e)?e:null:null}function IP(e){return xl(e)?e.scrollX:e.scrollLeft}function RP(e){return xl(e)?e.scrollY:e.scrollTop}function Ng(e){return{x:IP(e),y:RP(e)}}var rr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(rr||(rr={}));function MP(e){return!Rh||!e?!1:e===document.scrollingElement}function DP(e){const t={x:0,y:0},r=MP(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},a=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:a,isLeft:i,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const H5={x:.2,y:.2};function G5(e,t,r,n,a){let{top:i,left:o,right:s,bottom:l}=r;n===void 0&&(n=10),a===void 0&&(a=H5);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=DP(e),h={x:0,y:0},x={x:0,y:0},y={height:t.height*a.y,width:t.width*a.x};return!u&&i<=t.top+y.height?(h.y=rr.Backward,x.y=n*Math.abs((t.top+y.height-i)/y.height)):!f&&l>=t.bottom-y.height&&(h.y=rr.Forward,x.y=n*Math.abs((t.bottom-y.height-l)/y.height)),!p&&s>=t.right-y.width?(h.x=rr.Forward,x.x=n*Math.abs((t.right-y.width-s)/y.width)):!d&&o<=t.left+y.width&&(h.x=rr.Backward,x.x=n*Math.abs((t.left+y.width-o)/y.width)),{direction:h,speed:x}}function q5(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:r,right:n,bottom:a}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:a,width:e.clientWidth,height:e.clientHeight}}function LP(e){return e.reduce((t,r)=>Os(t,Ng(r)),zn)}function K5(e){return e.reduce((t,r)=>t+IP(r),0)}function X5(e){return e.reduce((t,r)=>t+RP(r),0)}function Y5(e,t){if(t===void 0&&(t=wl),!e)return;const{top:r,left:n,bottom:a,right:i}=t(e);$P(e)&&(a<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Z5=[["x",["left","right"],K5],["y",["top","bottom"],X5]];class gb{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Mh(r),a=LP(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,s]of Z5)for(const l of o)Object.defineProperty(this,l,{get:()=>{const u=s(n),f=a[i]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Tu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var a;(a=this.target)==null||a.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Q5(e){const{EventTarget:t}=zr(e);return e instanceof t?e:bl(e)}function Ey(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var cn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(cn||(cn={}));function K_(e){e.preventDefault()}function J5(e){e.stopPropagation()}var Ke;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ke||(Ke={}));const FP={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},e4=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ke.Right:return{...r,x:r.x+25};case Ke.Left:return{...r,x:r.x-25};case Ke.Down:return{...r,y:r.y+25};case Ke.Up:return{...r,y:r.y-25}}};class xb{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Tu(bl(r)),this.windowListeners=new Tu(zr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(cn.Resize,this.handleCancel),this.windowListeners.add(cn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(cn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Y5(n),r(zn)}handleKeyDown(t){if(vb(t)){const{active:r,context:n,options:a}=this.props,{keyboardCodes:i=FP,coordinateGetter:o=e4,scrollBehavior:s="smooth"}=a,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,f=u?{x:u.left,y:u.top}:zn;this.referenceCoordinates||(this.referenceCoordinates=f);const d=o(t,{active:r,context:n.current,currentCoordinates:f});if(d){const p=dc(d,f),h={x:0,y:0},{scrollableAncestors:x}=n.current;for(const y of x){const v=t.code,{isTop:g,isRight:m,isLeft:w,isBottom:S,maxScroll:b,minScroll:_}=DP(y),O=q5(y),k={x:Math.min(v===Ke.Right?O.right-O.width/2:O.right,Math.max(v===Ke.Right?O.left:O.left+O.width/2,d.x)),y:Math.min(v===Ke.Down?O.bottom-O.height/2:O.bottom,Math.max(v===Ke.Down?O.top:O.top+O.height/2,d.y))},A=v===Ke.Right&&!m||v===Ke.Left&&!w,I=v===Ke.Down&&!S||v===Ke.Up&&!g;if(A&&k.x!==d.x){const T=y.scrollLeft+p.x,P=v===Ke.Right&&T<=b.x||v===Ke.Left&&T>=_.x;if(P&&!p.y){y.scrollTo({left:T,behavior:s});return}P?h.x=y.scrollLeft-T:h.x=v===Ke.Right?y.scrollLeft-b.x:y.scrollLeft-_.x,h.x&&y.scrollBy({left:-h.x,behavior:s});break}else if(I&&k.y!==d.y){const T=y.scrollTop+p.y,P=v===Ke.Down&&T<=b.y||v===Ke.Up&&T>=_.y;if(P&&!p.x){y.scrollTo({top:T,behavior:s});return}P?h.y=y.scrollTop-T:h.y=v===Ke.Down?y.scrollTop-b.y:y.scrollTop-_.y,h.y&&y.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,Os(dc(d,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}xb.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=FP,onActivation:a}=t,{active:i}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const s=i.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function X_(e){return!!(e&&"distance"in e)}function Y_(e){return!!(e&&"delay"in e)}class bb{constructor(t,r,n){var a;n===void 0&&(n=Q5(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:o}=i;this.props=t,this.events=r,this.document=bl(o),this.documentListeners=new Tu(this.document),this.listeners=new Tu(n),this.windowListeners=new Tu(zr(o)),this.initialCoordinates=(a=Pg(i))!=null?a:zn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(cn.Resize,this.handleCancel),this.windowListeners.add(cn.DragStart,K_),this.windowListeners.add(cn.VisibilityChange,this.handleCancel),this.windowListeners.add(cn.ContextMenu,K_),this.documentListeners.add(cn.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Y_(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(X_(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:a}=this.props;a(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(cn.Click,J5,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(cn.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:a,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!a)return;const l=(r=Pg(t))!=null?r:zn,u=dc(a,l);if(!n&&s){if(X_(s)){if(s.tolerance!=null&&Ey(u,s.tolerance))return this.handleCancel();if(Ey(u,s.distance))return this.handleStart()}if(Y_(s)&&Ey(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const t4={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class wb extends bb{constructor(t){const{event:r}=t,n=bl(r.target);super(t,t4,n)}}wb.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const r4={move:{name:"mousemove"},end:{name:"mouseup"}};var Cg;(function(e){e[e.RightClick=2]="RightClick"})(Cg||(Cg={}));class n4 extends bb{constructor(t){super(t,r4,bl(t.event.target))}}n4.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Cg.RightClick?!1:(n==null||n({event:r}),!0)}}];const Py={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class a4 extends bb{constructor(t){super(t,Py)}static setup(){return window.addEventListener(Py.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Py.move.name,t)};function t(){}}}a4.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:a}=r;return a.length>1?!1:(n==null||n({event:r}),!0)}}];var $u;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})($u||($u={}));var lp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(lp||(lp={}));function i4(e){let{acceleration:t,activator:r=$u.Pointer,canScroll:n,draggingRect:a,enabled:i,interval:o=5,order:s=lp.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const h=s4({delta:d,disabled:!i}),[x,y]=v5(),v=j.useRef({x:0,y:0}),g=j.useRef({x:0,y:0}),m=j.useMemo(()=>{switch(r){case $u.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case $u.DraggableRect:return a}},[r,a,l]),w=j.useRef(null),S=j.useCallback(()=>{const _=w.current;if(!_)return;const O=v.current.x*g.current.x,k=v.current.y*g.current.y;_.scrollBy(O,k)},[]),b=j.useMemo(()=>s===lp.TreeOrder?[...u].reverse():u,[s,u]);j.useEffect(()=>{if(!i||!u.length||!m){y();return}for(const _ of b){if((n==null?void 0:n(_))===!1)continue;const O=u.indexOf(_),k=f[O];if(!k)continue;const{direction:A,speed:I}=G5(_,k,m,t,p);for(const T of["x","y"])h[T][A[T]]||(I[T]=0,A[T]=0);if(I.x>0||I.y>0){y(),w.current=_,x(S,o),v.current=I,g.current=A;return}}v.current={x:0,y:0},g.current={x:0,y:0},y()},[t,S,n,y,i,o,JSON.stringify(m),JSON.stringify(h),x,u,b,f,JSON.stringify(p)])}const o4={x:{[rr.Backward]:!1,[rr.Forward]:!1},y:{[rr.Backward]:!1,[rr.Forward]:!1}};function s4(e){let{delta:t,disabled:r}=e;const n=Eg(t);return sd(a=>{if(r||!n||!a)return o4;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[rr.Backward]:a.x[rr.Backward]||i.x===-1,[rr.Forward]:a.x[rr.Forward]||i.x===1},y:{[rr.Backward]:a.y[rr.Backward]||i.y===-1,[rr.Forward]:a.y[rr.Forward]||i.y===1}}},[r,t,n])}function l4(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return sd(a=>{var i;return t==null?null:(i=n??a)!=null?i:null},[n,t])}function u4(e,t){return j.useMemo(()=>e.reduce((r,n)=>{const{sensor:a}=n,i=a.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...i]},[]),[e,t])}var pc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(pc||(pc={}));var Tg;(function(e){e.Optimized="optimized"})(Tg||(Tg={}));const Z_=new Map;function c4(e,t){let{dragging:r,dependencies:n,config:a}=t;const[i,o]=j.useState(null),{frequency:s,measure:l,strategy:u}=a,f=j.useRef(e),d=v(),p=cc(d),h=j.useCallback(function(g){g===void 0&&(g=[]),!p.current&&o(m=>m===null?g:m.concat(g.filter(w=>!m.includes(w))))},[p]),x=j.useRef(null),y=sd(g=>{if(d&&!r)return Z_;if(!g||g===Z_||f.current!==e||i!=null){const m=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){m.set(w.id,w.rect.current);continue}const S=w.node.current,b=S?new gb(l(S),S):null;w.rect.current=b,b&&m.set(w.id,b)}return m}return g},[e,i,r,d,l]);return j.useEffect(()=>{f.current=e},[e]),j.useEffect(()=>{d||h()},[r,d]),j.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),j.useEffect(()=>{d||typeof s!="number"||x.current!==null||(x.current=setTimeout(()=>{h(),x.current=null},s))},[s,d,h,...n]),{droppableRects:y,measureDroppableContainers:h,measuringScheduled:i!=null};function v(){switch(u){case pc.Always:return!1;case pc.BeforeDragging:return r;default:return!r}}}function zP(e,t){return sd(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function d4(e,t){return zP(e,t)}function f4(e){let{callback:t,disabled:r}=e;const n=yb(t),a=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return j.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Dh(e){let{callback:t,disabled:r}=e;const n=yb(t),a=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return j.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function p4(e){return new gb(wl(e),e)}function Q_(e,t,r){t===void 0&&(t=p4);const[n,a]=j.useState(null);function i(){a(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=f4({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),s=Dh({callback:i});return na(()=>{i(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),n}function h4(e){const t=zP(e);return TP(e,t)}const J_=[];function m4(e){const t=j.useRef(e),r=sd(n=>e?n&&n!==J_&&e&&t.current&&e.parentNode===t.current.parentNode?n:Mh(e):J_,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function y4(e){const[t,r]=j.useState(null),n=j.useRef(e),a=j.useCallback(i=>{const o=Ay(i.target);o&&r(s=>s?(s.set(o,Ng(o)),new Map(s)):null)},[]);return j.useEffect(()=>{const i=n.current;if(e!==i){o(i);const s=e.map(l=>{const u=Ay(l);return u?(u.addEventListener("scroll",a,{passive:!0}),[u,Ng(u)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{o(e),o(i)};function o(s){s.forEach(l=>{const u=Ay(l);u==null||u.removeEventListener("scroll",a)})}},[a,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>Os(i,o),zn):LP(e):zn,[e,t])}function eS(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==zn;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?dc(e,r.current):zn}function v4(e){j.useEffect(()=>{if(!Rh)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function g4(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:a,handler:i}=n;return r[a]=o=>{i(o,t)},r},{}),[e,t])}function BP(e){return j.useMemo(()=>e?U5(e):null,[e])}const tS=[];function x4(e,t){t===void 0&&(t=wl);const[r]=e,n=BP(r?zr(r):null),[a,i]=j.useState(tS);function o(){i(()=>e.length?e.map(l=>MP(l)?n:new gb(t(l),l)):tS)}const s=Dh({callback:o});return na(()=>{s==null||s.disconnect(),o(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),a}function b4(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return od(t)?t:e}function w4(e){let{measure:t}=e;const[r,n]=j.useState(null),a=j.useCallback(u=>{for(const{target:f}of u)if(od(f)){n(d=>{const p=t(f);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),i=Dh({callback:a}),o=j.useCallback(u=>{const f=b4(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),n(f?t(f):null)},[t,i]),[s,l]=op(o);return j.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const _4=[{sensor:wb,options:{}},{sensor:xb,options:{}}],S4={current:{}},_f={draggable:{measure:q_},droppable:{measure:q_,strategy:pc.WhileDragging,frequency:Tg.Optimized},dragOverlay:{measure:wl}};class Iu extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const j4={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Iu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:sp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:_f,measureDroppableContainers:sp,windowRect:null,measuringScheduled:!1},O4={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:sp,draggableNodes:new Map,over:null,measureDroppableContainers:sp},Lh=j.createContext(O4),UP=j.createContext(j4);function k4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Iu}}}function A4(e,t){switch(t.type){case Ht.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ht.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Ht.DragEnd:case Ht.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ht.RegisterDroppable:{const{element:r}=t,{id:n}=r,a=new Iu(e.droppable.containers);return a.set(n,r),{...e,droppable:{...e.droppable,containers:a}}}case Ht.SetDroppableDisabled:{const{id:r,key:n,disabled:a}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new Iu(e.droppable.containers);return o.set(r,{...i,disabled:a}),{...e,droppable:{...e.droppable,containers:o}}}case Ht.UnregisterDroppable:{const{id:r,key:n}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new Iu(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function E4(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:a}=j.useContext(Lh),i=Eg(n),o=Eg(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&i&&o!=null){if(!vb(i)||document.activeElement===i.target)return;const s=a.get(o);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=b5(f);if(d){d.focus();break}}})}},[n,t,a,o,i]),null}function P4(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((a,i)=>i({transform:a,...n}),r):r}function N4(e){return j.useMemo(()=>({draggable:{..._f.draggable,...e==null?void 0:e.draggable},droppable:{..._f.droppable,...e==null?void 0:e.droppable},dragOverlay:{..._f.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function C4(e){let{activeNode:t,measure:r,initialRect:n,config:a=!0}=e;const i=j.useRef(!1),{x:o,y:s}=typeof a=="boolean"?{x:a,y:a}:a;na(()=>{if(!o&&!s||!t){i.current=!1;return}if(i.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=r(u),d=TP(f,n);if(o||(d.x=0),s||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=$P(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,o,s,n,r])}const VP=j.createContext({...zn,scaleX:1,scaleY:1});var ti;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ti||(ti={}));const T4=j.memo(function(t){var r,n,a,i;let{id:o,accessibility:s,autoScroll:l=!0,children:u,sensors:f=_4,collisionDetection:d=R5,measuring:p,modifiers:h,...x}=t;const y=j.useReducer(A4,void 0,k4),[v,g]=y,[m,w]=k5(),[S,b]=j.useState(ti.Uninitialized),_=S===ti.Initialized,{draggable:{active:O,nodes:k,translate:A},droppable:{containers:I}}=v,T=O!=null?k.get(O):null,P=j.useRef({initial:null,translated:null}),R=j.useMemo(()=>{var Zt;return O!=null?{id:O,data:(Zt=T==null?void 0:T.data)!=null?Zt:S4,rect:P}:null},[O,T]),M=j.useRef(null),[F,W]=j.useState(null),[V,L]=j.useState(null),U=cc(x,Object.values(x)),q=ld("DndDescribedBy",o),J=j.useMemo(()=>I.getEnabled(),[I]),K=N4(p),{droppableRects:ae,measureDroppableContainers:Q,measuringScheduled:be}=c4(J,{dragging:_,dependencies:[A.x,A.y],config:K.droppable}),ue=l4(k,O),Pe=j.useMemo(()=>V?Pg(V):null,[V]),Fe=Fo(),te=d4(ue,K.draggable.measure);C4({activeNode:O!=null?k.get(O):null,config:Fe.layoutShiftCompensation,initialRect:te,measure:K.draggable.measure});const ie=Q_(ue,K.draggable.measure,te),he=Q_(ue?ue.parentElement:null),X=j.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ke=I.getNodeFor((r=X.current.over)==null?void 0:r.id),ve=w4({measure:K.dragOverlay.measure}),Ae=(n=ve.nodeRef.current)!=null?n:ue,ze=_?(a=ve.rect)!=null?a:ie:null,ge=!!(ve.nodeRef.current&&ve.rect),Ce=h4(ge?null:ie),Me=BP(Ae?zr(Ae):null),je=m4(_?ke??ue:null),Ge=x4(je),H=P4(h,{transform:{x:A.x-Ce.x,y:A.y-Ce.y,scaleX:1,scaleY:1},activatorEvent:V,active:R,activeNodeRect:ie,containerNodeRect:he,draggingNodeRect:ze,over:X.current.over,overlayNodeRect:ve.rect,scrollableAncestors:je,scrollableAncestorRects:Ge,windowRect:Me}),E=Pe?Os(Pe,A):null,D=y4(je),N=eS(D),B=eS(D,[ie]),G=Os(H,N),ee=ze?L5(ze,H):null,Z=R&&ee?d({active:R,collisionRect:ee,droppableRects:ae,droppableContainers:J,pointerCoordinates:E}):null,me=CP(Z,"id"),[Ne,At]=j.useState(null),Ct=ge?H:Os(H,B),Yt=M5(Ct,(i=Ne==null?void 0:Ne.rect)!=null?i:null,ie),Fi=j.useRef(null),Wa=j.useCallback((Zt,Qt)=>{let{sensor:cr,options:jn}=Qt;if(M.current==null)return;const Nr=k.get(M.current);if(!Nr)return;const ut=Zt.nativeEvent,Ue=new cr({active:M.current,activeNode:Nr,event:ut,options:jn,context:X,onAbort(ot){if(!k.get(ot))return;const{onDragAbort:Ve}=U.current,rn={id:ot};Ve==null||Ve(rn),m({type:"onDragAbort",event:rn})},onPending(ot,Et,Ve,rn){if(!k.get(ot))return;const{onDragPending:Ha}=U.current,On={id:ot,constraint:Et,initialCoordinates:Ve,offset:rn};Ha==null||Ha(On),m({type:"onDragPending",event:On})},onStart(ot){const Et=M.current;if(Et==null)return;const Ve=k.get(Et);if(!Ve)return;const{onDragStart:rn}=U.current,nn={activatorEvent:ut,active:{id:Et,data:Ve.data,rect:P}};us.unstable_batchedUpdates(()=>{rn==null||rn(nn),b(ti.Initializing),g({type:Ht.DragStart,initialCoordinates:ot,active:Et}),m({type:"onDragStart",event:nn}),W(Fi.current),L(ut)})},onMove(ot){g({type:Ht.DragMove,coordinates:ot})},onEnd:ua(Ht.DragEnd),onCancel:ua(Ht.DragCancel)});Fi.current=Ue;function ua(ot){return async function(){const{active:Ve,collisions:rn,over:nn,scrollAdjustedTranslate:Ha}=X.current;let On=null;if(Ve&&Ha){const{cancelDrop:Ga}=U.current;On={activatorEvent:ut,active:Ve,collisions:rn,delta:Ha,over:nn},ot===Ht.DragEnd&&typeof Ga=="function"&&await Promise.resolve(Ga(On))&&(ot=Ht.DragCancel)}M.current=null,us.unstable_batchedUpdates(()=>{g({type:ot}),b(ti.Uninitialized),At(null),W(null),L(null),Fi.current=null;const Ga=ot===Ht.DragEnd?"onDragEnd":"onDragCancel";if(On){const zo=U.current[Ga];zo==null||zo(On),m({type:Ga,event:On})}})}}},[k]),zi=j.useCallback((Zt,Qt)=>(cr,jn)=>{const Nr=cr.nativeEvent,ut=k.get(jn);if(M.current!==null||!ut||Nr.dndKit||Nr.defaultPrevented)return;const Ue={active:ut};Zt(cr,Qt.options,Ue)===!0&&(Nr.dndKit={capturedBy:Qt.sensor},M.current=jn,Wa(cr,Qt))},[k,Wa]),Bi=u4(f,zi);v4(f),na(()=>{ie&&S===ti.Initializing&&b(ti.Initialized)},[ie,S]),j.useEffect(()=>{const{onDragMove:Zt}=U.current,{active:Qt,activatorEvent:cr,collisions:jn,over:Nr}=X.current;if(!Qt||!cr)return;const ut={active:Qt,activatorEvent:cr,collisions:jn,delta:{x:G.x,y:G.y},over:Nr};us.unstable_batchedUpdates(()=>{Zt==null||Zt(ut),m({type:"onDragMove",event:ut})})},[G.x,G.y]),j.useEffect(()=>{const{active:Zt,activatorEvent:Qt,collisions:cr,droppableContainers:jn,scrollAdjustedTranslate:Nr}=X.current;if(!Zt||M.current==null||!Qt||!Nr)return;const{onDragOver:ut}=U.current,Ue=jn.get(me),ua=Ue&&Ue.rect.current?{id:Ue.id,rect:Ue.rect.current,data:Ue.data,disabled:Ue.disabled}:null,ot={active:Zt,activatorEvent:Qt,collisions:cr,delta:{x:Nr.x,y:Nr.y},over:ua};us.unstable_batchedUpdates(()=>{At(ua),ut==null||ut(ot),m({type:"onDragOver",event:ot})})},[me]),na(()=>{X.current={activatorEvent:V,active:R,activeNode:ue,collisionRect:ee,collisions:Z,droppableRects:ae,draggableNodes:k,draggingNode:Ae,draggingNodeRect:ze,droppableContainers:I,over:Ne,scrollableAncestors:je,scrollAdjustedTranslate:G},P.current={initial:ze,translated:ee}},[R,ue,Z,ee,k,Ae,ze,ae,I,Ne,je,G]),i4({...Fe,delta:A,draggingRect:ee,pointerCoordinates:E,scrollableAncestors:je,scrollableAncestorRects:Ge});const Ui=j.useMemo(()=>({active:R,activeNode:ue,activeNodeRect:ie,activatorEvent:V,collisions:Z,containerNodeRect:he,dragOverlay:ve,draggableNodes:k,droppableContainers:I,droppableRects:ae,over:Ne,measureDroppableContainers:Q,scrollableAncestors:je,scrollableAncestorRects:Ge,measuringConfiguration:K,measuringScheduled:be,windowRect:Me}),[R,ue,ie,V,Z,he,ve,k,I,ae,Ne,Q,je,Ge,K,be,Me]),Rl=j.useMemo(()=>({activatorEvent:V,activators:Bi,active:R,activeNodeRect:ie,ariaDescribedById:{draggable:q},dispatch:g,draggableNodes:k,over:Ne,measureDroppableContainers:Q}),[V,Bi,R,ie,g,q,k,Ne,Q]);return C.createElement(EP.Provider,{value:w},C.createElement(Lh.Provider,{value:Rl},C.createElement(UP.Provider,{value:Ui},C.createElement(VP.Provider,{value:Yt},u)),C.createElement(E4,{disabled:(s==null?void 0:s.restoreFocus)===!1})),C.createElement(P5,{...s,hiddenTextDescribedById:q}));function Fo(){const Zt=(F==null?void 0:F.autoScrollEnabled)===!1,Qt=typeof l=="object"?l.enabled===!1:l===!1,cr=_&&!Zt&&!Qt;return typeof l=="object"?{...l,enabled:cr}:{enabled:cr}}}),$4=j.createContext(null),rS="button",I4="Draggable";function R4(e){let{id:t,data:r,disabled:n=!1,attributes:a}=e;const i=ld(I4),{activators:o,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=j.useContext(Lh),{role:h=rS,roleDescription:x="draggable",tabIndex:y=0}=a??{},v=(l==null?void 0:l.id)===t,g=j.useContext(v?VP:$4),[m,w]=op(),[S,b]=op(),_=g4(o,t),O=cc(r);na(()=>(d.set(t,{id:t,key:i,node:m,activatorNode:S,data:O}),()=>{const A=d.get(t);A&&A.key===i&&d.delete(t)}),[d,t]);const k=j.useMemo(()=>({role:h,tabIndex:y,"aria-disabled":n,"aria-pressed":v&&h===rS?!0:void 0,"aria-roledescription":x,"aria-describedby":f.draggable}),[n,h,y,v,x,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:k,isDragging:v,listeners:n?void 0:_,node:m,over:p,setNodeRef:w,setActivatorNodeRef:b,transform:g}}function M4(){return j.useContext(UP)}const D4="Droppable",L4={timeout:25};function F4(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:a}=e;const i=ld(D4),{active:o,dispatch:s,over:l,measureDroppableContainers:u}=j.useContext(Lh),f=j.useRef({disabled:r}),d=j.useRef(!1),p=j.useRef(null),h=j.useRef(null),{disabled:x,updateMeasurementsFor:y,timeout:v}={...L4,...a},g=cc(y??n),m=j.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),h.current=null},v)},[v]),w=Dh({callback:m,disabled:x||!o}),S=j.useCallback((k,A)=>{w&&(A&&(w.unobserve(A),d.current=!1),k&&w.observe(k))},[w]),[b,_]=op(S),O=cc(t);return j.useEffect(()=>{!w||!b.current||(w.disconnect(),d.current=!1,w.observe(b.current))},[b,w]),j.useEffect(()=>(s({type:Ht.RegisterDroppable,element:{id:n,key:i,disabled:r,node:b,rect:p,data:O}}),()=>s({type:Ht.UnregisterDroppable,key:i,id:n})),[n]),j.useEffect(()=>{r!==f.current.disabled&&(s({type:Ht.SetDroppableDisabled,id:n,key:i,disabled:r}),f.current.disabled=r)},[n,i,r,s]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===n,node:b,over:l,setNodeRef:_}}function _b(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function z4(e,t){return e.reduce((r,n,a)=>{const i=t.get(n);return i&&(r[a]=i),r},Array(e.length))}function Bd(e){return e!==null&&e>=0}function B4(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:a}=e;const i=_b(t,n,r),o=t[a],s=i[a];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Ud={scaleX:1,scaleY:1},V4=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:a,rects:i,overIndex:o}=e;const s=(t=i[r])!=null?t:n;if(!s)return null;if(a===r){const u=i[o];return u?{x:0,y:rr&&a<=o?{x:0,y:-s.height-l,...Ud}:a=o?{x:0,y:s.height+l,...Ud}:{x:0,y:0,...Ud}};function W4(e,t,r){const n=e[t],a=e[t-1],i=e[t+1];return n?rn.map(_=>typeof _=="object"&&"id"in _?_.id:_),[n]),x=o!=null,y=o?h.indexOf(o.id):-1,v=u?h.indexOf(u.id):-1,g=j.useRef(h),m=!B4(h,g.current),w=v!==-1&&y===-1||m,S=U4(i);na(()=>{m&&x&&f(h)},[m,h,x,f]),j.useEffect(()=>{g.current=h},[h]);const b=j.useMemo(()=>({activeIndex:y,containerId:d,disabled:S,disableTransforms:w,items:h,overIndex:v,useDragOverlay:p,sortedRects:z4(h,l),strategy:a}),[y,d,S.draggable,S.droppable,w,h,v,l,p,a]);return C.createElement(GP.Provider,{value:b},t)}const G4=e=>{let{id:t,items:r,activeIndex:n,overIndex:a}=e;return _b(r,n,a).indexOf(t)},q4=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:a,items:i,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!n||s!==i&&a===o?!1:r?!0:o!==a&&t===l},K4={duration:200,easing:"ease"},qP="transform",X4=fc.Transition.toString({property:qP,duration:0,easing:"linear"}),Y4={roleDescription:"sortable"};function Z4(e){let{disabled:t,index:r,node:n,rect:a}=e;const[i,o]=j.useState(null),s=j.useRef(r);return na(()=>{if(!t&&r!==s.current&&n.current){const l=a.current;if(l){const u=wl(n.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&o(f)}}r!==s.current&&(s.current=r)},[t,r,n,a]),j.useEffect(()=>{i&&o(null)},[i]),i}function Q4(e){let{animateLayoutChanges:t=q4,attributes:r,disabled:n,data:a,getNewIndex:i=G4,id:o,strategy:s,resizeObserverConfig:l,transition:u=K4}=e;const{items:f,containerId:d,activeIndex:p,disabled:h,disableTransforms:x,sortedRects:y,overIndex:v,useDragOverlay:g,strategy:m}=j.useContext(GP),w=J4(n,h),S=f.indexOf(o),b=j.useMemo(()=>({sortable:{containerId:d,index:S,items:f},...a}),[d,a,S,f]),_=j.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:O,node:k,isOver:A,setNodeRef:I}=F4({id:o,data:b,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...l}}),{active:T,activatorEvent:P,activeNodeRect:R,attributes:M,setNodeRef:F,listeners:W,isDragging:V,over:L,setActivatorNodeRef:U,transform:q}=R4({id:o,data:b,attributes:{...Y4,...r},disabled:w.draggable}),J=y5(I,F),K=!!T,ae=K&&!x&&Bd(p)&&Bd(v),Q=!g&&V,be=Q&&ae?q:null,Pe=ae?be??(s??m)({rects:y,activeNodeRect:R,activeIndex:p,overIndex:v,index:S}):null,Fe=Bd(p)&&Bd(v)?i({id:o,items:f,activeIndex:p,overIndex:v}):S,te=T==null?void 0:T.id,ie=j.useRef({activeId:te,items:f,newIndex:Fe,containerId:d}),he=f!==ie.current.items,X=t({active:T,containerId:d,isDragging:V,isSorting:K,id:o,index:S,items:f,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:u,wasDragging:ie.current.activeId!=null}),ke=Z4({disabled:!X,index:S,node:k,rect:O});return j.useEffect(()=>{K&&ie.current.newIndex!==Fe&&(ie.current.newIndex=Fe),d!==ie.current.containerId&&(ie.current.containerId=d),f!==ie.current.items&&(ie.current.items=f)},[K,Fe,d,f]),j.useEffect(()=>{if(te===ie.current.activeId)return;if(te&&!ie.current.activeId){ie.current.activeId=te;return}const Ae=setTimeout(()=>{ie.current.activeId=te},50);return()=>clearTimeout(Ae)},[te]),{active:T,activeIndex:p,attributes:M,data:b,rect:O,index:S,newIndex:Fe,items:f,isOver:A,isSorting:K,isDragging:V,listeners:W,node:k,overIndex:v,over:L,setNodeRef:J,setActivatorNodeRef:U,setDroppableNodeRef:I,setDraggableNodeRef:F,transform:ke??Pe,transition:ve()};function ve(){if(ke||he&&ie.current.newIndex===S)return X4;if(!(Q&&!vb(P)||!u)&&(K||X))return fc.Transition.toString({...u,property:qP})}}function J4(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function up(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const e6=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],t6=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:a,droppableContainers:i,over:o,scrollableAncestors:s}}=t;if(e6.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=a.get(d.id);if(p)switch(e.code){case Ke.Down:n.topp.top&&l.push(d);break;case Ke.Left:n.left>p.left&&l.push(d);break;case Ke.Right:n.left1&&(f=u[1].id),f!=null){const d=i.get(r.id),p=i.get(f),h=p?a.get(p.id):null,x=p==null?void 0:p.node.current;if(x&&h&&d&&p){const v=Mh(x).some((_,O)=>s[O]!==_),g=KP(d,p),m=r6(d,p),w=v||!g?{x:0,y:0}:{x:m?n.width-h.width:0,y:m?n.height-h.height:0},S={x:h.left,y:h.top};return w.x&&w.y?S:dc(S,w)}}}};function KP(e,t){return!up(e)||!up(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function r6(e,t){return!up(e)||!up(t)||!KP(e,t)?!1:e.data.current.sortable.index{if(!a||typeof a!="object")return{};const i=a.keys;return i&&typeof i=="object"?i:a},r={...t(e.keys),...t((n=e.routing_config)==null?void 0:n.keys)};return Object.keys(r).length===0?[]:Object.entries(r).map(([a,i])=>{const o=(i.type||i.data_type||"str_value").toString().toLowerCase(),s={key:a,type:o};return i.values&&(s.values=Array.isArray(i.values)?i.values.map(l=>l.trim()):i.values.split(",").map(l=>l.trim())),i.min_value!==void 0&&(s.min_value=i.min_value),i.max_value!==void 0&&(s.max_value=i.max_value),i.min_length!==void 0&&(s.min_length=i.min_length),i.max_length!==void 0&&(s.max_length=i.max_length),i.exact_length!==void 0&&(s.exact_length=i.exact_length),i.regex&&(s.regex=i.regex),s})}function XP(){const{data:e,error:t,isLoading:r}=Ft("/config/routing-keys",Qn,{refreshInterval:0,revalidateOnFocus:!1}),n=n6(e||null),a=n.reduce((o,s)=>(o[s.key]=s,o),{}),i={};return n.forEach(o=>{i[o.key]={type:o.type,values:o.values||[]}}),{config:e,keys:n,keysByName:a,routingKeysConfig:i,isLoading:r,error:t,getKeyValues:o=>{var s;return((s=a[o])==null?void 0:s.values)||[]},isIntegerKey:o=>{var s;return((s=a[o])==null?void 0:s.type)==="integer"},isEnumKey:o=>{var s;return((s=a[o])==null?void 0:s.type)==="enum"}}}const a6={"==":"equal","!=":"not_equal",">":"greater_than","<":"less_than",">=":"greater_than_equal","<=":"less_than_equal"};function i6({id:e,name:t,onRemove:r}){const{attributes:n,listeners:a,setNodeRef:i,transform:o,transition:s}=Q4({id:e}),l={transform:fc.Transform.toString(o),transition:s};return c.jsxs("div",{ref:i,style:l,className:"flex items-center gap-2 bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] rounded-lg px-2 py-1.5",children:[c.jsx("span",{...n,...a,className:"cursor-grab text-slate-400",children:c.jsx(CD,{size:14})}),c.jsx("span",{className:"text-sm flex-1 font-mono",children:t}),c.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:c.jsx($a,{size:12})})]})}function YP({gateways:e,onChange:t}){const[r,n]=j.useState(""),[a,i]=j.useState(""),o=N5(W_(wb),W_(xb,{coordinateGetter:t6}));function s(u){const{active:f,over:d}=u;if(d&&f.id!==d.id){const p=e.findIndex(x=>x.id===f.id),h=e.findIndex(x=>x.id===d.id);t(_b(e,p,h))}}function l(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:a.trim()}]),n(""),i(""))}return c.jsxs("div",{className:"space-y-2",children:[c.jsx(T4,{sensors:o,collisionDetection:T5,onDragEnd:s,children:c.jsx(H4,{items:e.map(u=>u.id),strategy:V4,children:e.map((u,f)=>c.jsx(i6,{id:u.id,name:`${f+1}. ${u.gatewayName}${u.gatewayId?` (${u.gatewayId})`:""}`,onRemove:()=>t(e.filter(d=>d.id!==u.id))},u.id))})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{value:a,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsxs(Te,{type:"button",size:"sm",variant:"secondary",onClick:l,children:[c.jsx(ji,{size:13})," Add"]})]})]})}function ZP({gateways:e,onChange:t}){const[r,n]=j.useState(""),[a,i]=j.useState(""),o=e.reduce((l,u)=>l+u.split,0);function s(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:a.trim(),split:0}]),n(""),i(""))}return c.jsxs("div",{className:"space-y-2",children:[e.map(l=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:l.gatewayName,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayName:u.target.value}:f)),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-32 focus:outline-none"}),c.jsx("input",{value:l.gatewayId,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayId:u.target.value}:f)),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-28 focus:outline-none"}),c.jsx("input",{type:"range",min:0,max:100,value:l.split,onChange:u=>t(e.map(f=>f.id===l.id?{...f,split:Number(u.target.value)}:f)),className:"flex-1 accent-brand-500"}),c.jsxs("span",{className:"text-sm w-10 text-right",children:[l.split,"%"]}),c.jsx("button",{type:"button",onClick:()=>t(e.filter(u=>u.id!==l.id)),className:"text-red-400 hover:text-red-600",children:c.jsx($a,{size:12})})]},l.id)),c.jsxs("div",{className:`text-xs font-medium ${o===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",o,"% ",o!==100&&"(must equal 100)"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{value:r,onChange:l=>n(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{value:a,onChange:l=>i(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsxs(Te,{type:"button",size:"sm",variant:"secondary",onClick:s,children:[c.jsx(ji,{size:13})," Add"]})]})]})}function o6({row:e,onChange:t,onRemove:r,routingKeys:n}){var l;const a=n[e.lhs],i=(a==null?void 0:a.type)==="enum",s=(a==null?void 0:a.type)==="integer"?[">","<",">=","<=","==","!="]:["==","!="];return c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("select",{value:e.lhs,onChange:u=>t({...e,lhs:u.target.value,value:"",operator:"=="}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:Object.keys(n).map(u=>c.jsx("option",{value:u,children:u},u))}),c.jsx("select",{value:e.operator,onChange:u=>t({...e,operator:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:s.map(u=>c.jsx("option",{value:u,children:u},u))}),i?c.jsxs("select",{value:e.value,onChange:u=>t({...e,value:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:[c.jsx("option",{value:"",children:"select..."}),(((l=n[e.lhs])==null?void 0:l.values)||[]).map(u=>c.jsx("option",{value:u,children:u},u))]}):c.jsx("input",{type:"number",value:e.value,onChange:u=>t({...e,value:u.target.value}),placeholder:"value",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none"}),c.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:c.jsx($a,{size:12})})]})}function s6({block:e,onChange:t,onRemove:r,routingKeys:n}){var f;const[a,i]=j.useState(!1),o=Object.keys(n)[0]||"payment_method",l=(((f=n[o])==null?void 0:f.values)||[])[0]||"";function u(){t({...e,conditions:[...e.conditions,{id:crypto.randomUUID(),lhs:o,operator:"==",value:l}]})}return c.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#0d0d12] rounded-t-xl cursor-pointer",onClick:()=>i(!a),children:[c.jsx("input",{value:e.name,onChange:d=>{d.stopPropagation(),t({...e,name:d.target.value})},onClick:d=>d.stopPropagation(),placeholder:"Rule name",className:"bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),r()},className:"text-red-400 hover:text-red-600",children:c.jsx($a,{size:14})}),a?c.jsx(cu,{size:14}):c.jsx(du,{size:14})]})]}),!a&&c.jsxs("div",{className:"px-4 py-3 space-y-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"CONDITIONS"}),c.jsxs("div",{className:"space-y-2",children:[e.conditions.map(d=>c.jsx(o6,{row:d,routingKeys:n,onChange:p=>t({...e,conditions:e.conditions.map(h=>h.id===d.id?p:h)}),onRemove:()=>t({...e,conditions:e.conditions.filter(p=>p.id!==d.id)})},d.id)),c.jsxs(Te,{type:"button",variant:"ghost",size:"sm",onClick:u,children:[c.jsx(ji,{size:12})," Add Condition"]})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"OUTPUT"}),c.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(d=>c.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[c.jsx("input",{type:"radio",checked:e.outputType===d,onChange:()=>t({...e,outputType:d}),className:"accent-brand-500"}),d==="priority"?"Priority":"Volume Split"]},d))}),e.outputType==="priority"?c.jsx(YP,{gateways:e.priorityGateways,onChange:d=>t({...e,priorityGateways:d})}):c.jsx(ZP,{gateways:e.volumeGateways,onChange:d=>t({...e,volumeGateways:d})})]})]})]})}function l6(e,t,r){function n(i,o,s){return i==="priority"?{priority:o.map(l=>({gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}))}:{volume_split:s.map(l=>({split:l.split,output:{gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}}))}}function a(i){return i==="priority"?"priority":"volume_split"}return{globals:{},default_selection:n(t.type,t.priorityGateways,t.volumeGateways),rules:e.map(i=>({name:i.name,routing_type:a(i.outputType),output:n(i.outputType,i.priorityGateways,i.volumeGateways),statements:[{condition:i.conditions.map(o=>{var s,l;return{lhs:o.lhs,comparison:a6[o.operator]||o.operator,value:{type:((s=r[o.lhs])==null?void 0:s.type)==="integer"?"number":"enum_variant",value:((l=r[o.lhs])==null?void 0:l.type)==="integer"?Number(o.value):o.value},metadata:{}}})}]}))}}function u6(){const{merchantId:e}=ia(),{routingKeysConfig:t,isLoading:r,error:n}=XP(),a=t,i=Object.keys(a).length>0,o=!r&&(!i||!!n),[s,l]=j.useState(""),[u,f]=j.useState(""),[d,p]=j.useState([]),[h,x]=j.useState({type:"priority",priorityGateways:[],volumeGateways:[]}),[y,v]=j.useState(!1),[g,m]=j.useState(!1),[w,S]=j.useState(null),[b,_]=j.useState(null),[O,k]=j.useState(!1),[A,I]=j.useState(null),[T,P]=j.useState(!1),[R,M]=j.useState(new Set),{data:F,mutate:W}=Ft(e?`/routing/list/${e}`:null,()=>bt(`/routing/list/${e}`)),{data:V}=Ft(e?`/routing/list/active/${e}`:null,()=>bt(`/routing/list/active/${e}`)),L=new Set((V||[]).map(Q=>Q.id)),U=l6(d,h,a);async function q(Q){if(Q.preventDefault(),!e){S("Set a Merchant ID first.");return}if(o){S("Routing key config is unavailable. Ensure backend /config/routing-keys is reachable and valid.");return}if(!s.trim()){S("Rule name is required.");return}m(!0),S(null),_(null);try{const be=await bt("/routing/create",{name:s.trim(),description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:U}});_(be.id),W()}catch(be){S(String(be))}finally{m(!1)}}async function J(Q){if(e){k(!0),I(null),P(!1);try{await bt("/routing/activate",{created_by:e,routing_algorithm_id:Q}),P(!0),W()}catch(be){I(String(be))}finally{k(!1)}}}function K(Q){M(be=>{const ue=new Set(be);return ue.has(Q)?ue.delete(Q):ue.add(Q),ue})}function ae(){p(Q=>[...Q,{id:crypto.randomUUID(),name:`Rule ${Q.length+1}`,conditions:[],outputType:"priority",priorityGateways:[],volumeGateways:[]}])}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Rule-Based Routing"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Create declarative routing rules"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsxs("div",{className:"lg:col-span-1 space-y-3",children:[c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Existing Rules"})}),c.jsx(Le,{className:"p-0",children:e?F?F.length===0?c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"No rules yet."}):c.jsx("div",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:F.map(Q=>{const be=L.has(Q.id),ue=R.has(Q.id),Pe=Q.algorithm_data||Q.algorithm;return c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate font-medium",children:Q.name}),c.jsx("p",{className:"text-xs text-slate-400 capitalize",children:Pe==null?void 0:Pe.type})]}),c.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 sm:justify-end",children:[c.jsx(Oe,{variant:be?"green":"gray",children:be?"Active":"Inactive"}),c.jsxs(Te,{size:"sm",variant:"ghost",onClick:()=>K(Q.id),children:[c.jsx(Ch,{size:14,className:"mr-1"}),ue?"Hide":"View"]}),!be&&c.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>J(Q.id),disabled:O,children:"Activate"})]})]}),ue&&c.jsx("div",{className:"bg-slate-50 px-4 py-3 dark:bg-[#151518]",children:c.jsxs("div",{className:"space-y-2 text-xs text-slate-600",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"ID:"})," ",Q.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Description:"})," ",Q.description||"N/A"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Algorithm For:"})," ",Q.algorithm_for]}),Q.created_at&&c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",new Date(Q.created_at).toLocaleString()]}),c.jsxs("div",{children:[c.jsx("strong",{children:"Configuration:"}),c.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-transparent bg-slate-100 p-2 text-xs dark:border-[#222226] dark:bg-[#0f0f11]",children:JSON.stringify(Pe,null,2)})]})]})})]},Q.id)})}):c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Loading..."}):c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Set merchant ID to load rules."})})]}),A&&c.jsx(Gr,{error:A}),T&&c.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400",children:"Rule activated successfully."})]}),c.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[c.jsx("form",{onSubmit:q,className:"space-y-4",children:c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Rule Builder"})}),c.jsxs(Le,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rule Name *"}),c.jsx("input",{value:s,onChange:Q=>l(Q.target.value),placeholder:"my-rule",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),c.jsx("input",{value:u,onChange:Q=>f(Q.target.value),placeholder:"Optional description",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Rules"}),r&&c.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),o&&c.jsx(Gr,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Builder is disabled until this is fixed."}),d.map(Q=>c.jsx(s6,{block:Q,routingKeys:a,onChange:be=>p(ue=>ue.map(Pe=>Pe.id===Q.id?be:Pe)),onRemove:()=>p(be=>be.filter(ue=>ue.id!==Q.id))},Q.id)),c.jsxs(Te,{type:"button",variant:"secondary",size:"sm",onClick:ae,disabled:o,children:[c.jsx(ji,{size:14})," Add Rule Block"]})]}),c.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl px-4 py-3",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"DEFAULT SELECTION (Fallback)"}),c.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(Q=>c.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[c.jsx("input",{type:"radio",checked:h.type===Q,onChange:()=>x({...h,type:Q}),className:"accent-brand-500"}),Q==="priority"?"Priority":"Volume Split"]},Q))}),h.type==="priority"?c.jsx(YP,{gateways:h.priorityGateways,onChange:Q=>x({...h,priorityGateways:Q})}):c.jsx(ZP,{gateways:h.volumeGateways,onChange:Q=>x({...h,volumeGateways:Q})})]}),c.jsx(Gr,{error:w}),b&&c.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400 flex items-center justify-between",children:[c.jsxs("span",{children:["Rule created (ID: ",b,")"]}),c.jsx(Te,{type:"button",size:"sm",onClick:()=>J(b),disabled:O,children:"Activate Now"})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx(Te,{type:"submit",disabled:g||o,children:g?"Creating...":"Create Rule"}),c.jsx(Te,{type:"button",variant:"secondary",size:"sm",onClick:()=>v(!y),children:y?"Hide JSON":"Preview JSON"})]})]})]})}),y&&c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"JSON Preview"})}),c.jsx(Le,{children:c.jsx("pre",{className:"text-xs text-slate-600 overflow-auto max-h-64 bg-[#07070b] rounded-lg p-4 font-mono border border-slate-200 dark:border-[#1c1c24]",children:JSON.stringify({name:s,description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:U}},null,2)})})]})]})]})]})}function QP(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t-1}var lF=sF,uF=zh;function cF(e,t){var r=this.__data__,n=uF(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var dF=cF,fF=K8,pF=rF,hF=iF,mF=lF,yF=dF;function Ol(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},no=function(t){return Oo(t)&&t.indexOf("%")===t.length-1},re=function(t){return Mz(t)&&!Al(t)},zz=function(t){return Ee(t)},Kt=function(t){return re(t)||Oo(t)},Bz=0,Ro=function(t){var r=++Bz;return"".concat(t||"").concat(r)},Or=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!re(t)&&!Oo(t))return n;var i;if(no(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return Al(i)&&(i=n),a&&i>r&&(i=r),i},oi=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},Uz=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xz(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ig(e){"@babel/helpers - typeof";return Ig=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ig(e)}var hS={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ka=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},mS=null,Ty=null,Ib=function e(t){if(t===mS&&Array.isArray(Ty))return Ty;var r=[];return j.Children.forEach(t,function(n){Ee(n)||(Cz.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Ty=r,mS=t,r};function Zr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return ka(a)}):n=[ka(t)],Ib(e).forEach(function(a){var i=Yr(a,"type.displayName")||Yr(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Hr(e,t){var r=Zr(e,t);return r&&r[0]}var yS=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!re(n)||n<=0||!re(a)||a<=0)},Yz=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Zz=function(t){return t&&t.type&&Oo(t.type)&&Yz.indexOf(t.type)>=0},dN=function(t){return t&&Ig(t)==="object"&&"clipDot"in t},Qz=function(t,r,n,a){var i,o=(i=Cy==null?void 0:Cy[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Se(t)&&(a&&o.includes(r)||Hz.includes(r))||n&&$b.includes(r)},we=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(j.isValidElement(t)&&(a=t.props),!Sl(a))return null;var i={};return Object.keys(a).forEach(function(o){var s;Qz((s=a)===null||s===void 0?void 0:s[o],o,r,n)&&(i[o]=a[o])}),i},Rg=function e(t,r){if(t===r)return!0;var n=j.Children.count(t);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return vS(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Dg(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,s=e.title,l=e.desc,u=rB(e,tB),f=a||{width:r,height:n,x:0,y:0},d=Re("recharts-surface",i);return C.createElement("svg",Mg({},we(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),C.createElement("title",null,s),C.createElement("desc",null,l),t)}var aB=["children","className"];function Lg(){return Lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var We=C.forwardRef(function(e,t){var r=e.children,n=e.className,a=iB(e,aB),i=Re("recharts-layer",n);return C.createElement("g",Lg({className:i},we(a,!0),{ref:t}),r)}),Ln=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;ia?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n=n?e:uB(e,t,r)}var dB=cB,fB="\\ud800-\\udfff",pB="\\u0300-\\u036f",hB="\\ufe20-\\ufe2f",mB="\\u20d0-\\u20ff",yB=pB+hB+mB,vB="\\ufe0e\\ufe0f",gB="\\u200d",xB=RegExp("["+gB+fB+yB+vB+"]");function bB(e){return xB.test(e)}var fN=bB;function wB(e){return e.split("")}var _B=wB,pN="\\ud800-\\udfff",SB="\\u0300-\\u036f",jB="\\ufe20-\\ufe2f",OB="\\u20d0-\\u20ff",kB=SB+jB+OB,AB="\\ufe0e\\ufe0f",EB="["+pN+"]",Fg="["+kB+"]",zg="\\ud83c[\\udffb-\\udfff]",PB="(?:"+Fg+"|"+zg+")",hN="[^"+pN+"]",mN="(?:\\ud83c[\\udde6-\\uddff]){2}",yN="[\\ud800-\\udbff][\\udc00-\\udfff]",NB="\\u200d",vN=PB+"?",gN="["+AB+"]?",CB="(?:"+NB+"(?:"+[hN,mN,yN].join("|")+")"+gN+vN+")*",TB=gN+vN+CB,$B="(?:"+[hN+Fg+"?",Fg,mN,yN,EB].join("|")+")",IB=RegExp(zg+"(?="+zg+")|"+$B+TB,"g");function RB(e){return e.match(IB)||[]}var MB=RB,DB=_B,LB=fN,FB=MB;function zB(e){return LB(e)?FB(e):DB(e)}var BB=zB,UB=dB,VB=fN,WB=BB,HB=iN;function GB(e){return function(t){t=HB(t);var r=VB(t)?WB(t):void 0,n=r?r[0]:t.charAt(0),a=r?UB(r,1).join(""):t.slice(1);return n[e]()+a}}var qB=GB,KB=qB,XB=KB("toUpperCase"),YB=XB;const em=nt(YB);function pt(e){return function(){return e}}const xN=Math.cos,fp=Math.sin,Un=Math.sqrt,pp=Math.PI,tm=2*pp,Bg=Math.PI,Ug=2*Bg,Ki=1e-6,ZB=Ug-Ki;function bN(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return bN;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;aKi)if(!(Math.abs(d*l-u*f)>Ki)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,x=a-s,y=l*l+u*u,v=h*h+x*x,g=Math.sqrt(y),m=Math.sqrt(p),w=i*Math.tan((Bg-Math.acos((y+p-v)/(2*g*m)))/2),S=w/m,b=w/g;Math.abs(S-1)>Ki&&this._append`L${t+S*f},${r+S*d}`,this._append`A${i},${i},0,0,${+(d*h>f*x)},${this._x1=t+b*l},${this._y1=r+b*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(a),l=n*Math.sin(a),u=t+s,f=r+l,d=1^o,p=o?a-i:i-a;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Ki||Math.abs(this._y1-f)>Ki)&&this._append`L${u},${f}`,n&&(p<0&&(p=p%Ug+Ug),p>ZB?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:p>Ki&&this._append`A${n},${n},0,${+(p>=Bg)},${d},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function Rb(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new JB(t)}function Mb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function wN(e){this._context=e}wN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function rm(e){return new wN(e)}function _N(e){return e[0]}function SN(e){return e[1]}function jN(e,t){var r=pt(!0),n=null,a=rm,i=null,o=Rb(s);e=typeof e=="function"?e:e===void 0?_N:pt(e),t=typeof t=="function"?t:t===void 0?SN:pt(t);function s(l){var u,f=(l=Mb(l)).length,d,p=!1,h;for(n==null&&(i=a(h=o())),u=0;u<=f;++u)!(u=h;--x)s.point(w[x],S[x]);s.lineEnd(),s.areaEnd()}g&&(w[p]=+e(v,p,d),S[p]=+t(v,p,d),s.point(n?+n(v,p,d):w[p],r?+r(v,p,d):S[p]))}if(m)return s=null,m+""||null}function f(){return jN().defined(a).curve(o).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:pt(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:pt(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(a=typeof d=="function"?d:pt(!!d),u):a},u.curve=function(d){return arguments.length?(o=d,i!=null&&(s=o(i)),u):o},u.context=function(d){return arguments.length?(d==null?i=s=null:s=o(i=d),u):i},u}class ON{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function e9(e){return new ON(e,!0)}function t9(e){return new ON(e,!1)}const Db={draw(e,t){const r=Un(t/pp);e.moveTo(r,0),e.arc(0,0,r,0,tm)}},r9={draw(e,t){const r=Un(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},kN=Un(1/3),n9=kN*2,a9={draw(e,t){const r=Un(t/n9),n=r*kN;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},i9={draw(e,t){const r=Un(t),n=-r/2;e.rect(n,n,r,r)}},o9=.8908130915292852,AN=fp(pp/10)/fp(7*pp/10),s9=fp(tm/10)*AN,l9=-xN(tm/10)*AN,u9={draw(e,t){const r=Un(t*o9),n=s9*r,a=l9*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=tm*i/5,s=xN(o),l=fp(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*a,l*n+s*a)}e.closePath()}},$y=Un(3),c9={draw(e,t){const r=-Un(t/($y*3));e.moveTo(0,r*2),e.lineTo(-$y*r,-r),e.lineTo($y*r,-r),e.closePath()}},an=-.5,on=Un(3)/2,Vg=1/Un(12),d9=(Vg/2+1)*3,f9={draw(e,t){const r=Un(t/d9),n=r/2,a=r*Vg,i=n,o=r*Vg+r,s=-i,l=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(s,l),e.lineTo(an*n-on*a,on*n+an*a),e.lineTo(an*i-on*o,on*i+an*o),e.lineTo(an*s-on*l,on*s+an*l),e.lineTo(an*n+on*a,an*a-on*n),e.lineTo(an*i+on*o,an*o-on*i),e.lineTo(an*s+on*l,an*l-on*s),e.closePath()}};function p9(e,t){let r=null,n=Rb(a);e=typeof e=="function"?e:pt(e||Db),t=typeof t=="function"?t:pt(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:pt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:pt(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function hp(){}function mp(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function EN(e){this._context=e}EN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:mp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:mp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h9(e){return new EN(e)}function PN(e){this._context=e}PN.prototype={areaStart:hp,areaEnd:hp,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:mp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function m9(e){return new PN(e)}function NN(e){this._context=e}NN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:mp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function y9(e){return new NN(e)}function CN(e){this._context=e}CN.prototype={areaStart:hp,areaEnd:hp,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function v9(e){return new CN(e)}function xS(e){return e<0?-1:1}function bS(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(xS(i)+xS(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function wS(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Iy(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,a+s*t,i-s,o-s*r,i,o)}function yp(e){this._context=e}yp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Iy(this,this._t0,wS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Iy(this,wS(this,r=bS(this,e,t)),r);break;default:Iy(this,this._t0,r=bS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function TN(e){this._context=new $N(e)}(TN.prototype=Object.create(yp.prototype)).point=function(e,t){yp.prototype.point.call(this,t,e)};function $N(e){this._context=e}$N.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function g9(e){return new yp(e)}function x9(e){return new TN(e)}function IN(e){this._context=e}IN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=_S(e),a=_S(t),i=0,o=1;o=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function w9(e){return new nm(e,.5)}function _9(e){return new nm(e,0)}function S9(e){return new nm(e,1)}function Vs(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,s=i.length;r=0;)r[t]=t;return r}function j9(e,t){return e[t]}function O9(e){const t=[];return t.key=e,t}function k9(){var e=pt([]),t=Wg,r=Vs,n=j9;function a(i){var o=Array.from(e.apply(this,arguments),O9),s,l=o.length,u=-1,f;for(const d of i)for(s=0,++u;s0){for(var r,n,a=0,i=e[0].length,o;a0){for(var r=0,n=e[t[0]],a,i=n.length;r0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function R9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var RN={symbolCircle:Db,symbolCross:r9,symbolDiamond:a9,symbolSquare:i9,symbolStar:u9,symbolTriangle:c9,symbolWye:f9},M9=Math.PI/180,D9=function(t){var r="symbol".concat(em(t));return RN[r]||Db},L9=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*M9;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},F9=function(t,r){RN["symbol".concat(em(t))]=r},Lb=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,s=o===void 0?"area":o,l=I9(t,N9),u=jS(jS({},l),{},{type:n,size:i,sizeType:s}),f=function(){var v=D9(n),g=p9().type(v).size(L9(i,s,n));return g()},d=u.className,p=u.cx,h=u.cy,x=we(u,!0);return p===+p&&h===+h&&i===+i?C.createElement("path",Hg({},x,{className:Re("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(h,")"),d:f()})):null};Lb.registerSymbol=F9;function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}function Gg(){return Gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var m=h.inactive?u:h.color;return C.createElement("li",Gg({className:v,style:d,key:"legend-item-".concat(x)},ko(n.props,h,x)),C.createElement(Dg,{width:o,height:o,viewBox:f,style:p},n.renderIcon(h)),C.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},y?y(g,h,x):g))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var s={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return C.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(j.PureComponent);mc(Fb,"displayName","Legend");mc(Fb,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var X9=Bh;function Y9(){this.__data__=new X9,this.size=0}var Z9=Y9;function Q9(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var J9=Q9;function eU(e){return this.__data__.get(e)}var tU=eU;function rU(e){return this.__data__.has(e)}var nU=rU,aU=Bh,iU=kb,oU=Ab,sU=200;function lU(e,t){var r=this.__data__;if(r instanceof aU){var n=r.__data__;if(!iU||n.lengths))return!1;var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var d=-1,p=!0,h=r&NU?new kU:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=IV}var Vb=RV,MV=Ba,DV=Vb,LV=Ua,FV="[object Arguments]",zV="[object Array]",BV="[object Boolean]",UV="[object Date]",VV="[object Error]",WV="[object Function]",HV="[object Map]",GV="[object Number]",qV="[object Object]",KV="[object RegExp]",XV="[object Set]",YV="[object String]",ZV="[object WeakMap]",QV="[object ArrayBuffer]",JV="[object DataView]",eW="[object Float32Array]",tW="[object Float64Array]",rW="[object Int8Array]",nW="[object Int16Array]",aW="[object Int32Array]",iW="[object Uint8Array]",oW="[object Uint8ClampedArray]",sW="[object Uint16Array]",lW="[object Uint32Array]",gt={};gt[eW]=gt[tW]=gt[rW]=gt[nW]=gt[aW]=gt[iW]=gt[oW]=gt[sW]=gt[lW]=!0;gt[FV]=gt[zV]=gt[QV]=gt[BV]=gt[JV]=gt[UV]=gt[VV]=gt[WV]=gt[HV]=gt[GV]=gt[qV]=gt[KV]=gt[XV]=gt[YV]=gt[ZV]=!1;function uW(e){return LV(e)&&DV(e.length)&&!!gt[MV(e)]}var cW=uW;function dW(e){return function(t){return e(t)}}var GN=dW,bp={exports:{}};bp.exports;(function(e,t){var r=JP,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,s=function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(bp,bp.exports);var fW=bp.exports,pW=cW,hW=GN,CS=fW,TS=CS&&CS.isTypedArray,mW=TS?hW(TS):pW,qN=mW,yW=xV,vW=Bb,gW=Br,xW=HN,bW=Ub,wW=qN,_W=Object.prototype,SW=_W.hasOwnProperty;function jW(e,t){var r=gW(e),n=!r&&vW(e),a=!r&&!n&&xW(e),i=!r&&!n&&!a&&wW(e),o=r||n||a||i,s=o?yW(e.length,String):[],l=s.length;for(var u in e)(t||SW.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||bW(u,l)))&&s.push(u);return s}var OW=jW,kW=Object.prototype;function AW(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||kW;return e===r}var EW=AW;function PW(e,t){return function(r){return e(t(r))}}var KN=PW,NW=KN,CW=NW(Object.keys,Object),TW=CW,$W=EW,IW=TW,RW=Object.prototype,MW=RW.hasOwnProperty;function DW(e){if(!$W(e))return IW(e);var t=[];for(var r in Object(e))MW.call(e,r)&&r!="constructor"&&t.push(r);return t}var LW=DW,FW=jb,zW=Vb;function BW(e){return e!=null&&zW(e.length)&&!FW(e)}var cd=BW,UW=OW,VW=LW,WW=cd;function HW(e){return WW(e)?UW(e):VW(e)}var am=HW,GW=sV,qW=vV,KW=am;function XW(e){return GW(e,KW,qW)}var YW=XW,$S=YW,ZW=1,QW=Object.prototype,JW=QW.hasOwnProperty;function e7(e,t,r,n,a,i){var o=r&ZW,s=$S(e),l=s.length,u=$S(t),f=u.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var p=s[d];if(!(o?p in t:JW.call(t,p)))return!1}var h=i.get(e),x=i.get(t);if(h&&x)return h==t&&x==e;var y=!0;i.set(e,t),i.set(t,e);for(var v=o;++d-1}var QH=ZH;function JH(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=hG){var u=t?null:fG(e);if(u)return pG(u);o=!1,a=dG,l=new lG}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function NG(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function CG(e){return e.value}function TG(e,t){if(C.isValidElement(e))return C.cloneElement(e,t);if(typeof e=="function")return C.createElement(e,t);t.ref;var r=PG(t,wG);return C.createElement(Fb,r)}var XS=1,Aa=function(e){function t(){var r;_G(this,t);for(var n=arguments.length,a=new Array(n),i=0;iXS||Math.abs(a.height-this.lastBoundingBox.height)>XS)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?da({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,s=a.verticalAlign,l=a.margin,u=a.chartWidth,f=a.chartHeight,d,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var h=this.getBBoxSnapshot();d={left:((u||0)-h.width)/2}}else d=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var x=this.getBBoxSnapshot();p={top:((f||0)-x.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return da(da({},d),p)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,s=a.height,l=a.wrapperStyle,u=a.payloadUniqBy,f=a.payload,d=da(da({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return C.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(h){n.wrapperNode=h}},TG(i,da(da({},this.props),{},{payload:tC(f,u,CG)})))}}],[{key:"getWithHeight",value:function(n,a){var i=da(da({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&re(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(j.PureComponent);im(Aa,"displayName","Legend");im(Aa,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var YS=ud,$G=Bb,IG=Br,ZS=YS?YS.isConcatSpreadable:void 0;function RG(e){return IG(e)||$G(e)||!!(ZS&&e&&e[ZS])}var MG=RG,DG=VN,LG=MG;function aC(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=LG),a||(a=[]);++i0&&r(s)?t>1?aC(s,t-1,r,n,a):DG(a,s):n||(a[a.length]=s)}return a}var iC=aC;function FG(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++a];if(r(i[l],l,i)===!1)break}return t}}var zG=FG,BG=zG,UG=BG(),VG=UG,WG=VG,HG=am;function GG(e,t){return e&&WG(e,t,HG)}var oC=GG,qG=cd;function KG(e,t){return function(r,n){if(r==null)return r;if(!qG(r))return e(r,n);for(var a=r.length,i=t?a:-1,o=Object(r);(t?i--:++it||i&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!a)return 1;if(!n&&!i&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var lq=sq,Ly=Pb,uq=Nb,cq=sa,dq=sC,fq=nq,pq=GN,hq=lq,mq=Nl,yq=Br;function vq(e,t,r){t.length?t=Ly(t,function(i){return yq(i)?function(o){return uq(o,i.length===1?i[0]:i)}:i}):t=[mq];var n=-1;t=Ly(t,pq(cq));var a=dq(e,function(i,o,s){var l=Ly(t,function(u){return u(i)});return{criteria:l,index:++n,value:i}});return fq(a,function(i,o){return hq(i,o,r)})}var gq=vq;function xq(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var bq=xq,wq=bq,JS=Math.max;function _q(e,t,r){return t=JS(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=JS(n.length-t,0),o=Array(i);++a0){if(++t>=Tq)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Mq=Rq,Dq=Cq,Lq=Mq,Fq=Lq(Dq),zq=Fq,Bq=Nl,Uq=Sq,Vq=zq;function Wq(e,t){return Vq(Uq(e,t,Bq),e+"")}var Hq=Wq,Gq=Ob,qq=cd,Kq=Ub,Xq=$i;function Yq(e,t,r){if(!Xq(r))return!1;var n=typeof t;return(n=="number"?qq(r)&&Kq(t,r.length):n=="string"&&t in r)?Gq(r[t],e):!1}var om=Yq,Zq=iC,Qq=gq,Jq=Hq,tj=om,eK=Jq(function(e,t){if(e==null)return[];var r=t.length;return r>1&&tj(e,t[0],t[1])?t=[]:r>2&&tj(t[0],t[1],t[2])&&(t=[t[0]]),Qq(e,Zq(t,1),[])}),tK=eK;const Gb=nt(tK);function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function e0(){return e0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Gl,"-left"),re(r)&&t&&re(t.x)&&r=t.y),"".concat(Gl,"-top"),re(n)&&t&&re(t.y)&&ny?Math.max(f,l[n]):Math.max(d,l[n])}function yK(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function vK(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=aj({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),d=aj({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=yK({translateX:f,translateY:d,useTranslate3d:s})):u=hK,{cssProperties:u,cssClasses:mK({translateX:f,translateY:d,coordinate:r})}}function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function ij(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oj(e){for(var t=1;tsj||Math.abs(n.height-this.state.lastBoundingBox.height)>sj)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,s=a.animationDuration,l=a.animationEasing,u=a.children,f=a.coordinate,d=a.hasPayload,p=a.isAnimationActive,h=a.offset,x=a.position,y=a.reverseDirection,v=a.useTranslate3d,g=a.viewBox,m=a.wrapperStyle,w=vK({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:x,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:g}),S=w.cssClasses,b=w.cssProperties,_=oj(oj({transition:p&&i?"transform ".concat(s,"ms ").concat(l):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},m);return C.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(k){n.wrapperNode=k}},u)}}])}(j.PureComponent),AK=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ii={isSsr:AK()};function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function lj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function uj(e){for(var t=1;t0;return C.createElement(kK,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:i,coordinate:f,hasPayload:_,offset:h,position:v,reverseDirection:g,useTranslate3d:m,viewBox:w,wrapperStyle:S},DK(u,uj(uj({},this.props),{},{payload:b})))}}])}(j.PureComponent);qb(_r,"displayName","Tooltip");qb(_r,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ii.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var LK=oa,FK=function(){return LK.Date.now()},zK=FK,BK=/\s/;function UK(e){for(var t=e.length;t--&&BK.test(e.charAt(t)););return t}var VK=UK,WK=VK,HK=/^\s+/;function GK(e){return e&&e.slice(0,WK(e)+1).replace(HK,"")}var qK=GK,KK=qK,cj=$i,XK=_l,dj=NaN,YK=/^[-+]0x[0-9a-f]+$/i,ZK=/^0b[01]+$/i,QK=/^0o[0-7]+$/i,JK=parseInt;function eX(e){if(typeof e=="number")return e;if(XK(e))return dj;if(cj(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=cj(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=KK(e);var r=ZK.test(e);return r||QK.test(e)?JK(e.slice(2),r?2:8):YK.test(e)?dj:+e}var pC=eX,tX=$i,zy=zK,fj=pC,rX="Expected a function",nX=Math.max,aX=Math.min;function iX(e,t,r){var n,a,i,o,s,l,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(rX);t=fj(t)||0,tX(r)&&(f=!!r.leading,d="maxWait"in r,i=d?nX(fj(r.maxWait)||0,t):i,p="trailing"in r?!!r.trailing:p);function h(_){var O=n,k=a;return n=a=void 0,u=_,o=e.apply(k,O),o}function x(_){return u=_,s=setTimeout(g,t),f?h(_):o}function y(_){var O=_-l,k=_-u,A=t-O;return d?aX(A,i-k):A}function v(_){var O=_-l,k=_-u;return l===void 0||O>=t||O<0||d&&k>=i}function g(){var _=zy();if(v(_))return m(_);s=setTimeout(g,y(_))}function m(_){return s=void 0,p&&n?h(_):(n=a=void 0,o)}function w(){s!==void 0&&clearTimeout(s),u=0,n=l=a=s=void 0}function S(){return s===void 0?o:m(zy())}function b(){var _=zy(),O=v(_);if(n=arguments,a=this,l=_,O){if(s===void 0)return x(l);if(d)return clearTimeout(s),s=setTimeout(g,t),h(l)}return s===void 0&&(s=setTimeout(g,t)),o}return b.cancel=w,b.flush=S,b}var oX=iX,sX=oX,lX=$i,uX="Expected a function";function cX(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(uX);return lX(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),sX(e,t,{leading:n,maxWait:t,trailing:a})}var dX=cX;const hC=nt(dX);function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function pj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gd(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(R=hC(R,y,{trailing:!0,leading:!1}));var M=new ResizeObserver(R),F=b.current.getBoundingClientRect(),W=F.width,V=F.height;return T(W,V),M.observe(b.current),function(){M.disconnect()}},[T,y]);var P=j.useMemo(function(){var R=A.containerWidth,M=A.containerHeight;if(R<0||M<0)return null;Ln(no(o)||no(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),Ln(!r||r>0,"The aspect(%s) must be greater than zero.",r);var F=no(o)?R:o,W=no(l)?M:l;r&&r>0&&(F?W=F/r:W&&(F=W*r),p&&W>p&&(W=p)),Ln(F>0||W>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,F,W,o,l,f,d,r);var V=!Array.isArray(h)&&ka(h.type).endsWith("Chart");return C.Children.map(h,function(L){return C.isValidElement(L)?j.cloneElement(L,Gd({width:F,height:W},V?{style:Gd({height:"100%",width:"100%",maxHeight:W,maxWidth:F},L.props.style)}:{})):L})},[r,h,l,p,d,f,A,o]);return C.createElement("div",{id:v?"".concat(v):void 0,className:Re("recharts-responsive-container",g),style:Gd(Gd({},S),{},{width:o,height:l,minWidth:f,minHeight:d,maxHeight:p}),ref:b},P)}),fo=function(t){return null};fo.displayName="Cell";function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}function mj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function a0(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ii.isSsr)return{width:0,height:0};var n=OX(r),a=JSON.stringify({text:t,copyStyle:n});if(Wo.widthCache[a])return Wo.widthCache[a];try{var i=document.getElementById(yj);i||(i=document.createElement("span"),i.setAttribute("id",yj),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=a0(a0({},jX),n);Object.assign(i.style,o),i.textContent="".concat(t);var s=i.getBoundingClientRect(),l={width:s.width,height:s.height};return Wo.widthCache[a]=l,++Wo.cacheCount>SX&&(Wo.cacheCount=0,Wo.widthCache={}),l}catch{return{width:0,height:0}}},kX=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function jp(e,t){return NX(e)||PX(e,t)||EX(e,t)||AX()}function AX(){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 EX(e,t){if(e){if(typeof e=="string")return vj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vj(e,t)}}function vj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Sj(e,t){return KX(e)||qX(e,t)||GX(e,t)||HX()}function HX(){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 GX(e,t){if(e){if(typeof e=="string")return jj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jj(e,t)}}function jj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(W,V){var L=V.word,U=V.width,q=W[W.length-1];if(q&&(a==null||i||q.width+U+nV.width?W:V})};if(!f)return h;for(var y="…",v=function(F){var W=d.slice(0,F),V=gC({breakAll:u,style:l,children:W+y}).wordsWithComputedWidth,L=p(V),U=L.length>o||x(L).width>Number(a);return[U,L]},g=0,m=d.length-1,w=0,S;g<=m&&w<=d.length-1;){var b=Math.floor((g+m)/2),_=b-1,O=v(_),k=Sj(O,2),A=k[0],I=k[1],T=v(b),P=Sj(T,1),R=P[0];if(!A&&!R&&(g=b+1),A&&R&&(m=b-1),!A&&R){S=I;break}w++}return S||h},Oj=function(t){var r=Ee(t)?[]:t.toString().split(vC);return[{words:r}]},YX=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Ii.isSsr){var l,u,f=gC({breakAll:o,children:a,style:i});if(f){var d=f.wordsWithComputedWidth,p=f.spaceWidth;l=d,u=p}else return Oj(a);return XX({breakAll:o,children:a,maxLines:s,style:i},l,u,r,n)}return Oj(a)},kj="#808080",Ao=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,d=f===void 0?!1:f,p=t.textAnchor,h=p===void 0?"start":p,x=t.verticalAnchor,y=x===void 0?"end":x,v=t.fill,g=v===void 0?kj:v,m=_j(t,UX),w=j.useMemo(function(){return YX({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),S=m.dx,b=m.dy,_=m.angle,O=m.className,k=m.breakAll,A=_j(m,VX);if(!Kt(n)||!Kt(i))return null;var I=n+(re(S)?S:0),T=i+(re(b)?b:0),P;switch(y){case"start":P=By("calc(".concat(u,")"));break;case"middle":P=By("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:P=By("calc(".concat(w.length-1," * -").concat(s,")"));break}var R=[];if(d){var M=w[0].width,F=m.width;R.push("scale(".concat((re(F)?F/M:1)/M,")"))}return _&&R.push("rotate(".concat(_,", ").concat(I,", ").concat(T,")")),R.length&&(A.transform=R.join(" ")),C.createElement("text",i0({},we(A,!0),{x:I,y:T,className:Re("recharts-text",O),textAnchor:h,fill:g.includes("url")?kj:g}),w.map(function(W,V){var L=W.words.join(k?"":" ");return C.createElement("tspan",{x:I,dy:V===0?P:s,key:"".concat(L,"-").concat(V)},L)}))};function wi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function ZX(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Kb(e){let t,r,n;e.length!==2?(t=wi,r=(s,l)=>wi(e(s),l),n=(s,l)=>e(s)-l):(t=e===wi||e===ZX?e:QX,r=e,n=e);function a(s,l,u=0,f=s.length){if(u>>1;r(s[d],l)<0?u=d+1:f=d}while(u>>1;r(s[d],l)<=0?u=d+1:f=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:a,center:o,right:i}}function QX(){return 0}function xC(e){return e===null?NaN:+e}function*JX(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const eY=Kb(wi),dd=eY.right;Kb(xC).center;class Aj extends Map{constructor(t,r=nY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(Ej(this,t))}has(t){return super.has(Ej(this,t))}set(t,r){return super.set(tY(this,t),r)}delete(t){return super.delete(rY(this,t))}}function Ej({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function tY({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function rY({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function nY(e){return e!==null&&typeof e=="object"?e.valueOf():e}function aY(e=wi){if(e===wi)return bC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function bC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const iY=Math.sqrt(50),oY=Math.sqrt(10),sY=Math.sqrt(2);function Op(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=iY?10:i>=oY?5:i>=sY?2:1;let s,l,u;return a<0?(u=Math.pow(10,-a)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,a)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=a))return[];const s=i-a+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function Nj(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function wC(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?bC:aY(a);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(l-d)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*d/l+p)),x=Math.min(n,Math.floor(t+(l-u)*d/l+p));wC(e,t,h,x,a)}const i=e[t];let o=r,s=n;for(ql(e,r,t),a(e[n],i)>0&&ql(e,r,n);o0;)--s}a(e[r],i)===0?ql(e,r,s):(++s,ql(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function ql(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function lY(e,t,r){if(e=Float64Array.from(JX(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Nj(e);if(t>=1)return Pj(e);var n,a=(n-1)*t,i=Math.floor(a),o=Pj(wC(e,i).subarray(0,i+1)),s=Nj(e.subarray(i+1));return o+(s-o)*(a-i)}}function uY(e,t,r=xC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),s=+r(e[i+1],i+1,e);return o+(s-o)*(a-i)}}function cY(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Kd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Kd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fY.exec(e))?new Mr(t[1],t[2],t[3],1):(t=pY.exec(e))?new Mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hY.exec(e))?Kd(t[1],t[2],t[3],t[4]):(t=mY.exec(e))?Kd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yY.exec(e))?Dj(t[1],t[2]/100,t[3]/100,1):(t=vY.exec(e))?Dj(t[1],t[2]/100,t[3]/100,t[4]):Cj.hasOwnProperty(e)?Ij(Cj[e]):e==="transparent"?new Mr(NaN,NaN,NaN,0):null}function Ij(e){return new Mr(e>>16&255,e>>8&255,e&255,1)}function Kd(e,t,r,n){return n<=0&&(e=t=r=NaN),new Mr(e,t,r,n)}function bY(e){return e instanceof fd||(e=jc(e)),e?(e=e.rgb(),new Mr(e.r,e.g,e.b,e.opacity)):new Mr}function c0(e,t,r,n){return arguments.length===1?bY(e):new Mr(e,t,r,n??1)}function Mr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Yb(Mr,c0,SC(fd,{brighter(e){return e=e==null?kp:Math.pow(kp,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_c:Math.pow(_c,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mr(po(this.r),po(this.g),po(this.b),Ap(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Rj,formatHex:Rj,formatHex8:wY,formatRgb:Mj,toString:Mj}));function Rj(){return`#${ao(this.r)}${ao(this.g)}${ao(this.b)}`}function wY(){return`#${ao(this.r)}${ao(this.g)}${ao(this.b)}${ao((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mj(){const e=Ap(this.opacity);return`${e===1?"rgb(":"rgba("}${po(this.r)}, ${po(this.g)}, ${po(this.b)}${e===1?")":`, ${e})`}`}function Ap(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function po(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ao(e){return e=po(e),(e<16?"0":"")+e.toString(16)}function Dj(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Rn(e,t,r,n)}function jC(e){if(e instanceof Rn)return new Rn(e.h,e.s,e.l,e.opacity);if(e instanceof fd||(e=jc(e)),!e)return new Rn;if(e instanceof Rn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,s=i-a,l=(i+a)/2;return s?(t===i?o=(r-n)/s+(r0&&l<1?0:o,new Rn(o,s,l,e.opacity)}function _Y(e,t,r,n){return arguments.length===1?jC(e):new Rn(e,t,r,n??1)}function Rn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Yb(Rn,_Y,SC(fd,{brighter(e){return e=e==null?kp:Math.pow(kp,e),new Rn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_c:Math.pow(_c,e),new Rn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Mr(Uy(e>=240?e-240:e+120,a,n),Uy(e,a,n),Uy(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new Rn(Lj(this.h),Xd(this.s),Xd(this.l),Ap(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ap(this.opacity);return`${e===1?"hsl(":"hsla("}${Lj(this.h)}, ${Xd(this.s)*100}%, ${Xd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Lj(e){return e=(e||0)%360,e<0?e+360:e}function Xd(e){return Math.max(0,Math.min(1,e||0))}function Uy(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Zb=e=>()=>e;function SY(e,t){return function(r){return e+r*t}}function jY(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function OY(e){return(e=+e)==1?OC:function(t,r){return r-t?jY(t,r,e):Zb(isNaN(t)?r:t)}}function OC(e,t){var r=t-e;return r?SY(e,r):Zb(isNaN(e)?t:e)}const Fj=function e(t){var r=OY(t);function n(a,i){var o=r((a=c0(a)).r,(i=c0(i)).r),s=r(a.g,i.g),l=r(a.b,i.b),u=OC(a.opacity,i.opacity);return function(f){return a.r=o(f),a.g=s(f),a.b=l(f),a.opacity=u(f),a+""}}return n.gamma=e,n}(1);function kY(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;ar&&(i=t.slice(r,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,l.push({i:o,x:Ep(n,a)})),r=Vy.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function DY(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a2?LY:DY,l=u=null,d}function d(p){return p==null||isNaN(p=+p)?i:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return d.invert=function(p){return o(a((u||(u=s(t,e.map(n),Ep)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,Pp),f()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),r=Qb,f()},d.clamp=function(p){return arguments.length?(o=p?!0:kr,f()):o!==kr},d.interpolate=function(p){return arguments.length?(r=p,f()):r},d.unknown=function(p){return arguments.length?(i=p,d):i},function(p,h){return n=p,a=h,f()}}function Jb(){return sm()(kr,kr)}function FY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Np(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ks(e){return e=Np(Math.abs(e)),e?e[1]:NaN}function zY(e,t){return function(r,n){for(var a=r.length,i=[],o=0,s=e[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),i.push(r.substring(a-=s,a+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function BY(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var UY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Oc(e){if(!(t=UY.exec(e)))throw new Error("invalid format: "+e);var t;return new ew({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Oc.prototype=ew.prototype;function ew(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ew.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function VY(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var Cp;function WY(e,t){var r=Np(e,t);if(!r)return Cp=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(Cp=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Np(e,Math.max(0,t+i-1))[0]}function Bj(e,t){var r=Np(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const Uj={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:FY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Bj(e*100,t),r:Bj,s:WY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Vj(e){return e}var Wj=Array.prototype.map,Hj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function HY(e){var t=e.grouping===void 0||e.thousands===void 0?Vj:zY(Wj.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Vj:BY(Wj.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d,p){d=Oc(d);var h=d.fill,x=d.align,y=d.sign,v=d.symbol,g=d.zero,m=d.width,w=d.comma,S=d.precision,b=d.trim,_=d.type;_==="n"?(w=!0,_="g"):Uj[_]||(S===void 0&&(S=12),b=!0,_="g"),(g||h==="0"&&x==="=")&&(g=!0,h="0",x="=");var O=(p&&p.prefix!==void 0?p.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),k=(v==="$"?n:/[%p]/.test(_)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),A=Uj[_],I=/[defgprs%]/.test(_);S=S===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function T(P){var R=O,M=k,F,W,V;if(_==="c")M=A(P)+M,P="";else{P=+P;var L=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),S),b&&(P=VY(P)),L&&+P==0&&y!=="+"&&(L=!1),R=(L?y==="("?y:s:y==="-"||y==="("?"":y)+R,M=(_==="s"&&!isNaN(P)&&Cp!==void 0?Hj[8+Cp/3]:"")+M+(L&&y==="("?")":""),I){for(F=-1,W=P.length;++FV||V>57){M=(V===46?a+P.slice(F+1):P.slice(F))+M,P=P.slice(0,F);break}}}w&&!g&&(P=t(P,1/0));var U=R.length+P.length+M.length,q=U>1)+R+P+M+q.slice(U);break;default:P=q+R+P+M;break}return i(P)}return T.toString=function(){return d+""},T}function f(d,p){var h=Math.max(-8,Math.min(8,Math.floor(Ks(p)/3)))*3,x=Math.pow(10,-h),y=u((d=Oc(d),d.type="f",d),{suffix:Hj[8+h/3]});return function(v){return y(x*v)}}return{format:u,formatPrefix:f}}var Yd,tw,kC;GY({thousands:",",grouping:[3],currency:["$",""]});function GY(e){return Yd=HY(e),tw=Yd.format,kC=Yd.formatPrefix,Yd}function qY(e){return Math.max(0,-Ks(Math.abs(e)))}function KY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ks(t)/3)))*3-Ks(Math.abs(e)))}function XY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ks(t)-Ks(e))+1}function AC(e,t,r,n){var a=l0(e,t,r),i;switch(n=Oc(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=KY(a,o))&&(n.precision=i),kC(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=XY(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=qY(a))&&(n.precision=i-(n.type==="%")*2);break}}return tw(n)}function Ri(e){var t=e.domain;return e.ticks=function(r){var n=t();return o0(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return AC(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],s=n[i],l,u,f=10;for(s0;){if(u=s0(o,s,r),u===l)return n[a]=o,n[i]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Tp(){var e=Jb();return e.copy=function(){return pd(e,Tp())},Sn.apply(e,arguments),Ri(e)}function EC(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Pp),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return EC(e).unknown(t)},e=arguments.length?Array.from(e,Pp):[0,1],Ri(r)}function PC(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return iMath.pow(e,t)}function eZ(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Kj(e){return(t,r)=>-e(-t,r)}function rw(e){const t=e(Gj,qj),r=t.domain;let n=10,a,i;function o(){return a=eZ(n),i=JY(n),r()[0]<0?(a=Kj(a),i=Kj(i),e(YY,ZY)):e(Gj,qj),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const d=f0){for(;p<=h;++p)for(x=1;xf)break;g.push(y)}}else for(;p<=h;++p)for(x=n-1;x>=1;--x)if(y=p>0?x/i(-p):x*i(p),!(yf)break;g.push(y)}g.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Oc(l)).precision==null&&(l.trim=!0),l=tw(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let d=f/i(Math.round(a(f)));return d*nr(PC(r(),{floor:s=>i(Math.floor(a(s))),ceil:s=>i(Math.ceil(a(s)))})),t}function NC(){const e=rw(sm()).domain([1,10]);return e.copy=()=>pd(e,NC()).base(e.base()),Sn.apply(e,arguments),e}function Xj(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Yj(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function nw(e){var t=1,r=e(Xj(t),Yj(t));return r.constant=function(n){return arguments.length?e(Xj(t=+n),Yj(t)):t},Ri(r)}function CC(){var e=nw(sm());return e.copy=function(){return pd(e,CC()).constant(e.constant())},Sn.apply(e,arguments)}function Zj(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function tZ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function rZ(e){return e<0?-e*e:e*e}function aw(e){var t=e(kr,kr),r=1;function n(){return r===1?e(kr,kr):r===.5?e(tZ,rZ):e(Zj(r),Zj(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Ri(t)}function iw(){var e=aw(sm());return e.copy=function(){return pd(e,iw()).exponent(e.exponent())},Sn.apply(e,arguments),e}function nZ(){return iw.apply(null,arguments).exponent(.5)}function Qj(e){return Math.sign(e)*e*e}function aZ(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function TC(){var e=Jb(),t=[0,1],r=!1,n;function a(i){var o=aZ(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(Qj(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Pp)).map(Qj)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return TC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Sn.apply(a,arguments),Ri(a)}function $C(){var e=[],t=[],r=[],n;function a(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(i=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return IC().domain([e,t]).range(a).unknown(i)},Sn.apply(Ri(o),arguments)}function RC(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[dd(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return RC().domain(e).range(t).unknown(r)},Sn.apply(a,arguments)}const Wy=new Date,Hy=new Date;function Xt(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),s=a.ceil(i);return i-o(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,s)=>{const l=[];if(i=a.ceil(i),s=s==null?1:Math.floor(s),!(i0))return l;let u;do l.push(u=new Date(+i)),t(i,s),e(i);while(uXt(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!i(o););else for(;--s>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(Wy.setTime(+i),Hy.setTime(+o),e(Wy),e(Hy),Math.floor(r(Wy,Hy))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const $p=Xt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$p.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Xt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):$p);$p.range;const _a=1e3,yn=_a*60,Sa=yn*60,Ra=Sa*24,ow=Ra*7,Jj=Ra*30,Gy=Ra*365,io=Xt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getUTCSeconds());io.range;const sw=Xt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_a)},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getMinutes());sw.range;const lw=Xt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getUTCMinutes());lw.range;const uw=Xt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_a-e.getMinutes()*yn)},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getHours());uw.range;const cw=Xt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getUTCHours());cw.range;const hd=Xt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*yn)/Ra,e=>e.getDate()-1);hd.range;const lm=Xt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ra,e=>e.getUTCDate()-1);lm.range;const MC=Xt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ra,e=>Math.floor(e/Ra));MC.range;function Mo(e){return Xt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*yn)/ow)}const um=Mo(0),Ip=Mo(1),iZ=Mo(2),oZ=Mo(3),Xs=Mo(4),sZ=Mo(5),lZ=Mo(6);um.range;Ip.range;iZ.range;oZ.range;Xs.range;sZ.range;lZ.range;function Do(e){return Xt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ow)}const cm=Do(0),Rp=Do(1),uZ=Do(2),cZ=Do(3),Ys=Do(4),dZ=Do(5),fZ=Do(6);cm.range;Rp.range;uZ.range;cZ.range;Ys.range;dZ.range;fZ.range;const dw=Xt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());dw.range;const fw=Xt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());fw.range;const Ma=Xt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ma.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ma.range;const Da=Xt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Da.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Da.range;function DC(e,t,r,n,a,i){const o=[[io,1,_a],[io,5,5*_a],[io,15,15*_a],[io,30,30*_a],[i,1,yn],[i,5,5*yn],[i,15,15*yn],[i,30,30*yn],[a,1,Sa],[a,3,3*Sa],[a,6,6*Sa],[a,12,12*Sa],[n,1,Ra],[n,2,2*Ra],[r,1,ow],[t,1,Jj],[t,3,3*Jj],[e,1,Gy]];function s(u,f,d){const p=fv).right(o,p);if(h===o.length)return e.every(l0(u/Gy,f/Gy,d));if(h===0)return $p.every(Math.max(l0(u,f,d),1));const[x,y]=o[p/o[h-1][2]53)return null;"w"in X||(X.w=1),"Z"in X?(ve=Ky(Kl(X.y,0,1)),Ae=ve.getUTCDay(),ve=Ae>4||Ae===0?Rp.ceil(ve):Rp(ve),ve=lm.offset(ve,(X.V-1)*7),X.y=ve.getUTCFullYear(),X.m=ve.getUTCMonth(),X.d=ve.getUTCDate()+(X.w+6)%7):(ve=qy(Kl(X.y,0,1)),Ae=ve.getDay(),ve=Ae>4||Ae===0?Ip.ceil(ve):Ip(ve),ve=hd.offset(ve,(X.V-1)*7),X.y=ve.getFullYear(),X.m=ve.getMonth(),X.d=ve.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),Ae="Z"in X?Ky(Kl(X.y,0,1)).getUTCDay():qy(Kl(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(Ae+5)%7:X.w+X.U*7-(Ae+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,Ky(X)):qy(X)}}function k(te,ie,he,X){for(var ke=0,ve=ie.length,Ae=he.length,ze,ge;ke=Ae)return-1;if(ze=ie.charCodeAt(ke++),ze===37){if(ze=ie.charAt(ke++),ge=b[ze in eO?ie.charAt(ke++):ze],!ge||(X=ge(te,he,X))<0)return-1}else if(ze!=he.charCodeAt(X++))return-1}return X}function A(te,ie,he){var X=u.exec(ie.slice(he));return X?(te.p=f.get(X[0].toLowerCase()),he+X[0].length):-1}function I(te,ie,he){var X=h.exec(ie.slice(he));return X?(te.w=x.get(X[0].toLowerCase()),he+X[0].length):-1}function T(te,ie,he){var X=d.exec(ie.slice(he));return X?(te.w=p.get(X[0].toLowerCase()),he+X[0].length):-1}function P(te,ie,he){var X=g.exec(ie.slice(he));return X?(te.m=m.get(X[0].toLowerCase()),he+X[0].length):-1}function R(te,ie,he){var X=y.exec(ie.slice(he));return X?(te.m=v.get(X[0].toLowerCase()),he+X[0].length):-1}function M(te,ie,he){return k(te,t,ie,he)}function F(te,ie,he){return k(te,r,ie,he)}function W(te,ie,he){return k(te,n,ie,he)}function V(te){return o[te.getDay()]}function L(te){return i[te.getDay()]}function U(te){return l[te.getMonth()]}function q(te){return s[te.getMonth()]}function J(te){return a[+(te.getHours()>=12)]}function K(te){return 1+~~(te.getMonth()/3)}function ae(te){return o[te.getUTCDay()]}function Q(te){return i[te.getUTCDay()]}function be(te){return l[te.getUTCMonth()]}function ue(te){return s[te.getUTCMonth()]}function Pe(te){return a[+(te.getUTCHours()>=12)]}function Fe(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var ie=_(te+="",w);return ie.toString=function(){return te},ie},parse:function(te){var ie=O(te+="",!1);return ie.toString=function(){return te},ie},utcFormat:function(te){var ie=_(te+="",S);return ie.toString=function(){return te},ie},utcParse:function(te){var ie=O(te+="",!0);return ie.toString=function(){return te},ie}}}var eO={"-":"",_:" ",0:"0"},ir=/^\s*\d+/,gZ=/^%/,xZ=/[\\^$*+?|[\]().{}]/g;function Je(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i[t.toLowerCase(),r]))}function wZ(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function _Z(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function SZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function jZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function OZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function tO(e,t,r){var n=ir.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function rO(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function kZ(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function AZ(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function EZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function nO(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function PZ(e,t,r){var n=ir.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function aO(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function NZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function CZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function TZ(e,t,r){var n=ir.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function $Z(e,t,r){var n=ir.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function IZ(e,t,r){var n=gZ.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function RZ(e,t,r){var n=ir.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function MZ(e,t,r){var n=ir.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function iO(e,t){return Je(e.getDate(),t,2)}function DZ(e,t){return Je(e.getHours(),t,2)}function LZ(e,t){return Je(e.getHours()%12||12,t,2)}function FZ(e,t){return Je(1+hd.count(Ma(e),e),t,3)}function LC(e,t){return Je(e.getMilliseconds(),t,3)}function zZ(e,t){return LC(e,t)+"000"}function BZ(e,t){return Je(e.getMonth()+1,t,2)}function UZ(e,t){return Je(e.getMinutes(),t,2)}function VZ(e,t){return Je(e.getSeconds(),t,2)}function WZ(e){var t=e.getDay();return t===0?7:t}function HZ(e,t){return Je(um.count(Ma(e)-1,e),t,2)}function FC(e){var t=e.getDay();return t>=4||t===0?Xs(e):Xs.ceil(e)}function GZ(e,t){return e=FC(e),Je(Xs.count(Ma(e),e)+(Ma(e).getDay()===4),t,2)}function qZ(e){return e.getDay()}function KZ(e,t){return Je(Ip.count(Ma(e)-1,e),t,2)}function XZ(e,t){return Je(e.getFullYear()%100,t,2)}function YZ(e,t){return e=FC(e),Je(e.getFullYear()%100,t,2)}function ZZ(e,t){return Je(e.getFullYear()%1e4,t,4)}function QZ(e,t){var r=e.getDay();return e=r>=4||r===0?Xs(e):Xs.ceil(e),Je(e.getFullYear()%1e4,t,4)}function JZ(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Je(t/60|0,"0",2)+Je(t%60,"0",2)}function oO(e,t){return Je(e.getUTCDate(),t,2)}function eQ(e,t){return Je(e.getUTCHours(),t,2)}function tQ(e,t){return Je(e.getUTCHours()%12||12,t,2)}function rQ(e,t){return Je(1+lm.count(Da(e),e),t,3)}function zC(e,t){return Je(e.getUTCMilliseconds(),t,3)}function nQ(e,t){return zC(e,t)+"000"}function aQ(e,t){return Je(e.getUTCMonth()+1,t,2)}function iQ(e,t){return Je(e.getUTCMinutes(),t,2)}function oQ(e,t){return Je(e.getUTCSeconds(),t,2)}function sQ(e){var t=e.getUTCDay();return t===0?7:t}function lQ(e,t){return Je(cm.count(Da(e)-1,e),t,2)}function BC(e){var t=e.getUTCDay();return t>=4||t===0?Ys(e):Ys.ceil(e)}function uQ(e,t){return e=BC(e),Je(Ys.count(Da(e),e)+(Da(e).getUTCDay()===4),t,2)}function cQ(e){return e.getUTCDay()}function dQ(e,t){return Je(Rp.count(Da(e)-1,e),t,2)}function fQ(e,t){return Je(e.getUTCFullYear()%100,t,2)}function pQ(e,t){return e=BC(e),Je(e.getUTCFullYear()%100,t,2)}function hQ(e,t){return Je(e.getUTCFullYear()%1e4,t,4)}function mQ(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ys(e):Ys.ceil(e),Je(e.getUTCFullYear()%1e4,t,4)}function yQ(){return"+0000"}function sO(){return"%"}function lO(e){return+e}function uO(e){return Math.floor(+e/1e3)}var Ho,UC,VC;vQ({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function vQ(e){return Ho=vZ(e),UC=Ho.format,Ho.parse,VC=Ho.utcFormat,Ho.utcParse,Ho}function gQ(e){return new Date(e)}function xQ(e){return e instanceof Date?+e:+new Date(+e)}function pw(e,t,r,n,a,i,o,s,l,u){var f=Jb(),d=f.invert,p=f.domain,h=u(".%L"),x=u(":%S"),y=u("%I:%M"),v=u("%I %p"),g=u("%a %d"),m=u("%b %d"),w=u("%B"),S=u("%Y");function b(_){return(l(_)<_?h:s(_)<_?x:o(_)<_?y:i(_)<_?v:n(_)<_?a(_)<_?g:m:r(_)<_?w:S)(_)}return f.invert=function(_){return new Date(d(_))},f.domain=function(_){return arguments.length?p(Array.from(_,xQ)):p().map(gQ)},f.ticks=function(_){var O=p();return e(O[0],O[O.length-1],_??10)},f.tickFormat=function(_,O){return O==null?b:u(O)},f.nice=function(_){var O=p();return(!_||typeof _.range!="function")&&(_=t(O[0],O[O.length-1],_??10)),_?p(PC(O,_)):f},f.copy=function(){return pd(f,pw(e,t,r,n,a,i,o,s,l,u))},f}function bQ(){return Sn.apply(pw(mZ,yZ,Ma,dw,um,hd,uw,sw,io,UC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function wQ(){return Sn.apply(pw(pZ,hZ,Da,fw,cm,lm,cw,lw,io,VC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function dm(){var e=0,t=1,r,n,a,i,o=kr,s=!1,l;function u(d){return d==null||isNaN(d=+d)?l:o(a===0?.5:(d=(i(d)-r)*a,s?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(s=!!d,u):s},u.interpolator=function(d){return arguments.length?(o=d,u):o};function f(d){return function(p){var h,x;return arguments.length?([h,x]=p,o=d(h,x),u):[o(0),o(1)]}}return u.range=f(Cl),u.rangeRound=f(Qb),u.unknown=function(d){return arguments.length?(l=d,u):l},function(d){return i=d,r=d(e),n=d(t),a=r===n?0:1/(n-r),u}}function Mi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function WC(){var e=Ri(dm()(kr));return e.copy=function(){return Mi(e,WC())},Va.apply(e,arguments)}function HC(){var e=rw(dm()).domain([1,10]);return e.copy=function(){return Mi(e,HC()).base(e.base())},Va.apply(e,arguments)}function GC(){var e=nw(dm());return e.copy=function(){return Mi(e,GC()).constant(e.constant())},Va.apply(e,arguments)}function hw(){var e=aw(dm());return e.copy=function(){return Mi(e,hw()).exponent(e.exponent())},Va.apply(e,arguments)}function _Q(){return hw.apply(null,arguments).exponent(.5)}function qC(){var e=[],t=kr;function r(n){if(n!=null&&!isNaN(n=+n))return t((dd(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(wi),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>lY(e,i/n))},r.copy=function(){return qC(t).domain(e)},Va.apply(r,arguments)}function fm(){var e=0,t=.5,r=1,n=1,a,i,o,s,l,u=kr,f,d=!1,p;function h(y){return isNaN(y=+y)?p:(y=.5+((y=+f(y))-i)*(n*yt}var ZC=kQ,AQ=pm,EQ=ZC,PQ=Nl;function NQ(e){return e&&e.length?AQ(e,PQ,EQ):void 0}var CQ=NQ;const ci=nt(CQ);function TQ(e,t){return ee.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};pe.decimalPlaces=pe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};pe.dividedBy=pe.div=function(e){return Ea(this,new this.constructor(e))};pe.dividedToIntegerBy=pe.idiv=function(e){var t=this,r=t.constructor;return dt(Ea(t,new r(e),0,1),r.precision)};pe.equals=pe.eq=function(e){return!this.cmp(e)};pe.exponent=function(){return Bt(this)};pe.greaterThan=pe.gt=function(e){return this.cmp(e)>0};pe.greaterThanOrEqualTo=pe.gte=function(e){return this.cmp(e)>=0};pe.isInteger=pe.isint=function(){return this.e>this.d.length-2};pe.isNegative=pe.isneg=function(){return this.s<0};pe.isPositive=pe.ispos=function(){return this.s>0};pe.isZero=function(){return this.s===0};pe.lessThan=pe.lt=function(e){return this.cmp(e)<0};pe.lessThanOrEqualTo=pe.lte=function(e){return this.cmp(e)<1};pe.logarithm=pe.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(qr))throw Error(bn+"NaN");if(r.s<1)throw Error(bn+(r.s?"NaN":"-Infinity"));return r.eq(qr)?new n(0):(St=!1,t=Ea(kc(r,i),kc(e,i),i),St=!0,dt(t,a))};pe.minus=pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rT(t,e):eT(t,(e.s=-e.s,e))};pe.modulo=pe.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(bn+"NaN");return r.s?(St=!1,t=Ea(r,e,0,1).times(e),St=!0,r.minus(t)):dt(new n(r),a)};pe.naturalExponential=pe.exp=function(){return tT(this)};pe.naturalLogarithm=pe.ln=function(){return kc(this)};pe.negated=pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};pe.plus=pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?eT(t,e):rT(t,(e.s=-e.s,e))};pe.precision=pe.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ho+e);if(t=Bt(a)+1,n=a.d.length-1,r=n*xt+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};pe.squareRoot=pe.sqrt=function(){var e,t,r,n,a,i,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(bn+"NaN")}for(e=Bt(s),St=!1,a=Math.sqrt(+s),a==0||a==1/0?(t=Kn(s.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=$l((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(a.toString()),r=l.precision,a=o=r+3;;)if(i=n,n=i.plus(Ea(s,i,o+2)).times(.5),Kn(i.d).slice(0,o)===(t=Kn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(dt(i,r+1,0),i.times(i).eq(s)){n=i;break}}else if(t!="9999")break;o+=4}return St=!0,dt(n,r)};pe.times=pe.mul=function(e){var t,r,n,a,i,o,s,l,u,f=this,d=f.constructor,p=f.d,h=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,l=p.length,u=h.length,l=0;){for(t=0,a=l+n;a>n;)s=i[a]+h[n]*p[a-n-1]+t,i[a--]=s%er|0,t=s/er|0;i[a]=(i[a]+t)%er|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,St?dt(e,d.precision):e};pe.toDecimalPlaces=pe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(aa(e,0,Tl),t===void 0?t=n.rounding:aa(t,0,8),dt(r,e+Bt(r)+1,t))};pe.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=Po(n,!0):(aa(e,0,Tl),t===void 0?t=a.rounding:aa(t,0,8),n=dt(new a(n),e+1,t),r=Po(n,!0,e+1)),r};pe.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?Po(a):(aa(e,0,Tl),t===void 0?t=i.rounding:aa(t,0,8),n=dt(new i(a),e+Bt(a)+1,t),r=Po(n.abs(),!1,e+Bt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};pe.toInteger=pe.toint=function(){var e=this,t=e.constructor;return dt(new t(e),Bt(e)+1,t.rounding)};pe.toNumber=function(){return+this};pe.toPower=pe.pow=function(e){var t,r,n,a,i,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(qr);if(s=new l(s),!s.s){if(e.s<1)throw Error(bn+"Infinity");return s}if(s.eq(qr))return s;if(n=l.precision,e.eq(qr))return dt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=s.s,o){if((r=f<0?-f:f)<=JC){for(a=new l(qr),t=Math.ceil(n/xt+4),St=!1;r%2&&(a=a.times(s),fO(a.d,t)),r=$l(r/2),r!==0;)s=s.times(s),fO(s.d,t);return St=!0,e.s<0?new l(qr).div(a):dt(a,n)}}else if(i<0)throw Error(bn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,St=!1,a=e.times(kc(s,n+u)),St=!0,a=tT(a),a.s=i,a};pe.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=Bt(a),n=Po(a,r<=i.toExpNeg||r>=i.toExpPos)):(aa(e,1,Tl),t===void 0?t=i.rounding:aa(t,0,8),a=dt(new i(a),e,t),r=Bt(a),n=Po(a,e<=r||r<=i.toExpNeg,e)),n};pe.toSignificantDigits=pe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(aa(e,1,Tl),t===void 0?t=n.rounding:aa(t,0,8)),dt(new n(r),e,t)};pe.toString=pe.valueOf=pe.val=pe.toJSON=pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Bt(e),r=e.constructor;return Po(e,t<=r.toExpNeg||t>=r.toExpPos)};function eT(e,t){var r,n,a,i,o,s,l,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),St?dt(t,d):t;if(l=e.d,u=t.d,o=e.e,a=t.e,l=l.slice(),i=o-a,i){for(i<0?(n=l,i=-i,s=u.length):(n=u,a=o,s=l.length),o=Math.ceil(d/xt),s=o>s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,n=u,u=l,l=n),r=0;i;)r=(l[--i]=l[i]+u[i]+r)/er|0,l[i]%=er;for(r&&(l.unshift(r),++a),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=a,St?dt(t,d):t}function aa(e,t,r){if(e!==~~e||er)throw Error(ho+e)}function Kn(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;to?1:-1;else for(s=l=0;sa[s]?1:-1;break}return l}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]1;)n.shift()}return function(n,a,i,o){var s,l,u,f,d,p,h,x,y,v,g,m,w,S,b,_,O,k,A=n.constructor,I=n.s==a.s?1:-1,T=n.d,P=a.d;if(!n.s)return new A(n);if(!a.s)throw Error(bn+"Division by zero");for(l=n.e-a.e,O=P.length,b=T.length,h=new A(I),x=h.d=[],u=0;P[u]==(T[u]||0);)++u;if(P[u]>(T[u]||0)&&--l,i==null?m=i=A.precision:o?m=i+(Bt(n)-Bt(a))+1:m=i,m<0)return new A(0);if(m=m/xt+2|0,u=0,O==1)for(f=0,P=P[0],m++;(u1&&(P=e(P,f),T=e(T,f),O=P.length,b=T.length),S=O,y=T.slice(0,O),v=y.length;v=er/2&&++_;do f=0,s=t(P,y,O,v),s<0?(g=y[0],O!=v&&(g=g*er+(y[1]||0)),f=g/_|0,f>1?(f>=er&&(f=er-1),d=e(P,f),p=d.length,v=y.length,s=t(d,y,p,v),s==1&&(f--,r(d,O16)throw Error(yw+Bt(e));if(!e.s)return new f(qr);for(St=!1,s=d,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Yi(2,u))/Math.LN10*2+5|0,s+=n,r=a=i=new f(qr),f.precision=s;;){if(a=dt(a.times(e),s),r=r.times(++l),o=i.plus(Ea(a,r,s)),Kn(o.d).slice(0,s)===Kn(i.d).slice(0,s)){for(;u--;)i=dt(i.times(i),s);return f.precision=d,t==null?(St=!0,dt(i,d)):i}i=o}}function Bt(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function Xy(e,t,r){if(t>e.LN10.sd())throw St=!0,r&&(e.precision=r),Error(bn+"LN10 precision limit exceeded");return dt(new e(e.LN10),t)}function ri(e){for(var t="";e--;)t+="0";return t}function kc(e,t){var r,n,a,i,o,s,l,u,f,d=1,p=10,h=e,x=h.d,y=h.constructor,v=y.precision;if(h.s<1)throw Error(bn+(h.s?"NaN":"-Infinity"));if(h.eq(qr))return new y(0);if(t==null?(St=!1,u=v):u=t,h.eq(10))return t==null&&(St=!0),Xy(y,u);if(u+=p,y.precision=u,r=Kn(x),n=r.charAt(0),i=Bt(h),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Kn(h.d),n=r.charAt(0),d++;i=Bt(h),n>1?(h=new y("0."+r),i++):h=new y(n+"."+r.slice(1))}else return l=Xy(y,u+2,v).times(i+""),h=kc(new y(n+"."+r.slice(1)),u-p).plus(l),y.precision=v,t==null?(St=!0,dt(h,v)):h;for(s=o=h=Ea(h.minus(qr),h.plus(qr),u),f=dt(h.times(h),u),a=3;;){if(o=dt(o.times(f),u),l=s.plus(Ea(o,new y(a),u)),Kn(l.d).slice(0,u)===Kn(s.d).slice(0,u))return s=s.times(2),i!==0&&(s=s.plus(Xy(y,u+2,v).times(i+""))),s=Ea(s,new y(d),u),y.precision=v,t==null?(St=!0,dt(s,v)):s;s=l,a+=2}}function dO(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=$l(r/xt),e.d=[],n=(r+1)%xt,r<0&&(n+=xt),nMp||e.e<-Mp))throw Error(yw+r)}else e.s=0,e.e=0,e.d=[0];return e}function dt(e,t,r){var n,a,i,o,s,l,u,f,d=e.d;for(o=1,i=d[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=xt,a=t,u=d[f=0];else{if(f=Math.ceil((n+1)/xt),i=d.length,f>=i)return e;for(u=i=d[f],o=1;i>=10;i/=10)o++;n%=xt,a=n-xt+o}if(r!==void 0&&(i=Yi(10,o-a-1),s=u/i%10|0,l=t<0||d[f+1]!==void 0||u%i,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?a>0?u/Yi(10,o-a):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(i=Bt(e),d.length=1,t=t-i-1,d[0]=Yi(10,(xt-t%xt)%xt),e.e=$l(-t/xt)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,i=1,f--):(d.length=f+1,i=Yi(10,xt-n),d[f]=a>0?(u/Yi(10,o-a)%Yi(10,a)|0)*i:0),l)for(;;)if(f==0){(d[0]+=i)==er&&(d[0]=1,++e.e);break}else{if(d[f]+=i,d[f]!=er)break;d[f--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(St&&(e.e>Mp||e.e<-Mp))throw Error(yw+Bt(e));return e}function rT(e,t){var r,n,a,i,o,s,l,u,f,d,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),St?dt(t,h):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=d.length):(r=d,n=u,s=l.length),a=Math.max(Math.ceil(h/xt),s)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=l.length,s=d.length,f=a0;--a)l[s++]=0;for(a=d.length;a>o;){if(l[--a]0?i=i.charAt(0)+"."+i.slice(1)+ri(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+ri(-a-1)+i,r&&(n=r-o)>0&&(i+=ri(n))):a>=o?(i+=ri(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+ri(n))):((n=a+1)0&&(a+1===o&&(i+="."),i+=ri(n))),e.s<0?"-"+i:i}function fO(e,t){if(e.length>t)return e.length=t,!0}function nT(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(ho+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return dO(o,i.toString())}else if(typeof i!="string")throw Error(ho+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,JQ.test(i))dO(o,i);else throw Error(ho+i)}if(a.prototype=pe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=nT,a.config=a.set=eJ,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(ho+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ho+r+": "+n);return this}var vw=nT(QQ);qr=new vw(1);const lt=vw;function tJ(e){return iJ(e)||aJ(e)||nJ(e)||rJ()}function rJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nJ(e,t){if(e){if(typeof e=="string")return p0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p0(e,t)}}function aJ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function iJ(e){if(Array.isArray(e))return p0(e)}function p0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-o,pO(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){a=!0,i=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function bJ(e){if(Array.isArray(e))return e}function lT(e){var t=Ac(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function uT(e,t,r){if(e.lte(0))return new lt(0);var n=ym.getDigitCount(e.toNumber()),a=new lt(10).pow(n),i=e.div(a),o=n!==1?.05:.1,s=new lt(Math.ceil(i.div(o).toNumber())).add(r).mul(o),l=s.mul(a);return t?l:new lt(Math.ceil(l))}function wJ(e,t,r){var n=1,a=new lt(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new lt(10).pow(ym.getDigitCount(e)-1),a=new lt(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new lt(Math.floor(e)))}else e===0?a=new lt(Math.floor((t-1)/2)):r||(a=new lt(Math.floor(e)));var o=Math.floor((t-1)/2),s=uJ(lJ(function(l){return a.add(new lt(l-o).mul(n)).toNumber()}),h0);return s(0,t)}function cT(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new lt(0),tickMin:new lt(0),tickMax:new lt(0)};var i=uT(new lt(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new lt(0):(o=new lt(e).add(t).div(2),o=o.sub(new lt(o).mod(i)));var s=Math.ceil(o.sub(e).div(i).toNumber()),l=Math.ceil(new lt(t).sub(o).div(i).toNumber()),u=s+l+1;return u>r?cT(e,t,r,n,a+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:i,tickMin:o.sub(new lt(s).mul(i)),tickMax:o.add(new lt(l).mul(i))})}function _J(e){var t=Ac(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),s=lT([r,n]),l=Ac(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(y0(h0(0,a-1).map(function(){return 1/0}))):[].concat(y0(h0(0,a-1).map(function(){return-1/0})),[f]);return r>n?m0(d):d}if(u===f)return wJ(u,a,i);var p=cT(u,f,o,i),h=p.step,x=p.tickMin,y=p.tickMax,v=ym.rangeStep(x,y.add(new lt(.1).mul(h)),h);return r>n?m0(v):v}function SJ(e,t){var r=Ac(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=lT([n,a]),s=Ac(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,a];if(l===u)return[l];var f=Math.max(t,2),d=uT(new lt(u).sub(l).div(f-1),i,0),p=[].concat(y0(ym.rangeStep(new lt(l),new lt(u).sub(new lt(.99).mul(d)),d)),[u]);return n>a?m0(p):p}var jJ=oT(_J),OJ=oT(SJ),kJ="Invariant failed";function No(e,t){throw new Error(kJ)}var AJ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Zs(e){"@babel/helpers - typeof";return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs(e)}function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function IJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function RJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MJ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var l=i.range,u=0;u0?a[u-1].coordinate:a[s-1].coordinate,d=a[u].coordinate,p=u>=s-1?a[0].coordinate:a[u+1].coordinate,h=void 0;if(jr(d-f)!==jr(p-d)){var x=[];if(jr(p-d)===jr(l[1]-l[0])){h=p;var y=d+l[1]-l[0];x[0]=Math.min(y,(y+f)/2),x[1]=Math.max(y,(y+f)/2)}else{h=f;var v=p+l[1]-l[0];x[0]=Math.min(d,(v+d)/2),x[1]=Math.max(d,(v+d)/2)}var g=[Math.min(d,(h+d)/2),Math.max(d,(h+d)/2)];if(t>g[0]&&t<=g[1]||t>=x[0]&&t<=x[1]){o=a[u].index;break}}else{var m=Math.min(f,p),w=Math.max(f,p);if(t>(m+d)/2&&t<=(w+d)/2){o=a[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},gw=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Nt(Nt({},t.type.defaultProps),t.props):t.props,o=i.stroke,s=i.fill,l;switch(a){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},JJ=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},s=Object.keys(i),l=0,u=s.length;l=0});if(g&&g.length){var m=g[0].type.defaultProps,w=m!==void 0?Nt(Nt({},m),g[0].props):g[0].props,S=w.barSize,b=w[v];o[b]||(o[b]=[]);var _=Ee(S)?r:S;o[b].push({item:g[0],stackList:g.slice(1),barSize:Ee(_)?void 0:Or(_,n,0)})}}return o},eee=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=Or(r,a,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=a/l,x=o.reduce(function(S,b){return S+b.barSize||0},0);x+=(l-1)*u,x>=a&&(x-=(l-1)*u,u=0),x>=a&&h>0&&(p=!0,h*=.9,x=l*h);var y=(a-x)/2>>0,v={offset:y-u,size:0};f=o.reduce(function(S,b){var _={item:b.item,position:{offset:v.offset+v.size+u,size:p?h:b.barSize}},O=[].concat(yO(S),[_]);return v=O[O.length-1].position,b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:v})}),O},d)}else{var g=Or(n,a,0,!0);a-2*g-(l-1)*u<=0&&(u=0);var m=(a-2*g-(l-1)*u)/l;m>1&&(m>>=0);var w=s===+s?Math.min(m,s):m;f=o.reduce(function(S,b,_){var O=[].concat(yO(S),[{item:b.item,position:{offset:g+(m+u)*_+(m-w)/2,size:w}}]);return b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:O[O.length-1].position})}),O},d)}return f},tee=function(t,r,n,a){var i=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=hT({children:i,legendWidth:l});if(u){var f=a||{},d=f.width,p=f.height,h=u.align,x=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&x==="middle")&&h!=="center"&&re(t[h]))return Nt(Nt({},t),{},Ps({},h,t[h]+(d||0)));if((y==="horizontal"||y==="vertical"&&h==="center")&&x!=="middle"&&re(t[x]))return Nt(Nt({},t),{},Ps({},x,t[x]+(p||0)))}return t},ree=function(t,r,n){return Ee(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},mT=function(t,r,n,a,i){var o=r.props.children,s=Zr(o,md).filter(function(u){return ree(a,i,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=It(f,n);if(Ee(d))return u;var p=Array.isArray(d)?[hm(d),ci(d)]:[d,d],h=l.reduce(function(x,y){var v=It(f,y,0),g=p[0]-Math.abs(Array.isArray(v)?v[0]:v),m=p[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(g,x[0]),Math.max(m,x[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},nee=function(t,r,n,a,i){var o=r.map(function(s){return mT(t,s,n,i,a)}).filter(function(s){return!Ee(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},yT=function(t,r,n,a,i){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&mT(t,l,u,a)||Du(t,u,n,i)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,d=u.length;f=2?jr(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var p=i?i.indexOf(d):d;return{coordinate:a(p)+u,value:d,offset:u}});return f.filter(function(d){return!Al(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,p){return{coordinate:a(d)+u,value:d,index:p,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(d){return{coordinate:a(d)+u,value:d,offset:u}}):a.domain().map(function(d,p){return{coordinate:a(d)+u,value:i?i[d]:d,index:p,offset:u}})},Yy=new WeakMap,Zd=function(t,r){if(typeof r!="function")return t;Yy.has(t)||Yy.set(t,new WeakMap);var n=Yy.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},xT=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,s=t.axisType;if(a==="auto")return o==="radial"&&s==="radiusAxis"?{scale:wc(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Tp(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Mu(),realScaleType:"point"}:i==="category"?{scale:wc(),realScaleType:"band"}:{scale:Tp(),realScaleType:"linear"};if(Oo(a)){var l="scale".concat(em(a));return{scale:(cO[l]||Mu)(),realScaleType:cO[l]?l:"point"}}return Se(a)?{scale:a}:{scale:Mu(),realScaleType:"point"}},gO=1e-4,bT=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-gO,o=Math.max(a[0],a[1])+gO,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},aee=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},see=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[o][n][0]=i,t[o][n][1]=i+s,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},lee={sign:oee,expand:A9,none:Vs,silhouette:E9,wiggle:P9,positive:see},uee=function(t,r,n){var a=r.map(function(s){return s.props.dataKey}),i=lee[n],o=k9().keys(a).value(function(s,l){return+It(s,l,0)}).order(Wg).offset(i);return o(t)},cee=function(t,r,n,a,i,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(d,p){var h,x=(h=p.type)!==null&&h!==void 0&&h.defaultProps?Nt(Nt({},p.type.defaultProps),p.props):p.props,y=x.stackId,v=x.hide;if(v)return d;var g=x[n],m=d[g]||{hasStack:!1,stackGroups:{}};if(Kt(y)){var w=m.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};w.items.push(p),m.hasStack=!0,m.stackGroups[y]=w}else m.stackGroups[Ro("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[p]};return Nt(Nt({},d),{},Ps({},g,m))},l),f={};return Object.keys(u).reduce(function(d,p){var h=u[p];if(h.hasStack){var x={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(y,v){var g=h.stackGroups[v];return Nt(Nt({},y),{},Ps({},v,{numericAxisId:n,cateAxisId:a,items:g.items,stackedData:uee(t,g.items,i)}))},x)}return Nt(Nt({},d),{},Ps({},p,h))},f)},wT=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=jJ(u,i,s);return t.domain([hm(f),ci(f)]),{niceTicks:f}}if(i&&a==="number"){var d=t.domain(),p=OJ(d,i,s);return{niceTicks:p}}return null};function Fp(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ee(a[t.dataKey])){var s=cp(r,"value",a[t.dataKey]);if(s)return s.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var l=It(a,Ee(o)?t.dataKey:o);return Ee(l)?null:t.scale(l)}var xO=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+a:null;var l=It(o,r.dataKey,r.domain[s]);return Ee(l)?null:r.scale(l)-i/2+a},dee=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},fee=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Nt(Nt({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Kt(i)){var o=r[i];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},pee=function(t){return t.reduce(function(r,n){return[hm(n.concat([r[0]]).filter(re)),ci(n.concat([r[1]]).filter(re))]},[1/0,-1/0])},_T=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],s=o.stackedData,l=s.reduce(function(u,f){var d=pee(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],a[0]),Math.max(l[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},bO=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,wO=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,b0=function(t,r,n){if(Se(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(re(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(bO.test(t[0])){var i=+bO.exec(t[0])[1];a[0]=r[0]-i}else Se(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(re(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(wO.test(t[1])){var o=+wO.exec(t[1])[1];a[1]=r[1]+o}else Se(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},zp=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=Gb(r,function(d){return d.coordinate}),o=1/0,s=1,l=i.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},_ee=function(t,r,n,a,i){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=Or(t.cx,o,o/2),d=Or(t.cy,s,s/2),p=OT(o,s,n),h=Or(t.innerRadius,p,0),x=Or(t.outerRadius,p,p*.8),y=Object.keys(r);return y.reduce(function(v,g){var m=r[g],w=m.domain,S=m.reversed,b;if(Ee(m.range))a==="angleAxis"?b=[l,u]:a==="radiusAxis"&&(b=[h,x]),S&&(b=[b[1],b[0]]);else{b=m.range;var _=b,O=yee(_,2);l=O[0],u=O[1]}var k=xT(m,i),A=k.realScaleType,I=k.scale;I.domain(w).range(b),bT(I);var T=wT(I,ha(ha({},m),{},{realScaleType:A})),P=ha(ha(ha({},m),T),{},{range:b,radius:x,realScaleType:A,scale:I,cx:f,cy:d,innerRadius:h,outerRadius:x,startAngle:l,endAngle:u});return ha(ha({},v),{},jT({},g,P))},{})},See=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},jee=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,s=See({x:n,y:a},{x:i,y:o});if(s<=0)return{radius:s};var l=(n-i)/s,u=Math.acos(l);return a>o&&(u=2*Math.PI-u),{radius:s,angle:wee(u),angleInRadian:u}},Oee=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},kee=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),s=Math.min(i,o);return t+s*360},OO=function(t,r){var n=t.x,a=t.y,i=jee({x:n,y:a},r),o=i.radius,s=i.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=Oee(r),d=f.startAngle,p=f.endAngle,h=s,x;if(d<=p){for(;h>p;)h-=360;for(;h=d&&h<=p}else{for(;h>d;)h-=360;for(;h=p&&h<=d}return x?ha(ha({},r),{},{radius:o,angle:kee(h,r)}):null},kT=function(t){return!j.isValidElement(t)&&!Se(t)&&typeof t!="boolean"?t.className:""};function Cc(e){"@babel/helpers - typeof";return Cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cc(e)}var Aee=["offset"];function Eee(e){return Tee(e)||Cee(e)||Nee(e)||Pee()}function Pee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nee(e,t){if(e){if(typeof e=="string")return w0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w0(e,t)}}function Cee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tee(e){if(Array.isArray(e))return w0(e)}function w0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Iee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function kO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Vt(e){for(var t=1;t=0?1:-1,w,S;a==="insideStart"?(w=h+m*o,S=y):a==="insideEnd"?(w=x-m*o,S=!y):a==="end"&&(w=x+m*o,S=y),S=g<=0?S:!S;var b=mt(u,f,v,w),_=mt(u,f,v,w+(S?1:-1)*359),O="M".concat(b.x,",").concat(b.y,` + A`).concat(v,",").concat(v,",0,1,").concat(S?0:1,`, + `).concat(_.x,",").concat(_.y),k=Ee(t.id)?Ro("recharts-radial-line-"):t.id;return C.createElement("text",Tc({},n,{dominantBaseline:"central",className:Re("recharts-radial-bar-label",s)}),C.createElement("defs",null,C.createElement("path",{id:k,d:O})),C.createElement("textPath",{xlinkHref:"#".concat(k)},r))},Bee=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,s=i.cy,l=i.innerRadius,u=i.outerRadius,f=i.startAngle,d=i.endAngle,p=(f+d)/2;if(a==="outside"){var h=mt(o,s,u+n,p),x=h.x,y=h.y;return{x,y,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var v=(l+u)/2,g=mt(o,s,v,p),m=g.x,w=g.y;return{x:m,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Uee=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,d=f>=0?1:-1,p=d*a,h=d>0?"end":"start",x=d>0?"start":"end",y=u>=0?1:-1,v=y*a,g=y>0?"end":"start",m=y>0?"start":"end";if(i==="top"){var w={x:s+u/2,y:l-d*a,textAnchor:"middle",verticalAnchor:h};return Vt(Vt({},w),n?{height:Math.max(l-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:s+u/2,y:l+f+p,textAnchor:"middle",verticalAnchor:x};return Vt(Vt({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(i==="left"){var b={x:s-v,y:l+f/2,textAnchor:g,verticalAnchor:"middle"};return Vt(Vt({},b),n?{width:Math.max(b.x-n.x,0),height:f}:{})}if(i==="right"){var _={x:s+u+v,y:l+f/2,textAnchor:m,verticalAnchor:"middle"};return Vt(Vt({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return i==="insideLeft"?Vt({x:s+v,y:l+f/2,textAnchor:m,verticalAnchor:"middle"},O):i==="insideRight"?Vt({x:s+u-v,y:l+f/2,textAnchor:g,verticalAnchor:"middle"},O):i==="insideTop"?Vt({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:x},O):i==="insideBottom"?Vt({x:s+u/2,y:l+f-p,textAnchor:"middle",verticalAnchor:h},O):i==="insideTopLeft"?Vt({x:s+v,y:l+p,textAnchor:m,verticalAnchor:x},O):i==="insideTopRight"?Vt({x:s+u-v,y:l+p,textAnchor:g,verticalAnchor:x},O):i==="insideBottomLeft"?Vt({x:s+v,y:l+f-p,textAnchor:m,verticalAnchor:h},O):i==="insideBottomRight"?Vt({x:s+u-v,y:l+f-p,textAnchor:g,verticalAnchor:h},O):Sl(i)&&(re(i.x)||no(i.x))&&(re(i.y)||no(i.y))?Vt({x:s+Or(i.x,u),y:l+Or(i.y,f),textAnchor:"end",verticalAnchor:"end"},O):Vt({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Vee=function(t){return"cx"in t&&re(t.cx)};function nr(e){var t=e.offset,r=t===void 0?5:t,n=$ee(e,Aee),a=Vt({offset:r},n),i=a.viewBox,o=a.position,s=a.value,l=a.children,u=a.content,f=a.className,d=f===void 0?"":f,p=a.textBreakAll;if(!i||Ee(s)&&Ee(l)&&!j.isValidElement(u)&&!Se(u))return null;if(j.isValidElement(u))return j.cloneElement(u,a);var h;if(Se(u)){if(h=j.createElement(u,a),j.isValidElement(h))return h}else h=Lee(a);var x=Vee(i),y=we(a,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return zee(a,h,y);var v=x?Bee(a):Uee(a);return C.createElement(Ao,Tc({className:Re("recharts-label",d)},y,v,{breakAll:p}),h)}nr.displayName="Label";var AT=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,p=t.y,h=t.top,x=t.left,y=t.width,v=t.height,g=t.clockWise,m=t.labelViewBox;if(m)return m;if(re(y)&&re(v)){if(re(d)&&re(p))return{x:d,y:p,width:y,height:v};if(re(h)&&re(x))return{x:h,y:x,width:y,height:v}}return re(d)&&re(p)?{x:d,y:p,width:0,height:0}:re(r)&&re(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:g}:t.viewBox?t.viewBox:{}},Wee=function(t,r){return t?t===!0?C.createElement(nr,{key:"label-implicit",viewBox:r}):Kt(t)?C.createElement(nr,{key:"label-implicit",viewBox:r,value:t}):j.isValidElement(t)?t.type===nr?j.cloneElement(t,{key:"label-implicit",viewBox:r}):C.createElement(nr,{key:"label-implicit",content:t,viewBox:r}):Se(t)?C.createElement(nr,{key:"label-implicit",content:t,viewBox:r}):Sl(t)?C.createElement(nr,Tc({viewBox:r},t,{key:"label-implicit"})):null:null},Hee=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=AT(t),o=Zr(a,nr).map(function(l,u){return j.cloneElement(l,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var s=Wee(t.label,r||i);return[s].concat(Eee(o))};nr.parseViewBox=AT;nr.renderCallByParent=Hee;function Gee(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var qee=Gee;const Kee=nt(qee);function $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}var Xee=["valueAccessor"],Yee=["data","dataKey","clockWise","id","textBreakAll"];function Zee(e){return tte(e)||ete(e)||Jee(e)||Qee()}function Qee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jee(e,t){if(e){if(typeof e=="string")return _0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _0(e,t)}}function ete(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tte(e){if(Array.isArray(e))return _0(e)}function _0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ite(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ote=function(t){return Array.isArray(t.value)?Kee(t.value):t.value};function ta(e){var t=e.valueAccessor,r=t===void 0?ote:t,n=PO(e,Xee),a=n.data,i=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=PO(n,Yee);return!a||!a.length?null:C.createElement(We,{className:"recharts-label-list"},a.map(function(f,d){var p=Ee(i)?r(f,d):It(f&&f.payload,i),h=Ee(s)?{}:{id:"".concat(s,"-").concat(d)};return C.createElement(nr,Up({},we(f,!0),u,h,{parentViewBox:f.parentViewBox,value:p,textBreakAll:l,viewBox:nr.parseViewBox(Ee(o)?f:EO(EO({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}ta.displayName="LabelList";function ste(e,t){return e?e===!0?C.createElement(ta,{key:"labelList-implicit",data:t}):C.isValidElement(e)||Se(e)?C.createElement(ta,{key:"labelList-implicit",data:t,content:e}):Sl(e)?C.createElement(ta,Up({data:t},e,{key:"labelList-implicit"})):null:null}function lte(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=Zr(n,ta).map(function(o,s){return j.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return a;var i=ste(e.label,t);return[i].concat(Zee(a))}ta.renderCallByParent=lte;function Ic(e){"@babel/helpers - typeof";return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(e)}function S0(){return S0=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, + `).concat(d.x,",").concat(d.y,` + `);if(a>0){var h=mt(r,n,a,o),x=mt(r,n,a,u);p+="L ".concat(x.x,",").concat(x.y,` + A `).concat(a,",").concat(a,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, + `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},pte=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=jr(f-u),p=Qd({cx:r,cy:n,radius:i,angle:u,sign:d,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,x=p.lineTangency,y=p.theta,v=Qd({cx:r,cy:n,radius:i,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:l}),g=v.circleTangency,m=v.lineTangency,w=v.theta,S=l?Math.abs(u-f):Math.abs(u-f)-y-w;if(S<0)return s?"M ".concat(x.x,",").concat(x.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):ET({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:f});var b="M ".concat(x.x,",").concat(x.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(h.x,",").concat(h.y,` + A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,` + `);if(a>0){var _=Qd({cx:r,cy:n,radius:a,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=_.circleTangency,k=_.lineTangency,A=_.theta,I=Qd({cx:r,cy:n,radius:a,angle:f,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),T=I.circleTangency,P=I.lineTangency,R=I.theta,M=l?Math.abs(u-f):Math.abs(u-f)-A-R;if(M<0&&o===0)return"".concat(b,"L").concat(r,",").concat(n,"Z");b+="L".concat(P.x,",").concat(P.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(T.x,",").concat(T.y,` + A`).concat(a,",").concat(a,",0,").concat(+(M>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(k.x,",").concat(k.y,"Z")}else b+="L".concat(r,",").concat(n,"Z");return b},hte={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},PT=function(t){var r=CO(CO({},hte),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,p=r.className;if(o0&&Math.abs(f-d)<360?v=pte({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,x/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:d}):v=ET({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:f,endAngle:d}),C.createElement("path",S0({},we(r,!0),{className:h,d:v,role:"img"}))};function Rc(e){"@babel/helpers - typeof";return Rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rc(e)}function j0(){return j0=Object.assign?Object.assign.bind():function(e){for(var t=1;tAte.call(e,t));function Lo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Nte="__v",Cte="__o",Tte="_owner",{getOwnPropertyDescriptor:MO,keys:DO}=Object;function $te(e,t){return e.byteLength===t.byteLength&&Vp(new Uint8Array(e),new Uint8Array(t))}function Ite(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Rte(e,t){return e.byteLength===t.byteLength&&Vp(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Mte(e,t){return Lo(e.getTime(),t.getTime())}function Dte(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Lte(e,t){return e===t}function LO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let o,s,l=0;for(;(o=i.next())&&!o.done;){const u=t.entries();let f=!1,d=0;for(;(s=u.next())&&!s.done;){if(a[d]){d++;continue}const p=o.value,h=s.value;if(r.equals(p[0],h[0],l,d,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){f=a[d]=!0;break}d++}if(!f)return!1;l++}return!0}const Fte=Lo;function zte(e,t,r){const n=DO(e);let a=n.length;if(DO(t).length!==a)return!1;for(;a-- >0;)if(!$T(e,t,r,n[a]))return!1;return!0}function Jl(e,t,r){const n=RO(e);let a=n.length;if(RO(t).length!==a)return!1;let i,o,s;for(;a-- >0;)if(i=n[a],!$T(e,t,r,i)||(o=MO(e,i),s=MO(t,i),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Bte(e,t){return Lo(e.valueOf(),t.valueOf())}function Ute(e,t){return e.source===t.source&&e.flags===t.flags}function FO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let o,s;for(;(o=i.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!a[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=a[f]=!0;break}f++}if(!u)return!1}return!0}function Vp(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function Vte(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function $T(e,t,r,n){return(n===Tte||n===Cte||n===Nte)&&(e.$$typeof||t.$$typeof)?!0:Pte(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const Wte="[object ArrayBuffer]",Hte="[object Arguments]",Gte="[object Boolean]",qte="[object DataView]",Kte="[object Date]",Xte="[object Error]",Yte="[object Map]",Zte="[object Number]",Qte="[object Object]",Jte="[object RegExp]",ere="[object Set]",tre="[object String]",rre={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},nre="[object URL]",are=Object.prototype.toString;function ire({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:x}){return function(v,g,m){if(v===g)return!0;if(v==null||g==null)return!1;const w=typeof v;if(w!==typeof g)return!1;if(w!=="object")return w==="number"?s(v,g,m):w==="function"?i(v,g,m):!1;const S=v.constructor;if(S!==g.constructor)return!1;if(S===Object)return l(v,g,m);if(Array.isArray(v))return t(v,g,m);if(S===Date)return n(v,g,m);if(S===RegExp)return f(v,g,m);if(S===Map)return o(v,g,m);if(S===Set)return d(v,g,m);const b=are.call(v);if(b===Kte)return n(v,g,m);if(b===Jte)return f(v,g,m);if(b===Yte)return o(v,g,m);if(b===ere)return d(v,g,m);if(b===Qte)return typeof v.then!="function"&&typeof g.then!="function"&&l(v,g,m);if(b===nre)return h(v,g,m);if(b===Xte)return a(v,g,m);if(b===Hte)return l(v,g,m);if(rre[b])return p(v,g,m);if(b===Wte)return e(v,g,m);if(b===qte)return r(v,g,m);if(b===Gte||b===Zte||b===tre)return u(v,g,m);if(x){let _=x[b];if(!_){const O=Ete(v);O&&(_=x[O])}if(_)return _(v,g,m)}return!1}}function ore({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:$te,areArraysEqual:r?Jl:Ite,areDataViewsEqual:Rte,areDatesEqual:Mte,areErrorsEqual:Dte,areFunctionsEqual:Lte,areMapsEqual:r?Zy(LO,Jl):LO,areNumbersEqual:Fte,areObjectsEqual:r?Jl:zte,arePrimitiveWrappersEqual:Bte,areRegExpsEqual:Ute,areSetsEqual:r?Zy(FO,Jl):FO,areTypedArraysEqual:r?Zy(Vp,Jl):Vp,areUrlsEqual:Vte,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=ef(n.areArraysEqual),i=ef(n.areMapsEqual),o=ef(n.areObjectsEqual),s=ef(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:s})}return n}function sre(e){return function(t,r,n,a,i,o,s){return e(t,r,s)}}function lre({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:a})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(s,l){return t(s,l,i)}}const ure=Di();Di({strict:!0});Di({circular:!0});Di({circular:!0,strict:!0});Di({createInternalComparator:()=>Lo});Di({strict:!0,createInternalComparator:()=>Lo});Di({circular:!0,createInternalComparator:()=>Lo});Di({circular:!0,createInternalComparator:()=>Lo,strict:!0});function Di(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=ore(e),o=ire(i),s=r?r(o):sre(o);return lre({circular:t,comparator:o,createState:n,equals:s,strict:a})}function cre(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function zO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):cre(a)};requestAnimationFrame(n)}function O0(e){"@babel/helpers - typeof";return O0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O0(e)}function dre(e){return mre(e)||hre(e)||pre(e)||fre()}function fre(){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 pre(e,t){if(e){if(typeof e=="string")return BO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BO(e,t)}}function BO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:g<0?0:g},y=function(g){for(var m=g>1?1:g,w=m,S=0;S<8;++S){var b=d(w)-m,_=h(w);if(Math.abs(b-m)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,s=o===void 0?17:o,l=function(f,d,p){var h=-(f-d)*n,x=p*i,y=p+(h-x)*s/1e3,v=p*s/1e3+f;return Math.abs(v-d)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gre(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function Qy(e){return Yre(e)||Xre(e)||Kre(e)||qre()}function qre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kre(e,t){if(e){if(typeof e=="string")return N0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N0(e,t)}}function Xre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yre(e){if(Array.isArray(e))return N0(e)}function N0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gp(e){return Gp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gp(e)}var Bn=function(e){tne(r,e);var t=rne(r);function r(n,a){var i;Zre(this,r),i=t.call(this,n,a);var o=i.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,d=o.steps,p=o.children,h=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind($0(i)),i.changeStyle=i.changeStyle.bind($0(i)),!s||h<=0)return i.state={style:{}},typeof p=="function"&&(i.state={style:f}),T0(i);if(d&&d.length)i.state={style:d[0].style};else if(u){if(typeof p=="function")return i.state={style:u},T0(i);i.state={style:l?hu({},l,u):u}}else i.state={style:{}};return i}return Jre(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,s=i.canBegin,l=i.attributeName,u=i.shouldReAnimate,f=i.to,d=i.from,p=this.state.style;if(s){if(!o){var h={style:l?hu({},l,f):f};this.state&&p&&(l&&p[l]!==f||!l&&p!==f)&&this.setState(h);return}if(!(ure(a.to,f)&&a.canBegin&&a.isActive)){var x=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=x||u?d:a.to;if(this.state&&p){var v={style:l?hu({},l,y):y};(l&&p[l]!==y||!l&&p!==y)&&this.setState(v)}this.runAnimation(An(An({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,s=a.to,l=a.duration,u=a.easing,f=a.begin,d=a.onAnimationEnd,p=a.onAnimationStart,h=Vre(o,s,Tre(u),l,this.changeStyle),x=function(){i.stopJSAnimation=h()};this.manager.start([p,f,x,l,d])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,s=a.begin,l=a.onAnimationStart,u=o[0],f=u.style,d=u.duration,p=d===void 0?0:d,h=function(y,v,g){if(g===0)return y;var m=v.duration,w=v.easing,S=w===void 0?"ease":w,b=v.style,_=v.properties,O=v.onAnimationEnd,k=g>0?o[g-1]:v,A=_||Object.keys(b);if(typeof S=="function"||S==="spring")return[].concat(Qy(y),[i.runJSAnimation.bind(i,{from:k.style,to:b,duration:m,easing:S}),m]);var I=WO(A,m,S),T=An(An(An({},k.style),b),{},{transition:I});return[].concat(Qy(y),[T,m,O]).filter(bre)};return this.manager.start([l].concat(Qy(o.reduce(h,[f,Math.max(p,s)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=yre());var i=a.begin,o=a.duration,s=a.attributeName,l=a.to,u=a.easing,f=a.onAnimationStart,d=a.onAnimationEnd,p=a.steps,h=a.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(a);return}if(p.length>1){this.runStepAnimation(a);return}var y=s?hu({},s,l):l,v=WO(Object.keys(y),o,u);x.start([f,i,An(An({},y),{},{transition:v}),o,d])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var s=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var l=Hre(a,Wre),u=j.Children.count(i),f=this.state.style;if(typeof i=="function")return i(f);if(!s||u===0||o<=0)return i;var d=function(h){var x=h.props,y=x.style,v=y===void 0?{}:y,g=x.className,m=j.cloneElement(h,An(An({},l),{},{style:An(An({},v),f),className:g}));return m};return u===1?d(j.Children.only(i)):C.createElement("div",null,j.Children.map(i,function(p){return d(p)}))}}]),r}(j.PureComponent);Bn.displayName="Animate";Bn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Bn.propTypes={from:tt.oneOfType([tt.object,tt.string]),to:tt.oneOfType([tt.object,tt.string]),attributeName:tt.string,duration:tt.number,begin:tt.number,easing:tt.oneOfType([tt.string,tt.func]),steps:tt.arrayOf(tt.shape({duration:tt.number.isRequired,style:tt.object.isRequired,easing:tt.oneOfType([tt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),tt.func]),properties:tt.arrayOf("string"),onAnimationEnd:tt.func})),children:tt.oneOfType([tt.node,tt.func]),isActive:tt.bool,canBegin:tt.bool,onAnimationEnd:tt.func,shouldReAnimate:tt.bool,onAnimationStart:tt.func,onAnimationReStart:tt.func};function Lc(e){"@babel/helpers - typeof";return Lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lc(e)}function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,f;if(o>0&&i instanceof Array){for(var d=[0,0,0,0],p=0,h=4;po?o:i[p];f="M".concat(t,",").concat(r+s*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+l*d[0],",").concat(r)),f+="L ".concat(t+n-l*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, + `).concat(t+n,",").concat(r+s*d[1])),f+="L ".concat(t+n,",").concat(r+a-s*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`, + `).concat(t+n-l*d[2],",").concat(r+a)),f+="L ".concat(t+l*d[3],",").concat(r+a),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`, + `).concat(t,",").concat(r+a-s*d[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var x=Math.min(o,i);f="M ".concat(t,",").concat(r+s*x,` + A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+l*x,",").concat(r,` + L `).concat(t+n-l*x,",").concat(r,` + A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*x,` + L `).concat(t+n,",").concat(r+a-s*x,` + A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+n-l*x,",").concat(r+a,` + L `).concat(t+l*x,",").concat(r+a,` + A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t,",").concat(r+a-s*x," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return f},fne=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(i,i+s),f=Math.max(i,i+s),d=Math.min(o,o+l),p=Math.max(o,o+l);return n>=u&&n<=f&&a>=d&&a<=p}return!1},pne={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},xw=function(t){var r=QO(QO({},pne),t),n=j.useRef(),a=j.useState(-1),i=ane(a,2),o=i[0],s=i[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,d=r.height,p=r.radius,h=r.className,x=r.animationEasing,y=r.animationDuration,v=r.animationBegin,g=r.isAnimationActive,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var w=Re("recharts-rectangle",h);return m?C.createElement(Bn,{canBegin:o>0,from:{width:f,height:d,x:l,y:u},to:{width:f,height:d,x:l,y:u},duration:y,animationEasing:x,isActive:m},function(S){var b=S.width,_=S.height,O=S.x,k=S.y;return C.createElement(Bn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,isActive:g,easing:x},C.createElement("path",qp({},we(r,!0),{className:w,d:JO(O,k,b,_,p),ref:n})))}):C.createElement("path",qp({},we(r,!0),{className:w,d:JO(l,u,f,d,p)}))},hne=["points","className","baseLinePoints","connectNulls"];function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ek(e){return bne(e)||xne(e)||gne(e)||vne()}function vne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gne(e,t){if(e){if(typeof e=="string")return I0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return I0(e,t)}}function xne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bne(e){if(Array.isArray(e))return I0(e)}function I0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){tk(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),tk(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Fu=function(t,r){var n=wne(t);r&&(n=[n.reduce(function(i,o){return[].concat(ek(i),ek(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},_ne=function(t,r,n){var a=Fu(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Fu(r.reverse(),n).slice(1))},Sne=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=mne(t,hne);if(!r||!r.length)return null;var s=Re("recharts-polygon",n);if(a&&a.length){var l=o.stroke&&o.stroke!=="none",u=_ne(r,a,i);return C.createElement("g",{className:s},C.createElement("path",fs({},we(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?C.createElement("path",fs({},we(o,!0),{fill:"none",d:Fu(r,i)})):null,l?C.createElement("path",fs({},we(o,!0),{fill:"none",d:Fu(a,i)})):null)}var f=Fu(r,i);return C.createElement("path",fs({},we(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function R0(){return R0=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Nne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Cne=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},Tne=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,d=f===void 0?0:f,p=t.height,h=p===void 0?0:p,x=t.className,y=Pne(t,jne),v=One({x:n,y:i,top:s,left:u,width:d,height:h},y);return!re(n)||!re(i)||!re(d)||!re(h)||!re(s)||!re(u)?null:C.createElement("path",M0({},we(v,!0),{className:Re("recharts-cross",x),d:Cne(n,i,d,h,s,u)}))},$ne=pm,Ine=ZC,Rne=sa;function Mne(e,t){return e&&e.length?$ne(e,Rne(t),Ine):void 0}var Dne=Mne;const Lne=nt(Dne);var Fne=pm,zne=sa,Bne=QC;function Une(e,t){return e&&e.length?Fne(e,zne(t),Bne):void 0}var Vne=Une;const Wne=nt(Vne);var Hne=["cx","cy","angle","ticks","axisLine"],Gne=["ticks","tick","angle","tickFormatter","stroke"];function Js(e){"@babel/helpers - typeof";return Js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Js(e)}function zu(){return zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ik(e,t){for(var r=0;rlk?o=a==="outer"?"start":"end":i<-lk?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=Hi(Hi({},we(this.props,!1)),{},{fill:"none"},we(s,!1));if(l==="circle")return C.createElement(yd,Zi({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var f=this.props.ticks,d=f.map(function(p){return mt(a,i,o,p.coordinate)});return C.createElement(Sne,Zi({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,s=a.tickLine,l=a.tickFormatter,u=a.stroke,f=we(this.props,!1),d=we(o,!1),p=Hi(Hi({},f),{},{fill:"none"},we(s,!1)),h=i.map(function(x,y){var v=n.getTickLineCoord(x),g=n.getTickTextAnchor(x),m=Hi(Hi(Hi({textAnchor:g},f),{},{stroke:"none",fill:u},d),{},{index:y,payload:x,x:v.x2,y:v.y2});return C.createElement(We,Zi({className:Re("recharts-polar-angle-axis-tick",kT(o)),key:"tick-".concat(x.coordinate)},ko(n.props,x,y)),s&&C.createElement("line",Zi({className:"recharts-polar-angle-axis-tick-line"},p,v)),o&&t.renderTickItem(o,m,l?l(x.value,y):x.value))});return C.createElement(We,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:C.createElement(We,{className:Re("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return C.isValidElement(n)?o=C.cloneElement(n,a):Se(n)?o=n(a):o=C.createElement(Ao,Zi({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(j.PureComponent);xm(bm,"displayName","PolarAngleAxis");xm(bm,"axisType","angleAxis");xm(bm,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var uae=KN,cae=uae(Object.getPrototypeOf,Object),dae=cae,fae=Ba,pae=dae,hae=Ua,mae="[object Object]",yae=Function.prototype,vae=Object.prototype,WT=yae.toString,gae=vae.hasOwnProperty,xae=WT.call(Object);function bae(e){if(!hae(e)||fae(e)!=mae)return!1;var t=pae(e);if(t===null)return!0;var r=gae.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&WT.call(r)==xae}var wae=bae;const _ae=nt(wae);var Sae=Ba,jae=Ua,Oae="[object Boolean]";function kae(e){return e===!0||e===!1||jae(e)&&Sae(e)==Oae}var Aae=kae;const Eae=nt(Aae);function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:f,lowerWidth:d,height:p,x:l,y:u},duration:y,animationEasing:x,isActive:g},function(w){var S=w.upperWidth,b=w.lowerWidth,_=w.height,O=w.x,k=w.y;return C.createElement(Bn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,easing:x},C.createElement("path",Yp({},we(r,!0),{className:m,d:fk(O,k,S,b,_),ref:n})))}):C.createElement("g",null,C.createElement("path",Yp({},we(r,!0),{className:m,d:fk(l,u,f,d,p)})))},Fae=["option","shapeType","propTransformer","activeClassName","isActive"];function Bc(e){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bc(e)}function zae(e,t){if(e==null)return{};var r=Bae(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Zp(e){for(var t=1;t0?Yr(w,"paddingAngle",0):0;if(b){var O=Gt(b.endAngle-b.startAngle,w.endAngle-w.startAngle),k=ft(ft({},w),{},{startAngle:m+_,endAngle:m+O(y)+_});v.push(k),m=k.endAngle}else{var A=w.endAngle,I=w.startAngle,T=Gt(0,A-I),P=T(y),R=ft(ft({},w),{},{startAngle:m+_,endAngle:m+P+_});v.push(R),m=R.endAngle}}),C.createElement(We,null,n.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Eo(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,s=a.className,l=a.label,u=a.cx,f=a.cy,d=a.innerRadius,p=a.outerRadius,h=a.isAnimationActive,x=this.state.isAnimationFinished;if(i||!o||!o.length||!re(u)||!re(f)||!re(d)||!re(p))return null;var y=Re("recharts-pie",s);return C.createElement(We,{tabIndex:this.props.rootTabIndex,className:y,ref:function(g){n.pieRef=g}},this.renderSectors(),l&&this.renderLabels(o),nr.renderCallByParent(this.props,null,!1),(!h||x)&&ta.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n=360?m:m-1)*l,S=v-m*h-w,b=a.reduce(function(k,A){var I=It(A,g,0);return k+(re(I)?I:0)},0),_;if(b>0){var O;_=a.map(function(k,A){var I=It(k,g,0),T=It(k,f,A),P=(re(I)?I:0)/b,R;A?R=O.endAngle+jr(y)*l*(I!==0?1:0):R=o;var M=R+jr(y)*((I!==0?h:0)+P*S),F=(R+M)/2,W=(x.innerRadius+x.outerRadius)/2,V=[{name:T,value:I,payload:k,dataKey:g,type:p}],L=mt(x.cx,x.cy,W,F);return O=ft(ft(ft({percent:P,cornerRadius:i,name:T,tooltipPayload:V,midAngle:F,middleRadius:W,tooltipPosition:L},k),x),{},{value:It(k,g),startAngle:R,endAngle:M,payload:k,paddingAngle:jr(y)*l}),O})}return ft(ft({},x),{},{sectors:_,data:a})});var lie=Math.ceil,uie=Math.max;function cie(e,t,r,n){for(var a=-1,i=uie(lie((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=e,e+=r;return o}var die=cie,fie=pC,vk=1/0,pie=17976931348623157e292;function hie(e){if(!e)return e===0?e:0;if(e=fie(e),e===vk||e===-vk){var t=e<0?-1:1;return t*pie}return e===e?e:0}var KT=hie,mie=die,yie=om,Jy=KT;function vie(e){return function(t,r,n){return n&&typeof n!="number"&&yie(t,r,n)&&(r=n=void 0),t=Jy(t),r===void 0?(r=t,t=0):r=Jy(r),n=n===void 0?t0&&n.handleDrag(a.changedTouches[0])}),Vr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,s=a.startIndex;o==null||o({endIndex:i,startIndex:s})}),n.detachDragEndListener()}),Vr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Vr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Vr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Vr(n,"handleSlideDragStart",function(a){var i=_k(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Cie(t,e),Aie(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,d=Math.min(a,i),p=Math.max(a,i),h=t.getIndexInRange(o,d),x=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:x===f?f:x-x%l}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,s=a.dataKey,l=It(i[n],s,n);return Se(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,s=a.endX,l=this.props,u=l.x,f=l.width,d=l.travellerWidth,p=l.startIndex,h=l.endIndex,x=l.onChange,y=n.pageX-i;y>0?y=Math.min(y,u+f-d-s,u+f-d-o):y<0&&(y=Math.max(y,u-o,u-s));var v=this.getIndex({startX:o+y,endX:s+y});(v.startIndex!==p||v.endIndex!==h)&&x&&x(v),this.setState({startX:o+y,endX:s+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=_k(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,s=a.endX,l=a.startX,u=this.state[o],f=this.props,d=f.x,p=f.width,h=f.travellerWidth,x=f.onChange,y=f.gap,v=f.data,g={startX:this.state.startX,endX:this.state.endX},m=n.pageX-i;m>0?m=Math.min(m,d+p-h-u):m<0&&(m=Math.max(m,d-u)),g[o]=u+m;var w=this.getIndex(g),S=w.startIndex,b=w.endIndex,_=function(){var k=v.length-1;return o==="startX"&&(s>l?S%y===0:b%y===0)||sl?b%y===0:S%y===0)||s>l&&b===k};this.setState(Vr(Vr({},o,u+m),"brushMoveStartX",n.pageX),function(){x&&_()&&x(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[a],d=s.indexOf(f);if(d!==-1){var p=d+n;if(!(p===-1||p>=s.length)){var h=s[p];a==="startX"&&h>=u||a==="endX"&&h<=l||this.setState(Vr({},a,h),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return C.createElement("rect",{stroke:u,fill:l,x:a,y:i,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,d=j.Children.only(u);return d?C.cloneElement(d,{x:a,y:i,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,d=l.height,p=l.traveller,h=l.ariaLabel,x=l.data,y=l.startIndex,v=l.endIndex,g=Math.max(n,this.props.x),m=ev(ev({},we(this.props,!1)),{},{x:g,y:u,width:f,height:d}),w=h||"Min value: ".concat((i=x[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=x[v])===null||o===void 0?void 0:o.name);return C.createElement(We,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(b){["ArrowLeft","ArrowRight"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),s.handleTravellerMoveKeyboard(b.key==="ArrowRight"?1:-1,a))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,m))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,s=i.height,l=i.stroke,u=i.travellerWidth,f=Math.min(n,a)+u,d=Math.max(Math.abs(a-n)-u,0);return C.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:d,height:s})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,p=f.endX,h=5,x={pointerEvents:"none",fill:u};return C.createElement(We,{className:"recharts-brush-texts"},C.createElement(Ao,eh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-h,y:o+s/2},x),this.getTextOfTick(a)),C.createElement(Ao,eh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+l+h,y:o+s/2},x),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,d=n.alwaysShowText,p=this.state,h=p.startX,x=p.endX,y=p.isTextActive,v=p.isSlideMoving,g=p.isTravellerMoving,m=p.isTravellerFocused;if(!a||!a.length||!re(s)||!re(l)||!re(u)||!re(f)||u<=0||f<=0)return null;var w=Re("recharts-brush",i),S=C.Children.count(o)===1,b=Oie("userSelect","none");return C.createElement(We,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,x),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(x,"endX"),(y||v||g||m||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(i+s/2)-1;return C.createElement(C.Fragment,null,C.createElement("rect",{x:a,y:i,width:o,height:s,fill:l,stroke:"none"}),C.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),C.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return C.isValidElement(n)?i=C.cloneElement(n,a):Se(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return ev({prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},i&&i.length?$ie({data:i,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||s!==a.prevX||l!==a.prevTravellerWidth)){a.scale.range([s,s+o-l]);var p=a.scale.domain().map(function(h){return a.scale(h)});return{prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,s=i-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>a?s=l:o=l}return a>=n[s]?s:o}}])}(j.PureComponent);Vr(nl,"displayName","Brush");Vr(nl,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Iie=Hb;function Rie(e,t){var r;return Iie(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var Mie=Rie,Die=zN,Lie=sa,Fie=Mie,zie=Br,Bie=om;function Uie(e,t,r){var n=zie(e)?Die:Fie;return r&&Bie(e,t,r)&&(t=void 0),n(e,Lie(t))}var Vie=Uie;const Wie=nt(Vie);var ra=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},Sk=lC;function Hie(e,t,r){t=="__proto__"&&Sk?Sk(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Gie=Hie,qie=Gie,Kie=oC,Xie=sa;function Yie(e,t){var r={};return t=Xie(t),Kie(e,function(n,a,i){qie(r,a,t(n,a,i))}),r}var Zie=Yie;const Qie=nt(Zie);function Jie(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function voe(e,t){var r=e.x,n=e.y,a=moe(e,doe),i="".concat(r),o=parseInt(i,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||a.height),f=parseInt(u,10),d="".concat(t.width||a.width),p=parseInt(d,10);return eu(eu(eu(eu(eu({},t),a),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:p,name:t.name,radius:t.radius})}function Ok(e){return C.createElement(HT,B0({shapeType:"rectangle",propTransformer:voe,activeClassName:"recharts-active-bar"},e))}var goe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=re(n)||zz(n);return i?t(n,a):(i||No(),r)}},xoe=["value","background"],JT;function al(e){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},al(e)}function boe(e,t){if(e==null)return{};var r=woe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function woe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function rh(){return rh=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(F)0&&Math.abs(M)0&&(R=Math.min((Q||0)-(M[be-1]||0),R))}),Number.isFinite(R)){var F=R/P,W=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(O=F*W/2),y.padding==="no-gap"){var V=Or(t.barCategoryGap,F*W),L=F*W/2;O=L-V-(L-V)/W*V}}}a==="xAxis"?k=[n.left+(w.left||0)+(O||0),n.left+n.width-(w.right||0)-(O||0)]:a==="yAxis"?k=l==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(O||0),n.top+n.height-(w.bottom||0)-(O||0)]:k=y.range,b&&(k=[k[1],k[0]]);var U=xT(y,i,p),q=U.scale,J=U.realScaleType;q.domain(g).range(k),bT(q);var K=wT(q,Cn(Cn({},y),{},{realScaleType:J}));a==="xAxis"?(T=v==="top"&&!S||v==="bottom"&&S,A=n.left,I=d[_]-T*y.height):a==="yAxis"&&(T=v==="left"&&!S||v==="right"&&S,A=d[_]-T*y.width,I=n.top);var ae=Cn(Cn(Cn({},y),K),{},{realScaleType:J,x:A,y:I,scale:q,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return ae.bandSize=zp(ae,K),!y.hide&&a==="xAxis"?d[_]+=(T?-1:1)*ae.height:y.hide||(d[_]+=(T?-1:1)*ae.width),Cn(Cn({},h),{},Sm({},x,ae))},{})},n$=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},Toe=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return n$({x:r,y:n},{x:a,y:i})},a$=function(){function e(t){Poe(this,e),this.scale=t}return Noe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(a){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();Sm(a$,"EPS",1e-4);var ww=function(t){var r=Object.keys(t).reduce(function(n,a){return Cn(Cn({},n),{},Sm({},a,a$.create(t[a])))},{});return Cn(Cn({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,s=i.position;return Qie(a,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(a){return QT(a,function(i,o){return r[o].isInRange(i)})}})};function $oe(e){return(e%180+180)%180}var Ioe=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=$oe(a),o=i*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?a[i?t[o]:o]:void 0}}var Foe=Loe,zoe=KT;function Boe(e){var t=zoe(e),r=t%1;return t===t?r?t-r:t:0}var Uoe=Boe,Voe=eC,Woe=sa,Hoe=Uoe,Goe=Math.max;function qoe(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Hoe(r);return a<0&&(a=Goe(n+a,0)),Voe(e,Woe(t),a)}var Koe=qoe,Xoe=Foe,Yoe=Koe,Zoe=Xoe(Yoe),Qoe=Zoe;const Joe=nt(Qoe);var ese=GF(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),_w=j.createContext(void 0),Sw=j.createContext(void 0),i$=j.createContext(void 0),o$=j.createContext({}),s$=j.createContext(void 0),l$=j.createContext(0),u$=j.createContext(0),Nk=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,f=ese(i);return C.createElement(_w.Provider,{value:n},C.createElement(Sw.Provider,{value:a},C.createElement(o$.Provider,{value:i},C.createElement(i$.Provider,{value:f},C.createElement(s$.Provider,{value:o},C.createElement(l$.Provider,{value:u},C.createElement(u$.Provider,{value:l},s)))))))},tse=function(){return j.useContext(s$)},c$=function(t){var r=j.useContext(_w);r==null&&No();var n=r[t];return n==null&&No(),n},rse=function(){var t=j.useContext(_w);return oi(t)},nse=function(){var t=j.useContext(Sw),r=Joe(t,function(n){return QT(n.domain,Number.isFinite)});return r||oi(t)},d$=function(t){var r=j.useContext(Sw);r==null&&No();var n=r[t];return n==null&&No(),n},ase=function(){var t=j.useContext(i$);return t},ise=function(){return j.useContext(o$)},jw=function(){return j.useContext(u$)},Ow=function(){return j.useContext(l$)};function il(e){"@babel/helpers - typeof";return il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},il(e)}function ose(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sse(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Use(e,t){return g$(e,t+1)}function Vse(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,d=function(){var x=n==null?void 0:n[l];if(x===void 0)return{v:g$(n,u)};var y=l,v,g=function(){return v===void 0&&(v=r(x,y)),v},m=x.coordinate,w=l===0||sh(e,m,g,f,s);w||(l=0,f=o,u+=1),w&&(f=m+e*(g()/2+a),l+=u)},p;u<=i.length;)if(p=d(),p)return p.v;return[]}function Gc(e){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gc(e)}function Lk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t0?h.coordinate-v*e:h.coordinate})}else i[p]=h=hr(hr({},h),{},{tickCoord:h.coordinate});var g=sh(e,h.tickCoord,y,s,l);g&&(l=h.tickCoord-e*(y()/2+a),i[p]=hr(hr({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return i}function Kse(e,t,r,n,a,i){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(i){var f=n[s-1],d=r(f,s-1),p=e*(f.coordinate+e*d/2-u);o[s-1]=f=hr(hr({},f),{},{tickCoord:p>0?f.coordinate-p*e:f.coordinate});var h=sh(e,f.tickCoord,function(){return d},l,u);h&&(u=f.tickCoord-e*(d/2+a),o[s-1]=hr(hr({},f),{},{isShow:!0}))}for(var x=i?s-1:s,y=function(m){var w=o[m],S,b=function(){return S===void 0&&(S=r(w,m)),S};if(m===0){var _=e*(w.coordinate-e*b()/2-l);o[m]=w=hr(hr({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else o[m]=w=hr(hr({},w),{},{tickCoord:w.coordinate});var O=sh(e,w.tickCoord,b,l,u);O&&(l=w.tickCoord+e*(b()/2+a),o[m]=hr(hr({},w),{},{isShow:!0}))},v=0;v=2?jr(a[1].coordinate-a[0].coordinate):1,g=Bse(i,v,h);return l==="equidistantPreserveStart"?Vse(v,g,y,a,o):(l==="preserveStart"||l==="preserveStartEnd"?p=Kse(v,g,y,a,o,l==="preserveStartEnd"):p=qse(v,g,y,a,o),p.filter(function(m){return m.isShow}))}var Xse=["viewBox"],Yse=["viewBox"],Zse=["ticks"];function ll(e){"@babel/helpers - typeof";return ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ll(e)}function hs(){return hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qse(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Jse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zk(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!x||!x.length?null:C.createElement(We,{className:Re("recharts-cartesian-axis",u),ref:function(v){n.layerReference=v}},i&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),nr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,s=Re(a.className,"recharts-cartesian-axis-tick-value");return C.isValidElement(n)?o=C.cloneElement(n,Ut(Ut({},a),{},{className:s})):Se(n)?o=n(Ut(Ut({},a),{},{className:s})):o=C.createElement(Ao,hs({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(j.Component);Pw(Il,"displayName","CartesianAxis");Pw(Il,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var ole=["x1","y1","x2","y2","key"],sle=["offset"];function Co(e){"@babel/helpers - typeof";return Co=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Co(e)}function Bk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var fle=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,s=t.height,l=t.ry;return C.createElement("rect",{x:a,y:i,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function w$(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(Se(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,s=t.key,l=Uk(t,ole),u=we(l,!1);u.offset;var f=Uk(u,sle);r=C.createElement("line",oo({},f,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:s}))}return r}function ple(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=gr(gr({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return w$(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function hle(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=gr(gr({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return w$(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function mle(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var f=s.map(function(p){return Math.round(p+a-a)}).sort(function(p,h){return p-h});a!==f[0]&&f.unshift(0);var d=f.map(function(p,h){var x=!f[h+1],y=x?a+o-p:f[h+1]-p;if(y<=0)return null;var v=h%t.length;return C.createElement("rect",{key:"react-".concat(h),y:p,x:n,height:y,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function yle(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(p){return Math.round(p+i-i)}).sort(function(p,h){return p-h});i!==f[0]&&f.unshift(0);var d=f.map(function(p,h){var x=!f[h+1],y=x?i+s-p:f[h+1]-p;if(y<=0)return null;var v=h%n.length;return C.createElement("rect",{key:"react-".concat(h),x:p,y:o,width:y,height:l,stroke:"none",fill:n[v],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var vle=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return gT(Ew(gr(gr(gr({},Il.defaultProps),n),{},{ticks:ja(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},gle=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return gT(Ew(gr(gr(gr({},Il.defaultProps),n),{},{ticks:ja(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Go={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Y0(e){var t,r,n,a,i,o,s=jw(),l=Ow(),u=ise(),f=gr(gr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Go.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Go.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Go.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Go.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Go.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Go.verticalFill,x:re(e.x)?e.x:u.left,y:re(e.y)?e.y:u.top,width:re(e.width)?e.width:u.width,height:re(e.height)?e.height:u.height}),d=f.x,p=f.y,h=f.width,x=f.height,y=f.syncWithTicks,v=f.horizontalValues,g=f.verticalValues,m=rse(),w=nse();if(!re(h)||h<=0||!re(x)||x<=0||!re(d)||d!==+d||!re(p)||p!==+p)return null;var S=f.verticalCoordinatesGenerator||vle,b=f.horizontalCoordinatesGenerator||gle,_=f.horizontalPoints,O=f.verticalPoints;if((!_||!_.length)&&Se(b)){var k=v&&v.length,A=b({yAxis:w?gr(gr({},w),{},{ticks:k?v:w.ticks}):void 0,width:s,height:l,offset:u},k?!0:y);Ln(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Co(A),"]")),Array.isArray(A)&&(_=A)}if((!O||!O.length)&&Se(S)){var I=g&&g.length,T=S({xAxis:m?gr(gr({},m),{},{ticks:I?g:m.ticks}):void 0,width:s,height:l,offset:u},I?!0:y);Ln(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Co(T),"]")),Array.isArray(T)&&(O=T)}return C.createElement("g",{className:"recharts-cartesian-grid"},C.createElement(fle,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),C.createElement(ple,oo({},f,{offset:u,horizontalPoints:_,xAxis:m,yAxis:w})),C.createElement(hle,oo({},f,{offset:u,verticalPoints:O,xAxis:m,yAxis:w})),C.createElement(mle,oo({},f,{horizontalPoints:_})),C.createElement(yle,oo({},f,{verticalPoints:O})))}Y0.displayName="CartesianGrid";var xle=["type","layout","connectNulls","ref"],ble=["key"];function ul(e){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ul(e)}function Vk(e,t){if(e==null)return{};var r=wle(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Bu(){return Bu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rd){h=[].concat(qo(l.slice(0,x)),[d-y]);break}var v=h.length%2===0?[0,p]:[p];return[].concat(qo(t.repeat(l,f)),qo(h),v).map(function(g){return"".concat(g,"px")}).join(", ")}),Tn(r,"id",Ro("recharts-line-")),Tn(r,"pathRef",function(o){r.mainCurve=o}),Tn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Tn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Cle(t,e),Ale(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,s=i.xAxis,l=i.yAxis,u=i.layout,f=i.children,d=Zr(f,md);if(!d)return null;var p=function(y,v){return{x:y.x,y:y.y,value:y.value,errorVal:It(y.payload,v)}},h={clipPath:n?"url(#clipPath-".concat(a,")"):null};return C.createElement(We,h,d.map(function(x){return C.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:p})}))}},{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,d=we(this.props,!1),p=we(l,!0),h=u.map(function(y,v){var g=Ur(Ur(Ur({key:"dot-".concat(v),r:3},d),p),{},{index:v,cx:y.x,cy:y.y,value:y.value,dataKey:f,payload:y.payload,points:u});return t.renderDotItem(l,g)}),x={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return C.createElement(We,Bu({className:"recharts-line-dots",key:"dots"},x),h)}},{key:"renderCurveStatically",value:function(n,a,i,o){var s=this.props,l=s.type,u=s.layout,f=s.connectNulls;s.ref;var d=Vk(s,xle),p=Ur(Ur(Ur({},we(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:f});return C.createElement(mo,Bu({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,p=o.animationEasing,h=o.animationId,x=o.animateNewValues,y=o.width,v=o.height,g=this.state,m=g.prevPoints,w=g.totalLength;return C.createElement(Bn,{begin:f,duration:d,isActive:u,easing:p,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var b=S.t;if(m){var _=m.length/s.length,O=s.map(function(P,R){var M=Math.floor(R*_);if(m[M]){var F=m[M],W=Gt(F.x,P.x),V=Gt(F.y,P.y);return Ur(Ur({},P),{},{x:W(b),y:V(b)})}if(x){var L=Gt(y*2,P.x),U=Gt(v/2,P.y);return Ur(Ur({},P),{},{x:L(b),y:U(b)})}return Ur(Ur({},P),{},{x:P.x,y:P.y})});return i.renderCurveStatically(O,n,a)}var k=Gt(0,w),A=k(b),I;if(l){var T="".concat(l).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});I=i.getStrokeDasharray(A,w,T)}else I=i.generateSimpleStrokeDasharray(w,A);return i.renderCurveStatically(s,n,a,{strokeDasharray:I})})}},{key:"renderCurve",value:function(n,a){var i=this.props,o=i.points,s=i.isAnimationActive,l=this.state,u=l.prevPoints,f=l.totalLength;return s&&o&&o.length&&(!u&&f>0||!Eo(u,o))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(o,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.xAxis,f=a.yAxis,d=a.top,p=a.left,h=a.width,x=a.height,y=a.isAnimationActive,v=a.id;if(i||!s||!s.length)return null;var g=this.state.isAnimationFinished,m=s.length===1,w=Re("recharts-line",l),S=u&&u.allowDataOverflow,b=f&&f.allowDataOverflow,_=S||b,O=Ee(v)?this.id:v,k=(n=we(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=k.r,I=A===void 0?3:A,T=k.strokeWidth,P=T===void 0?2:T,R=dN(o)?o:{},M=R.clipDot,F=M===void 0?!0:M,W=I*2+P;return C.createElement(We,{className:w},S||b?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(O)},C.createElement("rect",{x:S?p:p-h/2,y:b?d:d-x/2,width:S?h:h*2,height:b?x:x*2})),!F&&C.createElement("clipPath",{id:"clipPath-dots-".concat(O)},C.createElement("rect",{x:p-W/2,y:d-W/2,width:h+W,height:x+W}))):null,!m&&this.renderCurve(_,O),this.renderErrorBar(_,O),(m||o)&&this.renderDots(_,F,O),(!y||g)&&ta.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(qo(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Rle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Eo(f,o)||!Eo(d,s))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(o,s,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.top,f=a.left,d=a.xAxis,p=a.yAxis,h=a.width,x=a.height,y=a.isAnimationActive,v=a.id;if(i||!s||!s.length)return null;var g=this.state.isAnimationFinished,m=s.length===1,w=Re("recharts-area",l),S=d&&d.allowDataOverflow,b=p&&p.allowDataOverflow,_=S||b,O=Ee(v)?this.id:v,k=(n=we(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=k.r,I=A===void 0?3:A,T=k.strokeWidth,P=T===void 0?2:T,R=dN(o)?o:{},M=R.clipDot,F=M===void 0?!0:M,W=I*2+P;return C.createElement(We,{className:w},S||b?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(O)},C.createElement("rect",{x:S?f:f-h/2,y:b?u:u-x/2,width:S?h:h*2,height:b?x:x*2})),!F&&C.createElement("clipPath",{id:"clipPath-dots-".concat(O)},C.createElement("rect",{x:f-W/2,y:u-W/2,width:h+W,height:x+W}))):null,m?null:this.renderArea(_,O),(o||m)&&this.renderDots(_,F,O),(!y||g)&&ta.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(j.PureComponent);j$=Li;Xn(Li,"displayName","Area");Xn(Li,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Ii.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Xn(Li,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,o=t.props.baseValue,s=o??i;if(re(s)&&typeof s=="number")return s;var l=a==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return s==="dataMin"?d:s==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});Xn(Li,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,p=e.offset,h=t.layout,x=u&&u.length,y=j$.getBaseValue(t,r,n,a),v=h==="horizontal",g=!1,m=d.map(function(S,b){var _;x?_=u[f+b]:(_=It(S,l),Array.isArray(_)?g=!0:_=[y,_]);var O=_[1]==null||x&&It(S,l)==null;return v?{x:Fp({axis:n,ticks:i,bandSize:s,entry:S,index:b}),y:O?null:a.scale(_[1]),value:_,payload:S}:{x:O?null:n.scale(_[1]),y:Fp({axis:a,ticks:o,bandSize:s,entry:S,index:b}),value:_,payload:S}}),w;return x||g?w=m.map(function(S){var b=Array.isArray(S.value)?S.value[0]:null;return v?{x:S.x,y:b!=null&&S.y!=null?a.scale(b):null}:{x:b!=null?n.scale(b):null,y:S.y}}):w=v?a.scale(y):n.scale(y),Za({points:m,baseLine:w,layout:h,isRange:g},p)});Xn(Li,"renderDotItem",function(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(Se(e))r=e(t);else{var n=Re("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=O$(t,Ile);r=C.createElement(yd,so({},i,{key:a,className:n}))}return r});function dl(e){"@babel/helpers - typeof";return dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(e)}function Vle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wle(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Nue(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Cue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tue(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&re(a)&&re(i)?t.slice(a,i+1):[]};function B$(e){return e==="number"?[0,"auto"]:void 0}var lx=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,s=Em(r,t);return n<0||!i||!i.length||n>=s.length?null:i.reduce(function(l,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=d===void 0?s:d;p=cp(h,o.dataKey,a)}else p=d&&d[n]||s[n];return p?[].concat(hl(l),[ST(u,p)]):l},[])},Jk=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=Wue(i,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=QJ(o,s,u,l);if(f>=0&&u){var d=u[f]&&u[f].value,p=lx(t,r,f,d),h=Hue(n,s,f,i);return{activeTooltipIndex:f,activeLabel:d,activePayload:p,activeCoordinate:h}}return null},Gue=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,p=t.stackOffset,h=vT(f,i);return n.reduce(function(x,y){var v,g=y.type.defaultProps!==void 0?Y(Y({},y.type.defaultProps),y.props):y.props,m=g.type,w=g.dataKey,S=g.allowDataOverflow,b=g.allowDuplicatedCategory,_=g.scale,O=g.ticks,k=g.includeHidden,A=g[o];if(x[A])return x;var I=Em(t.data,{graphicalItems:a.filter(function(K){var ae,Q=o in K.props?K.props[o]:(ae=K.type.defaultProps)===null||ae===void 0?void 0:ae[o];return Q===A}),dataStartIndex:l,dataEndIndex:u}),T=I.length,P,R,M;gue(g.domain,S,m)&&(P=b0(g.domain,null,S),h&&(m==="number"||_!=="auto")&&(M=Du(I,w,"category")));var F=B$(m);if(!P||P.length===0){var W,V=(W=g.domain)!==null&&W!==void 0?W:F;if(w){if(P=Du(I,w,m),m==="category"&&h){var L=Uz(P);b&&L?(R=P,P=Jp(0,T)):b||(P=_O(V,P,y).reduce(function(K,ae){return K.indexOf(ae)>=0?K:[].concat(hl(K),[ae])},[]))}else if(m==="category")b?P=P.filter(function(K){return K!==""&&!Ee(K)}):P=_O(V,P,y).reduce(function(K,ae){return K.indexOf(ae)>=0||ae===""||Ee(ae)?K:[].concat(hl(K),[ae])},[]);else if(m==="number"){var U=nee(I,a.filter(function(K){var ae,Q,be=o in K.props?K.props[o]:(ae=K.type.defaultProps)===null||ae===void 0?void 0:ae[o],ue="hide"in K.props?K.props.hide:(Q=K.type.defaultProps)===null||Q===void 0?void 0:Q.hide;return be===A&&(k||!ue)}),w,i,f);U&&(P=U)}h&&(m==="number"||_!=="auto")&&(M=Du(I,w,"category"))}else h?P=Jp(0,T):s&&s[A]&&s[A].hasStack&&m==="number"?P=p==="expand"?[0,1]:_T(s[A].stackGroups,l,u):P=yT(I,a.filter(function(K){var ae=o in K.props?K.props[o]:K.type.defaultProps[o],Q="hide"in K.props?K.props.hide:K.type.defaultProps.hide;return ae===A&&(k||!Q)}),m,f,!0);if(m==="number")P=ix(d,P,A,i,O),V&&(P=b0(V,P,S));else if(m==="category"&&V){var q=V,J=P.every(function(K){return q.indexOf(K)>=0});J&&(P=q)}}return Y(Y({},x),{},_e({},A,Y(Y({},g),{},{axisType:i,domain:P,categoricalDomain:M,duplicateDomain:R,originalDomain:(v=g.domain)!==null&&v!==void 0?v:F,isCategorical:h,layout:f})))},{})},que=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,p=Em(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=p.length,x=vT(f,i),y=-1;return n.reduce(function(v,g){var m=g.type.defaultProps!==void 0?Y(Y({},g.type.defaultProps),g.props):g.props,w=m[o],S=B$("number");if(!v[w]){y++;var b;return x?b=Jp(0,h):s&&s[w]&&s[w].hasStack?(b=_T(s[w].stackGroups,l,u),b=ix(d,b,w,i)):(b=b0(S,yT(p,n.filter(function(_){var O,k,A=o in _.props?_.props[o]:(O=_.type.defaultProps)===null||O===void 0?void 0:O[o],I="hide"in _.props?_.props.hide:(k=_.type.defaultProps)===null||k===void 0?void 0:k.hide;return A===w&&!I}),"number",f),a.defaultProps.allowDataOverflow),b=ix(d,b,w,i)),Y(Y({},v),{},_e({},w,Y(Y({axisType:i},a.defaultProps),{},{hide:!0,orientation:Yr(Uue,"".concat(i,".").concat(y%2),null),domain:b,originalDomain:S,isCategorical:x,layout:f})))}return v},{})},Kue=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(a,"Id"),p=Zr(f,i),h={};return p&&p.length?h=Gue(t,{axes:p,graphicalItems:o,axisType:a,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=que(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Xue=function(t){var r=oi(t),n=ja(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Gb(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:zp(r,n)}},e2=function(t){var r=t.children,n=t.defaultShowTooltip,a=Hr(r,nl),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Yue=function(t){return!t||!t.length?!1:t.some(function(r){var n=ka(r&&r.type);return n&&n.indexOf("Bar")>=0})},t2=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Zue=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,d=n.children,p=n.margin||{},h=Hr(d,nl),x=Hr(d,Aa),y=Object.keys(l).reduce(function(b,_){var O=l[_],k=O.orientation;return!O.mirror&&!O.hide?Y(Y({},b),{},_e({},k,b[k]+O.width)):b},{left:p.left||0,right:p.right||0}),v=Object.keys(o).reduce(function(b,_){var O=o[_],k=O.orientation;return!O.mirror&&!O.hide?Y(Y({},b),{},_e({},k,Yr(b,"".concat(k))+O.height)):b},{top:p.top||0,bottom:p.bottom||0}),g=Y(Y({},v),y),m=g.bottom;h&&(g.bottom+=h.props.height||nl.defaultProps.height),x&&r&&(g=tee(g,a,n,r));var w=u-g.left-g.right,S=f-g.top-g.bottom;return Y(Y({brushBottom:m},g),{},{width:Math.max(w,0),height:Math.max(S,0)})},Que=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Pm=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,p=function(g,m){var w=m.graphicalItems,S=m.stackGroups,b=m.offset,_=m.updateId,O=m.dataStartIndex,k=m.dataEndIndex,A=g.barSize,I=g.layout,T=g.barGap,P=g.barCategoryGap,R=g.maxBarSize,M=t2(I),F=M.numericAxisName,W=M.cateAxisName,V=Yue(w),L=[];return w.forEach(function(U,q){var J=Em(g.data,{graphicalItems:[U],dataStartIndex:O,dataEndIndex:k}),K=U.type.defaultProps!==void 0?Y(Y({},U.type.defaultProps),U.props):U.props,ae=K.dataKey,Q=K.maxBarSize,be=K["".concat(F,"Id")],ue=K["".concat(W,"Id")],Pe={},Fe=l.reduce(function(Ge,H){var E=m["".concat(H.axisType,"Map")],D=K["".concat(H.axisType,"Id")];E&&E[D]||H.axisType==="zAxis"||No();var N=E[D];return Y(Y({},Ge),{},_e(_e({},H.axisType,N),"".concat(H.axisType,"Ticks"),ja(N)))},Pe),te=Fe[W],ie=Fe["".concat(W,"Ticks")],he=S&&S[be]&&S[be].hasStack&&fee(U,S[be].stackGroups),X=ka(U.type).indexOf("Bar")>=0,ke=zp(te,ie),ve=[],Ae=V&&JJ({barSize:A,stackGroups:S,totalSize:Que(Fe,W)});if(X){var ze,ge,Ce=Ee(Q)?R:Q,Me=(ze=(ge=zp(te,ie,!0))!==null&&ge!==void 0?ge:Ce)!==null&&ze!==void 0?ze:0;ve=eee({barGap:T,barCategoryGap:P,bandSize:Me!==ke?Me:ke,sizeList:Ae[ue],maxBarSize:Ce}),Me!==ke&&(ve=ve.map(function(Ge){return Y(Y({},Ge),{},{position:Y(Y({},Ge.position),{},{offset:Ge.position.offset-Me/2})})}))}var je=U&&U.type&&U.type.getComposedData;je&&L.push({props:Y(Y({},je(Y(Y({},Fe),{},{displayedData:J,props:g,dataKey:ae,item:U,bandSize:ke,barPosition:ve,offset:b,stackedData:he,layout:I,dataStartIndex:O,dataEndIndex:k}))),{},_e(_e(_e({key:U.key||"item-".concat(q)},F,Fe[F]),W,Fe[W]),"animationId",_)),childIndex:eB(U,g.children),item:U})}),L},h=function(g,m){var w=g.props,S=g.dataStartIndex,b=g.dataEndIndex,_=g.updateId;if(!yS({props:w}))return null;var O=w.children,k=w.layout,A=w.stackOffset,I=w.data,T=w.reverseStackOrder,P=t2(k),R=P.numericAxisName,M=P.cateAxisName,F=Zr(O,n),W=cee(I,F,"".concat(R,"Id"),"".concat(M,"Id"),A,T),V=l.reduce(function(K,ae){var Q="".concat(ae.axisType,"Map");return Y(Y({},K),{},_e({},Q,Kue(w,Y(Y({},ae),{},{graphicalItems:F,stackGroups:ae.axisType===R&&W,dataStartIndex:S,dataEndIndex:b}))))},{}),L=Zue(Y(Y({},V),{},{props:w,graphicalItems:F}),m==null?void 0:m.legendBBox);Object.keys(V).forEach(function(K){V[K]=f(w,V[K],L,K.replace("Map",""),r)});var U=V["".concat(M,"Map")],q=Xue(U),J=p(w,Y(Y({},V),{},{dataStartIndex:S,dataEndIndex:b,updateId:_,graphicalItems:F,stackGroups:W,offset:L}));return Y(Y({formattedGraphicalItems:J,graphicalItems:F,offset:L,stackGroups:W},q),V)},x=function(v){function g(m){var w,S,b;return Cue(this,g),b=Iue(this,g,[m]),_e(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_e(b,"accessibilityManager",new vue),_e(b,"handleLegendBBoxUpdate",function(_){if(_){var O=b.state,k=O.dataStartIndex,A=O.dataEndIndex,I=O.updateId;b.setState(Y({legendBBox:_},h({props:b.props,dataStartIndex:k,dataEndIndex:A,updateId:I},Y(Y({},b.state),{},{legendBBox:_}))))}}),_e(b,"handleReceiveSyncEvent",function(_,O,k){if(b.props.syncId===_){if(k===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(O)}}),_e(b,"handleBrushChange",function(_){var O=_.startIndex,k=_.endIndex;if(O!==b.state.dataStartIndex||k!==b.state.dataEndIndex){var A=b.state.updateId;b.setState(function(){return Y({dataStartIndex:O,dataEndIndex:k},h({props:b.props,dataStartIndex:O,dataEndIndex:k,updateId:A},b.state))}),b.triggerSyncEvent({dataStartIndex:O,dataEndIndex:k})}}),_e(b,"handleMouseEnter",function(_){var O=b.getMouseInfo(_);if(O){var k=Y(Y({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseEnter;Se(A)&&A(k,_)}}),_e(b,"triggeredAfterMouseMove",function(_){var O=b.getMouseInfo(_),k=O?Y(Y({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseMove;Se(A)&&A(k,_)}),_e(b,"handleItemMouseEnter",function(_){b.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),_e(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),_e(b,"handleMouseMove",function(_){_.persist(),b.throttleTriggeredAfterMouseMove(_)}),_e(b,"handleMouseLeave",function(_){b.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};b.setState(O),b.triggerSyncEvent(O);var k=b.props.onMouseLeave;Se(k)&&k(O,_)}),_e(b,"handleOuterEvent",function(_){var O=Jz(_),k=Yr(b.props,"".concat(O));if(O&&Se(k)){var A,I;/.*touch.*/i.test(O)?I=b.getMouseInfo(_.changedTouches[0]):I=b.getMouseInfo(_),k((A=I)!==null&&A!==void 0?A:{},_)}}),_e(b,"handleClick",function(_){var O=b.getMouseInfo(_);if(O){var k=Y(Y({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var A=b.props.onClick;Se(A)&&A(k,_)}}),_e(b,"handleMouseDown",function(_){var O=b.props.onMouseDown;if(Se(O)){var k=b.getMouseInfo(_);O(k,_)}}),_e(b,"handleMouseUp",function(_){var O=b.props.onMouseUp;if(Se(O)){var k=b.getMouseInfo(_);O(k,_)}}),_e(b,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),_e(b,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseDown(_.changedTouches[0])}),_e(b,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseUp(_.changedTouches[0])}),_e(b,"handleDoubleClick",function(_){var O=b.props.onDoubleClick;if(Se(O)){var k=b.getMouseInfo(_);O(k,_)}}),_e(b,"handleContextMenu",function(_){var O=b.props.onContextMenu;if(Se(O)){var k=b.getMouseInfo(_);O(k,_)}}),_e(b,"triggerSyncEvent",function(_){b.props.syncId!==void 0&&rv.emit(nv,b.props.syncId,_,b.eventEmitterSymbol)}),_e(b,"applySyncEvent",function(_){var O=b.props,k=O.layout,A=O.syncMethod,I=b.state.updateId,T=_.dataStartIndex,P=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)b.setState(Y({dataStartIndex:T,dataEndIndex:P},h({props:b.props,dataStartIndex:T,dataEndIndex:P,updateId:I},b.state)));else if(_.activeTooltipIndex!==void 0){var R=_.chartX,M=_.chartY,F=_.activeTooltipIndex,W=b.state,V=W.offset,L=W.tooltipTicks;if(!V)return;if(typeof A=="function")F=A(L,_);else if(A==="value"){F=-1;for(var U=0;U=0){var he,X;if(R.dataKey&&!R.allowDuplicatedCategory){var ke=typeof R.dataKey=="function"?ie:"payload.".concat(R.dataKey.toString());he=cp(U,ke,F),X=q&&J&&cp(J,ke,F)}else he=U==null?void 0:U[M],X=q&&J&&J[M];if(ue||be){var ve=_.props.activeIndex!==void 0?_.props.activeIndex:M;return[j.cloneElement(_,Y(Y(Y({},A.props),Fe),{},{activeIndex:ve})),null,null]}if(!Ee(he))return[te].concat(hl(b.renderActivePoints({item:A,activePoint:he,basePoint:X,childIndex:M,isRange:q})))}else{var Ae,ze=(Ae=b.getItemByXY(b.state.activeCoordinate))!==null&&Ae!==void 0?Ae:{graphicalItem:te},ge=ze.graphicalItem,Ce=ge.item,Me=Ce===void 0?_:Ce,je=ge.childIndex,Ge=Y(Y(Y({},A.props),Fe),{},{activeIndex:je});return[j.cloneElement(Me,Ge),null,null]}return q?[te,null,null]:[te,null]}),_e(b,"renderCustomized",function(_,O,k){return j.cloneElement(_,Y(Y({key:"recharts-customized-".concat(k)},b.props),b.state))}),_e(b,"renderMap",{CartesianGrid:{handler:rf,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:rf},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:rf},YAxis:{handler:rf},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((w=m.id)!==null&&w!==void 0?w:Ro("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=hC(b.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),b.state={},b}return Due(g,v),$ue(g,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,b=w.data,_=w.height,O=w.layout,k=Hr(S,_r);if(k){var A=k.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,T=lx(this.state,b,A,I),P=this.state.tooltipTicks[A].coordinate,R=(this.state.offset.top+_)/2,M=O==="horizontal",F=M?{x:P,y:R}:{y:P,x:R},W=this.state.formattedGraphicalItems.find(function(L){var U=L.item;return U.type.name==="Scatter"});W&&(F=Y(Y({},F),W.props.points[A].tooltipPosition),T=W.props.points[A].tooltipPayload);var V={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:I,activePayload:T,activeCoordinate:F};this.setState(V),this.renderCursor(k),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var b,_;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){Rg([Hr(w.children,_r)],[Hr(this.props.children,_r)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Hr(this.props.children,_r);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return s.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,b=S.getBoundingClientRect(),_=kX(b),O={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},k=b.width/S.offsetWidth||1,A=this.inRange(O.chartX,O.chartY,k);if(!A)return null;var I=this.state,T=I.xAxisMap,P=I.yAxisMap,R=this.getTooltipEventType(),M=Jk(this.state,this.props.data,this.props.layout,A);if(R!=="axis"&&T&&P){var F=oi(T).scale,W=oi(P).scale,V=F&&F.invert?F.invert(O.chartX):null,L=W&&W.invert?W.invert(O.chartY):null;return Y(Y({},O),{},{xValue:V,yValue:L},M)}return M?Y(Y({},O),M):null}},{key:"inRange",value:function(w,S){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,O=w/b,k=S/b;if(_==="horizontal"||_==="vertical"){var A=this.state.offset,I=O>=A.left&&O<=A.left+A.width&&k>=A.top&&k<=A.top+A.height;return I?{x:O,y:k}:null}var T=this.state,P=T.angleAxisMap,R=T.radiusAxisMap;if(P&&R){var M=oi(P);return OO({x:O,y:k},M)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),b=Hr(w,_r),_={};b&&S==="axis"&&(b.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=dp(this.props,this.handleOuterEvent);return Y(Y({},O),_)}},{key:"addListener",value:function(){rv.on(nv,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){rv.removeListener(nv,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,b){for(var _=this.state.formattedGraphicalItems,O=0,k=_.length;Obt(`/routing/list/active/${e}`)),n=t==null?void 0:t.find(T=>{var P;return((P=T.algorithm_data||T.algorithm)==null?void 0:P.type)==="volume_split"}),[a,i]=j.useState([{id:tu(),name:"",split:50},{id:tu(),name:"",split:50}]),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,d]=j.useState(null),[p,h]=j.useState(null),[x,y]=j.useState(!1),[v,g]=j.useState(new Set),m=a.reduce((T,P)=>T+P.split,0);function w(T,P,R){i(M=>M.map(F=>F.id===T?{...F,[P]:R}:F))}function S(){i(T=>[...T,{id:tu(),name:"",split:0}])}function b(T){i(P=>P.filter(R=>R.id!==T))}async function _(){if(!e)return d("Set a merchant ID first");if(!o.trim())return d("Enter a rule name");if(m!==100)return d(`Splits must sum to 100 (currently ${m})`);if(a.some(T=>!T.name.trim()))return d("All gateways must have names");u(!0),d(null),h(null);try{await bt("/routing/create",{rule_id:null,name:o,description:"",created_by:e,algorithm_for:"payment",metadata:null,algorithm:{type:"volume_split",data:a.map(T=>({split:T.split,output:{gateway_name:T.name.trim(),gateway_id:null}}))}}),h(`Rule "${o}" created successfully. Find it in the list below to activate.`),r(),s(""),i([{id:tu(),name:"",split:50},{id:tu(),name:"",split:50}])}catch(T){d(T instanceof Error?T.message:"Failed to create rule")}finally{u(!1)}}async function O(T){if(e)try{await bt("/routing/activate",{created_by:e,routing_algorithm_id:T}),r(),h("Rule activated.")}catch(P){d(P instanceof Error?P.message:"Failed to activate")}}function k(T){g(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})}const A=n?n.algorithm_data||n.algorithm:null,I=A&&"data"in A?A.data.map(T=>{var P;return{name:((P=T.output)==null?void 0:P.gateway_name)??"?",value:T.split}}):[];return c.jsxs("div",{className:"space-y-6 max-w-4xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Volume Split Routing"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Distribute payment traffic across gateways by percentage."})]}),n&&c.jsxs(De,{children:[c.jsxs(Ze,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Volume Split"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n.name})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Oe,{variant:"green",children:"Active"}),c.jsxs(Te,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(!x),children:[c.jsx(Ch,{size:14,className:"mr-1"}),x?"Hide":"View"]})]})]}),x&&c.jsxs(Le,{children:[c.jsx(As,{width:"100%",height:220,children:c.jsxs(U$,{children:[c.jsx(la,{data:I,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:T,value:P})=>`${T}: ${P}%`,labelLine:{stroke:"#45454f"},children:I.map((T,P)=>c.jsx(fo,{fill:n2[P%n2.length]},P))}),c.jsx(_r,{formatter:T=>`${T}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),c.jsx(Aa,{wrapperStyle:{color:"#8e8ea0"}})]})}),c.jsxs("div",{className:"mt-4 text-xs text-slate-600",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Rule ID:"})," ",n.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",n.created_at?new Date(n.created_at).toLocaleString():"Unknown"]})]})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"Create Volume Split Rule"})}),c.jsxs(Le,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Rule Name"}),c.jsx("input",{value:o,onChange:T=>s(T.target.value),placeholder:"e.g. ab-test-split",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 text-xs font-medium text-slate-500 px-1",children:[c.jsx("span",{children:"Gateway Name"}),c.jsx("span",{children:"Split %"}),c.jsx("span",{})]}),a.map(T=>c.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 items-center",children:[c.jsx("input",{value:T.name,onChange:P=>w(T.id,"name",P.target.value),placeholder:"e.g. stripe",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{type:"number",min:0,max:100,value:T.split,onChange:P=>w(T.id,"split",Number(P.target.value)),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>b(T.id),className:"text-slate-400 hover:text-red-500",children:c.jsx($a,{size:15})})]},T.id)),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-sm text-brand-500 hover:text-brand-600",children:[c.jsx(ji,{size:14})," Add Gateway"]}),c.jsxs("span",{className:`text-xs font-medium ${m===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",m,"%",m!==100&&" (must be 100)"]})]})]}),c.jsx(Gr,{error:f}),p&&c.jsx("p",{className:"text-sm text-emerald-400",children:p}),c.jsx(Te,{onClick:_,disabled:l||!e,children:l?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Creating…"]}):"Create Rule"})]})]}),c.jsx(rce,{merchantId:e,onActivate:O,expandedRuleIds:v,onToggleExpand:k})]})}function rce({merchantId:e,onActivate:t,expandedRuleIds:r,onToggleExpand:n}){const{data:a,isLoading:i}=Ft(e?["routing-list",e]:null,()=>bt(`/routing/list/${e}`)),o=(a==null?void 0:a.filter(s=>{var l;return((l=s.algorithm_data||s.algorithm)==null?void 0:l.type)==="volume_split"}))??[];return e?i?c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(mr,{})}):o.length?c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"Saved Volume Split Rules"})}),c.jsx(Le,{className:"p-0",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 uppercase tracking-wider",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2",children:"Name"}),c.jsx("th",{className:"text-left px-4 py-2",children:"Split"}),c.jsx("th",{className:"px-4 py-2"})]})}),c.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:o.map(s=>{const l=s.algorithm_data||s.algorithm,u=(l==null?void 0:l.data)||[],f=r.has(s.id);return c.jsxs(c.Fragment,{children:[c.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[c.jsx("td",{className:"px-4 py-2 font-medium text-slate-800",children:s.name}),c.jsx("td",{className:"px-4 py-2 text-slate-600 text-xs",children:u.map(d=>{var p;return`${(p=d.output)==null?void 0:p.gateway_name}:${d.split}%`}).join(" | ")}),c.jsx("td",{className:"px-4 py-2 text-right",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsxs(Te,{size:"sm",variant:"ghost",onClick:()=>n(s.id),children:[c.jsx(Ch,{size:14,className:"mr-1"}),f?"Hide":"View"]}),c.jsx(Te,{size:"sm",variant:"secondary",onClick:()=>t(s.id),children:"Activate"})]})})]},s.id),f&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:c.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"ID:"})," ",s.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Description:"})," ",s.description||"N/A"]}),s.created_at&&c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",new Date(s.created_at).toLocaleString()]}),c.jsxs("div",{children:[c.jsx("strong",{children:"Configuration:"}),c.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(l,null,2)})]})]})})})]})})})]})})]}):null:null}function nce(){var m;const{merchantId:e}=ia(),{data:t,mutate:r,isLoading:n}=Ft(e?["rule-debit",e]:null,()=>bt("/rule/get",{merchant_id:e,config:{type:"debitRouting"}})),[a,i]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,d]=j.useState(null),[p,h]=j.useState(null),x=(m=t==null?void 0:t.config)==null?void 0:m.data,y=a||(x==null?void 0:x.merchant_category_code)||"",v=o||(x==null?void 0:x.acquirer_country)||"";async function g(){if(!e)return d("Set a merchant ID first");const w={merchant_id:e,config:{type:"debitRouting",data:{merchant_category_code:y.trim(),acquirer_country:v.trim()}}};u(!0),d(null);try{await bt(t?"/rule/update":"/rule/create",w),h("Debit routing config saved."),r()}catch(S){d(S instanceof Error?S.message:"Failed to save")}finally{u(!1)}}return c.jsxs("div",{className:"space-y-6 max-w-2xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Network / Debit Routing"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Configure network-based routing to optimise processing fees for debit card transactions. The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR)."})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(GE,{size:16,className:"text-brand-500"}),c.jsx("h2",{className:"font-medium text-slate-800",children:"Debit Routing Configuration"})]})}),c.jsx(Le,{className:"space-y-4",children:n?c.jsx("div",{className:"flex justify-center py-6",children:c.jsx(mr,{})}):c.jsxs(c.Fragment,{children:[!e&&c.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar to load configuration."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Merchant Category Code (MCC)"}),c.jsx("input",{value:y,onChange:w=>i(w.target.value),placeholder:"e.g. 5411",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"4-digit ISO MCC for your business type"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Acquirer Country"}),c.jsx("input",{value:v,onChange:w=>s(w.target.value),placeholder:"e.g. US",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"ISO 3166-1 alpha-2 country code"})]})]}),c.jsx(Gr,{error:f}),p&&c.jsx("p",{className:"text-sm text-emerald-400",children:p}),c.jsx(Te,{onClick:g,disabled:l||!e,children:l?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Saving…"]}):t?"Update Config":"Save Config"})]})})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"How Network Routing Works"})}),c.jsxs(Le,{className:"text-sm text-slate-600 space-y-2",children:[c.jsx("p",{children:"For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee."}),c.jsxs("p",{children:["Supported networks: ",["VISA","MASTERCARD","ACCEL","NYCE","PULSE","STAR"].map(w=>c.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md mr-1 text-slate-700",children:w},w))]}),c.jsxs("p",{children:["Use the ",c.jsx("strong",{className:"text-slate-800",children:"Decision Explorer"})," to test network routing decisions with ",c.jsx("code",{className:"text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md text-brand-500",children:"NtwBasedRouting"})," algorithm."]})]})]})]})}const ace=["SR_BASED_ROUTING","PL_BASED_ROUTING","NTW_BASED_ROUTING"],ice={SR_BASED_ROUTING:"Success Rate Based",PL_BASED_ROUTING:"Priority List Based",NTW_BASED_ROUTING:"Network Based"};function oce(e){for(const[t,r]of Object.entries(c5))if(e.includes(t)||t.includes(e))return r;return"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8"}const Cr=["#0069ED","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function jf(e=[]){return e.map(t=>t.trim()).filter(Boolean).map(t=>t.toUpperCase())}function iv(e=[]){return Array.from(new Set(jf(e)))}function sce(e){return function(){let r=e+=1831565813;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function lce(e,t){const r=Math.max(0,t);if(!e.length||r===0)return[];const n=[];e.forEach((l,u)=>{for(let f=0;f({connector:l.name,colorIdx:u,percentage:l.percentage})).sort((l,u)=>u.percentage-l.percentage);for(;n.lengthr&&(n.length=r);const i=e.reduce((l,u,f)=>{const d=Array.from(u.name).reduce((p,h)=>p+h.charCodeAt(0),0);return l+d+f*31+u.count*17+Math.round(u.percentage*10)},r*13),o=sce(i),s=[...n];for(let l=s.length-1;l>0;l-=1){const u=Math.floor(o()*(l+1));[s[l],s[u]]=[s[u],s[l]]}return s}function ov(e){return e==="enum"?"enum_variant":e==="integer"?"number":e==="udf"||e==="global_ref"?"metadata_variant":"str_value"}function V$(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function mu(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function un(e){return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase()):""}function yu(e){return e?e==="decision_gateway"||e==="decide_gateway"?"Decide Gateway":e==="update_gateway_score"?"Update Gateway":e==="routing_evaluate"?"Rule Evaluate":un(e):"Unknown route"}function a2(e){return e?e==="decision"?"Decide Gateway":e==="gateway_update"?"Update Gateway":e==="rule_hit"?"Rule Evaluate":e==="rule_evaluation_preview"?"Preview Result":e==="error"?"Errors":un(e):"Unknown event"}function vu(e){return e.event_stage==="gateway_decided"?"Decide Gateway":e.event_stage==="score_updated"?"Update Gateway":e.event_stage==="rule_applied"?"Rule Evaluate":e.event_stage==="preview_evaluated"||e.event_type==="rule_evaluation_preview"?"Preview Result":e.event_type==="error"?"Errors":un(e.event_stage||e.event_type)}function ux(e){return e.event_type==="decision"||e.event_stage==="gateway_decided"?"Decide Gateway":e.event_type==="rule_hit"||e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="gateway_update"||e.event_stage==="score_updated"?"Update Gateway":e.event_type==="rule_evaluation_preview"||e.event_stage==="preview_evaluated"?"Preview":"Errors"}function nf(e){const t=(e.status||"").toUpperCase();return e.event_type==="error"||t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":e.event_type==="rule_hit"?"purple":t==="CHARGED"||t==="AUTHORIZED"||t==="SUCCESS"?"green":e.event_type==="rule_evaluation_preview"?"purple":e.event_type==="gateway_update"?"green":e.event_type==="decision"?"blue":"orange"}function i2(e){const t=(e||"").toUpperCase();return t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":t==="SUCCESS"||t==="CHARGED"||t==="AUTHORIZED"?"green":"gray"}function o2(e){return e==="Decide Gateway"?"blue":e==="Rule Evaluate"||e==="Preview"?"purple":e==="Update Gateway"?"green":e==="Errors"?"red":"gray"}function ru(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function sv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}function W$(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function uce(e,t){return`/analytics/payment-audit?${V$({scope:"current",range:"24h",page:1,page_size:25,merchant_id:e,payment_id:t})}`}function cce(e,t){return`/analytics/preview-trace?${V$({scope:"current",range:"24h",page:1,page_size:25,merchant_id:e,payment_id:t})}`}function s2(e){if(!e)return null;const t=ru(e.details_json)?e.details_json:{},r=t.response??t.response_payload??t.result??t.output??null,n=t.request??t.request_payload??t.input??t.payload??sv({payment_id:e.payment_id,request_id:e.request_id,payment_method_type:e.payment_method_type,payment_method:e.payment_method,gateway:e.gateway}),a=r??sv({event_type:e.event_type,status:e.status,error_code:e.error_code,error_message:e.error_message,score_value:e.score_value,sigma_factor:e.sigma_factor,average_latency:e.average_latency,tp99_latency:e.tp99_latency,transaction_count:e.transaction_count,rule_name:e.rule_name,routing_approach:e.routing_approach}),i=ru(r)?r:null,o=ru(i==null?void 0:i.decided_gateway)?i.decided_gateway:null,s=t.score_context??(o?o.gateway_priority_map:null)??(i?i.gateway_priority_map:null)??null,l=t.selection_reason??null,u=[{label:"Phase",value:ux(e)},{label:"Stage",value:vu(e)},{label:"Route",value:yu(e.route)},{label:"Timestamp",value:mu(e.created_at_ms)},...e.merchant_id?[{label:"Merchant",value:e.merchant_id}]:[],...e.payment_id?[{label:"Payment ID",value:e.payment_id}]:[],...e.request_id?[{label:"Request ID",value:e.request_id}]:[],...e.gateway?[{label:"Gateway",value:e.gateway}]:[],...e.status?[{label:"Status",value:un(e.status)}]:[]],f=sv(Object.fromEntries(Object.entries(t).filter(([d])=>!["request","request_payload","input","payload","response","response_payload","result","output","score_context","selection_reason"].includes(d))));return{summaryRows:u,requestPayload:ru(n)&&!Object.keys(n).length?null:n,responsePayload:ru(a)&&!Object.keys(a).length?null:a,scoreContext:s,selectionReason:l,signalRecord:Object.keys(f).length?f:null,rawEvent:{...e,details_json:e.details_json}}}function l2(e){return e?"bg-brand-600 text-white":"bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]"}function gu({title:e,body:t}){return c.jsxs("div",{className:"rounded-[22px] border border-dashed border-slate-200 bg-slate-50/80 px-6 py-12 text-center dark:border-[#1f1f26] dark:bg-[#0b0b0f]",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function u2({rows:e}){return e.length?c.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(t=>c.jsxs("div",{className:"rounded-[20px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:t.label}),c.jsx("p",{className:"mt-2 break-words text-sm text-slate-900 dark:text-white",children:t.value})]},`${t.label}-${t.value}`))}):null}function fa({title:e,value:t,emptyMessage:r}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{children:c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e})}),t?c.jsx("pre",{className:"overflow-x-auto rounded-[22px] bg-slate-950 px-4 py-4 text-xs leading-6 text-slate-200",children:W$(t)}):c.jsx(gu,{title:`No ${e.toLowerCase()} captured`,body:r})]})}function dce(){var Cw,Tw,$w,Iw,Rw,Mw,Dw,Lw;const{merchantId:e}=ia(),{routingKeysConfig:t,isLoading:r,error:n}=XP(),a=Object.keys(t).length>0,i=!r&&(!a||!!n),[o,s]=j.useState("single"),[l,u]=j.useState({amount:"1000",currency:"",payment_method_type:"",payment_method:"",card_brand:"",auth_type:"",eligible_gateways:"stripe, adyen",ranking_algorithm:"SR_BASED_ROUTING",elimination_enabled:!1}),[f,d]=j.useState({totalPayments:"10",successCount:"7",failureCount:"3"}),[p,h]=j.useState([{key:"payment_method_type",type:"enum_variant",value:"",metadataKey:""},{key:"currency",type:"enum_variant",value:"",metadataKey:""}]),[x,y]=j.useState([{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}]),[v,g]=j.useState("100"),[m,w]=j.useState(null),[S,b]=j.useState(null),[_,O]=j.useState("CHARGED"),[k,A]=j.useState(null),[I,T]=j.useState([]),[P,R]=j.useState([]),[M,F]=j.useState(!1),[W,V]=j.useState(null),[L,U]=j.useState(!1),[q,J]=j.useState(!1),[K,ae]=j.useState(!1),[Q,be]=j.useState(!1),[ue,Pe]=j.useState(null),[Fe,te]=j.useState(null),[ie,he]=j.useState("summary"),[X,ke]=j.useState(null),[ve,Ae]=j.useState(null),[ze,ge]=j.useState("summary"),[Ce,Me]=j.useState("Rule Evaluation Preview"),je=j.useMemo(()=>Object.keys(t).sort(),[t]),Ge=j.useMemo(()=>{var $;return jf((($=t.payment_method)==null?void 0:$.values)||[])},[t]),H=j.useMemo(()=>{var z;const $=l.payment_method_type.toLowerCase();return jf(((z=t[$])==null?void 0:z.values)||[])},[l.payment_method_type,t]),E=j.useMemo(()=>{var $;return iv((($=t.currency)==null?void 0:$.values)||[])},[t]),D=j.useMemo(()=>{var $;return iv((($=t.card_network)==null?void 0:$.values)||[])},[t]),N=j.useMemo(()=>{var $;return iv((($=t.authentication_type)==null?void 0:$.values)||[])},[t]),B=e&&ue?uce(e,ue):null,G=Ft(B,Qn,{refreshInterval:ue?12e3:0,revalidateOnFocus:!0}),ee=e&&X?cce(e,X):null,Z=Ft(ee,Qn,{refreshInterval:X?12e3:0,revalidateOnFocus:!0});j.useEffect(()=>{i||r||(u($=>{var de;const z={...$};E.length>0&&!E.includes(z.currency)&&(z.currency=E[0]),Ge.length>0&&!Ge.includes(z.payment_method_type)&&(z.payment_method_type=Ge[0]);const se=jf(((de=t[z.payment_method_type.toLowerCase()])==null?void 0:de.values)||[]);return se.length>0&&!se.includes(z.payment_method)&&(z.payment_method=se[0]),N.length>0&&!N.includes(z.auth_type)&&(z.auth_type=N[0]),D.length>0&&!D.includes(z.card_brand)&&(z.card_brand=D[0]),z}),h($=>$.map(z=>{if(!z.key||!t[z.key])return z;const se=t[z.key],de=ov(se.type),st=se.values||[],br=de==="enum_variant"?st.includes(z.value)?z.value:st[0]||"":z.value;return{...z,type:de,value:br}})))},[i,r,t,E,Ge,N,D]),j.useEffect(()=>{if(!ue&&!X)return;const $=document.body.style.overflow,z=se=>{se.key==="Escape"&&(Pe(null),te(null),he("summary"),ke(null),Ae(null),ge("summary"))};return document.body.style.overflow="hidden",window.addEventListener("keydown",z),()=>{document.body.style.overflow=$,window.removeEventListener("keydown",z)}},[ue,X]);function me($,z){u(se=>({...se,[$]:z}))}function Ne(){var st;if(je.length===0)return;const $=je[0],z=t[$],se=ov(z==null?void 0:z.type),de=se==="enum_variant"&&((st=z==null?void 0:z.values)==null?void 0:st[0])||"";h([...p,{key:$,type:se,value:de,metadataKey:""}])}function At($){h(p.filter((z,se)=>se!==$))}function Ct($,z,se){h(p.map((de,st)=>st===$?{...de,[z]:se}:de))}function Yt($,z){h(p.map((se,de)=>de===$?{...se,metadataKey:z}:se))}function Fi($,z){var br;const se=t[z],de=ov(se==null?void 0:se.type),st=de==="enum_variant"&&((br=se==null?void 0:se.values)==null?void 0:br[0])||"";h(p.map((Jt,qa)=>qa===$?{...Jt,key:z,type:de,value:st,metadataKey:""}:Jt))}function Wa(){y([...x,{gateway_name:"",gateway_id:""}])}function zi($){y(x.filter((z,se)=>se!==$))}function Bi($,z,se){y(x.map((de,st)=>st===$?{...de,[z]:se}:de))}async function Ui(){if(!e)return V("Set a merchant ID in the top bar");if(i)return V("Routing key config unavailable. Fix /config/routing-keys and retry.");U(!0),V(null),b(null);const $=l.eligible_gateways.split(",").map(se=>se.trim()).filter(Boolean),z=`explorer_${Date.now()}`;try{const se=await bt("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:z,amount:parseFloat(l.amount)||1e3,currency:l.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:l.payment_method_type,paymentMethod:l.payment_method,authType:l.auth_type,cardBrand:l.card_brand},eligibleGatewayList:$,rankingAlgorithm:l.ranking_algorithm,eliminationEnabled:l.elimination_enabled});await bt("/update-gateway-score",{merchantId:e,gateway:se.decided_gateway,gatewayReferenceId:null,status:_,paymentId:z,enforceDynamicRoutingFailure:null}),w(se),b(z)}catch(se){V(se instanceof Error?se.message:"Request failed")}finally{U(!1)}}async function Rl(){if(!e)return V("Set a merchant ID in the top bar");if(i)return V("Routing key config unavailable. Fix /config/routing-keys and retry.");const $=parseInt(f.totalPayments)||0,z=parseInt(f.successCount)||0,se=parseInt(f.failureCount)||0;if($<=0)return V("Total Payments must be greater than 0");if(z+se!==$)return V("Success + Failure count must equal Total Payments");F(!0),V(null),R([]);const de=l.eligible_gateways.split(",").map(Jt=>Jt.trim()).filter(Boolean),st=[],br=[...Array(z).fill("CHARGED"),...Array(se).fill("FAILURE")];for(let Jt=br.length-1;Jt>0;Jt--){const qa=Math.floor(Math.random()*(Jt+1));[br[Jt],br[qa]]=[br[qa],br[Jt]]}try{for(let Jt=0;Jt<$;Jt++){const qa=`sim_${Date.now()}_${Jt}`,Fw=(await bt("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:qa,amount:parseFloat(l.amount)||1e3,currency:l.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:l.payment_method_type,paymentMethod:l.payment_method,authType:l.auth_type,cardBrand:l.card_brand},eligibleGatewayList:de,rankingAlgorithm:l.ranking_algorithm,eliminationEnabled:l.elimination_enabled})).decided_gateway,zw=br[Jt];await bt("/update-gateway-score",{merchantId:e,gateway:Fw,gatewayReferenceId:null,status:zw,paymentId:qa,enforceDynamicRoutingFailure:null}),st.push({paymentId:qa,decidedGateway:Fw,status:zw,timestamp:new Date().toISOString()}),R([...st])}}catch(Jt){V(Jt instanceof Error?Jt.message:"Simulation failed")}finally{F(!1)}}async function Fo(){if(i)return V("Routing key config unavailable. Fix /config/routing-keys and retry.");U(!0),V(null),A(null),T([]);const $=`rule_preview_${Date.now()}`;try{const z={};p.forEach(de=>{de.key&&(de.type==="metadata_variant"?z[de.key]={type:de.type,value:{key:de.metadataKey||de.key,value:de.value}}:de.type==="number"?z[de.key]={type:de.type,value:parseFloat(de.value)||0}:z[de.key]={type:de.type,value:de.value})});const se=await bt("/routing/evaluate",{created_by:e||"test_user",payment_id:$,fallback_output:x.filter(de=>de.gateway_name),parameters:z});if(A(se),se.output.type==="volume_split"&&se.output.splits){const de=parseInt(v)||100,st=se.output.splits.map(br=>({name:br.connector.gateway_name,count:Math.round(br.split/100*de),percentage:br.split}));T(st)}}catch(z){V(z instanceof Error?z.message:"Request failed")}finally{U(!1)}}async function Zt(){U(!0),V(null),T([]);const $=`volume_preview_${Date.now()}`;try{const z=await bt("/routing/evaluate",{created_by:e||"test_user",payment_id:$,fallback_output:[{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}],parameters:{}});if(A(z),z.output.type==="volume_split"&&z.output.splits){const se=parseInt(v)||100,de=z.output.splits.map(st=>({name:st.connector.gateway_name,count:Math.round(st.split/100*se),percentage:st.split}));T(de)}}catch(z){V(z instanceof Error?z.message:"Request failed")}finally{U(!1)}}const Qt=m!=null&&m.gateway_priority_map?Object.entries(m.gateway_priority_map).sort(([,$],[,z])=>z-$).map(([$,z])=>({name:$,score:Math.round(z*1e3)/10})):[],cr=P.reduce(($,z)=>($[z.decidedGateway]||($[z.decidedGateway]={total:0,success:0,failure:0}),$[z.decidedGateway].total++,z.status==="CHARGED"?$[z.decidedGateway].success++:$[z.decidedGateway].failure++,$),{}),jn=I.map($=>({name:$.name,value:$.count})),Nr=j.useMemo(()=>lce(I,parseInt(v)||0),[I,v]),ut=j.useMemo(()=>{var z;const $=((z=G.data)==null?void 0:z.results)||[];return $.find(se=>se.payment_id===ue)||$[0]||null},[(Cw=G.data)==null?void 0:Cw.results,ue]),Ue=j.useMemo(()=>{var z;const $=((z=G.data)==null?void 0:z.timeline)||[];return $.find(se=>se.id===Fe)||$[0]||null},[(Tw=G.data)==null?void 0:Tw.timeline,Fe]);j.useEffect(()=>{var z,se;if(Ue!=null&&Ue.id){te(Ue.id);return}const $=(se=(z=G.data)==null?void 0:z.timeline)==null?void 0:se[0];$!=null&&$.id&&te($.id)},[($w=G.data)==null?void 0:$w.timeline,Ue==null?void 0:Ue.id]);const ua=j.useMemo(()=>{var z;const $=[];for(const se of((z=G.data)==null?void 0:z.timeline)||[]){const de=ux(se),st=$[$.length-1];!st||st.phase!==de?$.push({phase:de,events:[se]}):st.events.push(se)}return $},[(Iw=G.data)==null?void 0:Iw.timeline]),ot=j.useMemo(()=>s2(Ue),[Ue]),Et=j.useMemo(()=>{var z;const $=((z=Z.data)==null?void 0:z.results)||[];return $.find(se=>se.payment_id===X)||$[0]||null},[(Rw=Z.data)==null?void 0:Rw.results,X]),Ve=j.useMemo(()=>{var z;const $=((z=Z.data)==null?void 0:z.timeline)||[];return $.find(se=>se.id===ve)||$[0]||null},[(Mw=Z.data)==null?void 0:Mw.timeline,ve]);j.useEffect(()=>{var z,se;if(Ve!=null&&Ve.id){Ae(Ve.id);return}const $=(se=(z=Z.data)==null?void 0:z.timeline)==null?void 0:se[0];$!=null&&$.id&&Ae($.id)},[(Dw=Z.data)==null?void 0:Dw.timeline,Ve==null?void 0:Ve.id]);const rn=j.useMemo(()=>{var z;const $=[];for(const se of((z=Z.data)==null?void 0:z.timeline)||[]){const de=ux(se),st=$[$.length-1];!st||st.phase!==de?$.push({phase:de,events:[se]}):st.events.push(se)}return $},[(Lw=Z.data)==null?void 0:Lw.timeline]),nn=j.useMemo(()=>s2(Ve),[Ve]);function Ha($){ke(null),Ae(null),ge("summary"),Pe($),te(null),he("summary")}function On(){Pe(null),te(null),he("summary")}function Ga($,z){Pe(null),te(null),he("summary"),Me(z),ke($),Ae(null),ge("summary")}function zo(){ke(null),Ae(null),ge("summary")}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Decision Explorer"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split."})]}),c.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-[#1c1c24]",children:[c.jsx("button",{onClick:()=>s("single"),className:`px-4 py-2 text-sm font-medium ${o==="single"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Single Test"}),c.jsx("button",{onClick:()=>s("batch"),className:`px-4 py-2 text-sm font-medium ${o==="batch"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Batch Simulation"}),c.jsx("button",{onClick:()=>s("rule"),className:`px-4 py-2 text-sm font-medium ${o==="rule"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Rule-Based"}),c.jsx("button",{onClick:()=>s("volume"),className:`px-4 py-2 text-sm font-medium ${o==="volume"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Volume Split"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:o==="rule"?"Rule Evaluation Parameters":o==="volume"?"Volume Split Configuration":"Payment Parameters"})}),c.jsxs(Le,{className:"space-y-3",children:[!e&&o!=="volume"&&c.jsx("p",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar first."}),o!=="volume"&&r&&c.jsx("p",{className:"text-xs text-slate-600 bg-slate-50 border border-slate-200 rounded px-3 py-2",children:"Loading routing config from backend..."}),o!=="volume"&&i&&c.jsx(Gr,{error:"Routing config unavailable from /config/routing-keys. Parameter forms are disabled."}),o==="rule"?c.jsxs(c.Fragment,{children:[r&&c.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),i&&c.jsx(Gr,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Evaluation is disabled."}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Parameters"}),c.jsx("div",{className:"space-y-2",children:p.map(($,z)=>{var se;return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx("select",{value:$.key,onChange:de=>Fi(z,de.target.value),disabled:i||r,className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:je.length===0?c.jsx("option",{value:"",children:"No keys available"}):je.map(de=>c.jsx("option",{value:de,children:de},de))}),c.jsx("input",{value:$.type,readOnly:!0,className:"w-36 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>At(z),className:"p-1.5 text-slate-400 hover:text-red-500",children:c.jsx($a,{size:14})})]}),$.type==="metadata_variant"?c.jsxs("div",{className:"flex gap-2 items-center pl-1",children:[c.jsx("input",{placeholder:"Metadata Key",value:$.metadataKey||"",onChange:de=>Yt(z,de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{placeholder:"Metadata Value",value:$.value,onChange:de=>Ct(z,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}):$.type==="enum_variant"?c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("select",{value:$.value,onChange:de=>Ct(z,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(((se=t[$.key])==null?void 0:se.values)||[]).map(de=>c.jsx("option",{value:de,children:de},de))})}):$.type==="number"?c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("input",{type:"number",placeholder:"Value",value:$.value,onChange:de=>Ct(z,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})}):c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("input",{placeholder:"Value",value:$.value,onChange:de=>Ct(z,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})})]},z)})}),c.jsxs("button",{onClick:Ne,disabled:i||r||je.length===0,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[c.jsx(ji,{size:12})," Add Parameter"]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Fallback gateway_name/gateway_id"}),c.jsx("div",{className:"space-y-2",children:x.map(($,z)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx("input",{placeholder:"gateway_name",value:$.gateway_name,onChange:se=>Bi(z,"gateway_name",se.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{placeholder:"gateway_id",value:$.gateway_id||"",onChange:se=>Bi(z,"gateway_id",se.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>zi(z),className:"p-1.5 text-slate-400 hover:text-red-500",children:c.jsx($a,{size:14})})]},z))}),c.jsxs("button",{onClick:Wa,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[c.jsx(ji,{size:12})," Add Gateway"]})]})]}):o==="volume"?c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Number of Payments"}),c.jsx("input",{type:"text",value:v,onChange:$=>g($.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Enter the total number of payments to visualize how they would be distributed across gateways."})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Amount"}),c.jsx("input",{value:l.amount,onChange:$=>me("amount",$.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Currency"}),c.jsx("select",{value:l.currency,onChange:$=>me("currency",$.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:E.map($=>c.jsx("option",{children:$},$))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method Type"}),c.jsx("select",{value:l.payment_method_type,onChange:$=>me("payment_method_type",$.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Ge.map($=>c.jsx("option",{children:$},$))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method"}),c.jsx("select",{value:l.payment_method,onChange:$=>me("payment_method",$.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:H.map($=>c.jsx("option",{children:$},$))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Card Brand"}),c.jsx("select",{value:l.card_brand,onChange:$=>me("card_brand",$.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:D.map($=>c.jsx("option",{children:$},$))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Auth Type"}),c.jsx("select",{value:l.auth_type,onChange:$=>me("auth_type",$.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:N.map($=>c.jsx("option",{children:$},$))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Eligible Gateways (comma-separated)"}),c.jsx("input",{value:l.eligible_gateways,onChange:$=>me("eligible_gateways",$.target.value),placeholder:"stripe, adyen",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Algorithm"}),c.jsx("select",{value:l.ranking_algorithm,onChange:$=>me("ranking_algorithm",$.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:ace.map($=>c.jsx("option",{value:$,children:ice[$]},$))})]}),c.jsx("div",{className:"flex items-end pb-1",children:c.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:l.elimination_enabled,onChange:$=>me("elimination_enabled",$.target.checked),className:"rounded"}),"Elimination enabled"]})})]}),o==="single"&&c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Transaction Outcome"}),c.jsxs("select",{value:_,onChange:$=>O($.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:[c.jsx("option",{value:"CHARGED",children:"Success (CHARGED)"}),c.jsx("option",{value:"FAILURE",children:"Failure (FAILURE)"})]}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"After deciding the gateway, single test will post feedback with this outcome so the payment appears in Decision Audit."})]}),o==="batch"&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-4 mt-4 space-y-3",children:[c.jsxs("h3",{className:"text-sm font-medium text-slate-800 flex items-center gap-2",children:[c.jsx(_s,{size:14}),"Simulation Configuration"]}),c.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Total Payments"}),c.jsx("input",{type:"text",value:f.totalPayments,onChange:$=>d(z=>({...z,totalPayments:$.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Success Count"}),c.jsx("input",{type:"text",value:f.successCount,onChange:$=>d(z=>({...z,successCount:$.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Failure Count"}),c.jsx("input",{type:"text",value:f.failureCount,onChange:$=>d(z=>({...z,failureCount:$.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),c.jsxs("p",{className:"text-xs text-slate-500",children:["Will run ",f.totalPayments||0," payments: ",f.successCount||0," SUCCESS, ",f.failureCount||0," FAILURE"]})]})]}),c.jsx(Gr,{error:W}),o==="rule"?c.jsx(Te,{onClick:Fo,disabled:L||i,className:"w-full justify-center",children:L?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Evaluating…"]}):c.jsxs(c.Fragment,{children:[c.jsx(Md,{size:14})," Evaluate Rules"]})}):o==="volume"?c.jsx(Te,{onClick:Zt,disabled:L,className:"w-full justify-center",children:L?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Calculating…"]}):c.jsxs(c.Fragment,{children:[c.jsx(Qf,{size:14})," Visualize Distribution"]})}):o==="batch"?c.jsx(Te,{onClick:Rl,disabled:M||!e||i,className:"w-full justify-center",children:M?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14}),"Simulating ",P.length,"/",f.totalPayments||0,"..."]}):c.jsxs(c.Fragment,{children:[c.jsx(_s,{size:14})," Run Batch Simulation"]})}):c.jsx(Te,{onClick:Ui,disabled:L||!e||i,className:"w-full justify-center",children:L?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Running…"]}):c.jsxs(c.Fragment,{children:[c.jsx(Md,{size:14})," Run Single Transaction"]})})]})]}),c.jsx("div",{className:"space-y-4",children:o==="volume"?I.length>0?c.jsxs(c.Fragment,{children:[c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Volume Distribution Overview"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Preview only. This uses the active routing rule and stores a trace for inspection."})]}),k!=null&&k.payment_id?c.jsx(Te,{size:"sm",variant:"secondary",onClick:()=>Ga(k.payment_id,"Volume Split Preview"),children:"View preview trace"}):null]})}),c.jsxs(Le,{children:[c.jsxs("div",{className:"text-center mb-4",children:[c.jsx("p",{className:"text-3xl font-bold text-slate-900",children:v}),c.jsx("p",{className:"text-xs text-slate-500",children:"Total Payments"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4",children:I.map(($,z)=>c.jsxs("div",{className:"bg-slate-50 dark:bg-[#111114] rounded-lg p-3",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:Cr[z%Cr.length]}}),c.jsx("span",{className:"font-medium text-sm",children:$.name})]}),c.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[c.jsxs("span",{children:[$.percentage,"%"]}),c.jsxs("span",{className:"font-medium text-slate-700",children:[$.count," payments"]})]})]},z))})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Pie Chart"})}),c.jsx(Le,{children:c.jsx(As,{width:"100%",height:250,children:c.jsxs(U$,{children:[c.jsx(la,{data:jn,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:$,percent:z})=>`${$} ${(z*100).toFixed(0)}%`,labelLine:!1,children:jn.map(($,z)=>c.jsx(fo,{fill:Cr[z%Cr.length]},`cell-${z}`))}),c.jsx(_r,{formatter:$=>[`${$} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}})]})})})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Bar Chart"})}),c.jsx(Le,{children:c.jsx(As,{width:"100%",height:I.length*50+40,children:c.jsxs(r2,{data:I,layout:"vertical",margin:{left:20,right:40},children:[c.jsx(La,{type:"number",tick:{fontSize:12,fill:"#666"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),c.jsx(Fa,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#666"},width:80,axisLine:!1,tickLine:!1}),c.jsx(_r,{formatter:$=>[`${$} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}}),c.jsx(Ei,{dataKey:"count",radius:[0,6,6,0],children:I.map(($,z)=>c.jsx(fo,{fill:Cr[z%Cr.length]},`cell-${z}`))})]})})})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Percentage Distribution"})}),c.jsxs(Le,{children:[c.jsx("div",{className:"h-4 rounded-full overflow-hidden flex",children:I.map(($,z)=>c.jsx("div",{style:{width:`${$.percentage}%`,backgroundColor:Cr[z%Cr.length]},className:"h-full transition-all duration-300",title:`${$.name}: ${$.percentage}%`},z))}),c.jsx("div",{className:"flex flex-wrap gap-3 mt-3",children:I.map(($,z)=>c.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:Cr[z%Cr.length]}}),c.jsx("span",{className:"text-slate-600",children:$.name}),c.jsxs("span",{className:"font-medium",children:[$.percentage,"%"]})]},z))})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Summary"})}),c.jsx(Le,{className:"p-0",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"}),c.jsx("th",{className:"text-right px-4 py-2",children:"Payments"}),c.jsx("th",{className:"text-right px-4 py-2",children:"Percentage"})]})}),c.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:[I.map(($,z)=>c.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:Cr[z%Cr.length]}}),c.jsx("span",{className:"font-medium",children:$.name})]})}),c.jsx("td",{className:"px-4 py-2 text-right font-medium",children:$.count}),c.jsxs("td",{className:"px-4 py-2 text-right text-slate-500",children:[$.percentage,"%"]})]},z)),c.jsxs("tr",{className:"bg-slate-50 dark:bg-[#111114] font-medium",children:[c.jsx("td",{className:"px-4 py-2",children:"Total"}),c.jsx("td",{className:"px-4 py-2 text-right",children:v}),c.jsx("td",{className:"px-4 py-2 text-right",children:"100%"})]})]})]})})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Projected Sequence"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Preview-only projection based on the configured split. This is not a live payment trail."})]})}),c.jsx(Le,{className:"p-0 max-h-80 overflow-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500 sticky top-0",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2 w-20",children:"#"}),c.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:Nr.map(($,z)=>c.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[c.jsx("td",{className:"px-4 py-1.5 text-slate-500 font-mono text-xs",children:z+1}),c.jsx("td",{className:"px-4 py-1.5",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2 h-2 rounded",style:{backgroundColor:Cr[$.colorIdx%Cr.length]}}),c.jsx("span",{className:"font-medium",children:$.connector})]})})]},`${$.connector}-${z}`))})]})})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("button",{onClick:()=>be($=>!$),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ny,{size:14}),"API Response"]}),Q?c.jsx(du,{size:14}):c.jsx(cu,{size:14})]})}),Q&&k&&c.jsx(Le,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(k,null,2)})})]})]}):c.jsx(De,{children:c.jsxs(Le,{className:"py-16 text-center",children:[c.jsx(Qf,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Enter the number of payments and click "Visualize Distribution" to see how payments are split across gateways.'})]})}):o==="rule"?k?c.jsxs(c.Fragment,{children:[c.jsx(De,{children:c.jsxs(Le,{children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Status"}),c.jsx("p",{className:"text-2xl font-bold text-slate-900",children:k.status}),c.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["output_type: ",k.output.type]})]}),k.payment_id?c.jsx(Te,{size:"sm",variant:"secondary",onClick:()=>Ga(k.payment_id,"Rule Evaluation Preview"),children:"View preview trace"}):null]}),k.output.type==="single"&&k.output.connector&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Selected gateway_name"}),c.jsx("p",{className:"text-lg font-semibold",children:k.output.connector.gateway_name}),k.output.connector.gateway_id&&c.jsxs("p",{className:"text-xs text-slate-500",children:["gateway_id: ",k.output.connector.gateway_id]})]}),k.output.type==="priority"&&k.output.connectors&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Priority gateway_name list"}),c.jsx("div",{className:"space-y-1",children:k.output.connectors.map(($,z)=>c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-500 text-white text-xs flex items-center justify-center",children:z+1}),c.jsx("span",{className:"font-medium",children:$.gateway_name}),$.gateway_id&&c.jsxs("span",{className:"text-xs text-slate-500",children:["(",$.gateway_id,")"]})]},z))})]}),k.output.type==="volume_split"&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Volume Split Result"}),c.jsx("p",{className:"text-sm text-slate-600",children:"See Volume Split tab for detailed visualization."})]})]})}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("button",{onClick:()=>ae($=>!$),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ny,{size:14}),"API Response"]}),K?c.jsx(du,{size:14}):c.jsx(cu,{size:14})]})}),K&&c.jsx(Le,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(k,null,2)})})]})]}):c.jsx(De,{children:c.jsxs(Le,{className:"py-16 text-center",children:[c.jsx(Md,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Configure rule parameters and click "Evaluate Rules" to test routing.'})]})}):o==="batch"?P.length>0?c.jsxs(c.Fragment,{children:[c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Simulation Progress"})}),c.jsxs(Le,{children:[c.jsxs("div",{className:"mb-4",children:[c.jsxs("div",{className:"flex justify-between text-xs text-slate-600 mb-1",children:[c.jsx("span",{children:"Progress"}),c.jsxs("span",{children:[Math.round(P.length/(parseInt(f.totalPayments)||1)*100),"%"]})]}),c.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:c.jsx("div",{className:"bg-brand-500 h-2 rounded-full transition-all duration-300",style:{width:`${P.length/(parseInt(f.totalPayments)||1)*100}%`}})})]}),Object.keys(cr).length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-xs font-medium text-slate-700",children:"Gateway Selection Summary"}),Object.entries(cr).map(([$,z])=>c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"font-medium",children:$}),c.jsxs("div",{className:"flex gap-3 text-xs",children:[c.jsxs("span",{className:"text-emerald-600",children:[z.success," ✓"]}),c.jsxs("span",{className:"text-red-500",children:[z.failure," ✗"]}),c.jsxs("span",{className:"text-slate-500",children:["(",z.total," total)"]})]})]},$))]})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Transaction Log"})}),c.jsx(Le,{className:"p-0 max-h-96 overflow-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 sticky top-0",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-3 py-2",children:"#"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Payment ID"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Gateway"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Outcome"})]})}),c.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:P.map(($,z)=>c.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16]",children:[c.jsx("td",{className:"px-3 py-2 text-slate-500",children:z+1}),c.jsx("td",{className:"px-3 py-2",children:c.jsxs("button",{type:"button",title:$.paymentId,onClick:()=>Ha($.paymentId),className:"group flex items-start gap-3 text-left",children:[c.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-brand-500/10 text-[11px] font-semibold uppercase tracking-[0.16em] text-brand-600 dark:text-brand-300",children:z+1}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block truncate font-mono text-xs font-semibold text-slate-900 transition group-hover:text-brand-600 dark:text-white",children:$.paymentId}),c.jsx("span",{className:"mt-1 block text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-400 transition group-hover:text-brand-500",children:"View audit"})]})]})}),c.jsx("td",{className:"px-3 py-2 font-medium",children:$.decidedGateway}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(Oe,{variant:$.status==="CHARGED"?"green":"red",children:$.status})})]},$.paymentId))})]})})]})]}):c.jsx(De,{children:c.jsxs(Le,{className:"py-16 text-center",children:[c.jsx(_s,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.'})]})}):m?c.jsxs(c.Fragment,{children:[c.jsx(De,{children:c.jsxs(Le,{children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Decided Gateway"}),c.jsx("p",{className:"text-3xl font-bold text-slate-900",children:m.decided_gateway})]}),c.jsxs("div",{className:"text-right space-y-2",children:[c.jsx("div",{children:c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${oce(m.routing_approach)}`,children:m.routing_approach})}),S?c.jsx(Te,{size:"sm",variant:"secondary",onClick:()=>Ha(S),children:"View audit"}):null,m.is_scheduled_outage&&c.jsx(Oe,{variant:"red",children:"Scheduled Outage"}),S?c.jsx(Oe,{variant:_==="CHARGED"?"green":"red",children:_}):null,m.latency!=null&&c.jsxs("p",{className:"text-xs text-slate-400",children:[m.latency,"ms"]})]})]}),S?c.jsxs("div",{className:"mb-3 rounded-[18px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Payment ID"}),c.jsx("p",{className:"mt-2 font-mono text-sm text-slate-900 dark:text-white",children:S}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:["Feedback recorded as ",_,". Open audit to inspect the full decide and update flow."]})]}):null,m.routing_dimension&&c.jsxs("div",{className:"flex gap-4 text-sm text-slate-600 border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Dimension"}),c.jsx("p",{className:"font-medium",children:m.routing_dimension})]}),m.routing_dimension_level&&c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Level"}),c.jsx("p",{className:"font-medium",children:m.routing_dimension_level})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Reset"}),c.jsx("p",{className:"font-medium",children:m.reset_approach})]})]})]})}),Qt.length>0&&c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Scores"}),c.jsxs(Te,{size:"sm",variant:"ghost",onClick:Ui,className:"text-xs",children:[c.jsx(ay,{size:12})," Refresh"]})]})}),c.jsx(Le,{children:c.jsx(As,{width:"100%",height:Qt.length*40+20,children:c.jsxs(r2,{data:Qt,layout:"vertical",margin:{left:10,right:30},children:[c.jsx(La,{type:"number",domain:[0,100],tickFormatter:$=>`${$}%`,tick:{fontSize:11,fill:"#66667a"},axisLine:{stroke:"#1c1c24"},tickLine:!1}),c.jsx(Fa,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#8e8ea0"},width:60,axisLine:!1,tickLine:!1}),c.jsx(_r,{formatter:$=>`${$}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),c.jsx(Ei,{dataKey:"score",radius:[0,4,4,0],children:Qt.map(($,z)=>c.jsx(fo,{fill:$.name===m.decided_gateway?"#0069ED":$.score<30?"#ef4444":$.score<60?"#f59e0b":"#10b981"},z))})]})})})]}),m.filter_wise_gateways&&c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("button",{onClick:()=>J($=>!$),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:["Filter Chain",q?c.jsx(du,{size:14}):c.jsx(cu,{size:14})]})}),q&&c.jsx(Le,{className:"space-y-2",children:Object.entries(m.filter_wise_gateways).map(([$,z])=>c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:"text-xs font-mono bg-slate-100 dark:bg-[#111118] text-slate-600 rounded-md px-2 py-0.5 mt-0.5 shrink-0 border border-slate-200 dark:border-[#1c1c24]",children:$}),c.jsx("div",{className:"flex flex-wrap gap-1",children:Array.isArray(z)?z.map(se=>c.jsx("span",{className:"text-xs bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20 rounded-md px-2 py-0.5",children:se},se)):c.jsx("span",{className:"text-xs text-slate-400",children:"—"})})]},$))})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("button",{onClick:()=>ae($=>!$),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ny,{size:14}),"API Response"]}),K?c.jsx(du,{size:14}):c.jsx(cu,{size:14})]})}),K&&c.jsx(Le,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(m,null,2)})})]})]}):c.jsx(De,{children:c.jsxs(Le,{className:"py-16 text-center",children:[c.jsx(Md,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Fill in the parameters and click "Run Single Transaction" to decide a gateway, post feedback, and inspect the audit trail.'})]})})})]}),ue&&c.jsxs("div",{className:"fixed bottom-0 left-64 right-0 top-[76px] z-[130] p-8",children:[c.jsx("button",{type:"button","aria-label":"Close payment audit",className:"absolute inset-0 bg-slate-950/70 backdrop-blur-sm",onClick:On}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"decision-explorer-audit-title",className:"relative mx-auto flex h-full w-full max-w-7xl flex-col overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-2xl dark:border-[#1c1c23] dark:bg-[#09090d]",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-slate-200 bg-slate-50/90 px-6 py-5 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-[#8a8a93]",children:"Batch Simulation Audit"}),c.jsx("h2",{id:"decision-explorer-audit-title",className:"mt-2 truncate text-2xl font-semibold text-slate-900 dark:text-white",children:ue}),c.jsx("p",{className:"mt-2 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:"Inspect the exact decision trail for this simulated payment, including request payloads, API responses, score context, and the final transaction outcome."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ut!=null&&ut.latest_gateway?c.jsx(Oe,{variant:"green",children:ut.latest_gateway}):null,ut!=null&&ut.latest_status?c.jsx(Oe,{variant:i2(ut.latest_status),children:un(ut.latest_status)}):null,ut!=null&&ut.event_count?c.jsxs(Oe,{variant:"gray",children:[ut.event_count," events"]}):null,c.jsxs(Te,{size:"sm",variant:"secondary",onClick:()=>G.mutate(),children:[c.jsx(ay,{size:12}),"Refresh"]}),c.jsxs(Te,{size:"sm",variant:"ghost",onClick:On,children:[c.jsx(s_,{size:14}),"Close"]})]})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 gap-0 xl:grid-cols-[340px_minmax(0,1fr)]",children:[c.jsxs("div",{className:"flex min-h-0 flex-col border-b border-slate-200 bg-slate-50/70 xl:border-b-0 xl:border-r dark:border-[#1c1c23] dark:bg-[#08080b]",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"Audit Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Choose a step to inspect its request, response, and scoring context."})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:G.isLoading&&!G.data?c.jsxs("div",{className:"flex items-center gap-2 px-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading payment audit…"]}):G.error?c.jsx(Gr,{error:G.error.message}):ua.length?c.jsx("div",{className:"space-y-4",children:ua.map($=>c.jsxs("section",{className:"space-y-2",children:[c.jsx("div",{className:"px-2",children:c.jsx(Oe,{variant:o2($.phase),children:$.phase})}),c.jsx("div",{className:"space-y-2",children:$.events.map(z=>c.jsxs("button",{type:"button",onClick:()=>{te(z.id),he("summary")},className:`w-full rounded-[22px] border px-4 py-3 text-left transition ${(Ue==null?void 0:Ue.id)===z.id?"border-brand-500/50 bg-brand-500/8":"border-slate-200 bg-white hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#0c0c10] dark:hover:border-[#2a2a31]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:vu(z)}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:mu(z.created_at_ms)})]}),c.jsx(Oe,{variant:nf(z),children:un(z.status)||a2(z.event_type)})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(Oe,{variant:"gray",children:yu(z.route)}),z.gateway?c.jsx(Oe,{variant:"green",children:z.gateway}):null,z.request_id?c.jsx(Oe,{variant:"blue",children:"Request"}):null]})]},z.id))})]},$.phase))}):c.jsx(gu,{title:"No audit trail captured yet",body:"Run a simulated payment and gateway update first, then reopen the row once the audit payload is available."})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:Ue?vu(Ue):"Audit Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:Ue?`${yu(Ue.route)} · ${mu(Ue.created_at_ms)}`:"Select an event from the left to inspect payloads."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ue!=null&&Ue.gateway?c.jsx(Oe,{variant:"green",children:Ue.gateway}):null,Ue!=null&&Ue.status?c.jsx(Oe,{variant:nf(Ue),children:un(Ue.status)}):null]})]}),c.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["summary","input","response","raw"].map($=>c.jsx("button",{type:"button",onClick:()=>he($),className:`rounded-full px-4 py-2 text-xs font-semibold uppercase tracking-[0.16em] transition ${l2(ie===$)}`,children:$==="raw"?"Raw JSON":un($)},$))})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:G.isLoading&&!G.data?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading inspector…"]}):ot?c.jsxs("div",{className:"space-y-5",children:[ie==="summary"?c.jsxs(c.Fragment,{children:[c.jsx(u2,{rows:ot.summaryRows}),ot.selectionReason?c.jsxs("div",{className:"rounded-[22px] border border-slate-200 bg-slate-50/80 px-5 py-4 dark:border-[#1d1d23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Selection Reason"}),c.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-700 dark:text-slate-200",children:W$(ot.selectionReason)})]}):null,c.jsx(fa,{title:"Score Context",value:ot.scoreContext,emptyMessage:"No scoring context was captured for this event."}),ot.signalRecord?c.jsx(fa,{title:"Additional Signals",value:ot.signalRecord,emptyMessage:"No additional signals were captured for this event."}):null]}):null,ie==="input"?c.jsx(fa,{title:"Request Payload",value:ot.requestPayload,emptyMessage:"This step did not persist a request payload."}):null,ie==="response"?c.jsx(fa,{title:"Response Payload",value:ot.responsePayload,emptyMessage:"This step did not persist a response payload."}):null,ie==="raw"?c.jsx(fa,{title:"Raw Event JSON",value:ot.rawEvent,emptyMessage:"No raw event payload is available."}):null]}):c.jsx(gu,{title:"Select a timeline step",body:"Choose one of the audit events on the left to inspect its request, response, and score context."})})]})]})]})]}),X&&c.jsxs("div",{className:"fixed bottom-0 left-64 right-0 top-[76px] z-[130] p-8",children:[c.jsx("button",{type:"button","aria-label":"Close preview trace",className:"absolute inset-0 bg-slate-950/70 backdrop-blur-sm",onClick:zo}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"decision-explorer-preview-title",className:"relative mx-auto flex h-full w-full max-w-7xl flex-col overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-2xl dark:border-[#1c1c23] dark:bg-[#09090d]",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-slate-200 bg-slate-50/90 px-6 py-5 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-[#8a8a93]",children:"Preview Trace"}),c.jsx("h2",{id:"decision-explorer-preview-title",className:"mt-2 truncate text-2xl font-semibold text-slate-900 dark:text-white",children:X}),c.jsxs("p",{className:"mt-2 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:[Ce,". This is a preview-only trace captured from ",c.jsx("code",{className:"font-mono text-xs",children:"/routing/evaluate"}),", not a transaction outcome."]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Et!=null&&Et.latest_gateway?c.jsx(Oe,{variant:"green",children:Et.latest_gateway}):null,Et!=null&&Et.latest_status?c.jsx(Oe,{variant:i2(Et.latest_status),children:un(Et.latest_status)}):null,Et!=null&&Et.event_count?c.jsxs(Oe,{variant:"gray",children:[Et.event_count," events"]}):null,c.jsxs(Te,{size:"sm",variant:"secondary",onClick:()=>Z.mutate(),children:[c.jsx(ay,{size:12}),"Refresh"]}),c.jsxs(Te,{size:"sm",variant:"ghost",onClick:zo,children:[c.jsx(s_,{size:14}),"Close"]})]})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 gap-0 xl:grid-cols-[340px_minmax(0,1fr)]",children:[c.jsxs("div",{className:"flex min-h-0 flex-col border-b border-slate-200 bg-slate-50/70 xl:border-b-0 xl:border-r dark:border-[#1c1c23] dark:bg-[#08080b]",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"Preview Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Choose a preview step to inspect its request, response, and routing output."})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:Z.isLoading&&!Z.data?c.jsxs("div",{className:"flex items-center gap-2 px-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading preview trace…"]}):Z.error?c.jsx(Gr,{error:Z.error.message}):rn.length?c.jsx("div",{className:"space-y-4",children:rn.map($=>c.jsxs("section",{className:"space-y-2",children:[c.jsx("div",{className:"px-2",children:c.jsx(Oe,{variant:o2($.phase),children:$.phase})}),c.jsx("div",{className:"space-y-2",children:$.events.map(z=>c.jsxs("button",{type:"button",onClick:()=>{Ae(z.id),ge("summary")},className:`w-full rounded-[22px] border px-4 py-3 text-left transition ${(Ve==null?void 0:Ve.id)===z.id?"border-brand-500/50 bg-brand-500/8":"border-slate-200 bg-white hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#0c0c10] dark:hover:border-[#2a2a31]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:vu(z)}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:mu(z.created_at_ms)})]}),c.jsx(Oe,{variant:nf(z),children:un(z.status)||a2(z.event_type)})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(Oe,{variant:"gray",children:yu(z.route)}),z.gateway?c.jsx(Oe,{variant:"green",children:z.gateway}):null]})]},z.id))})]},$.phase))}):c.jsx(gu,{title:"No preview trace captured yet",body:"Run Rule-Based or Volume Split evaluation first, then open the preview trace once the request has been logged."})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:Ve?vu(Ve):"Preview Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:Ve?`${yu(Ve.route)} · ${mu(Ve.created_at_ms)}`:"Select an event from the left to inspect the preview payload."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ve!=null&&Ve.gateway?c.jsx(Oe,{variant:"green",children:Ve.gateway}):null,Ve!=null&&Ve.status?c.jsx(Oe,{variant:nf(Ve),children:un(Ve.status)}):null]})]}),c.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["summary","input","response","raw"].map($=>c.jsx("button",{type:"button",onClick:()=>ge($),className:`rounded-full px-4 py-2 text-xs font-semibold uppercase tracking-[0.16em] transition ${l2(ze===$)}`,children:$==="raw"?"Raw JSON":un($)},$))})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:Z.isLoading&&!Z.data?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading preview inspector…"]}):nn?c.jsxs("div",{className:"space-y-5",children:[ze==="summary"?c.jsxs(c.Fragment,{children:[c.jsx(u2,{rows:nn.summaryRows}),c.jsx(fa,{title:"Preview Signals",value:nn.signalRecord,emptyMessage:"No extra preview metadata was captured for this evaluation."})]}):null,ze==="input"?c.jsx(fa,{title:"Request Payload",value:nn.requestPayload,emptyMessage:"No request payload was captured for this preview."}):null,ze==="response"?c.jsx(fa,{title:"Response Payload",value:nn.responsePayload,emptyMessage:"No response payload was captured for this preview."}):null,ze==="raw"?c.jsx(fa,{title:"Raw Event JSON",value:nn.rawEvent,emptyMessage:"No raw event payload is available for this preview."}):null]}):c.jsx(gu,{title:"Select a preview step",body:"Choose one of the preview events on the left to inspect its request and response payload."})})]})]})]})]})]})}const c2=[{value:"15m",label:"Last 15 mins"},{value:"1h",label:"Last 1 hour"},{value:"24h",label:"Last 1 day"},{value:"custom",label:"Custom window"}],Ya=["#0069ED","#14b8a6","#f97316","#e11d48","#8b5cf6","#22c55e"],d2={backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"14px",color:"#e8e8f4",boxShadow:"0 16px 40px rgba(0, 0, 0, 0.35)"},f2={color:"#f8fafc",fontWeight:600,marginBottom:8},p2={color:"#e2e8f0"},h2={zIndex:30,outline:"none"},m2={dimensions:{},gateways:[]},nu=3,lv={hits:{title:"API call counts",purpose:"Use these cards to see how much traffic each major decision-engine API handled in the selected window.",calculation:"Each request records one lightweight API-call event. The cards count those recorded calls for `/decide_gateway`, `/update_gateway`, and `/rule_evaluate`.",source:"Counts come from analytics rows persisted in `analytics_event` in Postgres."},share:{title:"Gateway share over time",purpose:"Use this to see when traffic shifted from one connector to another for the selected merchant.",calculation:"Decision events are bucketed by time and grouped by chosen connector. The chart shows how many decisions each gateway captured in each bucket.",source:"Reads persisted `decision` rows from `analytics_event` in Postgres."},sr:{title:"Connector success rate over time",purpose:"Use this to explain why a connector won routing at a given time, based on the recorded historical score trail.",calculation:"Stored `score_snapshot` events are bucketed over the selected window and averaged per connector. The line values are displayed as percentages.",source:"Reads persisted `score_snapshot` rows from `analytics_event` in Postgres. The current score state originates from Redis-backed scoring flows."}};function fce(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function uv(e,t,r,n,a){const i={scope:"current",range:t==="custom"?"1h":t,start_ms:n==null?void 0:n.start_ms,end_ms:n==null?void 0:n.end_ms,merchant_id:r,gateway:a!=null&&a.gateways.length?a.gateways.join(","):void 0};Object.entries((a==null?void 0:a.dimensions)||{}).forEach(([s,l])=>{l&&(i[s]=l)});const o=fce(i);return o?`${e}?${o}`:e}function Nw(e,t=2){if(e==null||Number.isNaN(Number(e)))return"0";const r=Number(e);return Number.isInteger(r)?r.toString():r.toFixed(t)}function H$(e){return Number.isFinite(e)?e<=1?e*100:e:0}function y2(e,t=1){return e==null||Number.isNaN(Number(e))?"0%":`${Nw(H$(Number(e)),t)}%`}function v2(e){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function af(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function pce(e){const t=Date.now(),r=e==="15m"?15*60*1e3:e==="1h"?60*60*1e3:24*60*60*1e3;return{start_ms:t-r,end_ms:t}}function of(e){const t=new Date(e),r=n=>n.toString().padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}T${r(t.getHours())}:${r(t.getMinutes())}`}function g2(e){const t=new Date(e).getTime();return Number.isFinite(t)?t:null}function sf({title:e,body:t}){return c.jsxs("div",{className:"rounded-[24px] border border-dashed border-slate-200 bg-white/60 px-6 py-12 text-center dark:border-[#222227] dark:bg-[#0b0b0d]",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function lf(){return"h-11 w-full rounded-2xl border border-slate-200 bg-white px-4 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]"}function cv({content:e}){const[t,r]=j.useState(!1),n=j.useRef(null),[a,i]=j.useState({top:0,left:0,width:320});return j.useEffect(()=>{if(!t)return;function o(s){var l;(l=n.current)!=null&&l.contains(s.target)||r(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[t]),j.useLayoutEffect(()=>{if(!t||!n.current)return;const o=320,s=280,l=16,u=12;function f(){if(!n.current)return;const d=n.current.getBoundingClientRect(),p=Math.min(o,window.innerWidth-l*2),h=Math.min(Math.max(d.right-p,l),window.innerWidth-p-l),y=d.bottom+u+s>window.innerHeight-l?Math.max(d.top-s-u,l):d.bottom+u;i({top:y,left:h,width:p})}return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0)}},[t]),c.jsxs("div",{ref:n,className:"relative shrink-0",children:[c.jsx("button",{type:"button","aria-label":`About ${e.title}`,onClick:()=>r(o=>!o),className:`flex h-7 w-7 items-center justify-center rounded-full border text-xs font-semibold transition ${t?"border-brand-500/50 bg-brand-500/10 text-brand-700 dark:text-brand-200":"border-slate-200 bg-white text-slate-500 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#8a8a93] dark:hover:text-white"}`,children:"i"}),t?c.jsxs("div",{style:{position:"fixed",top:a.top,left:a.left,width:a.width},className:"z-[120] rounded-[24px] border border-slate-200 bg-white/95 p-4 shadow-2xl backdrop-blur dark:border-[#1d1d23] dark:bg-[#09090d]/95",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e.title}),c.jsxs("div",{className:"mt-3 space-y-3 text-xs leading-6 text-slate-600 dark:text-[#b3b3bd]",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Why it matters"}),c.jsx("p",{className:"mt-1",children:e.purpose})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"How it is calculated"}),c.jsx("p",{className:"mt-1",children:e.calculation})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Data source"}),c.jsx("p",{className:"mt-1",children:e.source})]})]})]}):null]})}function hce({label:e,value:t,subtitle:r}){return c.jsx(De,{className:"h-full overflow-hidden",children:c.jsxs(Le,{className:"flex h-full min-h-[150px] flex-col justify-between",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Endpoint hits"}),c.jsx("p",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:e})]}),c.jsxs("div",{className:"flex items-end justify-between gap-4",children:[c.jsx("p",{className:"text-5xl font-semibold tracking-tight text-slate-950 dark:text-white",children:Nw(t,0)}),c.jsx(Oe,{variant:"blue",children:r})]})]})})}function mce(e){return e==="/decide_gateway"?"Decide Gateway":e==="/update_gateway"?"Update Gateway":e==="/rule_evaluate"?"Rule Evaluate":e}function yce(){var Pe,Fe,te,ie,he,X,ke,ve,Ae,ze,ge,Ce,Me,je,Ge;const{merchantId:e}=ia(),[t,r]=j.useState("1h"),[n,a]=j.useState(m2),[i,o]=j.useState(!1),[s,l]=j.useState(()=>of(Date.now()-2*60*60*1e3)),[u,f]=j.useState(()=>of(Date.now())),d=!!e,p=j.useMemo(()=>{if(t!=="custom")return;const H=g2(s),E=g2(u);if(!(H===null||E===null||E<=H))return{start_ms:H,end_ms:E}},[u,s,t]),h=d&&e&&(t!=="custom"||p)?uv("/analytics/overview",t,e,p):null,x=d&&e&&(t!=="custom"||p)?uv("/analytics/routing-stats",t,e,p):null,y=d&&e&&(t!=="custom"||p)?uv("/analytics/routing-stats",t,e,p,n):null,v={refreshInterval:1e4,revalidateOnFocus:!0,revalidateIfStale:!1},g={refreshInterval:12e3,revalidateOnFocus:!0,revalidateIfStale:!1},m={...g,keepPreviousData:!0},w=Ft(h,Qn,v),S=Ft(x,Qn,g),b=Ft(y,Qn,m),_=!w.data&&w.isLoading||!S.data&&S.isLoading||!b.data&&b.isLoading,O=((Pe=w.error)==null?void 0:Pe.message)||((Fe=S.error)==null?void 0:Fe.message)||((te=b.error)==null?void 0:te.message)||null,k={dimensions:((he=(ie=S.data)==null?void 0:ie.available_filters)==null?void 0:he.dimensions)||((ke=(X=b.data)==null?void 0:X.available_filters)==null?void 0:ke.dimensions)||[],missing_dimensions:((Ae=(ve=S.data)==null?void 0:ve.available_filters)==null?void 0:Ae.missing_dimensions)||((ge=(ze=b.data)==null?void 0:ze.available_filters)==null?void 0:ge.missing_dimensions)||[],gateways:((Me=(Ce=S.data)==null?void 0:Ce.available_filters)==null?void 0:Me.gateways)||((Ge=(je=b.data)==null?void 0:je.available_filters)==null?void 0:Ge.gateways)||[]},A=j.useMemo(()=>new Map(k.dimensions.map(H=>[H.key,H])),[k.dimensions]);j.useEffect(()=>{a(H=>{const E=Object.fromEntries(Object.entries(H.dimensions).filter(([N,B])=>{if(!B)return!1;const G=A.get(N);return G?G.values.includes(B):!1})),D=H.gateways.filter(N=>k.gateways.includes(N));return Object.keys(E).length===Object.keys(H.dimensions).length&&Object.entries(E).every(([N,B])=>H.dimensions[N]===B)&&D.length===H.gateways.length&&D.every((N,B)=>N===H.gateways[B])?H:{dimensions:E,gateways:D}})},[A,k.gateways]),j.useEffect(()=>{k.dimensions.length<=nu&&i&&o(!1)},[k.dimensions.length,i]);const I=j.useMemo(()=>{var H;return t!=="custom"?((H=c2.find(E=>E.value===t))==null?void 0:H.label)||"Selected window":p?`${af(p.start_ms)} to ${af(p.end_ms)}`:"Custom window"},[p,t]),T=j.useMemo(()=>{var E,D;const H=[{route:"/decide_gateway",count:0},{route:"/update_gateway",count:0},{route:"/rule_evaluate",count:0}];return(D=(E=w.data)==null?void 0:E.route_hits)!=null&&D.length?H.map(N=>{var B,G;return{...N,count:((G=(B=w.data)==null?void 0:B.route_hits.find(ee=>ee.route===N.route))==null?void 0:G.count)||0}}):H},[w.data]),P=j.useMemo(()=>{var D,N;const H=Array.from(new Set((((D=S.data)==null?void 0:D.gateway_share)||[]).map(B=>B.gateway))).slice(0,6),E=new Map;for(const B of((N=S.data)==null?void 0:N.gateway_share)||[]){if(!H.includes(B.gateway))continue;const G=E.get(B.bucket_ms)||{bucket_ms:B.bucket_ms};G[B.gateway]=B.count,E.set(B.bucket_ms,G)}return{gateways:H,rows:Array.from(E.values()).sort((B,G)=>B.bucket_ms-G.bucket_ms)}},[S.data]),R=j.useMemo(()=>{var D,N;const H=Array.from(new Set((((D=b.data)==null?void 0:D.sr_trend)||[]).map(B=>B.gateway))).slice(0,6),E=new Map;for(const B of((N=b.data)==null?void 0:N.sr_trend)||[]){if(!H.includes(B.gateway))continue;const G=E.get(B.bucket_ms)||{bucket_ms:B.bucket_ms};G[B.gateway]=H$(B.score_value),E.set(B.bucket_ms,G)}return{gateways:H,rows:Array.from(E.values()).sort((B,G)=>B.bucket_ms-G.bucket_ms)}},[b.data]),M=j.useMemo(()=>{if(!R.rows.length)return[];const H=R.rows[R.rows.length-1];return R.gateways.map(E=>({gateway:E,value:typeof H[E]=="number"?H[E]:null})).filter(E=>E.value!==null)},[R]),F=j.useMemo(()=>{const H=R.rows.flatMap(B=>R.gateways.map(G=>B[G]).filter(G=>typeof G=="number"));if(!H.length)return[0,100];const E=Math.min(...H),D=Math.max(...H),N=E===D?5:Math.max(2,(D-E)*.35);return[Math.max(0,Math.floor(E-N)),Math.min(100,Math.ceil(D+N))]},[R]),W=j.useMemo(()=>{const H=k.dimensions.flatMap(E=>{const D=n.dimensions[E.key];return D?[`${E.label}: ${D}`]:[]});return n.gateways.length&&H.push(n.gateways.join(", ")),H.length?H.join(" / "):"All routing dimensions"},[k.dimensions,n]),V=j.useMemo(()=>i||k.dimensions.length<=nu?k.dimensions:k.dimensions.slice(0,nu),[k.dimensions,i]),L=k.dimensions.length>nu,U=L?k.dimensions.length-nu:0,q=j.useMemo(()=>{const H=k.dimensions.flatMap(D=>{const N=n.dimensions[D.key];return N?[{key:`dimension:${D.key}`,label:`${D.label}: ${N}`}]:[]}),E=n.gateways.map(D=>({key:`gateway:${D}`,label:`Connector: ${D}`}));return[...H,...E]},[k.dimensions,n]);function J(H){if(r(H),H!=="custom"){const E=pce(H);l(of(E.start_ms)),f(of(E.end_ms))}}function K(){w.mutate(),S.mutate(),b.mutate()}function ae(H){a(E=>{const D=E.gateways.includes(H);return{...E,gateways:D?E.gateways.filter(N=>N!==H):[...E.gateways,H]}})}function Q(){a(m2)}function be(H){if(H.startsWith("dimension:")){ue(H.replace("dimension:",""),"");return}H.startsWith("gateway:")&&ae(H.replace("gateway:",""))}function ue(H,E){a(D=>{const N={...D.dimensions};return E?N[H]=E:delete N[H],{...D,dimensions:N}})}return d?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Analytics"}),c.jsx(Oe,{variant:"green",children:e||"Current merchant"})]}),c.jsx("p",{className:"text-sm text-slate-500 dark:text-[#8a8a93]",children:"One working surface for route volume, connector share, and historical connector success rate."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(Te,{size:"sm",variant:"ghost",onClick:K,children:"Refresh"})})]}),c.jsx(De,{className:"overflow-visible",children:c.jsxs(Le,{className:"flex flex-wrap items-end gap-4",children:[c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Time window"}),c.jsx("select",{value:t,onChange:H=>J(H.target.value),className:lf(),children:c2.map(H=>c.jsx("option",{value:H.value,children:H.label},H.value))})]}),t==="custom"?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Start time"}),c.jsx("input",{type:"datetime-local",value:s,onChange:H=>l(H.target.value),className:lf()})]}),c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"End time"}),c.jsx("input",{type:"datetime-local",value:u,onChange:H=>f(H.target.value),className:lf()})]})]}):null,c.jsxs("div",{className:"min-w-[220px] flex-1 rounded-[24px] border border-slate-200 bg-white px-4 py-3 dark:border-[#1d1d23] dark:bg-[#0c0c0e]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Active window"}),c.jsx("p",{className:"mt-1 text-sm font-medium text-slate-900 dark:text-white",children:I}),t==="custom"&&!p?c.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Choose an end time after the start time."}):null]})]})}),c.jsx(Gr,{error:O}),_?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading analytics…"]}):null,c.jsxs("section",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"API calls"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Counts for the three routing surfaces most operators watch first."})]}),c.jsx(cv,{content:lv.hits})]}),c.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:T.map(H=>c.jsx(hce,{label:mce(H.route),value:H.count,subtitle:t==="custom"?"Custom window":I},H.route))})]}),c.jsxs(De,{className:"overflow-visible",children:[c.jsx(Ze,{children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Gateway share over time"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"How decision volume moved across connectors inside the selected merchant window."})]}),c.jsx(cv,{content:lv.share})]})}),c.jsx(Le,{children:P.rows.length?c.jsx("div",{className:"h-80",children:c.jsx(As,{width:"100%",height:"100%",children:c.jsxs(ece,{data:P.rows,children:[c.jsx(Y0,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),c.jsx(La,{dataKey:"bucket_ms",tickFormatter:v2,tick:{fontSize:11}}),c.jsx(Fa,{tick:{fontSize:11}}),c.jsx(_r,{labelFormatter:H=>af(Number(H)),contentStyle:d2,labelStyle:f2,itemStyle:p2,wrapperStyle:h2}),c.jsx(Aa,{}),P.gateways.map((H,E)=>c.jsx(Li,{type:"monotone",dataKey:H,stackId:"1",stroke:Ya[E%Ya.length],fill:Ya[E%Ya.length],fillOpacity:.24,name:H},H))]})})}):c.jsx(sf,{title:"No gateway share history yet",body:"Send real decide-gateway traffic in the selected window to populate connector share."})})]}),c.jsxs(De,{className:"overflow-visible",children:[c.jsx(Ze,{children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Connector success rate over time"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Historical connector score trend for the selected merchant window."}),c.jsxs("p",{className:"mt-2 text-xs font-medium text-slate-600 dark:text-[#b3b3bd]",children:["Active filters: ",W]})]}),c.jsx(cv,{content:lv.sr})]})}),c.jsxs(Le,{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-[24px] border border-slate-200 bg-white p-4 dark:border-[#1d1d23] dark:bg-[#0c0c0e]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Connector filters"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Narrow the success-rate line chart by the routing dimensions present for this merchant."})]}),c.jsx(Te,{size:"sm",variant:"secondary",onClick:Q,disabled:!Object.values(n.dimensions).some(Boolean)&&!n.gateways.length,children:"Clear filters"})]}),k.dimensions.length?c.jsxs("div",{className:"mt-4 space-y-3",children:[c.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:V.map(H=>c.jsxs("label",{className:"space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:H.label}),c.jsxs("select",{value:n.dimensions[H.key]||"",onChange:E=>ue(H.key,E.target.value),className:lf(),disabled:!H.values.length,children:[c.jsxs("option",{value:"",children:["All ",H.label.toLowerCase()]}),H.values.map(E=>c.jsx("option",{value:E,children:E},E))]})]},H.key))}),L?c.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-slate-200 bg-white px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:i?"Showing all routing dimensions available for this merchant.":`${U} more routing dimension${U===1?"":"s"} available for this merchant.`}),c.jsx(Te,{size:"sm",variant:"secondary",onClick:()=>o(H=>!H),children:i?"Show fewer filters":"More filters"})]}):null]}):k.missing_dimensions.length?c.jsx(sf,{title:"No populated routing dimensions in this window",body:"The merchant has score history, but none of the dynamic routing dimensions have values recorded in the selected time window yet."}):null,k.missing_dimensions.length?c.jsxs("div",{className:"mt-4 rounded-2xl border border-dashed border-slate-200 bg-white px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"No values in this window yet"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:k.missing_dimensions.map(H=>H.label).join(", ")})]}):null,q.length?c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Active filters"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:q.map(H=>c.jsxs("button",{type:"button",onClick:()=>be(H.key),className:"inline-flex items-center gap-2 rounded-full border border-brand-500/30 bg-brand-500/10 px-3 py-1.5 text-xs font-semibold text-brand-700 transition hover:bg-brand-500/15 dark:text-brand-200",children:[c.jsx("span",{children:H.label}),c.jsx("span",{"aria-hidden":"true",children:"×"})]},H.key))})]}):null,c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Connectors"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:k.gateways.length?k.gateways.map(H=>{const E=n.gateways.includes(H);return c.jsx("button",{type:"button",onClick:()=>ae(H),className:`rounded-full border px-3 py-1.5 text-xs font-semibold transition ${E?"border-brand-500/50 bg-brand-500/10 text-brand-700 dark:text-brand-200":"border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#a1a1aa] dark:hover:text-white"}`,children:H},H)}):c.jsx("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:"No connector history yet for the selected window."})})]})]}),M.length?c.jsx("div",{className:"flex flex-wrap gap-2",children:M.map(H=>c.jsxs(Oe,{variant:"blue",children:[H.gateway,": ",y2(H.value)]},H.gateway))}):null,R.rows.length?c.jsx("div",{className:"h-80",children:c.jsx(As,{width:"100%",height:"100%",children:c.jsxs(Jue,{data:R.rows,children:[c.jsx(Y0,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),c.jsx(La,{dataKey:"bucket_ms",tickFormatter:v2,tick:{fontSize:11}}),c.jsx(Fa,{domain:F,tick:{fontSize:11},tickFormatter:H=>`${Nw(Number(H),0)}%`}),c.jsx(_r,{labelFormatter:H=>af(Number(H)),formatter:(H,E)=>[y2(H),String(E)],contentStyle:d2,labelStyle:f2,itemStyle:p2,wrapperStyle:h2}),c.jsx(Aa,{}),R.gateways.map((H,E)=>c.jsx(vd,{type:"monotone",dataKey:H,stroke:Ya[E%Ya.length],strokeWidth:3,dot:{r:3,strokeWidth:1,fill:Ya[E%Ya.length]},activeDot:{r:5},name:H},H))]})})}):c.jsx(sf,{title:"No connector score history yet",body:"Send decide-gateway and update-gateway-score traffic in the selected window to populate connector history."})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Analytics"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Set a merchant in the top bar to load merchant-scoped analytics."})]}),c.jsx(sf,{title:"Select a merchant first",body:"The analytics surface is merchant-scoped. Use the merchant selector in the top bar to load data."})]})}const vce=["15m","1h","24h"],gce=[{value:"",label:"Any status"},{value:"success",label:"Success"},{value:"failure",label:"Failure"}],xce=[{value:"",label:"Any route"},{value:"decide_gateway",label:"Decide Gateway"},{value:"update_gateway_score",label:"Update Gateway"},{value:"routing_evaluate",label:"Rule Evaluate"}],bce=["summary","input","response","raw"],dv={paymentId:"",requestId:"",gateway:"",route:"",status:"",eventType:"",errorCode:""};function Uu(e){const t=e.paymentId.trim(),r=t?"":e.requestId.trim();return{paymentId:t,requestId:r,gateway:e.gateway.trim(),route:e.route,status:e.status,eventType:e.eventType,errorCode:e.errorCode.trim()}}function G$(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function x2(e,t,r,n,a){const i=Uu(a),o={scope:"current",range:e,page:r,page_size:n,merchant_id:t,payment_id:i.paymentId||void 0,request_id:i.requestId||void 0,gateway:i.gateway||void 0,route:i.route||void 0,status:i.status||void 0,event_type:i.eventType||void 0,error_code:i.errorCode||void 0},s=G$(o);return s?`/analytics/payment-audit?${s}`:"/analytics/payment-audit"}function wce(e){return e==="15m"||e==="24h"?e:"24h"}function _ce(e){return Uu({paymentId:e.get("payment_id")||"",requestId:e.get("request_id")||"",gateway:e.get("gateway")||"",route:e.get("route")||"",status:e.get("status")||"",eventType:e.get("event_type")||"",errorCode:e.get("error_code")||""})}function Of(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function Sce(e){const t=Math.max(0,Math.round((Date.now()-e)/6e4));if(t<1)return"just now";if(t<60)return`${t}m ago`;const r=Math.round(t/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Ns(e){return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase()):""}function q$(e){return e?e==="decision_gateway"||e==="decide_gateway"?"Decide Gateway":e==="update_gateway_score"?"Update Gateway":e==="routing_evaluate"?"Rule Evaluate":Ns(e):"Unknown route"}function jce(e){return e?e==="decision"?"Decide Gateway":e==="gateway_update"?"Update Gateway":e==="rule_hit"?"Rule Evaluate":e==="error"?"Errors":Ns(e):"Unknown event"}function cx(e){return e.event_stage==="gateway_decided"?"Decide Gateway":e.event_stage==="score_updated"?"Update Gateway":e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="error"?"Errors":Ns(e.event_stage||e.event_type)}function kf(e){return e.event_type==="decision"||e.event_stage==="gateway_decided"?"Decide Gateway":e.event_type==="rule_hit"||e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="gateway_update"||e.event_stage==="score_updated"?"Update Gateway":"Errors"}function au(e){const t=(e.status||"").toUpperCase();return e.event_type==="error"||t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":e.event_type==="rule_hit"?"purple":t==="CHARGED"||t==="AUTHORIZED"||t==="SUCCESS"||e.event_type==="gateway_update"?"green":e.event_type==="decision"?"blue":"orange"}function fv(e){const t=(e||"").toUpperCase();return t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":t==="SUCCESS"||t==="CHARGED"||t==="AUTHORIZED"?"green":t==="HIT"?"purple":"gray"}function b2(e){return e==="Decide Gateway"?"blue":e==="Rule Evaluate"?"purple":e==="Update Gateway"?"green":e==="Errors"?"red":"orange"}function iu(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function pv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}function Oce(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function kce(e){return e?"bg-brand-600 text-white":"bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]"}function Ko(){return"h-10 rounded-2xl border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]"}function uf({label:e,value:t,helper:r}){return c.jsx(De,{children:c.jsxs(Le,{children:[c.jsx("p",{className:"text-xs uppercase tracking-[0.16em] text-slate-500",children:e}),c.jsx("p",{className:"mt-2 text-3xl font-semibold text-slate-900 dark:text-white",children:t}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:r})]})})}function xu({title:e,body:t}){return c.jsxs("div",{className:"rounded-2xl border border-dashed border-slate-200 dark:border-[#222227] bg-white/60 dark:bg-[#0b0b0d] px-6 py-12 text-center",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function Ace({rows:e}){return e.length?c.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(t=>c.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:t.label}),c.jsx("p",{className:"mt-2 text-sm text-slate-900 dark:text-white break-words",children:t.value})]},`${t.label}-${t.value}`))}):null}function Xo({title:e,value:t,emptyMessage:r}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{children:c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e})}),t?c.jsx("pre",{className:"overflow-x-auto rounded-2xl bg-slate-950/90 px-4 py-4 text-xs leading-6 text-slate-200",children:Oce(t)}):c.jsx(xu,{title:`No ${e.toLowerCase()} captured`,body:r})]})}function Ece(e){if(!e)return null;const t=iu(e.details_json)?e.details_json:{},r=t.response??t.response_payload??t.result??t.output??null,n=t.request??t.request_payload??t.input??t.payload??pv({payment_id:e.payment_id,request_id:e.request_id,payment_method_type:e.payment_method_type,payment_method:e.payment_method,gateway:e.gateway}),a=r??pv({event_type:e.event_type,status:e.status,error_code:e.error_code,error_message:e.error_message,score_value:e.score_value,sigma_factor:e.sigma_factor,average_latency:e.average_latency,tp99_latency:e.tp99_latency,transaction_count:e.transaction_count,rule_name:e.rule_name,routing_approach:e.routing_approach}),i=iu(r)?r:null,o=iu(i==null?void 0:i.decided_gateway)?i.decided_gateway:null,s=t.score_context??(o?o.gateway_priority_map:null)??(i?i.gateway_priority_map:null)??null,l=t.selection_reason??null,u=[{label:"Phase",value:kf(e)},{label:"Stage",value:cx(e)},{label:"Route",value:q$(e.route)},{label:"Timestamp",value:Of(e.created_at_ms)},{label:"Merchant",value:e.merchant_id||"unknown merchant"},...e.payment_id?[{label:"Payment ID",value:e.payment_id}]:[],...e.request_id?[{label:"Request ID",value:e.request_id}]:[],...e.gateway?[{label:"Gateway",value:e.gateway}]:[],...e.status?[{label:"Status",value:e.status}]:[]],f=pv(Object.fromEntries(Object.entries(t).filter(([d])=>!["request","request_payload","input","payload","response","response_payload","result","output","score_context","selection_reason"].includes(d))));return{summaryRows:u,requestPayload:iu(n)&&!Object.keys(n).length?null:n,responsePayload:iu(a)&&!Object.keys(a).length?null:a,scoreContext:s,selectionReason:l,signalRecord:Object.keys(f).length?f:null,rawEvent:{...e,details_json:e.details_json}}}function Pce(){var ie,he,X,ke,ve,Ae,ze,ge,Ce,Me,je,Ge,H,E,D;const{merchantId:e}=ia(),[t,r]=_D(),n=wce(t.get("range")),a=_ce(t),i=Math.max(1,Number(t.get("page")||"1")),o=t.get("selected")||"",[s,l]=j.useState(n),[u,f]=j.useState(a),[d,p]=j.useState(a),[h,x]=j.useState(i),[y,v]=j.useState(o),[g,m]=j.useState(null),[w,S]=j.useState("summary"),b=12,_=!!e,O=_&&e?x2(s,e,h,b,d):null,k=Ft(O,Qn,{refreshInterval:12e3,revalidateOnFocus:!0}),A=j.useMemo(()=>{var B;const N=((B=k.data)==null?void 0:B.results)||[];return N.find(G=>G.lookup_key===y)||N[0]||null},[(ie=k.data)==null?void 0:ie.results,y]);j.useEffect(()=>{var B,G;if(A!=null&&A.lookup_key){v(A.lookup_key);return}const N=(G=(B=k.data)==null?void 0:B.results)==null?void 0:G[0];N!=null&&N.lookup_key&&v(N.lookup_key)},[(he=k.data)==null?void 0:he.results,A==null?void 0:A.lookup_key]);const I=j.useMemo(()=>{if(!A)return null;const N=A.payment_id||"";return{paymentId:N,requestId:N?"":A.request_id||"",gateway:"",route:"",status:"",eventType:"",errorCode:""}},[A]),T=_&&e&&I?x2(s,e,1,50,I):null,P=Ft(T,Qn,{refreshInterval:12e3,revalidateOnFocus:!0}),R=j.useMemo(()=>{var B;const N=((B=P.data)==null?void 0:B.timeline)||[];return N.find(G=>G.id===g)||N[0]||null},[(X=P.data)==null?void 0:X.timeline,g]);j.useEffect(()=>{var B,G;if(R!=null&&R.id){m(R.id);return}const N=(G=(B=P.data)==null?void 0:B.timeline)==null?void 0:G[0];N!=null&&N.id&&m(N.id)},[(ke=P.data)==null?void 0:ke.timeline,R==null?void 0:R.id]);const M=j.useMemo(()=>{var B;const N=[];for(const G of((B=P.data)==null?void 0:B.timeline)||[]){const ee=kf(G),Z=N[N.length-1];!Z||Z.phase!==ee?N.push({phase:ee,events:[G]}):Z.events.push(G)}return N},[(ve=P.data)==null?void 0:ve.timeline]),F=j.useMemo(()=>Ece(R),[R]),W=((Ae=k.error)==null?void 0:Ae.message)||((ze=P.error)==null?void 0:ze.message)||null,V=k.isLoading||P.isLoading,L=((Ce=(ge=P.data)==null?void 0:ge.timeline)==null?void 0:Ce.length)||0,U=((Me=A==null?void 0:A.gateways)==null?void 0:Me.length)||0,q=A?Sce(A.last_seen_ms):"No activity";function J(N,B,G,ee){const Z=Uu(G),me=G$({range:N,page:B>1?B:void 0,payment_id:Z.paymentId||void 0,request_id:Z.requestId||void 0,gateway:Z.gateway||void 0,route:Z.route||void 0,status:Z.status||void 0,event_type:Z.eventType||void 0,error_code:Z.errorCode||void 0,selected:ee||void 0});r(me)}function K(N,B){f(G=>Uu({...G,[N]:B}))}function ae(){const B=Uu(u);x(1),f(B),p(B),J(s,1,B)}function Q(){x(1),f(dv),p(dv),J(s,1,dv)}function be(){k.mutate(),P.mutate()}function ue(N){l(N),x(1),J(N,1,d,y)}function Pe(N){v(N),J(s,h,d,N)}async function Fe(N){if(N)try{await navigator.clipboard.writeText(N)}catch{}}function te(){if(!R)return;const N=R.payment_id||"",B={paymentId:N,requestId:N?"":R.request_id||"",gateway:R.gateway||"",route:"",status:"",eventType:"",errorCode:""};f(B),p(B),x(1),J(s,1,B,y)}return _?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Decision Audit"}),c.jsx("p",{className:"mt-1 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:"Search by payment or request, then inspect the full sequence of gateway decisions, gateway updates, rule evaluations, and errors with the exact payload captured at each step."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(Te,{size:"sm",variant:"ghost",onClick:be,children:"Refresh"})})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[vce.map(N=>c.jsx(Te,{size:"sm",variant:s===N?"primary":"secondary",onClick:()=>ue(N),children:N},N)),c.jsx(Oe,{variant:"green",children:e||"Current merchant"})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Search Decision Trail"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Use payment or request IDs when you have them. Error code, gateway, route, and status narrow operational noise quickly."})]})}),c.jsxs(Le,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[c.jsx("input",{className:Ko(),value:u.paymentId,onChange:N=>K("paymentId",N.target.value),placeholder:"Payment ID"}),c.jsx("input",{className:Ko(),value:u.requestId,onChange:N=>K("requestId",N.target.value),placeholder:"Request ID"}),c.jsx("input",{className:Ko(),value:u.gateway,onChange:N=>K("gateway",N.target.value),placeholder:"Gateway"}),c.jsx("select",{className:Ko(),value:u.route,onChange:N=>K("route",N.target.value),children:xce.map(N=>c.jsx("option",{value:N.value,children:N.label},N.value||"all"))}),c.jsx("input",{className:Ko(),value:u.errorCode,onChange:N=>K("errorCode",N.target.value),placeholder:"Error code"}),c.jsx("select",{className:Ko(),value:u.status,onChange:N=>K("status",N.target.value),children:gce.map(N=>c.jsx("option",{value:N.value,children:N.label},N.value||"all"))})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Te,{size:"sm",onClick:ae,children:"Search"}),c.jsx(Te,{size:"sm",variant:"secondary",onClick:Q,children:"Clear"})]})]})]}),c.jsx(Gr,{error:W}),V&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading decision audit data…"]}),c.jsxs("section",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsx(uf,{label:"Matching payments",value:String(((je=k.data)==null?void 0:je.total_results)||0),helper:"Results within the selected time window"}),c.jsx(uf,{label:"Timeline events",value:String(L),helper:"Captured for the selected payment"}),c.jsx(uf,{label:"Active gateways",value:String(U),helper:"Distinct gateways seen on the selected payment"}),c.jsx(uf,{label:"Latest activity",value:q,helper:"Most recent event on the selected payment"})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[360px_minmax(0,1fr)]",children:[c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Matching Payments"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Te,{size:"sm",variant:"secondary",disabled:h<=1,onClick:()=>{const N=Math.max(1,h-1);x(N),J(s,N,d,y)},children:"Prev"}),c.jsx(Te,{size:"sm",variant:"secondary",disabled:(((H=(Ge=k.data)==null?void 0:Ge.results)==null?void 0:H.length)||0){const N=h+1;x(N),J(s,N,d,y)},children:"Next"})]})]})}),c.jsx(Le,{className:"space-y-3",children:(D=(E=k.data)==null?void 0:E.results)!=null&&D.length?k.data.results.map(N=>c.jsxs("button",{type:"button",onClick:()=>Pe(N.lookup_key),className:`w-full rounded-2xl border p-4 text-left transition-all ${(A==null?void 0:A.lookup_key)===N.lookup_key?"border-brand-500/50 bg-brand-500/5":"border-slate-200 hover:border-slate-300 dark:border-[#1d1d23] dark:hover:border-[#2a2a33]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:N.payment_id||N.request_id||N.lookup_key}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:[N.merchant_id||"unknown merchant"," · ",Of(N.last_seen_ms)]})]}),c.jsx(Oe,{variant:fv(N.latest_status),children:Ns(N.latest_status)||"Unknown"})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[N.latest_stage?c.jsx(Oe,{variant:"blue",children:N.latest_stage}):null,N.latest_gateway?c.jsx(Oe,{variant:"green",children:N.latest_gateway}):null,c.jsxs(Oe,{variant:"gray",children:[N.event_count," events"]})]}),N.request_id?c.jsxs("p",{className:"mt-3 truncate text-[11px] text-slate-500 dark:text-[#8a8a93]",children:["request ",N.request_id]}):null]},N.lookup_key)):c.jsx(xu,{title:"No matching payments found",body:"Try widening the time range or searching by a single payment ID, request ID, or error code."})})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_380px]",children:[c.jsxs(De,{className:"overflow-visible",children:[c.jsx(Ze,{children:c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Selected Payment Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:(A==null?void 0:A.payment_id)||(A==null?void 0:A.request_id)||"Choose a payment from the result list to inspect the timeline."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[A!=null&&A.latest_gateway?c.jsx(Oe,{variant:"green",children:A.latest_gateway}):null,A!=null&&A.latest_stage?c.jsx(Oe,{variant:"blue",children:A.latest_stage}):null,A!=null&&A.latest_status?c.jsx(Oe,{variant:fv(A.latest_status),children:Ns(A.latest_status)}):null]})]})}),c.jsx(Le,{children:M.length?c.jsx("div",{className:"space-y-6",children:M.map(N=>c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Oe,{variant:b2(N.phase),children:N.phase}),c.jsxs("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:[N.events.length," event",N.events.length===1?"":"s"]})]}),c.jsx("div",{className:"relative space-y-3 pl-6 before:absolute before:left-2 before:top-2 before:bottom-2 before:w-px before:bg-slate-200 dark:before:bg-[#23232a]",children:N.events.map(B=>{const G=(R==null?void 0:R.id)===B.id;return c.jsxs("button",{type:"button",onClick:()=>{m(B.id),S("summary")},className:`relative w-full rounded-[24px] border p-5 text-left shadow-sm transition ${G?"border-brand-500/50 bg-brand-500/5":"border-slate-200 bg-white/70 hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#09090b] dark:hover:border-[#2a2a33]"}`,children:[c.jsx("span",{className:`absolute -left-[25px] top-6 h-3 w-3 rounded-full ${au(B)==="red"?"bg-red-400":au(B)==="green"?"bg-emerald-400":au(B)==="purple"?"bg-purple-400":au(B)==="orange"?"bg-orange-400":"bg-blue-400"}`}),c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:cx(B)}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:[q$(B.route)," · ",Of(B.created_at_ms)]})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Oe,{variant:au(B),children:jce(B.event_type)}),B.status?c.jsx(Oe,{variant:fv(B.status),children:Ns(B.status)}):null,B.gateway?c.jsx(Oe,{variant:"green",children:B.gateway}):null]})]}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-slate-500 dark:text-[#8a8a93]",children:[B.request_id?c.jsxs("span",{children:["request ",B.request_id]}):null,B.routing_approach?c.jsxs("span",{children:["approach ",B.routing_approach]}):null,B.rule_name?c.jsxs("span",{children:["rule ",B.rule_name]}):null,B.payment_method_type?c.jsxs("span",{children:["PMT ",B.payment_method_type]}):null,B.payment_method?c.jsxs("span",{children:["method ",B.payment_method]}):null,B.error_code?c.jsxs("span",{children:["error ",B.error_code]}):null]}),B.error_message?c.jsx("p",{className:"mt-4 rounded-2xl border border-red-500/20 bg-red-500/5 px-4 py-3 text-sm text-red-300",children:B.error_message}):null]},B.id)})})]},N.phase))}):c.jsx(xu,{title:"No timeline selected yet",body:"Pick a payment from the left column to see the full transaction trail."})})]}),c.jsxs(De,{className:"overflow-visible xl:sticky xl:top-6 xl:self-start",children:[c.jsx(Ze,{children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Event Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:R?`${cx(R)} · ${Of(R.created_at_ms)}`:"Select a timeline event to inspect the captured payload."})]}),R?c.jsx(Oe,{variant:b2(kf(R)),children:kf(R)}):null]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:bce.map(N=>c.jsx(Te,{size:"sm",variant:"secondary",className:kce(w===N),onClick:()=>S(N),children:N==="summary"?"Summary":N==="input"?"Input":N==="response"?"Response":"Raw JSON"},N))})]})}),c.jsx(Le,{className:"space-y-4",children:R&&F?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Te,{size:"sm",variant:"secondary",onClick:()=>S("raw"),children:"View payload"}),c.jsx(Te,{size:"sm",variant:"secondary",disabled:!R.request_id,onClick:()=>Fe(R.request_id),children:"Copy request ID"}),c.jsx(Te,{size:"sm",variant:"secondary",disabled:!R.payment_id,onClick:()=>Fe(R.payment_id),children:"Copy payment ID"}),c.jsx(Te,{size:"sm",variant:"secondary",onClick:te,children:"Open related events"})]}),w==="summary"?c.jsxs("div",{className:"space-y-4",children:[c.jsx(Ace,{rows:F.summaryRows}),c.jsx(Xo,{title:"Connector score context",value:F.scoreContext,emptyMessage:"No connector score map was captured for this event."}),c.jsx(Xo,{title:"Selection reason",value:F.selectionReason,emptyMessage:"No explicit selection reason was captured for this event."}),c.jsx(Xo,{title:"Score / rule details",value:F.signalRecord,emptyMessage:"This event did not capture additional scoring or rule metadata."})]}):null,w==="input"?c.jsx(Xo,{title:"Input",value:F.requestPayload,emptyMessage:"No dedicated request payload was captured for this event."}):null,w==="response"?c.jsx(Xo,{title:"Response",value:F.responsePayload,emptyMessage:"No dedicated response payload was captured for this event."}):null,w==="raw"?c.jsx(Xo,{title:"Raw JSON",value:F.rawEvent,emptyMessage:"No raw payload is available for this event."}):null]}):c.jsx(xu,{title:"No event selected",body:"Pick a timeline step to see the request, response, transaction context, and raw payload."})})]})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Decision Audit"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Search a payment and inspect gateway decisions, gateway updates, rule evaluations, and errors in one transaction trail."})]}),c.jsx(xu,{title:"Select a merchant to start auditing payments",body:"Use the merchant selector in the top bar to load the decision trail for a merchant."})]})}function Nce(){return c.jsx(vD,{children:c.jsxs(ln,{element:c.jsx(j3,{}),children:[c.jsx(ln,{index:!0,element:c.jsx(iL,{})}),c.jsx(ln,{path:"routing",element:c.jsx(oL,{})}),c.jsx(ln,{path:"routing/sr",element:c.jsx(m5,{})}),c.jsx(ln,{path:"routing/rules",element:c.jsx(u6,{})}),c.jsx(ln,{path:"routing/volume",element:c.jsx(tce,{})}),c.jsx(ln,{path:"routing/debit",element:c.jsx(nce,{})}),c.jsx(ln,{path:"decisions",element:c.jsx(dce,{})}),c.jsx(ln,{path:"analytics",element:c.jsx(yce,{})}),c.jsx(ln,{path:"audit",element:c.jsx(Pce,{})}),c.jsx(ln,{path:"*",element:c.jsx(hD,{to:".",replace:!0})})]})})}class Cce extends j.Component{constructor(){super(...arguments);Bw(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(r){return{error:r,errorInfo:null}}componentDidCatch(r,n){console.log(` +`+"!".repeat(80)),console.log("[ERROR BOUNDARY] Component Error Caught"),console.log(`Timestamp: ${new Date().toISOString()}`),console.log("Error Message:",r.message),console.log("Error Stack:",r.stack),console.log("Component Stack:",n.componentStack),console.log("!".repeat(80)+` +`),this.setState({errorInfo:n})}render(){return this.state.error?c.jsxs("div",{style:{padding:32,fontFamily:"monospace",color:"red"},children:[c.jsx("h2",{children:"Dashboard Error"}),c.jsx("pre",{children:this.state.error.message}),c.jsx("pre",{children:this.state.error.stack}),this.state.errorInfo&&c.jsxs("pre",{style:{marginTop:16,color:"darkred"},children:["Component Stack:",this.state.errorInfo.componentStack]})]}):this.props.children}}console.log(` +`+"=".repeat(80));console.log("[APP STARTUP] Dashboard initializing...");console.log(`Timestamp: ${new Date().toISOString()}`);console.log("Environment: production");console.log("Base URL: /dashboard");console.log("=".repeat(80)+` +`);window.onerror=(e,t,r,n,a)=>{console.log(` +`+"!".repeat(80)),console.log("[WINDOW ERROR]"),console.log("Message:",e),console.log("Source:",t),console.log("Line:",r,"Column:",n),a&&(console.log("Error:",a.message),console.log("Stack:",a.stack)),console.log("!".repeat(80)+` +`)};window.onunhandledrejection=e=>{console.log(` +`+"!".repeat(80)),console.log("[UNHANDLED PROMISE REJECTION]"),console.log("Reason:",e.reason),e.reason instanceof Error&&console.log("Stack:",e.reason.stack),console.log("!".repeat(80)+` +`)};hv.createRoot(document.getElementById("root")).render(c.jsx(C.StrictMode,{children:c.jsx(Cce,{children:c.jsx(wD,{basename:"/dashboard",children:c.jsx(Nce,{})})})})); diff --git a/website/dist/assets/index-XOTDNfmE.css b/website/dist/assets/index-XOTDNfmE.css deleted file mode 100644 index f63fdc7b..00000000 --- a/website/dist/assets/index-XOTDNfmE.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Menlo,Monaco,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html{color-scheme:light}html.dark{color-scheme:dark}html,body{font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark html,.dark body{color:#f1f5f9}html,body{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}html:is(.dark *),body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark p,.dark span,.dark h1,.dark h2,.dark h3,.dark h4,.dark h5,.dark h6{color:#f1f5f9}p,span,h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}p:is(.dark *),span:is(.dark *),h1:is(.dark *),h2:is(.dark *),h3:is(.dark *),h4:is(.dark *),h5:is(.dark *),h6:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark p.text-slate-500:is(.dark *),.dark span.text-slate-500:is(.dark *),.dark div.text-slate-500:is(.dark *){color:#64748b}p.text-slate-500:is(.dark *),span.text-slate-500:is(.dark *),div.text-slate-500:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}p.text-slate-600:is(.dark *),span.text-slate-600:is(.dark *),div.text-slate-600:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .text-slate-900,.dark .text-slate-800{color:#f1f5f9!important}.dark .text-slate-700{color:#e2e8f0!important}.dark .text-slate-600{color:#cbd5e1!important}.dark .text-slate-500{color:#94a3b8!important}.dark .text-slate-400{color:#64748b!important}.dark .text-blue-800,.dark .text-blue-700{color:#93c5fd!important}.dark .text-blue-600{color:#60a5fa!important}.dark .text-brand-500{color:#818cf8!important}.dark .bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .bg-slate-100{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1));-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.dark :where(input:not([type=checkbox]):not([type=radio]):not([type=range])),.dark :where(select),.dark :where(textarea){color:#f1f5f9}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){border-radius:9999px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::-moz-placeholder,:where(select)::-moz-placeholder,:where(textarea)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::placeholder,:where(select)::placeholder,:where(textarea)::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus,:where(select):focus,:where(textarea):focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(99 102 241 / .2)}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *),:where(select):is(.dark *),:where(textarea):is(.dark *){border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::-moz-placeholder,:where(select):is(.dark *)::-moz-placeholder,:where(textarea):is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::placeholder,:where(select):is(.dark *)::placeholder,:where(textarea):is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus:is(.dark *),:where(select):focus:is(.dark *),:where(textarea):focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 51 56 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){box-shadow:0 1px 2px #0000000d!important;font-family:Outfit,sans-serif}.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),.dark select,.dark textarea{box-shadow:none!important}.dark select option{color:#f1f5f9}select option{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}select option:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}input[type=range]{accent-color:#6366f1}input[type=range]:is(.dark *){accent-color:#fff}input[type=radio],input[type=checkbox]{height:1rem;width:1rem;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));accent-color:#6366f1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}input[type=radio]:is(.dark *),input[type=checkbox]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));accent-color:#fff}input[type=radio]{border-radius:50%}input[type=checkbox]{border-radius:4px}input[type=radio]:checked,input[type=checkbox]:checked{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}input[type=radio]:checked:is(.dark *),input[type=checkbox]:checked:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-left-\[25px\]{left:-25px}.bottom-0{bottom:0}.left-64{left:16rem}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.top-6{top:1.5rem}.top-\[76px\]{top:76px}.z-10{z-index:10}.z-20{z-index:20}.z-\[120\]{z-index:120}.z-\[130\]{z-index:130}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-\[76px\]{height:76px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.min-h-0{min-height:0px}.min-h-20{min-height:5rem}.min-h-\[150px\]{min-height:150px}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-32{width:8rem}.w-36{width:9rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[calc\(100\%-12px\)\]{width:calc(100% - 12px)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[220px\]{min-width:220px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.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-\[1fr_100px_32px\]{grid-template-columns:1fr 100px 32px}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#1c1c24\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(28 28 36 / var(--tw-divide-opacity, 1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[14px\]{border-radius:14px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[30px\]{border-radius:30px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1c2d50\]{--tw-border-opacity: 1;border-color:rgb(28 45 80 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-brand-500\/30{border-color:#6366f14d}.border-brand-500\/50{border-color:#6366f180}.border-emerald-500\/20{border-color:#10b98133}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-t-gray-500{--tw-border-opacity: 1;border-top-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.bg-\[\#07070b\]{--tw-bg-opacity: 1;background-color:rgb(7 7 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#f8fafc\]{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-brand-500\/10{background-color:#6366f11a}.bg-brand-500\/5{background-color:#6366f10d}.bg-brand-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-400{--tw-bg-opacity: 1;background-color:rgb(192 132 252 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/5{background-color:#ef44440d}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/70{background-color:#f8fafcb3}.bg-slate-50\/80{background-color:#f8fafccc}.bg-slate-50\/90{background-color:#f8fafce6}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-slate-950\/70{background-color:#020617b3}.bg-slate-950\/90{background-color:#020617e6}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-white\/60{background-color:#fff9}.bg-white\/70{background-color:#ffffffb3}.bg-white\/95{background-color:#fffffff2}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-3{padding-bottom:.75rem}.pl-1{padding-left:.25rem}.pl-6{padding-left:1.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Menlo,Monaco,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-6{line-height:1.5rem}.tracking-\[0\.16em\]{letter-spacing:.16em}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-brand-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.accent-brand-500{accent-color:#6366f1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.ring-emerald-500\/20{--tw-ring-color: rgb(16 185 129 / .2)}.ring-orange-500\/20{--tw-ring-color: rgb(249 115 22 / .2)}.ring-purple-500\/20{--tw-ring-color: rgb(168 85 247 / .2)}.ring-red-500\/20{--tw-ring-color: rgb(239 68 68 / .2)}.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{--tw-backdrop-blur: blur(8px);-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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.glass-panel{position:relative;overflow:hidden;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.glass-panel:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 26 29 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1));--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark .glass-panel-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.glass-panel-hover:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.glass-panel-hover:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #a855f7 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient:is(.dark *){--tw-gradient-from: #9b51e0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(155 81 224 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #4f46e5 var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-gradient-to: #0ea5e9 var(--tw-gradient-to-position)}.aurora-top{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#9b51e0,#4f46e5,#0ea5e9,transparent);opacity:.8;z-index:100}.dark .hover\:text-slate-900:hover{color:#f1f5f9!important}.dark .hover\:text-slate-700:hover{color:#e2e8f0!important}.dark .hover\:text-brand-500:hover{color:#818cf8!important}.dark .hover\:bg-slate-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .hover\:bg-slate-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}.group:hover .group-hover\:text-slate-600p:is(.dark *),.group:hover .group-hover\:text-slate-600 span:is(.dark *),.group:hover .group-hover\:text-slate-600 div:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .group:hover .group-hover\:text-slate-600{color:#cbd5e1!important}.dark .group:hover .group-hover\:text-brand-500{color:#818cf8!important}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:bottom-2:before{content:var(--tw-content);bottom:.5rem}.before\:left-2:before{content:var(--tw-content);left:.5rem}.before\:top-2:before{content:var(--tw-content);top:.5rem}.before\:w-px:before{content:var(--tw-content);width:1px}.before\:bg-slate-200:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.hover\:bg-brand-500\/15:hover{background-color:#6366f126}.hover\:bg-brand-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#28282f\]:focus{--tw-border-opacity: 1;border-color:rgb(40 40 47 / var(--tw-border-opacity, 1))}.focus\:border-brand-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.focus\:border-slate-400:focus{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-brand-500\/20:focus{--tw-ring-color: rgb(99 102 241 / .2)}.focus\:ring-brand-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-offset-1:focus{--tw-ring-offset-width: 1px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.dark\:divide-\[\#222226\]:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(34 34 38 / var(--tw-divide-opacity, 1))}.dark\:border-\[\#151515\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 21 21 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c1f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 31 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c23\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 35 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c24\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 36 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1d1d23\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 29 35 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1f1f26\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 31 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222222\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222226\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222227\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 39 / var(--tw-border-opacity, 1))}.dark\:border-\[\#27272a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:border-\[\#5c1c1c\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(92 28 28 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#000000\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#08080b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 8 11 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090d\]\/95:is(.dark *){background-color:#09090df2}.dark\:bg-\[\#0a0a0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b0d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b10\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 16 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c0e\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c10\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 16 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f11\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f16\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 22 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111114\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111118\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121214\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151515\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151518\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#2a0505\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(42 5 5 / var(--tw-bg-opacity, 1))}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:text-\[\#55555e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(85 85 94 / var(--tw-text-opacity, 1))}.dark\:text-\[\#66666e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(102 102 110 / var(--tw-text-opacity, 1))}.dark\:text-\[\#888891\]:is(.dark *){--tw-text-opacity: 1;color:rgb(136 136 145 / var(--tw-text-opacity, 1))}.dark\:text-\[\#8a8a93\]:is(.dark *){--tw-text-opacity: 1;color:rgb(138 138 147 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a1a1aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:text-\[\#b3b3bd\]:is(.dark *){--tw-text-opacity: 1;color:rgb(179 179 189 / var(--tw-text-opacity, 1))}.dark\:text-\[\#e5e7eb\]:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-slate-200:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:before\:bg-\[\#23232a\]:is(.dark *):before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(35 35 42 / var(--tw-bg-opacity, 1))}.dark\:hover\:border-\[\#2a2a31\]:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 49 / var(--tw-border-opacity, 1))}.dark\:hover\:border-\[\#2a2a33\]:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 51 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-\[\#0c0c0e\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#121214\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#18181b\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#222222\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#380808\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(56 8 8 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-slate-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:border-\[\#444444\]:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(68 68 68 / var(--tw-border-opacity, 1))}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.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: 1280px){.xl\:sticky{position:sticky}.xl\:top-6{top:1.5rem}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[340px_minmax\(0\,1fr\)\]{grid-template-columns:340px minmax(0,1fr)}.xl\:grid-cols-\[360px_minmax\(0\,1fr\)\]{grid-template-columns:360px minmax(0,1fr)}.xl\:grid-cols-\[minmax\(0\,1fr\)_380px\]{grid-template-columns:minmax(0,1fr) 380px}.xl\:self-start{align-self:flex-start}.xl\:border-b-0{border-bottom-width:0px}.xl\:border-r{border-right-width:1px}} diff --git a/website/dist/index.html b/website/dist/index.html index dd465b0b..f89af833 100644 --- a/website/dist/index.html +++ b/website/dist/index.html @@ -7,8 +7,8 @@ Juspay Decision Engine Dashboard - - + +
diff --git a/website/src/components/layout/AppShell.tsx b/website/src/components/layout/AppShell.tsx index 7912a8f2..c7bb5ff7 100644 --- a/website/src/components/layout/AppShell.tsx +++ b/website/src/components/layout/AppShell.tsx @@ -4,12 +4,13 @@ import { TopBar } from './TopBar' export function AppShell() { return ( -
+
+
-
+
diff --git a/website/src/components/layout/Sidebar.tsx b/website/src/components/layout/Sidebar.tsx index c1eedfa9..040baa8c 100644 --- a/website/src/components/layout/Sidebar.tsx +++ b/website/src/components/layout/Sidebar.tsx @@ -1,4 +1,5 @@ -import { NavLink } from 'react-router-dom' +import { useLayoutEffect, useState } from 'react' +import { useLocation, useNavigate } from 'react-router-dom' import { LayoutDashboard, GitBranch, @@ -12,10 +13,28 @@ import { } from 'lucide-react' export function Sidebar() { + const location = useLocation() + const [pendingPath, setPendingPath] = useState(null) + const selectedPath = pendingPath ?? location.pathname + + useLayoutEffect(() => { + if (!pendingPath) { + return + } + + const navigationSettled = + location.pathname === pendingPath || + location.pathname.startsWith(`${pendingPath}/`) + + if (navigationSettled) { + setPendingPath(null) + } + }, [location.pathname, pendingPath]) + return ( -
- Live 1h + {selectedWindow.badge}
@@ -538,7 +535,7 @@ export function OverviewPage() { {[ { label: 'Selected merchant', value: merchantId }, { label: 'Last sync', value: formatUpdatedAt(latestSync) }, - { label: 'Errors last hour', value: formatCompactNumber(totalErrors) }, + { label: selectedWindow.summaryLabel, value: formatCompactNumber(totalErrors) }, { label: 'Top gateway', value: topGateway?.toUpperCase() || 'No activity' }, ].map((item) => (
( navigate(item.route)}>
-
+
diff --git a/website/src/components/pages/PaymentAuditPage.tsx b/website/src/components/pages/PaymentAuditPage.tsx index b775fd0a..9a994d89 100644 --- a/website/src/components/pages/PaymentAuditPage.tsx +++ b/website/src/components/pages/PaymentAuditPage.tsx @@ -9,10 +9,10 @@ import { PaymentAuditResponse, } from '../../types/api' import { Button } from '../ui/Button' -import { Card, CardBody, CardHeader } from '../ui/Card' import { Badge } from '../ui/Badge' import { Spinner } from '../ui/Spinner' import { ErrorMessage } from '../ui/ErrorMessage' +import { Card as GlassCard, InsetPanel, SurfaceLabel } from '../ui/Card' const RANGE_OPTIONS: AnalyticsRange[] = ['15m', '1h', '24h'] const STATUS_OPTIONS = [ @@ -39,6 +39,7 @@ type AuditFilters = { } type InspectorTab = (typeof INSPECTOR_TABS)[number] +type AuditMode = 'transactions' | 'rule_based' const EMPTY_FILTERS: AuditFilters = { paymentId: '', @@ -75,6 +76,7 @@ function queryString(params: Record) { } function buildAuditUrl( + path: '/analytics/payment-audit' | '/analytics/preview-trace', range: AnalyticsRange, merchantId: string, page: number, @@ -97,7 +99,7 @@ function buildAuditUrl( error_code: normalizedFilters.errorCode || undefined, } const qs = queryString(params) - return qs ? `/analytics/payment-audit?${qs}` : '/analytics/payment-audit' + return qs ? `${path}?${qs}` : path } function parseRange(value: string | null): AnalyticsRange { @@ -105,6 +107,10 @@ function parseRange(value: string | null): AnalyticsRange { return '24h' } +function parseAuditMode(value: string | null): AuditMode { + return value === 'rule_based' ? 'rule_based' : 'transactions' +} + function parseFilters(searchParams: URLSearchParams): AuditFilters { return normalizeAuditFilters({ paymentId: searchParams.get('payment_id') || '', @@ -145,6 +151,10 @@ function humanizeAuditValue(value?: string | null) { return normalized.replace(/\b\w/g, (char) => char.toUpperCase()) } +function compactMeta(parts: Array) { + return parts.filter(Boolean).join(' · ') +} + function routeLabel(route?: string | null) { if (!route) return 'Unknown route' if (route === 'decision_gateway' || route === 'decide_gateway') return 'Decide Gateway' @@ -153,19 +163,13 @@ function routeLabel(route?: string | null) { return humanizeAuditValue(route) } -function eventTypeLabel(eventType?: string | null) { - if (!eventType) return 'Unknown event' - if (eventType === 'decision') return 'Decide Gateway' - if (eventType === 'gateway_update') return 'Update Gateway' - if (eventType === 'rule_hit') return 'Rule Evaluate' - if (eventType === 'error') return 'Errors' - return humanizeAuditValue(eventType) -} - function stageLabel(event: PaymentAuditEvent) { if (event.event_stage === 'gateway_decided') return 'Decide Gateway' if (event.event_stage === 'score_updated') return 'Update Gateway' if (event.event_stage === 'rule_applied') return 'Rule Evaluate' + if (event.event_stage === 'preview_evaluated' || event.event_type === 'rule_evaluation_preview') { + return 'Preview Result' + } if (event.event_type === 'error') return 'Errors' return humanizeAuditValue(event.event_stage || event.event_type) } @@ -173,6 +177,9 @@ function stageLabel(event: PaymentAuditEvent) { function eventPhase(event: PaymentAuditEvent) { if (event.event_type === 'decision' || event.event_stage === 'gateway_decided') return 'Decide Gateway' if (event.event_type === 'rule_hit' || event.event_stage === 'rule_applied') return 'Rule Evaluate' + if (event.event_type === 'rule_evaluation_preview' || event.event_stage === 'preview_evaluated') { + return 'Rule Preview' + } if (event.event_type === 'gateway_update' || event.event_stage === 'score_updated') return 'Update Gateway' return 'Errors' } @@ -185,6 +192,7 @@ function badgeVariantForEvent(event: PaymentAuditEvent): 'blue' | 'green' | 'pur normalizedStatus.includes('FAILED') || normalizedStatus.includes('DECLINED') ) return 'red' + if (event.event_type === 'rule_evaluation_preview') return 'purple' if (event.event_type === 'rule_hit') return 'purple' if ( normalizedStatus === 'CHARGED' || @@ -212,14 +220,6 @@ function summaryBadgeVariant(status?: string | null): 'blue' | 'green' | 'purple return 'gray' } -function phaseBadgeVariant(phase: string): 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' { - if (phase === 'Decide Gateway') return 'blue' - if (phase === 'Rule Evaluate') return 'purple' - if (phase === 'Update Gateway') return 'green' - if (phase === 'Errors') return 'red' - return 'orange' -} - function isRecord(value: unknown): value is Record { return Boolean(value) && typeof value === 'object' && !Array.isArray(value) } @@ -236,31 +236,31 @@ function stringifyValue(value: unknown) { } function sectionButtonClass(active: boolean) { - return active ? 'bg-brand-600 text-white' : 'bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]' + return active + ? '!border-slate-200 !bg-white !text-slate-950 shadow-[0_12px_30px_-24px_rgba(15,23,42,0.28)] dark:!border-[#2a303a] dark:!bg-[#161b24] dark:!text-white' + : '!border-transparent !bg-slate-100 !text-slate-600 hover:!bg-slate-200 hover:!text-slate-900 dark:!bg-[#161b24] dark:!text-[#a7b2c6] dark:hover:!bg-[#1c2330] dark:hover:!text-white' } function controlClassName() { - return 'h-10 rounded-2xl border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]' + return 'h-11 rounded-2xl border border-slate-200 bg-white/90 px-4 text-sm text-slate-700 shadow-[0_12px_30px_-24px_rgba(15,23,42,0.2)] outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#2a303a] dark:bg-[#161b24] dark:text-[#e5ecf7] dark:shadow-none' } function KeyMetric({ label, value, helper }: { label: string; value: string; helper: string }) { return ( - - -

{label}

-

{value}

-

{helper}

-
-
+ + {label} +

{value}

+

{helper}

+
) } function EmptyState({ title, body }: { title: string; body: string }) { return ( -
+

{title}

-

{body}

-
+

{body}

+ ) } @@ -270,10 +270,10 @@ function InspectorKeyValueGrid({ rows }: { rows: Array<{ label: string; value: s return (
{rows.map((row) => ( -
-

{row.label}

+ +

{row.label}

{row.value}

-
+ ))}
) @@ -286,7 +286,7 @@ function InspectorJsonPanel({ title, value, emptyMessage }: { title: string; val

{title}

{value ? ( -
+        
           {stringifyValue(value)}
         
) : ( @@ -389,11 +389,13 @@ export function PaymentAuditPage() { const { merchantId } = useMerchantStore() const [searchParams, setSearchParams] = useSearchParams() + const initialMode = parseAuditMode(searchParams.get('mode')) const initialRange = parseRange(searchParams.get('range')) const initialFilters = parseFilters(searchParams) const initialPage = Math.max(1, Number(searchParams.get('page') || '1')) const initialSelectedKey = searchParams.get('selected') || '' + const [mode, setMode] = useState(initialMode) const [range, setRange] = useState(initialRange) const [filters, setFilters] = useState(initialFilters) const [appliedFilters, setAppliedFilters] = useState(initialFilters) @@ -404,9 +406,10 @@ export function PaymentAuditPage() { const pageSize = 12 const canQueryCurrent = Boolean(merchantId) + const auditPath = mode === 'rule_based' ? '/analytics/preview-trace' : '/analytics/payment-audit' const searchUrl = canQueryCurrent && merchantId - ? buildAuditUrl(range, merchantId, page, pageSize, appliedFilters) + ? buildAuditUrl(auditPath, range, merchantId, page, pageSize, appliedFilters) : null const auditSearch = useSWR(searchUrl, fetcher, { @@ -445,7 +448,7 @@ export function PaymentAuditPage() { }, [selectedSummary]) const detailUrl = canQueryCurrent && merchantId && detailFilters - ? buildAuditUrl(range, merchantId, 1, 50, detailFilters) + ? buildAuditUrl(auditPath, range, merchantId, 1, 50, detailFilters) : null const auditDetail = useSWR(detailUrl, fetcher, { @@ -490,10 +493,44 @@ export function PaymentAuditPage() { const totalEvents = auditDetail.data?.timeline?.length || 0 const activeGateways = selectedSummary?.gateways?.length || 0 const latestSeen = selectedSummary ? formatRelative(selectedSummary.last_seen_ms) : 'No activity' + const content = mode === 'rule_based' + ? { + title: 'Decision Audit', + description: 'Inspect preview-only rule activity from /routing/evaluate without mixing it into transaction outcomes.', + merchantPrompt: 'Use the merchant selector in the top bar to load the preview trace for a merchant.', + searchTitle: 'Search Rule Preview Trail', + searchDescription: 'Use preview payment IDs or request IDs when you have them. Gateway, status, and error code help narrow rule-preview activity quickly.', + matchingLabel: 'Matching previews', + matchingDescription: 'Scan the current result set and pick a preview to open its full trace.', + summaryLabel: 'Selected Preview Timeline', + summaryEmpty: 'Pick a preview from the left column to see the full rule evaluation trace.', + noMatchesTitle: 'No matching previews found', + noMatchesBody: 'Try widening the time range or searching by a preview payment ID, request ID, or gateway.', + } + : { + title: 'Decision Audit', + description: 'Search by payment or request, then inspect gateway decisions, gateway updates, rule evaluations, and errors with the exact payload captured at each step.', + merchantPrompt: 'Use the merchant selector in the top bar to load the decision trail for a merchant.', + searchTitle: 'Search Decision Trail', + searchDescription: 'Use payment or request IDs when you have them. Error code, gateway, route, and status narrow operational noise quickly.', + matchingLabel: 'Matching payments', + matchingDescription: 'Scan the current result set and pick a payment to open its full event trail.', + summaryLabel: 'Selected Payment Timeline', + summaryEmpty: 'Pick a payment from the left column to see the full transaction trail.', + noMatchesTitle: 'No matching payments found', + noMatchesBody: 'Try widening the time range or searching by a single payment ID, request ID, or error code.', + } - function syncSearch(nextRange: AnalyticsRange, nextPage: number, nextFilters: AuditFilters, nextSelectedKey?: string) { + function syncSearch( + nextMode: AuditMode, + nextRange: AnalyticsRange, + nextPage: number, + nextFilters: AuditFilters, + nextSelectedKey?: string, + ) { const normalizedFilters = normalizeAuditFilters(nextFilters) const nextQuery = queryString({ + mode: nextMode === 'rule_based' ? nextMode : undefined, range: nextRange, page: nextPage > 1 ? nextPage : undefined, payment_id: normalizedFilters.paymentId || undefined, @@ -514,19 +551,26 @@ export function PaymentAuditPage() { function applyFilters() { const nextPage = 1 - const normalizedFilters = normalizeAuditFilters(filters) + const normalizedFilters = normalizeAuditFilters({ + ...filters, + route: mode === 'rule_based' ? '' : filters.route, + }) setPage(nextPage) setFilters(normalizedFilters) setAppliedFilters(normalizedFilters) - syncSearch(range, nextPage, normalizedFilters) + syncSearch(mode, range, nextPage, normalizedFilters) } function clearFilters() { const nextPage = 1 + const clearedFilters = { + ...EMPTY_FILTERS, + route: mode === 'rule_based' ? '' : EMPTY_FILTERS.route, + } setPage(nextPage) - setFilters(EMPTY_FILTERS) - setAppliedFilters(EMPTY_FILTERS) - syncSearch(range, nextPage, EMPTY_FILTERS) + setFilters(clearedFilters) + setAppliedFilters(clearedFilters) + syncSearch(mode, range, nextPage, clearedFilters) } function refreshAll() { @@ -538,12 +582,28 @@ export function PaymentAuditPage() { const nextPage = 1 setRange(nextRange) setPage(nextPage) - syncSearch(nextRange, nextPage, appliedFilters, selectedKey) + syncSearch(mode, nextRange, nextPage, appliedFilters, selectedKey) } function selectSummary(lookupKey: string) { setSelectedKey(lookupKey) - syncSearch(range, page, appliedFilters, lookupKey) + syncSearch(mode, range, page, appliedFilters, lookupKey) + } + + function updateMode(nextMode: AuditMode) { + const nextPage = 1 + const nextFilters = normalizeAuditFilters({ + ...filters, + route: nextMode === 'rule_based' ? '' : filters.route, + }) + + setMode(nextMode) + setPage(nextPage) + setSelectedKey('') + setSelectedEventId(null) + setFilters(nextFilters) + setAppliedFilters(nextFilters) + syncSearch(nextMode, range, nextPage, nextFilters) } async function copyValue(value: string | null | undefined) { @@ -570,21 +630,21 @@ export function PaymentAuditPage() { setFilters(nextFilters) setAppliedFilters(nextFilters) setPage(1) - syncSearch(range, 1, nextFilters, selectedKey) + syncSearch(mode, range, 1, nextFilters, selectedKey) } if (!canQueryCurrent) { return (
-

Decision Audit

+

{content.title}

- Search a payment and inspect gateway decisions, gateway updates, rule evaluations, and errors in one transaction trail. + {content.description}

) @@ -594,9 +654,9 @@ export function PaymentAuditPage() {
-

Decision Audit

+

{content.title}

- Search by payment or request, then inspect the full sequence of gateway decisions, gateway updates, rule evaluations, and errors with the exact payload captured at each step. + {content.description}

@@ -606,41 +666,66 @@ export function PaymentAuditPage() {
-
- {RANGE_OPTIONS.map((value) => ( +
+
+ - ))} - {merchantId || 'Current merchant'} + {merchantId || 'Current merchant'} +
+ +
+

+ Time window +

+ {RANGE_OPTIONS.map((value) => ( + + ))} +
- - -
-

Search Decision Trail

-

- Use payment or request IDs when you have them. Error code, gateway, route, and status narrow operational noise quickly. -

-
-
- -
+ +
+ {content.searchTitle} +

+ {content.searchDescription} +

+
+
+
updateFilter('paymentId', event.target.value)} placeholder="Payment ID" /> updateFilter('requestId', event.target.value)} placeholder="Request ID" /> updateFilter('gateway', event.target.value)} placeholder="Gateway" /> - + {mode === 'transactions' ? ( + + ) : null} updateFilter('errorCode', event.target.value)} placeholder="Error code" />
+
+ +
+ +
+ +
+
+
+ ) +} diff --git a/website/src/components/layout/Sidebar.tsx b/website/src/components/layout/Sidebar.tsx new file mode 100644 index 00000000..9687697a --- /dev/null +++ b/website/src/components/layout/Sidebar.tsx @@ -0,0 +1,94 @@ +import { NavLink } from 'react-router-dom' +import { + LayoutDashboard, + GitBranch, + Search, + Zap, + TrendingUp, + BookOpen, + PieChart, + Network, +} from 'lucide-react' + +export function Sidebar() { + return ( + + ) +} + +function SideLink({ + to, + icon: Icon, + children, + end, + indent, +}: { + to: string + icon: React.ElementType + children: React.ReactNode + end?: boolean + indent?: boolean +}) { + return ( + + `group relative flex items-center gap-3 px-4 py-3 rounded-[14px] text-[14px] font-medium transition-all duration-200 ${indent ? 'ml-3 w-[calc(100%-12px)]' : '' + } ${isActive + ? 'bg-slate-100 text-brand-600 dark:bg-[#151518] dark:text-white shadow-sm' + : 'text-slate-500 hover:text-slate-900 hover:bg-slate-50 dark:text-[#888891] dark:hover:text-white dark:hover:bg-[#0c0c0e]' + }` + } + > + {({ isActive }) => ( + <> + + {children} + + )} + + ) +} diff --git a/website/src/components/layout/TopBar.tsx b/website/src/components/layout/TopBar.tsx new file mode 100644 index 00000000..04975bdd --- /dev/null +++ b/website/src/components/layout/TopBar.tsx @@ -0,0 +1,87 @@ +import { useState, useEffect } from 'react' +import { useMerchantStore } from '../../store/merchantStore' +import { apiPost } from '../../lib/api' +import { Building2, ArrowRight, Loader2, Moon, Sun } from 'lucide-react' + +export function TopBar() { + const { merchantId, setMerchantId } = useMerchantStore() + const [draft, setDraft] = useState(merchantId) + const [creating, setCreating] = useState(false) + + // Theme management + const [isDark, setIsDark] = useState(() => { + return localStorage.getItem('theme') === 'dark' + }) + + useEffect(() => { + const root = window.document.documentElement + if (isDark) { + root.classList.add('dark') + localStorage.setItem('theme', 'dark') + } else { + root.classList.remove('dark') + localStorage.setItem('theme', 'light') + } + }, [isDark]) + + async function handleSetMerchant() { + const id = draft.trim() + if (!id) return + + setMerchantId(id) + setCreating(true) + + try { + await apiPost('/merchant-account/create', { + merchant_id: id, + gateway_success_rate_based_decider_input: null, + }) + } catch { + // Merchant may already exist - that's fine + } finally { + setCreating(false) + } + } + + return ( +
+
+
+
+ setDraft(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && handleSetMerchant()} + placeholder="Set Merchant ID" + className="w-72 bg-slate-50 dark:bg-[#0f0f11] border border-slate-200 dark:border-[#222222] rounded-full px-4 py-2 text-sm text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-[#66666e] focus:outline-none focus:border-slate-400 dark:focus:border-[#444444] transition-colors" + /> + +
+ + {merchantId && ( +
+ + + {merchantId} + +
+ )} + + {/* Theme Toggle */} + +
+
+ ) +} \ No newline at end of file diff --git a/website/src/components/pages/DebitRoutingPage.tsx b/website/src/components/pages/DebitRoutingPage.tsx new file mode 100644 index 00000000..cea9ba24 --- /dev/null +++ b/website/src/components/pages/DebitRoutingPage.tsx @@ -0,0 +1,139 @@ +import { useState } from 'react' +import useSWR from 'swr' +import { Card, CardBody, CardHeader } from '../ui/Card' +import { Button } from '../ui/Button' +import { ErrorMessage } from '../ui/ErrorMessage' +import { Spinner } from '../ui/Spinner' +import { useMerchantStore } from '../../store/merchantStore' +import { apiPost } from '../../lib/api' +import { DebitRoutingData, CreateRuleRequest } from '../../types/api' +import { Network } from 'lucide-react' + +interface RuleConfigResponse { + merchant_id: string + config: { type: string; data: DebitRoutingData } +} + +export function DebitRoutingPage() { + const { merchantId } = useMerchantStore() + + const { data: existing, mutate, isLoading } = useSWR( + merchantId ? ['rule-debit', merchantId] : null, + () => apiPost('/rule/get', { merchant_id: merchantId, config: { type: 'debitRouting' } }) + ) + + const [mcc, setMcc] = useState('') + const [country, setCountry] = useState('') + const [saving, setSaving] = useState(false) + const [error, setError] = useState(null) + const [success, setSuccess] = useState(null) + + // Pre-fill from fetched config + const current = existing?.config?.data + const displayMcc = mcc || current?.merchant_category_code || '' + const displayCountry = country || current?.acquirer_country || '' + + async function handleSave() { + if (!merchantId) return setError('Set a merchant ID first') + const payload: CreateRuleRequest = { + merchant_id: merchantId, + config: { + type: 'debitRouting', + data: { + merchant_category_code: displayMcc.trim(), + acquirer_country: displayCountry.trim(), + } as DebitRoutingData, + }, + } + setSaving(true); setError(null) + try { + await apiPost(existing ? '/rule/update' : '/rule/create', payload) + setSuccess('Debit routing config saved.') + mutate() + } catch (e: unknown) { + setError(e instanceof Error ? e.message : 'Failed to save') + } finally { + setSaving(false) + } + } + + return ( +
+
+

Network / Debit Routing

+

+ Configure network-based routing to optimise processing fees for debit card transactions. + The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR). +

+
+ + + +
+ +

Debit Routing Configuration

+
+
+ + {isLoading ? ( +
+ ) : ( + <> + {!merchantId && ( +

+ Set a merchant ID in the top bar to load configuration. +

+ )} + +
+
+ + setMcc(e.target.value)} + placeholder="e.g. 5411" + className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +

4-digit ISO MCC for your business type

+
+ +
+ + setCountry(e.target.value)} + placeholder="e.g. US" + className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +

ISO 3166-1 alpha-2 country code

+
+
+ + + {success &&

{success}

} + + + + )} +
+
+ + + +

How Network Routing Works

+
+ +

For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee.

+

Supported networks: {['VISA','MASTERCARD','ACCEL','NYCE','PULSE','STAR'].map(n => {n})}

+

Use the Decision Explorer to test network routing decisions with NtwBasedRouting algorithm.

+
+
+
+ ) +} diff --git a/website/src/components/pages/DecisionExplorerPage.tsx b/website/src/components/pages/DecisionExplorerPage.tsx new file mode 100644 index 00000000..941bfac9 --- /dev/null +++ b/website/src/components/pages/DecisionExplorerPage.tsx @@ -0,0 +1,1211 @@ +import { useState } from 'react' +import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, Cell, PieChart, Pie } from 'recharts' +import { Card, CardBody, CardHeader } from '../ui/Card' +import { Button } from '../ui/Button' +import { Badge } from '../ui/Badge' +import { ErrorMessage } from '../ui/ErrorMessage' +import { Spinner } from '../ui/Spinner' +import { useMerchantStore } from '../../store/merchantStore' +import { apiPost } from '../../lib/api' +import { DecideGatewayResponse, GatewayConnector } from '../../types/api' +import { ROUTING_APPROACH_COLORS } from '../../lib/constants' +import { Play, RefreshCw, ChevronDown, ChevronUp, Activity, Code, Plus, Trash2, PieChart as PieChartIcon } from 'lucide-react' + +const PAYMENT_METHOD_TYPES = ['CARD', 'UPI', 'WALLET', 'NETBANKING', 'interac'] +const PAYMENT_METHODS = ['CREDIT', 'DEBIT', 'PREPAID'] +const CURRENCIES = ['USD', 'EUR', 'GBP', 'INR', 'SGD', 'AUD', 'CAD'] +const CARD_BRANDS = ['VISA', 'MASTERCARD', 'AMEX', 'RUPAY', 'DINERS'] +const AUTH_TYPES = ['THREE_DS', 'NO_THREE_DS'] +const ALGORITHMS = ['SR_BASED_ROUTING', 'PL_BASED_ROUTING', 'NTW_BASED_ROUTING'] + +const ALGORITHM_LABELS: Record = { + 'SR_BASED_ROUTING': 'Success Rate Based', + 'PL_BASED_ROUTING': 'Priority List Based', + 'NTW_BASED_ROUTING': 'Network Based' +} + +type TabType = 'single' | 'batch' | 'rule' | 'volume' + +interface FormState { + amount: string + currency: string + payment_method_type: string + payment_method: string + card_brand: string + auth_type: string + eligible_gateways: string + ranking_algorithm: string + elimination_enabled: boolean +} + +interface SimulationConfig { + totalPayments: string + successCount: string + failureCount: string +} + +interface SimulationResult { + paymentId: string + decidedGateway: string + status: 'CHARGED' | 'FAILURE' + timestamp: string +} + +interface RuleEvaluateParams { + key: string + type: 'enum_variant' | 'str_value' | 'number' | 'metadata_variant' + value: string + metadataKey?: string +} + +interface RuleEvaluateResponse { + payment_id: string | null + status: string + output: { + type: 'single' | 'priority' | 'volume_split' + connector?: GatewayConnector + connectors?: GatewayConnector[] + splits?: { connector: GatewayConnector; split: number }[] + } + evaluated_output?: GatewayConnector[] + eligible_connectors?: GatewayConnector[] +} + +function approachColor(approach: string): string { + for (const [k, v] of Object.entries(ROUTING_APPROACH_COLORS)) { + if (approach.includes(k) || k.includes(approach)) return v + } + return 'bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8' +} + +const COLORS = ['#0069ED', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6', '#ec4899', '#06b6d4', '#84cc16'] + +export function DecisionExplorerPage() { + const { merchantId } = useMerchantStore() + const [activeTab, setActiveTab] = useState('single') + + const [form, setForm] = useState({ + amount: '1000', + currency: 'USD', + payment_method_type: 'CARD', + payment_method: 'CREDIT', + card_brand: 'VISA', + auth_type: 'THREE_DS', + eligible_gateways: 'stripe, adyen', + ranking_algorithm: 'SR_BASED_ROUTING', + elimination_enabled: false, + }) + + const [simulationConfig, setSimulationConfig] = useState({ + totalPayments: '10', + successCount: '7', + failureCount: '3', + }) + + const [ruleParams, setRuleParams] = useState([ + { key: 'payment_method_type', type: 'enum_variant', value: 'credit', metadataKey: '' }, + { key: 'currency', type: 'enum_variant', value: 'USD', metadataKey: '' }, + ]) + + const [fallbackConnectors, setFallbackConnectors] = useState([ + { gateway_name: 'stripe', gateway_id: 'mca_001' }, + { gateway_name: 'adyen', gateway_id: 'mca_002' }, + ]) + + const [volumePayments, setVolumePayments] = useState('100') + + const [result, setResult] = useState(null) + const [ruleResult, setRuleResult] = useState(null) + const [volumeDistribution, setVolumeDistribution] = useState<{ name: string; count: number; percentage: number }[]>([]) + const [simulationResults, setSimulationResults] = useState([]) + const [isSimulating, setIsSimulating] = useState(false) + const [error, setError] = useState(null) + const [loading, setLoading] = useState(false) + const [filterOpen, setFilterOpen] = useState(false) + const [responseOpen, setResponseOpen] = useState(false) + const [volumeResponseOpen, setVolumeResponseOpen] = useState(false) + + function set(field: keyof FormState, value: string | boolean) { + setForm(f => ({ ...f, [field]: value })) + } + + function addRuleParam() { + setRuleParams([...ruleParams, { key: '', type: 'enum_variant', value: '', metadataKey: '' }]) + } + + function removeRuleParam(index: number) { + setRuleParams(ruleParams.filter((_, i) => i !== index)) + } + + function updateRuleParam(index: number, field: keyof RuleEvaluateParams, value: string) { + setRuleParams(ruleParams.map((p, i) => i === index ? { ...p, [field]: value } : p)) + } + + function updateRuleParamMetadataKey(index: number, value: string) { + setRuleParams(ruleParams.map((p, i) => i === index ? { ...p, metadataKey: value } : p)) + } + + function addFallbackConnector() { + setFallbackConnectors([...fallbackConnectors, { gateway_name: '', gateway_id: '' }]) + } + + function removeFallbackConnector(index: number) { + setFallbackConnectors(fallbackConnectors.filter((_, i) => i !== index)) + } + + function updateFallbackConnector(index: number, field: keyof GatewayConnector, value: string) { + setFallbackConnectors(fallbackConnectors.map((c, i) => i === index ? { ...c, [field]: value } : c)) + } + + async function run() { + if (!merchantId) return setError('Set a merchant ID in the top bar') + setLoading(true); setError(null) + const gateways = form.eligible_gateways.split(',').map(s => s.trim()).filter(Boolean) + try { + const res = await apiPost('/decide-gateway', { + merchantId: merchantId, + paymentInfo: { + paymentId: `explorer_${Date.now()}`, + amount: parseFloat(form.amount) || 1000, + currency: form.currency, + paymentType: 'ORDER_PAYMENT', + paymentMethodType: form.payment_method_type, + paymentMethod: form.payment_method, + authType: form.auth_type, + cardBrand: form.card_brand, + }, + eligibleGatewayList: gateways, + rankingAlgorithm: form.ranking_algorithm, + eliminationEnabled: form.elimination_enabled, + }) + setResult(res) + } catch (e: unknown) { + setError(e instanceof Error ? e.message : 'Request failed') + } finally { + setLoading(false) + } + } + + async function runSimulation() { + if (!merchantId) return setError('Set a merchant ID in the top bar') + + const total = parseInt(simulationConfig.totalPayments) || 0 + const success = parseInt(simulationConfig.successCount) || 0 + const failure = parseInt(simulationConfig.failureCount) || 0 + + if (total <= 0) return setError('Total Payments must be greater than 0') + if (success + failure !== total) { + return setError('Success + Failure count must equal Total Payments') + } + + setIsSimulating(true) + setError(null) + setSimulationResults([]) + + const gateways = form.eligible_gateways.split(',').map(s => s.trim()).filter(Boolean) + const results: SimulationResult[] = [] + + const outcomes: ('CHARGED' | 'FAILURE')[] = [ + ...Array(success).fill('CHARGED'), + ...Array(failure).fill('FAILURE'), + ] + + for (let i = outcomes.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [outcomes[i], outcomes[j]] = [outcomes[j], outcomes[i]] + } + + try { + for (let i = 0; i < total; i++) { + const paymentId = `sim_${Date.now()}_${i}` + + const decideRes = await apiPost('/decide-gateway', { + merchantId: merchantId, + paymentInfo: { + paymentId: paymentId, + amount: parseFloat(form.amount) || 1000, + currency: form.currency, + paymentType: 'ORDER_PAYMENT', + paymentMethodType: form.payment_method_type, + paymentMethod: form.payment_method, + authType: form.auth_type, + cardBrand: form.card_brand, + }, + eligibleGatewayList: gateways, + rankingAlgorithm: form.ranking_algorithm, + eliminationEnabled: form.elimination_enabled, + }) + + const decidedGateway = decideRes.decided_gateway + const outcome = outcomes[i] + + await apiPost('/update-gateway-score', { + merchantId: merchantId, + gateway: decidedGateway, + gatewayReferenceId: null, + status: outcome, + paymentId: paymentId, + enforceDynamicRoutingFailure: null, + }) + + results.push({ + paymentId, + decidedGateway, + status: outcome, + timestamp: new Date().toISOString(), + }) + + setSimulationResults([...results]) + } + } catch (e: unknown) { + setError(e instanceof Error ? e.message : 'Simulation failed') + } finally { + setIsSimulating(false) + } + } + + async function runRuleEvaluation() { + setLoading(true) + setError(null) + setRuleResult(null) + setVolumeDistribution([]) + + try { + const parameters: Record = {} + ruleParams.forEach(p => { + if (p.key) { + if (p.type === 'metadata_variant') { + parameters[p.key] = { + type: p.type, + value: { key: p.metadataKey || p.key, value: p.value } + } + } else if (p.type === 'number') { + parameters[p.key] = { type: p.type, value: parseFloat(p.value) || 0 } + } else { + parameters[p.key] = { type: p.type, value: p.value } + } + } + }) + + const res = await apiPost('/routing/evaluate', { + created_by: merchantId || 'test_user', + fallback_output: fallbackConnectors.filter(c => c.gateway_name), + parameters, + }) + + setRuleResult(res) + + if (res.output.type === 'volume_split' && res.output.splits) { + const totalPayments = parseInt(volumePayments) || 100 + const distribution = res.output.splits.map(item => ({ + name: item.connector.gateway_name, + count: Math.round((item.split / 100) * totalPayments), + percentage: item.split, + })) + setVolumeDistribution(distribution) + } + } catch (e: unknown) { + setError(e instanceof Error ? e.message : 'Request failed') + } finally { + setLoading(false) + } + } + + async function runVolumeSplit() { + setLoading(true) + setError(null) + setVolumeDistribution([]) + + try { + const res = await apiPost('/routing/evaluate', { + created_by: merchantId || 'test_user', + fallback_output: [ + { gateway_name: 'stripe', gateway_id: 'mca_001' }, + { gateway_name: 'adyen', gateway_id: 'mca_002' }, + ], + parameters: {}, + }) + + setRuleResult(res) + + if (res.output.type === 'volume_split' && res.output.splits) { + const totalPayments = parseInt(volumePayments) || 100 + const distribution = res.output.splits.map(item => ({ + name: item.connector.gateway_name, + count: Math.round((item.split / 100) * totalPayments), + percentage: item.split, + })) + setVolumeDistribution(distribution) + } + } catch (e: unknown) { + setError(e instanceof Error ? e.message : 'Request failed') + } finally { + setLoading(false) + } + } + + const scoreData = result?.gateway_priority_map + ? Object.entries(result.gateway_priority_map) + .sort(([, a], [, b]) => b - a) + .map(([name, score]) => ({ name, score: Math.round(score * 1000) / 10 })) + : [] + + const gatewayStats = simulationResults.reduce((acc, curr) => { + if (!acc[curr.decidedGateway]) { + acc[curr.decidedGateway] = { total: 0, success: 0, failure: 0 } + } + acc[curr.decidedGateway].total++ + if (curr.status === 'CHARGED') acc[curr.decidedGateway].success++ + else acc[curr.decidedGateway].failure++ + return acc + }, {} as Record) + + const pieData = volumeDistribution.map(d => ({ name: d.name, value: d.count })) + + return ( +
+
+

Decision Explorer

+

+ Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split. +

+
+ +
+ + + + +
+ +
+ + +

+ {activeTab === 'rule' ? 'Rule Evaluation Parameters' : + activeTab === 'volume' ? 'Volume Split Configuration' : + 'Payment Parameters'} +

+
+ + {!merchantId && activeTab !== 'volume' && ( +

+ Set a merchant ID in the top bar first. +

+ )} + + {activeTab === 'rule' ? ( + <> +
+ +
+ {ruleParams.map((param, idx) => ( +
+
+ updateRuleParam(idx, 'key', e.target.value)} + className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + + +
+ {param.type === 'metadata_variant' ? ( +
+ updateRuleParamMetadataKey(idx, e.target.value)} + className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + updateRuleParam(idx, 'value', e.target.value)} + className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
+ ) : ( +
+ updateRuleParam(idx, 'value', e.target.value)} + className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
+ )} +
+ ))} +
+ +
+ +
+ +
+ {fallbackConnectors.map((connector, idx) => ( +
+ updateFallbackConnector(idx, 'gateway_name', e.target.value)} + className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + updateFallbackConnector(idx, 'gateway_id', e.target.value)} + className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + +
+ ))} +
+ +
+ + ) : activeTab === 'volume' ? ( +
+ + setVolumePayments(e.target.value)} + className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +

+ Enter the total number of payments to visualize how they would be distributed across connectors. +

+
+ ) : ( + <> +
+
+ + set('amount', e.target.value)} + className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" /> +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + set('eligible_gateways', e.target.value)} + placeholder="stripe, adyen" + className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" /> +
+ +
+
+ + +
+
+ +
+
+ + {activeTab === 'batch' && ( +
+

+ + Simulation Configuration +

+
+
+ + setSimulationConfig(s => ({ ...s, totalPayments: e.target.value }))} + className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
+
+ + setSimulationConfig(s => ({ ...s, successCount: e.target.value }))} + className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
+
+ + setSimulationConfig(s => ({ ...s, failureCount: e.target.value }))} + className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
+
+

+ Will run {simulationConfig.totalPayments || 0} payments: {simulationConfig.successCount || 0} SUCCESS, {simulationConfig.failureCount || 0} FAILURE +

+
+ )} + + )} + + + + {activeTab === 'rule' ? ( + + ) : activeTab === 'volume' ? ( + + ) : activeTab === 'batch' ? ( + + ) : ( + + )} +
+
+ +
+ {activeTab === 'volume' ? ( + volumeDistribution.length > 0 ? ( + <> + + +

Volume Distribution Overview

+
+ +
+

{volumePayments}

+

Total Payments

+
+
+ {volumeDistribution.map((item, idx) => ( +
+
+
+ {item.name} +
+
+ {item.percentage}% + {item.count} payments +
+
+ ))} +
+ + + + + +

Pie Chart

+
+ + + + `${name} ${(percent * 100).toFixed(0)}%`} + labelLine={false} + > + {pieData.map((_, index) => ( + + ))} + + [`${value} payments`, 'Count']} + contentStyle={document.documentElement.classList.contains('dark') ? { backgroundColor: '#111114', border: '1px solid #222226', borderRadius: '8px', color: '#fff' } : { backgroundColor: '#fff', border: '1px solid #e5e7eb', borderRadius: '8px', color: '#1f2937' }} + /> + + + +
+ + + +

Bar Chart

+
+ + + + + + [`${value} payments`, 'Count']} + contentStyle={document.documentElement.classList.contains('dark') ? { backgroundColor: '#111114', border: '1px solid #222226', borderRadius: '8px', color: '#fff' } : { backgroundColor: '#fff', border: '1px solid #e5e7eb', borderRadius: '8px', color: '#1f2937' }} + /> + + {volumeDistribution.map((_, index) => ( + + ))} + + + + +
+ + + +

Percentage Distribution

+
+ +
+ {volumeDistribution.map((item, idx) => ( +
+ ))} +
+
+ {volumeDistribution.map((item, idx) => ( +
+
+ {item.name} + {item.percentage}% +
+ ))} +
+ + + + + +

Connector Summary

+
+ + + + + + + + + + + {volumeDistribution.map((item, idx) => ( + + + + + + ))} + + + + + + +
ConnectorPaymentsPercentage
+
+
+ {item.name} +
+
{item.count}{item.percentage}%
Total{volumePayments}100%
+
+
+ + + +

Payment Log

+
+ + + + + + + + + + {Array.from({ length: parseInt(volumePayments) || 0 }).map((_, idx) => { + let cumulative = 0 + let connector = volumeDistribution[0]?.name || '' + let colorIdx = 0 + + for (let i = 0; i < volumeDistribution.length; i++) { + cumulative += volumeDistribution[i].count + if (idx < cumulative) { + connector = volumeDistribution[i].name + colorIdx = i + break + } + } + + return ( + + + + + ) + })} + +
#Connector
{idx + 1} +
+
+ {connector} +
+
+
+
+ + + + + + {volumeResponseOpen && ruleResult && ( + +
+                        {JSON.stringify(ruleResult, null, 2)}
+                      
+
+ )} +
+ + ) : ( + + + +

Enter the number of payments and click "Visualize Distribution" to see how payments are split across connectors.

+
+
+ ) + ) : activeTab === 'rule' ? ( + ruleResult ? ( + <> + + +
+
+

Output Type

+

{ruleResult.output.type}

+
+
+ + {ruleResult.output.type === 'single' && ruleResult.output.connector && ( +
+

Selected Gateway

+

{ruleResult.output.connector.gateway_name}

+ {ruleResult.output.connector.gateway_id && ( +

ID: {ruleResult.output.connector.gateway_id}

+ )} +
+ )} + + {ruleResult.output.type === 'priority' && ruleResult.output.connectors && ( +
+

Priority List

+
+ {ruleResult.output.connectors.map((gw, idx) => ( +
+ {idx + 1} + {gw.gateway_name} + {gw.gateway_id && ({gw.gateway_id})} +
+ ))} +
+
+ )} + + {ruleResult.output.type === 'volume_split' && ( +
+

Volume Split Result

+

See Volume Split tab for detailed visualization.

+
+ )} +
+
+ + + + + + {responseOpen && ( + +
+                        {JSON.stringify(ruleResult, null, 2)}
+                      
+
+ )} +
+ + ) : ( + + + +

Configure rule parameters and click "Evaluate Rules" to test routing.

+
+
+ ) + ) : activeTab === 'batch' ? ( + simulationResults.length > 0 ? ( + <> + + +

Simulation Progress

+
+ +
+
+ Progress + {Math.round((simulationResults.length / (parseInt(simulationConfig.totalPayments) || 1)) * 100)}% +
+
+
+
+
+ + {Object.keys(gatewayStats).length > 0 && ( +
+

Gateway Selection Summary

+ {Object.entries(gatewayStats).map(([gateway, stats]) => ( +
+ {gateway} +
+ {stats.success} ✓ + {stats.failure} ✗ + ({stats.total} total) +
+
+ ))} +
+ )} + + + + + +

Transaction Log

+
+ + + + + + + + + + + + {simulationResults.map((res, idx) => ( + + + + + + + ))} + +
#Payment IDGatewayOutcome
{idx + 1}{res.paymentId.slice(-8)}{res.decidedGateway} + + {res.status} + +
+
+
+ + ) : ( + + + +

Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.

+
+
+ ) + ) : ( + result ? ( + <> + + +
+
+

Decided Gateway

+

{result.decided_gateway}

+
+
+
+ + {result.routing_approach} + +
+ {result.is_scheduled_outage && Scheduled Outage} + {result.latency != null && ( +

{result.latency}ms

+ )} +
+
+ {result.routing_dimension && ( +
+
+ Dimension +

{result.routing_dimension}

+
+ {result.routing_dimension_level && ( +
+ Level +

{result.routing_dimension_level}

+
+ )} +
+ Reset +

{result.reset_approach}

+
+
+ )} +
+
+ + {scoreData.length > 0 && ( + + +
+

Gateway Scores

+ +
+
+ + + + `${v}%`} tick={{ fontSize: 11, fill: '#66667a' }} axisLine={{ stroke: '#1c1c24' }} tickLine={false} /> + + `${v}%`} contentStyle={{ backgroundColor: '#0d0d12', border: '1px solid #1c1c24', borderRadius: '8px', color: '#e8e8f4' }} /> + + {scoreData.map((entry, i) => ( + + ))} + + + + +
+ )} + + {result.filter_wise_gateways && ( + + + + + {filterOpen && ( + + {Object.entries(result.filter_wise_gateways).map(([filter, gateways]) => ( +
+ {filter} +
+ {Array.isArray(gateways) + ? gateways.map(gw => ( + {gw} + )) + : + } +
+
+ ))} +
+ )} +
+ )} + + + + + + {responseOpen && ( + +
+                        {JSON.stringify(result, null, 2)}
+                      
+
+ )} +
+ + ) : ( + + + +

Fill in the parameters and click "Run Decision" to see the routing result.

+
+
+ ) + )} +
+
+
+ ) +} diff --git a/website/src/components/pages/EuclidRulesPage.tsx b/website/src/components/pages/EuclidRulesPage.tsx new file mode 100644 index 00000000..c4755077 --- /dev/null +++ b/website/src/components/pages/EuclidRulesPage.tsx @@ -0,0 +1,821 @@ +import { useState } from 'react' +import useSWR from 'swr' +import { + DndContext, + closestCenter, + KeyboardSensor, + PointerSensor, + useSensor, + useSensors, + DragEndEvent, +} from '@dnd-kit/core' +import { + arrayMove, + SortableContext, + sortableKeyboardCoordinates, + useSortable, + verticalListSortingStrategy, +} from '@dnd-kit/sortable' +import { CSS } from '@dnd-kit/utilities' +import { Card, CardBody, CardHeader } from '../ui/Card' +import { Badge } from '../ui/Badge' +import { Button } from '../ui/Button' +import { ErrorMessage } from '../ui/ErrorMessage' +import { useMerchantStore } from '../../store/merchantStore' +import { apiPost } from '../../lib/api' +import { RoutingAlgorithm } from '../../types/api' +import { useDynamicRoutingConfig, RoutingKeyConfig } from '../../hooks/useDynamicRoutingConfig' +import { STATIC_ROUTING_KEYS } from '../../lib/constants' +import { Plus, Trash2, GripVertical, ChevronDown, ChevronUp, Eye } from 'lucide-react' + +const OPERATOR_TO_API: Record = { + '==': 'equal', + '!=': 'not_equal', + '>': 'greater_than', + '<': 'less_than', + '>=': 'greater_than_equal', + '<=': 'less_than_equal', +} + +// ---- Types for builder ---- +interface GatewayEntry { + id: string + name: string +} + +interface VolSplitEntry { + id: string + name: string + split: number +} + +interface ConditionRow { + id: string + lhs: string + operator: string + value: string +} + +interface RuleBlock { + id: string + name: string + conditions: ConditionRow[] + outputType: 'priority' | 'volume_split' + priorityGateways: GatewayEntry[] + volumeGateways: VolSplitEntry[] +} + +type DefaultOutput = { + type: 'priority' | 'volume_split' + priorityGateways: GatewayEntry[] + volumeGateways: VolSplitEntry[] +} + +// ---- Sortable gateway item ---- +function SortableGatewayItem({ + id, + name, + onRemove, +}: { + id: string + name: string + onRemove: () => void +}) { + const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id }) + const style = { transform: CSS.Transform.toString(transform), transition } + return ( +
+ + + + {name} + +
+ ) +} + +// ---- Priority output editor ---- +function PriorityEditor({ + gateways, + onChange, +}: { + gateways: GatewayEntry[] + onChange: (gws: GatewayEntry[]) => void +}) { + const [newName, setNewName] = useState('') + const sensors = useSensors( + useSensor(PointerSensor), + useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }) + ) + + function handleDragEnd(event: DragEndEvent) { + const { active, over } = event + if (over && active.id !== over.id) { + const oldIndex = gateways.findIndex((g) => g.id === active.id) + const newIndex = gateways.findIndex((g) => g.id === over.id) + onChange(arrayMove(gateways, oldIndex, newIndex)) + } + } + + function add() { + if (!newName.trim()) return + onChange([...gateways, { id: crypto.randomUUID(), name: newName.trim() }]) + setNewName('') + } + + return ( +
+ + g.id)} strategy={verticalListSortingStrategy}> + {gateways.map((gw, idx) => ( + onChange(gateways.filter((g) => g.id !== gw.id))} + /> + ))} + + +
+ setNewName(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && (e.preventDefault(), add())} + placeholder="gateway name" + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + +
+
+ ) +} + +// ---- Volume split output editor ---- +function VolumeSplitEditor({ + gateways, + onChange, +}: { + gateways: VolSplitEntry[] + onChange: (gws: VolSplitEntry[]) => void +}) { + const [newName, setNewName] = useState('') + const total = gateways.reduce((s, g) => s + g.split, 0) + + function add() { + if (!newName.trim()) return + onChange([...gateways, { id: crypto.randomUUID(), name: newName.trim(), split: 0 }]) + setNewName('') + } + + return ( +
+ {gateways.map((gw) => ( +
+ {gw.name} + + onChange( + gateways.map((g) => + g.id === gw.id ? { ...g, split: Number(e.target.value) } : g + ) + ) + } + className="flex-1 accent-brand-500" + /> + {gw.split}% + +
+ ))} +
+ Total: {total}% {total !== 100 && '(must equal 100)'} +
+
+ setNewName(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && (e.preventDefault(), add())} + placeholder="gateway name" + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + +
+
+ ) +} + +// ---- Condition row ---- +function ConditionRowEditor({ + row, + onChange, + onRemove, + routingKeys, +}: { + row: ConditionRow + onChange: (r: ConditionRow) => void + onRemove: () => void + routingKeys: Record +}) { + const keyInfo = routingKeys[row.lhs] + const isEnum = keyInfo?.type === 'enum' + const isInt = keyInfo?.type === 'integer' + + const operators = isInt + ? ['>', '<', '>=', '<=', '==', '!='] + : ['==', '!='] + + return ( +
+ + + {isEnum ? ( + + ) : ( + onChange({ ...row, value: e.target.value })} + placeholder="value" + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none" + /> + )} + +
+ ) +} + +// ---- Rule block ---- +function RuleBlockEditor({ + block, + onChange, + onRemove, + routingKeys, +}: { + block: RuleBlock + onChange: (b: RuleBlock) => void + onRemove: () => void + routingKeys: Record +}) { + const [collapsed, setCollapsed] = useState(false) + + // Get the first available key from routing keys for defaults + const firstKey = Object.keys(routingKeys)[0] || 'payment_method' + const firstKeyValues = routingKeys[firstKey]?.values || [] + const defaultValue = firstKeyValues[0] || '' + + function addCondition() { + onChange({ + ...block, + conditions: [ + ...block.conditions, + { + id: crypto.randomUUID(), + lhs: firstKey, + operator: '==', + value: defaultValue, + }, + ], + }) + } + + return ( +
+
setCollapsed(!collapsed)} + > + { + e.stopPropagation() + onChange({ ...block, name: e.target.value }) + }} + onClick={(e) => e.stopPropagation()} + placeholder="Rule name" + className="bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900" + /> +
+ + {collapsed ? : } +
+
+ {!collapsed && ( +
+ {/* Conditions */} +
+

CONDITIONS

+
+ {block.conditions.map((cond) => ( + + onChange({ + ...block, + conditions: block.conditions.map((c) => + c.id === cond.id ? updated : c + ), + }) + } + onRemove={() => + onChange({ + ...block, + conditions: block.conditions.filter((c) => c.id !== cond.id), + }) + } + /> + ))} + +
+
+ + {/* Output */} +
+

OUTPUT

+
+ {(['priority', 'volume_split'] as const).map((t) => ( + + ))} +
+ {block.outputType === 'priority' ? ( + onChange({ ...block, priorityGateways: gws })} + /> + ) : ( + onChange({ ...block, volumeGateways: gws })} + /> + )} +
+
+ )} +
+ ) +} + +// ---- Build Euclid payload ---- +function buildAlgorithmData(rules: RuleBlock[], defaultOutput: DefaultOutput, routingKeys: Record) { + function buildOutput(type: 'priority' | 'volume_split', pg: GatewayEntry[], vg: VolSplitEntry[]): Record { + if (type === 'priority') { + return { + priority: pg.map((g) => ({ gateway_name: g.name, gateway_id: null })), + } + } + return { + volume_split: vg.map((g) => ({ + split: g.split, + output: { gateway_name: g.name, gateway_id: null }, + })), + } + } + + function getRoutingType(type: 'priority' | 'volume_split'): string { + return type === 'priority' ? 'priority' : 'volume_split' + } + + return { + globals: {}, + default_selection: buildOutput( + defaultOutput.type, + defaultOutput.priorityGateways, + defaultOutput.volumeGateways + ), + rules: rules.map((r) => ({ + name: r.name, + routing_type: getRoutingType(r.outputType), + output: buildOutput(r.outputType, r.priorityGateways, r.volumeGateways), + statements: [ + { + condition: r.conditions.map((c) => ({ + lhs: c.lhs, + comparison: OPERATOR_TO_API[c.operator] || c.operator, + value: { + type: routingKeys[c.lhs]?.type === 'integer' ? 'number' : 'enum_variant', + value: routingKeys[c.lhs]?.type === 'integer' ? Number(c.value) : c.value, + }, + metadata: {}, + })), + }, + ], + })), + } +} + +// ---- Main Page ---- +export function EuclidRulesPage() { + const { merchantId } = useMerchantStore() + const { routingKeysConfig } = useDynamicRoutingConfig() + // Use dynamic config if available, otherwise fall back to static + const routingKeys = Object.keys(routingKeysConfig).length > 0 ? routingKeysConfig : STATIC_ROUTING_KEYS + const [ruleName, setRuleName] = useState('') + const [ruleDesc, setRuleDesc] = useState('') + const [ruleBlocks, setRuleBlocks] = useState([]) + const [defaultOutput, setDefaultOutput] = useState({ + type: 'priority', + priorityGateways: [], + volumeGateways: [], + }) + const [showJson, setShowJson] = useState(false) + const [submitting, setSubmitting] = useState(false) + const [submitError, setSubmitError] = useState(null) + const [createdId, setCreatedId] = useState(null) + const [activating, setActivating] = useState(false) + const [activateError, setActivateError] = useState(null) + const [activateSuccess, setActivateSuccess] = useState(false) + const [expandedRuleIds, setExpandedRuleIds] = useState>(new Set()) + + const { data: allAlgorithms, mutate } = useSWR( + merchantId ? `/routing/list/${merchantId}` : null, + () => apiPost(`/routing/list/${merchantId}`) + ) + + const { data: activeAlgorithms } = useSWR( + merchantId ? `/routing/list/active/${merchantId}` : null, + () => apiPost(`/routing/list/active/${merchantId}`) + ) + + const activeIds = new Set((activeAlgorithms || []).map((a) => a.id)) + + const algorithmData = buildAlgorithmData(ruleBlocks, defaultOutput, routingKeys) + + async function handleSubmit(e: React.FormEvent) { + e.preventDefault() + if (!merchantId) { setSubmitError('Set a Merchant ID first.'); return } + if (!ruleName.trim()) { setSubmitError('Rule name is required.'); return } + setSubmitting(true) + setSubmitError(null) + setCreatedId(null) + try { + const result = await apiPost('/routing/create', { + name: ruleName.trim(), + description: ruleDesc, + created_by: merchantId, + algorithm_for: 'payment', + algorithm: { type: 'advanced', data: algorithmData }, + }) + setCreatedId(result.id) + mutate() + } catch (err) { + setSubmitError(String(err)) + } finally { + setSubmitting(false) + } + } + + async function handleActivate(id: string) { + if (!merchantId) return + setActivating(true) + setActivateError(null) + setActivateSuccess(false) + try { + await apiPost('/routing/activate', { + created_by: merchantId, + routing_algorithm_id: id, + }) + setActivateSuccess(true) + mutate() + } catch (err) { + setActivateError(String(err)) + } finally { + setActivating(false) + } + } + + function toggleRuleExpand(id: string) { + setExpandedRuleIds(prev => { + const newSet = new Set(prev) + if (newSet.has(id)) { + newSet.delete(id) + } else { + newSet.add(id) + } + return newSet + }) + } + + function addRuleBlock() { + setRuleBlocks((prev) => [ + ...prev, + { + id: crypto.randomUUID(), + name: `Rule ${prev.length + 1}`, + conditions: [], + outputType: 'priority', + priorityGateways: [], + volumeGateways: [], + }, + ]) + } + + return ( +
+
+

Rule-Based Routing

+

Create Euclid DSL declarative routing rules

+
+ +
+ {/* Rule list */} +
+ + +

Existing Rules

+
+ + {!merchantId ? ( +

Set merchant ID to load rules.

+ ) : !allAlgorithms ? ( +

Loading...

+ ) : allAlgorithms.length === 0 ? ( +

No rules yet.

+ ) : ( + + + {allAlgorithms.map((algo) => { + const isActive = activeIds.has(algo.id) + const isExpanded = expandedRuleIds.has(algo.id) + // Backend returns algorithm_data, map it to algorithm for display + const algorithm = algo.algorithm_data || algo.algorithm + return ( + <> + + + + + + {isExpanded && ( + + + + )} + + ) + })} + +
+

{algo.name}

+

{algorithm?.type}

+
+ + {isActive ? 'Active' : 'Inactive'} + + +
+ + {!isActive && ( + + )} +
+
+
+

ID: {algo.id}

+

Description: {algo.description || 'N/A'}

+

Algorithm For: {algo.algorithm_for}

+ {algo.created_at && ( +

Created: {new Date(algo.created_at).toLocaleString()}

+ )} +
+ Configuration: +
+                                      {JSON.stringify(algorithm, null, 2)}
+                                    
+
+
+
+ )} +
+
+ {activateError && } + {activateSuccess && ( +
+ Rule activated successfully. +
+ )} +
+ + {/* Rule builder */} +
+
+ + +

Rule Builder

+
+ +
+
+ + setRuleName(e.target.value)} + placeholder="my-rule" + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
+
+ + setRuleDesc(e.target.value)} + placeholder="Optional description" + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
+
+ + {/* Rule blocks */} +
+

Rules

+ {ruleBlocks.map((block) => ( + + setRuleBlocks((prev) => + prev.map((b) => (b.id === block.id ? updated : b)) + ) + } + onRemove={() => + setRuleBlocks((prev) => prev.filter((b) => b.id !== block.id)) + } + /> + ))} + +
+ + {/* Default selection */} +
+

DEFAULT SELECTION (Fallback)

+
+ {(['priority', 'volume_split'] as const).map((t) => ( + + ))} +
+ {defaultOutput.type === 'priority' ? ( + + setDefaultOutput({ ...defaultOutput, priorityGateways: gws }) + } + /> + ) : ( + + setDefaultOutput({ ...defaultOutput, volumeGateways: gws }) + } + /> + )} +
+ + + {createdId && ( +
+ Rule created (ID: {createdId}) + +
+ )} +
+ + +
+
+
+
+ + {/* JSON preview */} + {showJson && ( + + +

JSON Preview

+
+ +
+                  {JSON.stringify(
+                    {
+                      name: ruleName,
+                      description: ruleDesc,
+                      created_by: merchantId,
+                      algorithm_for: 'payment',
+                      algorithm: { type: 'advanced', data: algorithmData },
+                    },
+                    null,
+                    2
+                  )}
+                
+
+
+ )} +
+
+
+ ) +} diff --git a/website/src/components/pages/OverviewPage.tsx b/website/src/components/pages/OverviewPage.tsx new file mode 100644 index 00000000..7462b43e --- /dev/null +++ b/website/src/components/pages/OverviewPage.tsx @@ -0,0 +1,178 @@ +import { useNavigate } from 'react-router-dom' +import { useEffect, useState } from 'react' +import useSWR from 'swr' +import { Card, CardBody, CardHeader } from '../ui/Card' +import { Badge } from '../ui/Badge' +import { useMerchantStore } from '../../store/merchantStore' +import { apiPost } from '../../lib/api' +import { RoutingAlgorithm, RuleConfig } from '../../types/api' +import { CheckCircle, XCircle, AlertCircle } from 'lucide-react' + +function useHealth() { + const [status, setStatus] = useState<'up' | 'down' | 'loading'>('loading') + useEffect(() => { + console.log(`\n[HEALTH CHECK] ${new Date().toISOString()}`) + console.log('Fetching: GET /health') + + fetch('/health') + .then((r) => { + console.log(`[HEALTH CHECK] Response: ${r.status} ${r.statusText}`) + setStatus(r.ok ? 'up' : 'down') + }) + .catch((err) => { + console.log(`[HEALTH CHECK ERROR] ${err.message}`) + setStatus('down') + }) + }, []) + return status +} + +export function OverviewPage() { + const navigate = useNavigate() + const { merchantId } = useMerchantStore() + const health = useHealth() + + const { data: activeAlgorithms } = useSWR( + merchantId ? `/routing/list/active/${merchantId}` : null, + () => apiPost(`/routing/list/active/${merchantId}`), + { shouldRetryOnError: false } + ) + + const { data: srConfig, error: srError } = useSWR( + merchantId ? [`/rule/get`, 'successRate', merchantId] : null, + () => + apiPost('/rule/get', { merchant_id: merchantId, algorithm: 'successRate' }) + ) + + const activeRouting = + activeAlgorithms && activeAlgorithms.length > 0 ? activeAlgorithms[0] : null + + const hasRuleBasedRouting = (activeAlgorithms || []).some(a => + (a.algorithm_data || a.algorithm)?.type === 'advanced' + ) + + return ( +
+
+

Overview

+

+ Decision Engine routing health and status +

+
+ + {!merchantId && ( +
+ + Set your Merchant ID in the top bar to load configuration. +
+ )} + + {/* Health status */} +
+ + + {health === 'up' ? ( + + ) : health === 'down' ? ( + + ) : ( +
+ )} +
+

API Health

+

+ {health === 'up' ? 'Healthy' : health === 'down' ? 'Down' : 'Checking...'} +

+
+ + + + navigate('/routing')} + > + +

Active Routing Rule

+ {!merchantId ? ( + Not set + ) : activeRouting ? ( +
+ Active +

{activeRouting.name}

+

{(activeRouting.algorithm_data || activeRouting.algorithm)?.type}

+
+ ) : ( + Not Configured + )} +
+
+ + navigate('/routing/sr')} + > + +

Auth-Rate Config

+ {!merchantId ? ( + Not set + ) : srError ? ( + Not Configured + ) : srConfig?.data ? ( + Configured + ) : ( + Not Configured + )} +
+
+ + navigate('/routing/rules')} + > + +

Rule-Based Routing

+ {!merchantId ? ( + Not set + ) : hasRuleBasedRouting ? ( + Configured + ) : ( + Not Configured + )} +
+
+
+ + {/* Active algorithm detail */} + {activeRouting && ( + navigate('/routing')} + > + +

Active Routing Configuration

+
+ +
+
+
Name
+
{activeRouting.name}
+
+
+
Type
+
{(activeRouting.algorithm_data || activeRouting.algorithm)?.type}
+
+
+
Algorithm For
+
{activeRouting.algorithm_for}
+
+
+
ID
+
{activeRouting.id}
+
+
+
+
+ )} +
+ ) +} diff --git a/website/src/components/pages/RoutingHubPage.tsx b/website/src/components/pages/RoutingHubPage.tsx new file mode 100644 index 00000000..78c85bc7 --- /dev/null +++ b/website/src/components/pages/RoutingHubPage.tsx @@ -0,0 +1,121 @@ +import { useNavigate } from 'react-router-dom' +import useSWR from 'swr' +import { Card, CardBody } from '../ui/Card' +import { Badge } from '../ui/Badge' +import { useMerchantStore } from '../../store/merchantStore' +import { apiPost } from '../../lib/api' +import { RoutingAlgorithm, RuleConfig } from '../../types/api' +import { TrendingUp, Layers, PieChart, CreditCard } from 'lucide-react' + +interface RoutingCard { + id: string + title: string + description: string + icon: React.ElementType + route: string + algorithmType: string + checkConfigured: () => boolean +} + +export function RoutingHubPage() { + const navigate = useNavigate() + const { merchantId } = useMerchantStore() + + const { data: activeAlgorithms } = useSWR( + merchantId ? `/routing/list/active/${merchantId}` : null, + () => apiPost(`/routing/list/active/${merchantId}`) + ) + + const { data: srConfig } = useSWR( + merchantId ? ['/rule/get', 'successRate', merchantId] : null, + () => apiPost('/rule/get', { merchant_id: merchantId, algorithm: 'successRate' }) + ) + + const ROUTING_CARDS: RoutingCard[] = [ + { + id: 'sr', + title: 'Auth-Rate Based Routing', + description: 'Dynamically route to the best-performing gateway based on real-time authorization rates.', + icon: TrendingUp, + route: '/routing/sr', + algorithmType: 'successRate', + checkConfigured: () => !!(srConfig as any)?.config?.data, + }, + { + id: 'rules', + title: 'Rule-Based Routing', + description: 'Declarative Euclid DSL rules to route payments based on conditions and attributes.', + icon: Layers, + route: '/routing/rules', + algorithmType: 'advanced', + checkConfigured: () => (activeAlgorithms || []).some(a => + (a.algorithm_data || a.algorithm)?.type === 'advanced' + ), + }, + { + id: 'volume', + title: 'Volume Split', + description: 'Distribute payment traffic across gateways by configurable percentage splits.', + icon: PieChart, + route: '/routing/volume', + algorithmType: 'volume_split', + checkConfigured: () => (activeAlgorithms || []).some(a => + (a.algorithm_data || a.algorithm)?.type === 'volume_split' + ), + }, + { + id: 'debit', + title: 'Network Routing', + description: 'Optimise debit network fees with acquirer-aware network-based routing.', + icon: CreditCard, + route: '/routing/debit', + algorithmType: 'debitRouting', + checkConfigured: () => false, // Not implemented yet + }, + ] + + return ( +
+
+

Routing Hub

+

+ Click on any routing strategy to configure +

+
+ +
+ {ROUTING_CARDS.map((card) => { + const Icon = card.icon + const isConfigured = card.checkConfigured() + return ( + navigate(card.route)} + > + +
+
+ +
+ + {isConfigured ? 'Configured' : 'Not Configured'} + +
+
+

{card.title}

+

{card.description}

+
+
+ + {isConfigured ? 'Manage →' : 'Setup →'} + +
+
+
+ ) + })} +
+
+ ) +} \ No newline at end of file diff --git a/website/src/components/pages/SRRoutingPage.tsx b/website/src/components/pages/SRRoutingPage.tsx new file mode 100644 index 00000000..96ee2b18 --- /dev/null +++ b/website/src/components/pages/SRRoutingPage.tsx @@ -0,0 +1,482 @@ +import useSWR from 'swr' +import { useForm, useFieldArray } from 'react-hook-form' +import { zodResolver } from '@hookform/resolvers/zod' +import { z } from 'zod' +import { useEffect, useState } from 'react' +import { Card, CardBody, CardHeader } from '../ui/Card' +import { Badge } from '../ui/Badge' +import { Button } from '../ui/Button' +import { ErrorMessage } from '../ui/ErrorMessage' +import { Spinner } from '../ui/Spinner' +import { useMerchantStore } from '../../store/merchantStore' +import { apiPost } from '../../lib/api' +import { PAYMENT_METHOD_TYPES, PAYMENT_METHODS } from '../../lib/constants' +import { Plus, Trash2, Eye } from 'lucide-react' + +// ---- Schema ---- +const subLevelSchema = z.object({ + paymentMethodType: z.string().min(1), + paymentMethod: z.string().min(1), + bucketSize: z.coerce.number().int().positive(), + hedgingPercent: z.preprocess( + (v) => (v === '' || v === null ? null : Number(v)), + z.number().nullable() + ), + latencyThreshold: z.preprocess( + (v) => (v === '' || v === null ? null : Number(v)), + z.number().nullable() + ), +}) + +const srFormSchema = z.object({ + defaultBucketSize: z.coerce.number().int().positive(), + defaultSuccessRate: z.preprocess( + (v) => (v === '' || v === null ? null : Number(v)), + z.number().min(0).max(1).nullable() + ), + defaultLatencyThreshold: z.preprocess( + (v) => (v === '' || v === null ? null : Number(v)), + z.number().nullable() + ), + defaultHedgingPercent: z.preprocess( + (v) => (v === '' || v === null ? null : Number(v)), + z.number().nullable() + ), + subLevelInputConfig: z.array(subLevelSchema), +}) + +type SRForm = z.infer + +interface SRConfigResponse { + merchant_id: string + modified_at?: string + config: { + type: string + data: { + defaultBucketSize: number + defaultSuccessRate: number | null + defaultLatencyThreshold: number | null + defaultHedgingPercent: number | null + subLevelInputConfig: { + paymentMethodType: string + paymentMethod: string + bucketSize: number + hedgingPercent: number | null + latencyThreshold: number | null + }[] | null + } + } +} + +export function SRRoutingPage() { + const { merchantId } = useMerchantStore() + const [saving, setSaving] = useState(false) + const [saveError, setSaveError] = useState(null) + const [saveSuccess, setSaveSuccess] = useState(false) + const [showCurrentConfig, setShowCurrentConfig] = useState(false) + const [deleting, setDeleting] = useState(false) + const [deleteError, setDeleteError] = useState(null) + + const { data: existing, isLoading, mutate } = useSWR( + merchantId ? ['rule-sr', merchantId] : null, + () => apiPost('/rule/get', { merchant_id: merchantId, algorithm: 'successRate' }), + { shouldRetryOnError: false } + ) + + const { + register, + control, + handleSubmit, + reset, + watch, + formState: { errors }, + } = useForm({ + resolver: zodResolver(srFormSchema), + defaultValues: { + defaultBucketSize: 200, + defaultSuccessRate: 0.5, + defaultLatencyThreshold: null, + defaultHedgingPercent: null, + subLevelInputConfig: [], + }, + }) + + // Pre-fill form from fetched config + useEffect(() => { + if (existing?.config?.data) { + const d = existing.config.data + reset({ + defaultBucketSize: d.defaultBucketSize ?? 200, + defaultSuccessRate: d.defaultSuccessRate ?? 0.5, + defaultLatencyThreshold: d.defaultLatencyThreshold ?? null, + defaultHedgingPercent: d.defaultHedgingPercent ?? null, + subLevelInputConfig: d.subLevelInputConfig ?? [], + }) + } + }, [existing, reset]) + + const { fields, append, remove } = useFieldArray({ control, name: 'subLevelInputConfig' }) + const watchedRows = watch('subLevelInputConfig') + + async function ensureMerchantExists() { + try { + await apiPost(`/merchant-account/create`, { + merchant_id: merchantId, + gateway_success_rate_based_decider_input: null, + }) + } catch { + // Ignore — merchant may already exist + } + } + + async function onSave(data: SRForm) { + if (!merchantId) { setSaveError('Set a Merchant ID first.'); return } + setSaving(true); setSaveError(null); setSaveSuccess(false) + try { + await ensureMerchantExists() + const endpoint = existing ? '/rule/update' : '/rule/create' + await apiPost(endpoint, { + merchant_id: merchantId, + config: { + type: 'successRate', + data: { + defaultBucketSize: data.defaultBucketSize, + defaultSuccessRate: data.defaultSuccessRate, + defaultLatencyThreshold: data.defaultLatencyThreshold, + defaultHedgingPercent: data.defaultHedgingPercent, + subLevelInputConfig: data.subLevelInputConfig.length > 0 + ? data.subLevelInputConfig + : null, + }, + }, + }) + setSaveSuccess(true) + mutate() + } catch (err: unknown) { + setSaveError(err instanceof Error ? err.message : String(err)) + } finally { + setSaving(false) + } + } + + async function handleDelete() { + if (!merchantId) return + setDeleting(true); setDeleteError(null) + try { + await apiPost('/rule/delete', { merchant_id: merchantId, algorithm: 'successRate' }) + mutate(undefined, { revalidate: false }) + } catch (err: unknown) { + setDeleteError(err instanceof Error ? err.message : String(err)) + } finally { + setDeleting(false) + } + } + + return ( +
+
+

Auth-Rate Based Routing

+

+ Configure success-rate based gateway routing +

+
+ + {!merchantId && ( +
+ Set a Merchant ID in the top bar to load and save configuration. +
+ )} + + {/* Status Card */} + {merchantId && !isLoading && ( + + +
+

Configuration Status

+

+ {existing?.config?.data + ? 'Success Rate routing is configured and active' + : 'No Success Rate configuration found'} +

+
+ + {existing?.config?.data ? 'Active' : 'Not Configured'} + +
+ {existing?.config?.data && ( + +
+
+ Last Modified: + + {existing.modified_at + ? new Date(existing.modified_at).toLocaleString() + : 'Unknown'} + +
+ +
+ {deleteError && ( +

{deleteError}

+ )} +
+ )} +
+ )} + + {isLoading ? ( +
+ ) : ( +
+ + +

Success Rate Config

+
+ + + + + + + + + + + + + + {/* Default row */} + + + + + + + + + + {fields.map((field, idx) => { + const methodType = watchedRows?.[idx]?.paymentMethodType || '' + const methodOptions = PAYMENT_METHODS[methodType] || [] + return ( + + + + + + + + + ) + })} + +
Payment Method TypePayment MethodBucket SizeSuccess RateHedging %Latency Threshold (ms) +
Default + + {errors.defaultBucketSize && ( +

{errors.defaultBucketSize.message}

+ )} +
+ + + + + + +
+ + + + + + + + + + + +
+
+ +
+
+
+ + + {saveSuccess && ( +
+ Configuration saved successfully. +
+ )} + + {/* View Current Configuration Section */} + {existing?.config?.data && ( + + +

Current Active Configuration

+ +
+ {showCurrentConfig && ( + +
+ {/* Default Config */} +
+

Default Settings

+
+
+ Bucket Size: +

{existing.config.data.defaultBucketSize}

+
+
+ Success Rate: +

{existing.config.data.defaultSuccessRate ?? 'Not set'}

+
+
+ Hedging %: +

{existing.config.data.defaultHedgingPercent ?? 'Not set'}

+
+
+ Latency Threshold: +

{existing.config.data.defaultLatencyThreshold ?? 'Not set'} ms

+
+
+
+ + {/* Sub-level Configs */} + {existing.config.data.subLevelInputConfig && existing.config.data.subLevelInputConfig.length > 0 && ( +
+

Sub-Level Configurations

+
+ {existing.config.data.subLevelInputConfig.map((config, idx) => ( +
+
+
+ Payment Type: +

{config.paymentMethodType}

+
+
+ Payment Method: +

{config.paymentMethod}

+
+
+ Bucket Size: +

{config.bucketSize}

+
+
+ Hedging %: +

{config.hedgingPercent ?? 'Default'}

+
+
+ Latency Threshold: +

{config.latencyThreshold ?? 'Default'} ms

+
+
+
+ ))} +
+
+ )} + + {/* Raw JSON */} +
+

Raw Configuration (JSON)

+
+                        {JSON.stringify(existing.config, null, 2)}
+                      
+
+
+
+ )} +
+ )} + + + + )} +
+ ) +} diff --git a/website/src/components/pages/VolumeSplitPage.tsx b/website/src/components/pages/VolumeSplitPage.tsx new file mode 100644 index 00000000..97cbaeae --- /dev/null +++ b/website/src/components/pages/VolumeSplitPage.tsx @@ -0,0 +1,335 @@ +import { useState } from 'react' +import useSWR from 'swr' +import { PieChart, Pie, Cell, Tooltip, Legend, ResponsiveContainer } from 'recharts' +import { Card, CardBody, CardHeader } from '../ui/Card' +import { Button } from '../ui/Button' +import { Badge } from '../ui/Badge' +import { ErrorMessage } from '../ui/ErrorMessage' +import { Spinner } from '../ui/Spinner' +import { useMerchantStore } from '../../store/merchantStore' +import { apiPost } from '../../lib/api' +import { RoutingAlgorithm } from '../../types/api' +import { Plus, Trash2, Eye } from 'lucide-react' + +const COLORS = ['#0069ED', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6', '#ec4899'] + +interface GatewayEntry { id: string; name: string; split: number } + +function makeId() { return Math.random().toString(36).slice(2) } + +export function VolumeSplitPage() { + const { merchantId } = useMerchantStore() + + const { data: active, mutate } = useSWR( + merchantId ? ['active-routing', merchantId] : null, + () => apiPost(`/routing/list/active/${merchantId}`) + ) + + const activeVol = active?.find(r => (r.algorithm_data || r.algorithm)?.type === 'volume_split') + + const [gateways, setGateways] = useState([ + { id: makeId(), name: '', split: 50 }, + { id: makeId(), name: '', split: 50 }, + ]) + const [ruleName, setRuleName] = useState('') + const [saving, setSaving] = useState(false) + const [error, setError] = useState(null) + const [success, setSuccess] = useState(null) + const [showCurrentConfig, setShowCurrentConfig] = useState(false) + const [expandedRuleIds, setExpandedRuleIds] = useState>(new Set()) + + const total = gateways.reduce((s, g) => s + g.split, 0) + + function updateGateway(id: string, field: 'name' | 'split', val: string | number) { + setGateways(gs => gs.map(g => g.id === id ? { ...g, [field]: val } : g)) + } + + function addGateway() { + setGateways(gs => [...gs, { id: makeId(), name: '', split: 0 }]) + } + + function removeGateway(id: string) { + setGateways(gs => gs.filter(g => g.id !== id)) + } + + async function handleCreate() { + if (!merchantId) return setError('Set a merchant ID first') + if (!ruleName.trim()) return setError('Enter a rule name') + if (total !== 100) return setError(`Splits must sum to 100 (currently ${total})`) + if (gateways.some(g => !g.name.trim())) return setError('All gateways must have names') + + setSaving(true); setError(null); setSuccess(null) + try { + await apiPost('/routing/create', { + rule_id: null, + name: ruleName, + description: '', + created_by: merchantId, + algorithm_for: 'payment', + metadata: null, + algorithm: { + type: 'volume_split', + data: gateways.map(g => ({ + split: g.split, + output: { gateway_name: g.name.trim(), gateway_id: null }, + })), + }, + }) + setSuccess(`Rule "${ruleName}" created successfully. Find it in the list below to activate.`) + mutate() + setRuleName('') + setGateways([ + { id: makeId(), name: '', split: 50 }, + { id: makeId(), name: '', split: 50 }, + ]) + } catch (e: unknown) { + setError(e instanceof Error ? e.message : 'Failed to create rule') + } finally { + setSaving(false) + } + } + + async function handleActivate(ruleId: string) { + if (!merchantId) return + try { + await apiPost('/routing/activate', { created_by: merchantId, routing_algorithm_id: ruleId }) + mutate() + setSuccess('Rule activated.') + } catch (e: unknown) { + setError(e instanceof Error ? e.message : 'Failed to activate') + } + } + + function toggleRuleExpand(id: string) { + setExpandedRuleIds(prev => { + const newSet = new Set(prev) + if (newSet.has(id)) { + newSet.delete(id) + } else { + newSet.add(id) + } + return newSet + }) + } + + // Build pie data from active rule + const algo = activeVol ? (activeVol.algorithm_data || activeVol.algorithm) : null + const pieData = algo && 'data' in algo + ? (algo.data as { split: number; output: { gateway_name: string; gateway_id: string | null } }[]).map(item => ({ + name: item.output?.gateway_name ?? '?', + value: item.split, + })) + : [] + + return ( +
+
+

Volume Split Routing

+

Distribute payment traffic across gateways by percentage.

+
+ + {/* Active Configuration */} + {activeVol && ( + + +
+

Active Volume Split

+

{activeVol.name}

+
+
+ Active + +
+
+ {showCurrentConfig && ( + + + + `${name}: ${value}%`} labelLine={{ stroke: '#45454f' }}> + {pieData.map((_, i) => ( + + ))} + + `${v}%`} contentStyle={{ backgroundColor: '#0d0d12', border: '1px solid #1c1c24', borderRadius: '8px', color: '#e8e8f4' }} /> + + + +
+

Rule ID: {activeVol.id}

+

Created: {activeVol.created_at ? new Date(activeVol.created_at).toLocaleString() : 'Unknown'}

+
+
+ )} +
+ )} + + {/* Create Rule */} + + +

Create Volume Split Rule

+
+ +
+ + setRuleName(e.target.value)} + placeholder="e.g. ab-test-split" + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
+ +
+
+ Gateway Name + Split % + +
+ {gateways.map(g => ( +
+ updateGateway(g.id, 'name', e.target.value)} + placeholder="e.g. stripe" + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + updateGateway(g.id, 'split', Number(e.target.value))} + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + +
+ ))} +
+ + + Total: {total}%{total !== 100 && ' (must be 100)'} + +
+
+ + + {success &&

{success}

} + + +
+
+ + +
+ ) +} + +function ActiveRulesList({ + merchantId, + onActivate, + expandedRuleIds, + onToggleExpand +}: { + merchantId: string; + onActivate: (id: string) => void; + expandedRuleIds: Set; + onToggleExpand: (id: string) => void; +}) { + const { data: rules, isLoading } = useSWR( + merchantId ? ['routing-list', merchantId] : null, + () => apiPost(`/routing/list/${merchantId}`) + ) + + const volRules = rules?.filter(r => (r.algorithm_data || r.algorithm)?.type === 'volume_split') ?? [] + + if (!merchantId) return null + if (isLoading) return
+ if (!volRules.length) return null + + return ( + +

Saved Volume Split Rules

+ + + + + + + + + + {volRules.map(r => { + const algorithm = r.algorithm_data || r.algorithm + const items = algorithm?.data as { split: number; output: { gateway_name: string; gateway_id: string | null } }[] || [] + const isExpanded = expandedRuleIds.has(r.id) + return ( + <> + + + + + + {isExpanded && ( + + + + )} + + ) + })} + +
NameSplit +
{r.name} + {items.map(i => `${i.output?.gateway_name}:${i.split}%`).join(' | ')} + +
+ + +
+
+
+

ID: {r.id}

+

Description: {r.description || 'N/A'}

+ {r.created_at && ( +

Created: {new Date(r.created_at).toLocaleString()}

+ )} +
+ Configuration: +
+                              {JSON.stringify(algorithm, null, 2)}
+                            
+
+
+
+
+
+ ) +} \ No newline at end of file diff --git a/website/src/components/ui/Badge.tsx b/website/src/components/ui/Badge.tsx new file mode 100644 index 00000000..f4982552 --- /dev/null +++ b/website/src/components/ui/Badge.tsx @@ -0,0 +1,23 @@ +interface BadgeProps { + variant?: 'green' | 'gray' | 'blue' | 'red' | 'orange' | 'purple' + children: React.ReactNode +} + +const variantClasses: Record = { + green: 'bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20', + gray: 'bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8', + blue: 'bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20', + red: 'bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20', + orange: 'bg-orange-500/10 text-orange-400 ring-1 ring-inset ring-orange-500/20', + purple: 'bg-purple-500/10 text-purple-400 ring-1 ring-inset ring-purple-500/20', +} + +export function Badge({ variant = 'gray', children }: BadgeProps) { + return ( + + {children} + + ) +} diff --git a/website/src/components/ui/Button.tsx b/website/src/components/ui/Button.tsx new file mode 100644 index 00000000..1c104f06 --- /dev/null +++ b/website/src/components/ui/Button.tsx @@ -0,0 +1,38 @@ +import { ButtonHTMLAttributes } from 'react' + +interface ButtonProps extends ButtonHTMLAttributes { + variant?: 'primary' | 'secondary' | 'ghost' | 'danger' + size?: 'sm' | 'md' +} + +const variantClasses = { + primary: + 'bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200', + secondary: + 'bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white', + ghost: + 'text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]', + danger: + 'bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]', +} + +const sizeClasses = { + sm: 'px-4 py-1.5 text-xs font-semibold', + md: 'px-5 py-2.5 text-sm font-semibold', +} + +export function Button({ + variant = 'primary', + size = 'md', + className = '', + ...props +}: ButtonProps) { + return ( + + ) +} diff --git a/website/src/components/ui/Card.tsx b/website/src/components/ui/Card.tsx new file mode 100644 index 00000000..dc370e58 --- /dev/null +++ b/website/src/components/ui/Card.tsx @@ -0,0 +1,32 @@ +import { ReactNode } from 'react' + +interface CardProps { + children: ReactNode + className?: string + onClick?: () => void +} + +export function Card({ children, className = '', onClick }: CardProps) { + return ( +
+ {children} +
+ ) +} + +export function CardHeader({ children, className = '' }: CardProps) { + return ( +
+ {children} +
+ ) +} + +export function CardBody({ children, className = '' }: CardProps) { + return
{children}
+} diff --git a/website/src/components/ui/ErrorMessage.tsx b/website/src/components/ui/ErrorMessage.tsx new file mode 100644 index 00000000..bacbe8f8 --- /dev/null +++ b/website/src/components/ui/ErrorMessage.tsx @@ -0,0 +1,12 @@ +interface ErrorMessageProps { + error: string | null +} + +export function ErrorMessage({ error }: ErrorMessageProps) { + if (!error) return null + return ( +
+ {error} +
+ ) +} diff --git a/website/src/components/ui/Spinner.tsx b/website/src/components/ui/Spinner.tsx new file mode 100644 index 00000000..cc4e8c38 --- /dev/null +++ b/website/src/components/ui/Spinner.tsx @@ -0,0 +1,25 @@ +export function Spinner({ size = 20 }: { size?: number }) { + return ( + + + + + ) +} diff --git a/website/src/hooks/useDynamicRoutingConfig.ts b/website/src/hooks/useDynamicRoutingConfig.ts new file mode 100644 index 00000000..1b05082c --- /dev/null +++ b/website/src/hooks/useDynamicRoutingConfig.ts @@ -0,0 +1,131 @@ +import useSWR from 'swr' +import { fetcher } from '../lib/api' + +export interface KeyConfig { + data_type: 'Enum' | 'Integer' | 'Udf' | 'StrValue' | 'GlobalRef' + values?: string + min_value?: number + max_value?: number + min_length?: number + max_length?: number + exact_length?: number + regex?: string +} + +export interface RoutingConfig { + keys: { + keys: Record + } +} + +export interface ParsedRoutingKey { + key: string + type: 'enum' | 'integer' | 'udf' | 'str_value' | 'global_ref' + values?: string[] + min_value?: number + max_value?: number + min_length?: number + max_length?: number + exact_length?: number + regex?: string +} + +export type RoutingKeyType = 'enum' | 'integer' | 'udf' | 'str_value' | 'global_ref' + +export interface RoutingKeyConfig { + type: RoutingKeyType + values: string[] +} + +function parseRoutingConfig(config: RoutingConfig | null): ParsedRoutingKey[] { + if (!config || !config.keys || !config.keys.keys) { + return [] + } + + return Object.entries(config.keys.keys).map(([key, keyConfig]) => { + const parsed: ParsedRoutingKey = { + key, + type: keyConfig.data_type.toLowerCase() as ParsedRoutingKey['type'], + } + + if (keyConfig.values) { + parsed.values = keyConfig.values.split(',').map(v => v.trim()) + } + + if (keyConfig.min_value !== undefined) { + parsed.min_value = keyConfig.min_value + } + + if (keyConfig.max_value !== undefined) { + parsed.max_value = keyConfig.max_value + } + + if (keyConfig.min_length !== undefined) { + parsed.min_length = keyConfig.min_length + } + + if (keyConfig.max_length !== undefined) { + parsed.max_length = keyConfig.max_length + } + + if (keyConfig.exact_length !== undefined) { + parsed.exact_length = keyConfig.exact_length + } + + if (keyConfig.regex) { + parsed.regex = keyConfig.regex + } + + return parsed + }) +} + +export function useDynamicRoutingConfig() { + const { data, error, isLoading } = useSWR( + '/config/routing-keys', + fetcher, + { + refreshInterval: 0, + revalidateOnFocus: false, + } + ) + + const parsedKeys = parseRoutingConfig(data || null) + + // Build a lookup map for easy access + const keysByName = parsedKeys.reduce((acc, key) => { + acc[key.key] = key + return acc + }, {} as Record) + + // Convert to the format expected by components (matching old ROUTING_KEYS structure) + const routingKeysConfig: Record = {} + + parsedKeys.forEach((key) => { + routingKeysConfig[key.key] = { + type: key.type, + values: key.values || [], + } + }) + + return { + config: data, + keys: parsedKeys, + keysByName, + routingKeysConfig, + isLoading, + error, + // Helper to get values for a specific key + getKeyValues: (keyName: string): string[] => { + return keysByName[keyName]?.values || [] + }, + // Check if key is integer type + isIntegerKey: (keyName: string): boolean => { + return keysByName[keyName]?.type === 'integer' + }, + // Check if key is enum type + isEnumKey: (keyName: string): boolean => { + return keysByName[keyName]?.type === 'enum' + }, + } +} diff --git a/website/src/index.css b/website/src/index.css new file mode 100644 index 00000000..aa04d812 --- /dev/null +++ b/website/src/index.css @@ -0,0 +1,174 @@ +@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'); + +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + + html { + color-scheme: light; + } + + html.dark { + color-scheme: dark; + } + + html, + body { + font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + @apply bg-[#f8fafc] text-slate-800 dark:bg-[#000000] dark:text-[#f4f4f5] transition-colors duration-300; + } + + /* Fallback text colors for robust contrast when not overridden */ + p, + span, + h1, + h2, + h3, + h4, + h5, + h6 { + @apply text-slate-800 dark:text-slate-200 transition-colors duration-300; + } + + p.text-slate-500, + span.text-slate-500, + div.text-slate-500 { + @apply dark:text-slate-400; + } + + p.text-slate-600, + span.text-slate-600, + div.text-slate-600 { + @apply dark:text-slate-300; + } + + /* Automatic inversion for tailwind colors in dark mode */ + .dark .text-slate-900, + .dark .text-slate-800 { + color: #f1f5f9 !important; + } + + .dark .text-slate-700 { + color: #e2e8f0 !important; + } + + .dark .text-slate-600 { + color: #cbd5e1 !important; + } + + .dark .text-slate-500 { + color: #94a3b8 !important; + } + + .dark .text-slate-400 { + color: #64748b !important; + } + + .dark .text-blue-800, + .dark .text-blue-700 { + color: #93c5fd !important; + } + + .dark .text-blue-600 { + color: #60a5fa !important; + } + + .dark .text-brand-500 { + color: #818cf8 !important; + } + + .dark .bg-slate-50 { + @apply bg-[#1a1a1d] !important; + } + + .dark .bg-slate-100 { + @apply bg-[#222226] !important; + } + + /* Scrollbar */ + ::-webkit-scrollbar { + width: 5px; + height: 5px; + } + + ::-webkit-scrollbar-track { + background: transparent; + } + + ::-webkit-scrollbar-thumb { + @apply bg-slate-300 dark:bg-[#222222] rounded-full hover:bg-slate-400 dark:hover:bg-[#333333] transition-colors; + } + + /* Form elements — Dynamic override */ + :where(input:not([type='checkbox']):not([type='radio']):not([type='range'])), + :where(select), + :where(textarea) { + @apply bg-white dark:bg-[#0f0f11] border-slate-200 dark:border-transparent text-slate-800 dark:text-white rounded-full px-4 placeholder-slate-400 dark:placeholder-[#66666e] transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/20 dark:focus:bg-[#151518] dark:focus:border-[#333338]; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important; + font-family: 'Outfit', sans-serif; + } + + .dark input:not([type='checkbox']):not([type='radio']):not([type='range']), + .dark select, + .dark textarea { + box-shadow: none !important; + } + + select option { + @apply bg-white dark:bg-[#0f0f11] text-slate-800 dark:text-white; + } + + /* Range input */ + input[type='range'] { + @apply accent-brand-500 dark:accent-white; + } + + /* Radio/checkbox */ + input[type='radio'], + input[type='checkbox'] { + @apply w-4 h-4 bg-white dark:bg-[#0f0f11] border-slate-300 dark:border-[#222226] accent-brand-500 dark:accent-white transition-all duration-200; + } + + input[type='radio'] { + border-radius: 50%; + } + + input[type='checkbox'] { + border-radius: 4px; + } + + input[type='radio']:checked, + input[type='checkbox']:checked { + @apply bg-brand-500 dark:bg-white border-brand-500 dark:border-white; + } +} + +/* Floating panel utility class */ +.glass-panel { + @apply bg-white dark:bg-[#0c0c0e] border border-slate-200 dark:border-[#1a1a1d] shadow-lg dark:shadow-2xl rounded-2xl relative overflow-hidden transition-all duration-300; +} + +.glass-panel-hover:hover { + @apply bg-slate-50 dark:bg-[#111114] border-slate-300 dark:border-[#222226]; +} + +/* Brand Gradient Text Utility */ +.text-gradient { + @apply bg-clip-text text-transparent bg-gradient-to-r from-brand-600 to-purple-500 dark:from-[#9b51e0] dark:via-[#4f46e5] dark:to-[#0ea5e9]; +} + +/* Aurora top edge */ +.aurora-top { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 3px; + background: linear-gradient(90deg, #9b51e0, #4f46e5, #0ea5e9, transparent); + opacity: 0.8; + z-index: 100; +} \ No newline at end of file diff --git a/website/src/lib/api.ts b/website/src/lib/api.ts new file mode 100644 index 00000000..9f3c4c21 --- /dev/null +++ b/website/src/lib/api.ts @@ -0,0 +1,96 @@ +// All API calls use relative URLs so nginx/vite-proxy can handle routing + +const DEBUG_API = true + +function logRequest(method: string, path: string, body?: unknown) { + if (!DEBUG_API) return + console.log('\n' + '='.repeat(80)) + console.log(`[API REQUEST] ${new Date().toISOString()}`) + console.log(`Method: ${method}`) + console.log(`Path: ${path}`) + if (body !== undefined) { + console.log('Body:', JSON.stringify(body, null, 2)) + } + console.log('='.repeat(80)) +} + +function logResponse(path: string, status: number, statusText: string, body: string) { + if (!DEBUG_API) return + console.log('\n' + '-'.repeat(80)) + console.log(`[API RESPONSE] ${new Date().toISOString()}`) + console.log(`Path: ${path}`) + console.log(`Status: ${status} ${statusText}`) + console.log('Response Body:', body) + console.log('-'.repeat(80) + '\n') +} + +function logError(path: string, error: unknown) { + if (!DEBUG_API) return + console.log('\n' + '!'.repeat(80)) + console.log(`[API ERROR] ${new Date().toISOString()}`) + console.log(`Path: ${path}`) + if (error instanceof Error) { + console.log('Error:', error.message) + console.log('Stack:', error.stack) + } else { + console.log('Error:', error) + } + console.log('!'.repeat(80) + '\n') +} + +export async function apiFetch( + path: string, + options?: RequestInit +): Promise { + const method = options?.method || 'GET' + const body = options?.body ? JSON.parse(options.body as string) : undefined + + logRequest(method, path, body) + + try { + const res = await fetch(path, { + headers: { 'Content-Type': 'application/json', ...options?.headers }, + ...options, + }) + + const responseText = await res.text() + let responseBody: string + + try { + const json = JSON.parse(responseText) + responseBody = JSON.stringify(json, null, 2) + } catch { + responseBody = responseText + } + + logResponse(path, res.status, res.statusText, responseBody) + + if (!res.ok) { + const error = new Error(`API error ${res.status}: ${responseText}`) + logError(path, error) + throw error + } + + // Handle empty response body + if (!responseText.trim()) { + return undefined as T + } + + return JSON.parse(responseText) as T + } catch (error) { + logError(path, error) + throw error + } +} + +export async function apiPost(path: string, body?: unknown): Promise { + return apiFetch(path, { + method: 'POST', + body: body !== undefined ? JSON.stringify(body) : undefined, + }) +} + +// Generic fetcher for SWR +export async function fetcher(url: string): Promise { + return apiFetch(url) +} diff --git a/website/src/lib/constants.ts b/website/src/lib/constants.ts new file mode 100644 index 00000000..85ec4964 --- /dev/null +++ b/website/src/lib/constants.ts @@ -0,0 +1,95 @@ +// Static routing keys configuration - fallback when API is unavailable +// These should match the values in the backend config +export type RoutingKeyType = 'enum' | 'integer' | 'udf' | 'str_value' | 'global_ref' + +export interface StaticRoutingKeyConfig { + type: RoutingKeyType + values: string[] +} + +export const STATIC_ROUTING_KEYS: Record = { + payment_method: { + type: 'enum', + values: ['card', 'bank_debit', 'bank_transfer'], + }, + amount: { type: 'integer', values: [] }, + currency: { + type: 'enum', + values: ['USD', 'EUR', 'GBP', 'INR', 'JPY', 'CAD', 'AUD', 'SGD', 'AED'], + }, + payment_type: { + type: 'enum', + values: ['normal', 'new_mandate', 'setup_mandate', 'recurring_mandate', 'non_mandate'], + }, + card_network: { + type: 'enum', + values: ['visa', 'mastercard', 'amex', 'jcb', 'diners_club', 'discover', 'cartes_bancaires', 'union_pay', 'interac', 'rupay', 'maestro'], + }, + authentication_type: { + type: 'enum', + values: ['three_ds', 'no_three_ds'], + }, + card_type: { + type: 'enum', + values: ['debit', 'credit'], + }, + card: { + type: 'enum', + values: ['debit', 'credit'], + }, +} + +export type RoutingKey = keyof typeof STATIC_ROUTING_KEYS + +export const ROUTING_APPROACH_COLORS: Record = { + SR_SELECTION_V3_ROUTING: 'bg-blue-100 text-blue-800', + PRIORITY_LOGIC: 'bg-purple-100 text-purple-800', + NTW_BASED_ROUTING: 'bg-green-100 text-green-800', + SR_SELECTION_V3_ROUTING_WITH_HEDGING: 'bg-orange-100 text-orange-800', + HEDGING: 'bg-orange-100 text-orange-800', +} + +export const SR_DIMENSION_OPTIONS = [ + { key: 'currency', label: 'Currency' }, + { key: 'country', label: 'Country' }, + { key: 'auth_type', label: 'Auth Type' }, + { key: 'card_is_in', label: 'Card Is In' }, + { key: 'card_network', label: 'Card Network' }, +] + +// Full payment method types for reference (backend validates against config) +export const PAYMENT_METHOD_TYPES = [ + 'card', + 'card_redirect', + 'pay_later', + 'wallet', + 'bank_redirect', + 'bank_transfer', + 'crypto', + 'bank_debit', + 'reward', + 'real_time_payment', + 'upi', + 'voucher', + 'gift_card', + 'open_banking', + 'mobile_payment', +] + +export const PAYMENT_METHODS: Record = { + card: ['credit', 'debit'], + bank_debit: ['ach', 'sepa', 'bacs', 'becs'], + bank_transfer: ['ach', 'sepa', 'sepa_bank_transfer', 'bacs', 'multibanco', 'pix', 'pse', 'permata_bank_transfer', 'bca_bank_transfer', 'bni_va', 'bri_va', 'cimb_va', 'danamon_va', 'mandiri_va', 'local_bank_transfer', 'instant_bank_transfer'], + wallet: ['amazon_pay', 'apple_pay', 'google_pay', 'paypal', 'ali_pay', 'ali_pay_hk', 'dana', 'mb_way', 'mobile_pay', 'samsung_pay', 'twint', 'vipps', 'touch_n_go', 'swish', 'we_chat_pay', 'go_pay', 'gcash', 'momo', 'kakao_pay', 'cashapp', 'mifinity', 'paze'], + pay_later: ['affirm', 'alma', 'afterpay_clearpay', 'klarna', 'pay_bright', 'atome', 'walley'], + upi: ['upi_collect', 'upi_intent'], + voucher: ['boleto', 'efecty', 'pago_efectivo', 'red_compra', 'red_pagos', 'indomaret', 'alfamart', 'oxxo', 'seven_eleven', 'lawson', 'mini_stop', 'family_mart', 'seicomart', 'pay_easy'], + bank_redirect: ['giropay', 'ideal', 'sofort', 'eft', 'eps', 'bancontact_card', 'blik', 'local_bank_redirect', 'online_banking_thailand', 'online_banking_czech_republic', 'online_banking_finland', 'online_banking_fpx', 'online_banking_poland', 'online_banking_slovakia', 'przelewy24', 'trustly', 'bizum', 'interac', 'open_banking_uk', 'open_banking_pis'], + gift_card: ['givex', 'pay_safe_card'], + card_redirect: ['knet', 'benefit', 'momo_atm', 'card_redirect'], + real_time_payment: ['fps', 'duit_now', 'prompt_pay', 'viet_qr'], + crypto: ['crypto_currency'], + reward: ['evoucher', 'classic_reward'], + open_banking: ['open_banking_pis'], + mobile_payment: ['direct_carrier_billing'], +} diff --git a/website/src/main.tsx b/website/src/main.tsx new file mode 100644 index 00000000..ade12f1d --- /dev/null +++ b/website/src/main.tsx @@ -0,0 +1,46 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import { BrowserRouter } from 'react-router-dom' +import App from './App' +import { ErrorBoundary } from './ErrorBoundary' +import './index.css' + +console.log('\n' + '='.repeat(80)) +console.log('[APP STARTUP] Dashboard initializing...') +console.log(`Timestamp: ${new Date().toISOString()}`) +console.log(`Environment: ${(import.meta as any).env?.MODE ?? 'production'}`) +console.log(`Base URL: /dashboard`) +console.log('='.repeat(80) + '\n') + +window.onerror = (message, source, lineno, colno, error) => { + console.log('\n' + '!'.repeat(80)) + console.log('[WINDOW ERROR]') + console.log('Message:', message) + console.log('Source:', source) + console.log('Line:', lineno, 'Column:', colno) + if (error) { + console.log('Error:', error.message) + console.log('Stack:', error.stack) + } + console.log('!'.repeat(80) + '\n') +} + +window.onunhandledrejection = (event) => { + console.log('\n' + '!'.repeat(80)) + console.log('[UNHANDLED PROMISE REJECTION]') + console.log('Reason:', event.reason) + if (event.reason instanceof Error) { + console.log('Stack:', event.reason.stack) + } + console.log('!'.repeat(80) + '\n') +} + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + + + + + +) diff --git a/website/src/store/merchantStore.ts b/website/src/store/merchantStore.ts new file mode 100644 index 00000000..31ff261a --- /dev/null +++ b/website/src/store/merchantStore.ts @@ -0,0 +1,24 @@ +import { create } from 'zustand' +import { persist } from 'zustand/middleware' + +interface MerchantStore { + merchantId: string + setMerchantId: (id: string) => void +} + +const DEBUG_STORE = true + +export const useMerchantStore = create()( + persist( + (set) => ({ + merchantId: '', + setMerchantId: (id) => { + if (DEBUG_STORE) { + console.log(`\n[STORE] Merchant ID changed: "${id}"`) + } + set({ merchantId: id }) + }, + }), + { name: 'merchant-store' } + ) +) diff --git a/website/src/types/api.ts b/website/src/types/api.ts new file mode 100644 index 00000000..0205f9ed --- /dev/null +++ b/website/src/types/api.ts @@ -0,0 +1,145 @@ +// All types use snake_case to match Rust backend responses + +export interface DecideGatewayResponse { + decided_gateway: string + routing_approach: string + gateway_priority_map: Record + routing_dimension: string + routing_dimension_level: string + filter_wise_gateways: Record | null + reset_approach: string + is_scheduled_outage: boolean + latency: number +} + +export interface GatewayConnector { + gateway_name: string + gateway_id: string | null +} + +export interface VolumeSplitItem { + split: number + output: GatewayConnector +} + +export type RoutingAlgorithmData = + | GatewayConnector[] // priority + | VolumeSplitItem[] // volume_split + | GatewayConnector // single + | EuclidAlgorithmData // advanced + +export interface EuclidRule { + name: string + connectorSelection: EuclidOutput + statements: EuclidStatement[] +} + +export interface EuclidStatement { + condition: EuclidCondition[] +} + +export interface EuclidCondition { + lhs: string + comparison: string + value: { type: string; value: string | number } + metadata: Record +} + +export interface EuclidOutput { + type: 'priority' | 'volume_split' + data: GatewayConnector[] | VolumeSplitItem[] +} + +export interface EuclidAlgorithmData { + globals: Record + defaultSelection: EuclidOutput + rules: EuclidRule[] +} + +export interface RoutingAlgorithm { + id: string + name: string + description: string + created_by: string + algorithm_for: string + created_at?: string + modified_at?: string + // Backend returns algorithm_data, not algorithm + algorithm_data?: { + type: 'priority' | 'volume_split' | 'single' | 'advanced' + data: RoutingAlgorithmData + } + // For convenience, map algorithm_data to algorithm in the component + algorithm?: { + type: 'priority' | 'volume_split' | 'single' | 'advanced' + data: RoutingAlgorithmData + } +} + +export interface CreateRoutingRequest { + name: string + description: string + created_by: string + algorithm_for: string + algorithm: { + type: string + data: RoutingAlgorithmData + } +} + +export interface ActivateRoutingRequest { + created_by: string + routing_algorithm_id: string +} + +export interface SRConfigData { + defaultBucketSize: number + defaultLatencyThreshold: number | null + defaultHedgingPercent: number | null + defaultLowerResetFactor: number | null + defaultUpperResetFactor: number | null + defaultGatewayExtraScore: number | null + subLevelInputConfig: SubLevelConfig[] | null +} + +export interface SubLevelConfig { + paymentMethodType: string + paymentMethod: string + bucketSize: number + hedgingPercent: number | null + latencyThreshold: number | null +} + +export interface EliminationData { + threshold: number + txnLatency: { + gatewayLatency: number + } +} + +export interface RuleConfig { + type: 'successRate' | 'elimination' | 'debitRouting' + data?: SRConfigData | EliminationData | DebitRoutingData +} + +export interface CreateRuleRequest { + merchant_id: string + config: RuleConfig +} + +export interface DebitRoutingData { + merchant_category_code: string + acquirer_country: string +} + +export interface CreateMerchantRequest { + merchant_id: string + gateway_success_rate_based_decider_input: null +} + +export interface SRDimensionRequest { + merchant_id: string + paymentInfo: { + fields: string[] + } +} diff --git a/website/tailwind.config.ts b/website/tailwind.config.ts new file mode 100644 index 00000000..a298f58b --- /dev/null +++ b/website/tailwind.config.ts @@ -0,0 +1,32 @@ +import type { Config } from 'tailwindcss' + +export default { + content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], + darkMode: 'class', + theme: { + extend: { + colors: { + brand: { + DEFAULT: '#4f46e5', + 50: '#eef2ff', + 100: '#e0e7ff', + 500: '#6366f1', + 600: '#4f46e5', + 700: '#4338ca', + }, + }, + fontFamily: { + sans: ['Outfit', 'Inter', 'system-ui', '-apple-system', 'sans-serif'], + mono: ['JetBrains Mono', 'Menlo', 'Monaco', 'monospace'], + }, + letterSpacing: { + tightest: '-0.03em', + }, + boxShadow: { + 'glass-light': '0 10px 40px -10px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.05)', + 'glass-dark': '0 20px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05), inset 0 0 0 1px rgba(255,255,255,0.02)', + }, + }, + }, + plugins: [], +} satisfies Config diff --git a/website/tsconfig.json b/website/tsconfig.json new file mode 100644 index 00000000..3934b8f6 --- /dev/null +++ b/website/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/website/tsconfig.node.json b/website/tsconfig.node.json new file mode 100644 index 00000000..42872c59 --- /dev/null +++ b/website/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/website/vite.config.ts b/website/vite.config.ts new file mode 100644 index 00000000..b793bc90 --- /dev/null +++ b/website/vite.config.ts @@ -0,0 +1,143 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +export default defineConfig({ + plugins: [react()], + base: '/dashboard/', + server: { + proxy: { + '/decide-gateway': { + target: 'http://localhost:8080', + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (proxyReq, req) => { + console.log(`\n[PROXY] ${new Date().toISOString()}`) + console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`) + }) + proxy.on('proxyRes', (proxyRes, req) => { + console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`) + }) + proxy.on('error', (err, req) => { + console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`) + console.log(`Error forwarding ${req.url}:`, err.message) + }) + }, + }, + '/routing': { + target: 'http://localhost:8080', + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (proxyReq, req) => { + console.log(`\n[PROXY] ${new Date().toISOString()}`) + console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`) + }) + proxy.on('proxyRes', (proxyRes, req) => { + console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`) + }) + proxy.on('error', (err, req) => { + console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`) + console.log(`Error forwarding ${req.url}:`, err.message) + }) + }, + }, + '/rule': { + target: 'http://localhost:8080', + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (proxyReq, req) => { + console.log(`\n[PROXY] ${new Date().toISOString()}`) + console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`) + }) + proxy.on('proxyRes', (proxyRes, req) => { + console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`) + }) + proxy.on('error', (err, req) => { + console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`) + console.log(`Error forwarding ${req.url}:`, err.message) + }) + }, + }, + '/merchant-account': { + target: 'http://localhost:8080', + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (proxyReq, req) => { + console.log(`\n[PROXY] ${new Date().toISOString()}`) + console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`) + }) + proxy.on('proxyRes', (proxyRes, req) => { + console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`) + }) + proxy.on('error', (err, req) => { + console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`) + console.log(`Error forwarding ${req.url}:`, err.message) + }) + }, + }, + '/config-sr-dimension': { + target: 'http://localhost:8080', + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (proxyReq, req) => { + console.log(`\n[PROXY] ${new Date().toISOString()}`) + console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`) + }) + proxy.on('proxyRes', (proxyRes, req) => { + console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`) + }) + proxy.on('error', (err, req) => { + console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`) + console.log(`Error forwarding ${req.url}:`, err.message) + }) + }, + }, + '/health': { + target: 'http://localhost:8080', + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (proxyReq, req) => { + console.log(`\n[PROXY] ${new Date().toISOString()}`) + console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`) + }) + proxy.on('proxyRes', (proxyRes, req) => { + console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`) + }) + proxy.on('error', (err, req) => { + console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`) + console.log(`Error forwarding ${req.url}:`, err.message) + }) + }, + }, + '/update-gateway-score': { + target: 'http://localhost:8080', + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (proxyReq, req) => { + console.log(`\n[PROXY] ${new Date().toISOString()}`) + console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`) + }) + proxy.on('proxyRes', (proxyRes, req) => { + console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`) + }) + proxy.on('error', (err, req) => { + console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`) + console.log(`Error forwarding ${req.url}:`, err.message) + }) + }, + }, + }, + fs: { + strict: false, + }, + historyApiFallback: { + rewrites: [ + { from: /./, to: '/dashboard/index.html' } + ] + }, + host: true, + port: 5173, + }, + build: { + outDir: 'dist', + }, +}) \ No newline at end of file From 615a30decdc49117854058145fba905947beba2c Mon Sep 17 00:00:00 2001 From: Prajjwal kumar Date: Fri, 10 Apr 2026 16:40:50 +0530 Subject: [PATCH 77/95] fix clippy --- src/euclid/handlers/routing_rules.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index 53ef57b4..39c68f25 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -884,7 +884,7 @@ pub async fn get_routing_config( .config .routing_config .clone() - .ok_or_else(|| EuclidErrors::GlobalRoutingConfigsUnavailable)?; + .ok_or(EuclidErrors::GlobalRoutingConfigsUnavailable)?; metrics::API_REQUEST_COUNTER .with_label_values(&["get_routing_config", "success"]) From c0acddd158e57065258428b71a63ffde2e8797c4 Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Sat, 11 Apr 2026 21:23:39 +0530 Subject: [PATCH 78/95] refactor(docs): improve docs and docker setup (#230) --- Dockerfile.docs | 2 +- Makefile | 56 +- README.md | 9 +- config/development.toml | 72 +- config/docker-configuration.toml | 71 +- docker-compose.override.yml | 32 +- docker-compose.yaml | 182 +++-- docs/api-reference.md | 163 +--- docs/configuration.md | 165 +--- docs/dual-protocol-layer.md | 81 +- docs/installation.md | 171 +--- docs/introduction.mdx | 2 +- docs/local-setup.md | 383 ++++----- docs/setup-guide-mysql.md | 236 +----- docs/setup-guide-postgres.md | 212 +---- docs/setup-guide.md | 170 +--- helm-charts/README.md | 26 +- helm-charts/config/development.toml | 741 +----------------- nginx/nginx.conf | 2 +- website/dist/assets/index-BtfYF3zd.js | 328 ++++++++ website/dist/assets/index-CT0UhhRt.js | 328 -------- website/dist/assets/index-D41MAvos.css | 1 - website/dist/assets/index-_ClGteNY.css | 1 + website/dist/index.html | 4 +- .../components/pages/DecisionExplorerPage.tsx | 265 +++++-- .../src/components/pages/EuclidRulesPage.tsx | 118 ++- website/src/hooks/useDynamicRoutingConfig.ts | 47 +- website/src/lib/constants.ts | 18 +- 28 files changed, 1189 insertions(+), 2697 deletions(-) mode change 100644 => 120000 helm-charts/config/development.toml create mode 100644 website/dist/assets/index-BtfYF3zd.js delete mode 100644 website/dist/assets/index-CT0UhhRt.js delete mode 100644 website/dist/assets/index-D41MAvos.css create mode 100644 website/dist/assets/index-_ClGteNY.css diff --git a/Dockerfile.docs b/Dockerfile.docs index 3fd22d88..afaa64be 100644 --- a/Dockerfile.docs +++ b/Dockerfile.docs @@ -1,6 +1,6 @@ FROM node:20-alpine -ARG MINTLIFY_VERSION=4.0.0 +ARG MINTLIFY_VERSION=4.2.504 RUN npm install -g "mintlify@${MINTLIFY_VERSION}" WORKDIR /docs diff --git a/Makefile b/Makefile index eda82aa5..85ce99d4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ COMMIT_HASH := $(shell git rev-parse --short HEAD) TAG := ghcr.io/juspay/decision-engine:sha_$(COMMIT_HASH) +DECISION_ENGINE_TAG ?= v1.3.4 +GROOVY_RUNNER_TAG ?= v1.3.4 + docker-build: docker build --platform=linux/amd64 -t $(TAG) . @@ -10,35 +13,46 @@ docker-run: docker-it-run: docker run --platform=linux/amd64 -v `pwd`/config/docker-configuration.toml:/local/config/development.toml -it $(TAG) /bin/bash -init: - docker-compose run --rm db-migrator && docker-compose up open-router +init-mysql-ghcr: + DECISION_ENGINE_TAG=$(DECISION_ENGINE_TAG) GROOVY_RUNNER_TAG=$(GROOVY_RUNNER_TAG) docker compose --profile mysql-ghcr up -d -init-pg: - docker-compose run --rm db-migrator-postgres && docker-compose up open-router-pg - -run: - docker-compose up open-router +init-pg-ghcr: + DECISION_ENGINE_TAG=$(DECISION_ENGINE_TAG) GROOVY_RUNNER_TAG=$(GROOVY_RUNNER_TAG) docker compose --profile postgres-ghcr up -d -init-local: - docker-compose run --rm db-migrator && docker-compose up --build open-router-local +init-mysql-local: + docker compose --profile mysql-local up -d --build -init-local-pg: - docker-compose run --rm db-migrator-postgres && docker-compose up --build open-router-local-pg +init-pg-local: + docker compose --profile postgres-local up -d --build -init-local-pg-monitor: - docker-compose run --rm db-migrator-postgres && docker-compose up --build -d prometheus && docker-compose up --build -d grafana && docker-compose up --build open-router-local-pg +run-mysql-ghcr: + DECISION_ENGINE_TAG=$(DECISION_ENGINE_TAG) GROOVY_RUNNER_TAG=$(GROOVY_RUNNER_TAG) docker compose --profile mysql-ghcr up -d open-router-mysql-ghcr -init-pg-monitor: - docker-compose run --rm db-migrator-postgres && docker-compose up --build -d prometheus && docker-compose up --build -d grafana && docker-compose up --build open-router-pg +run-pg-ghcr: + DECISION_ENGINE_TAG=$(DECISION_ENGINE_TAG) GROOVY_RUNNER_TAG=$(GROOVY_RUNNER_TAG) docker compose --profile postgres-ghcr up -d open-router-pg-ghcr -init-pg-local: - docker-compose run --rm db-migrator-postgres && docker-compose --profile local up open-router-pg +run-mysql-local: + docker compose --profile mysql-local up -d --build open-router-mysql-local -run-local: - docker-compose up open-router-local +run-pg-local: + docker compose --profile postgres-local up -d --build open-router-pg-local + +init-pg-monitor: + DECISION_ENGINE_TAG=$(DECISION_ENGINE_TAG) GROOVY_RUNNER_TAG=$(GROOVY_RUNNER_TAG) docker compose --profile postgres-ghcr --profile monitoring up -d + +init-local-pg-monitor: + docker compose --profile postgres-local --profile monitoring up -d --build update-config: - docker-compose run --rm routing-config + docker compose --profile mysql-ghcr run --rm routing-config stop: - docker-compose down \ No newline at end of file + docker compose down + +# Backward-compatible aliases +init: init-mysql-ghcr +init-pg: init-pg-ghcr +run: run-mysql-ghcr +init-local: init-mysql-local +init-local-pg: init-pg-local +run-local: run-mysql-local diff --git a/README.md b/README.md index f003bcaf..725a9931 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Decision Engine is a **high-performance payment gateway router** built in Rust t # Clone and run git clone https://github.com/juspay/decision-engine.git cd decision-engine -docker compose up -d +docker compose --profile postgres-ghcr up -d # That's it! API ready at http://localhost:8080 ``` @@ -133,7 +133,7 @@ diesel migration run ```bash curl http://localhost:8080/health -# → {"status":"ok"} +# → {"message":"Health is good"} ``` --- @@ -142,8 +142,9 @@ curl http://localhost:8080/health | 📘 Resource | Description | |-------------|-------------| -| [MySQL Setup Guide](docs/setup-guide-mysql.md) | Step-by-step MySQL configuration | -| [PostgreSQL Setup Guide](docs/setup-guide-postgres.md) | Step-by-step PostgreSQL configuration | +| [Local Setup Guide](docs/local-setup.md) | Canonical guide for CLI, Docker, Compose profiles, and Helm | +| [MySQL Setup Guide](docs/setup-guide-mysql.md) | MySQL-specific walkthrough | +| [PostgreSQL Setup Guide](docs/setup-guide-postgres.md) | PostgreSQL-specific walkthrough | | [API Reference](docs/api-reference1.md) | Complete REST API documentation | | [Configuration Guide](docs/configuration.md) | All config options explained | | [Deep Dive Blog](https://juspay.io/blog/juspay-orchestrator-and-merchant-controlled-routing-engine) | How routing logic works | diff --git a/config/development.toml b/config/development.toml index 7b07a2d8..33dc5ce5 100644 --- a/config/development.toml +++ b/config/development.toml @@ -1,7 +1,7 @@ [log.console] enabled = true level = "DEBUG" -log_format = "json" +log_format = "default" [server] host = "127.0.0.1" @@ -60,60 +60,44 @@ zstd_compression_filepath = "/tmp/extra-paths/redis-zstd-dictionaries/sbx" public = { schema = "public" } [routing_config.keys] +amount = { type = "integer", min = 0 } +authentication_type = { type = "enum", values = "three_ds, no_three_ds" } +bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } +bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } +bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, multibanco, pix, pse, permata_bank_transfer, bca_bank_transfer, bni_va, bri_va, cimb_va, danamon_va, mandiri_va, local_bank_transfer, instant_bank_transfer" } billing_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } -issuer_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } business_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } business_label = { type = "str_value" } -metadata = { type = "udf" } -pay_later = { type = "enum", values = "affirm, alma, afterpay_clearpay, klarna, pay_bright, atome, walley" } -gift_card = { type = "enum", values = "givex, pay_safe_card" } -upi = { type = "enum", values = "upi_collect, upi_intent" } -wallet = { type = "enum", values = "amazon_pay, apple_pay, google_pay, paypal, ali_pay, ali_pay_hk, dana, mb_way, mobile_pay, samsung_pay, twint, vipps, touch_n_go, swish, we_chat_pay, go_pay, gcash, momo, kakao_pay, cashapp, mifinity, paze" } -voucher = { type = "enum", values = "boleto, efecty, pago_efectivo, red_compra, red_pagos, indomaret, alfamart, oxxo, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy" } -bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, multibanco, pix, pse, permata_bank_transfer, bca_bank_transfer, bni_va, bri_va, cimb_va, danamon_va, mandiri_va, local_bank_transfer, instant_bank_transfer" } -bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } -customer_device_display_size = { type = "enum", values = "size320x568, size375x667, size390x844, size414x896, size428x926, size768x1024, size834x1112, size834x1194, size1024x1366, size1280x720, size1366x768, size1440x900, size1920x1080, size2560x1440, size3840x2160, size500x600, size600x400, size360x640, size412x915, size800x1280" } -customer_device_type = { type = "enum", values = "mobile, tablet, desktop, gaming_console" } -customer_device_platform = { type = "enum", values = "web, android, ios" } -bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } -crypto = { type = "enum", values = "crypto_currency" } -reward = { type = "enum", values = "evoucher, classic_reward" } +capture_method = { type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic" } +card = { type = "enum", values = "debit, credit" } +card_bin = { type = "str_value", exact_length = 6, regex = "^[0-9]{6}$" } +card_discovery = { type = "enum", values = "manual, saved_card, click_to_pay" } +card_network = { type = "enum", values = "visa, VISA, Visa, visaCard, mastercard, MASTERCARD, MasterCard, masterCard, mastercardCard, master_card, Master_card, Master_Card, Master Card, Mastercard, american_express, AMERICANEXPRESS, AmericanExpress, americanExpress, americanExpressCard, amex, AMEX, Amex, jcb, JCB, Jcb, diners_club, DINERSCLUB, DinersClub, dinersClub, dinersClubCard, discover, DISCOVER, Discover, discoverCard, cartes_bancaires, CARTESBANCAIRES, CartesBancaires, cartesBancaires, union_pay, UNIONPAY, UnionPay, unionPay, interac, INTERAC, Interac, rupay, RUPAY, RuPay, ruPay, maestro, MAESTRO, Maestro, star, STAR, Star, pulse, PULSE, Pulse, accel, ACCEL, Accel, nyce, NYCE, Nyce" } card_redirect = { type = "enum", values = "knet, benefit, momo_atm, card_redirect" } -real_time_payment = { type = "enum", values = "fps, duit_now, prompt_pay, viet_qr" } -open_banking = { type = "enum", values = "open_banking_pis" } -mobile_payment = { type = "enum", values = "direct_carrier_billing" } -payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } card_type = { type = "enum", values = "debit, credit" } -card = { type = "enum", values = "debit, credit" } -payment_card_bin = { type = "udf", exact_length = 6, regex = "^[0-9]{6}$" } +crypto = { type = "enum", values = "crypto_currency" } +currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +extended_card_bin = { type = "str_value", exact_length = 8, regex = "^[0-9]{8}$" } +gift_card = { type = "enum", values = "givex, pay_safe_card" } +issuer_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } issuer_name = { type = "str_value", min_length = 1 } -payment_card_type = { type = "enum", values = "CREDIT, DEBIT" } mandate_acceptance_type = { type = "enum", values = "online, offline" } mandate_type = { type = "enum", values = "single_use, multi_use" } -card_network = { type = "enum", values = "visa, VISA, Visa, visaCard, mastercard, MASTERCARD, MasterCard, masterCard, mastercardCard, master_card, Master_card, Master_Card, Master Card, Mastercard, american_express, AMERICANEXPRESS, AmericanExpress, americanExpress, americanExpressCard, amex, AMEX, Amex, jcb, JCB, Jcb, diners_club, DINERSCLUB, DinersClub, dinersClub, dinersClubCard, discover, DISCOVER, Discover, discoverCard, cartes_bancaires, CARTESBANCAIRES, CartesBancaires, cartesBancaires, union_pay, UNIONPAY, UnionPay, unionPay, interac, INTERAC, Interac, rupay, RUPAY, RuPay, ruPay, maestro, MAESTRO, Maestro, star, STAR, Star, pulse, PULSE, Pulse, accel, ACCEL, Accel, nyce, NYCE, Nyce" } -payment_type = { type = "enum", values = "normal, new_mandate, setup_mandate, recurring_mandate, non_mandate" } +metadata = { type = "udf" } +mobile_payment = { type = "enum", values = "direct_carrier_billing" } +network_token = { type = "enum", values = "network_token" } +open_banking = { type = "enum", values = "open_banking_pis" } +pay_later = { type = "enum", values = "affirm, alma, afterpay_clearpay, klarna, pay_bright, atome, walley" } +payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } payment_method_type = { type = "enum", values = "ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, boleto, bca_bank_transfer, bni_va, bri_va, card, card_redirect, cimb_va, classic_reward, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eft, eps, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, multibanco, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, paypal, paze, pix, pay_safe_card, przelewy24, prompt_pay, pse, red_compra, red_pagos, samsung_pay, sepa, sepa_bank_transfer, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, direct_carrier_billing, instant_bank_transfer" } -authentication_type = { type = "enum", values = "three_ds, no_three_ds" } -capture_methods = { type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic" } +payment_type = { type = "enum", values = "normal, new_mandate, setup_mandate, recurring_mandate, non_mandate" } +real_time_payment = { type = "enum", values = "fps, duit_now, prompt_pay, viet_qr" } +reward = { type = "enum", values = "evoucher, classic_reward" } setup_future_usage = { type = "enum", values = "on_session, off_session" } -payment_card_network = { type = "enum", values = "visa, mastercard, american_express, jcb, diners_club, discover, cartes_bancaires, union_pay, interac, rupay, maestro" } -amount = { type = "integer", min = 0 } -login_date = { type = "str_value" } -currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } -payment_card_issuer_country = { type = "enum", values = "AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, US" } - -card_bin = { type = "str_value", exact_length = 6, regex = "^[0-9]{6}$" } -extended_card_bin = { type = "str_value", exact_length = 8, regex = "^[0-9]{8}$" } -capture_method = { type = "enum", values = "automatic, manual" } -new_customer = { type = "udf" } -udf1 = { type = "str_value" } -order_udf1 = { type = "global_ref" } -payment_payment_method = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } -payment_payment_source = { type = "enum", values = "net.one97.paytm, @paytm" } -txn_is_emi = { type = "enum", values = "true, false" } transaction_initiator = { type = "enum", values = "customer, merchant" } -network_token = { type = "enum", values = "network_token" } -card_discovery = { type = "enum", values = "manual, saved_card, click_to_pay" } +upi = { type = "enum", values = "upi_collect, upi_intent" } +voucher = { type = "enum", values = "boleto, efecty, pago_efectivo, red_compra, red_pagos, indomaret, alfamart, oxxo, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy" } +wallet = { type = "enum", values = "amazon_pay, apple_pay, google_pay, paypal, ali_pay, ali_pay_hk, dana, mb_way, mobile_pay, samsung_pay, twint, vipps, touch_n_go, swish, we_chat_pay, go_pay, gcash, momo, kakao_pay, cashapp, mifinity, paze" } [debit_routing_config] fraud_check_fee = 1.0 diff --git a/config/docker-configuration.toml b/config/docker-configuration.toml index ce4512d9..b406bf62 100644 --- a/config/docker-configuration.toml +++ b/config/docker-configuration.toml @@ -69,61 +69,44 @@ pool_max_idle_per_host = 10 identity = "" [routing_config.keys] +amount = { type = "integer", min = 0 } +authentication_type = { type = "enum", values = "three_ds, no_three_ds" } +bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } +bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } +bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, multibanco, pix, pse, permata_bank_transfer, bca_bank_transfer, bni_va, bri_va, cimb_va, danamon_va, mandiri_va, local_bank_transfer, instant_bank_transfer" } billing_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } -issuer_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } business_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } business_label = { type = "str_value" } -metadata = { type = "udf" } -pay_later = { type = "enum", values = "affirm, alma, afterpay_clearpay, klarna, pay_bright, atome, walley" } -gift_card = { type = "enum", values = "givex, pay_safe_card" } -upi = { type = "enum", values = "upi_collect, upi_intent" } -wallet = { type = "enum", values = "amazon_pay, apple_pay, google_pay, paypal, ali_pay, ali_pay_hk, dana, mb_way, mobile_pay, samsung_pay, twint, vipps, touch_n_go, swish, we_chat_pay, go_pay, gcash, momo, kakao_pay, cashapp, mifinity, paze" } -voucher = { type = "enum", values = "boleto, efecty, pago_efectivo, red_compra, red_pagos, indomaret, alfamart, oxxo, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy" } -bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, multibanco, pix, pse, permata_bank_transfer, bca_bank_transfer, bni_va, bri_va, cimb_va, danamon_va, mandiri_va, local_bank_transfer, instant_bank_transfer" } -bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } -customer_device_display_size = { type = "enum", values = "size320x568, size375x667, size390x844, size414x896, size428x926, size768x1024, size834x1112, size834x1194, size1024x1366, size1280x720, size1366x768, size1440x900, size1920x1080, size2560x1440, size3840x2160, size500x600, size600x400, size360x640, size412x915, size800x1280" } -customer_device_type = { type = "enum", values = "mobile, tablet, desktop, gaming_console" } -customer_device_platform = { type = "enum", values = "web, android, ios" } -bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } -crypto = { type = "enum", values = "crypto_currency" } -reward = { type = "enum", values = "evoucher, classic_reward" } +capture_method = { type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic" } +card = { type = "enum", values = "debit, credit" } +card_bin = { type = "str_value", exact_length = 6, regex = "^[0-9]{6}$" } +card_discovery = { type = "enum", values = "manual, saved_card, click_to_pay" } +card_network = { type = "enum", values = "visa, VISA, Visa, visaCard, mastercard, MASTERCARD, MasterCard, masterCard, mastercardCard, master_card, Master_card, Master_Card, Master Card, Mastercard, american_express, AMERICANEXPRESS, AmericanExpress, americanExpress, americanExpressCard, amex, AMEX, Amex, jcb, JCB, Jcb, diners_club, DINERSCLUB, DinersClub, dinersClub, dinersClubCard, discover, DISCOVER, Discover, discoverCard, cartes_bancaires, CARTESBANCAIRES, CartesBancaires, cartesBancaires, union_pay, UNIONPAY, UnionPay, unionPay, interac, INTERAC, Interac, rupay, RUPAY, RuPay, ruPay, maestro, MAESTRO, Maestro, star, STAR, Star, pulse, PULSE, Pulse, accel, ACCEL, Accel, nyce, NYCE, Nyce" } card_redirect = { type = "enum", values = "knet, benefit, momo_atm, card_redirect" } -real_time_payment = { type = "enum", values = "fps, duit_now, prompt_pay, viet_qr" } -open_banking = { type = "enum", values = "open_banking_pis" } -mobile_payment = { type = "enum", values = "direct_carrier_billing" } -payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } card_type = { type = "enum", values = "debit, credit" } -card = { type = "enum", values = "debit, credit" } -payment_card_bin = { type = "udf", exact_length = 6, regex = "^[0-9]{6}$" } +crypto = { type = "enum", values = "crypto_currency" } +currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } +extended_card_bin = { type = "str_value", exact_length = 8, regex = "^[0-9]{8}$" } +gift_card = { type = "enum", values = "givex, pay_safe_card" } +issuer_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } issuer_name = { type = "str_value", min_length = 1 } -payment_card_type = { type = "enum", values = "CREDIT, DEBIT" } mandate_acceptance_type = { type = "enum", values = "online, offline" } mandate_type = { type = "enum", values = "single_use, multi_use" } -card_network = { type = "enum", values = "visa, VISA, Visa, visaCard, mastercard, MASTERCARD, MasterCard, masterCard, mastercardCard, master_card, Master_card, Master_Card, Master Card, Mastercard, american_express, AMERICANEXPRESS, AmericanExpress, americanExpress, americanExpressCard, amex, AMEX, Amex, jcb, JCB, Jcb, diners_club, DINERSCLUB, DinersClub, dinersClub, dinersClubCard, discover, DISCOVER, Discover, discoverCard, cartes_bancaires, CARTESBANCAIRES, CartesBancaires, cartesBancaires, union_pay, UNIONPAY, UnionPay, unionPay, interac, INTERAC, Interac, rupay, RUPAY, RuPay, ruPay, maestro, MAESTRO, Maestro, star, STAR, Star, pulse, PULSE, Pulse, accel, ACCEL, Accel, nyce, NYCE, Nyce" } -payment_type = { type = "enum", values = "normal, new_mandate, setup_mandate, recurring_mandate, non_mandate" } +metadata = { type = "udf" } +mobile_payment = { type = "enum", values = "direct_carrier_billing" } +network_token = { type = "enum", values = "network_token" } +open_banking = { type = "enum", values = "open_banking_pis" } +pay_later = { type = "enum", values = "affirm, alma, afterpay_clearpay, klarna, pay_bright, atome, walley" } +payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } payment_method_type = { type = "enum", values = "ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, boleto, bca_bank_transfer, bni_va, bri_va, card, card_redirect, cimb_va, classic_reward, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eft, eps, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, multibanco, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, paypal, paze, pix, pay_safe_card, przelewy24, prompt_pay, pse, red_compra, red_pagos, samsung_pay, sepa, sepa_bank_transfer, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, direct_carrier_billing, instant_bank_transfer" } -authentication_type = { type = "enum", values = "three_ds, no_three_ds" } -capture_methods = { type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic" } +payment_type = { type = "enum", values = "normal, new_mandate, setup_mandate, recurring_mandate, non_mandate" } +real_time_payment = { type = "enum", values = "fps, duit_now, prompt_pay, viet_qr" } +reward = { type = "enum", values = "evoucher, classic_reward" } setup_future_usage = { type = "enum", values = "on_session, off_session" } -payment_card_network = { type = "enum", values = "visa, mastercard, american_express, jcb, diners_club, discover, cartes_bancaires, union_pay, interac, rupay, maestro" } -amount = { type = "integer", min = 0 } -login_date = { type = "str_value" } -currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } -payment_card_issuer_country = { type = "enum", values = "AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, US" } - -card_bin = { type = "str_value", exact_length = 6, regex = "^[0-9]{6}$" } -extended_card_bin = { type = "str_value", exact_length = 8, regex = "^[0-9]{8}$" } -capture_method = { type = "enum", values = "automatic, manual" } -new_customer = { type = "udf" } -udf1 = { type = "str_value" } -order_udf1 = { type = "global_ref" } -payment_payment_method = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } -payment_payment_source = { type = "enum", values = "net.one97.paytm, @paytm" } -txn_is_emi = { type = "enum", values = "true, false" } transaction_initiator = { type = "enum", values = "customer, merchant" } -network_token = { type = "enum", values = "network_token" } -card_discovery = { type = "enum", values = "manual, saved_card, click_to_pay" } - +upi = { type = "enum", values = "upi_collect, upi_intent" } +voucher = { type = "enum", values = "boleto, efecty, pago_efectivo, red_compra, red_pagos, indomaret, alfamart, oxxo, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy" } +wallet = { type = "enum", values = "amazon_pay, apple_pay, google_pay, paypal, ali_pay, ali_pay_hk, dana, mb_way, mobile_pay, samsung_pay, twint, vipps, touch_n_go, swish, we_chat_pay, go_pay, gcash, momo, kakao_pay, cashapp, mifinity, paze" } [debit_routing_config] fraud_check_fee = 1.0 diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 545cb75b..c2720dc9 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -1,29 +1,3 @@ -# Local development override - adds live code reloading for backend -services: - open-router-pg-local: - build: - context: . - dockerfile: Dockerfile.postgres - args: - - BUILDKIT_INLINE_CACHE=1 - profiles: - - local-postgres - - local-dev - container_name: open-router-pg-local - restart: unless-stopped - ports: - - "8080:8080" - - "9094:9094" - depends_on: - postgresql: - condition: service_healthy - redis: - condition: service_healthy - db-migrator-postgres: - condition: service_completed_successfully - volumes: - - ./config/docker-configuration.toml:/local/config/development.toml - networks: - - open-router-network - environment: - - GROOVY_RUNNER_HOST=host.docker.internal:8085 +# Local profile variants are now defined directly in docker-compose.yaml. +# This override file is intentionally kept minimal for backward compatibility. +services: {} diff --git a/docker-compose.yaml b/docker-compose.yaml index b6fe531d..c333d9fb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,18 +1,14 @@ services: # ========================================== - # PROFILE: postgres (Basic PostgreSQL + Redis) + # Decision Engine Runtime (GHCR Images) # ========================================== - # ========================================== - # PROFILE: postgres (Basic PostgreSQL + Redis) - # ========================================== - open-router-pg: - image: ghcr.io/juspay/decision-engine/postgres:v1.3.3 + open-router-pg-ghcr: + image: ghcr.io/juspay/decision-engine/postgres:${DECISION_ENGINE_TAG:-v1.3.4} pull_policy: always platform: linux/amd64 - container_name: open-router-pg profiles: - - postgres - - dashboard-postgres + - postgres-ghcr + - dashboard-postgres-ghcr restart: unless-stopped ports: - "8080:8080" @@ -27,20 +23,85 @@ services: volumes: - ./config/docker-configuration.toml:/local/config/development.toml networks: - - open-router-network + open-router-network: + aliases: + - decision-engine-api + environment: + - GROOVY_RUNNER_HOST=host.docker.internal:8085 + + open-router-mysql-ghcr: + image: ghcr.io/juspay/decision-engine:${DECISION_ENGINE_TAG:-v1.3.4} + pull_policy: always + platform: linux/amd64 + profiles: + - mysql-ghcr + - dashboard-mysql-ghcr + restart: unless-stopped + ports: + - "8080:8080" + depends_on: + mysql: + condition: service_healthy + redis: + condition: service_healthy + routing-config: + condition: service_completed_successfully + db-migrator: + condition: service_completed_successfully + volumes: + - ./config/docker-configuration.toml:/local/config/development.toml + networks: + open-router-network: + aliases: + - decision-engine-api environment: - GROOVY_RUNNER_HOST=host.docker.internal:8085 # ========================================== - # PROFILE: mysql (Basic MySQL + Redis) + # Decision Engine Runtime (Local Build) # ========================================== - open-router: - image: ghcr.io/juspay/decision-engine:v1.3.3 - pull_policy: always + open-router-pg-local: + build: + context: . + dockerfile: Dockerfile.postgres + platforms: + - linux/amd64 + image: decision-engine-pg:local platform: linux/amd64 - container_name: open-router profiles: - - mysql + - postgres-local + - dashboard-postgres-local + restart: unless-stopped + ports: + - "8080:8080" + - "9094:9094" + depends_on: + postgresql: + condition: service_healthy + redis: + condition: service_healthy + db-migrator-postgres: + condition: service_completed_successfully + volumes: + - ./config/docker-configuration.toml:/local/config/development.toml + networks: + open-router-network: + aliases: + - decision-engine-api + environment: + - GROOVY_RUNNER_HOST=host.docker.internal:8085 + + open-router-mysql-local: + build: + context: . + dockerfile: Dockerfile + platforms: + - linux/amd64 + image: decision-engine-mysql:local + platform: linux/amd64 + profiles: + - mysql-local + - dashboard-mysql-local restart: unless-stopped ports: - "8080:8080" @@ -51,22 +112,27 @@ services: condition: service_healthy routing-config: condition: service_completed_successfully + db-migrator: + condition: service_completed_successfully volumes: - ./config/docker-configuration.toml:/local/config/development.toml networks: - - open-router-network + open-router-network: + aliases: + - decision-engine-api environment: - GROOVY_RUNNER_HOST=host.docker.internal:8085 # ========================================== - # PROFILE: dashboard-postgres (PG + Redis + Dashboard) + # Dashboard and Docs # ========================================== nginx: image: nginx:alpine profiles: - - dashboard-postgres - - dashboard-mysql - container_name: open-router-nginx + - dashboard-postgres-ghcr + - dashboard-postgres-local + - dashboard-mysql-ghcr + - dashboard-mysql-local restart: unless-stopped ports: - "8081:80" @@ -74,8 +140,8 @@ services: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./website/dist:/usr/share/nginx/html/dashboard:ro depends_on: - - open-router-pg - - mintlify-docs + mintlify-docs: + condition: service_healthy networks: - open-router-network @@ -84,9 +150,10 @@ services: context: . dockerfile: Dockerfile.docs profiles: - - dashboard-postgres - - dashboard-mysql - container_name: mintlify-docs + - dashboard-postgres-ghcr + - dashboard-postgres-local + - dashboard-mysql-ghcr + - dashboard-mysql-local restart: unless-stopped expose: - "3000" @@ -100,7 +167,7 @@ services: start_period: 60s # ========================================== - # Supporting Services with Profiles + # Supporting Services # ========================================== prometheus: image: prom/prometheus:latest @@ -130,13 +197,12 @@ services: volumes: - ./config/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yml - groovy-runner: - image: ghcr.io/juspay/open-router/groovy-runner:main + groovy-runner-ghcr: + image: ghcr.io/juspay/decision-engine/groovy-runner:${GROOVY_RUNNER_TAG:-v1.3.4} pull_policy: always platform: linux/amd64 - container_name: groovy-runner profiles: - - groovy + - groovy-ghcr restart: unless-stopped ports: - "8085:8085" @@ -160,8 +226,8 @@ services: labels: - "com.docker.compose.watchfile=groovy.Dockerfile" - "com.docker.compose.watchfile=src/Runner.groovy" + image: decision-engine-groovy-runner:local platform: linux/amd64 - container_name: groovy-runner-local profiles: - groovy-local restart: unless-stopped @@ -177,14 +243,15 @@ services: start_period: 10s # ========================================== - # Core Infrastructure (Pulled when needed) + # Core Infrastructure # ========================================== mysql: image: mysql:8.0 - container_name: open-router-mysql profiles: - - mysql - - dashboard-mysql + - mysql-ghcr + - dashboard-mysql-ghcr + - mysql-local + - dashboard-mysql-local restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: root @@ -206,10 +273,11 @@ services: postgresql: image: postgres:16 - container_name: open-router-postgres profiles: - - postgres - - dashboard-postgres + - postgres-ghcr + - dashboard-postgres-ghcr + - postgres-local + - dashboard-postgres-local restart: unless-stopped environment: POSTGRES_USER: db_user @@ -230,12 +298,15 @@ services: redis: image: redis:7-alpine - container_name: open-router-redis profiles: - - postgres - - dashboard-postgres - - mysql - - dashboard-mysql + - postgres-ghcr + - dashboard-postgres-ghcr + - postgres-local + - dashboard-postgres-local + - mysql-ghcr + - dashboard-mysql-ghcr + - mysql-local + - dashboard-mysql-local restart: unless-stopped ports: - "6379:6379" @@ -252,10 +323,11 @@ services: db-migrator: image: mysql:8.0 - container_name: db-migrator profiles: - - mysql - - dashboard-mysql + - mysql-ghcr + - dashboard-mysql-ghcr + - mysql-local + - dashboard-mysql-local depends_on: mysql: condition: service_healthy @@ -268,10 +340,11 @@ services: db-migrator-postgres: image: rust:latest - container_name: db-migrator-postgres profiles: - - postgres - - dashboard-postgres + - postgres-ghcr + - dashboard-postgres-ghcr + - postgres-local + - dashboard-postgres-local depends_on: postgresql: condition: service_healthy @@ -281,16 +354,17 @@ services: volumes: - .:/app working_dir: /app - command: "bash -c 'cargo install diesel_cli --no-default-features --features postgres && cargo install just && just migrate-pg'" + command: "bash -c 'cargo install diesel_cli --no-default-features --features postgres && diesel migration run --database-url \"$$DATABASE_URL\" --migration-dir /app/migrations_pg --config-file /app/diesel_pg.toml'" networks: - open-router-network routing-config: image: python:3.10-slim - container_name: routing-config profiles: - - mysql - - dashboard-mysql + - mysql-ghcr + - dashboard-mysql-ghcr + - mysql-local + - dashboard-mysql-local depends_on: mysql: condition: service_healthy diff --git a/docs/api-reference.md b/docs/api-reference.md index 2dfeb000..f249414f 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -1,160 +1,9 @@ -# Dynamo API Reference +# API Reference -## Overview +Decision Engine API documentation is available in: -Dynamo provides both gRPC and HTTP APIs for its dynamic payment routing services. This reference documents the available endpoints, their parameters, and example usage. - ---- - -## Authentication and Headers - -All API requests require appropriate authentication: - -| Header | Required | Description | -|:-------|:--------:|:------------| -| `x-api-key` | ✅ | API key for authentication | -| `x-tenant-id` | ✅ | Tenant identifier (*required if multi-tenancy is enabled) | - ---- - -## Available Services - -Dynamo offers three main routing services: - -### 1. **[Success Rate Calculator](api-reference/success-rate.md)** - -Routes payments to processors with the highest historical success rates. - -| Endpoint | Description | -|:---------|:------------| -| **`FetchSuccessRate`** | Get success rates for processors | -| **`UpdateSuccessRateWindow`** | Update success/failure data | -| **`InvalidateWindows`** | Reset success rate data | -| **`FetchEntityAndGlobalSuccessRate`** | Get both entity and global success rates | - -### 2. **[Elimination Analyser](api-reference/elimination.md)** - -Prevents routing to processors that meet failure criteria. - -| Endpoint | Description | -|:---------|:------------| -| **`GetEliminationStatus`** | Check if processors should be eliminated | -| **`UpdateEliminationBucket`** | Update failure data | -| **`InvalidateBucket`** | Reset elimination data | - -### 3. **[Contract Score Calculator](api-reference/contract.md)** - -Routes based on contractual obligations and targets. - -| Endpoint | Description | -|:---------|:------------| -| **`FetchContractScore`** | Get contract-based scores | -| **`UpdateContract`** | Update contract fulfillment data | -| **`InvalidateContract`** | Reset contract data | - -### 4. **Health** - -System health checks. - -| Endpoint | Description | -|:---------|:------------| -| **`Check`** | Verify system health status | - -**gRPC Method**: `grpc.health.v1.Health/Check` - -**HTTP Endpoint**: `POST /grpc.health.v1.Health/Check` - -**Request**: - -```json -{ - "service": "dynamo" -} -``` - -**Response**: - -```json -{ - "status": 1 // 1 = SERVING -} -``` - ---- - -## Protocol Support - -All services are available via both: - - - - - - - - - - -
gRPCEfficient binary protocol for direct integration
HTTP/JSONRESTful interface for broader compatibility
- ---- - -## Quick Start Examples - -### 🔹 gRPC Example (using grpcurl) - -```bash -grpcurl -d '{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels": ["processor_A", "processor_B"], - "config": { - "min_aggregates_size": 10, - "default_success_rate": 0.5 - } -}' \ --H 'x-api-key: YOUR_API_KEY' \ --H 'x-tenant-id: tenant_001' \ --plaintext localhost:9000 success_rate.SuccessRateCalculator/FetchSuccessRate -``` - -### 🔹 HTTP Example (using curl) - -```bash -curl -X POST \ - -H "Content-Type: application/json" \ - -H "x-api-key: YOUR_API_KEY" \ - -H "x-tenant-id: tenant_001" \ - -d '{ - "id": "merchant_123", - "params": "{\"payment_method\":\"card\"}", - "labels": ["processor_A", "processor_B"], - "config": { - "min_aggregates_size": 10, - "default_success_rate": 0.5 - } - }' \ - http://localhost:8080/success_rate.SuccessRateCalculator/FetchSuccessRate -``` - ---- - -## Error Handling - -All services use standard gRPC status codes: - -| Status Code | Description | Common Causes | -|:------------|:------------|:--------------| -| OK (0) | ✅ Operation completed successfully | Normal successful operation | -| INVALID_ARGUMENT (3) | ⚠️ Validation failed | Missing required fields, invalid parameters | -| NOT_FOUND (5) | 🔍 Required resource not found | Entity or configuration not found | -| UNAUTHENTICATED (16) | 🔒 Authentication failed | Invalid API key | -| PERMISSION_DENIED (7) | 🚫 Unauthorized access | Insufficient permissions | -| INTERNAL (13) | ❌ Internal server error | Unexpected server-side errors | - ---- - -## Related Documentation - -📥 [**Installation**](installation.md) ⚙️ [**Configuration**](configuration.md) 🔄 [**Dual Protocol**](dual-protocol-layer.md) +- [Primary API Reference](api-reference1.md) +- Mint API pages under `docs/api-reference/endpoint/*` +If you run docs locally (`dashboard-*` profiles), browse: +- `http://localhost:8081/introduction` diff --git a/docs/configuration.md b/docs/configuration.md index fc4d0f28..a78d1742 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,176 +1,69 @@ # Configuration Guide -Dynamo uses TOML configuration files to customize its behavior. This guide explains the available configuration options and how to use them effectively. +This document explains how to configure Decision Engine for local and on-prem deployments. -## Configuration File Location +## Primary Config Files -By default, Dynamo looks for configuration files in the following locations: +- `config/development.toml`: host/source runs +- `config/docker-configuration.toml`: Docker/Compose runs +- `helm-charts/config/development.toml`: Kubernetes chart template config -- Development mode: `config/development.toml` -- Production mode: `config/production.toml` +## Core Sections -You can also specify a custom configuration file using environment variables. - -## Configuration Format - -Below is an explanation of the main configuration sections: - -### Server Configuration +### Server ```toml [server] -host = "127.0.0.1" # The address to bind the server to -port = 8000 # The port to listen on -type = "grpc" # Server type: "grpc" or "http" +host = "0.0.0.0" +port = 8080 ``` -### Metrics Server Configuration +### Metrics ```toml [metrics] -host = "127.0.0.1" # The address to bind the metrics server to -port = 9000 # The port for the metrics server -``` - -### Logging Configuration - -```toml -[log.console] -enabled = true # Whether to enable console logging -level = "DEBUG" # Log level: DEBUG, INFO, WARN, ERROR -log_format = "default" # Log format: "default" or "json" -``` - -### Redis Configuration - -```toml -[redis] -host = "127.0.0.1" -port = 6379 -pool_size = 5 # Number of connections to keep open -reconnect_max_attempts = 5 # Maximum reconnection attempts -reconnect_delay = 5 # Delay between attempts in milliseconds -use_legacy_version = false # Use RESP2 protocol for Redis < 6 -``` - -### TTL for Keys - -```toml -[ttl_for_keys] -aggregates = 300 # Time to live for aggregates keys (seconds) -current_block = 900 # Time to live for current_block keys (seconds) -elimination_bucket = 900 # Time to live for elimination buckets (seconds) -contract_ttl = 900 # Time to live for contracts (seconds) -``` - -### Global Routing Configurations - -```toml -[global_routing_configs.success_rate] -min_aggregates_size = 5 # Minimum number of buckets for SR calculation -default_success_rate = 100 # Default SR when insufficient data -max_aggregates_size = 10 # Maximum number of aggregates to store - -[global_routing_configs.success_rate.current_block_threshold] -duration_in_mins = 10 # Current block duration in minutes -max_total_count = 5 # Maximum transaction count for current block - -[global_routing_configs.elimination_rate] -bucket_size = 5 # Capacity of buckets -bucket_leak_interval_in_secs = 300 # Leak rate of buckets in seconds -``` - -### Multi-Tenancy - -```toml -[multi_tenancy] -enabled = true # Enable multi-tenant mode -``` - -## Environment Variables - -You can override configuration values using environment variables with the prefix `DYNAMO__`: - -```bash -# Override Redis host and port -export DYNAMO__REDIS__HOST=redis-server -export DYNAMO__REDIS__PORT=6380 - -# Override server port -export DYNAMO__SERVER__PORT=9000 +host = "0.0.0.0" +port = 9090 ``` -## Configuration Examples - -### Development Configuration +### Logging ```toml [log.console] enabled = true level = "DEBUG" log_format = "default" - -[server] -host = "127.0.0.1" -port = 8000 -type = "grpc" - -[redis] -host = "127.0.0.1" -port = 6379 ``` -### Production Configuration +### Database -```toml -[log.console] -enabled = true -level = "INFO" -log_format = "json" +Use either MySQL or PostgreSQL as required by your deployment mode. -[server] -host = "0.0.0.0" # Listen on all interfaces -port = 8000 -type = "grpc" +For Docker Compose profiles, connection details are pre-wired via service names and mounted config. +For source runs, ensure your database URL in config matches your local DB. -[redis] -host = "redis-server" # Use service name in production -port = 6379 -pool_size = 20 -reconnect_max_attempts = 10 -``` - -### High-Availability Configuration +### Redis ```toml -[server] -host = "0.0.0.0" -port = 8000 -type = "grpc" - [redis] -host = "redis-master" +host = "127.0.0.1" port = 6379 -pool_size = 30 -reconnect_max_attempts = 15 -reconnect_delay = 2 ``` -## Advanced Configuration +### Secrets Manager -### Using Multiple Redis Instances +`secrets_manager` controls encryption/key-management behavior. In local environments this is commonly set to `no_encryption`. -While not directly supported in the configuration file, you can set up Redis Sentinel or Redis Cluster for high availability and implement a custom client. +## Environment Overrides -### Configuring Routing Strategies +Use environment variables to override selected runtime values when needed (for example in Helm via `extraEnvVars`). -Each routing strategy has specific configuration parameters: +For deployment-specific examples, see: -1. **Success Rate Routing**: Configure weight factors, time windows, and default values -2. **Elimination Routing**: Configure bucket sizes, leak rates, and thresholds -3. **Contract Routing**: Configure contract scores, targets, and time scales +- [Local Setup Guide](local-setup.md) +- [Helm Chart README](../helm-charts/README.md) -## Next Steps +## Related Docs -- [Installation Guide](setup-guide.md) -- [API Reference](api-reference.md) +- [Local Setup Guide](local-setup.md) +- [API Reference](api-reference1.md) diff --git a/docs/dual-protocol-layer.md b/docs/dual-protocol-layer.md index a897e432..44dbf4dd 100644 --- a/docs/dual-protocol-layer.md +++ b/docs/dual-protocol-layer.md @@ -1,79 +1,8 @@ -# Dual Protocol Layer: gRPC and HTTP +# Protocol Notes -## Overview +Decision Engine exposes HTTP REST endpoints documented in [api-reference1.md](api-reference1.md). -Dynamo implements a unique dual-protocol layer that allows services to be exposed via both gRPC and HTTP simultaneously. This enables clients to interact with Dynamo using their preferred protocol without requiring separate service implementations. +For local execution, deployment tracks, and integration flow, see: -## Architecture - -The implementation uses a custom generator that extends Tonic's standard gRPC code generation to automatically create corresponding HTTP endpoints for each gRPC service. This is done through a specialized WebGenerator in the build process. - -### Key Components - -- **Protocol Buff Definition**: Service interfaces are defined once in `.proto` files -- **Code Generation**: Build process generates both gRPC and HTTP handlers -- **Axum Integration**: HTTP endpoints are implemented using the Axum framework -- **Automatic Conversion**: Seamless serialization/deserialization between gRPC and HTTP formats - -## How It Works - -1. **Define Once**: Services are defined once using Protocol Buffers -2. **Generate Both**: Build scripts generate both gRPC service code and HTTP routes -3. **Single Implementation**: Service logic is implemented only once -4. **Configure at Runtime**: Choose protocol through configuration settings - -The system automatically handles conversion between HTTP and gRPC formats, including: -- Converting gRPC metadata to HTTP headers and vice versa -- Mapping gRPC status codes to HTTP status codes -- Handling serialization differences between the protocols - -## Benefits - -1. **Protocol Flexibility**: Clients can choose between gRPC or HTTP based on their needs -2. **Unified Codebase**: Service logic is implemented only once -3. **No Duplication**: Avoid duplicating endpoint logic and type definitions -4. **Simple Configuration**: Switch between protocols with a single configuration option -5. **Testing Ease**: Test services using simple HTTP clients like cURL - -## Using the Dual Protocol Layer - -### Configuration - -In your configuration file, specify the protocol: - -```toml -[server] -type = "grpc" # or "http" -``` - -### Client Options - -Clients can interact with the service using either protocol: - -**gRPC Client**: -- Better performance for high-throughput scenarios -- Efficient binary serialization -- Built-in streaming support -- Strong typing via generated client code - -**HTTP Client**: -- Works in environments where gRPC isn't supported (e.g., browsers) -- Simpler to debug and inspect with standard tools -- Easier integration with existing HTTP-based systems -- No need for protocol buffer compilation - -## Technical Considerations - -1. **Performance**: gRPC generally offers better performance for service-to-service communication -2. **Compatibility**: HTTP offers broader compatibility but without some gRPC advantages -3. **Streaming**: gRPC excels at bidirectional streaming; HTTP is more limited -4. **Headers/Metadata**: Slight differences in how metadata is handled between protocols - -## Future Directions - -- Enhanced streaming support for HTTP endpoints -- WebSocket alternatives for bidirectional communication in HTTP mode -- Automatic OpenAPI/Swagger documentation generation -- Support for protocol-specific optimizations - -This innovative approach allows Dynamo to be more accessible to a wider range of clients while maintaining a clean and maintainable codebase. +- [Local Setup Guide](local-setup.md) +- [Introduction](introduction.mdx) diff --git a/docs/installation.md b/docs/installation.md index 675014e1..c5df66d1 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,168 +1,11 @@ # Installation Guide -This guide provides detailed instructions for installing Dynamo on different platforms. +The canonical installation and local run instructions are maintained in: -## Prerequisites +- [Local Setup Guide](local-setup.md) -- Rust 1.78.0 or later -- Redis server 6.0 or later -- Git - -## From Source - -### 1. Clone the Repository - -```bash -git clone https://github.com/yourusername/dynamo.git -cd dynamo -``` - -### 2. Install Dependencies - -#### Ubuntu/Debian - -```bash -# Install system dependencies -sudo apt-get update -sudo apt-get install -y pkg-config libssl-dev protobuf-compiler libpq-dev - -# Install Rust (if not already installed) -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -source $HOME/.cargo/env -``` - -#### macOS - -```bash -# Using Homebrew -brew install pkg-config openssl protobuf postgresql - -# Install Rust (if not already installed) -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -source $HOME/.cargo/env -``` - -### 3. Build Dynamo - -```bash -# Build in release mode -cargo build --release -``` - -### 4. Set Up Configuration - -```bash -# Copy example configuration -cp config/config.example.toml config/development.toml - -# Edit configuration as needed -# vi config/development.toml -``` - -### 5. Run Redis - -Make sure Redis is running on your system: - -```bash -# Install Redis if needed -sudo apt-get install redis-server # Ubuntu/Debian -brew install redis # macOS - -# Start Redis server -redis-server -``` - -### 6. Run Dynamo - -```bash -# Run with development configuration -./target/release/dynamo -``` - -## Using Docker - -### 1. Pull the Docker Image - -```bash -docker pull yourusername/dynamo:latest -``` - -Or build it yourself: - -```bash -docker build -t dynamo:latest . -``` - -### 2. Run with Docker - -```bash -# Run with default configuration -docker run -p 8000:8000 -p 9000:9000 dynamo:latest - -# Run with custom configuration -docker run -p 8000:8000 -p 9000:9000 \ - -v $(pwd)/config:/app/config \ - dynamo:latest -``` - -### 3. Docker Compose Setup - -Create a `docker-compose.yml` file: - -```yaml -version: '3' -services: - dynamo: - image: yourusername/dynamo:latest - ports: - - "8000:8000" - - "9000:9000" - volumes: - - ./config:/app/config - depends_on: - - redis - - redis: - image: redis:latest - ports: - - "6379:6379" -``` - -Run with Docker Compose: - -```bash -docker-compose up -d -``` - -## Building the WebAssembly Module - -The `procesmo` module can be built for web use: - -```bash -# Install wasm-pack if needed -cargo install wasm-pack - -# Build the WebAssembly module -cd crates/procesmo -wasm-pack build --target web -``` - -## Verifying Installation - -To verify that Dynamo is running correctly: - -```bash -# Check health status -curl http://localhost:8000/grpc.health.v1.Health/Check - -# Or using grpcurl -grpcurl -plaintext localhost:8000 grpc.health.v1.Health/Check -``` - -You should see a response indicating the service is running. - -## Next Steps - -- [Configure Dynamo](configuration.md) for your environment -- [Explore the API](api-reference.md) -- [See usage examples](examples.md) +This includes: +- CLI build and run +- Docker image build and run +- Docker Compose GHCR vs local profile tracks +- Helm installation examples diff --git a/docs/introduction.mdx b/docs/introduction.mdx index cb9130b6..e6ccdbf9 100644 --- a/docs/introduction.mdx +++ b/docs/introduction.mdx @@ -82,7 +82,7 @@ curl -X POST http://localhost:8080/update-gateway-score \ ## Running locally ```bash -docker compose --profile dashboard-postgres up -d +docker compose --profile dashboard-postgres-ghcr up -d curl http://localhost:8080/health # {"message":"Health is good"} ``` diff --git a/docs/local-setup.md b/docs/local-setup.md index fb778113..61a3777e 100644 --- a/docs/local-setup.md +++ b/docs/local-setup.md @@ -1,350 +1,249 @@ -# Local Development Setup Guide +# Local Setup Guide -Complete guide for setting up Decision Engine locally with Docker, Kubernetes (Helm), or from source. +This is the canonical setup guide for running Decision Engine locally and for on-prem style validation. ## Table of Contents - [Prerequisites](#prerequisites) -- [Quick Start](#quick-start) +- [Image Strategy](#image-strategy) +- [Quick Start (Compose)](#quick-start-compose) - [Docker Compose Profiles](#docker-compose-profiles) -- [Setup Modes](#setup-modes) - - [1. PostgreSQL with Dashboard (Recommended)](#1-postgresql-with-dashboard-recommended) - - [2. PostgreSQL Only](#2-postgresql-only) - - [3. MySQL with Dashboard](#3-mysql-with-dashboard) - - [4. MySQL Only](#4-mysql-only) - - [5. With Monitoring](#5-with-monitoring) -- [Optional Components](#optional-components) -- [Configuration](#configuration) -- [Verifying Installation](#verifying-installation) +- [Build and Run from CLI (Cargo)](#build-and-run-from-cli-cargo) +- [Build and Run with Docker (Without Compose)](#build-and-run-with-docker-without-compose) +- [Helm Chart Deployment](#helm-chart-deployment) +- [Verification](#verification) +- [Common Commands](#common-commands) - [Troubleshooting](#troubleshooting) ---- - ## Prerequisites -### Common Requirements +- Docker 20+ +- Docker Compose v2+ +- Git 2+ -| Tool | Version | Purpose | -|------|---------|---------| -| Git | 2.0+ | Clone repository | -| Docker | 20.0+ | Container runtime | -| Docker Compose | 2.0+ | Multi-container orchestration | +Optional for source builds: +- Rust 1.85+ +- `just` (recommended) +- PostgreSQL/MySQL + Redis if running without Docker Compose -### Platform-Specific Dependencies +## Image Strategy -#### Ubuntu/Debian +Decision Engine supports two deployment tracks: -```bash -sudo apt-get update -sudo apt-get install -y pkg-config libssl-dev protobuf-compiler libpq-dev curl git -``` +1. `ghcr` track (recommended for on-prem): pulls pinned images from GHCR. +2. `local` track: builds images from your current local source. + +Default pinned tags: -#### macOS +- `DECISION_ENGINE_TAG=v1.3.4` +- `GROOVY_RUNNER_TAG=v1.3.4` + +Override example: ```bash -brew install pkg-config openssl protobuf postgresql curl git +export DECISION_ENGINE_TAG=v1.3.5 +export GROOVY_RUNNER_TAG=v1.3.5 ``` ---- - -## Quick Start +## Quick Start (Compose) ```bash git clone https://github.com/juspay/decision-engine.git cd decision-engine -docker compose --profile dashboard-postgres up -d + +# On-prem style run: GHCR pinned image + PostgreSQL +docker compose --profile postgres-ghcr up -d ``` -Access: -- **API**: http://localhost:8080/health -- **Dashboard**: http://localhost:8081/dashboard/ -- **Documentation**: http://localhost:8081/introduction +For dashboard + docs: ---- +```bash +docker compose --profile dashboard-postgres-ghcr up -d +``` ## Docker Compose Profiles -Profiles control which services are started. **You must specify at least one profile** - nothing runs by default. - -| Profile | Database | Dashboard | Redis | Services Started | -|---------|----------|-----------|-------|------------------| -| `postgres` | PostgreSQL | ❌ | ✅ | 4 services | -| `dashboard-postgres` | PostgreSQL | ✅ | ✅ | 6 services | -| `mysql` | MySQL | ❌ | ✅ | 5 services | -| `dashboard-mysql` | MySQL | ✅ | ✅ | 7 services | -| `monitoring` | N/A | Grafana | N/A | Prometheus + Grafana | -| `groovy` | N/A | N/A | N/A | Groovy Runner (optional) | +You must pass at least one profile. -### Combining Profiles +### Core runtime profiles -```bash -# PostgreSQL + Dashboard + Monitoring -docker compose --profile dashboard-postgres --profile monitoring up -d +| Profile | Image Source | DB | Includes | +|---|---|---|---| +| `postgres-ghcr` | GHCR | PostgreSQL | API + PostgreSQL + Redis + PG migrations | +| `postgres-local` | Local build | PostgreSQL | API + PostgreSQL + Redis + PG migrations | +| `mysql-ghcr` | GHCR | MySQL | API + MySQL + Redis + MySQL migrations + routing-config | +| `mysql-local` | Local build | MySQL | API + MySQL + Redis + MySQL migrations + routing-config | -# PostgreSQL + Groovy Runner -docker compose --profile postgres --profile groovy up -d +### Dashboard profiles -# MySQL + Dashboard + Monitoring + Groovy -docker compose --profile dashboard-mysql --profile monitoring --profile groovy up -d -``` +| Profile | Image Source | DB | Includes | +|---|---|---|---| +| `dashboard-postgres-ghcr` | GHCR | PostgreSQL | Core PG stack + Nginx dashboard + Mintlify docs | +| `dashboard-postgres-local` | Local build | PostgreSQL | Core PG stack + Nginx dashboard + Mintlify docs | +| `dashboard-mysql-ghcr` | GHCR | MySQL | Core MySQL stack + Nginx dashboard + Mintlify docs | +| `dashboard-mysql-local` | Local build | MySQL | Core MySQL stack + Nginx dashboard + Mintlify docs | ---- +### Optional profiles -## Setup Modes +| Profile | Description | +|---|---| +| `monitoring` | Prometheus + Grafana | +| `groovy-ghcr` | Groovy runner from GHCR (`GROOVY_RUNNER_TAG`) | +| `groovy-local` | Groovy runner built from local `groovy.Dockerfile` | -### 1. PostgreSQL with Dashboard (Recommended) - -Best for local development with web UI and documentation. +### Common combinations ```bash -docker compose --profile dashboard-postgres up -d -``` +# PostgreSQL (GHCR) + monitoring +docker compose --profile postgres-ghcr --profile monitoring up -d -**Services:** -| Service | Port | Description | -|---------|------|-------------| -| Decision Engine API | 8080 | Main REST API | -| Nginx Proxy | 8081 | Dashboard + Docs proxy | -| PostgreSQL | 5432 | Primary database | -| Redis | 6379 | Cache store | -| Mintlify Docs | 3000 (internal) | Documentation site | -| DB Migrator | N/A | Runs migrations | +# PostgreSQL (local build) + dashboard + docs +docker compose --profile dashboard-postgres-local up -d --build -**URLs:** -- API: http://localhost:8080/health -- Dashboard: http://localhost:8081/dashboard/ -- Docs: http://localhost:8081/introduction +# MySQL (GHCR) + dashboard + docs +docker compose --profile dashboard-mysql-ghcr up -d +``` -### 2. PostgreSQL Only +## Build and Run from CLI (Cargo) -Lightweight setup for API-only testing. +### PostgreSQL build ```bash -docker compose --profile postgres up -d +cargo build --release --no-default-features --features middleware,kms-aws,postgres ``` -**Services:** -| Service | Port | Description | -|---------|------|-------------| -| Decision Engine API | 8080 | Main REST API | -| PostgreSQL | 5432 | Primary database | -| Redis | 6379 | Cache store | -| DB Migrator | N/A | Runs migrations | - -**URL:** http://localhost:8080/health - -### 3. MySQL with Dashboard - -Alternative database with full UI stack. +Run migrations: ```bash -docker compose --profile dashboard-mysql up -d +just migrate-pg ``` -**Services:** -| Service | Port | Description | -|---------|------|-------------| -| Decision Engine API | 8080 | Main REST API | -| Nginx Proxy | 8081 | Dashboard + Docs proxy | -| MySQL | 3306 | Primary database | -| Redis | 6379 | Cache store | -| Mintlify Docs | 3000 (internal) | Documentation site | -| DB Migrator | N/A | MySQL migrations | -| Routing Config | N/A | Initial config setup | - -### 4. MySQL Only - -MySQL backend without dashboard. +Run service: ```bash -docker compose --profile mysql up -d +RUSTFLAGS="-Awarnings" cargo run --no-default-features --features postgres ``` -### 5. With Monitoring - -Add Prometheus metrics and Grafana dashboards to any profile. +### MySQL build ```bash -# With PostgreSQL dashboard -docker compose --profile dashboard-postgres --profile monitoring up -d - -# With MySQL only -docker compose --profile mysql --profile monitoring up -d +cargo build --release --features release ``` -**Additional Services:** -| Service | Port | Description | -|---------|------|-------------| -| Prometheus | 9090 | Metrics collection | -| Grafana | 3000 | Visualization dashboards | - ---- - -## Optional Components - -### Groovy Runner - -Enables Groovy scripting support (needed for dynamic routing rules). +Run service: ```bash -# Add to any profile -docker compose --profile postgres --profile groovy up -d +RUSTFLAGS="-Awarnings" cargo run --features release ``` -**Profile:** `groovy` (pre-built image) or `groovy-local` (build from source) - -**Port:** 8085 - ---- - -## Configuration +## Build and Run with Docker (Without Compose) -### Environment Variables - -Set in `docker-compose.yaml` or create `.env` file: +### Build images locally ```bash -# Database URLs -export DATABASE_URL="postgresql://db_user:db_pass@localhost:5432/decision_engine_db" +# MySQL-target binary image +docker build --platform=linux/amd64 -t decision-engine-mysql:local -f Dockerfile . -# Groovy Runner (if using) -export GROOVY_RUNNER_HOST="host.docker.internal:8085" +# PostgreSQL-target binary image +docker build --platform=linux/amd64 -t decision-engine-pg:local -f Dockerfile.postgres . ``` -### Configuration Files +### Run image -| File | Purpose | -|------|---------| -| `config/development.toml` | Local development settings | -| `config/docker-configuration.toml` | Docker deployment settings | +```bash +docker run --platform=linux/amd64 \ + -v $(pwd)/config/docker-configuration.toml:/local/config/development.toml \ + -p 8080:8080 \ + decision-engine-pg:local +``` ---- +## Helm Chart Deployment -## Verifying Installation +Chart location: `helm-charts/` -### Health Check +### Install with defaults ```bash -curl http://localhost:8080/health +cd helm-charts +helm dependency build +helm install my-release . ``` -Expected: `{"message":"Health is good"}` - -### API Test +### Pin GHCR tag explicitly ```bash -curl -X POST http://localhost:8080/decide-gateway \ - -H "Content-Type: application/json" \ - -d '{ - "merchantId": "test_merchant1", - "eligibleGatewayList": ["stripe", "adyen"], - "paymentInfo": { - "paymentId": "test_123", - "amount": 100.50, - "currency": "USD" - } - }' +helm install my-release . \ + --set image.repository=ghcr.io/juspay/decision-engine/postgres \ + --set image.version=v1.3.4 \ + --set image.pullPolicy=Always ``` -### Dashboard Access - -Open browser to: http://localhost:8081/dashboard/ - ---- +### Use local/private registry image -## Troubleshooting - -### Port Already in Use - -**Error:** `Port 8080 is already in use` - -**Solution:** ```bash -lsof -ti:8080 | xargs kill -9 -# or change ports in docker-compose.yaml +helm install my-release . \ + --set image.repository=/decision-engine/postgres \ + --set image.version= \ + --set image.pullPolicy=IfNotPresent ``` -### Container Conflicts - -**Error:** `container name "X" is already in use` +## Verification -**Solution:** ```bash -docker compose --profile down -docker system prune -f -docker compose --profile up -d +curl http://localhost:8080/health ``` -### Database Connection Failed +Expected response: -**Error:** `Connection refused` or `database does not exist` - -**Solutions:** - -1. Check database is running: - ```bash - docker ps | grep postgres - ``` +```json +{"message":"Health is good"} +``` -2. Verify migrations ran: - ```bash - docker logs db-migrator-postgres - ``` +Dashboard/docs (if dashboard profile is used): -3. Restart with fresh state: - ```bash - docker compose --profile postgres down -v - docker compose --profile postgres up -d - ``` +- Dashboard: `http://localhost:8081/dashboard/` +- Docs: `http://localhost:8081/introduction` -### Dashboard Shows Old Version +## Common Commands -The `website/dist` folder contains old build artifacts. +Make targets are aligned to ghcr/local tracks: -**Solution:** ```bash -cd website -npm install -npm run build -cd .. -docker restart open-router-nginx -``` +# GHCR tracks +make init-pg-ghcr +make init-mysql-ghcr -### Profile Not Found +# Local build tracks +make init-pg-local +make init-mysql-local -**Error:** `service "X" has neither an image nor a build context` - -**Cause:** Missing profile flag - -**Solution:** Always specify a profile: -```bash -# Wrong -docker compose up -d +# Run one API service (when infra is ready) +make run-pg-ghcr +make run-mysql-local -# Correct -docker compose --profile postgres up -d +# Stop everything +make stop ``` ---- +## Troubleshooting -## Stopping Services +### Port conflicts ```bash -# Stop specific profile -docker compose --profile dashboard-postgres down +lsof -ti:8080 | xargs kill -9 +lsof -ti:8081 | xargs kill -9 +``` -# Stop all profiles and remove volumes -docker compose --profile dashboard-postgres --profile monitoring down -v +### Recreate stack with clean volumes -# Clean up everything -docker system prune -af --volumes +```bash +docker compose --profile postgres-ghcr down -v +docker compose --profile postgres-ghcr up -d ``` ---- +### Verify migration jobs -## Next Steps - -- [API Reference](api-reference.md) -- [Configuration Guide](configuration.md) -- [MySQL Setup Guide](setup-guide-mysql.md) -- [PostgreSQL Setup Guide](setup-guide-postgres.md) +```bash +docker compose logs db-migrator-postgres +docker compose logs db-migrator +``` diff --git a/docs/setup-guide-mysql.md b/docs/setup-guide-mysql.md index 7b17c83e..ddd57a41 100644 --- a/docs/setup-guide-mysql.md +++ b/docs/setup-guide-mysql.md @@ -1,247 +1,47 @@ -# Setup Instructions: +# MySQL Setup Guide -Follow the steps below to set up and run the project locally. +This page provides MySQL-focused commands. The full end-to-end setup (CLI, Docker, Compose, Helm) is in [local-setup.md](local-setup.md). -## 1. Clone the Repository +## Docker Compose (GHCR track) ```bash -git clone https://github.com/juspay/decision-engine.git -cd decision-engine +export DECISION_ENGINE_TAG=v1.3.4 +docker compose --profile mysql-ghcr up -d ``` ---- -## 2. Install Docker - -Make sure Docker is installed on your system. -You can download and install Docker Desktop from the below links. - -- Mac - https://docs.docker.com/desktop/setup/install/mac-install/ -- Windows - https://docs.docker.com/desktop/setup/install/windows-install/ -- Linux - https://docs.docker.com/desktop/setup/install/linux/ - ---- - -## 3. Run the Project - -### a. First-Time Setup - -If you're setting up the environment for the first time, run: - -```bash -make init -``` - -To build it with postgres DB use this instead -``` -make init-pg -``` - -This command performs the following under the hood: - -```bash -docker-compose run --rm db-migrator && docker-compose up open-router -``` -This will: -- Set up the environment -- Set up the database with the required schema -- Sets up redis and the server for running the application -- Push the configs defined in the config.yaml & the static rules defined for routing in priority_logic.txt to the DB - -### b. Start the Server (without resetting DB) - -If the DB schema is already set up and you don't want to reset the DB, use: - -```bash -make run -``` -**System Requirements:** Approximately 2GB of disk space - -After successful setup, the server will start running. -### c. Update Configs / Static Rules - -To update the configs (from the config.yaml file) or the static rules (from priority_logic.txt), run: - -```bash -make update-config -``` - -### d. Stop Running Instances - -To stop the running Docker instances: +With dashboard + docs: ```bash -make stop +docker compose --profile dashboard-mysql-ghcr up -d ``` ---- - -## 4. Running Local Code Changes - -If you've made changes to the code locally and want to test them: - -### a. Initialize Local Environment +## Docker Compose (Local build track) ```bash -make init-local +docker compose --profile mysql-local up -d --build ``` -This command performs the following under the hood: +With dashboard + docs: ```bash -docker-compose run --rm db-migrator && docker-compose up open-router-local +docker compose --profile dashboard-mysql-local up -d --build ``` -### b. Run Locally +## Make targets ```bash -make run-local +make init-mysql-ghcr +make init-mysql-local ``` -## Using the Decision Engine APIs - -image - -### 1. Get the Gateway Decision - -Use the following cURL with payment info to get the gateway-decision: +## Verify ```bash -curl --location 'http://localhost:8080/decide-gateway' \ ---header 'Content-Type: application/json' \ ---data '{ - "merchantId": "test_merchant1", - "eligibleGatewayList": ["PAYU", "RAZORPAY", "PAYTM_V2"], - "rankingAlgorithm": "SR_BASED_ROUTING", - "eliminationEnabled": true, - "paymentInfo": { - "paymentId": "PAY12345", - "amount": 100.50, - "currency": "USD", - "customerId": "CUST12345", - "udfs": null, - "preferredGateway": null, - "paymentType": "ORDER_PAYMENT", - "metadata": null, - "internalMetadata": null, - "isEmi": false, - "emiBank": null, - "emiTenure": null, - "paymentMethodType": "UPI", - "paymentMethod": "UPI_PAY", - "paymentSource": null, - "authType": null, - "cardIssuerBankName": null, - "cardIsin": null, - "cardType": null, - "cardSwitchProvider": null - } -}' +curl http://localhost:8080/health ``` -#### Response Example +Expected response: ```json -{ - "decided_gateway": "PAYTM_V2", - "gateway_priority_map": { - "PAYU": 1.0, - "RAZORPAY": 1.0, - "PAYTM_V2": 1.0 - }, - "filter_wise_gateways": null, - "priority_logic_tag": "PL_TEST", - "routing_approach": "PRIORITY_LOGIC", - "gateway_before_evaluation": "RAZORPAY", - "priority_logic_output": { - "isEnforcement": false, - "gws": [], - "priorityLogicTag": "PL_TEST", - "gatewayReferenceIds": {}, - "primaryLogic": { - "name": "PL_TEST", - "status": "SUCCESS", - "failure_reason": "NO_ERROR" - }, - "fallbackLogic": null - }, - "reset_approach": "NO_RESET", - "routing_dimension": "ORDER_PAYMENT, UPI, UPI_PAY", - "routing_dimension_level": "PM_LEVEL", - "is_scheduled_outage": false, - "gateway_mga_id_map": null -} +{"message":"Health is good"} ``` - -### 2. Update Gateway Score - -This will update the decision-engine with the transaction status to optimize for future decisions: - -```bash -curl --location 'http://localhost:8080/update-gateway-score' \ ---header 'Content-Type: application/json' \ ---data '{ - "merchantId": "test_merchant1", - "gateway": "PAYU", - "gatewayReferenceId": null, - "status": "PENDING_VBV", - "paymentId": "123" -}' -``` - -## Glossary - -### Gateway Decision API Parameters - -| Parameter | Description | -|-----------|-------------| -| `merchantId` | Unique identifier assigned to the merchant using the API | -| `eligibleGatewayList` | List of gateways eligible to process the transaction | -| `rankingAlgorithm` | Specifies the routing algorithm to use (`SR_BASED_ROUTING` or `PL_BASED_ROUTING`) | -| `eliminationEnabled` | Boolean flag to enable/disable downtime detection in routing decisions | - -#### Payment Info Parameters - -| Parameter | Description | -|-----------|-------------| -| `paymentId` | Unique identifier for the transaction (mandatory) | -| `amount` | Transaction amount to be processed | -| `currency` | Currency code for the transaction (e.g., INR, USD) | -| `paymentType` | Indicates payment purpose (e.g., `ORDER_PAYMENT`, `MANDATE_REGISTER`, `EMANDATE_REGISTER`) | -| `paymentMethodType` | Type of payment method (e.g., `CARD`, `UPI`, `WALLET`, `NET BANKING`) | -| `paymentMethod` | Specific subcategory within the chosen paymentMethodType | - -### Response Fields - -| Field | Description | -|-------|-------------| -| `decided_gateway` | The gateway chosen by the decision engine for routing the transaction | -| `gateway_priority_map` | Scores for each gateway used in making the routing decision | -| `filter_wise_gateways` | List of eligible connectors (if Eligibility Check/Orchestration is used) | -| `priority_logic_tag` | Unique identifier for the specific Static Rule defined in the YAML file | -| `routing_approach` | The specific routing approach used for processing the transaction | -| `gateway_before_evaluation` | The gateway decided before downtime evaluation | -| `routing_dimension` | The dimensions on which routing decisions are made | -| `routing_dimension_level` | The level at which routing decisions are made (e.g., `PM_LEVEL`) | -| `is_scheduled_outage` | Returns true if the routing decision is impacted by scheduled outages | - -### Update Gateway Score Parameters - -| Parameter | Description | -|-----------|-------------| -| `merchantId` | Unique identifier assigned to the merchant using the API | -| `gateway` | The gateway to which the transaction was routed | -| `gatewayReferenceId` | Reference ID from the gateway | -| `status` | Transaction status used to update the routing score | -| `paymentId` | Unique identifier for the transaction | - -### Configuration YAML Parameters - -| Parameter | Description | -|-----------|-------------| -| `merchant_id` | Unique identifier assigned to the merchant | -| `priority_logic.script` | The file name in which static rules are defined | -| `priority_logic.tag` | Unique identifier for a static rule defined | -| `elimination_config.threshold` | PG health threshold (PGs below this are deprioritized) | -| `defaultBucketSize` | Last 'n' transactions to consider for computing SR scores | -| `defaultHedgingPercent` | Percentage of traffic for exploration of lower-ranked gateways | -| `subLevelInputConfig` | Define granular configs at PMT/PM level | diff --git a/docs/setup-guide-postgres.md b/docs/setup-guide-postgres.md index 187fd616..451df396 100644 --- a/docs/setup-guide-postgres.md +++ b/docs/setup-guide-postgres.md @@ -1,195 +1,47 @@ -# PostgreSQL Setup Guide for Decision Engine +# PostgreSQL Setup Guide -This guide provides instructions on how to set up the Decision Engine with PostgreSQL as the database. There are several ways to achieve this, depending on your preference for using Docker or a local PostgreSQL installation. +This page provides PostgreSQL-focused commands. The full end-to-end setup (CLI, Docker, Compose, Helm) is in [local-setup.md](local-setup.md). -## Prerequisites +## Docker Compose (GHCR track) -Before you begin, ensure you have the necessary tools installed based on your chosen setup method. +```bash +export DECISION_ENGINE_TAG=v1.3.4 +docker compose --profile postgres-ghcr up -d +``` -**Common Tools (potentially needed for all methods):** +With dashboard + docs: -* A text editor or IDE for viewing/editing configuration files. -* Git for cloning the project repository. -* Rust and Cargo: Essential to build and run the Decision Engine application from source directly on your host machine. +```bash +docker compose --profile dashboard-postgres-ghcr up -d +``` -**For All Docker-Based Setups:** +## Docker Compose (Local build track) -* **Docker and Docker Compose**: Essential for running the application and database in containers. +```bash +docker compose --profile postgres-local up -d --build +``` +With dashboard + docs: -**For Full Local Development Setup:** +```bash +docker compose --profile dashboard-postgres-local up -d --build +``` -* **PostgreSQL**: Needed if you are managing a local PostgreSQL instance directly (e.g., for creating databases, running `just resurrect`). -* **Just**: A command runner used for some of the local setup scripts (e.g., `just resurrect`, `just migrate-pg`). You can install it by following the instructions [here](https://github.com/casey/just#installation). -* **Diesel CLI (with PostgreSQL feature)**: Required for managing database migrations when running against a local PostgreSQL database. Install using: +## Make targets - ```bash - cargo install diesel_cli --no-default-features --features postgres - ``` +```bash +make init-pg-ghcr +make init-pg-local +``` -## Setup Options +## Verify -Choose one of the following methods to set up the Decision Engine with PostgreSQL: +```bash +curl http://localhost:8080/health +``` -### 1. Using Pre-built Docker Image (Recommended for quick setup) +Expected response: -This method uses pre-built Docker images for both the application and the PostgreSQL database. It's the simplest way to get started. - -**Steps:** - -1. Navigate to the root directory of the `decision-engine` project. -2. Run the following command: - - ```bash - make init-pg - ``` - - This command will: - * Pull the necessary Docker images. - * Start a PostgreSQL container. - * Run database migrations using a `db-migrator-postgres` service defined in `docker-compose.yaml`. - * Start the Decision Engine application container (`open-router-pg`), configured to connect to the PostgreSQL database. - -The application should now be running and accessible. - -### 2. Using Local Changes with PostgreSQL in Docker - -This method is useful if you are making changes to the Decision Engine codebase and want to test them with a PostgreSQL database running in Docker. - -**Steps:** - -1. Navigate to the root directory of the `decision-engine` project. -2. Run the following command: - - ```bash - make init-local-pg - ``` - - This command will: - * Start a PostgreSQL container. - * Run database migrations using the `db-migrator-postgres` service. - * Build the Decision Engine application from your local source code within a Docker container (`open-router-local-pg`). - * Start the newly built application container, connected to the PostgreSQL database. - -This allows you to test your local code changes in an environment where PostgreSQL is managed by Docker. - -### 3. Using Local Changes with a Local PostgreSQL Installation - -This method is for developers who have PostgreSQL installed and running directly on their local machine (not in Docker). - -**Steps:** - -1. **Ensure PostgreSQL is Running:** - Make sure your local PostgreSQL server is running and accessible. - -2. **Set up Environment Variables (Optional but Recommended):** - The application and `diesel` CLI use environment variables to connect to the database. - - The `Justfile` provides defaults if these are not set: - * `DB_USER` (default: `db_user`) - * `DB_PASSWORD` (default: `db_pass`) - * `DB_HOST` (default: `localhost`) - * `DB_PORT` (default: `5432`) - * `DB_NAME` (default: `decision_engine_db`) - * `DATABASE_URL` (derived default: `postgresql://db_user:db_pass@localhost:5432/decision_engine_db`) - - **Example of exporting variables in your shell (using default values):** - ```bash - export DB_USER="db_user" - export DB_PASSWORD="db_pass" - export DB_HOST="localhost" - export DB_PORT="5432" - export DB_NAME="decision_engine_db" - # DATABASE_URL will be constructed by the application or Justfile if not set, - ``` -3. **Drop Database if Exist:** - - ```bash - just resurrect - ``` - This command will drop the Database and create a new one. -4. **Run Database Migrations:** - Apply the database schema migrations to your local PostgreSQL database: - - ```bash - just migrate-pg - ``` - This command uses `diesel migration run` with the PostgreSQL specific migration directory (`migrations_pg`) and configuration file (`diesel_pg.toml`). - -5. **Run the Application:** - Compile and run the Decision Engine application, ensuring it's built with PostgreSQL features: - ```bash - RUSTFLAGS="-Awarnings" cargo run --no-default-features --features postgres - ``` - * `RUSTFLAGS="-Awarnings"`: Suppresses warnings during compilation (optional). - * `--no-default-features --features postgres`: Ensures the application is compiled specifically for PostgreSQL, excluding default features (like MySQL support if it's a default) and including the `postgres` feature. - -The application will start and connect to your local PostgreSQL database. - -## Configuration - -The database connection URL is typically configured in: - -* `config/development.toml` (for local cargo runs) -* `config/docker-configuration.toml` (often mapped into Docker containers) - -Ensure the `[database.url]` points to your PostgreSQL instance. For example: -`url = "postgresql://db_user:db_pass@localhost:5432/decision_engine_db"` - -For Docker setups (`make init-pg`, `make init-local-pg`), the `docker-compose.yaml` file handles the service linking and environment variables to ensure the application container can connect to the PostgreSQL container (usually aliased as `postgres` or a similar hostname within the Docker network). - -## Troubleshooting - -* **Connection Issues:** - * Verify `DATABASE_URL` is correct and the PostgreSQL server is accessible from where the application is running (your local machine or Docker container). - * Check PostgreSQL logs for any connection errors. - * Ensure firewalls are not blocking the connection. -* **Migration Failures:** - * Check `diesel_pg.toml` for correct configuration. - * Ensure the migration files in `migrations_pg/` are correctly formatted. - * If you encounter issues with a "dirty" database state after a failed migration, you might need to manually resolve it in the database or use `diesel migration redo` (with caution). -* **`just` command not found:** - * Install `just` by following its official installation guide. -* **`diesel` command not found:** - * Install `diesel_cli` with PostgreSQL support: `cargo install diesel_cli --no-default-features --features postgres`. - -This guide should help you get the Decision Engine up and running with PostgreSQL. - - -# Metrics - -This document provides an overview of the metrics implementation in the routing layer. - -## Overview - -The metrics server is responsible for exposing key performance indicators of the application. It uses the `prometheus` crate to register and expose metrics in a format that can be scraped by a Prometheus server. - -## How it works - -The metrics server is built using `axum` and runs on a separate port from the main application server. It exposes a `/metrics` endpoint that returns the current state of all registered metrics. - -The server is initialized in the `metrics_server_builder` function in `src/metrics.rs`. This function creates a new `axum` router and binds it to the address specified in the configuration. - -## Available Metrics - -The following metrics are exposed by the server: - -### Counters - -- `api_requests_total`: A counter that tracks the total number of API requests received by the application. It has a single label, `endpoint`, which is the path of the API endpoint that was called. - -- `api_requests_by_status`: A counter that tracks the number of API requests grouped by endpoint and result status. It has two labels: `endpoint` and `status`. - -### Histograms - -- `api_latency_seconds`: A histogram that measures the latency of API calls. It has a single label, `endpoint`, and uses exponential buckets to provide a detailed view of the latency distribution. - -## How to check metrics - -To check the metrics, you can hit the following endpoint: - -```sh -curl http://127.0.0.1:9090/metrics -```` - -This will return a text-based representation of the current metrics, which can be ingested by a Prometheus server. +```json +{"message":"Health is good"} +``` diff --git a/docs/setup-guide.md b/docs/setup-guide.md index 89012211..90b30f7d 100644 --- a/docs/setup-guide.md +++ b/docs/setup-guide.md @@ -1,167 +1,11 @@ -# Installation Guide +# Setup Guide -This guide provides detailed instructions for installing Dynamo on different platforms. +This page has been consolidated. -## Prerequisites +Use the canonical guide: -- Rust 1.78.0 or later -- Redis server 6.0 or later -- Git +- [Local Setup Guide](local-setup.md) -## From Source - -### 1. Clone the Repository - -```bash -git clone https://github.com/yourusername/dynamo.git -cd dynamo -``` - -### 2. Install Dependencies - -#### Ubuntu/Debian - -```bash -# Install system dependencies -sudo apt-get update -sudo apt-get install -y pkg-config libssl-dev protobuf-compiler libpq-dev - -# Install Rust (if not already installed) -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -source $HOME/.cargo/env -``` - -#### macOS - -```bash -# Using Homebrew -brew install pkg-config openssl protobuf postgresql - -# Install Rust (if not already installed) -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -source $HOME/.cargo/env -``` - -### 3. Build Dynamo - -```bash -# Build in release mode -cargo build --release -``` - -### 4. Set Up Configuration - -```bash -# Copy example configuration -cp config/config.example.toml config/development.toml - -# Edit configuration as needed -# vi config/development.toml -``` - -### 5. Run Redis - -Make sure Redis is running on your system: - -```bash -# Install Redis if needed -sudo apt-get install redis-server # Ubuntu/Debian -brew install redis # macOS - -# Start Redis server -redis-server -``` - -### 6. Run Dynamo - -```bash -# Run with development configuration -./target/release/dynamo -``` - -## Using Docker - -### 1. Pull the Docker Image - -```bash -docker pull yourusername/dynamo:latest -``` - -Or build it yourself: - -```bash -docker build -t dynamo:latest . -``` - -### 2. Run with Docker - -```bash -# Run with default configuration -docker run -p 8000:8000 -p 9000:9000 dynamo:latest - -# Run with custom configuration -docker run -p 8000:8000 -p 9000:9000 \ - -v $(pwd)/config:/app/config \ - dynamo:latest -``` - -### 3. Docker Compose Setup - -Create a `docker-compose.yml` file: - -```yaml -version: '3' -services: - dynamo: - image: yourusername/dynamo:latest - ports: - - "8000:8000" - - "9000:9000" - volumes: - - ./config:/app/config - depends_on: - - redis - - redis: - image: redis:latest - ports: - - "6379:6379" -``` - -Run with Docker Compose: - -```bash -docker-compose up -d -``` - -## Building the WebAssembly Module - -The `procesmo` module can be built for web use: - -```bash -# Install wasm-pack if needed -cargo install wasm-pack - -# Build the WebAssembly module -cd crates/procesmo -wasm-pack build --target web -``` - -## Verifying Installation - -To verify that Dynamo is running correctly: - -```bash -# Check health status -curl http://localhost:8000/grpc.health.v1.Health/Check - -# Or using grpcurl -grpcurl -plaintext localhost:8000 grpc.health.v1.Health/Check -``` - -You should see a response indicating the service is running. - -## Next Steps - -- [Configure Dynamo](configuration.md) for your environment -- [Explore the API](api-reference.md) +For database-specific walkthroughs: +- [PostgreSQL Setup Guide](setup-guide-postgres.md) +- [MySQL Setup Guide](setup-guide-mysql.md) diff --git a/helm-charts/README.md b/helm-charts/README.md index e2531b15..40d28734 100644 --- a/helm-charts/README.md +++ b/helm-charts/README.md @@ -60,6 +60,24 @@ Then, to install the chart with the release name `my-release`: helm install my-release . ``` +To pin a specific on-prem image version (for example `v1.3.4`): + +```bash +helm install my-release . \ + --set image.repository=ghcr.io/juspay/decision-engine/postgres \ + --set image.version=v1.3.4 \ + --set image.pullPolicy=Always +``` + +To use an internal/private registry: + +```bash +helm install my-release . \ + --set image.repository=/decision-engine/postgres \ + --set image.version= \ + --set image.pullPolicy=IfNotPresent +``` + The command deploys Decision Engine on the Kubernetes cluster with the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation. ## Uninstalling the Chart @@ -77,8 +95,8 @@ helm delete my-release | Name | Description | Value | |---------------------|---------------------------------------------------------------------------------------|-----------------| | `replicaCount` | Number of Decision Engine replicas | `1` | -| `image.repository` | Decision Engine image repository | `decision-engine` | -| `image.version` | Decision Engine image tag | `latest` | +| `image.repository` | Decision Engine image repository | `ghcr.io/juspay/decision-engine/postgres` | +| `image.version` | Decision Engine image tag | `v1.2.0` | | `image.pullPolicy` | Decision Engine image pull policy | `Always` | | `imagePullSecrets` | Image pull secrets | `[]` | | `nameOverride` | Override the name of the chart | `""` | @@ -136,8 +154,8 @@ helm delete my-release | Name | Description | Value | |-----------------------------------------|------------------------------------------------------------|-----------------| | `groovyRunner.enabled` | Deploy Groovy Runner | `true` | -| `groovyRunner.image.repository` | Groovy Runner image repository | `"groovy-runner"` | -| `groovyRunner.image.version` | Groovy Runner image tag | `"latest"` | +| `groovyRunner.image.repository` | Groovy Runner image repository | `"ghcr.io/juspay/decision-engine/groovy-runner"` | +| `groovyRunner.image.version` | Groovy Runner image tag | `"v1.0.0"` | | `groovyRunner.image.pullPolicy` | Groovy Runner image pull policy | `"Always"` | | `groovyRunner.service.port` | Groovy Runner service port | `8085` | | `groovyRunner.resources` | Groovy Runner resources | `{}` | diff --git a/helm-charts/config/development.toml b/helm-charts/config/development.toml deleted file mode 100644 index 463762f6..00000000 --- a/helm-charts/config/development.toml +++ /dev/null @@ -1,740 +0,0 @@ -[log.console] -enabled = true -level = "DEBUG" -log_format = "json" - -[server] -host = "127.0.0.1" -port = 8080 - -[metrics] -host = "127.0.0.1" -port = 9094 - -[limit] -request_count = 1 -duration = 60 - -[database] -username = "root" -password = "root" -host = "127.0.0.1" -port = 3306 -dbname = "jdb" - -[pg_database] -pg_username = "db_user" -pg_password = "db_pass" -pg_host = "localhost" -pg_port = 5432 -pg_dbname = "decision_engine_db" - - -[redis] -host = "127.0.0.1" -port = 6379 -pool_size = 5 -reconnect_max_attempts = 5 -reconnect_delay = 5 -use_legacy_version = false -stream_read_count = 1 -auto_pipeline = true -disable_auto_backpressure = false -max_in_flight_commands = 5000 -default_command_timeout = 30 -unresponsive_timeout = 10 -max_feed_count = 200 - -[cache] -tti = 7200 # i.e. 2 hours -max_capacity = 5000 - -[cache_config] -service_config_redis_prefix = "DE_service_config_" -service_config_ttl = 300 # 5 minutes - -[compression_filepath] -zstd_compression_filepath = "/tmp/extra-paths/redis-zstd-dictionaries/sbx" - -[secrets] -open_router_private_key = "" - -[tenant_secrets] -public = { master_key = "", public_key = "", schema = "public" } - -[routing_config.keys] -billing_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } -issuer_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } -business_country = { type = "enum", values = "Afghanistan, AlandIslands, Albania, Algeria, AmericanSamoa, Andorra, Angola, Anguilla, Antarctica, AntiguaAndBarbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, BoliviaPlurinationalState, BonaireSintEustatiusAndSaba, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, BritishIndianOceanTerritory, BruneiDarussalam, Bulgaria, BurkinaFaso, Burundi, CaboVerde, Cambodia, Cameroon, Canada, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Congo, CongoDemocraticRepublic, CookIslands, CostaRica, CotedIvoire, Croatia, Cuba, Curacao, Cyprus, Czechia, Denmark, Djibouti, Dominica, DominicanRepublic, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Eritrea, Estonia, Ethiopia, FalklandIslandsMalvinas, FaroeIslands, Fiji, Finland, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, IranIslamicRepublic, Iraq, Ireland, IsleOfMan, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, KoreaDemocraticPeoplesRepublic, KoreaRepublic, Kuwait, Kyrgyzstan, LaoPeoplesDemocraticRepublic, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, MacedoniaTheFormerYugoslavRepublic, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, MarshallIslands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, MicronesiaFederatedStates, MoldovaRepublic, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, NorthernMarianaIslands, Norway, Oman, Pakistan, Palau, PalestineState, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, PuertoRico, Qatar, Reunion, Romania, RussianFederation, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristandaCunha, SaintKittsAndNevis, SaintLucia, SaintMartinFrenchpart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, Samoa, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, SintMaartenDutchpart, Slovakia, Slovenia, SolomonIslands, Somalia, SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands, SouthSudan, Spain, SriLanka, Sudan, Suriname, SvalbardAndJanMayen, Swaziland, Sweden, Switzerland, SyrianArabRepublic, TaiwanProvinceOfChina, Tajikistan, TanzaniaUnitedRepublic, Thailand, TimorLeste, Togo, Tokelau, Tonga, TrinidadAndTobago, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdomOfGreatBritainAndNorthernIreland, UnitedStatesOfAmerica, UnitedStatesMinorOutlyingIslands, Uruguay, Uzbekistan, Vanuatu, VenezuelaBolivarianRepublic, Vietnam, VirginIslandsBritish, VirginIslandsUS, WallisAndFutuna, WesternSahara, Yemen, Zambia, Zimbabwe" } -business_label = { type = "str_value" } -metadata = { type = "udf" } -pay_later = { type = "enum", values = "affirm, alma, afterpay_clearpay, klarna, pay_bright, atome, walley" } -gift_card = { type = "enum", values = "givex, pay_safe_card" } -upi = { type = "enum", values = "upi_collect, upi_intent" } -wallet = { type = "enum", values = "amazon_pay, apple_pay, google_pay, paypal, ali_pay, ali_pay_hk, dana, mb_way, mobile_pay, samsung_pay, twint, vipps, touch_n_go, swish, we_chat_pay, go_pay, gcash, momo, kakao_pay, cashapp, mifinity, paze" } -voucher = { type = "enum", values = "boleto, efecty, pago_efectivo, red_compra, red_pagos, indomaret, alfamart, oxxo, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy" } -bank_transfer = { type = "enum", values = "ach, sepa, sepa_bank_transfer, bacs, multibanco, pix, pse, permata_bank_transfer, bca_bank_transfer, bni_va, bri_va, cimb_va, danamon_va, mandiri_va, local_bank_transfer, instant_bank_transfer" } -bank_redirect = { type = "enum", values = "giropay, ideal, sofort, eft, eps, bancontact_card, blik, local_bank_redirect, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, przelewy24, trustly, bizum, interac, open_banking_uk, open_banking_pis" } -customer_device_display_size = { type = "enum", values = "size320x568, size375x667, size390x844, size414x896, size428x926, size768x1024, size834x1112, size834x1194, size1024x1366, size1280x720, size1366x768, size1440x900, size1920x1080, size2560x1440, size3840x2160, size500x600, size600x400, size360x640, size412x915, size800x1280" } -customer_device_type = { type = "enum", values = "mobile, tablet, desktop, gaming_console" } -customer_device_platform = { type = "enum", values = "web, android, ios" } -bank_debit = { type = "enum", values = "ach, sepa, bacs, becs" } -crypto = { type = "enum", values = "crypto_currency" } -reward = { type = "enum", values = "evoucher, classic_reward" } -card_redirect = { type = "enum", values = "knet, benefit, momo_atm, card_redirect" } -real_time_payment = { type = "enum", values = "fps, duit_now, prompt_pay, viet_qr" } -open_banking = { type = "enum", values = "open_banking_pis" } -mobile_payment = { type = "enum", values = "direct_carrier_billing" } -payment_method = { type = "enum", values = "card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment" } -card_type = { type = "enum", values = "debit, credit" } -card = { type = "enum", values = "debit, credit" } -payment_card_bin = { type = "udf", exact_length = 6, regex = "^[0-9]{6}$" } -issuer_name = { type = "str_value", min_length = 1 } -payment_card_type = { type = "enum", values = "CREDIT, DEBIT" } -mandate_acceptance_type = { type = "enum", values = "online, offline" } -mandate_type = { type = "enum", values = "single_use, multi_use" } -card_network = { type = "enum", values = "visa, VISA, Visa, visaCard, mastercard, MASTERCARD, MasterCard, masterCard, mastercardCard, master_card, Master_card, Master_Card, Master Card, Mastercard, american_express, AMERICANEXPRESS, AmericanExpress, americanExpress, americanExpressCard, amex, AMEX, Amex, jcb, JCB, Jcb, diners_club, DINERSCLUB, DinersClub, dinersClub, dinersClubCard, discover, DISCOVER, Discover, discoverCard, cartes_bancaires, CARTESBANCAIRES, CartesBancaires, cartesBancaires, union_pay, UNIONPAY, UnionPay, unionPay, interac, INTERAC, Interac, rupay, RUPAY, RuPay, ruPay, maestro, MAESTRO, Maestro, star, STAR, Star, pulse, PULSE, Pulse, accel, ACCEL, Accel, nyce, NYCE, Nyce" } -payment_type = { type = "enum", values = "normal, new_mandate, setup_mandate, recurring_mandate, non_mandate" } -payment_method_type = { type = "enum", values = "ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, boleto, bca_bank_transfer, bni_va, bri_va, card, card_redirect, cimb_va, classic_reward, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eft, eps, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, multibanco, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, paypal, paze, pix, pay_safe_card, przelewy24, prompt_pay, pse, red_compra, red_pagos, samsung_pay, sepa, sepa_bank_transfer, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, direct_carrier_billing, instant_bank_transfer" } -authentication_type = { type = "enum", values = "three_ds, no_three_ds" } -capture_methods = { type = "enum", values = "automatic, manual, manual_multiple, scheduled, sequential_automatic" } -setup_future_usage = { type = "enum", values = "on_session, off_session" } -payment_card_network = { type = "enum", values = "visa, mastercard, american_express, jcb, diners_club, discover, cartes_bancaires, union_pay, interac, rupay, maestro" } -amount = { type = "integer", min = 0 } -login_date = { type = "str_value" } -currency = { type = "enum", values = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } -payment_card_issuer_country = { type = "enum", values = "AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, US" } - -card_bin = { type = "str_value", exact_length = 6, regex = "^[0-9]{6}$" } -extended_card_bin = { type = "str_value", exact_length = 8, regex = "^[0-9]{8}$" } -capture_method = { type = "enum", values = "automatic, manual" } -new_customer = { type = "udf" } -udf1 = { type = "str_value" } -order_udf1 = { type = "global_ref" } -payment_payment_method = { type = "enum", values = "NB_HDFC, NB_ICICI, NB_SBI" } -payment_payment_source = { type = "enum", values = "net.one97.paytm, @paytm" } -txn_is_emi = { type = "enum", values = "true, false" } -transaction_initiator = { type = "enum", values = "customer, merchant" } -network_token = { type = "enum", values = "network_token" } -card_discovery = { type = "enum", values = "manual, saved_card, click_to_pay" } - -[routing_config.default] -output = [] - -[debit_routing_config] -fraud_check_fee = 1.0 - -[debit_routing_config.network_fee] -visa = { percentage = 0.1375, fixed_amount = 2.0 } -mastercard = { percentage = 0.15, fixed_amount = 4.0 } -accel = { percentage = 0.0, fixed_amount = 4.0 } -nyce = { percentage = 0.10, fixed_amount = 1.5 } -pulse = { percentage = 0.10, fixed_amount = 3.0 } -star = { percentage = 0.10, fixed_amount = 1.5 } - -[debit_routing_config.interchange_fee] -regulated = { percentage = 0.05, fixed_amount = 0.21 } - -[debit_routing_config.interchange_fee.non_regulated] -merchant_category_code_0001.visa = { percentage = 1.65, fixed_amount = 15.0 } -merchant_category_code_0001.mastercard = { percentage = 1.65, fixed_amount = 15.0 } -merchant_category_code_0001.accel = { percentage = 1.55, fixed_amount = 4.0 } -merchant_category_code_0001.nyce = { percentage = 1.30, fixed_amount = 21.3125 } -merchant_category_code_0001.pulse = { percentage = 1.60, fixed_amount = 15.0 } -merchant_category_code_0001.star = { percentage = 1.63, fixed_amount = 15.0 } - -[pm_filters.default] -google_pay = { country = "AL,DZ,AS,AO,AG,AR,AU,AT,AZ,BH,BY,BE,BR,BG,CA,CL,CO,HR,CZ,DK,DO,EG,EE,FI,FR,DE,GR,HK,HU,IN,ID,IE,IL,IT,JP,JO,KZ,KE,KW,LV,LB,LT,LU,MY,MX,NL,NZ,NO,OM,PK,PA,PE,PH,PL,PT,QA,RO,RU,SA,SG,SK,ZA,ES,LK,SE,CH,TW,TH,TR,UA,AE,GB,US,UY,VN" } -apple_pay = { country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US,KR,VN,MA,ZA,VA,CL,SV,GT,HN,PA", currency = "AED,AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" } -paypal = { currency = "AUD,BRL,CAD,CHF,CNY,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,MYR,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD" } -klarna = { country = "AT,BE,DK,FI,FR,DE,IE,IT,NL,NO,ES,SE,GB,US,CA", currency = "USD,GBP,EUR,CHF,DKK,SEK,NOK,AUD,PLN,CAD" } -affirm = { country = "US", currency = "USD" } -afterpay_clearpay = { country = "US,CA,GB,AU,NZ", currency = "GBP,AUD,NZD,CAD,USD" } -giropay = { country = "DE", currency = "EUR" } -eps = { country = "AT", currency = "EUR" } -sofort = { country = "ES,GB,SE,AT,NL,DE,CH,BE,FR,FI,IT,PL", currency = "EUR" } -ideal = { country = "NL", currency = "EUR" } - -[pm_filters.stripe] -google_pay = { country = "AU, AT, BE, BR, BG, CA, HR, CZ, DK, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IT, JP, LV, KE, LT, LU, MY, MX, NL, NZ, NO, PL, PT, RO, SG, SK, ZA, ES, SE, CH, TH, AE, GB, US, GI, LI, MT, CY, PH, IS, AR, CL, KR, IL"} -apple_pay = { country = "AU, AT, BE, BR, BG, CA, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, HK, IE, IT, JP, LV, LI, LT, LU, MT, MY, MX, NL, NZ, NO, PL, PT, RO, SK, SG, SI, ZA, ES, SE, CH, GB, AE, US" } -klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,CAD,CHF,CZK,DKK,EUR,GBP,NOK,NZD,PLN,SEK,USD" } -credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI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SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"} -affirm = { country = "US", currency = "USD" } -afterpay_clearpay = { country = "US,CA,GB,AU,NZ,FR,ES", currency = "USD,CAD,GBP,AUD,NZD" } -cashapp = { country = "US", currency = "USD" } -eps = { country = "AT", currency = "EUR" } -giropay = { country = "DE", currency = "EUR" } -ideal = { country = "NL", currency = "EUR" } -multibanco = { country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GI,GR,HU,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB", currency = "EUR" } -ach = { country = "US", currency = "USD" } -revolut_pay = { currency = "EUR,GBP" } -sepa = {country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GI,GR,HU,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GB,IS,LI", currency="EUR"} -bacs = { country = "GB", currency = "GBP" } -becs = { country = "AU", currency = "AUD" } -sofort = {country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IS,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE", currency = "EUR" } -blik = {country="PL", currency = "PLN"} -bancontact_card = { country = "BE", currency = "EUR" } -przelewy24 = { country = "PL", currency = "EUR,PLN" } -online_banking_fpx = { country = "MY", currency = "MYR" } -amazon_pay = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW,US", currency = "USD,AUD,GBP,DKK,EUR,HKD,JPY,NZD,NOK,ZAR,SEK,CHF" } -we_chat_pay = { country = "CN", currency = "CNY,AUD,CAD,EUR,GBP,HKD,JPY,SGD,USD,DKK,NOK,SEK,CHF" } -ali_pay = {country = "CN", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,MYR,NZD,SGD,USD"} - -[pm_filters.volt] -open_banking = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "GBP,EUR,DKK,NOK,PLN,SEK" } -open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "GBP" } - -[pm_filters.razorpay] -upi_collect = { country = "IN", currency = "INR" } - -[pm_filters.phonepe] -upi_collect = { country = "IN", currency = "INR" } -upi_intent = { country = "IN", currency = "INR" } - -[pm_filters.paytm] -upi_collect = { country = "IN", currency = "INR" } -upi_intent = { country = "IN", currency = "INR" } - -[pm_filters.hyperpg] -credit = { currency = "INR,USD,GBP,EUR" } -debit = { currency = "INR,USD,GBP,EUR" } - -[pm_filters.plaid] -open_banking_pis = { currency = "EUR,GBP" } - -[pm_filters.adyen] -google_pay = { country = "AT, AU, BE, BG, CA, HR, CZ, EE, FI, FR, DE, GR, HK, DK, HU, IE, IT, LV, LT, LU, NL, NO, PL, PT, RO, SK, ES, SE, CH, GB, US, NZ, SG", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } -apple_pay = { country = "AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, GG, HU, IE, IM, IT, LV, LI, LT, LU, MT, NL, NO, PL, PT, RO, SK, SI, SE, ES, CH, GB, US, PR, CA, AU, HK, NZ, SG", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, CHF, UAH, ARS, BRL, CLP, COP, CRC, DOP, GTQ, HNL, MXN, PAB, USD, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, ILS, QAR, SAR, AED, CAD" } -paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" } -mobile_pay = { country = "DK,FI", currency = "DKK,SEK,NOK,EUR" } -ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" } -we_chat_pay = { country = "AU,NZ,CN,JP,HK,SG,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,LI,MT,SI,GR,PT,IT,CA,US", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,NZD,SGD,USD" } -mb_way = { country = "PT", currency = "EUR" } -klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD" } -affirm = { country = "US", currency = "USD" } -afterpay_clearpay = { country = "AU,NZ,ES,GB,FR,IT,CA,US", currency = "GBP" } -pay_bright = { country = "CA", currency = "CAD" } -walley = { country = "SE,NO,DK,FI", currency = "DKK,EUR,NOK,SEK" } -giropay = { country = "DE", currency = "EUR" } -eps = { country = "AT", currency = "EUR" } -sofort = { not_available_flows = { capture_method = "manual" }, country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR" } -ideal = { not_available_flows = { capture_method = "manual" }, country = "NL", currency = "EUR" } -blik = { country = "PL", currency = "PLN" } -trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" } -online_banking_czech_republic = { country = "CZ", currency = "EUR,CZK" } -online_banking_finland = { country = "FI", currency = "EUR" } -online_banking_poland = { country = "PL", currency = "PLN" } -online_banking_slovakia = { country = "SK", currency = "EUR,CZK" } -bancontact_card = { country = "BE", currency = "EUR" } -ach = { country = "US", currency = "USD" } -bacs = { country = "GB", currency = "GBP" } -sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR" } -ali_pay_hk = { country = "HK", currency = "HKD" } -bizum = { country = "ES", currency = "EUR" } -go_pay = { country = "ID", currency = "IDR" } -kakao_pay = { country = "KR", currency = "KRW" } -momo = { country = "VN", currency = "VND" } -gcash = { country = "PH", currency = "PHP" } -online_banking_fpx = { country = "MY", currency = "MYR" } -online_banking_thailand = { country = "TH", currency = "THB" } -touch_n_go = { country = "MY", currency = "MYR" } -atome = { country = "MY,SG", currency = "MYR,SGD" } -swish = { country = "SE", currency = "SEK" } -permata_bank_transfer = { country = "ID", currency = "IDR" } -bca_bank_transfer = { country = "ID", currency = "IDR" } -bni_va = { country = "ID", currency = "IDR" } -bri_va = { country = "ID", currency = "IDR" } -cimb_va = { country = "ID", currency = "IDR" } -danamon_va = { country = "ID", currency = "IDR" } -mandiri_va = { country = "ID", currency = "IDR" } -alfamart = { country = "ID", currency = "IDR" } -indomaret = { country = "ID", currency = "IDR" } -open_banking_uk = { country = "GB", currency = "GBP" } -oxxo = { country = "MX", currency = "MXN" } -pay_safe_card = { country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,AE,GB,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU" } -seven_eleven = { country = "JP", currency = "JPY" } -lawson = { country = "JP", currency = "JPY" } -mini_stop = { country = "JP", currency = "JPY" } -family_mart = { country = "JP", currency = "JPY" } -seicomart = { country = "JP", currency = "JPY" } -pay_easy = { country = "JP", currency = "JPY" } -pix = { country = "BR", currency = "BRL" } -boleto = { country = "BR", currency = "BRL" } - -[pm_filters.affirm] -affirm = { country = "CA,US", currency = "CAD,USD" } - -[pm_filters.airwallex] -credit = { country = "AU,HK,SG,NZ,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } -debit = { country = "AU,HK,SG,NZ,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } -google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AZ, BH, BR, BG, CA, CL, CO, CZ, DK, DO, EG, HK, HU, ID, IL, JP, JO, KZ, KE, KW, LB, MY, MX, OM, PK, PA, PE, PH, PL, QA, RO, SA, SG, ZA, LK, SE, TW, TH, TR, UA, AE, UY, VN, AT, BE, HR, EE, FI, FR, DE, GR, IE, IT, LV, LT, LU, NL, PL, PT, SK, ES, SE, RO, BG", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } -paypal = { currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,JPY,MYR,MXN,NOK,NZD,PHP,PLN,GBP,RUB,SGD,SEK,CHF,THB,USD" } -klarna = { currency = "EUR, DKK, NOK, PLN, SEK, CHF, GBP, USD, CZK" } -trustly = {currency="DKK, EUR, GBP, NOK, PLN, SEK" } -blik = { country="PL" , currency = "PLN" } -ideal = { country="NL" , currency = "EUR" } -atome = { country = "SG, MY" , currency = "SGD, MYR" } -skrill = { country="AL, DZ, AD, AR, AM, AW, AU, AT, AZ, BS, BD, BE, BJ, BO, BA, BW, BR, BN, BG, KH, CM, CA, CL, CN, CX, CO, CR , HR, CW, CY, CZ, DK, DM, DO, EC, EG, EE , FK, FI, GE, DE, GH, GI, GR, GP, GU, GT, GG, HK, HU, IS, IN, ID , IQ, IE, IM, IL, IT, JE , KZ, KE , KR, KW, KG, LV , LS, LI, LT, LU , MK, MG, MY, MV, MT, MU, YT, MX, MD, MC, MN, ME, MA, NA, NP, NZ, NI, NE, NO, PK , PA, PY, PE, PH, PL, PT, PR, QA, RO , SM , SA, SN , SG, SX, SK, SI, ZA, SS, ES, LK, SE, CH, TW, TZ, TH, TN, AE, GB, UM, UY, VN, VG, VI, US" , currency = "EUR, GBP, USD" } -indonesian_bank_transfer = { country="ID" , currency = "IDR" } - -[pm_filters.elavon] -credit = { country = "US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } -debit = { country = "US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } - -[pm_filters.xendit] -credit = { country = "ID,PH", currency = "IDR,PHP,USD,SGD,MYR" } -debit = { country = "ID,PH", currency = "IDR,PHP,USD,SGD,MYR" } -qris = {currency = "IDR" } - -[pm_filters.tsys] -credit = { country = "NA", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL, BYN, KPW, STN, MRU, VES" } -debit = { country = "NA", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL, BYN, KPW, STN, MRU, VES" } - -[pm_filters.billwerk] -credit = { country = "DE, DK, FR, SE", currency = "DKK, NOK" } -debit = { country = "DE, DK, FR, SE", currency = "DKK, NOK" } - -[pm_filters.fiservemea] -credit = { country = "DE, FR, IT, NL, PL, ES, ZA, GB, AE", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } -debit = { country = "DE, FR, IT, NL, PL, ES, ZA, GB, AE", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } - -[pm_filters.getnet] -credit = { country = "AR, BR, CL, MX, UY, ES, PT, DE, IT, FR, NL, BE, AT, PL, CH, GB, IE, LU, DK, SE, NO, FI, IN, AE", currency = "ARS, BRL, CLP, MXN, UYU, EUR, PLN, CHF, GBP, DKK, SEK, NOK, INR, AED" } - -[pm_filters.hipay] -credit = { country = "GB, CH, SE, DK, NO, PL, CZ, US, CA, JP, HK, AU, ZA", currency = "EUR, GBP, CHF, SEK, DKK, NOK, PLN, CZK, USD, CAD, JPY, HKD, AUD, ZAR" } -debit = { country = "GB, CH, SE, DK, NO, PL, CZ, US, CA, JP, HK, AU, ZA", currency = "EUR, GBP, CHF, SEK, DKK, NOK, PLN, CZK, USD, CAD, JPY, HKD, AUD, ZAR" } - -[pm_filters.moneris] -credit = { country = "AE, AF, AL, AO, AR, AT, AU, AW, AZ, BA, BB, BD, BE, BG, BH, BI, BM, BN, BO, BR, BT, BY, BZ, CH, CL, CN, CO, CR, CU, CV, CY, CZ, DE, DJ, DK, DO, DZ, EE, EG, ES, FI, FJ, FR, GB, GE, GI, GM, GN, GR, GT, GY, HK, HN, HR, HT, HU, ID, IE, IL, IN, IS, IT, JM, JO, JP, KE, KM, KR, KW, KY, KZ, LA, LK, LR, LS, LV, LT, LU, MA, MD, MG, MK, MO, MR, MT, MU, MV, MW, MX, MY, MZ, NA, NG, NI, NL, NO, NP, NZ, OM, PE, PG, PK, PL, PT, PY, QA, RO, RS, RU, RW, SA, SB, SC, SE, SG, SH, SI, SK, SL, SR, SV, SZ, TH, TJ, TM, TN, TR, TT, TW, TZ, UG, US, UY, UZ, VN, VU, WS, ZA, ZM", currency = "AED, AFN, ALL, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BTN, BYN, BZD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GEL, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JOD, JPY, KES, KMF, KRW, KWD, KYD, KZT, LAK, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SRD, SVC, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VND, VUV, WST, XCD, XOF, XPF, ZAR, ZMW" } -debit = { country = "AE, AF, AL, AO, AR, AT, AU, AW, AZ, BA, BB, BD, BE, BG, BH, BI, BM, BN, BO, BR, BT, BY, BZ, CH, CL, CN, CO, CR, CU, CV, CY, CZ, DE, DJ, DK, DO, DZ, EE, EG, ES, FI, FJ, FR, GB, GE, GI, GM, GN, GR, GT, GY, HK, HN, HR, HT, HU, ID, IE, IL, IN, IS, IT, JM, JO, JP, KE, KM, KR, KW, KY, KZ, LA, LK, LR, LS, LV, LT, LU, MA, MD, MG, MK, MO, MR, MT, MU, MV, MW, MX, MY, MZ, NA, NG, NI, NL, NO, NP, NZ, OM, PE, PG, PK, PL, PT, PY, QA, RO, RS, RU, RW, SA, SB, SC, SE, SG, SH, SI, SK, SL, SR, SV, SZ, TH, TJ, TM, TN, TR, TT, TW, TZ, UG, US, UY, UZ, VN, VU, WS, ZA, ZM", currency = "AED, AFN, ALL, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BTN, BYN, BZD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GEL, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JOD, JPY, KES, KMF, KRW, KWD, KYD, KZT, LAK, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SRD, SVC, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VND, VUV, WST, XCD, XOF, XPF, ZAR, ZMW" } - -[pm_filters.opennode] -crypto_currency = { country = "US, CA, GB, AU, BR, MX, SG, PH, NZ, ZA, JP, AT, BE, HR, CY, EE, FI, FR, DE, GR, IE, IT, LV, LT, LU, MT, NL, PT, SK, SI, ES", currency = "USD, CAD, GBP, AUD, BRL, MXN, SGD, PHP, NZD, ZAR, JPY, EUR" } - -[pm_filters.bambora] -credit = { country = "US,CA", currency = "USD" } -debit =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IL,IT,JM,JP,JE,JO,KZ,KE,KI,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MG,MW,MY,MV,ML,MT,MH,MR,MU,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PL,PT,PR,QA,CG,RO,RW,KN,LC,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SO,ZA,GS,ES,LK,SR,SJ,SZ,SE,CH,TW,TJ,TZ,TH,TL,TG,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UY,UZ,VU,VE,VN,VG,WF,YE,ZM,ZW", currency = "USD" } -apple_pay = { country = "AU,AT,BH,BE,BR,BG,CA,CL,CN,CO,CR,HR,CY,CZ,DK,DO,EC,EE,SV,FI,FR,DE,GR,GT,HN,HK,HU,IS,IN,IE,IL,IT,JP,JO,KZ,KW,LV,LI,LT,LU,MY,MT,MX,MC,ME,NL,NZ,NO,OM,PA,PY,PE,PL,PT,QA,RO,SA,SG,SK,SI,ZA,KR,ES,SE,CH,TW,AE,GB,US,UY,VN,VA", currency = "USD" } -google_pay = { country = "AU,AT,BE,BR,CA,CL,CO,CR,CY,CZ,DK,DO,EC,EE,SV,FI,FR,DE,GR,GT,HN,HK,HU,IS,IN,IE,IL,IT,JP,JO,KZ,KW,LV,LI,LT,LU,MY,MT,MX,NL,NZ,NO,OM,PA,PY,PE,PL,PT,QA,RO,SA,SG,SK,SI,ZA,KR,ES,SE,CH,TW,AE,GB,US,UY,VN,VA", currency = "USD" } -samsung_pay = { country = "AU,BH,BR,CA,CN,DK,FI,FR,DE,HK,IN,IT,JP,KZ,KR,KW,MY,NZ,NO,OM,QA,SA,SG,ZA,ES,SE,CH,TW,AE,GB,US", currency = "USD" } - -[pm_filters.cybersource] -credit = { currency = "USD,GBP,EUR,PLN,SEK,XOF,CAD,KWD,QAR" } -debit = { currency = "USD,GBP,EUR,PLN,SEK,XOF,CAD,KWD,QAR" } -apple_pay = { currency = "ARS, CAD, CLP, COP, CNY, EUR, HKD, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, GBP, AED, USD, PLN, SEK" } -google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" } -samsung_pay = { currency = "USD,GBP,EUR,SEK" } -paze = { currency = "USD,SEK" } - -[pm_filters.barclaycard] -credit = { currency = "USD,GBP,EUR,PLN,SEK" } -debit = { currency = "USD,GBP,EUR,PLN,SEK" } -google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" } -apple_pay = { currency = "ARS, CAD, CLP, COP, CNY, EUR, HKD, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, GBP, AED, USD, PLN, SEK" } - - -[pm_filters.globepay] -ali_pay = { country = "GB",currency = "GBP,CNY" } -we_chat_pay = { country = "GB",currency = "GBP,CNY" } - - -[pm_filters.itaubank] -pix = { country = "BR", currency = "BRL" } - -[pm_filters.nexinets] -credit = { country = "DE",currency = "EUR" } -debit = { country = "DE",currency = "EUR" } -ideal = { country = "DE",currency = "EUR" } -giropay = { country = "DE",currency = "EUR" } -sofort = { country = "DE",currency = "EUR" } -eps = { country = "DE",currency = "EUR" } -apple_pay = { country = "DE",currency = "EUR" } -paypal = { country = "DE",currency = "EUR" } - - -[pm_filters.nuvei] -credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,C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TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } -klarna = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } -afterpay_clearpay = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" } -giropay = { currency = "EUR" } -ideal = { currency = "EUR" } -sofort = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL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R,KMF,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } -google_pay = { country = "AL,DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, CA, BG, CL, CO, HR, DK, DO, EE, EG, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, SA, SG, SK, ZA, ES, LK, SE, CH, TH, TW, TR, UA, AE, US, UY, VN", currency = "AED, ALL, AOA, AUD, AZN, BGN, BHD, BRL, CAD, CHF, CLP, COP, CZK, DKK, DOP, DZD, EGP, EUR, GBP, HKD, HUF, IDR, ILS, INR, JPY, KES, KWD, KZT, LKR, MXN, MYR, NOK, NZD, OMR, PAB, PEN, PHP, PKR, PLN, QAR, RON, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, UYU, VND, XCD, ZAR" } -apple_pay = { country = "AM,US, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" } - -[pm_filters.checkbook] -ach = { country = "US", currency = "USD" } - -[pm_filters.nexixpay] -credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU,AU,BR,US", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" } -debit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU,AU,BR,US", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" } - -[pm_filters.square] -credit = { country = "AU,CA,FR,IE,JP,ES,GB,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,B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LL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW" } - -[pm_filters.iatapay] -upi_collect = { country = "IN", currency = "INR" } -upi_intent = { country = "IN", currency = "INR" } -ideal = { country = "NL", currency = "EUR" } -local_bank_redirect = { country = "AT,BE,EE,FI,FR,DE,IE,IT,LV,LT,LU,NL,PT,ES,GB,IN,HK,SG,TH,BR,MX,GH,VN,MY,PH,JO,AU,CO", currency = "EUR,GBP,INR,HKD,SGD,THB,BRL,MXN,GHS,VND,MYR,PHP,JOD,AUD,COP" } -duit_now = { country = "MY", currency = "MYR" } -fps = { country = "GB", currency = "GBP" } -prompt_pay = { country = "TH", currency = "THB" } -viet_qr = { country = "VN", currency = "VND" } - -[pm_filters.coinbase] -crypto_currency = { country = "ZA,US,BR,CA,TR,SG,VN,GB,DE,FR,ES,PT,IT,NL,AU" } - -[pm_filters.novalnet] -credit = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,CL,CN,CO,CR,CU,CY,CZ,DE,DJ,DK,DO,DZ,EE,EG,ET,ES,FI,FJ,FR,GB,GE,GH,GI,GM,GR,GT,GY,HK,HN,HR,HU,ID,IE,IL,IN,IS,IT,JM,JO,JP,KE,KH,KR,KW,KY,KZ,LB,LK,LT,LV,LY,MA,MC,MD,ME,MG,MK,MN,MO,MT,MV,MW,MX,MY,NG,NI,NO,NP,NL,NZ,OM,PA,PE,PG,PH,PK,PL,PT,PY,QA,RO,RS,RU,RW,SA,SB,SC,SE,SG,SH,SI,SK,SL,SO,SM,SR,ST,SV,SY,TH,TJ,TN,TO,TR,TW,TZ,UA,UG,US,UY,UZ,VE,VA,VN,VU,WS,CF,AG,DM,GD,KN,LC,VC,YE,ZA,ZM", currency = "AED,ALL,AMD,AR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WP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,GBP,GEL,GHS,GIP,GMD,GTQ,GYD,HKD,HNL,HRK,HUF,IDR,ILS,INR,ISK,JMD,JOD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,LYD,MAD,MDL,MGA,MKD,MNT,MOP,MVR,MWK,MXN,MYR,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STN,SVC,SYP,THB,TJS,TND,TOP,TRY,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,YER,ZAR,ZMW" } -apple_pay = { country = "EG, MA, ZA, CN, HK, JP, MY, MN, SG, KR, VN, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, GE, DE, GR, GL, HU, IS, IE, IT, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, CA, US, BH, IL, JO, KW, OM, QA, SA, AE, AR, BR, CL, CO, CR, SV, GT, MX, PY, PE, UY, BS, DO, AM, KZ, NZ", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, AZN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } -google_pay = { country = "AO, EG, KE, ZA, AR, BR, CL, CO, MX, PE, UY, AG, DO, AE, TR, SA, QA, OM, LB, KW, JO, IL, BH, KZ, VN, TH, SG, MY, JP, HK, LK, IN, US, CA, GB, UA, CH, SE, ES, SK, PT, RO, PL, NO, NL, LU, LT, LV, IE, IT, HU, GR, DE, FR, FI, EE, DK, CZ, HR, BG, BE, AT, AL", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, AZN, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } -paypal = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,BS,BW,BY,BZ,CA,CD,CH,CL,CN,CO,CR,CU,CY,CZ,DE,DJ,DK,DO,DZ,EE,EG,ET,ES,FI,FJ,FR,GB,GE,GH,GI,GM,GR,GT,GY,HK,HN,HR,HU,ID,IE,IL,IN,IS,IT,JM,JO,JP,KE,KH,KR,KW,KY,KZ,LB,LK,LT,LV,LY,MA,MC,MD,ME,MG,MK,MN,MO,MT,MV,MW,MX,MY,NG,NI,NO,NP,NL,NZ,OM,PA,PE,PG,PH,PK,PL,PT,PY,QA,RO,RS,RU,RW,SA,SB,SC,SE,SG,SH,SI,SK,SL,SO,SM,SR,ST,SV,SY,TH,TJ,TN,TO,TR,TW,TZ,UA,UG,US,UY,UZ,VE,VA,VN,VU,WS,CF,AG,DM,GD,KN,LC,VC,YE,ZA,ZM", currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,GBP,GEL,GHS,GIP,GMD,GTQ,GYD,HKD,HNL,HRK,HUF,IDR,ILS,INR,ISK,JMD,JOD,JPY,KES,KHR,KRW,KWD,KYD,KZT,LBP,LKR,LYD,MAD,MDL,MGA,MKD,MNT,MOP,MVR,MWK,MXN,MYR,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STN,SVC,SYP,THB,TJS,TND,TOP,TRY,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,YER,ZAR,ZMW" } -sepa = {country = "FR, IT, GR, BE, BG, FI, EE, HR, IE, DE, DK, LT, LV, MT, LU, AT, NL, PT, RO, PL, SK, SE, ES, SI, HU, CZ, CY, GB, LI, NO, IS, MC, CH, YT, PM, SM", currency="EUR"} -sepa_guaranteed_debit = {country = "AT, CH, DE", currency="EUR"} - -[pm_filters.braintree] -credit = { country = "AD,AT,AU,BE,BG,CA,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GG,GI,GR,HK,HR,HU,IE,IM,IT,JE,LI,LT,LU,LV,MT,MC,MY,NL,NO,NZ,PL,PT,RO,SE,SG,SI,SK,SM,US", currency = "AED,AMD,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BIF,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CHF,CLP,CNY,COP,CRC,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,ISK,JMD,JPY,KES,KGS,KHR,KMF,KRW,KYD,KZT,LAK,LBP,LKR,LRD,LSL,MAD,MDL,MKD,MNT,MOP,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLL,SOS,SRD,STD,SVC,SYP,SZL,THB,TJS,TOP,TRY,TT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D,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"} -google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" } -apple_pay = { currency = "USD, CAD" } - -[pm_filters.helcim] -credit = { country = "US, CA", currency = "USD, CAD" } -debit = { country = "US, CA", currency = "USD, CAD" } - -[pm_filters.globalpay] -credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,SZ,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG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F,STD,CUC" } -eps = { country = "AT", currency = "EUR" } -giropay = { country = "DE", currency = "EUR" } -ideal = { country = "NL", currency = "EUR" } -sofort = { country = "AT,BE,DE,ES,IT,NL", currency = "EUR" } - -[pm_filters.jpmorgan] -debit = { country = "CA, GB, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, EUR, GBP, AUD, NZD, SGD, CAD, JPY, HKD, KRW, TWD, MXN, BRL, DKK, NOK, ZAR, SEK, CHF, CZK, PLN, TRY, AFN, ALL, DZD, AOA, ARS, AMD, AWG, AZN, BSD, BDT, BBD, BYN, BZD, BMD, BOB, BAM, BWP, BND, BGN, BIF, BTN, XOF, XAF, XPF, KHR, CVE, KYD, CLP, CNY, COP, KMF, CDF, CRC, HRK, DJF, DOP, XCD, EGP, ETB, FKP, FJD, GMD, GEL, GHS, GIP, GTQ, GYD, HTG, HNL, HUF, ISK, INR, IDR, ILS, JMD, KZT, KES, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRU, MUR, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, PGK, NIO, NGN, PKR, PAB, PYG, PEN, PHP, QAR, RON, RWF, SHP, WST, STN, SAR, RSD, SCR, SLL, SBD, SOS, LKR, SRD, SZL, TJS, TZS, THB, TOP, TTD, UGX, UAH, AED, UYU, UZS, VUV, VND, YER, ZMW" } -credit = { country = "CA, GB, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, EUR, GBP, AUD, NZD, SGD, CAD, JPY, HKD, KRW, TWD, MXN, BRL, DKK, NOK, ZAR, SEK, CHF, CZK, PLN, TRY, AFN, ALL, DZD, AOA, ARS, AMD, AWG, AZN, BSD, BDT, BBD, BYN, BZD, BMD, BOB, BAM, BWP, BND, BGN, BIF, BTN, XOF, XAF, XPF, KHR, CVE, KYD, CLP, CNY, COP, KMF, CDF, CRC, HRK, DJF, DOP, XCD, EGP, ETB, FKP, FJD, GMD, GEL, GHS, GIP, GTQ, GYD, HTG, HNL, HUF, ISK, INR, IDR, ILS, JMD, KZT, KES, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRU, MUR, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, PGK, NIO, NGN, PKR, PAB, PYG, PEN, PHP, QAR, RON, RWF, SHP, WST, STN, SAR, RSD, SCR, SLL, SBD, SOS, LKR, SRD, SZL, TJS, TZS, THB, TOP, TTD, UGX, UAH, AED, UYU, UZS, VUV, VND, YER, ZMW" } - -[pm_filters.bitpay] -crypto_currency = { country = "US, CA, GB, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE", currency = "USD, AUD, CAD, GBP, MXN, NZD, CHF, EUR"} - -[pm_filters.paybox] -debit = { country = "FR", currency = "CAD, AUD, EUR, USD" } -credit = { country = "FR", currency = "CAD, AUD, EUR, USD" } - -[pm_filters.payload] -debit = { currency = "USD,CAD" } -credit = { currency = "USD,CAD" } -ach = { currency = "USD,CAD" } - - -[pm_filters.digitalvirgo] -direct_carrier_billing = {country = "MA, CM, ZA, EG, SN, DZ, TN, ML, GN, GH, LY, GA, CG, MG, BW, SD, NG, ID, SG, AZ, TR, FR, ES, PL, GB, PT, DE, IT, BE, IE, SK, GR, NL, CH, BR, MX, AR, CL, AE, IQ, KW, BH, SA, QA, PS, JO, OM, RU" , currency = "MAD, XOF, XAF, ZAR, EGP, DZD, TND, GNF, GHS, LYD, XAF, CDF, MGA, BWP, SDG, NGN, IDR, SGD, RUB, AZN, TRY, EUR, PLN, GBP, CHF, BRL, MXN, ARS, CLP, AED, IQD, KWD, BHD, SAR, QAR, ILS, JOD, OMR" } - -[pm_filters.payu] -debit = { country = "AE, AF, AL, AM, CW, AO, AR, AU, AW, AZ, BA, BB, BG, BH, BI, BM, BN, BO, BR, BS, BW, BY, BZ, CA, CD, LI, CL, CN, CO, CR, CV, CZ, DJ, DK, DO, DZ, EG, ET, AD, FJ, FK, GG, GE, GH, GI, GM, GN, GT, GY, HK, HN, HR, HT, HU, ID, IL, IQ, IS, JM, JO, JP, KG, KH, KM, KR, KW, KY, KZ, LA, LB, LR, LS, MA, MD, MG, MK, MN, MO, MR, MV, MW, MX, MY, MZ, NA, NG, NI, BV, CK, OM, PA, PE, PG, PL, PY, QA, RO, RS, RW, SA, SB, SC, SE, SG, SH, SO, SR, SV, SZ, TH, TJ, TM, TN, TO, TR, TT, TW, TZ, UG, AS, UY, UZ, VE, VN, VU, WS, CM, AI, BJ, PF, YE, ZA, ZM, ZW", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IQD, ISK, JMD, JOD, JPY, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LRD, LSL, MAD, MDL, MGA, MKD, MNT, MOP, MRU, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NZD, OMR, PAB, PEN, PGK, PLN, PYG, QAR, RON, RSD, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SOS, SRD, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } -credit = { country = "AE, AF, AL, AM, CW, AO, AR, AU, AW, AZ, BA, BB, BG, BH, BI, BM, BN, BO, BR, BS, BW, BY, BZ, CA, CD, LI, CL, CN, CO, CR, CV, CZ, DJ, DK, DO, DZ, EG, ET, AD, FJ, FK, GG, GE, GH, GI, GM, GN, GT, GY, HK, HN, HR, HT, HU, ID, IL, IQ, IS, JM, JO, JP, KG, KH, KM, KR, KW, KY, KZ, LA, LB, LR, LS, MA, MD, MG, MK, MN, MO, MR, MV, MW, MX, MY, MZ, NA, NG, NI, BV, CK, OM, PA, PE, PG, PL, PY, QA, RO, RS, RW, SA, SB, SC, SE, SG, SH, SO, SR, SV, SZ, TH, TJ, TM, TN, TO, TR, TT, TW, TZ, UG, AS, UY, UZ, VE, VN, VU, WS, CM, AI, BJ, PF, YE, ZA, ZM, ZW", currency = "AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IQD, ISK, JMD, JOD, JPY, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LRD, LSL, MAD, MDL, MGA, MKD, MNT, MOP, MRU, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NZD, OMR, PAB, PEN, PGK, PLN, PYG, QAR, RON, RSD, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SOS, SRD, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL" } -google_pay = { country = "AL, DZ, AS, AO, AR, AU, AZ, BH, BY, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, HK, HU, ID, IN, IL, JP, JO, KZ, KW, LB, MY, MX, OM, PA, PE, PL, QA, RO, SA, SG, SE, TW, TH, TR, AE, UY, VN", currency = "ALL, DZD, USD, AOA, XCD, ARS, AUD, EUR, AZN, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PAB, PEN, PLN, QAR, RON, SAR, SGD, ZAR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } - -[pm_filters.klarna] -klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,EUR,EUR,CAD,CZK,DKK,EUR,EUR,EUR,EUR,EUR,EUR,EUR,NZD,NOK,PLN,EUR,EUR,SEK,CHF,GBP,USD" } - -[pm_filters.flexiti] -flexiti = { country = "CA", currency = "CAD" } - -[pm_filters.mifinity] -mifinity = { country = "BR,CN,SG,MY,DE,CH,DK,GB,ES,AD,GI,FI,FR,GR,HR,IT,JP,MX,AR,CO,CL,PE,VE,UY,PY,BO,EC,GT,HN,SV,NI,CR,PA,DO,CU,PR,NL,NO,PL,PT,SE,RU,TR,TW,HK,MO,AX,AL,DZ,AS,AO,AI,AG,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BE,BZ,BJ,BM,BT,BQ,BA,BW,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CX,CC,KM,CG,CK,CI,CW,CY,CZ,DJ,DM,EG,GQ,ER,EE,ET,FK,FO,FJ,GF,PF,TF,GA,GM,GE,GH,GL,GD,GP,GU,GG,GN,GW,GY,HT,HM,VA,IS,IN,ID,IE,IM,IL,JE,JO,KZ,KE,KI,KW,KG,LA,LV,LB,LS,LI,LT,LU,MK,MG,MW,MV,ML,MT,MH,MQ,MR,MU,YT,FM,MD,MC,MN,ME,MS,MA,MZ,NA,NR,NP,NC,NZ,NE,NG,NU,NF,MP,OM,PK,PW,PS,PG,PH,PN,QA,RE,RO,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SX,SK,SI,SB,SO,ZA,GS,KR,LK,SR,SJ,SZ,TH,TL,TG,TK,TO,TT,TN,TM,TC,TV,UG,UA,AE,UZ,VU,VN,VG,VI,WF,EH,ZM", currency = "AUD,CAD,CHF,CNY,CZK,DKK,EUR,GBP,INR,JPY,NOK,NZD,PLN,RUB,SEK,ZAR,USD,EGP,UYU,UZS" } - -[pm_filters.zen] -credit = { not_available_flows = { capture_method = "manual" } } -debit = { not_available_flows = { capture_method = "manual" } } -boleto = { country = "BR", currency = "BRL" } -efecty = { country = "CO", currency = "COP" } -multibanco = { country = "PT", currency = "EUR" } -pago_efectivo = { country = "PE", currency = "PEN" } -pse = { country = "CO", currency = "COP" } -pix = { country = "BR", currency = "BRL" } -red_compra = { country = "CL", currency = "CLP" } -red_pagos = { country = "UY", currency = "UYU" } - -[pm_filters.zsl] -local_bank_transfer = { country = "CN", currency = "CNY" } - -[pm_filters.aci] -credit = { country = "AD,AE,AT,BE,BG,CH,CN,CO,CR,CY,CZ,DE,DK,DO,EE,EG,ES,ET,FI,FR,GB,GH,GI,GR,GT,HN,HK,HR,HU,ID,IE,IS,IT,JP,KH,LA,LI,LT,LU,LY,MK,MM,MX,MY,MZ,NG,NZ,OM,PA,PE,PK,PL,PT,QA,RO,SA,SN,SE,SI,SK,SV,TH,UA,US,UY,VN,ZM", currency = "AED,ALL,ARS,BGN,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,EGP,EUR,GBP,GHS,HKD,HNL,HRK,HUF,IDR,ILS,ISK,JPY,KHR,KPW,LAK,LKR,MAD,MKD,MMK,MXN,MYR,MZN,NGN,NOK,NZD,OMR,PAB,PEN,PHP,PKR,PLN,QAR,RON,RSD,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,UYU,VND,ZAR,ZMW" } -debit = { country = "AD,AE,AT,BE,BG,CH,CN,CO,CR,CY,CZ,DE,DK,DO,EE,EG,ES,ET,FI,FR,GB,GH,GI,GR,GT,HN,HK,HR,HU,ID,IE,IS,IT,JP,KH,LA,LI,LT,LU,LY,MK,MM,MX,MY,MZ,NG,NZ,OM,PA,PE,PK,PL,PT,QA,RO,SA,SN,SE,SI,SK,SV,TH,UA,US,UY,VN,ZM", currency = "AED,ALL,ARS,BGN,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,EGP,EUR,GBP,GHS,HKD,HNL,HRK,HUF,IDR,ILS,ISK,JPY,KHR,KPW,LAK,LKR,MAD,MKD,MMK,MXN,MYR,MZN,NGN,NOK,NZD,OMR,PAB,PEN,PHP,PKR,PLN,QAR,RON,RSD,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,UYU,VND,ZAR,ZMW" } -mb_way = { country = "EE,ES,PT", currency = "EUR" } -ali_pay = { country = "CN", currency = "CNY" } -eps = { country = "AT", currency = "EUR" } -ideal = { country = "NL", currency = "EUR" } -giropay = { country = "DE", currency = "EUR" } -sofort = { country = "AT,BE,CH,DE,ES,GB,IT,NL,PL", currency = "CHF,EUR,GBP,HUF,PLN"} -interac = { country = "CA", currency = "CAD,USD"} -przelewy24 = { country = "PL", currency = "CZK,EUR,GBP,PLN" } -trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" } -klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" } - -[pm_filters.gigadat] -interac = { currency = "CAD"} - -[pm_filters.loonio] -interac = { currency = "CAD"} - -[pm_filters.dlocal] -oxxo = { currency = "MXN" } - -[pm_filters.mollie] -eps = { country = "AT", currency = "EUR" } -ideal = { country = "NL", currency = "EUR" } -przelewy24 = { country = "PL", currency = "PLN,EUR" } -klarna = { country = "DE,AT,NL,BE,FR,GB,IT,ES,PT,SE,DK,FI,NO,CH,IR,CZ,PL,GR,SK", currency = "EUR,GBP,DKK,SEK,NOK,CHF,PLN,CZK" } - -[pm_filters.redsys] -credit = { currency = "AUD,BGN,CAD,CHF,COP,CZK,DKK,EUR,GBP,HRK,HUF,ILS,INR,JPY,MYR,NOK,NZD,PEN,PLN,RUB,SAR,SEK,SGD,THB,USD,ZAR", country="ES" } -debit = { currency = "AUD,BGN,CAD,CHF,COP,CZK,DKK,EUR,GBP,HRK,HUF,ILS,INR,JPY,MYR,NOK,NZD,PEN,PLN,RUB,SAR,SEK,SGD,THB,USD,ZAR", country="ES" } - -[pm_filters.stax] -credit = { country = "US", currency = "USD" } -debit = { country = "US", currency = "USD" } -ach = { country = "US", currency = "USD" } - -[pm_filters.prophetpay] -card_redirect = { country = "US", currency = "USD" } - -[pm_filters.multisafepay] -credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,CV,KH,CM,CA,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,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TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "AED,AUD,BRL,CAD,CHF,CLP,CNY,COP,CZK,DKK,EUR,GBP,HKD,HRK,HUF,ILS,INR,ISK,JPY,KRW,MXN,MYR,NOK,NZD,PEN,PLN,RON,RUB,SEK,SGD,TRY,TWD,USD,ZAR", not_available_flows = { capture_method = "manual" } } -google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "AED, AUD, BRL, CAD, CHF, CLP, COP, CZK, DKK, EUR, GBP, HKD, HRK, HUF, ILS, INR, JPY, MXN, MYR, NOK, NZD, PEN, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, TWD, UAH, USD, ZAR" } -paypal = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,CV,KH,CM,CA,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "AUD,BRL,CAD,CHF,CZK,DKK,EUR,GBP,HKD,HRK,HUF,JPY,MXN,MYR,NOK,NZD,PHP,PLN,RUB,SEK,SGD,THB,TRY,TWD,USD" } -giropay = { country = "DE", currency = "EUR" } -ideal = { country = "NL", currency = "EUR" } -klarna = { country = "AT,BE,DK,FI,FR,DE,IT,NL,NO,PT,ES,SE,GB", currency = "DKK,EUR,GBP,NOK,SEK" } -trustly = { country = "AT,CZ,DK,EE,FI,DE,LV,LT,NL,NO,PL,PT,ES,SE,GB" , currency = "EUR,GBP,SEK"} -ali_pay = { currency = "EUR,USD" } -we_chat_pay = { currency = "EUR"} -eps = { country = "AT" , currency = "EUR" } -mb_way = { country = "PT" , currency = "EUR" } -sofort = { country = "AT,BE,FR,DE,IT,PL,ES,CH,GB" , currency = "EUR"} - -[pm_filters.cashtocode] -classic = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,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MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } -google_pay = { country = "US", currency = "USD" } -apple_pay = { country = "US", currency = "USD" } -ach = { country = "US", currency = "USD" } - -[pm_filters.trustpay] -credit = { not_available_flows = { capture_method = "manual" } } -debit = { not_available_flows = { capture_method = "manual" } } -instant_bank_transfer = { country = "CZ,SK,GB,AT,DE,IT", currency = "CZK, EUR, GBP" } -instant_bank_transfer_poland = { country = "PL", currency = "PLN" } -instant_bank_transfer_finland = { country = "FI", currency = "EUR" } -sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,GB", currency = "EUR" } - -[pm_filters.tesouro] -credit = { country = "AF,AL,DZ,AD,AO,AI,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BA,BW,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CO,KM,CD,CG,CK,CR,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MG,MW,MY,MV,ML,MT,MH,MR,MU,MX,FM,MD,MC,MN,ME,MS,MA,MZ,M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,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } -apple_pay = { currency = "USD" } -google_pay = { currency = "USD" } - -[pm_filters.authorizedotnet] -credit = {currency = "CAD,USD"} -debit = {currency = "CAD,USD"} -google_pay = {currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"} -apple_pay = {currency = "EUR,GBP,ISK,USD,AUD,CAD,BRL,CLP,COP,CRC,CZK,DKK,EGP,GEL,GHS,GTQ,HNL,HKD,HUF,ILS,INR,JPY,KZT,KRW,KWD,MAD,MXN,MYR,NOK,NZD,PEN,PLN,PYG,QAR,RON,SAR,SEK,SGD,THB,TWD,UAH,AED,VND,ZAR"} -paypal = {currency = "AUD,BRL,CAD,CHF,CNY,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,MYR,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD"} - -[pm_filters.dwolla] -ach = { country = "US", currency = "USD" } - -[pm_filters.worldpay] -debit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US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,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" } -google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "DZD, AOA, USD, XCD, ARS, AUD, AZN, EUR, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } -apple_pay = { country = "EG, MA, ZA, AU, CN, HK, JP, MO, MY, MN, NZ, SG, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, CZ, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IE, IS, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US, PR", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } - -[pm_filters.worldpayxml] -debit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US,UZ,VU,VE,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,A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,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" } - -[pm_filters.worldpaymodular] -google_pay = { country = "AL, DZ, AS, AO, AG, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CA, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "DZD, AOA, USD, XCD, ARS, AUD, AZN, EUR, BHD, BYN, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, JOD, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND" } -apple_pay = { country = "EG, MA, ZA, AU, CN, HK, JP, MO, MY, MN, NZ, SG, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, CZ, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IE, IS, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US, PR", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, EUR, AZN, BYN, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD" } - -[pm_filters.calida] -bluecode = { country = "AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,SK,SI,ES,SE,IS,LI,NO", currency = "EUR" } - -[file_upload_config] -bucket_name = "" -region = "" - -[pm_filters.forte] -credit = { country = "US, CA", currency = "CAD,USD"} -debit = { country = "US, CA", currency = "CAD,USD"} - -[pm_filters.nordea] -sepa = { country = "DK,FI,NO,SE", currency = "DKK,EUR,NOK,SEK" } - -[pm_filters.fiuu] -duit_now = { country = "MY", currency = "MYR" } -apple_pay = { country = "MY", currency = "MYR" } -google_pay = { country = "MY", currency = "MYR" } -online_banking_fpx = { country = "MY", currency = "MYR" } -credit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PHP,SGD,THB,TWD,VND" } -debit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PHP,SGD,THB,TWD,VND" } - -[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, AR, AU, AT, AZ, BH, BY, BE, BR, BG, CL, CO, HR, CZ, DK, DO, EG, EE, FI, FR, DE, GR, HK, HU, IN, ID, IE, IL, IT, JP, JO, KZ, KE, KW, LV, LB, LT, LU, MY, MX, NL, NZ, NO, OM, PK, PA, PE, PH, PL, PT, QA, RO, RU, SA, SG, SK, ZA, ES, LK, SE, CH, TW, TH, TR, UA, AE, GB, US, UY, VN", currency = "ALL, DZD, USD, XCD, ARS, AUD, EUR, BHD, BRL, BGN, CAD, CLP, COP, CZK, DKK, DOP, EGP, HKD, HUF, INR, IDR, ILS, JPY, KZT, KES, KWD, LBP, MYR, MXN, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, SGD, ZAR, LKR, SEK, CHF, TWD, THB, TRY, UAH, AED, GBP, UYU, VND"} -apple_pay = { country = "EG, MA, ZA, AU, HK, JP, MO, MY, MN, NZ, SG, KR, TW, VN, AM, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT , KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SI, ES, SE, CH, UA, GB, VA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, BS, UY, BH, IL, JO, KW, OM, PS, QA, SA, AE, CA, US", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MYR, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, GBP, ARS, BRL, CLP, COP, CRC, DOP, USD, GTQ, MXN, PAB, PEN, BSD, UYU, BHD, ILS, KWD, OMR, QAR, SAR, AED, CAD"} - -[pm_filters.fiserv] -credit = {country = "AU,NZ,CN,HK,IN,LK,KR,MY,SG,GB,BE,FR,DE,IT,ME,NL,PL,ES,ZA,AR,BR,CO,MX,PA,UY,US,CA", currency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OP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,NZD,NIO,NGN,VUV,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SHP,SVC,WST,STN,SAR,RSD,SCR,SLL,SGD,SBD,SOS,ZAR,KRW,SSP,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,UGX,UAH,AED,USD,UYU,UZS,VND,XOF,YER,ZMW,ZWL"} -paypal = { currency = "AUD,EUR,BRL,CAD,CNY,EUR,EUR,EUR,GBP,HKD,INR,EUR,JPY,MYR,EUR,NZD,PHP,PLN,SGD,USD", country = "AU, BE, BR, CA, CN, DE, ES, FR, GB, HK, IN, IT, JP, MY, NL, NZ, PH, PL, SG, US" } -google_pay = { country = "AU,AT,BE,BR,CA,CN,HK,MY,NZ,SG,US", currency = "AUD,EUR,EUR,BRL,CAD,CNY,HKD,MYR,NZD,SGD,USD" } -apple_pay = { country = "AU,NZ,CN,HK,JP,SG,MY,KR,TW,VN,GB,IE,FR,DE,IT,ES,PT,NL,BE,LU,AT,CH,SE,FI,DK,NO,PL,CZ,SK,HU,LT,LV,EE,GR,RO,BG,HR,SI,MT,CY,IS,LI,MC,SM,VA,US,CA,MX,BR,AR,CL,CO,PE,UY,CR,PA,DO,EC,SV,GT,HN,BS,PR,AE,SA,QA,KW,BH,OM,IL,JO,PS,EG,MA,ZA,GE,AM,AZ,MD,ME,MK,AL,BA,RS,UA", currency = "AUD,BRL,CAD,CHF,CZK,DKK,EUR,GBP,HKD,HUF,ILS,JPY,MXN,NOK,NZD,PHP,PLN,SEK,SGD,THB,TWD,USD" } - - -[pm_filters.amazonpay] -amazon_pay = { country = "US", currency = "USD" } - -[pm_filters.rapyd] -apple_pay = { country = "BR, CA, CL, CO, DO, SV, MX, PE, PT, US, AT, BE, BG, HR, CY, CZ, DO, DK, EE, FI, FR, GE, DE, GR, GL, HU, IS, IE, IL, IT, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, RO, SM, SK, SI, ZA, ES, SE, CH, GB, VA, AU, HK, JP, MY, NZ, SG, KR, TW, VN", currency = "AMD, AUD, BGN, BRL, BYN, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DOP, EUR, GBP, GEL, GTQ, HUF, ISK, JPY, KRW, MDL, MXN, MYR, NOK, PAB, PEN, PLN, PYG, RON, RSD, SEK, SGD, TWD, UAH, USD, UYU, VND, ZAR" } -google_pay = { country = "BR, CA, CL, CO, DO, MX, PE, PT, US, AT, BE, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IL, IT, LV, LT, LU, NZ, NO, GB, PL, RO, RU, SK, ZA, ES, SE, CH, TR, AU, HK, IN, ID, JP, MY, PH, SG, TW, TH, VN", currency = "AUD, BGN, BRL, BYN, CAD, CHF, CLP, COP, CZK, DKK, DOP, EUR, GBP, HUF, IDR, JPY, KES, MXN, MYR, NOK, PAB, PEN, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, TWD, UAH, USD, UYU, VND, ZAR" } -credit = { country = "AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IM,IN,IO,IQ,IR,IS,IT,JE,JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,LY,MA,MC,M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SI,SK,SL,SM,SN,SO,SR,SS,ST,SV,SZ,TD,TG,TH,TJ,TL,TM,TN,TO,TR,TT,TV,TZ,UA,UG,US,UY,UZ,VA,VC,VE,VN,VU,WS,ZA,ZM,ZW", currency = "AED,AUD,BDT,BGN,BND,BOB,BRL,BWP,CAD,CHF,CNY,COP,CZK,DKK,EGP,EUR,FJD,GBP,GEL,GHS,HKD,HRK,HUF,IDR,ILS,INR,IQD,IRR,ISK,JPY,KES,KRW,KWD,KZT,LAK,LKR,MAD,MDL,MMK,MOP,MXN,MYR,MZN,NAD,NGN,NOK,NPR,NZD,PEN,PHP,PKR,PLN,QAR,RON,RSD,RUB,RWF,SAR,SCR,SEK,SGD,SLL,THB,TRY,TWD,TZS,UAH,UGX,USD,UYU,VND,XAF,XOF,ZAR,ZMW,MWK" } - -[pm_filters.gocardless] -ach = { country = "US", currency = "USD" } -becs = { country = "AU", currency = "AUD" } -sepa = { country = "AU,AT,BE,BG,CA,HR,CY,CZ,DK,FI,FR,DE,HU,IT,LU,MT,NL,NZ,NO,PL,PT,IE,RO,SK,SI,ZA,ES,SE,CH,GB", currency = "GBP,EUR,SEK,DKK,AUD,NZD,CAD" } - -[pm_filters.powertranz] -credit = { country = "AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IM,IN,IO,IQ,IR,IS,IT,JE,JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,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E,RO,RS,RU,RW,SA,SB,SC,SD,SE,SG,SH,SI,SJ,SK,SL,SM,SN,SO,SR,SS,ST,SV,SX,SY,SZ,TC,TD,TF,TG,TH,TJ,TL,TM,TN,TO,TR,TT,TV,TW,TZ,UA,UG,UM,US,UY,UZ,VA,VC,VE,VG,VI,VN,VU,WF,WS,YE,YT,ZA,ZM,ZW", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLL,SOS,SRD,SSP,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL" } -boleto = { country = "BR", currency = "BRL" } -trustly = { currency = "CZK,DKK,EUR,GBP,NOK,SEK" } -ali_pay = { country = "CN", currency = "CNY" } -we_chat_pay = { country = "CN", currency = "CNY" } -klarna = { currency = "EUR,GBP,CHF,SEK" } -blik = { country = "PL", currency = "PLN" } -crypto_currency = { currency = "USD,GBP,AED" } -paysera = { currency = "EUR" } -skrill = { currency = "USD" } - -[pm_filters.placetopay] -credit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"} -debit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"} - -[pm_filters.coingate] -crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" } - -[pm_filters.paystack] -eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" } - -[pm_filters.santander] -pix = { country = "BR", currency = "BRL" } -boleto = { country = "BR", currency = "BRL" } - -[pm_filters.boku] -dana = { country = "ID", currency = "IDR" } -gcash = { country = "PH", currency = "PHP" } -go_pay = { country = "ID", currency = "IDR" } -kakao_pay = { country = "KR", currency = "KRW" } -momo = { country = "VN", currency = "VND" } - -[pm_filters.nmi] -credit = { country = "EG,ZA,BH,CY,HK,IN,ID,IL,JP,JO,KW,MY,PK,PH,SA,SG,KR,TW,TH,TR,AE,VN,AL,AD,AM,AT,AZ,BY,BE,BA,BG,HR,CZ,DK,EE,FI,FR,GE,DE,GR,HU,IS,IE,IT,KZ,LV,LI,LT,LU,MT,MD,MC,ME,NL,MK,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,TR,GB,VA,AG,BS,BB,BZ,CA,SV,GT,HN,MX,PA,KN,LC,TT,US,AU,NZ,AR,BO,BR,CL,CO,EC,GY,PY,PE,SR,UY,VE", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,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country = "AL,AD,AM,AT,AZ,BY,BE,BA,BG,CH,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GE,GR,HR,HU,IE,IS,IT,KZ,LI,LT,LU,LV,MC,MD,ME,MK,MT,NL,NO,PL,PT,RO,RU,SE,SI,SK,SM,TR,UA,VA", currency = "BHD,BIF,CHF,DJF,EUR,GBP,GNF,IQD,ISK,JPY,JOD,KMF,KRW,KWD,LYD,OMR,PYG,RWF,TND,UGX,USD,VND,VUV,XAF,XOF,XPF" } - -[pm_filters.payme] -credit = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } -debit = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } -apple_pay = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" } - -[pm_filters.paysafe] -apple_pay = {country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,PM,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,NL,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VA,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "ARS,AUD,AZN,BHD,BOB,BAM,BRL,BGN,CAD,CLP,CNY,COP,CRC,HRK,CZK,DKK,DOP,XCD,EGP,ETB,EUR,FJD,GEL,GTQ,HTG,HNL,HKD,HUF,INR,IDR,JMD,JPY,JOD,KZT,KES,KRW,KWD,LBP,LYD,MWK,MUR,MXN,MDL,MAD,ILS,NZD,NGN,NOK,OMR,PKR,PAB,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SAR,RSD,SGD,ZAR,LKR,SEK,CHF,SYP,TWD,THB,TTD,TND,TRY,UAH,AED,UYU,USD,VND" } - -[pm_filters.payjustnow] -payjustnow = { country = "ZA", currency = "ZAR" } - -[pm_filters.payjustnowinstore] -payjustnow = { country = "ZA", currency = "ZAR" } diff --git a/helm-charts/config/development.toml b/helm-charts/config/development.toml new file mode 120000 index 00000000..7f052ec6 --- /dev/null +++ b/helm-charts/config/development.toml @@ -0,0 +1 @@ +../../config/development.toml \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf index d1ec39eb..e46aa9a7 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -5,7 +5,7 @@ http { default_type application/octet-stream; upstream decision_engine { - server open-router-pg:8080; + server decision-engine-api:8080; } upstream mintlify_docs { diff --git a/website/dist/assets/index-BtfYF3zd.js b/website/dist/assets/index-BtfYF3zd.js new file mode 100644 index 00000000..0e57bbe4 --- /dev/null +++ b/website/dist/assets/index-BtfYF3zd.js @@ -0,0 +1,328 @@ +var kT=Object.defineProperty;var ET=(e,t,r)=>t in e?kT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ub=(e,t,r)=>ET(e,typeof t!="symbol"?t+"":t,r);function PT(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var gc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vj={exports:{}},rp={},yj={exports:{}},Ne={};/** + * @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 Qu=Symbol.for("react.element"),CT=Symbol.for("react.portal"),TT=Symbol.for("react.fragment"),NT=Symbol.for("react.strict_mode"),$T=Symbol.for("react.profiler"),RT=Symbol.for("react.provider"),IT=Symbol.for("react.context"),MT=Symbol.for("react.forward_ref"),DT=Symbol.for("react.suspense"),LT=Symbol.for("react.memo"),BT=Symbol.for("react.lazy"),cb=Symbol.iterator;function FT(e){return e===null||typeof e!="object"?null:(e=cb&&e[cb]||e["@@iterator"],typeof e=="function"?e:null)}var gj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xj=Object.assign,bj={};function Ss(e,t,r){this.props=e,this.context=t,this.refs=bj,this.updater=r||gj}Ss.prototype.isReactComponent={};Ss.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ss.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wj(){}wj.prototype=Ss.prototype;function Kg(e,t,r){this.props=e,this.context=t,this.refs=bj,this.updater=r||gj}var qg=Kg.prototype=new wj;qg.constructor=Kg;xj(qg,Ss.prototype);qg.isPureReactComponent=!0;var fb=Array.isArray,_j=Object.prototype.hasOwnProperty,Xg={current:null},Sj={key:!0,ref:!0,__self:!0,__source:!0};function Oj(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)_j.call(t,n)&&!Sj.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,G=M[J];if(0>>1;Ji(de,W))uei(Se,de)?(M[J]=Se,M[ue]=W,J=ue):(M[J]=de,M[X]=W,J=X);else if(uei(Se,W))M[J]=Se,M[ue]=W,J=ue;else break e}}return B}function i(M,B){var W=M.sortIndex-B.sortIndex;return W!==0?W:M.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,c=null,p=3,h=!1,x=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var B=r(u);B!==null;){if(B.callback===null)n(u);else if(B.startTime<=M)n(u),B.sortIndex=B.expirationTime,t(l,B);else break;B=r(u)}}function S(M){if(v=!1,w(M),!x)if(r(l)!==null)x=!0,z(b);else{var B=r(u);B!==null&&U(S,B.startTime-M)}}function b(M,B){x=!1,v&&(v=!1,g(k),k=-1),h=!0;var W=p;try{for(w(B),c=r(l);c!==null&&(!(c.expirationTime>B)||M&&!$());){var J=c.callback;if(typeof J=="function"){c.callback=null,p=c.priorityLevel;var G=J(c.expirationTime<=B);B=e.unstable_now(),typeof G=="function"?c.callback=G:c===r(l)&&n(l),w(B)}else n(l);c=r(l)}if(c!==null)var Q=!0;else{var X=r(u);X!==null&&U(S,X.startTime-B),Q=!1}return Q}finally{c=null,p=W,h=!1}}var _=!1,O=null,k=-1,P=5,R=-1;function $(){return!(e.unstable_now()-RM||125J?(M.sortIndex=W,t(u,M),r(l)===null&&M===r(u)&&(v?(g(k),k=-1):v=!0,U(S,W-J))):(M.sortIndex=G,t(l,M),x||h||(x=!0,z(b))),M},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(M){var B=p;return function(){var W=p;p=B;try{return M.apply(this,arguments)}finally{p=W}}}})(Pj);Ej.exports=Pj;var QT=Ej.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 JT=j,Rr=QT;function Z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tv=Object.prototype.hasOwnProperty,eN=/^[: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]*$/,pb={},hb={};function tN(e){return tv.call(hb,e)?!0:tv.call(pb,e)?!1:eN.test(e)?hb[e]=!0:(pb[e]=!0,!1)}function rN(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nN(e,t,r,n){if(t===null||typeof t>"u"||rN(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Kt[e]=new fr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Kt[t]=new fr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Kt[e]=new fr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Kt[e]=new fr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Kt[e]=new fr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Kt[e]=new fr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Kt[e]=new fr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Kt[e]=new fr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Kt[e]=new fr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zg=/[\-:]([a-z])/g;function Qg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Zg,Qg);Kt[t]=new fr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zg,Qg);Kt[t]=new fr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zg,Qg);Kt[t]=new fr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Kt[e]=new fr(e,1,!1,e.toLowerCase(),null,!1,!1)});Kt.xlinkHref=new fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Kt[e]=new fr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jg(e,t,r,n){var i=Kt.hasOwnProperty(t)?Kt[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` +`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Eh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ml(e):""}function iN(e){switch(e.tag){case 5:return ml(e.type);case 16:return ml("Lazy");case 13:return ml("Suspense");case 19:return ml("SuspenseList");case 0:case 2:case 15:return e=Ph(e.type,!1),e;case 11:return e=Ph(e.type.render,!1),e;case 1:return e=Ph(e.type,!0),e;default:return""}}function av(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case uo:return"Fragment";case lo:return"Portal";case rv:return"Profiler";case e0:return"StrictMode";case nv:return"Suspense";case iv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Nj:return(e.displayName||"Context")+".Consumer";case Tj:return(e._context.displayName||"Context")+".Provider";case t0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case r0:return t=e.displayName||null,t!==null?t:av(e.type)||"Memo";case _i:t=e._payload,e=e._init;try{return av(e(t))}catch{}}return null}function aN(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return av(t);case 8:return t===e0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ki(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oN(e){var t=Rj(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wc(e){e._valueTracker||(e._valueTracker=oN(e))}function Ij(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Rj(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function gf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ov(e,t){var r=t.checked;return yt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function vb(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ki(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mj(e,t){t=t.checked,t!=null&&Jg(e,"checked",t,!1)}function sv(e,t){Mj(e,t);var r=Ki(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?lv(e,t.type,r):t.hasOwnProperty("defaultValue")&&lv(e,t.type,Ki(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yb(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function lv(e,t,r){(t!=="number"||gf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var vl=Array.isArray;function Eo(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=_c.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ol={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},sN=["Webkit","ms","Moz","O"];Object.keys(Ol).forEach(function(e){sN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ol[t]=Ol[e]})});function Fj(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ol.hasOwnProperty(e)&&Ol[e]?(""+t).trim():t+"px"}function zj(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Fj(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var lN=yt({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 fv(e,t){if(t){if(lN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function dv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pv=null;function n0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hv=null,Po=null,Co=null;function bb(e){if(e=tc(e)){if(typeof hv!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=sp(t),hv(e.stateNode,e.type,t))}}function Uj(e){Po?Co?Co.push(e):Co=[e]:Po=e}function Vj(){if(Po){var e=Po,t=Co;if(Co=Po=null,bb(e),t)for(e=0;e>>=0,e===0?32:31-(xN(e)/bN|0)|0}var Sc=64,Oc=4194304;function yl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function _f(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=yl(s):(a&=o,a!==0&&(n=yl(a)))}else o=r&~i,o!==0?n=yl(o):a!==0&&(n=yl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Ju(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=r}function ON(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Al),Pb=" ",Cb=!1;function uA(e,t){switch(e){case"keyup":return QN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var co=!1;function e$(e,t){switch(e){case"compositionend":return cA(t);case"keypress":return t.which!==32?null:(Cb=!0,Pb);case"textInput":return e=t.data,e===Pb&&Cb?null:e;default:return null}}function t$(e,t){if(co)return e==="compositionend"||!f0&&uA(e,t)?(e=sA(),af=l0=Ti=null,co=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Rb(r)}}function hA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mA(){for(var e=window,t=gf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=gf(e.document)}return t}function d0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function c$(e){var t=mA(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&hA(r.ownerDocument.documentElement,r)){if(n!==null&&d0(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=Ib(r,a);var o=Ib(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,fo=null,bv=null,El=null,wv=!1;function Mb(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wv||fo==null||fo!==gf(n)||(n=fo,"selectionStart"in n&&d0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),El&&Zl(El,n)||(El=n,n=jf(bv,"onSelect"),0mo||(e.current=kv[mo],kv[mo]=null,mo--)}function nt(e,t){mo++,kv[mo]=e.current,e.current=t}var qi={},nr=ta(qi),gr=ta(!1),$a=qi;function zo(e,t){var r=e.type.contextTypes;if(!r)return qi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xr(e){return e=e.childContextTypes,e!=null}function kf(){ut(gr),ut(nr)}function Vb(e,t,r){if(nr.current!==qi)throw Error(Z(168));nt(nr,t),nt(gr,r)}function OA(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Z(108,aN(e)||"Unknown",i));return yt({},r,n)}function Ef(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qi,$a=nr.current,nt(nr,e),nt(gr,gr.current),!0}function Wb(e,t,r){var n=e.stateNode;if(!n)throw Error(Z(169));r?(e=OA(e,t,$a),n.__reactInternalMemoizedMergedChildContext=e,ut(gr),ut(nr),nt(nr,e)):ut(gr),nt(gr,r)}var Un=null,lp=!1,Vh=!1;function jA(e){Un===null?Un=[e]:Un.push(e)}function _$(e){lp=!0,jA(e)}function ra(){if(!Vh&&Un!==null){Vh=!0;var e=0,t=Ke;try{var r=Un;for(Ke=1;e>=o,i-=o,Wn=1<<32-pn(t)+i|r<k?(P=O,O=null):P=O.sibling;var R=p(g,O,w[k],S);if(R===null){O===null&&(O=P);break}e&&O&&R.alternate===null&&t(g,O),m=a(R,m,k),_===null?b=R:_.sibling=R,_=R,O=P}if(k===w.length)return r(g,O),ct&&pa(g,k),b;if(O===null){for(;kk?(P=O,O=null):P=O.sibling;var $=p(g,O,R.value,S);if($===null){O===null&&(O=P);break}e&&O&&$.alternate===null&&t(g,O),m=a($,m,k),_===null?b=$:_.sibling=$,_=$,O=P}if(R.done)return r(g,O),ct&&pa(g,k),b;if(O===null){for(;!R.done;k++,R=w.next())R=c(g,R.value,S),R!==null&&(m=a(R,m,k),_===null?b=R:_.sibling=R,_=R);return ct&&pa(g,k),b}for(O=n(g,O);!R.done;k++,R=w.next())R=h(O,g,k,R.value,S),R!==null&&(e&&R.alternate!==null&&O.delete(R.key===null?k:R.key),m=a(R,m,k),_===null?b=R:_.sibling=R,_=R);return e&&O.forEach(function(C){return t(g,C)}),ct&&pa(g,k),b}function y(g,m,w,S){if(typeof w=="object"&&w!==null&&w.type===uo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case bc:e:{for(var b=w.key,_=m;_!==null;){if(_.key===b){if(b=w.type,b===uo){if(_.tag===7){r(g,_.sibling),m=i(_,w.props.children),m.return=g,g=m;break e}}else if(_.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===_i&&Kb(b)===_.type){r(g,_.sibling),m=i(_,w.props),m.ref=el(g,_,w),m.return=g,g=m;break e}r(g,_);break}else t(g,_);_=_.sibling}w.type===uo?(m=Ea(w.props.children,g.mode,S,w.key),m.return=g,g=m):(S=pf(w.type,w.key,w.props,null,g.mode,S),S.ref=el(g,m,w),S.return=g,g=S)}return o(g);case lo:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){r(g,m.sibling),m=i(m,w.children||[]),m.return=g,g=m;break e}else{r(g,m);break}else t(g,m);m=m.sibling}m=Zh(w,g.mode,S),m.return=g,g=m}return o(g);case _i:return _=w._init,y(g,m,_(w._payload),S)}if(vl(w))return x(g,m,w,S);if(Xs(w))return v(g,m,w,S);Tc(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(r(g,m.sibling),m=i(m,w),m.return=g,g=m):(r(g,m),m=Yh(w,g.mode,S),m.return=g,g=m),o(g)):r(g,m)}return y}var Vo=PA(!0),CA=PA(!1),Tf=ta(null),Nf=null,go=null,v0=null;function y0(){v0=go=Nf=null}function g0(e){var t=Tf.current;ut(Tf),e._currentValue=t}function Cv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function No(e,t){Nf=e,v0=go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mr=!0),e.firstContext=null)}function Zr(e){var t=e._currentValue;if(v0!==e)if(e={context:e,memoizedValue:t,next:null},go===null){if(Nf===null)throw Error(Z(308));go=e,Nf.dependencies={lanes:0,firstContext:e}}else go=go.next=e;return t}var ba=null;function x0(e){ba===null?ba=[e]:ba.push(e)}function TA(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,x0(t)):(r.next=i.next,i.next=r),t.interleaved=r,ni(e,n)}function ni(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Si=!1;function b0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function NA(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,De&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ni(e,r)}return i=n.interleaved,i===null?(t.next=t,x0(n)):(t.next=i.next,i.next=t),n.interleaved=t,ni(e,r)}function sf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,a0(e,r)}}function qb(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function $f(e,t,r,n){var i=e.updateQueue;Si=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var c=i.baseState;o=0,f=u=l=null,s=a;do{var p=s.lane,h=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,v=s;switch(p=t,h=r,v.tag){case 1:if(x=v.payload,typeof x=="function"){c=x.call(h,c,p);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,p=typeof x=="function"?x.call(h,c,p):x,p==null)break e;c=yt({},c,p);break e;case 2:Si=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,l=c):f=f.next=h,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Ma|=o,e.lanes=o,e.memoizedState=c}}function Xb(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Hh.transition;Hh.transition={};try{e(!1),t()}finally{Ke=r,Hh.transition=n}}function XA(){return Qr().memoizedState}function A$(e,t,r){var n=zi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},YA(e))ZA(t,r);else if(r=TA(e,t,r,n),r!==null){var i=ur();hn(r,e,n,i),QA(r,t,n)}}function k$(e,t,r){var n=zi(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(YA(e))ZA(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,mn(s,o)){var l=t.interleaved;l===null?(i.next=i,x0(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=TA(e,t,i,n),r!==null&&(i=ur(),hn(r,e,n,i),QA(r,t,n))}}function YA(e){var t=e.alternate;return e===mt||t!==null&&t===mt}function ZA(e,t){Pl=If=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function QA(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,a0(e,r)}}var Mf={readContext:Zr,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},E$={readContext:Zr,useCallback:function(e,t){return Sn().memoizedState=[e,t===void 0?null:t],e},useContext:Zr,useEffect:Zb,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,uf(4194308,4,WA.bind(null,t,e),r)},useLayoutEffect:function(e,t){return uf(4194308,4,e,t)},useInsertionEffect:function(e,t){return uf(4,2,e,t)},useMemo:function(e,t){var r=Sn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Sn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=A$.bind(null,mt,e),[n.memoizedState,e]},useRef:function(e){var t=Sn();return e={current:e},t.memoizedState=e},useState:Yb,useDebugValue:E0,useDeferredValue:function(e){return Sn().memoizedState=e},useTransition:function(){var e=Yb(!1),t=e[0];return e=j$.bind(null,e[1]),Sn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=mt,i=Sn();if(ct){if(r===void 0)throw Error(Z(407));r=r()}else{if(r=t(),zt===null)throw Error(Z(349));Ia&30||MA(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,Zb(LA.bind(null,n,a,e),[e]),n.flags|=2048,au(9,DA.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Sn(),t=zt.identifierPrefix;if(ct){var r=Hn,n=Wn;r=(n&~(1<<32-pn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[jn]=t,e[eu]=n,lk(e,t,!1,!1),t.stateNode=e;e:{switch(o=dv(r,n),r){case"dialog":at("cancel",e),at("close",e),i=n;break;case"iframe":case"object":case"embed":at("load",e),i=n;break;case"video":case"audio":for(i=0;iGo&&(t.flags|=128,n=!0,tl(a,!1),t.lanes=4194304)}else{if(!n)if(e=Rf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),tl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ct)return Yt(t),null}else 2*_t()-a.renderingStartTime>Go&&r!==1073741824&&(t.flags|=128,n=!0,tl(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=_t(),t.sibling=null,r=pt.current,nt(pt,n?r&1|2:r&1),t):(Yt(t),null);case 22:case 23:return R0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?kr&1073741824&&(Yt(t),t.subtreeFlags&6&&(t.flags|=8192)):Yt(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function M$(e,t){switch(h0(t),t.tag){case 1:return xr(t.type)&&kf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wo(),ut(gr),ut(nr),S0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _0(t),null;case 13:if(ut(pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(pt),null;case 4:return Wo(),null;case 10:return g0(t.type._context),null;case 22:case 23:return R0(),null;case 24:return null;default:return null}}var $c=!1,er=!1,D$=typeof WeakSet=="function"?WeakSet:Set,se=null;function xo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){gt(e,t,n)}else r.current=null}function Bv(e,t,r){try{r()}catch(n){gt(e,t,n)}}var l1=!1;function L$(e,t){if(_v=Sf,e=mA(),d0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,c=e,p=null;t:for(;;){for(var h;c!==r||i!==0&&c.nodeType!==3||(s=o+i),c!==a||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)p=c,c=h;for(;;){if(c===e)break t;if(p===r&&++u===i&&(s=o),p===a&&++f===n&&(l=o),(h=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Sv={focusedElem:e,selectionRange:r},Sf=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,y=x.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:sn(t.type,v),y);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(S){gt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return x=l1,l1=!1,x}function Cl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Bv(t,r,a)}i=i.next}while(i!==n)}}function fp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Fv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function fk(e){var t=e.alternate;t!==null&&(e.alternate=null,fk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jn],delete t[eu],delete t[Av],delete t[b$],delete t[w$])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dk(e){return e.tag===5||e.tag===3||e.tag===4}function u1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dk(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Af));else if(n!==4&&(e=e.child,e!==null))for(zv(e,t,r),e=e.sibling;e!==null;)zv(e,t,r),e=e.sibling}function Uv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Uv(e,t,r),e=e.sibling;e!==null;)Uv(e,t,r),e=e.sibling}var Ht=null,ln=!1;function bi(e,t,r){for(r=r.child;r!==null;)pk(e,t,r),r=r.sibling}function pk(e,t,r){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(np,r)}catch{}switch(r.tag){case 5:er||xo(r,t);case 6:var n=Ht,i=ln;Ht=null,bi(e,t,r),Ht=n,ln=i,Ht!==null&&(ln?(e=Ht,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ht.removeChild(r.stateNode));break;case 18:Ht!==null&&(ln?(e=Ht,r=r.stateNode,e.nodeType===8?Uh(e.parentNode,r):e.nodeType===1&&Uh(e,r),Xl(e)):Uh(Ht,r.stateNode));break;case 4:n=Ht,i=ln,Ht=r.stateNode.containerInfo,ln=!0,bi(e,t,r),Ht=n,ln=i;break;case 0:case 11:case 14:case 15:if(!er&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Bv(r,t,o),i=i.next}while(i!==n)}bi(e,t,r);break;case 1:if(!er&&(xo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){gt(r,t,s)}bi(e,t,r);break;case 21:bi(e,t,r);break;case 22:r.mode&1?(er=(n=er)||r.memoizedState!==null,bi(e,t,r),er=n):bi(e,t,r);break;default:bi(e,t,r)}}function c1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new D$),t.forEach(function(n){var i=K$.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function nn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=_t()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*F$(n/1960))-n,10e?16:e,Ni===null)var n=!1;else{if(e=Ni,Ni=null,Bf=0,De&6)throw Error(Z(331));var i=De;for(De|=4,se=e.current;se!==null;){var a=se,o=a.child;if(se.flags&16){var s=a.deletions;if(s!==null){for(var l=0;l_t()-N0?ka(e,0):T0|=r),br(e,t)}function wk(e,t){t===0&&(e.mode&1?(t=Oc,Oc<<=1,!(Oc&130023424)&&(Oc=4194304)):t=1);var r=ur();e=ni(e,t),e!==null&&(Ju(e,t,r),br(e,r))}function G$(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),wk(e,r)}function K$(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Z(314))}n!==null&&n.delete(t),wk(e,r)}var _k;_k=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||gr.current)mr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return mr=!1,R$(e,t,r);mr=!!(e.flags&131072)}else mr=!1,ct&&t.flags&1048576&&AA(t,Cf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;cf(e,t),e=t.pendingProps;var i=zo(t,nr.current);No(t,r),i=j0(null,t,n,e,i,r);var a=A0();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xr(n)?(a=!0,Ef(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,b0(t),i.updater=cp,t.stateNode=i,i._reactInternals=t,Nv(t,n,e,r),t=Iv(null,t,n,!0,a,r)):(t.tag=0,ct&&a&&p0(t),ir(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(cf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=X$(n),e=sn(n,e),i){case 0:t=Rv(null,t,n,e,r);break e;case 1:t=a1(null,t,n,e,r);break e;case 11:t=n1(null,t,n,e,r);break e;case 14:t=i1(null,t,n,sn(n.type,e),r);break e}throw Error(Z(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),Rv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),a1(e,t,n,i,r);case 3:e:{if(ak(t),e===null)throw Error(Z(387));n=t.pendingProps,a=t.memoizedState,i=a.element,NA(e,t),$f(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Ho(Error(Z(423)),t),t=o1(e,t,n,r,i);break e}else if(n!==i){i=Ho(Error(Z(424)),t),t=o1(e,t,n,r,i);break e}else for(Tr=Li(t.stateNode.containerInfo.firstChild),Nr=t,ct=!0,cn=null,r=CA(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Uo(),n===i){t=ii(e,t,r);break e}ir(e,t,n,r)}t=t.child}return t;case 5:return $A(t),e===null&&Pv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Ov(n,i)?o=null:a!==null&&Ov(n,a)&&(t.flags|=32),ik(e,t),ir(e,t,o,r),t.child;case 6:return e===null&&Pv(t),null;case 13:return ok(e,t,r);case 4:return w0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Vo(t,null,n,r):ir(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),n1(e,t,n,i,r);case 7:return ir(e,t,t.pendingProps,r),t.child;case 8:return ir(e,t,t.pendingProps.children,r),t.child;case 12:return ir(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,nt(Tf,n._currentValue),n._currentValue=o,a!==null)if(mn(a.value,o)){if(a.children===i.children&&!gr.current){t=ii(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Yn(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Cv(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Z(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Cv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}ir(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,No(t,r),i=Zr(i),n=n(i),t.flags|=1,ir(e,t,n,r),t.child;case 14:return n=t.type,i=sn(n,t.pendingProps),i=sn(n.type,i),i1(e,t,n,i,r);case 15:return rk(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),cf(e,t),t.tag=1,xr(n)?(e=!0,Ef(t)):e=!1,No(t,r),JA(t,n,i),Nv(t,n,i,r),Iv(null,t,n,!0,e,r);case 19:return sk(e,t,r);case 22:return nk(e,t,r)}throw Error(Z(156,t.tag))};function Sk(e,t){return Yj(e,t)}function q$(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,r,n){return new q$(e,t,r,n)}function M0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function X$(e){if(typeof e=="function")return M0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===t0)return 11;if(e===r0)return 14}return 2}function Ui(e,t){var r=e.alternate;return r===null?(r=Kr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function pf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")M0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case uo:return Ea(r.children,i,a,t);case e0:o=8,i|=8;break;case rv:return e=Kr(12,r,t,i|2),e.elementType=rv,e.lanes=a,e;case nv:return e=Kr(13,r,t,i),e.elementType=nv,e.lanes=a,e;case iv:return e=Kr(19,r,t,i),e.elementType=iv,e.lanes=a,e;case $j:return pp(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Tj:o=10;break e;case Nj:o=9;break e;case t0:o=11;break e;case r0:o=14;break e;case _i:o=16,n=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=Kr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Ea(e,t,r,n){return e=Kr(7,e,n,t),e.lanes=r,e}function pp(e,t,r,n){return e=Kr(22,e,n,t),e.elementType=$j,e.lanes=r,e.stateNode={isHidden:!1},e}function Yh(e,t,r){return e=Kr(6,e,null,t),e.lanes=r,e}function Zh(e,t,r){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Y$(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Th(0),this.expirationTimes=Th(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Th(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function D0(e,t,r,n,i,a,o,s,l){return e=new Y$(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Kr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},b0(a),e}function Z$(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kk)}catch(e){console.error(e)}}kk(),kj.exports=Mr;var wo=kj.exports,g1=wo;ev.createRoot=g1.createRoot,ev.hydrateRoot=g1.hydrateRoot;/** + * @remix-run/router v1.23.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function su(){return su=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function z0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function nR(){return Math.random().toString(36).substr(2,8)}function b1(e,t){return{usr:e.state,key:e.key,idx:t}}function Kv(e,t,r,n){return r===void 0&&(r=null),su({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?As(t):t,{state:r,key:t&&t.key||n||nR()})}function Uf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function As(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function iR(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=$i.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(su({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){s=$i.Pop;let y=f(),g=y==null?null:y-u;u=y,l&&l({action:s,location:v.location,delta:g})}function p(y,g){s=$i.Push;let m=Kv(v.location,y,g);u=f()+1;let w=b1(m,u),S=v.createHref(m);try{o.pushState(w,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;i.location.assign(S)}a&&l&&l({action:s,location:v.location,delta:1})}function h(y,g){s=$i.Replace;let m=Kv(v.location,y,g);u=f();let w=b1(m,u),S=v.createHref(m);o.replaceState(w,"",S),a&&l&&l({action:s,location:v.location,delta:0})}function x(y){let g=i.location.origin!=="null"?i.location.origin:i.location.href,m=typeof y=="string"?y:Uf(y);return m=m.replace(/ $/,"%20"),vt(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let v={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(x1,c),l=y,()=>{i.removeEventListener(x1,c),l=null}},createHref(y){return t(i,y)},createURL:x,encodeLocation(y){let g=x(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:h,go(y){return o.go(y)}};return v}var w1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(w1||(w1={}));function aR(e,t,r){return r===void 0&&(r="/"),oR(e,t,r)}function oR(e,t,r,n){let i=typeof t=="string"?As(t):t,a=Ko(i.pathname||"/",r);if(a==null)return null;let o=Ek(e);sR(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(vt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Vi([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(vt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Ek(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:hR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of Pk(a.path))i(a,o,l)}),t}function Pk(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=Pk(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function sR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:mR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const lR=/^:[\w-]+$/,uR=3,cR=2,fR=1,dR=10,pR=-2,_1=e=>e==="*";function hR(e,t){let r=e.split("/"),n=r.length;return r.some(_1)&&(n+=pR),t&&(n+=cR),r.filter(i=>!_1(i)).reduce((i,a)=>i+(lR.test(a)?uR:a===""?fR:dR),n)}function mR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function vR(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=f;if(p==="*"){let v=s[c]||"";o=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const x=s[c];return h&&!x?u[p]=void 0:u[p]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function yR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),z0(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function gR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return z0(!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 Ko(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const xR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bR=e=>xR.test(e);function wR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?As(e):e,a;if(r)if(bR(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),z0(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=S1(r.substring(1),"/"):a=S1(r,t)}else a=t;return{pathname:a,search:OR(n),hash:jR(i)}}function S1(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Qh(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function _R(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function U0(e,t){let r=_R(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function V0(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=As(e):(i=su({},e),vt(!i.pathname||!i.pathname.includes("?"),Qh("?","pathname","search",i)),vt(!i.pathname||!i.pathname.includes("#"),Qh("#","pathname","hash",i)),vt(!i.search||!i.search.includes("#"),Qh("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let c=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),c-=1;i.pathname=p.join("/")}s=c>=0?t[c]:"/"}let l=wR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Vi=e=>e.join("/").replace(/\/\/+/g,"/"),SR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),OR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function AR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ck=["post","put","patch","delete"];new Set(Ck);const kR=["get",...Ck];new Set(kR);/** + * React Router v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),j.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let c=V0(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Vi([t,c.pathname])),(f.replace?n.replace:n.push)(c,f.state,f)},[t,n,o,a,e])}const CR=j.createContext(null);function TR(e){let t=j.useContext(pi).outlet;return t&&j.createElement(CR.Provider,{value:e},t)}function wp(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=j.useContext(di),{matches:i}=j.useContext(pi),{pathname:a}=Es(),o=JSON.stringify(U0(i,n.v7_relativeSplatPath));return j.useMemo(()=>V0(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function NR(e,t){return $R(e,t)}function $R(e,t,r,n){ks()||vt(!1);let{navigator:i}=j.useContext(di),{matches:a}=j.useContext(pi),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Es(),f;if(t){var c;let y=typeof t=="string"?As(t):t;l==="/"||(c=y.pathname)!=null&&c.startsWith(l)||vt(!1),f=y}else f=u;let p=f.pathname||"/",h=p;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let x=aR(e,{pathname:h}),v=LR(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Vi([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Vi([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&v?j.createElement(xp.Provider,{value:{location:lu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:$i.Pop}},v):v}function RR(){let e=UR(),t=AR(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:i},r):null,null)}const IR=j.createElement(RR,null);class MR extends j.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?j.createElement(pi.Provider,{value:this.props.routeContext},j.createElement(Nk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function DR(e){let{routeContext:t,match:r,children:n}=e,i=j.useContext(gp);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(pi.Provider,{value:t},n)}function LR(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);f>=0||vt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,c,p)=>{let h,x=!1,v=null,y=null;r&&(h=s&&c.route.id?s[c.route.id]:void 0,v=c.route.errorElement||IR,l&&(u<0&&p===0?(WR("route-fallback"),x=!0,y=null):u===p&&(x=!0,y=c.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=v:x?w=y:c.route.Component?w=j.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=f,j.createElement(DR,{match:c,routeContext:{outlet:f,matches:g,isDataRoute:r!=null},children:w})};return r&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?j.createElement(MR,{location:r.location,revalidation:r.revalidation,component:v,error:h,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var Rk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Rk||{}),Ik=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}(Ik||{});function BR(e){let t=j.useContext(gp);return t||vt(!1),t}function FR(e){let t=j.useContext(Tk);return t||vt(!1),t}function zR(e){let t=j.useContext(pi);return t||vt(!1),t}function Mk(e){let t=zR(),r=t.matches[t.matches.length-1];return r.route.id||vt(!1),r.route.id}function UR(){var e;let t=j.useContext(Nk),r=FR(),n=Mk();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function VR(){let{router:e}=BR(Rk.UseNavigateStable),t=Mk(Ik.UseNavigateStable),r=j.useRef(!1);return $k(()=>{r.current=!0}),j.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,lu({fromRouteId:t},a)))},[e,t])}const O1={};function WR(e,t,r){O1[e]||(O1[e]=!0)}function HR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function GR(e){let{to:t,replace:r,state:n,relative:i}=e;ks()||vt(!1);let{future:a,static:o}=j.useContext(di),{matches:s}=j.useContext(pi),{pathname:l}=Es(),u=bp(),f=V0(t,U0(s,a.v7_relativeSplatPath),l,i==="path"),c=JSON.stringify(f);return j.useEffect(()=>u(JSON.parse(c),{replace:r,state:n,relative:i}),[u,c,i,r,n]),null}function KR(e){return TR(e.context)}function _n(e){vt(!1)}function qR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=$i.Pop,navigator:a,static:o=!1,future:s}=e;ks()&&vt(!1);let l=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:l,navigator:a,static:o,future:lu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=As(n));let{pathname:f="/",search:c="",hash:p="",state:h=null,key:x="default"}=n,v=j.useMemo(()=>{let y=Ko(f,l);return y==null?null:{location:{pathname:y,search:c,hash:p,state:h,key:x},navigationType:i}},[l,f,c,p,h,x,i]);return v==null?null:j.createElement(di.Provider,{value:u},j.createElement(xp.Provider,{children:r,value:v}))}function XR(e){let{children:t,location:r}=e;return NR(Xv(t),r)}new Promise(()=>{});function Xv(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,i)=>{if(!j.isValidElement(n))return;let a=[...t,i];if(n.type===j.Fragment){r.push.apply(r,Xv(n.props.children,a));return}n.type!==_n&&vt(!1),!n.props.index||!n.props.children||vt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Xv(n.props.children,a)),r.push(o)}),r}/** + * React Router DOM v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Vf(){return Vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function YR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZR(e,t){return e.button===0&&(!t||t==="_self")&&!YR(e)}const QR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],JR=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],eI="6";try{window.__reactRouterVersion=eI}catch{}const tI=j.createContext({isTransitioning:!1}),rI="startTransition",j1=HT[rI];function nI(e){let{basename:t,children:r,future:n,window:i}=e,a=j.useRef();a.current==null&&(a.current=rR({window:i,v5Compat:!0}));let o=a.current,[s,l]=j.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=j.useCallback(c=>{u&&j1?j1(()=>l(c)):l(c)},[l,u]);return j.useLayoutEffect(()=>o.listen(f),[o,f]),j.useEffect(()=>HR(n),[n]),j.createElement(qR,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const iI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oI=j.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:c}=t,p=Dk(t,QR),{basename:h}=j.useContext(di),x,v=!1;if(typeof u=="string"&&aI.test(u)&&(x=u,iI))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),b=Ko(S.pathname,h);S.origin===w.origin&&b!=null?u=b+S.search+S.hash:v=!0}catch{}let y=ER(u,{relative:i}),g=uI(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:c});function m(w){n&&n(w),w.defaultPrevented||g(w)}return j.createElement("a",Vf({},p,{href:x||y,onClick:v||a?n:m,ref:r,target:l}))}),sI=j.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:o=!1,style:s,to:l,viewTransition:u,children:f}=t,c=Dk(t,JR),p=wp(l,{relative:c.relative}),h=Es(),x=j.useContext(Tk),{navigator:v,basename:y}=j.useContext(di),g=x!=null&&cI(p)&&u===!0,m=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&y&&(S=Ko(S,y)||S);const b=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!o&&w.startsWith(m)&&w.charAt(b)==="/",O=S!=null&&(S===m||!o&&S.startsWith(m)&&S.charAt(m.length)==="/"),k={isActive:_,isPending:O,isTransitioning:g},P=_?n:void 0,R;typeof a=="function"?R=a(k):R=[a,_?"active":null,O?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let $=typeof s=="function"?s(k):s;return j.createElement(oI,Vf({},c,{"aria-current":P,className:R,ref:r,style:$,to:l,viewTransition:u}),typeof f=="function"?f(k):f)});var Yv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Yv||(Yv={}));var A1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(A1||(A1={}));function lI(e){let t=j.useContext(gp);return t||vt(!1),t}function uI(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=bp(),u=Es(),f=wp(e,{relative:o});return j.useCallback(c=>{if(ZR(c,r)){c.preventDefault();let p=n!==void 0?n:Uf(u)===Uf(f);l(e,{replace:p,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function cI(e,t){t===void 0&&(t={});let r=j.useContext(tI);r==null&&vt(!1);let{basename:n}=lI(Yv.useViewTransitionState),i=wp(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=Ko(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Ko(r.nextLocation.pathname,n)||r.nextLocation.pathname;return qv(i.pathname,o)!=null||qv(i.pathname,a)!=null}/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var fI={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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ze=(e,t)=>{const r=j.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>j.createElement("svg",{ref:f,...fI,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:["lucide",`lucide-${dI(e)}`,s].join(" "),...u},[...t.map(([c,p])=>j.createElement(c,p)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jh=Ze("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pI=Ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hI=Ze("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mI=Ze("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xl=Ze("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bl=Ze("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vI=Ze("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yI=Ze("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gI=Ze("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.363.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=Ze("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + * @license lucide-react v0.363.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=Ze("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _p=Ze("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bI=Ze("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wI=Ze("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _I=Ze("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SI=Ze("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OI=Ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jI=Ze("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lk=Ze("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wf=Ze("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mc=Ze("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.363.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=Ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AI=Ze("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kI=Ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const EI=Ze("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ai=Ze("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bk=Ze("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PI=Ze("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"}]]);function CI(){return d.jsxs("aside",{className:"w-64 shrink-0 flex flex-col h-screen bg-white dark:bg-black border-r border-slate-200 dark:border-[#151515] relative z-20 transition-colors duration-300",children:[d.jsxs("div",{className:"h-20 px-6 flex items-center gap-3.5 border-b border-slate-200 dark:border-[#151515] transition-colors duration-300",children:[d.jsx("div",{className:"w-9 h-9 bg-brand-500 dark:bg-black border border-brand-600 dark:border-[#2a2a2e] rounded-xl flex items-center justify-center shadow-sm",children:d.jsx(PI,{size:18,className:"text-white",strokeWidth:2})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[16px] font-bold tracking-widest text-slate-900 dark:text-white leading-tight uppercase",children:"Decision"}),d.jsx("p",{className:"text-[10px] uppercase text-brand-600 dark:text-[#66666e] tracking-wider leading-tight font-semibold",children:"Engine"})]})]}),d.jsxs("nav",{className:"flex-1 px-4 py-8 space-y-1 overflow-y-auto",children:[d.jsx(ua,{to:"/",icon:SI,end:!0,children:"Overview"}),d.jsx(ua,{to:"/decisions",icon:kI,children:"Decision Explorer"}),d.jsx("div",{className:"pt-8 pb-3 px-3 flex items-center gap-2",children:d.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-slate-400 dark:text-[#66666e]",children:"Routing"})}),d.jsx(ua,{to:"/routing",icon:bI,end:!0,children:"Routing Hub"}),d.jsx(ua,{to:"/routing/sr",icon:Bk,indent:!0,children:"Auth-Rate Based"}),d.jsx(ua,{to:"/routing/rules",icon:hI,indent:!0,children:"Rule-Based (Euclid)"}),d.jsx(ua,{to:"/routing/volume",icon:Wf,indent:!0,children:"Volume Split"}),d.jsx(ua,{to:"/routing/debit",icon:Lk,indent:!0,children:"Debit Routing"})]}),d.jsx("div",{className:"px-6 py-5 border-t border-slate-200 dark:border-[#151515] bg-slate-50 dark:bg-black transition-colors duration-300",children:d.jsx("span",{className:"text-[11px] text-slate-500 dark:text-[#66666e] font-medium tracking-wide",children:"v1.2.1"})})]})}function ua({to:e,icon:t,children:r,end:n,indent:i}){return d.jsx(sI,{to:e,end:n,className:({isActive:a})=>`group relative flex items-center gap-3 px-4 py-3 rounded-[14px] text-[14px] font-medium transition-all duration-200 ${i?"ml-3 w-[calc(100%-12px)]":""} ${a?"bg-slate-100 text-brand-600 dark:bg-[#151518] dark:text-white shadow-sm":"text-slate-500 hover:text-slate-900 hover:bg-slate-50 dark:text-[#888891] dark:hover:text-white dark:hover:bg-[#0c0c0e]"}`,children:({isActive:a})=>d.jsxs(d.Fragment,{children:[d.jsx(t,{size:18,className:`transition-colors duration-200 ${a?"text-brand-600 dark:text-white":"text-slate-400 dark:text-[#55555e] group-hover:text-slate-600 dark:group-hover:text-white"}`,strokeWidth:a?2.5:2}),d.jsx("span",{className:"flex-1",children:r})]})})}const TI={},k1=e=>{let t;const r=new Set,n=(f,c)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=c??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(x=>x(t,h))}},i=()=>t,l={setState:n,getState:i,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(TI?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,i,l);return l},NI=e=>e?k1(e):k1;var Fk={exports:{}},zk={},Uk={exports:{}},Vk={};/** + * @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 qo=j;function $I(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var RI=typeof Object.is=="function"?Object.is:$I,II=qo.useState,MI=qo.useEffect,DI=qo.useLayoutEffect,LI=qo.useDebugValue;function BI(e,t){var r=t(),n=II({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return DI(function(){i.value=r,i.getSnapshot=t,tm(i)&&a({inst:i})},[e,r,t]),MI(function(){return tm(i)&&a({inst:i}),e(function(){tm(i)&&a({inst:i})})},[e]),LI(r),r}function tm(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!RI(e,r)}catch{return!0}}function FI(e,t){return t()}var zI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?FI:BI;Vk.useSyncExternalStore=qo.useSyncExternalStore!==void 0?qo.useSyncExternalStore:zI;Uk.exports=Vk;var Zv=Uk.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.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 Sp=j,UI=Zv;function VI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var WI=typeof Object.is=="function"?Object.is:VI,HI=UI.useSyncExternalStore,GI=Sp.useRef,KI=Sp.useEffect,qI=Sp.useMemo,XI=Sp.useDebugValue;zk.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=GI(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=qI(function(){function l(h){if(!u){if(u=!0,f=h,h=n(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return c=x}return c=h}if(x=c,WI(f,h))return x;var v=n(h);return i!==void 0&&i(x,v)?(f=h,x):(f=h,c=v)}var u=!1,f,c,p=r===void 0?null:r;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,r,n,i]);var s=HI(e,a[0],a[1]);return KI(function(){o.hasValue=!0,o.value=s},[s]),XI(s),s};Fk.exports=zk;var YI=Fk.exports;const ZI=qe(YI),Wk={},{useDebugValue:QI}=N,{useSyncExternalStoreWithSelector:JI}=ZI;let E1=!1;const eM=e=>e;function tM(e,t=eM,r){(Wk?"production":void 0)!=="production"&&r&&!E1&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),E1=!0);const n=JI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return QI(n),n}const rM=e=>{(Wk?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?NI(e):e,r=(n,i)=>tM(t,n,i);return Object.assign(r,t),r},nM=e=>rM,iM={};function aM(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var a;const o=l=>l===null?null:JSON.parse(l,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(o):o(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const uu=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return uu(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return uu(n)(r)}}}},oM=(e,t)=>(r,n,i)=>{let a={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,g)=>({...g,...y}),...t},o=!1;const s=new Set,l=new Set;let u;try{u=a.getStorage()}catch{}if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...y)},n,i);const f=uu(a.serialize),c=()=>{const y=a.partialize({...n()});let g;const m=f({state:y,version:a.version}).then(w=>u.setItem(a.name,w)).catch(w=>{g=w});if(g)throw g;return m},p=i.setState;i.setState=(y,g)=>{p(y,g),c()};const h=e((...y)=>{r(...y),c()},n,i);let x;const v=()=>{var y;if(!u)return;o=!1,s.forEach(m=>m(n()));const g=((y=a.onRehydrateStorage)==null?void 0:y.call(a,n()))||void 0;return uu(u.getItem.bind(u))(a.name).then(m=>{if(m)return a.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return a.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var w;return x=a.merge(m,(w=n())!=null?w:h),r(x,!0),c()}).then(()=>{g==null||g(x,void 0),o=!0,l.forEach(m=>m(x))}).catch(m=>{g==null||g(void 0,m)})};return i.persist={setOptions:y=>{a={...a,...y},y.getStorage&&(u=y.getStorage())},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},v(),x||h},sM=(e,t)=>(r,n,i)=>{let a={storage:aM(()=>localStorage),partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...t},o=!1;const s=new Set,l=new Set;let u=a.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const f=()=>{const v=a.partialize({...n()});return u.setItem(a.name,{state:v,version:a.version})},c=i.setState;i.setState=(v,y)=>{c(v,y),f()};const p=e((...v)=>{r(...v),f()},n,i);i.getInitialState=()=>p;let h;const x=()=>{var v,y;if(!u)return;o=!1,s.forEach(m=>{var w;return m((w=n())!=null?w:p)});const g=((y=a.onRehydrateStorage)==null?void 0:y.call(a,(v=n())!=null?v:p))||void 0;return uu(u.getItem.bind(u))(a.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return[!0,a.migrate(m.state,m.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var w;const[S,b]=m;if(h=a.merge(b,(w=n())!=null?w:p),r(h,!0),S)return f()}).then(()=>{g==null||g(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{g==null||g(void 0,m)})};return i.persist={setOptions:v=>{a={...a,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},a.skipHydration||x(),h||p},lM=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((iM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),oM(e,t)):sM(e,t),uM=lM,na=nM()(uM(e=>({merchantId:"",setMerchantId:t=>{console.log(` +[STORE] Merchant ID changed: "${t}"`),e({merchantId:t})}}),{name:"merchant-store"}));function cM(e,t,r){console.log(` +`+"=".repeat(80)),console.log(`[API REQUEST] ${new Date().toISOString()}`),console.log(`Method: ${e}`),console.log(`Path: ${t}`),r!==void 0&&console.log("Body:",JSON.stringify(r,null,2)),console.log("=".repeat(80))}function fM(e,t,r,n){console.log(` +`+"-".repeat(80)),console.log(`[API RESPONSE] ${new Date().toISOString()}`),console.log(`Path: ${e}`),console.log(`Status: ${t} ${r}`),console.log("Response Body:",n),console.log("-".repeat(80)+` +`)}function P1(e,t){console.log(` +`+"!".repeat(80)),console.log(`[API ERROR] ${new Date().toISOString()}`),console.log(`Path: ${e}`),t instanceof Error?(console.log("Error:",t.message),console.log("Stack:",t.stack)):console.log("Error:",t),console.log("!".repeat(80)+` +`)}async function Hk(e,t){const r=(t==null?void 0:t.method)||"GET",n=t!=null&&t.body?JSON.parse(t.body):void 0;cM(r,e,n);try{const i=await fetch(e,{headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t}),a=await i.text();let o;try{const s=JSON.parse(a);o=JSON.stringify(s,null,2)}catch{o=a}if(fM(e,i.status,i.statusText,o),!i.ok){const s=new Error(`API error ${i.status}: ${a}`);throw P1(e,s),s}return a.trim()?JSON.parse(a):void 0}catch(i){throw P1(e,i),i}}async function ft(e,t){return Hk(e,{method:"POST",body:t!==void 0?JSON.stringify(t):void 0})}async function dM(e){return Hk(e)}function pM(){const{merchantId:e,setMerchantId:t}=na(),[r,n]=j.useState(e),[i,a]=j.useState(!1),[o,s]=j.useState(()=>localStorage.getItem("theme")==="dark");j.useEffect(()=>{const u=window.document.documentElement;o?(u.classList.add("dark"),localStorage.setItem("theme","dark")):(u.classList.remove("dark"),localStorage.setItem("theme","light"))},[o]);async function l(){const u=r.trim();if(u){t(u),a(!0);try{await ft("/merchant-account/create",{merchant_id:u,gateway_success_rate_based_decider_input:null})}catch{}finally{a(!1)}}}return d.jsxs("header",{className:"h-[76px] bg-white dark:bg-black border-b border-slate-200 dark:border-[#151515] flex items-center justify-between px-8 shrink-0 relative z-10 transition-colors duration-300",children:[d.jsx("div",{}),d.jsxs("div",{className:"flex items-center gap-6",children:[d.jsxs("div",{className:"relative",children:[d.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&l(),placeholder:"Set Merchant ID",className:"w-72 bg-slate-50 dark:bg-[#0f0f11] border border-slate-200 dark:border-[#222222] rounded-full px-4 py-2 text-sm text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-[#66666e] focus:outline-none focus:border-slate-400 dark:focus:border-[#444444] transition-colors"}),d.jsx("button",{onClick:l,disabled:i,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-slate-400 hover:text-brand-500 dark:text-[#66666e] dark:hover:text-white transition-colors",children:i?d.jsx(OI,{size:16,className:"animate-spin"}):d.jsx(pI,{size:16})})]}),e&&d.jsxs("div",{className:"flex items-center gap-2 pl-6 ml-2 border-l border-slate-200 dark:border-[#222222] transition-colors duration-300",children:[d.jsx(mI,{size:16,className:"text-brand-500 dark:text-[#66666e]"}),d.jsx("span",{className:"text-sm text-slate-800 dark:text-white font-medium",children:e})]}),d.jsx("button",{onClick:()=>s(!o),className:"p-2.5 rounded-full bg-slate-100 text-slate-600 hover:bg-slate-200 dark:bg-[#151515] dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#222222] transition-colors duration-200","aria-label":"Toggle theme",children:o?d.jsx(EI,{size:18}):d.jsx(jI,{size:18})})]})]})}function hM(){return d.jsxs("div",{className:"flex h-screen overflow-hidden bg-[#f8fafc] text-slate-900 dark:bg-[#000000] dark:text-white relative transition-colors duration-300",children:[d.jsx("div",{className:"aurora-top"}),d.jsx(CI,{}),d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[d.jsx(pM,{}),d.jsx("main",{className:"flex-1 overflow-y-auto p-8 relative",children:d.jsx(KR,{})})]})]})}const Gk=0,Kk=1,qk=2,C1=3;var T1=Object.prototype.hasOwnProperty;function Qv(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&Qv(e[n],t[n]););return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(T1.call(e,r)&&++n&&!T1.call(t,r)||!(r in t)||!Qv(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const Vn=new WeakMap,Gn=()=>{},tr=Gn(),Jv=Object,Re=e=>e===tr,An=e=>typeof e=="function",Yi=(e,t)=>({...e,...t}),Xk=e=>An(e.then),rm={},Dc={},W0="undefined",nc=typeof window!=W0,ey=typeof document!=W0,mM=nc&&"Deno"in window,vM=()=>nc&&typeof window.requestAnimationFrame!=W0,Yk=(e,t)=>{const r=Vn.get(e);return[()=>!Re(t)&&e.get(t)||rm,n=>{if(!Re(t)){const i=e.get(t);t in Dc||(Dc[t]=i),r[5](t,Yi(i,n),i||rm)}},r[6],()=>!Re(t)&&t in Dc?Dc[t]:!Re(t)&&e.get(t)||rm]};let ty=!0;const yM=()=>ty,[ry,ny]=nc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Gn,Gn],gM=()=>{const e=ey&&document.visibilityState;return Re(e)||e!=="hidden"},xM=e=>(ey&&document.addEventListener("visibilitychange",e),ry("focus",e),()=>{ey&&document.removeEventListener("visibilitychange",e),ny("focus",e)}),bM=e=>{const t=()=>{ty=!0,e()},r=()=>{ty=!1};return ry("online",t),ry("offline",r),()=>{ny("online",t),ny("offline",r)}},wM={isOnline:yM,isVisible:gM},_M={initFocus:xM,initReconnect:bM},N1=!N.useId,Ro=!nc||mM,SM=e=>vM()?window.requestAnimationFrame(e):setTimeout(e,1),nm=Ro?j.useEffect:j.useLayoutEffect,im=typeof navigator<"u"&&navigator.connection,$1=!Ro&&im&&(["slow-2g","2g"].includes(im.effectiveType)||im.saveData),Lc=new WeakMap,OM=e=>Jv.prototype.toString.call(e),am=(e,t)=>e===`[object ${t}]`;let jM=0;const iy=e=>{const t=typeof e,r=OM(e),n=am(r,"Date"),i=am(r,"RegExp"),a=am(r,"Object");let o,s;if(Jv(e)===e&&!n&&!i){if(o=Lc.get(e),o)return o;if(o=++jM+"~",Lc.set(e,o),Array.isArray(e)){for(o="@",s=0;s{if(An(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?iy(e):"",[e,t]};let AM=0;const ay=()=>++AM;async function Zk(...e){const[t,r,n,i]=e,a=Yi({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let l=a.optimisticData;const u=p=>typeof s=="function"?s(p):s!==!1,f=a.throwOnError;if(An(r)){const p=r,h=[],x=t.keys();for(const v of x)!/^\$(inf|sub)\$/.test(v)&&p(t.get(v)._k)&&h.push(v);return Promise.all(h.map(c))}return c(r);async function c(p){const[h]=H0(p);if(!h)return;const[x,v]=Yk(t,h),[y,g,m,w]=Vn.get(t),S=()=>{const D=y[h];return(An(a.revalidate)?a.revalidate(x().data,p):a.revalidate!==!1)&&(delete m[h],delete w[h],D&&D[0])?D[0](qk).then(()=>x().data):x().data};if(e.length<3)return S();let b=n,_,O=!1;const k=ay();g[h]=[k,0];const P=!Re(l),R=x(),$=R.data,C=R._c,I=Re(C)?$:C;if(P&&(l=An(l)?l(I,$):l,v({data:l,_c:I})),An(b))try{b=b(I)}catch(D){_=D,O=!0}if(b&&Xk(b))if(b=await b.catch(D=>{_=D,O=!0}),k!==g[h][0]){if(O)throw _;return b}else O&&P&&u(_)&&(o=!0,v({data:I,_c:tr}));if(o&&!O)if(An(o)){const D=o(b,I);v({data:D,error:tr,_c:tr})}else v({data:b,error:tr,_c:tr});if(g[h][1]=ay(),Promise.resolve(S()).then(()=>{v({_c:tr})}),O){if(f)throw _;return}return b}}const R1=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},kM=(e,t)=>{if(!Vn.has(e)){const r=Yi(_M,t),n=Object.create(null),i=Zk.bind(tr,e);let a=Gn;const o=Object.create(null),s=(f,c)=>{const p=o[f]||[];return o[f]=p,p.push(c),()=>p.splice(p.indexOf(c),1)},l=(f,c,p)=>{e.set(f,c);const h=o[f];if(h)for(const x of h)x(c,p)},u=()=>{if(!Vn.has(e)&&(Vn.set(e,[n,Object.create(null),Object.create(null),Object.create(null),i,l,s]),!Ro)){const f=r.initFocus(setTimeout.bind(tr,R1.bind(tr,n,Gk))),c=r.initReconnect(setTimeout.bind(tr,R1.bind(tr,n,Kk)));a=()=>{f&&f(),c&&c(),Vn.delete(e)}}};return u(),[e,i,u,a]}return[e,Vn.get(e)[4]]},EM=(e,t,r,n,i)=>{const a=r.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!Re(a)&&o>a||setTimeout(n,s,i)},PM=Qv,[Qk,CM]=kM(new Map),TM=Yi({onLoadingSlow:Gn,onSuccess:Gn,onError:Gn,onErrorRetry:EM,onDiscarded:Gn,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:$1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:$1?5e3:3e3,compare:PM,isPaused:()=>!1,cache:Qk,mutate:CM,fallback:{}},wM),NM=(e,t)=>{const r=Yi(e,t);if(t){const{use:n,fallback:i}=e,{use:a,fallback:o}=t;n&&a&&(r.use=n.concat(a)),i&&o&&(r.fallback=Yi(i,o))}return r},$M=j.createContext({}),RM="$inf$",Jk=nc&&window.__SWR_DEVTOOLS_USE__,IM=Jk?window.__SWR_DEVTOOLS_USE__:[],MM=()=>{Jk&&(window.__SWR_DEVTOOLS_REACT__=N)},DM=e=>An(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],LM=()=>{const e=j.useContext($M);return j.useMemo(()=>Yi(TM,e),[e])},BM=e=>(t,r,n)=>e(t,r&&((...a)=>{const[o]=H0(t),[,,,s]=Vn.get(Qk);if(o.startsWith(RM))return r(...a);const l=s[o];return Re(l)?r(...a):(delete s[o],l)}),n),FM=IM.concat(BM),zM=e=>function(...r){const n=LM(),[i,a,o]=DM(r),s=NM(n,o);let l=e;const{use:u}=s,f=(u||[]).concat(FM);for(let c=f.length;c--;)l=f[c](l);return l(i,a||s.fetcher||null,s)},UM=(e,t,r)=>{const n=t[e]||(t[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i>=0&&(n[i]=n[n.length-1],n.pop())}};MM();const om=N.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),sm={dedupe:!0},I1=Promise.resolve(tr),VM=()=>Gn,WM=(e,t,r)=>{const{cache:n,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:p,strictServerPrefetchWarning:h}=r,[x,v,y,g]=Vn.get(n),[m,w]=H0(e),S=j.useRef(!1),b=j.useRef(!1),_=j.useRef(m),O=j.useRef(t),k=j.useRef(r),P=()=>k.current,R=()=>P().isVisible()&&P().isOnline(),[$,C,I,D]=Yk(n,m),L=j.useRef({}).current,z=Re(o)?Re(r.fallback)?tr:r.fallback[m]:o,U=(ve,Ae)=>{for(const $e in L){const Oe=$e;if(Oe==="data"){if(!i(ve[Oe],Ae[Oe])&&(!Re(ve[Oe])||!i(ue,Ae[Oe])))return!1}else if(Ae[Oe]!==ve[Oe])return!1}return!0},M=!S.current,B=j.useMemo(()=>{const ve=$(),Ae=D(),$e=T=>{const A=Yi(T);return delete A._k,(()=>{if(!m||!t||P().isPaused())return!1;if(M&&!Re(s))return s;const F=Re(z)?A.data:z;return Re(F)||l})()?{isValidating:!0,isLoading:!0,...A}:A},Oe=$e(ve),He=ve===Ae?Oe:$e(Ae);let Ue=Oe;return[()=>{const T=$e($());return U(T,Ue)?(Ue.data=T.data,Ue.isLoading=T.isLoading,Ue.isValidating=T.isValidating,Ue.error=T.error,Ue):(Ue=T,T)},()=>He]},[n,m]),W=Zv.useSyncExternalStore(j.useCallback(ve=>I(m,(Ae,$e)=>{U($e,Ae)||ve()}),[n,m]),B[0],B[1]),J=x[m]&&x[m].length>0,G=W.data,Q=Re(G)?z&&Xk(z)?om(z):z:G,X=W.error,de=j.useRef(Q),ue=p?Re(G)?Re(de.current)?Q:de.current:G:Q,Se=m&&Re(Q),_e=j.useRef(null);!Ro&&Zv.useSyncExternalStore(VM,()=>(_e.current=!1,_e),()=>(_e.current=!0,_e));const te=_e.current;h&&te&&!a&&Se&&console.warn(`Missing pre-initiated data for serialized key "${m}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const re=!m||!t||P().isPaused()||J&&!Re(X)?!1:M&&!Re(s)?s:a?Re(Q)?!1:l:Re(Q)||l,pe=M&&re,K=Re(W.isValidating)?pe:W.isValidating,Pe=Re(W.isLoading)?pe:W.isLoading,he=j.useCallback(async ve=>{const Ae=O.current;if(!m||!Ae||b.current||P().isPaused())return!1;let $e,Oe,He=!0;const Ue=ve||{},T=!y[m]||!Ue.dedupe,A=()=>N1?!b.current&&m===_.current&&S.current:m===_.current,E={isValidating:!1,isLoading:!1},F=()=>{C(E)},V=()=>{const Y=y[m];Y&&Y[1]===Oe&&delete y[m]},q={isValidating:!0};Re($().data)&&(q.isLoading=!0);try{if(T&&(C(q),r.loadingTimeout&&Re($().data)&&setTimeout(()=>{He&&A()&&P().onLoadingSlow(m,r)},r.loadingTimeout),y[m]=[Ae(w),ay()]),[$e,Oe]=y[m],$e=await $e,T&&setTimeout(V,r.dedupingInterval),!y[m]||y[m][1]!==Oe)return T&&A()&&P().onDiscarded(m),!1;E.error=tr;const Y=v[m];if(!Re(Y)&&(Oe<=Y[0]||Oe<=Y[1]||Y[1]===0))return F(),T&&A()&&P().onDiscarded(m),!1;const ie=$().data;E.data=i(ie,$e)?ie:$e,T&&A()&&P().onSuccess($e,m,r)}catch(Y){V();const ie=P(),{shouldRetryOnError:me}=ie;ie.isPaused()||(E.error=Y,T&&A()&&(ie.onError(Y,m,ie),(me===!0||An(me)&&me(Y))&&(!P().revalidateOnFocus||!P().revalidateOnReconnect||R())&&ie.onErrorRetry(Y,m,ie,bt=>{const Et=x[m];Et&&Et[0]&&Et[0](C1,bt)},{retryCount:(Ue.retryCount||0)+1,dedupe:!0})))}return He=!1,F(),!0},[m,n]),Me=j.useCallback((...ve)=>Zk(n,_.current,...ve),[]);if(nm(()=>{O.current=t,k.current=r,Re(G)||(de.current=G)}),nm(()=>{if(!m)return;const ve=he.bind(tr,sm);let Ae=0;P().revalidateOnFocus&&(Ae=Date.now()+P().focusThrottleInterval);const Oe=UM(m,x,(He,Ue={})=>{if(He==Gk){const T=Date.now();P().revalidateOnFocus&&T>Ae&&R()&&(Ae=T+P().focusThrottleInterval,ve())}else if(He==Kk)P().revalidateOnReconnect&&R()&&ve();else{if(He==qk)return he();if(He==C1)return he(Ue)}});return b.current=!1,_.current=m,S.current=!0,C({_k:w}),re&&(y[m]||(Re(Q)||Ro?ve():SM(ve))),()=>{b.current=!0,Oe()}},[m]),nm(()=>{let ve;function Ae(){const Oe=An(u)?u($().data):u;Oe&&ve!==-1&&(ve=setTimeout($e,Oe))}function $e(){!$().error&&(f||P().isVisible())&&(c||P().isOnline())?he(sm).then(Ae):Ae()}return Ae(),()=>{ve&&(clearTimeout(ve),ve=-1)}},[u,f,c,m]),j.useDebugValue(ue),a){if(!N1&&Ro&&Se)throw new Error("Fallback data is required when using Suspense in SSR.");Se&&(O.current=t,k.current=r,b.current=!1);const ve=g[m],Ae=!Re(ve)&&Se?Me(ve):I1;if(om(Ae),!Re(X)&&Se)throw X;const $e=Se?he(sm):I1;!Re(ue)&&Se&&($e.status="fulfilled",$e.value=!0),om($e)}return{mutate:Me,get data(){return L.data=!0,ue},get error(){return L.error=!0,X},get isValidating(){return L.isValidating=!0,K},get isLoading(){return L.isLoading=!0,Pe}}},vn=zM(WM);function Ce({children:e,className:t="",onClick:r}){return d.jsx("div",{className:`glass-panel rounded-[20px] ${r?"glass-panel-hover cursor-pointer":""} ${t}`,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:e})}function et({children:e,className:t=""}){return d.jsx("div",{className:`px-6 py-5 border-b border-slate-200 dark:border-[#1c1c1f] bg-slate-50 dark:bg-[#0c0c0e] rounded-t-[20px] ${t}`,children:e})}function Te({children:e,className:t=""}){return d.jsx("div",{className:`px-6 py-5 ${t}`,children:e})}const HM={green:"bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20",gray:"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8",blue:"bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20",red:"bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20",orange:"bg-orange-500/10 text-orange-400 ring-1 ring-inset ring-orange-500/20",purple:"bg-purple-500/10 text-purple-400 ring-1 ring-inset ring-purple-500/20"};function Qt({variant:e="gray",children:t}){return d.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${HM[e]}`,children:t})}function GM(){const[e,t]=j.useState("loading");return j.useEffect(()=>{console.log(` +[HEALTH CHECK] ${new Date().toISOString()}`),console.log("Fetching: GET /health"),fetch("/health").then(r=>{console.log(`[HEALTH CHECK] Response: ${r.status} ${r.statusText}`),t(r.ok?"up":"down")}).catch(r=>{console.log(`[HEALTH CHECK ERROR] ${r.message}`),t("down")})},[]),e}function KM(){var l,u;const e=bp(),{merchantId:t}=na(),r=GM(),{data:n}=vn(t?`/routing/list/active/${t}`:null,()=>ft(`/routing/list/active/${t}`),{shouldRetryOnError:!1}),{data:i,error:a}=vn(t?["/rule/get","successRate",t]:null,()=>ft("/rule/get",{merchant_id:t,algorithm:"successRate"})),o=n&&n.length>0?n[0]:null,s=(n||[]).some(f=>{var c;return((c=f.algorithm_data||f.algorithm)==null?void 0:c.type)==="advanced"});return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Overview"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Decision Engine routing health and status"})]}),!t&&d.jsxs("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 flex items-center gap-2 text-sm text-yellow-800",children:[d.jsx(vI,{size:16}),"Set your Merchant ID in the top bar to load configuration."]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[d.jsx(Ce,{children:d.jsxs(Te,{className:"flex items-center gap-3",children:[r==="up"?d.jsx(yI,{className:"text-green-500",size:24}):r==="down"?d.jsx(gI,{className:"text-red-500",size:24}):d.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-gray-200 border-t-gray-500 animate-spin"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500",children:"API Health"}),d.jsx("p",{className:"text-sm font-medium",children:r==="up"?"Healthy":r==="down"?"Down":"Checking..."})]})]})}),d.jsx(Ce,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:d.jsxs(Te,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Active Routing Rule"}),t?o?d.jsxs("div",{children:[d.jsx(Qt,{variant:"green",children:"Active"}),d.jsx("p",{className:"text-sm font-medium mt-1 truncate",children:o.name}),d.jsx("p",{className:"text-xs text-slate-400",children:(l=o.algorithm_data||o.algorithm)==null?void 0:l.type})]}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})}),d.jsx(Ce,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/sr"),children:d.jsxs(Te,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Auth-Rate Config"}),t?a?d.jsx(Qt,{variant:"gray",children:"Not Configured"}):i!=null&&i.data?d.jsx(Qt,{variant:"green",children:"Configured"}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})}),d.jsx(Ce,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/rules"),children:d.jsxs(Te,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Rule-Based Routing"}),t?s?d.jsx(Qt,{variant:"green",children:"Configured"}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})})]}),o&&d.jsxs(Ce,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Routing Configuration"})}),d.jsx(Te,{children:d.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Name"}),d.jsx("dd",{className:"font-medium",children:o.name})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Type"}),d.jsx("dd",{className:"font-medium capitalize",children:(u=o.algorithm_data||o.algorithm)==null?void 0:u.type})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Algorithm For"}),d.jsx("dd",{className:"font-medium capitalize",children:o.algorithm_for})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"ID"}),d.jsx("dd",{className:"font-mono text-xs text-slate-600",children:o.id})]})]})})]})]})}function qM(){const e=bp(),{merchantId:t}=na(),{data:r}=vn(t?`/routing/list/active/${t}`:null,()=>ft(`/routing/list/active/${t}`)),{data:n}=vn(t?["/rule/get","successRate",t]:null,()=>ft("/rule/get",{merchant_id:t,algorithm:"successRate"})),i=[{id:"sr",title:"Auth-Rate Based Routing",description:"Dynamically route to the best-performing gateway based on real-time authorization rates.",icon:Bk,route:"/routing/sr",algorithmType:"successRate",checkConfigured:()=>{var a;return!!((a=n==null?void 0:n.config)!=null&&a.data)}},{id:"rules",title:"Rule-Based Routing",description:"Declarative Euclid DSL rules to route payments based on conditions and attributes.",icon:_I,route:"/routing/rules",algorithmType:"advanced",checkConfigured:()=>(r||[]).some(a=>{var o;return((o=a.algorithm_data||a.algorithm)==null?void 0:o.type)==="advanced"})},{id:"volume",title:"Volume Split",description:"Distribute payment traffic across gateways by configurable percentage splits.",icon:Wf,route:"/routing/volume",algorithmType:"volume_split",checkConfigured:()=>(r||[]).some(a=>{var o;return((o=a.algorithm_data||a.algorithm)==null?void 0:o.type)==="volume_split"})},{id:"debit",title:"Network Routing",description:"Optimise debit network fees with acquirer-aware network-based routing.",icon:xI,route:"/routing/debit",algorithmType:"debitRouting",checkConfigured:()=>!1}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Routing Hub"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Click on any routing strategy to configure"})]}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:i.map(a=>{const o=a.icon,s=a.checkConfigured();return d.jsx(Ce,{className:"flex flex-col hover:border-brand-300 cursor-pointer transition-all hover:shadow-md",onClick:()=>e(a.route),children:d.jsxs(Te,{className:"flex-1 flex flex-col gap-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"p-2 bg-brand-50 rounded-lg border border-[#1c2d50]",children:d.jsx(o,{size:20,className:"text-brand-500"})}),d.jsx(Qt,{variant:s?"green":"gray",children:s?"Configured":"Not Configured"})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-slate-900",children:a.title}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:a.description})]}),d.jsx("div",{className:"mt-auto pt-2",children:d.jsx("span",{className:"text-sm text-brand-600 font-medium",children:s?"Manage →":"Setup →"})})]})},a.id)})})]})}var ic=e=>e.type==="checkbox",_a=e=>e instanceof Date,pr=e=>e==null;const eE=e=>typeof e=="object";var St=e=>!pr(e)&&!Array.isArray(e)&&eE(e)&&!_a(e),XM=e=>St(e)&&e.target?ic(e.target)?e.target.checked:e.target.value:e,YM=(e,t)=>t.split(".").some((r,n,i)=>!isNaN(Number(r))&&e.has(i.slice(0,n).join("."))),ZM=e=>{const t=e.constructor&&e.constructor.prototype;return St(t)&&t.hasOwnProperty("isPrototypeOf")},G0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ot(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(G0&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(St(e)&&ZM(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=ot(e[i]));return n}var Op=e=>/^\w*$/.test(e),Qe=e=>e===void 0,jp=e=>Array.isArray(e)?e.filter(Boolean):[],K0=e=>jp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(e,t,r)=>{if(!t||!St(e))return r;const n=(Op(t)?[t]:K0(t)).reduce((i,a)=>pr(i)?i:i[a],e);return Qe(n)||n===e?Qe(e[t])?r:e[t]:n},On=e=>typeof e=="boolean",fn=e=>typeof e=="function",We=(e,t,r)=>{let n=-1;const i=Op(t)?[t]:K0(t),a=i.length,o=a-1;for(;++nN.useContext(rE);var JM=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Hr.all&&(t._proxyFormState[o]=!n||Hr.all),e[o]}});return i};const nE=typeof window<"u"?N.useLayoutEffect:N.useEffect;var ar=e=>typeof e=="string",eD=(e,t,r,n,i)=>ar(e)?(n&&t.watch.add(e),ae(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),ae(r,a))):(n&&(t.watchAll=!0),r),oy=e=>pr(e)||!eE(e);function Ci(e,t,r=new WeakSet){if(oy(e)||oy(t))return Object.is(e,t);if(_a(e)&&_a(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const o=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const s=t[a];if(_a(o)&&_a(s)||(St(o)||Array.isArray(o))&&(St(s)||Array.isArray(s))?!Ci(o,s,r):!Object.is(o,s))return!1}}return!0}const tD=N.createContext(null);tD.displayName="HookFormContext";var iE=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},vr=e=>Array.isArray(e)?e:[e],M1=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}};function aE(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],a=t[n];if(i&&St(i)&&a){const o=aE(i,a);St(o)&&(r[n]=o)}else e[n]&&(r[n]=a)}return r}var Zt=e=>St(e)&&!Object.keys(e).length,q0=e=>e.type==="file",Hf=e=>{if(!G0)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},oE=e=>e.type==="select-multiple",X0=e=>e.type==="radio",rD=e=>X0(e)||ic(e),um=e=>Hf(e)&&e.isConnected;function nD(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(fn(e[t]))return!0;return!1};function sE(e){return Array.isArray(e)||St(e)&&!aD(e)}function sy(e,t={}){for(const r in e){const n=e[r];sE(n)?(t[r]=Array.isArray(n)?[]:{},sy(n,t[r])):Qe(n)||(t[r]=!0)}return t}function wl(e,t,r){r||(r=sy(t));for(const n in e){const i=e[n];if(sE(i))Qe(t)||oy(r[n])?r[n]=sy(i,Array.isArray(i)?[]:{}):wl(i,pr(t)?{}:t[n],r[n]);else{const a=t[n];r[n]=!Ci(i,a)}}return r}const D1={value:!1,isValid:!1},L1={value:!0,isValid:!0};var lE=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Qe(e[0].attributes.value)?Qe(e[0].value)||e[0].value===""?L1:{value:e[0].value,isValid:!0}:L1:D1}return D1},uE=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Qe(e)?e:t?e===""?NaN:e&&+e:r&&ar(e)?new Date(e):n?n(e):e;const B1={isValid:!1,value:null};var cE=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,B1):B1;function F1(e){const t=e.ref;return q0(t)?t.files:X0(t)?cE(e.refs).value:oE(t)?[...t.selectedOptions].map(({value:r})=>r):ic(t)?lE(e.refs).value:uE(Qe(t.value)?e.ref.value:t.value,e)}var oD=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,sD=(e,t,r,n)=>{const i={};for(const a of e){const o=ae(t,a);o&&We(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Gf=e=>e instanceof RegExp,nl=e=>Qe(e)?e:Gf(e)?e.source:St(e)?Gf(e.value)?e.value.source:e.value:e,_o=e=>({isOnSubmit:!e||e===Hr.onSubmit,isOnBlur:e===Hr.onBlur,isOnChange:e===Hr.onChange,isOnAll:e===Hr.all,isOnTouch:e===Hr.onTouched});const z1="AsyncFunction";var lD=e=>!!e&&!!e.validate&&!!(fn(e.validate)&&e.validate.constructor.name===z1||St(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===z1)),uD=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ly=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Io=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=ae(e,i);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Io(s,t))break}else if(St(s)&&Io(s,t))break}}};function U1(e,t,r){const n=ae(e,r);if(n||Op(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=ae(t,a),s=ae(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};i.pop()}return{name:r}}var cD=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return Zt(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||Hr.all))},fD=(e,t,r)=>!e||!t||e===t||vr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),dD=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,pD=(e,t)=>!jp(ae(e,t)).length&&wt(e,t),fE=(e,t,r)=>{const n=vr(ae(e,r));return We(n,tE,t[r]),We(e,r,n),e};function V1(e,t,r="validate"){if(ar(e)||Array.isArray(e)&&e.every(ar)||On(e)&&!e)return{type:r,message:ar(e)?e:"",ref:t}}var no=e=>St(e)&&!Gf(e)?e:{value:e,message:""},uy=async(e,t,r,n,i,a)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:f,min:c,max:p,pattern:h,validate:x,name:v,valueAsNumber:y,mount:g}=e._f,m=ae(r,v);if(!g||t.has(v))return{};const w=s?s[0]:o,S=C=>{i&&w.reportValidity&&(w.setCustomValidity(On(C)?"":C||""),w.reportValidity())},b={},_=X0(o),O=ic(o),k=_||O,P=(y||q0(o))&&Qe(o.value)&&Qe(m)||Hf(o)&&o.value===""||m===""||Array.isArray(m)&&!m.length,R=iE.bind(null,v,n,b),$=(C,I,D,L=on.maxLength,z=on.minLength)=>{const U=C?I:D;b[v]={type:C?L:z,message:U,ref:o,...R(C?L:z,U)}};if(a?!Array.isArray(m)||!m.length:l&&(!k&&(P||pr(m))||On(m)&&!m||O&&!lE(s).isValid||_&&!cE(s).isValid)){const{value:C,message:I}=ar(l)?{value:!!l,message:l}:no(l);if(C&&(b[v]={type:on.required,message:I,ref:w,...R(on.required,I)},!n))return S(I),b}if(!P&&(!pr(c)||!pr(p))){let C,I;const D=no(p),L=no(c);if(!pr(m)&&!isNaN(m)){const z=o.valueAsNumber||m&&+m;pr(D.value)||(C=z>D.value),pr(L.value)||(I=znew Date(new Date().toDateString()+" "+W),M=o.type=="time",B=o.type=="week";ar(D.value)&&m&&(C=M?U(m)>U(D.value):B?m>D.value:z>new Date(D.value)),ar(L.value)&&m&&(I=M?U(m)+C.value,L=!pr(I.value)&&m.length<+I.value;if((D||L)&&($(D,C.message,I.message),!n))return S(b[v].message),b}if(h&&!P&&ar(m)){const{value:C,message:I}=no(h);if(Gf(C)&&!m.match(C)&&(b[v]={type:on.pattern,message:I,ref:o,...R(on.pattern,I)},!n))return S(I),b}if(x){if(fn(x)){const C=await x(m,r),I=V1(C,w);if(I&&(b[v]={...I,...R(on.validate,I.message)},!n))return S(I.message),b}else if(St(x)){let C={};for(const I in x){if(!Zt(C)&&!n)break;const D=V1(await x[I](m,r),w,I);D&&(C={...D,...R(I,D.message)},S(D.message),n&&(b[v]=C))}if(!Zt(C)&&(b[v]={ref:w,...C},!n))return b}}return S(!0),b};const hD={mode:Hr.onSubmit,reValidateMode:Hr.onChange,shouldFocusError:!0};function mD(e={}){let t={...hD,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:fn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=St(t.defaultValues)||St(t.values)?ot(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ot(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},c={...f};let p={...c};const h={array:M1(),state:M1()},x=t.criteriaMode===Hr.all,v=T=>A=>{clearTimeout(u),u=setTimeout(T,A)},y=async T=>{if(!o.keepIsValid&&!t.disabled&&(c.isValid||p.isValid||T)){let A;t.resolver?(A=Zt((await P()).errors),g()):A=await C({fields:n,onlyCheckValid:!0,eventType:ro.VALID}),A!==r.isValid&&h.state.next({isValid:A})}},g=(T,A)=>{!t.disabled&&(c.isValidating||c.validatingFields||p.isValidating||p.validatingFields)&&((T||Array.from(s.mount)).forEach(E=>{E&&(A?We(r.validatingFields,E,A):wt(r.validatingFields,E))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Zt(r.validatingFields)}))},m=T=>{const A=wl(i,a),E=oD(T);We(r.dirtyFields,E,ae(A,E))},w=(T,A=[],E,F,V=!0,q=!0)=>{if(F&&E&&!t.disabled){if(o.action=!0,q&&Array.isArray(ae(n,T))){const Y=E(ae(n,T),F.argA,F.argB);V&&We(n,T,Y)}if(q&&Array.isArray(ae(r.errors,T))){const Y=E(ae(r.errors,T),F.argA,F.argB);V&&We(r.errors,T,Y),pD(r.errors,T)}if((c.touchedFields||p.touchedFields)&&q&&Array.isArray(ae(r.touchedFields,T))){const Y=E(ae(r.touchedFields,T),F.argA,F.argB);V&&We(r.touchedFields,T,Y)}(c.dirtyFields||p.dirtyFields)&&m(T),h.state.next({name:T,isDirty:D(T,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else We(a,T,A)},S=(T,A)=>{We(r.errors,T,A),h.state.next({errors:r.errors})},b=T=>{r.errors=T,h.state.next({errors:r.errors,isValid:!1})},_=(T,A,E,F)=>{const V=ae(n,T);if(V){const q=ae(a,T,Qe(E)?ae(i,T):E);Qe(q)||F&&F.defaultChecked||A?We(a,T,A?q:F1(V._f)):U(T,q),o.mount&&!o.action&&y()}},O=(T,A,E,F,V)=>{let q=!1,Y=!1;const ie={name:T};if(!t.disabled){if(!E||F){(c.isDirty||p.isDirty)&&(Y=r.isDirty,r.isDirty=ie.isDirty=D(),q=Y!==ie.isDirty);const me=Ci(ae(i,T),A);Y=!!ae(r.dirtyFields,T),me?wt(r.dirtyFields,T):We(r.dirtyFields,T,!0),ie.dirtyFields=r.dirtyFields,q=q||(c.dirtyFields||p.dirtyFields)&&Y!==!me}if(E){const me=ae(r.touchedFields,T);me||(We(r.touchedFields,T,E),ie.touchedFields=r.touchedFields,q=q||(c.touchedFields||p.touchedFields)&&me!==E)}q&&V&&h.state.next(ie)}return q?ie:{}},k=(T,A,E,F)=>{const V=ae(r.errors,T),q=(c.isValid||p.isValid)&&On(A)&&r.isValid!==A;if(t.delayError&&E?(l=v(()=>S(T,E)),l(t.delayError)):(clearTimeout(u),l=null,E?We(r.errors,T,E):wt(r.errors,T)),(E?!Ci(V,E):V)||!Zt(F)||q){const Y={...F,...q&&On(A)?{isValid:A}:{},errors:r.errors,name:T};r={...r,...Y},h.state.next(Y)}},P=async T=>(g(T,!0),await t.resolver(a,t.context,sD(T||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),R=async T=>{const{errors:A}=await P(T);if(g(T),T)for(const E of T){const F=ae(A,E);F?We(r.errors,E,F):wt(r.errors,E)}else r.errors=A;return A},$=async({name:T,eventType:A})=>{if(e.validate){const E=await e.validate({formValues:a,formState:r,name:T,eventType:A});if(St(E))for(const F in E)E[F]&&ue(`${lm}.${F}`,{message:ar(E.message)?E.message:"",type:on.validate});else ar(E)||!E?ue(lm,{message:E||"",type:on.validate}):de(lm);return E}return!0},C=async({fields:T,onlyCheckValid:A,name:E,eventType:F,context:V={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(V.runRootValidation=!0,!await $({name:E,eventType:F})&&(V.valid=!1,A)))return V.valid;for(const q in T){const Y=T[q];if(Y){const{_f:ie,...me}=Y;if(ie){const bt=s.array.has(ie.name),Et=Y._f&&lD(Y._f);Et&&c.validatingFields&&g([ie.name],!0);const Pt=await uy(Y,s.disabled,a,x,t.shouldUseNativeValidation&&!A,bt);if(Et&&c.validatingFields&&g([ie.name]),Pt[ie.name]&&(V.valid=!1,A)||(!A&&(ae(Pt,ie.name)?bt?fE(r.errors,Pt,ie.name):We(r.errors,ie.name,Pt[ie.name]):wt(r.errors,ie.name)),e.shouldUseNativeValidation&&Pt[ie.name]))break}!Zt(me)&&await C({context:V,onlyCheckValid:A,fields:me,name:q,eventType:F})}}return V.valid},I=()=>{for(const T of s.unMount){const A=ae(n,T);A&&(A._f.refs?A._f.refs.every(E=>!um(E)):!um(A._f.ref))&&re(T)}s.unMount=new Set},D=(T,A)=>!t.disabled&&(T&&A&&We(a,T,A),!Ci(Q(),i)),L=(T,A,E)=>eD(T,s,{...o.mount?a:Qe(A)?i:ar(T)?{[T]:A}:A},E,A),z=T=>jp(ae(o.mount?a:i,T,t.shouldUnregister?ae(i,T,[]):[])),U=(T,A,E={})=>{const F=ae(n,T);let V=A;if(F){const q=F._f;q&&(!q.disabled&&We(a,T,uE(A,q)),V=Hf(q.ref)&&pr(A)?"":A,oE(q.ref)?[...q.ref.options].forEach(Y=>Y.selected=V.includes(Y.value)):q.refs?ic(q.ref)?q.refs.forEach(Y=>{(!Y.defaultChecked||!Y.disabled)&&(Array.isArray(V)?Y.checked=!!V.find(ie=>ie===Y.value):Y.checked=V===Y.value||!!V)}):q.refs.forEach(Y=>Y.checked=Y.value===V):q0(q.ref)?q.ref.value="":(q.ref.value=V,q.ref.type||h.state.next({name:T,values:ot(a)})))}(E.shouldDirty||E.shouldTouch)&&O(T,V,E.shouldTouch,E.shouldDirty,!0),E.shouldValidate&&G(T)},M=(T,A,E)=>{for(const F in A){if(!A.hasOwnProperty(F))return;const V=A[F],q=T+"."+F,Y=ae(n,q);(s.array.has(T)||St(V)||Y&&!Y._f)&&!_a(V)?M(q,V,E):U(q,V,E)}},B=(T,A,E={})=>{const F=ae(n,T),V=s.array.has(T),q=ot(A);We(a,T,q),V?(h.array.next({name:T,values:ot(a)}),(c.isDirty||c.dirtyFields||p.isDirty||p.dirtyFields)&&E.shouldDirty&&(m(T),h.state.next({name:T,dirtyFields:r.dirtyFields,isDirty:D(T,q)}))):F&&!F._f&&!pr(q)?M(T,q,E):U(T,q,E),ly(T,s)?h.state.next({...r,name:T,values:ot(a)}):h.state.next({name:o.mount?T:void 0,values:ot(a)})},W=async T=>{o.mount=!0;const A=T.target;let E=A.name,F=!0;const V=ae(n,E),q=me=>{F=Number.isNaN(me)||_a(me)&&isNaN(me.getTime())||Ci(me,ae(a,E,me))},Y=_o(t.mode),ie=_o(t.reValidateMode);if(V){let me,bt;const Et=A.type?F1(V._f):XM(T),Pt=T.type===ro.BLUR||T.type===ro.FOCUS_OUT,Ws=!uD(V._f)&&!e.validate&&!t.resolver&&!ae(r.errors,E)&&!V._f.deps||dD(Pt,ae(r.touchedFields,E),r.isSubmitted,ie,Y),Ja=ly(E,s,Pt);We(a,E,Et),Pt?(!A||!A.readOnly)&&(V._f.onBlur&&V._f.onBlur(T),l&&l(0)):V._f.onChange&&V._f.onChange(T);const Hs=O(E,Et,Pt),mc=!Zt(Hs)||Ja;if(!Pt&&h.state.next({name:E,type:T.type,values:ot(a)}),Ws)return(c.isValid||p.isValid)&&(t.mode==="onBlur"?Pt&&y():Pt||y()),mc&&h.state.next({name:E,...Ja?{}:Hs});if(!t.resolver&&e.validate&&await $({name:E,eventType:T.type}),!Pt&&Ja&&h.state.next({...r}),t.resolver){const{errors:vc}=await P([E]);if(g([E]),q(Et),F){const Oh=U1(r.errors,n,E),yc=U1(vc,n,Oh.name||E);me=yc.error,E=yc.name,bt=Zt(vc)}}else g([E],!0),me=(await uy(V,s.disabled,a,x,t.shouldUseNativeValidation))[E],g([E]),q(Et),F&&(me?bt=!1:(c.isValid||p.isValid)&&(bt=await C({fields:n,onlyCheckValid:!0,name:E,eventType:T.type})));F&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&G(V._f.deps),k(E,bt,me,Hs))}},J=(T,A)=>{if(ae(r.errors,A)&&T.focus)return T.focus(),1},G=async(T,A={})=>{let E,F;const V=vr(T);if(t.resolver){const q=await R(Qe(T)?T:V);E=Zt(q),F=T?!V.some(Y=>ae(q,Y)):E}else T?(F=(await Promise.all(V.map(async q=>{const Y=ae(n,q);return await C({fields:Y&&Y._f?{[q]:Y}:Y,eventType:ro.TRIGGER})}))).every(Boolean),!(!F&&!r.isValid)&&y()):F=E=await C({fields:n,name:T,eventType:ro.TRIGGER});return h.state.next({...!ar(T)||(c.isValid||p.isValid)&&E!==r.isValid?{}:{name:T},...t.resolver||!T?{isValid:E}:{},errors:r.errors}),A.shouldFocus&&!F&&Io(n,J,T?V:s.mount),F},Q=(T,A)=>{let E={...o.mount?a:i};return A&&(E=aE(A.dirtyFields?r.dirtyFields:r.touchedFields,E)),Qe(T)?E:ar(T)?ae(E,T):T.map(F=>ae(E,F))},X=(T,A)=>({invalid:!!ae((A||r).errors,T),isDirty:!!ae((A||r).dirtyFields,T),error:ae((A||r).errors,T),isValidating:!!ae(r.validatingFields,T),isTouched:!!ae((A||r).touchedFields,T)}),de=T=>{const A=T?vr(T):void 0;A==null||A.forEach(E=>wt(r.errors,E)),A?A.forEach(E=>{h.state.next({name:E,errors:r.errors})}):h.state.next({errors:{}})},ue=(T,A,E)=>{const F=(ae(n,T,{_f:{}})._f||{}).ref,V=ae(r.errors,T)||{},{ref:q,message:Y,type:ie,...me}=V;We(r.errors,T,{...me,...A,ref:F}),h.state.next({name:T,errors:r.errors,isValid:!1}),E&&E.shouldFocus&&F&&F.focus&&F.focus()},Se=(T,A)=>fn(T)?h.state.subscribe({next:E=>"values"in E&&T(L(void 0,A),E)}):L(T,A,!0),_e=T=>h.state.subscribe({next:A=>{fD(T.name,A.name,T.exact)&&cD(A,T.formState||c,Oe,T.reRenderRoot)&&T.callback({values:{...a},...r,...A,defaultValues:i})}}).unsubscribe,te=T=>(o.mount=!0,p={...p,...T.formState},_e({...T,formState:{...f,...T.formState}})),re=(T,A={})=>{for(const E of T?vr(T):s.mount)s.mount.delete(E),s.array.delete(E),A.keepValue||(wt(n,E),wt(a,E)),!A.keepError&&wt(r.errors,E),!A.keepDirty&&wt(r.dirtyFields,E),!A.keepTouched&&wt(r.touchedFields,E),!A.keepIsValidating&&wt(r.validatingFields,E),!t.shouldUnregister&&!A.keepDefaultValue&&wt(i,E);h.state.next({values:ot(a)}),h.state.next({...r,...A.keepDirty?{isDirty:D()}:{}}),!A.keepIsValid&&y()},pe=({disabled:T,name:A})=>{if(On(T)&&o.mount||T||s.disabled.has(A)){const V=s.disabled.has(A)!==!!T;T?s.disabled.add(A):s.disabled.delete(A),V&&o.mount&&!o.action&&y()}},K=(T,A={})=>{let E=ae(n,T);const F=On(A.disabled)||On(t.disabled),V=!s.registerName.has(T)&&E&&!E._f.mount;return We(n,T,{...E||{},_f:{...E&&E._f?E._f:{ref:{name:T}},name:T,mount:!0,...A}}),s.mount.add(T),E&&!V?pe({disabled:On(A.disabled)?A.disabled:t.disabled,name:T}):_(T,!0,A.value),{...F?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:nl(A.min),max:nl(A.max),minLength:nl(A.minLength),maxLength:nl(A.maxLength),pattern:nl(A.pattern)}:{},name:T,onChange:W,onBlur:W,ref:q=>{if(q){s.registerName.add(T),K(T,A),s.registerName.delete(T),E=ae(n,T);const Y=Qe(q.value)&&q.querySelectorAll&&q.querySelectorAll("input,select,textarea")[0]||q,ie=rD(Y),me=E._f.refs||[];if(ie?me.find(bt=>bt===Y):Y===E._f.ref)return;We(n,T,{_f:{...E._f,...ie?{refs:[...me.filter(um),Y,...Array.isArray(ae(i,T))?[{}]:[]],ref:{type:Y.type,name:T}}:{ref:Y}}}),_(T,!1,void 0,Y)}else E=ae(n,T,{}),E._f&&(E._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(YM(s.array,T)&&o.action)&&s.unMount.add(T)}}},Pe=()=>t.shouldFocusError&&Io(n,J,s.mount),he=T=>{On(T)&&(h.state.next({disabled:T}),Io(n,(A,E)=>{const F=ae(n,E);F&&(A.disabled=F._f.disabled||T,Array.isArray(F._f.refs)&&F._f.refs.forEach(V=>{V.disabled=F._f.disabled||T}))},0,!1))},Me=(T,A)=>async E=>{let F;E&&(E.preventDefault&&E.preventDefault(),E.persist&&E.persist());let V=ot(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:q,values:Y}=await P();g(),r.errors=q,V=ot(Y)}else await C({fields:n,eventType:ro.SUBMIT});if(s.disabled.size)for(const q of s.disabled)wt(V,q);if(wt(r.errors,tE),Zt(r.errors)){h.state.next({errors:{}});try{await T(V,E)}catch(q){F=q}}else A&&await A({...r.errors},E),Pe(),setTimeout(Pe);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Zt(r.errors)&&!F,submitCount:r.submitCount+1,errors:r.errors}),F)throw F},Be=(T,A={})=>{ae(n,T)&&(Qe(A.defaultValue)?B(T,ot(ae(i,T))):(B(T,A.defaultValue),We(i,T,ot(A.defaultValue))),A.keepTouched||wt(r.touchedFields,T),A.keepDirty||(wt(r.dirtyFields,T),r.isDirty=A.defaultValue?D(T,ot(ae(i,T))):D()),A.keepError||(wt(r.errors,T),c.isValid&&y()),h.state.next({...r}))},ve=(T,A={})=>{const E=T?ot(T):i,F=ot(E),V=Zt(T),q=V?i:F;if(A.keepDefaultValues||(i=E),!A.keepValues){if(A.keepDirtyValues){const Y=new Set([...s.mount,...Object.keys(wl(i,a))]);for(const ie of Array.from(Y)){const me=ae(r.dirtyFields,ie),bt=ae(a,ie),Et=ae(q,ie);me&&!Qe(bt)?We(q,ie,bt):!me&&!Qe(Et)&&B(ie,Et)}}else{if(G0&&Qe(T))for(const Y of s.mount){const ie=ae(n,Y);if(ie&&ie._f){const me=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(Hf(me)){const bt=me.closest("form");if(bt){bt.reset();break}}}}if(A.keepFieldsRef)for(const Y of s.mount)B(Y,ae(q,Y));else n={}}a=t.shouldUnregister?A.keepDefaultValues?ot(i):{}:ot(q),h.array.next({values:{...q}}),h.state.next({values:{...q}})}s={mount:A.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!c.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!t.shouldUnregister&&!Zt(q),o.watch=!!t.shouldUnregister,o.keepIsValid=!!A.keepIsValid,o.action=!1,A.keepErrors||(r.errors={}),h.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:V?!1:A.keepDirty?r.isDirty:!!(A.keepDefaultValues&&!Ci(T,i)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:V?{}:A.keepDirtyValues?A.keepDefaultValues&&a?wl(i,a):r.dirtyFields:A.keepDefaultValues&&T?wl(i,T):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Ae=(T,A)=>ve(fn(T)?T(a):T,{...t.resetOptions,...A}),$e=(T,A={})=>{const E=ae(n,T),F=E&&E._f;if(F){const V=F.refs?F.refs[0]:F.ref;V.focus&&setTimeout(()=>{V.focus(),A.shouldSelect&&fn(V.select)&&V.select()})}},Oe=T=>{r={...r,...T}},Ue={control:{register:K,unregister:re,getFieldState:X,handleSubmit:Me,setError:ue,_subscribe:_e,_runSchema:P,_updateIsValidating:g,_focusError:Pe,_getWatch:L,_getDirty:D,_setValid:y,_setFieldArray:w,_setDisabledField:pe,_setErrors:b,_getFieldArray:z,_reset:ve,_resetDefaultValues:()=>fn(t.defaultValues)&&t.defaultValues().then(T=>{Ae(T,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:he,_subjects:h,_proxyFormState:c,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(T){o=T},get _defaultValues(){return i},get _names(){return s},set _names(T){s=T},get _formState(){return r},get _options(){return t},set _options(T){t={...t,...T}}},subscribe:te,trigger:G,register:K,handleSubmit:Me,watch:Se,setValue:B,getValues:Q,reset:Ae,resetField:Be,clearErrors:de,unregister:re,setError:ue,setFocus:$e,getFieldState:X};return{...Ue,formControl:Ue}}var wi=()=>{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 r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},cm=(e,t,r={})=>r.shouldFocus||Qe(r.shouldFocus)?r.focusName||`${e}.${Qe(r.focusIndex)?t:r.focusIndex}.`:"",fm=(e,t)=>[...e,...vr(t)],dm=e=>Array.isArray(e)?e.map(()=>{}):void 0;function pm(e,t,r){return[...e.slice(0,t),...vr(r),...e.slice(t)]}var hm=(e,t,r)=>Array.isArray(e)?(Qe(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],mm=(e,t)=>[...vr(t),...vr(e)];function vD(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return jp(n).length?n:[]}var vm=(e,t)=>Qe(t)?[]:vD(e,vr(t).sort((r,n)=>r-n)),ym=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},W1=(e,t,r)=>(e[t]=r,e);function yD(e){const t=QM(),{control:r=t,name:n,keyName:i="id",shouldUnregister:a,rules:o}=e,[s,l]=N.useState(r._getFieldArray(n)),u=N.useRef(r._getFieldArray(n).map(wi)),f=N.useRef(!1);r._names.array.add(n),N.useMemo(()=>o&&s.length>=0&&r.register(n,o),[r,n,s.length,o]),nE(()=>r._subjects.array.subscribe({next:({values:S,name:b})=>{if(b===n||!b){const _=ae(S,n);Array.isArray(_)&&(l(_),u.current=_.map(wi))}}}).unsubscribe,[r,n]);const c=N.useCallback(S=>{f.current=!0,r._setFieldArray(n,S)},[r,n]),p=(S,b)=>{const _=vr(ot(S)),O=fm(r._getFieldArray(n),_);r._names.focus=cm(n,O.length-1,b),u.current=fm(u.current,_.map(wi)),c(O),l(O),r._setFieldArray(n,O,fm,{argA:dm(S)})},h=(S,b)=>{const _=vr(ot(S)),O=mm(r._getFieldArray(n),_);r._names.focus=cm(n,0,b),u.current=mm(u.current,_.map(wi)),c(O),l(O),r._setFieldArray(n,O,mm,{argA:dm(S)})},x=S=>{const b=vm(r._getFieldArray(n),S);u.current=vm(u.current,S),c(b),l(b),!Array.isArray(ae(r._fields,n))&&We(r._fields,n,void 0),r._setFieldArray(n,b,vm,{argA:S})},v=(S,b,_)=>{const O=vr(ot(b)),k=pm(r._getFieldArray(n),S,O);r._names.focus=cm(n,S,_),u.current=pm(u.current,S,O.map(wi)),c(k),l(k),r._setFieldArray(n,k,pm,{argA:S,argB:dm(b)})},y=(S,b)=>{const _=r._getFieldArray(n);ym(_,S,b),ym(u.current,S,b),c(_),l(_),r._setFieldArray(n,_,ym,{argA:S,argB:b},!1)},g=(S,b)=>{const _=r._getFieldArray(n);hm(_,S,b),hm(u.current,S,b),c(_),l(_),r._setFieldArray(n,_,hm,{argA:S,argB:b},!1)},m=(S,b)=>{const _=ot(b),O=W1(r._getFieldArray(n),S,_);u.current=[...O].map((k,P)=>!k||P===S?wi():u.current[P]),c(O),l([...O]),r._setFieldArray(n,O,W1,{argA:S,argB:_},!0,!1)},w=S=>{const b=vr(ot(S));u.current=b.map(wi),c([...b]),l([...b]),r._setFieldArray(n,[...b],_=>_,{},!0,!1)};return N.useEffect(()=>{if(r._state.action=!1,ly(n,r._names)&&r._subjects.state.next({...r._formState}),f.current&&(!_o(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!_o(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{r._updateIsValidating([n]);const b=ae(S.errors,n),_=ae(r._formState.errors,n);(_?!b&&_.type||b&&(_.type!==b.type||_.message!==b.message):b&&b.type)&&(b?We(r._formState.errors,n,b):wt(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=ae(r._fields,n);S&&S._f&&!(_o(r._options.reValidateMode).isOnSubmit&&_o(r._options.mode).isOnSubmit)&&uy(S,r._names.disabled,r._formValues,r._options.criteriaMode===Hr.all,r._options.shouldUseNativeValidation,!0).then(b=>!Zt(b)&&r._subjects.state.next({errors:fE(r._formState.errors,b,n)}))}r._subjects.state.next({name:n,values:ot(r._formValues)}),r._names.focus&&Io(r._fields,(S,b)=>{if(r._names.focus&&b.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),f.current=!1},[s,n,r]),N.useEffect(()=>(!ae(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(b,_)=>{const O=ae(r._fields,b);O&&O._f&&(O._f.mount=_)};r._options.shouldUnregister||a?r.unregister(n):S(n,!1)}),[n,r,i,a]),{swap:N.useCallback(y,[c,n,r]),move:N.useCallback(g,[c,n,r]),prepend:N.useCallback(h,[c,n,r]),append:N.useCallback(p,[c,n,r]),remove:N.useCallback(x,[c,n,r]),insert:N.useCallback(v,[c,n,r]),update:N.useCallback(m,[c,n,r]),replace:N.useCallback(w,[c,n,r]),fields:N.useMemo(()=>s.map((S,b)=>({...S,[i]:u.current[b]||wi()})),[s,i])}}function gD(e={}){const t=N.useRef(void 0),r=N.useRef(void 0),[n,i]=N.useState({isDirty:!1,isValidating:!1,isLoading:fn(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:fn(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!fn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=mD(e);t.current={...s,formState:n}}const a=t.current.control;return a._options=e,nE(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(s=>({...s,isReady:!0})),a._formState.isReady=!0,o},[a]),N.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),N.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),N.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),N.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),N.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==n.isDirty&&a._subjects.state.next({isDirty:o})}},[a,n.isDirty]),N.useEffect(()=>{var o;e.values&&!Ci(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((o=a._options.resetOptions)===null||o===void 0)&&o.keepIsValid||a._setValid(),r.current=e.values,i(s=>({...s}))):a._resetDefaultValues()},[a,e.values]),N.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=N.useMemo(()=>JM(n,a),[a,n]),t.current}const H1=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ae(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},dE=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?H1(n.ref,r,e):n.refs&&n.refs.forEach(i=>H1(i,r,e))}},xD=(e,t)=>{t.shouldUseNativeValidation&&dE(e,t);const r={};for(const n in e){const i=ae(t.fields,n),a=Object.assign(e[n]||{},{ref:i&&i.ref});if(bD(t.names||Object.keys(e),n)){const o=Object.assign({},ae(r,n));We(o,"root",a),We(r,n,o)}else We(r,n,a)}return r},bD=(e,t)=>e.some(r=>r.startsWith(t+"."));var wD=function(e,t){for(var r={};e.length;){var n=e[0],i=n.code,a=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:a,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(c){return e.push(c)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=iE(o,t,r,i,u?[].concat(u,n.message):n.message)}e.shift()}return r},_D=function(e,t,r){return r===void 0&&(r={}),function(n,i,a){try{return Promise.resolve(function(o,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return a.shouldUseNativeValidation&&dE({},a),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:xD(wD(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}},Fe;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Fe||(Fe={}));var G1;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(G1||(G1={}));const ce=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=e=>{switch(typeof e){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return Number.isNaN(e)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"symbol":return ce.symbol;case"object":return Array.isArray(e)?ce.array:e===null?ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ce.promise:typeof Map<"u"&&e instanceof Map?ce.map:typeof Set<"u"&&e instanceof Set?ce.set:typeof Date<"u"&&e instanceof Date?ce.date:ce.object;default:return ce.unknown}},ee=Fe.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 oi extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];r[a]=r[a]||[],r[a].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}oi.create=e=>new oi(e);const cy=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===ce.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Fe.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fe.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fe.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${Fe.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Fe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,Fe.assertNever(e)}return{message:r}};let SD=cy;function OD(){return SD}const jD=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function oe(e,t){const r=OD(),n=jD({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===cy?void 0:cy].filter(i=>!!i)});e.common.issues.push(n)}class Ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return xe;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const a=await i.key,o=await i.value;n.push({key:a,value:o})}return Ir.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return xe;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}}const xe=Object.freeze({status:"aborted"}),_l=e=>({status:"dirty",value:e}),en=e=>({status:"valid",value:e}),K1=e=>e.status==="aborted",q1=e=>e.status==="dirty",Xo=e=>e.status==="valid",Kf=e=>typeof Promise<"u"&&e instanceof Promise;var fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(fe||(fe={}));class Zi{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}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 X1=(e,t)=>{if(Xo(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 r=new oi(e.common.issues);return this._error=r,this._error}}};function ke(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,s)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:i}}class Le{get description(){return this._def.description}_getType(t){return Oi(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ir,ctx:{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Kf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},i=this._parseSync({data:t,path:n.path,parent:n});return X1(n,i)}"~validate"(t){var n,i;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return Xo(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(i=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>Xo(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Kf(i)?i:Promise.resolve(i));return X1(n,a)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const o=t(i),s=()=>a.addIssue({code:ee.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new za({schema:this,typeName:be.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:r=>this["~validate"](r)}}optional(){return Wi.create(this,this._def)}nullable(){return Qo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tn.create(this)}promise(){return Zf.create(this,this._def)}or(t){return Xf.create([this,t],this._def)}and(t){return Yf.create(this,t,this._def)}transform(t){return new za({...ke(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new dy({...ke(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new qD({typeName:be.ZodBranded,type:this,...ke(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new py({...ke(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Y0.create(this,t)}readonly(){return hy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const AD=/^c[^\s-]{8,}$/i,kD=/^[0-9a-z]+$/,ED=/^[0-9A-HJKMNP-TV-Z]{26}$/i,PD=/^[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,CD=/^[a-z0-9_-]{21}$/i,TD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ND=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(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[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])))",zD=new RegExp(`^${pE}$`);function hE(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function UD(e){return new RegExp(`^${hE(e)}$`)}function VD(e){let t=`${pE}T${hE(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function WD(e,t){return!!((t==="v4"||!t)&&ID.test(e)||(t==="v6"||!t)&&DD.test(e))}function HD(e,t){if(!TD.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function GD(e,t){return!!((t==="v4"||!t)&&MD.test(e)||(t==="v6"||!t)&&LD.test(e))}class Kn extends Le{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ce.string){const a=this._getOrReturnCtx(t);return oe(a,{code:ee.invalid_type,expected:ce.string,received:a.parsedType}),xe}const n=new Ir;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,s=t.data.lengtht.test(i),{validation:r,code:ee.invalid_string,...fe.errToObj(n)})}_addCheck(t){return new Kn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...fe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...fe.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==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...fe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...fe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...fe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...fe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...fe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...fe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...fe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...fe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...fe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...fe.errToObj(r)})}nonempty(t){return this.min(1,fe.errToObj(t))}trim(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Kn({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Kn({checks:[],typeName:be.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ke(e)});function KD(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return a%o/10**i}class La extends Le{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)!==ce.number){const a=this._getOrReturnCtx(t);return oe(a,{code:ee.invalid_type,expected:ce.number,received:a.parsedType}),xe}let n;const i=new Ir;for(const a of this._def.checks)a.kind==="int"?Fe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?KD(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.not_finite,message:a.message}),i.dirty()):Fe.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,i){return new La({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(i)}]})}_addCheck(t){return new La({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Fe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew La({checks:[],typeName:be.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ke(e)});class Ba extends Le{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)!==ce.bigint)return this._getInvalidInput(t);let n;const i=new Ir;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Fe.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return oe(r,{code:ee.invalid_type,expected:ce.bigint,received:r.parsedType}),xe}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,i){return new Ba({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(i)}]})}_addCheck(t){return new Ba({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Ba({checks:[],typeName:be.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ke(e)});class qf extends Le{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ce.boolean){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.boolean,received:n.parsedType}),xe}return en(t.data)}}qf.create=e=>new qf({typeName:be.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ke(e)});class Yo extends Le{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ce.date){const a=this._getOrReturnCtx(t);return oe(a,{code:ee.invalid_type,expected:ce.date,received:a.parsedType}),xe}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return oe(a,{code:ee.invalid_date}),xe}const n=new Ir;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Fe.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Yo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:fe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:fe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Yo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:be.ZodDate,...ke(e)});class Y1 extends Le{_parse(t){if(this._getType(t)!==ce.symbol){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.symbol,received:n.parsedType}),xe}return en(t.data)}}Y1.create=e=>new Y1({typeName:be.ZodSymbol,...ke(e)});class Z1 extends Le{_parse(t){if(this._getType(t)!==ce.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.undefined,received:n.parsedType}),xe}return en(t.data)}}Z1.create=e=>new Z1({typeName:be.ZodUndefined,...ke(e)});class Q1 extends Le{_parse(t){if(this._getType(t)!==ce.null){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.null,received:n.parsedType}),xe}return en(t.data)}}Q1.create=e=>new Q1({typeName:be.ZodNull,...ke(e)});class J1 extends Le{constructor(){super(...arguments),this._any=!0}_parse(t){return en(t.data)}}J1.create=e=>new J1({typeName:be.ZodAny,...ke(e)});class ew extends Le{constructor(){super(...arguments),this._unknown=!0}_parse(t){return en(t.data)}}ew.create=e=>new ew({typeName:be.ZodUnknown,...ke(e)});class Qi extends Le{_parse(t){const r=this._getOrReturnCtx(t);return oe(r,{code:ee.invalid_type,expected:ce.never,received:r.parsedType}),xe}}Qi.create=e=>new Qi({typeName:be.ZodNever,...ke(e)});class tw extends Le{_parse(t){if(this._getType(t)!==ce.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.void,received:n.parsedType}),xe}return en(t.data)}}tw.create=e=>new tw({typeName:be.ZodVoid,...ke(e)});class Tn extends Le{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ce.array)return oe(r,{code:ee.invalid_type,expected:ce.array,received:r.parsedType}),xe;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,s=r.data.lengthi.maxLength.value&&(oe(r,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new Zi(r,o,r.path,s)))).then(o=>Ir.mergeArray(n,o));const a=[...r.data].map((o,s)=>i.type._parseSync(new Zi(r,o,r.path,s)));return Ir.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new Tn({...this._def,minLength:{value:t,message:fe.toString(r)}})}max(t,r){return new Tn({...this._def,maxLength:{value:t,message:fe.toString(r)}})}length(t,r){return new Tn({...this._def,exactLength:{value:t,message:fe.toString(r)}})}nonempty(t){return this.min(1,t)}}Tn.create=(e,t)=>new Tn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...ke(t)});function oo(e){if(e instanceof jt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Wi.create(oo(n))}return new jt({...e._def,shape:()=>t})}else return e instanceof Tn?new Tn({...e._def,type:oo(e.element)}):e instanceof Wi?Wi.create(oo(e.unwrap())):e instanceof Qo?Qo.create(oo(e.unwrap())):e instanceof Fa?Fa.create(e.items.map(t=>oo(t))):e}class jt extends Le{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(),r=Fe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ce.object){const u=this._getOrReturnCtx(t);return oe(u,{code:ee.invalid_type,expected:ce.object,received:u.parsedType}),xe}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Qi&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const f=a[u],c=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new Zi(i,c,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Qi){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")s.length>0&&(oe(i,{code:ee.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of s){const c=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new Zi(i,c,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const c=await f.key,p=await f.value;u.push({key:c,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>Ir.mergeObjectSync(n,u)):Ir.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return fe.errToObj,new jt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,o;const i=((o=(a=this._def).errorMap)==null?void 0:o.call(a,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:fe.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new jt({...this._def,unknownKeys:"strip"})}passthrough(){return new jt({...this._def,unknownKeys:"passthrough"})}extend(t){return new jt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new jt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:be.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new jt({...this._def,catchall:t})}pick(t){const r={};for(const n of Fe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new jt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Fe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new jt({...this._def,shape:()=>r})}deepPartial(){return oo(this)}partial(t){const r={};for(const n of Fe.objectKeys(this.shape)){const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new jt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Fe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Wi;)a=a._def.innerType;r[n]=a}return new jt({...this._def,shape:()=>r})}keyof(){return mE(Fe.objectKeys(this.shape))}}jt.create=(e,t)=>new jt({shape:()=>e,unknownKeys:"strip",catchall:Qi.create(),typeName:be.ZodObject,...ke(t)});jt.strictCreate=(e,t)=>new jt({shape:()=>e,unknownKeys:"strict",catchall:Qi.create(),typeName:be.ZodObject,...ke(t)});jt.lazycreate=(e,t)=>new jt({shape:e,unknownKeys:"strip",catchall:Qi.create(),typeName:be.ZodObject,...ke(t)});class Xf extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new oi(s.ctx.common.issues));return oe(r,{code:ee.invalid_union,unionErrors:o}),xe}if(r.common.async)return Promise.all(n.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new oi(l));return oe(r,{code:ee.invalid_union,unionErrors:s}),xe}}get options(){return this._def.options}}Xf.create=(e,t)=>new Xf({options:e,typeName:be.ZodUnion,...ke(t)});function fy(e,t){const r=Oi(e),n=Oi(t);if(e===t)return{valid:!0,data:e};if(r===ce.object&&n===ce.object){const i=Fe.objectKeys(t),a=Fe.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...t};for(const s of a){const l=fy(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===ce.array&&n===ce.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a{if(K1(a)||K1(o))return xe;const s=fy(a.value,o.value);return s.valid?((q1(a)||q1(o))&&r.dirty(),{status:r.value,value:s.data}):(oe(n,{code:ee.invalid_intersection_types}),xe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Yf.create=(e,t,r)=>new Yf({left:e,right:t,typeName:be.ZodIntersection,...ke(r)});class Fa extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.array)return oe(n,{code:ee.invalid_type,expected:ce.array,received:n.parsedType}),xe;if(n.data.lengththis._def.items.length&&(oe(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Zi(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Ir.mergeArray(r,o)):Ir.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Fa({...this._def,rest:t})}}Fa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fa({items:e,typeName:be.ZodTuple,rest:null,...ke(t)})};class rw extends Le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.map)return oe(n,{code:ee.invalid_type,expected:ce.map,received:n.parsedType}),xe;const i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:i._parse(new Zi(n,s,n.path,[u,"key"])),value:a._parse(new Zi(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return xe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return xe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}}rw.create=(e,t,r)=>new rw({valueType:t,keyType:e,typeName:be.ZodMap,...ke(r)});class cu extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.set)return oe(n,{code:ee.invalid_type,expected:ce.set,received:n.parsedType}),xe;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(oe(n,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return xe;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>a._parse(new Zi(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new cu({...this._def,minSize:{value:t,message:fe.toString(r)}})}max(t,r){return new cu({...this._def,maxSize:{value:t,message:fe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}cu.create=(e,t)=>new cu({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...ke(t)});class nw extends Le{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}nw.create=(e,t)=>new nw({getter:e,typeName:be.ZodLazy,...ke(t)});class iw extends Le{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return oe(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:t.data}}get value(){return this._def.value}}iw.create=(e,t)=>new iw({value:e,typeName:be.ZodLiteral,...ke(t)});function mE(e,t){return new Zo({values:e,typeName:be.ZodEnum,...ke(t)})}class Zo extends Le{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{expected:Fe.joinValues(n),received:r.parsedType,code:ee.invalid_type}),xe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{received:r.data,code:ee.invalid_enum_value,options:n}),xe}return en(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Zo.create(t,{...this._def,...r})}exclude(t,r=this._def){return Zo.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Zo.create=mE;class aw extends Le{_parse(t){const r=Fe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ce.string&&n.parsedType!==ce.number){const i=Fe.objectValues(r);return oe(n,{expected:Fe.joinValues(i),received:n.parsedType,code:ee.invalid_type}),xe}if(this._cache||(this._cache=new Set(Fe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Fe.objectValues(r);return oe(n,{received:n.data,code:ee.invalid_enum_value,options:i}),xe}return en(t.data)}get enum(){return this._def.values}}aw.create=(e,t)=>new aw({values:e,typeName:be.ZodNativeEnum,...ke(t)});class Zf extends Le{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.promise&&r.common.async===!1)return oe(r,{code:ee.invalid_type,expected:ce.promise,received:r.parsedType}),xe;const n=r.parsedType===ce.promise?r.data:Promise.resolve(r.data);return en(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Zf.create=(e,t)=>new Zf({type:e,typeName:be.ZodPromise,...ke(t)});class za extends Le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{oe(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return xe;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?xe:l.status==="dirty"||r.value==="dirty"?_l(l.value):l});{if(r.value==="aborted")return xe;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?xe:s.status==="dirty"||r.value==="dirty"?_l(s.value):s}}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?xe:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?xe:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Xo(o))return xe;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Xo(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):xe);Fe.assertNever(i)}}za.create=(e,t,r)=>new za({schema:e,typeName:be.ZodEffects,effect:t,...ke(r)});za.createWithPreprocess=(e,t,r)=>new za({schema:t,effect:{type:"preprocess",transform:e},typeName:be.ZodEffects,...ke(r)});class Wi extends Le{_parse(t){return this._getType(t)===ce.undefined?en(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Wi.create=(e,t)=>new Wi({innerType:e,typeName:be.ZodOptional,...ke(t)});class Qo extends Le{_parse(t){return this._getType(t)===ce.null?en(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Qo.create=(e,t)=>new Qo({innerType:e,typeName:be.ZodNullable,...ke(t)});class dy extends Le{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ce.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}dy.create=(e,t)=>new dy({innerType:e,typeName:be.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ke(t)});class py extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Kf(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new oi(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new oi(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}py.create=(e,t)=>new py({innerType:e,typeName:be.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ke(t)});class ow extends Le{_parse(t){if(this._getType(t)!==ce.nan){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.nan,received:n.parsedType}),xe}return{status:"valid",value:t.data}}}ow.create=e=>new ow({typeName:be.ZodNaN,...ke(e)});class qD extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Y0 extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?xe:a.status==="dirty"?(r.dirty(),_l(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?xe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new Y0({in:t,out:r,typeName:be.ZodPipeline})}}class hy extends Le{_parse(t){const r=this._def.innerType._parse(t),n=i=>(Xo(i)&&(i.value=Object.freeze(i.value)),i);return Kf(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}hy.create=(e,t)=>new hy({innerType:e,typeName:be.ZodReadonly,...ke(t)});var be;(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"})(be||(be={}));const sw=Kn.create,$l=La.create;Ba.create;qf.create;Yo.create;Qi.create;const XD=Tn.create,vE=jt.create;Xf.create;Yf.create;Fa.create;Zo.create;Zf.create;Wi.create;Qo.create;const Rl=za.createWithPreprocess,yE={string:e=>Kn.create({...e,coerce:!0}),number:e=>La.create({...e,coerce:!0}),boolean:e=>qf.create({...e,coerce:!0}),bigint:e=>Ba.create({...e,coerce:!0}),date:e=>Yo.create({...e,coerce:!0})},YD={primary:"bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white",ghost:"text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]",danger:"bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]"},ZD={sm:"px-4 py-1.5 text-xs font-semibold",md:"px-5 py-2.5 text-sm font-semibold"};function ht({variant:e="primary",size:t="md",className:r="",...n}){return d.jsx("button",{className:`relative inline-flex items-center justify-center gap-2 rounded-full transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/50 focus:ring-offset-1 focus:ring-offset-transparent focus:border-transparent ${YD[e]} ${ZD[t]} ${r}`,...n,children:n.children})}function Zn({error:e}){return e?d.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/8 px-4 py-3 text-sm text-red-400 font-mono",children:e}):null}function kn({size:e=20}){return d.jsxs("svg",{className:"animate-spin text-brand-500",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}const QD={SR_SELECTION_V3_ROUTING:"bg-blue-100 text-blue-800",PRIORITY_LOGIC:"bg-purple-100 text-purple-800",NTW_BASED_ROUTING:"bg-green-100 text-green-800",SR_SELECTION_V3_ROUTING_WITH_HEDGING:"bg-orange-100 text-orange-800",HEDGING:"bg-orange-100 text-orange-800"},JD=["card","card_redirect","pay_later","wallet","bank_redirect","bank_transfer","crypto","bank_debit","reward","real_time_payment","upi","voucher","gift_card","open_banking","mobile_payment"],eL={card:["credit","debit"],bank_debit:["ach","sepa","bacs","becs"],bank_transfer:["ach","sepa","sepa_bank_transfer","bacs","multibanco","pix","pse","permata_bank_transfer","bca_bank_transfer","bni_va","bri_va","cimb_va","danamon_va","mandiri_va","local_bank_transfer","instant_bank_transfer"],wallet:["amazon_pay","apple_pay","google_pay","paypal","ali_pay","ali_pay_hk","dana","mb_way","mobile_pay","samsung_pay","twint","vipps","touch_n_go","swish","we_chat_pay","go_pay","gcash","momo","kakao_pay","cashapp","mifinity","paze"],pay_later:["affirm","alma","afterpay_clearpay","klarna","pay_bright","atome","walley"],upi:["upi_collect","upi_intent"],voucher:["boleto","efecty","pago_efectivo","red_compra","red_pagos","indomaret","alfamart","oxxo","seven_eleven","lawson","mini_stop","family_mart","seicomart","pay_easy"],bank_redirect:["giropay","ideal","sofort","eft","eps","bancontact_card","blik","local_bank_redirect","online_banking_thailand","online_banking_czech_republic","online_banking_finland","online_banking_fpx","online_banking_poland","online_banking_slovakia","przelewy24","trustly","bizum","interac","open_banking_uk","open_banking_pis"],gift_card:["givex","pay_safe_card"],card_redirect:["knet","benefit","momo_atm","card_redirect"],real_time_payment:["fps","duit_now","prompt_pay","viet_qr"],crypto:["crypto_currency"],reward:["evoucher","classic_reward"],open_banking:["open_banking_pis"],mobile_payment:["direct_carrier_billing"]},tL=vE({paymentMethodType:sw().min(1),paymentMethod:sw().min(1),bucketSize:yE.number().int().positive(),hedgingPercent:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),latencyThreshold:Rl(e=>e===""||e===null?null:Number(e),$l().nullable())}),rL=vE({defaultBucketSize:yE.number().int().positive(),defaultSuccessRate:Rl(e=>e===""||e===null?null:Number(e),$l().min(0).max(1).nullable()),defaultLatencyThreshold:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),defaultHedgingPercent:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),subLevelInputConfig:XD(tL)});function nL(){var I,D,L,z,U;const{merchantId:e}=na(),[t,r]=j.useState(!1),[n,i]=j.useState(null),[a,o]=j.useState(!1),[s,l]=j.useState(!1),[u,f]=j.useState(!1),[c,p]=j.useState(null),{data:h,isLoading:x,mutate:v}=vn(e?["rule-sr",e]:null,()=>ft("/rule/get",{merchant_id:e,algorithm:"successRate"}),{shouldRetryOnError:!1}),{register:y,control:g,handleSubmit:m,reset:w,watch:S,formState:{errors:b}}=gD({resolver:_D(rL),defaultValues:{defaultBucketSize:200,defaultSuccessRate:.5,defaultLatencyThreshold:null,defaultHedgingPercent:null,subLevelInputConfig:[]}});j.useEffect(()=>{var M;if((M=h==null?void 0:h.config)!=null&&M.data){const B=h.config.data;w({defaultBucketSize:B.defaultBucketSize??200,defaultSuccessRate:B.defaultSuccessRate??.5,defaultLatencyThreshold:B.defaultLatencyThreshold??null,defaultHedgingPercent:B.defaultHedgingPercent??null,subLevelInputConfig:B.subLevelInputConfig??[]})}},[h,w]);const{fields:_,append:O,remove:k}=yD({control:g,name:"subLevelInputConfig"}),P=S("subLevelInputConfig");async function R(){try{await ft("/merchant-account/create",{merchant_id:e,gateway_success_rate_based_decider_input:null})}catch{}}async function $(M){if(!e){i("Set a Merchant ID first.");return}r(!0),i(null),o(!1);try{await R(),await ft(h?"/rule/update":"/rule/create",{merchant_id:e,config:{type:"successRate",data:{defaultBucketSize:M.defaultBucketSize,defaultSuccessRate:M.defaultSuccessRate,defaultLatencyThreshold:M.defaultLatencyThreshold,defaultHedgingPercent:M.defaultHedgingPercent,subLevelInputConfig:M.subLevelInputConfig.length>0?M.subLevelInputConfig:null}}}),o(!0),v()}catch(B){i(B instanceof Error?B.message:String(B))}finally{r(!1)}}async function C(){if(e){f(!0),p(null);try{await ft("/rule/delete",{merchant_id:e,algorithm:"successRate"}),v(void 0,{revalidate:!1})}catch(M){p(M instanceof Error?M.message:String(M))}finally{f(!1)}}}return d.jsxs("div",{className:"space-y-6 max-w-5xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Auth-Rate Based Routing"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure success-rate based gateway routing"})]}),!e&&d.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-800",children:"Set a Merchant ID in the top bar to load and save configuration."}),e&&!x&&d.jsxs(Ce,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Configuration Status"}),d.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(I=h==null?void 0:h.config)!=null&&I.data?"Success Rate routing is configured and active":"No Success Rate configuration found"})]}),d.jsx(Qt,{variant:(D=h==null?void 0:h.config)!=null&&D.data?"green":"gray",children:(L=h==null?void 0:h.config)!=null&&L.data?"Active":"Not Configured"})]}),((z=h==null?void 0:h.config)==null?void 0:z.data)&&d.jsxs(Te,{className:"border-t border-slate-100 dark:border-[#222226]",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Last Modified:"}),d.jsx("span",{className:"ml-1 font-medium",children:h.modified_at?new Date(h.modified_at).toLocaleString():"Unknown"})]}),d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>{confirm("Are you sure you want to clear the Success Rate configuration? This will disable SR-based routing.")&&C()},disabled:u,children:[d.jsx(ai,{size:14,className:"mr-1"}),u?"Clearing...":"Clear Configuration"]})]}),c&&d.jsx("p",{className:"text-xs text-red-500 mt-2",children:c})]})]}),x?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx(kn,{})}):d.jsxs("form",{onSubmit:m($),className:"space-y-6",children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Success Rate Config"})}),d.jsxs(Te,{className:"overflow-x-auto p-0",children:[d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-200 dark:border-[#1c1c24] bg-slate-50 dark:bg-[#0a0a0f]",children:[d.jsx("th",{className:"px-4 py-2",children:"Payment Method Type"}),d.jsx("th",{className:"px-4 py-2",children:"Payment Method"}),d.jsx("th",{className:"px-4 py-2",children:"Bucket Size"}),d.jsx("th",{className:"px-4 py-2",children:"Success Rate"}),d.jsx("th",{className:"px-4 py-2",children:"Hedging %"}),d.jsx("th",{className:"px-4 py-2",children:"Latency Threshold (ms)"}),d.jsx("th",{className:"px-4 py-2"})]})}),d.jsxs("tbody",{children:[d.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] bg-brand-50/50 dark:bg-[#151518]",children:[d.jsx("td",{className:"px-4 py-2 text-slate-500 italic",children:"Default"}),d.jsx("td",{className:"px-4 py-2 text-slate-400",children:"—"}),d.jsxs("td",{className:"px-4 py-2",children:[d.jsx("input",{type:"number",...y("defaultBucketSize"),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"}),b.defaultBucketSize&&d.jsx("p",{className:"text-xs text-red-500 mt-0.5",children:b.defaultBucketSize.message})]}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",...y("defaultSuccessRate"),placeholder:"0.5",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",...y("defaultHedgingPercent"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...y("defaultLatencyThreshold"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2"})]}),_.map((M,B)=>{var G;const W=((G=P==null?void 0:P[B])==null?void 0:G.paymentMethodType)||"",J=eL[W]||[];return d.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[d.jsx("td",{className:"px-4 py-2",children:d.jsx("select",{...y(`subLevelInputConfig.${B}.paymentMethodType`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:JD.map(Q=>d.jsx("option",{value:Q,children:Q},Q))})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("select",{...y(`subLevelInputConfig.${B}.paymentMethod`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(J.length?J:["credit","debit"]).map(Q=>d.jsx("option",{value:Q,children:Q},Q))})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...y(`subLevelInputConfig.${B}.bucketSize`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",...y(`subLevelInputConfig.${B}.hedgingPercent`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...y(`subLevelInputConfig.${B}.latencyThreshold`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("button",{type:"button",onClick:()=>k(B),className:"text-slate-400 hover:text-red-500",children:d.jsx(ai,{size:14})})})]},M.id)})]})]}),d.jsx("div",{className:"px-4 py-3",children:d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>O({paymentMethodType:"card",paymentMethod:"credit",bucketSize:20,hedgingPercent:null,latencyThreshold:null}),children:[d.jsx(Xi,{size:14})," Add Level"]})})]})]}),d.jsx(Zn,{error:n}),a&&d.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-4 py-3 text-sm text-emerald-400",children:"Configuration saved successfully."}),((U=h==null?void 0:h.config)==null?void 0:U.data)&&d.jsxs(Ce,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Current Active Configuration"}),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!s),children:[d.jsx(_p,{size:14,className:"mr-1"}),s?"Hide":"View"]})]}),s&&d.jsx(Te,{children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-4",children:[d.jsxs("div",{className:"border-b border-slate-200 dark:border-[#222226] pb-3",children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Default Settings"}),d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultBucketSize})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Success Rate:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultSuccessRate??"Not set"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultHedgingPercent??"Not set"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),d.jsxs("p",{className:"font-medium",children:[h.config.data.defaultLatencyThreshold??"Not set"," ms"]})]})]})]}),h.config.data.subLevelInputConfig&&h.config.data.subLevelInputConfig.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Sub-Level Configurations"}),d.jsx("div",{className:"space-y-2",children:h.config.data.subLevelInputConfig.map((M,B)=>d.jsx("div",{className:"bg-slate-50 dark:bg-[#151518] rounded-lg p-3",children:d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Payment Type:"}),d.jsx("p",{className:"font-medium capitalize",children:M.paymentMethodType})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Payment Method:"}),d.jsx("p",{className:"font-medium",children:M.paymentMethod})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),d.jsx("p",{className:"font-medium",children:M.bucketSize})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),d.jsx("p",{className:"font-medium",children:M.hedgingPercent??"Default"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),d.jsxs("p",{className:"font-medium",children:[M.latencyThreshold??"Default"," ms"]})]})]})},B))})]}),d.jsxs("div",{className:"border-t border-gray-200 pt-3",children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Raw Configuration (JSON)"}),d.jsx("pre",{className:"bg-slate-900 dark:bg-[#0f0f11] text-slate-100 border border-transparent dark:border-[#222226] rounded-lg p-3 text-xs overflow-auto max-h-64",children:JSON.stringify(h.config,null,2)})]})]})})]}),d.jsx(ht,{type:"submit",disabled:t||!e,children:t?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Saving…"]}):"Save Configuration"})]})]})}function iL(){for(var e=arguments.length,t=new Array(e),r=0;rn=>{t.forEach(i=>i(n))},t)}const Ap=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ps(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Z0(e){return"nodeType"in e}function wr(e){var t,r;return e?Ps(e)?e:Z0(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Q0(e){const{Document:t}=wr(e);return e instanceof t}function ac(e){return Ps(e)?!1:e instanceof wr(e).HTMLElement}function gE(e){return e instanceof wr(e).SVGElement}function Cs(e){return e?Ps(e)?e.document:Z0(e)?Q0(e)?e:ac(e)||gE(e)?e.ownerDocument:document:document:document}const Rn=Ap?j.useLayoutEffect:j.useEffect;function J0(e){const t=j.useRef(e);return Rn(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i{e.current=setInterval(n,i)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function fu(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return Rn(()=>{r.current!==e&&(r.current=e)},t),r}function oc(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Qf(e){const t=J0(e),r=j.useRef(null),n=j.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function my(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let xm={};function sc(e,t){return j.useMemo(()=>{if(t)return t;const r=xm[e]==null?0:xm[e]+1;return xm[e]=r,e+"-"+r},[e,t])}function xE(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i{const s=Object.entries(o);for(const[l,u]of s){const f=a[l];f!=null&&(a[l]=f+e*u)}return a},{...t})}}const Mo=xE(1),du=xE(-1);function oL(e){return"clientX"in e&&"clientY"in e}function ex(e){if(!e)return!1;const{KeyboardEvent:t}=wr(e.target);return t&&e instanceof t}function sL(e){if(!e)return!1;const{TouchEvent:t}=wr(e.target);return t&&e instanceof t}function vy(e){if(sL(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return oL(e)?{x:e.clientX,y:e.clientY}:null}const pu=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[pu.Translate.toString(e),pu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),lw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function lL(e){return e.matches(lw)?e:e.querySelector(lw)}const uL={display:"none"};function cL(e){let{id:t,value:r}=e;return N.createElement("div",{id:t,style:uL},r)}function fL(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return N.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function dL(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const bE=j.createContext(null);function pL(e){const t=j.useContext(bE);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function hL(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.useCallback(n=>{let{type:i,event:a}=n;e.forEach(o=>{var s;return(s=o[i])==null?void 0:s.call(o,a)})},[e]),t]}const mL={draggable:` + To pick up a draggable item, press the space bar. + While dragging, use the arrow keys to move the item. + Press space again to drop the item in its new position, or press escape to cancel. + `},vL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function yL(e){let{announcements:t=vL,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=mL}=e;const{announce:a,announcement:o}=dL(),s=sc("DndLiveRegion"),[l,u]=j.useState(!1);if(j.useEffect(()=>{u(!0)},[]),pL(j.useMemo(()=>({onDragStart(c){let{active:p}=c;a(t.onDragStart({active:p}))},onDragMove(c){let{active:p,over:h}=c;t.onDragMove&&a(t.onDragMove({active:p,over:h}))},onDragOver(c){let{active:p,over:h}=c;a(t.onDragOver({active:p,over:h}))},onDragEnd(c){let{active:p,over:h}=c;a(t.onDragEnd({active:p,over:h}))},onDragCancel(c){let{active:p,over:h}=c;a(t.onDragCancel({active:p,over:h}))}}),[a,t])),!l)return null;const f=N.createElement(N.Fragment,null,N.createElement(cL,{id:n,value:i.draggable}),N.createElement(fL,{id:s,announcement:o}));return r?wo.createPortal(f,r):f}var $t;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})($t||($t={}));function Jf(){}function uw(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function gL(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const yn=Object.freeze({x:0,y:0});function wE(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function _E(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function xL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function cw(e){let{left:t,top:r,height:n,width:i}=e;return[{x:t,y:r},{x:t+i,y:r},{x:t,y:r+n},{x:t+i,y:r+n}]}function SE(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function fw(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const bL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=fw(t,t.left,t.top),a=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=wE(fw(l),i);a.push({id:s,data:{droppableContainer:o,value:u}})}}return a.sort(_E)},wL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=cw(t),a=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=cw(l),f=i.reduce((p,h,x)=>p+wE(u[x],h),0),c=Number((f/4).toFixed(4));a.push({id:s,data:{droppableContainer:o,value:c}})}}return a.sort(_E)};function _L(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-n,s=a-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:o}=a,s=r.get(o);if(s){const l=_L(s,t);l>0&&i.push({id:o,data:{droppableContainer:a,value:l}})}}return i.sort(xL)};function OL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function OE(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:yn}function jL(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a({...o,top:o.top+e*s.y,bottom:o.bottom+e*s.y,left:o.left+e*s.x,right:o.right+e*s.x}),{...r})}}const AL=jL(1);function kL(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function EL(e,t,r){const n=kL(t);if(!n)return e;const{scaleX:i,scaleY:a,x:o,y:s}=n,l=e.left-o-(1-i)*parseFloat(r),u=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=i?e.width/i:e.width,c=a?e.height/a:e.height;return{width:f,height:c,top:u,right:l+f,bottom:u+c,left:l}}const PL={ignoreTransform:!1};function Ts(e,t){t===void 0&&(t=PL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=wr(e).getComputedStyle(e);u&&(r=EL(r,u,f))}const{top:n,left:i,width:a,height:o,bottom:s,right:l}=r;return{top:n,left:i,width:a,height:o,bottom:s,right:l}}function dw(e){return Ts(e,{ignoreTransform:!0})}function CL(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function TL(e,t){return t===void 0&&(t=wr(e).getComputedStyle(e)),t.position==="fixed"}function NL(e,t){t===void 0&&(t=wr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function kp(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(Q0(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!ac(i)||gE(i)||r.includes(i))return r;const a=wr(e).getComputedStyle(i);return i!==e&&NL(i,a)&&r.push(i),TL(i,a)?r:n(i.parentNode)}return e?n(e):r}function jE(e){const[t]=kp(e,1);return t??null}function bm(e){return!Ap||!e?null:Ps(e)?e:Z0(e)?Q0(e)||e===Cs(e).scrollingElement?window:ac(e)?e:null:null}function AE(e){return Ps(e)?e.scrollX:e.scrollLeft}function kE(e){return Ps(e)?e.scrollY:e.scrollTop}function yy(e){return{x:AE(e),y:kE(e)}}var Bt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Bt||(Bt={}));function EE(e){return!Ap||!e?!1:e===document.scrollingElement}function PE(e){const t={x:0,y:0},r=EE(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const $L={x:.2,y:.2};function RL(e,t,r,n,i){let{top:a,left:o,right:s,bottom:l}=r;n===void 0&&(n=10),i===void 0&&(i=$L);const{isTop:u,isBottom:f,isLeft:c,isRight:p}=PE(e),h={x:0,y:0},x={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!u&&a<=t.top+v.height?(h.y=Bt.Backward,x.y=n*Math.abs((t.top+v.height-a)/v.height)):!f&&l>=t.bottom-v.height&&(h.y=Bt.Forward,x.y=n*Math.abs((t.bottom-v.height-l)/v.height)),!p&&s>=t.right-v.width?(h.x=Bt.Forward,x.x=n*Math.abs((t.right-v.width-s)/v.width)):!c&&o<=t.left+v.width&&(h.x=Bt.Backward,x.x=n*Math.abs((t.left+v.width-o)/v.width)),{direction:h,speed:x}}function IL(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:o}=window;return{top:0,left:0,right:a,bottom:o,width:a,height:o}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function CE(e){return e.reduce((t,r)=>Mo(t,yy(r)),yn)}function ML(e){return e.reduce((t,r)=>t+AE(r),0)}function DL(e){return e.reduce((t,r)=>t+kE(r),0)}function LL(e,t){if(t===void 0&&(t=Ts),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);jE(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const BL=[["x",["left","right"],ML],["y",["top","bottom"],DL]];class tx{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=kp(r),i=CE(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,o,s]of BL)for(const l of o)Object.defineProperty(this,l,{get:()=>{const u=s(n),f=i[a]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Il{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function FL(e){const{EventTarget:t}=wr(e);return e instanceof t?e:Cs(e)}function wm(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ur;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ur||(Ur={}));function pw(e){e.preventDefault()}function zL(e){e.stopPropagation()}var Ie;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ie||(Ie={}));const TE={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter,Ie.Tab]},UL=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ie.Right:return{...r,x:r.x+25};case Ie.Left:return{...r,x:r.x-25};case Ie.Down:return{...r,y:r.y+25};case Ie.Up:return{...r,y:r.y-25}}};class rx{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Il(Cs(r)),this.windowListeners=new Il(wr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ur.Resize,this.handleCancel),this.windowListeners.add(Ur.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ur.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&LL(n),r(yn)}handleKeyDown(t){if(ex(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=TE,coordinateGetter:o=UL,scrollBehavior:s="smooth"}=i,{code:l}=t;if(a.end.includes(l)){this.handleEnd(t);return}if(a.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,f=u?{x:u.left,y:u.top}:yn;this.referenceCoordinates||(this.referenceCoordinates=f);const c=o(t,{active:r,context:n.current,currentCoordinates:f});if(c){const p=du(c,f),h={x:0,y:0},{scrollableAncestors:x}=n.current;for(const v of x){const y=t.code,{isTop:g,isRight:m,isLeft:w,isBottom:S,maxScroll:b,minScroll:_}=PE(v),O=IL(v),k={x:Math.min(y===Ie.Right?O.right-O.width/2:O.right,Math.max(y===Ie.Right?O.left:O.left+O.width/2,c.x)),y:Math.min(y===Ie.Down?O.bottom-O.height/2:O.bottom,Math.max(y===Ie.Down?O.top:O.top+O.height/2,c.y))},P=y===Ie.Right&&!m||y===Ie.Left&&!w,R=y===Ie.Down&&!S||y===Ie.Up&&!g;if(P&&k.x!==c.x){const $=v.scrollLeft+p.x,C=y===Ie.Right&&$<=b.x||y===Ie.Left&&$>=_.x;if(C&&!p.y){v.scrollTo({left:$,behavior:s});return}C?h.x=v.scrollLeft-$:h.x=y===Ie.Right?v.scrollLeft-b.x:v.scrollLeft-_.x,h.x&&v.scrollBy({left:-h.x,behavior:s});break}else if(R&&k.y!==c.y){const $=v.scrollTop+p.y,C=y===Ie.Down&&$<=b.y||y===Ie.Up&&$>=_.y;if(C&&!p.x){v.scrollTo({top:$,behavior:s});return}C?h.y=v.scrollTop-$:h.y=y===Ie.Down?v.scrollTop-b.y:v.scrollTop-_.y,h.y&&v.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,Mo(du(c,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}rx.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=TE,onActivation:i}=t,{active:a}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function hw(e){return!!(e&&"distance"in e)}function mw(e){return!!(e&&"delay"in e)}class nx{constructor(t,r,n){var i;n===void 0&&(n=FL(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:o}=a;this.props=t,this.events=r,this.document=Cs(o),this.documentListeners=new Il(this.document),this.listeners=new Il(n),this.windowListeners=new Il(wr(o)),this.initialCoordinates=(i=vy(a))!=null?i:yn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ur.Resize,this.handleCancel),this.windowListeners.add(Ur.DragStart,pw),this.windowListeners.add(Ur.VisibilityChange,this.handleCancel),this.windowListeners.add(Ur.ContextMenu,pw),this.documentListeners.add(Ur.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(mw(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(hw(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ur.Click,zL,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ur.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:o,options:{activationConstraint:s}}=a;if(!i)return;const l=(r=vy(t))!=null?r:yn,u=du(i,l);if(!n&&s){if(hw(s)){if(s.tolerance!=null&&wm(u,s.tolerance))return this.handleCancel();if(wm(u,s.distance))return this.handleStart()}if(mw(s)&&wm(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ie.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const VL={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ix extends nx{constructor(t){const{event:r}=t,n=Cs(r.target);super(t,VL,n)}}ix.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const WL={move:{name:"mousemove"},end:{name:"mouseup"}};var gy;(function(e){e[e.RightClick=2]="RightClick"})(gy||(gy={}));class HL extends nx{constructor(t){super(t,WL,Cs(t.event.target))}}HL.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===gy.RightClick?!1:(n==null||n({event:r}),!0)}}];const _m={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class GL extends nx{constructor(t){super(t,_m)}static setup(){return window.addEventListener(_m.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(_m.move.name,t)};function t(){}}}GL.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var Ml;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ml||(Ml={}));var ed;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ed||(ed={}));function KL(e){let{acceleration:t,activator:r=Ml.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:o=5,order:s=ed.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:c,threshold:p}=e;const h=XL({delta:c,disabled:!a}),[x,v]=aL(),y=j.useRef({x:0,y:0}),g=j.useRef({x:0,y:0}),m=j.useMemo(()=>{switch(r){case Ml.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ml.DraggableRect:return i}},[r,i,l]),w=j.useRef(null),S=j.useCallback(()=>{const _=w.current;if(!_)return;const O=y.current.x*g.current.x,k=y.current.y*g.current.y;_.scrollBy(O,k)},[]),b=j.useMemo(()=>s===ed.TreeOrder?[...u].reverse():u,[s,u]);j.useEffect(()=>{if(!a||!u.length||!m){v();return}for(const _ of b){if((n==null?void 0:n(_))===!1)continue;const O=u.indexOf(_),k=f[O];if(!k)continue;const{direction:P,speed:R}=RL(_,k,m,t,p);for(const $ of["x","y"])h[$][P[$]]||(R[$]=0,P[$]=0);if(R.x>0||R.y>0){v(),w.current=_,x(S,o),y.current=R,g.current=P;return}}y.current={x:0,y:0},g.current={x:0,y:0},v()},[t,S,n,v,a,o,JSON.stringify(m),JSON.stringify(h),x,u,b,f,JSON.stringify(p)])}const qL={x:{[Bt.Backward]:!1,[Bt.Forward]:!1},y:{[Bt.Backward]:!1,[Bt.Forward]:!1}};function XL(e){let{delta:t,disabled:r}=e;const n=my(t);return oc(i=>{if(r||!n||!i)return qL;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Bt.Backward]:i.x[Bt.Backward]||a.x===-1,[Bt.Forward]:i.x[Bt.Forward]||a.x===1},y:{[Bt.Backward]:i.y[Bt.Backward]||a.y===-1,[Bt.Forward]:i.y[Bt.Forward]||a.y===1}}},[r,t,n])}function YL(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return oc(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function ZL(e,t){return j.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...a]},[]),[e,t])}var hu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hu||(hu={}));var xy;(function(e){e.Optimized="optimized"})(xy||(xy={}));const vw=new Map;function QL(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,o]=j.useState(null),{frequency:s,measure:l,strategy:u}=i,f=j.useRef(e),c=y(),p=fu(c),h=j.useCallback(function(g){g===void 0&&(g=[]),!p.current&&o(m=>m===null?g:m.concat(g.filter(w=>!m.includes(w))))},[p]),x=j.useRef(null),v=oc(g=>{if(c&&!r)return vw;if(!g||g===vw||f.current!==e||a!=null){const m=new Map;for(let w of e){if(!w)continue;if(a&&a.length>0&&!a.includes(w.id)&&w.rect.current){m.set(w.id,w.rect.current);continue}const S=w.node.current,b=S?new tx(l(S),S):null;w.rect.current=b,b&&m.set(w.id,b)}return m}return g},[e,a,r,c,l]);return j.useEffect(()=>{f.current=e},[e]),j.useEffect(()=>{c||h()},[r,c]),j.useEffect(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),j.useEffect(()=>{c||typeof s!="number"||x.current!==null||(x.current=setTimeout(()=>{h(),x.current=null},s))},[s,c,h,...n]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:a!=null};function y(){switch(u){case hu.Always:return!1;case hu.BeforeDragging:return r;default:return!r}}}function NE(e,t){return oc(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function JL(e,t){return NE(e,t)}function e4(e){let{callback:t,disabled:r}=e;const n=J0(t),i=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return j.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ep(e){let{callback:t,disabled:r}=e;const n=J0(t),i=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return j.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function t4(e){return new tx(Ts(e),e)}function yw(e,t,r){t===void 0&&(t=t4);const[n,i]=j.useState(null);function a(){i(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=e4({callback(l){if(e)for(const u of l){const{type:f,target:c}=u;if(f==="childList"&&c instanceof HTMLElement&&c.contains(e)){a();break}}}}),s=Ep({callback:a});return Rn(()=>{a(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),n}function r4(e){const t=NE(e);return OE(e,t)}const gw=[];function n4(e){const t=j.useRef(e),r=oc(n=>e?n&&n!==gw&&e&&t.current&&e.parentNode===t.current.parentNode?n:kp(e):gw,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function i4(e){const[t,r]=j.useState(null),n=j.useRef(e),i=j.useCallback(a=>{const o=bm(a.target);o&&r(s=>s?(s.set(o,yy(o)),new Map(s)):null)},[]);return j.useEffect(()=>{const a=n.current;if(e!==a){o(a);const s=e.map(l=>{const u=bm(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,yy(u)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{o(e),o(a)};function o(s){s.forEach(l=>{const u=bm(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,o)=>Mo(a,o),yn):CE(e):yn,[e,t])}function xw(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==yn;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?du(e,r.current):yn}function a4(e){j.useEffect(()=>{if(!Ap)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function o4(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=o=>{a(o,t)},r},{}),[e,t])}function $E(e){return j.useMemo(()=>e?CL(e):null,[e])}const bw=[];function s4(e,t){t===void 0&&(t=Ts);const[r]=e,n=$E(r?wr(r):null),[i,a]=j.useState(bw);function o(){a(()=>e.length?e.map(l=>EE(l)?n:new tx(t(l),l)):bw)}const s=Ep({callback:o});return Rn(()=>{s==null||s.disconnect(),o(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),i}function l4(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ac(t)?t:e}function u4(e){let{measure:t}=e;const[r,n]=j.useState(null),i=j.useCallback(u=>{for(const{target:f}of u)if(ac(f)){n(c=>{const p=t(f);return c?{...c,width:p.width,height:p.height}:p});break}},[t]),a=Ep({callback:i}),o=j.useCallback(u=>{const f=l4(u);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[s,l]=Qf(o);return j.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const c4=[{sensor:ix,options:{}},{sensor:rx,options:{}}],f4={current:{}},hf={draggable:{measure:dw},droppable:{measure:dw,strategy:hu.WhileDragging,frequency:xy.Optimized},dragOverlay:{measure:Ts}};class Dl extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const d4={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Jf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:hf,measureDroppableContainers:Jf,windowRect:null,measuringScheduled:!1},p4={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Jf,draggableNodes:new Map,over:null,measureDroppableContainers:Jf},Pp=j.createContext(p4),RE=j.createContext(d4);function h4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dl}}}function m4(e,t){switch(t.type){case $t.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case $t.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case $t.DragEnd:case $t.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $t.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new Dl(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case $t.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const o=new Dl(e.droppable.containers);return o.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case $t.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new Dl(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function v4(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=j.useContext(Pp),a=my(n),o=my(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&a&&o!=null){if(!ex(a)||document.activeElement===a.target)return;const s=i.get(o);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const c=lL(f);if(c){c.focus();break}}})}},[n,t,i,o,a]),null}function y4(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function g4(e){return j.useMemo(()=>({draggable:{...hf.draggable,...e==null?void 0:e.draggable},droppable:{...hf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...hf.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function x4(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=j.useRef(!1),{x:o,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Rn(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=r(u),c=OE(f,n);if(o||(c.x=0),s||(c.y=0),a.current=!0,Math.abs(c.x)>0||Math.abs(c.y)>0){const p=jE(u);p&&p.scrollBy({top:c.y,left:c.x})}},[t,o,s,n,r])}const IE=j.createContext({...yn,scaleX:1,scaleY:1});var ji;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ji||(ji={}));const b4=j.memo(function(t){var r,n,i,a;let{id:o,accessibility:s,autoScroll:l=!0,children:u,sensors:f=c4,collisionDetection:c=SL,measuring:p,modifiers:h,...x}=t;const v=j.useReducer(m4,void 0,h4),[y,g]=v,[m,w]=hL(),[S,b]=j.useState(ji.Uninitialized),_=S===ji.Initialized,{draggable:{active:O,nodes:k,translate:P},droppable:{containers:R}}=y,$=O!=null?k.get(O):null,C=j.useRef({initial:null,translated:null}),I=j.useMemo(()=>{var qt;return O!=null?{id:O,data:(qt=$==null?void 0:$.data)!=null?qt:f4,rect:C}:null},[O,$]),D=j.useRef(null),[L,z]=j.useState(null),[U,M]=j.useState(null),B=fu(x,Object.values(x)),W=sc("DndDescribedBy",o),J=j.useMemo(()=>R.getEnabled(),[R]),G=g4(p),{droppableRects:Q,measureDroppableContainers:X,measuringScheduled:de}=QL(J,{dragging:_,dependencies:[P.x,P.y],config:G.droppable}),ue=YL(k,O),Se=j.useMemo(()=>U?vy(U):null,[U]),_e=yc(),te=JL(ue,G.draggable.measure);x4({activeNode:O!=null?k.get(O):null,config:_e.layoutShiftCompensation,initialRect:te,measure:G.draggable.measure});const re=yw(ue,G.draggable.measure,te),pe=yw(ue?ue.parentElement:null),K=j.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Pe=R.getNodeFor((r=K.current.over)==null?void 0:r.id),he=u4({measure:G.dragOverlay.measure}),Me=(n=he.nodeRef.current)!=null?n:ue,Be=_?(i=he.rect)!=null?i:re:null,ve=!!(he.nodeRef.current&&he.rect),Ae=r4(ve?null:re),$e=$E(Me?wr(Me):null),Oe=n4(_?Pe??ue:null),He=s4(Oe),Ue=y4(h,{transform:{x:P.x-Ae.x,y:P.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:U,active:I,activeNodeRect:re,containerNodeRect:pe,draggingNodeRect:Be,over:K.current.over,overlayNodeRect:he.rect,scrollableAncestors:Oe,scrollableAncestorRects:He,windowRect:$e}),T=Se?Mo(Se,P):null,A=i4(Oe),E=xw(A),F=xw(A,[re]),V=Mo(Ue,E),q=Be?AL(Be,Ue):null,Y=I&&q?c({active:I,collisionRect:q,droppableRects:Q,droppableContainers:J,pointerCoordinates:T}):null,ie=SE(Y,"id"),[me,bt]=j.useState(null),Et=ve?Ue:Mo(Ue,F),Pt=OL(Et,(a=me==null?void 0:me.rect)!=null?a:null,re),Ws=j.useRef(null),Ja=j.useCallback((qt,Sr)=>{let{sensor:Or,options:yi}=Sr;if(D.current==null)return;const Lr=k.get(D.current);if(!Lr)return;const jr=qt.nativeEvent,xn=new Or({active:D.current,activeNode:Lr,event:jr,options:yi,context:K,onAbort(Vt){if(!k.get(Vt))return;const{onDragAbort:bn}=B.current,Ln={id:Vt};bn==null||bn(Ln),m({type:"onDragAbort",event:Ln})},onPending(Vt,gi,bn,Ln){if(!k.get(Vt))return;const{onDragPending:Ks}=B.current,xi={id:Vt,constraint:gi,initialCoordinates:bn,offset:Ln};Ks==null||Ks(xi),m({type:"onDragPending",event:xi})},onStart(Vt){const gi=D.current;if(gi==null)return;const bn=k.get(gi);if(!bn)return;const{onDragStart:Ln}=B.current,Gs={activatorEvent:jr,active:{id:gi,data:bn.data,rect:C}};wo.unstable_batchedUpdates(()=>{Ln==null||Ln(Gs),b(ji.Initializing),g({type:$t.DragStart,initialCoordinates:Vt,active:gi}),m({type:"onDragStart",event:Gs}),z(Ws.current),M(jr)})},onMove(Vt){g({type:$t.DragMove,coordinates:Vt})},onEnd:eo($t.DragEnd),onCancel:eo($t.DragCancel)});Ws.current=xn;function eo(Vt){return async function(){const{active:bn,collisions:Ln,over:Gs,scrollAdjustedTranslate:Ks}=K.current;let xi=null;if(bn&&Ks){const{cancelDrop:qs}=B.current;xi={activatorEvent:jr,active:bn,collisions:Ln,delta:Ks,over:Gs},Vt===$t.DragEnd&&typeof qs=="function"&&await Promise.resolve(qs(xi))&&(Vt=$t.DragCancel)}D.current=null,wo.unstable_batchedUpdates(()=>{g({type:Vt}),b(ji.Uninitialized),bt(null),z(null),M(null),Ws.current=null;const qs=Vt===$t.DragEnd?"onDragEnd":"onDragCancel";if(xi){const jh=B.current[qs];jh==null||jh(xi),m({type:qs,event:xi})}})}}},[k]),Hs=j.useCallback((qt,Sr)=>(Or,yi)=>{const Lr=Or.nativeEvent,jr=k.get(yi);if(D.current!==null||!jr||Lr.dndKit||Lr.defaultPrevented)return;const xn={active:jr};qt(Or,Sr.options,xn)===!0&&(Lr.dndKit={capturedBy:Sr.sensor},D.current=yi,Ja(Or,Sr))},[k,Ja]),mc=ZL(f,Hs);a4(f),Rn(()=>{re&&S===ji.Initializing&&b(ji.Initialized)},[re,S]),j.useEffect(()=>{const{onDragMove:qt}=B.current,{active:Sr,activatorEvent:Or,collisions:yi,over:Lr}=K.current;if(!Sr||!Or)return;const jr={active:Sr,activatorEvent:Or,collisions:yi,delta:{x:V.x,y:V.y},over:Lr};wo.unstable_batchedUpdates(()=>{qt==null||qt(jr),m({type:"onDragMove",event:jr})})},[V.x,V.y]),j.useEffect(()=>{const{active:qt,activatorEvent:Sr,collisions:Or,droppableContainers:yi,scrollAdjustedTranslate:Lr}=K.current;if(!qt||D.current==null||!Sr||!Lr)return;const{onDragOver:jr}=B.current,xn=yi.get(ie),eo=xn&&xn.rect.current?{id:xn.id,rect:xn.rect.current,data:xn.data,disabled:xn.disabled}:null,Vt={active:qt,activatorEvent:Sr,collisions:Or,delta:{x:Lr.x,y:Lr.y},over:eo};wo.unstable_batchedUpdates(()=>{bt(eo),jr==null||jr(Vt),m({type:"onDragOver",event:Vt})})},[ie]),Rn(()=>{K.current={activatorEvent:U,active:I,activeNode:ue,collisionRect:q,collisions:Y,droppableRects:Q,draggableNodes:k,draggingNode:Me,draggingNodeRect:Be,droppableContainers:R,over:me,scrollableAncestors:Oe,scrollAdjustedTranslate:V},C.current={initial:Be,translated:q}},[I,ue,Y,q,k,Me,Be,Q,R,me,Oe,V]),KL({..._e,delta:P,draggingRect:q,pointerCoordinates:T,scrollableAncestors:Oe,scrollableAncestorRects:He});const vc=j.useMemo(()=>({active:I,activeNode:ue,activeNodeRect:re,activatorEvent:U,collisions:Y,containerNodeRect:pe,dragOverlay:he,draggableNodes:k,droppableContainers:R,droppableRects:Q,over:me,measureDroppableContainers:X,scrollableAncestors:Oe,scrollableAncestorRects:He,measuringConfiguration:G,measuringScheduled:de,windowRect:$e}),[I,ue,re,U,Y,pe,he,k,R,Q,me,X,Oe,He,G,de,$e]),Oh=j.useMemo(()=>({activatorEvent:U,activators:mc,active:I,activeNodeRect:re,ariaDescribedById:{draggable:W},dispatch:g,draggableNodes:k,over:me,measureDroppableContainers:X}),[U,mc,I,re,g,W,k,me,X]);return N.createElement(bE.Provider,{value:w},N.createElement(Pp.Provider,{value:Oh},N.createElement(RE.Provider,{value:vc},N.createElement(IE.Provider,{value:Pt},u)),N.createElement(v4,{disabled:(s==null?void 0:s.restoreFocus)===!1})),N.createElement(yL,{...s,hiddenTextDescribedById:W}));function yc(){const qt=(L==null?void 0:L.autoScrollEnabled)===!1,Sr=typeof l=="object"?l.enabled===!1:l===!1,Or=_&&!qt&&!Sr;return typeof l=="object"?{...l,enabled:Or}:{enabled:Or}}}),w4=j.createContext(null),ww="button",_4="Draggable";function S4(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=sc(_4),{activators:o,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:c,over:p}=j.useContext(Pp),{role:h=ww,roleDescription:x="draggable",tabIndex:v=0}=i??{},y=(l==null?void 0:l.id)===t,g=j.useContext(y?IE:w4),[m,w]=Qf(),[S,b]=Qf(),_=o4(o,t),O=fu(r);Rn(()=>(c.set(t,{id:t,key:a,node:m,activatorNode:S,data:O}),()=>{const P=c.get(t);P&&P.key===a&&c.delete(t)}),[c,t]);const k=j.useMemo(()=>({role:h,tabIndex:v,"aria-disabled":n,"aria-pressed":y&&h===ww?!0:void 0,"aria-roledescription":x,"aria-describedby":f.draggable}),[n,h,v,y,x,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:k,isDragging:y,listeners:n?void 0:_,node:m,over:p,setNodeRef:w,setActivatorNodeRef:b,transform:g}}function O4(){return j.useContext(RE)}const j4="Droppable",A4={timeout:25};function k4(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=sc(j4),{active:o,dispatch:s,over:l,measureDroppableContainers:u}=j.useContext(Pp),f=j.useRef({disabled:r}),c=j.useRef(!1),p=j.useRef(null),h=j.useRef(null),{disabled:x,updateMeasurementsFor:v,timeout:y}={...A4,...i},g=fu(v??n),m=j.useCallback(()=>{if(!c.current){c.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),h.current=null},y)},[y]),w=Ep({callback:m,disabled:x||!o}),S=j.useCallback((k,P)=>{w&&(P&&(w.unobserve(P),c.current=!1),k&&w.observe(k))},[w]),[b,_]=Qf(S),O=fu(t);return j.useEffect(()=>{!w||!b.current||(w.disconnect(),c.current=!1,w.observe(b.current))},[b,w]),j.useEffect(()=>(s({type:$t.RegisterDroppable,element:{id:n,key:a,disabled:r,node:b,rect:p,data:O}}),()=>s({type:$t.UnregisterDroppable,key:a,id:n})),[n]),j.useEffect(()=>{r!==f.current.disabled&&(s({type:$t.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,s]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===n,node:b,over:l,setNodeRef:_}}function ax(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function E4(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function Bc(e){return e!==null&&e>=0}function P4(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=ax(t,n,r),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Fc={scaleX:1,scaleY:1},T4=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:o}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(i===r){const u=a[o];return u?{x:0,y:rr&&i<=o?{x:0,y:-s.height-l,...Fc}:i=o?{x:0,y:s.height+l,...Fc}:{x:0,y:0,...Fc}};function N4(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?rn.map(_=>typeof _=="object"&&"id"in _?_.id:_),[n]),x=o!=null,v=o?h.indexOf(o.id):-1,y=u?h.indexOf(u.id):-1,g=j.useRef(h),m=!P4(h,g.current),w=y!==-1&&v===-1||m,S=C4(a);Rn(()=>{m&&x&&f(h)},[m,h,x,f]),j.useEffect(()=>{g.current=h},[h]);const b=j.useMemo(()=>({activeIndex:v,containerId:c,disabled:S,disableTransforms:w,items:h,overIndex:y,useDragOverlay:p,sortedRects:E4(h,l),strategy:i}),[v,c,S.draggable,S.droppable,w,h,y,l,p,i]);return N.createElement(LE.Provider,{value:b},t)}const R4=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return ax(r,n,i).indexOf(t)},I4=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!n||s!==a&&i===o?!1:r?!0:o!==i&&t===l},M4={duration:200,easing:"ease"},BE="transform",D4=pu.Transition.toString({property:BE,duration:0,easing:"linear"}),L4={roleDescription:"sortable"};function B4(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,o]=j.useState(null),s=j.useRef(r);return Rn(()=>{if(!t&&r!==s.current&&n.current){const l=i.current;if(l){const u=Ts(n.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&o(f)}}r!==s.current&&(s.current=r)},[t,r,n,i]),j.useEffect(()=>{a&&o(null)},[a]),a}function F4(e){let{animateLayoutChanges:t=I4,attributes:r,disabled:n,data:i,getNewIndex:a=R4,id:o,strategy:s,resizeObserverConfig:l,transition:u=M4}=e;const{items:f,containerId:c,activeIndex:p,disabled:h,disableTransforms:x,sortedRects:v,overIndex:y,useDragOverlay:g,strategy:m}=j.useContext(LE),w=z4(n,h),S=f.indexOf(o),b=j.useMemo(()=>({sortable:{containerId:c,index:S,items:f},...i}),[c,i,S,f]),_=j.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:O,node:k,isOver:P,setNodeRef:R}=k4({id:o,data:b,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...l}}),{active:$,activatorEvent:C,activeNodeRect:I,attributes:D,setNodeRef:L,listeners:z,isDragging:U,over:M,setActivatorNodeRef:B,transform:W}=S4({id:o,data:b,attributes:{...L4,...r},disabled:w.draggable}),J=iL(R,L),G=!!$,Q=G&&!x&&Bc(p)&&Bc(y),X=!g&&U,de=X&&Q?W:null,Se=Q?de??(s??m)({rects:v,activeNodeRect:I,activeIndex:p,overIndex:y,index:S}):null,_e=Bc(p)&&Bc(y)?a({id:o,items:f,activeIndex:p,overIndex:y}):S,te=$==null?void 0:$.id,re=j.useRef({activeId:te,items:f,newIndex:_e,containerId:c}),pe=f!==re.current.items,K=t({active:$,containerId:c,isDragging:U,isSorting:G,id:o,index:S,items:f,newIndex:re.current.newIndex,previousItems:re.current.items,previousContainerId:re.current.containerId,transition:u,wasDragging:re.current.activeId!=null}),Pe=B4({disabled:!K,index:S,node:k,rect:O});return j.useEffect(()=>{G&&re.current.newIndex!==_e&&(re.current.newIndex=_e),c!==re.current.containerId&&(re.current.containerId=c),f!==re.current.items&&(re.current.items=f)},[G,_e,c,f]),j.useEffect(()=>{if(te===re.current.activeId)return;if(te&&!re.current.activeId){re.current.activeId=te;return}const Me=setTimeout(()=>{re.current.activeId=te},50);return()=>clearTimeout(Me)},[te]),{active:$,activeIndex:p,attributes:D,data:b,rect:O,index:S,newIndex:_e,items:f,isOver:P,isSorting:G,isDragging:U,listeners:z,node:k,overIndex:y,over:M,setNodeRef:J,setActivatorNodeRef:B,setDroppableNodeRef:R,setDraggableNodeRef:L,transform:Pe??Se,transition:he()};function he(){if(Pe||pe&&re.current.newIndex===S)return D4;if(!(X&&!ex(C)||!u)&&(G||K))return pu.Transition.toString({...u,property:BE})}}function z4(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function td(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const U4=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],V4=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(U4.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];a.getEnabled().forEach(c=>{if(!c||c!=null&&c.disabled)return;const p=i.get(c.id);if(p)switch(e.code){case Ie.Down:n.topp.top&&l.push(c);break;case Ie.Left:n.left>p.left&&l.push(c);break;case Ie.Right:n.left1&&(f=u[1].id),f!=null){const c=a.get(r.id),p=a.get(f),h=p?i.get(p.id):null,x=p==null?void 0:p.node.current;if(x&&h&&c&&p){const y=kp(x).some((_,O)=>s[O]!==_),g=FE(c,p),m=W4(c,p),w=y||!g?{x:0,y:0}:{x:m?n.width-h.width:0,y:m?n.height-h.height:0},S={x:h.left,y:h.top};return w.x&&w.y?S:du(S,w)}}}};function FE(e,t){return!td(e)||!td(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function W4(e,t){return!td(e)||!td(t)||!FE(e,t)?!1:e.data.current.sortable.index{if(!i||typeof i!="object")return{};const a=i.keys;return a&&typeof a=="object"?a:i},r={...t(e.keys),...t((n=e.routing_config)==null?void 0:n.keys)};return Object.keys(r).length===0?[]:Object.entries(r).map(([i,a])=>{const o=(a.type||a.data_type||"str_value").toString().toLowerCase(),s={key:i,type:o};return a.values&&(s.values=Array.isArray(a.values)?a.values.map(l=>l.trim()):a.values.split(",").map(l=>l.trim())),a.min_value!==void 0&&(s.min_value=a.min_value),a.max_value!==void 0&&(s.max_value=a.max_value),a.min_length!==void 0&&(s.min_length=a.min_length),a.max_length!==void 0&&(s.max_length=a.max_length),a.exact_length!==void 0&&(s.exact_length=a.exact_length),a.regex&&(s.regex=a.regex),s})}function zE(){const{data:e,error:t,isLoading:r}=vn("/config/routing-keys",dM,{refreshInterval:0,revalidateOnFocus:!1}),n=H4(e||null),i=n.reduce((o,s)=>(o[s.key]=s,o),{}),a={};return n.forEach(o=>{a[o.key]={type:o.type,values:o.values||[]}}),{config:e,keys:n,keysByName:i,routingKeysConfig:a,isLoading:r,error:t,getKeyValues:o=>{var s;return((s=i[o])==null?void 0:s.values)||[]},isIntegerKey:o=>{var s;return((s=i[o])==null?void 0:s.type)==="integer"},isEnumKey:o=>{var s;return((s=i[o])==null?void 0:s.type)==="enum"}}}const G4={"==":"equal","!=":"not_equal",">":"greater_than","<":"less_than",">=":"greater_than_equal","<=":"less_than_equal"};function K4({id:e,name:t,onRemove:r}){const{attributes:n,listeners:i,setNodeRef:a,transform:o,transition:s}=F4({id:e}),l={transform:pu.Transform.toString(o),transition:s};return d.jsxs("div",{ref:a,style:l,className:"flex items-center gap-2 bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] rounded-lg px-2 py-1.5",children:[d.jsx("span",{...n,...i,className:"cursor-grab text-slate-400",children:d.jsx(wI,{size:14})}),d.jsx("span",{className:"text-sm flex-1 font-mono",children:t}),d.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:d.jsx(ai,{size:12})})]})}function UE({gateways:e,onChange:t}){const[r,n]=j.useState(""),[i,a]=j.useState(""),o=gL(uw(ix),uw(rx,{coordinateGetter:V4}));function s(u){const{active:f,over:c}=u;if(c&&f.id!==c.id){const p=e.findIndex(x=>x.id===f.id),h=e.findIndex(x=>x.id===c.id);t(ax(e,p,h))}}function l(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:i.trim()}]),n(""),a(""))}return d.jsxs("div",{className:"space-y-2",children:[d.jsx(b4,{sensors:o,collisionDetection:bL,onDragEnd:s,children:d.jsx($4,{items:e.map(u=>u.id),strategy:T4,children:e.map((u,f)=>d.jsx(K4,{id:u.id,name:`${f+1}. ${u.gatewayName}${u.gatewayId?` (${u.gatewayId})`:""}`,onRemove:()=>t(e.filter(c=>c.id!==u.id))},u.id))})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{value:i,onChange:u=>a(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs(ht,{type:"button",size:"sm",variant:"secondary",onClick:l,children:[d.jsx(Xi,{size:13})," Add"]})]})]})}function VE({gateways:e,onChange:t}){const[r,n]=j.useState(""),[i,a]=j.useState(""),o=e.reduce((l,u)=>l+u.split,0);function s(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:i.trim(),split:0}]),n(""),a(""))}return d.jsxs("div",{className:"space-y-2",children:[e.map(l=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{value:l.gatewayName,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayName:u.target.value}:f)),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-32 focus:outline-none"}),d.jsx("input",{value:l.gatewayId,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayId:u.target.value}:f)),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-28 focus:outline-none"}),d.jsx("input",{type:"range",min:0,max:100,value:l.split,onChange:u=>t(e.map(f=>f.id===l.id?{...f,split:Number(u.target.value)}:f)),className:"flex-1 accent-brand-500"}),d.jsxs("span",{className:"text-sm w-10 text-right",children:[l.split,"%"]}),d.jsx("button",{type:"button",onClick:()=>t(e.filter(u=>u.id!==l.id)),className:"text-red-400 hover:text-red-600",children:d.jsx(ai,{size:12})})]},l.id)),d.jsxs("div",{className:`text-xs font-medium ${o===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",o,"% ",o!==100&&"(must equal 100)"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:r,onChange:l=>n(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{value:i,onChange:l=>a(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs(ht,{type:"button",size:"sm",variant:"secondary",onClick:s,children:[d.jsx(Xi,{size:13})," Add"]})]})]})}function q4({row:e,onChange:t,onRemove:r,routingKeys:n}){var l;const i=n[e.lhs],a=(i==null?void 0:i.type)==="enum",s=(i==null?void 0:i.type)==="integer"?[">","<",">=","<=","==","!="]:["==","!="];return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("select",{value:e.lhs,onChange:u=>t({...e,lhs:u.target.value,value:"",operator:"=="}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:Object.keys(n).map(u=>d.jsx("option",{value:u,children:u},u))}),d.jsx("select",{value:e.operator,onChange:u=>t({...e,operator:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:s.map(u=>d.jsx("option",{value:u,children:u},u))}),a?d.jsxs("select",{value:e.value,onChange:u=>t({...e,value:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:[d.jsx("option",{value:"",children:"select..."}),(((l=n[e.lhs])==null?void 0:l.values)||[]).map(u=>d.jsx("option",{value:u,children:u},u))]}):d.jsx("input",{type:"number",value:e.value,onChange:u=>t({...e,value:u.target.value}),placeholder:"value",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none"}),d.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:d.jsx(ai,{size:12})})]})}function X4({block:e,onChange:t,onRemove:r,routingKeys:n}){var f;const[i,a]=j.useState(!1),o=Object.keys(n)[0]||"payment_method",l=(((f=n[o])==null?void 0:f.values)||[])[0]||"";function u(){t({...e,conditions:[...e.conditions,{id:crypto.randomUUID(),lhs:o,operator:"==",value:l}]})}return d.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#0d0d12] rounded-t-xl cursor-pointer",onClick:()=>a(!i),children:[d.jsx("input",{value:e.name,onChange:c=>{c.stopPropagation(),t({...e,name:c.target.value})},onClick:c=>c.stopPropagation(),placeholder:"Rule name",className:"bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),r()},className:"text-red-400 hover:text-red-600",children:d.jsx(ai,{size:14})}),i?d.jsx(xl,{size:14}):d.jsx(bl,{size:14})]})]}),!i&&d.jsxs("div",{className:"px-4 py-3 space-y-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"CONDITIONS"}),d.jsxs("div",{className:"space-y-2",children:[e.conditions.map(c=>d.jsx(q4,{row:c,routingKeys:n,onChange:p=>t({...e,conditions:e.conditions.map(h=>h.id===c.id?p:h)}),onRemove:()=>t({...e,conditions:e.conditions.filter(p=>p.id!==c.id)})},c.id)),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:u,children:[d.jsx(Xi,{size:12})," Add Condition"]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"OUTPUT"}),d.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(c=>d.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[d.jsx("input",{type:"radio",checked:e.outputType===c,onChange:()=>t({...e,outputType:c}),className:"accent-brand-500"}),c==="priority"?"Priority":"Volume Split"]},c))}),e.outputType==="priority"?d.jsx(UE,{gateways:e.priorityGateways,onChange:c=>t({...e,priorityGateways:c})}):d.jsx(VE,{gateways:e.volumeGateways,onChange:c=>t({...e,volumeGateways:c})})]})]})]})}function Y4(e,t,r){function n(a,o,s){return a==="priority"?{priority:o.map(l=>({gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}))}:{volume_split:s.map(l=>({split:l.split,output:{gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}}))}}function i(a){return a==="priority"?"priority":"volume_split"}return{globals:{},default_selection:n(t.type,t.priorityGateways,t.volumeGateways),rules:e.map(a=>({name:a.name,routing_type:i(a.outputType),output:n(a.outputType,a.priorityGateways,a.volumeGateways),statements:[{condition:a.conditions.map(o=>{var s,l;return{lhs:o.lhs,comparison:G4[o.operator]||o.operator,value:{type:((s=r[o.lhs])==null?void 0:s.type)==="integer"?"number":"enum_variant",value:((l=r[o.lhs])==null?void 0:l.type)==="integer"?Number(o.value):o.value},metadata:{}}})}]}))}}function Z4(){const{merchantId:e}=na(),{routingKeysConfig:t,isLoading:r,error:n}=zE(),i=t,a=Object.keys(i).length>0,o=!r&&(!a||!!n),[s,l]=j.useState(""),[u,f]=j.useState(""),[c,p]=j.useState([]),[h,x]=j.useState({type:"priority",priorityGateways:[],volumeGateways:[]}),[v,y]=j.useState(!1),[g,m]=j.useState(!1),[w,S]=j.useState(null),[b,_]=j.useState(null),[O,k]=j.useState(!1),[P,R]=j.useState(null),[$,C]=j.useState(!1),[I,D]=j.useState(new Set),{data:L,mutate:z}=vn(e?`/routing/list/${e}`:null,()=>ft(`/routing/list/${e}`)),{data:U}=vn(e?`/routing/list/active/${e}`:null,()=>ft(`/routing/list/active/${e}`)),M=new Set((U||[]).map(X=>X.id)),B=Y4(c,h,i);async function W(X){if(X.preventDefault(),!e){S("Set a Merchant ID first.");return}if(o){S("Routing key config is unavailable. Ensure backend /config/routing-keys is reachable and valid.");return}if(!s.trim()){S("Rule name is required.");return}m(!0),S(null),_(null);try{const de=await ft("/routing/create",{name:s.trim(),description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:B}});_(de.id),z()}catch(de){S(String(de))}finally{m(!1)}}async function J(X){if(e){k(!0),R(null),C(!1);try{await ft("/routing/activate",{created_by:e,routing_algorithm_id:X}),C(!0),z()}catch(de){R(String(de))}finally{k(!1)}}}function G(X){D(de=>{const ue=new Set(de);return ue.has(X)?ue.delete(X):ue.add(X),ue})}function Q(){p(X=>[...X,{id:crypto.randomUUID(),name:`Rule ${X.length+1}`,conditions:[],outputType:"priority",priorityGateways:[],volumeGateways:[]}])}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Rule-Based Routing"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Create Euclid DSL declarative routing rules"})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[d.jsxs("div",{className:"lg:col-span-1 space-y-3",children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Existing Rules"})}),d.jsx(Te,{className:"p-0",children:e?L?L.length===0?d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"No rules yet."}):d.jsx("table",{className:"w-full text-sm",children:d.jsx("tbody",{children:L.map(X=>{const de=M.has(X.id),ue=I.has(X.id),Se=X.algorithm_data||X.algorithm;return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"border-b border-slate-100 dark:border-[#222226] last:border-0",children:[d.jsxs("td",{className:"px-4 py-3",children:[d.jsx("p",{className:"font-medium truncate",children:X.name}),d.jsx("p",{className:"text-xs text-slate-400 capitalize",children:Se==null?void 0:Se.type})]}),d.jsx("td",{className:"px-2 py-3",children:d.jsx(Qt,{variant:de?"green":"gray",children:de?"Active":"Inactive"})}),d.jsx("td",{className:"px-2 py-3",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsxs(ht,{size:"sm",variant:"ghost",onClick:()=>G(X.id),children:[d.jsx(_p,{size:14,className:"mr-1"}),ue?"Hide":"View"]}),!de&&d.jsx(ht,{size:"sm",variant:"ghost",onClick:()=>J(X.id),disabled:O,children:"Activate"})]})})]},X.id),ue&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"ID:"})," ",X.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Description:"})," ",X.description||"N/A"]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Algorithm For:"})," ",X.algorithm_for]}),X.created_at&&d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",new Date(X.created_at).toLocaleString()]}),d.jsxs("div",{children:[d.jsx("strong",{children:"Configuration:"}),d.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(Se,null,2)})]})]})})})]})})})}):d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Loading..."}):d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Set merchant ID to load rules."})})]}),P&&d.jsx(Zn,{error:P}),$&&d.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400",children:"Rule activated successfully."})]}),d.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[d.jsx("form",{onSubmit:W,className:"space-y-4",children:d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Rule Builder"})}),d.jsxs(Te,{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rule Name *"}),d.jsx("input",{value:s,onChange:X=>l(X.target.value),placeholder:"my-rule",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),d.jsx("input",{value:u,onChange:X=>f(X.target.value),placeholder:"Optional description",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Rules"}),r&&d.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),o&&d.jsx(Zn,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Builder is disabled until this is fixed."}),c.map(X=>d.jsx(X4,{block:X,routingKeys:i,onChange:de=>p(ue=>ue.map(Se=>Se.id===X.id?de:Se)),onRemove:()=>p(de=>de.filter(ue=>ue.id!==X.id))},X.id)),d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:Q,disabled:o,children:[d.jsx(Xi,{size:14})," Add Rule Block"]})]}),d.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl px-4 py-3",children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"DEFAULT SELECTION (Fallback)"}),d.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(X=>d.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[d.jsx("input",{type:"radio",checked:h.type===X,onChange:()=>x({...h,type:X}),className:"accent-brand-500"}),X==="priority"?"Priority":"Volume Split"]},X))}),h.type==="priority"?d.jsx(UE,{gateways:h.priorityGateways,onChange:X=>x({...h,priorityGateways:X})}):d.jsx(VE,{gateways:h.volumeGateways,onChange:X=>x({...h,volumeGateways:X})})]}),d.jsx(Zn,{error:w}),b&&d.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400 flex items-center justify-between",children:[d.jsxs("span",{children:["Rule created (ID: ",b,")"]}),d.jsx(ht,{type:"button",size:"sm",onClick:()=>J(b),disabled:O,children:"Activate Now"})]}),d.jsxs("div",{className:"flex gap-3",children:[d.jsx(ht,{type:"submit",disabled:g||o,children:g?"Creating...":"Create Rule"}),d.jsx(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>y(!v),children:v?"Hide JSON":"Preview JSON"})]})]})]})}),v&&d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"JSON Preview"})}),d.jsx(Te,{children:d.jsx("pre",{className:"text-xs text-slate-600 overflow-auto max-h-64 bg-[#07070b] rounded-lg p-4 font-mono border border-slate-200 dark:border-[#1c1c24]",children:JSON.stringify({name:s,description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:B}},null,2)})})]})]})]})]})}function WE(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var Y5=X5,Z5=Tp;function Q5(e,t){var r=this.__data__,n=Z5(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var J5=Q5,eB=M5,tB=W5,rB=K5,nB=Y5,iB=J5;function Is(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Sa=function(t){return Ua(t)&&t.indexOf("%")===t.length-1},ne=function(t){return O6(t)&&!uc(t)},E6=function(t){return Ee(t)},It=function(t){return ne(t)||Ua(t)},P6=0,cc=function(t){var r=++P6;return"".concat(t||"").concat(r)},sr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ne(t)&&!Ua(t))return n;var a;if(Sa(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return uc(a)&&(a=n),i&&a>r&&(a=r),a},so=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},C6=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function D6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var $w={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Qn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Rw=null,jm=null,yx=function e(t){if(t===Rw&&Array.isArray(jm))return jm;var r=[];return j.Children.forEach(t,function(n){Ee(n)||(x6.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),jm=r,Rw=t,r};function Yr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Qn(i)}):n=[Qn(t)],yx(e).forEach(function(i){var a=$r(i,"type.displayName")||$r(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Er(e,t){var r=Yr(e,t);return r&&r[0]}var Iw=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!ne(n)||n<=0||!ne(i)||i<=0)},L6=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],B6=function(t){return t&&t.type&&Ua(t.type)&&L6.indexOf(t.type)>=0},F6=function(t,r,n,i){var a,o=(a=Om==null?void 0:Om[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!we(t)&&(i&&o.includes(r)||$6.includes(r))||n&&vx.includes(r)},ge=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(j.isValidElement(t)&&(i=t.props),!$s(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;F6((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},_y=function e(t,r){if(t===r)return!0;var n=j.Children.count(t);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Mw(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function H6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Oy(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=W6(e,V6),f=i||{width:r,height:n,x:0,y:0},c=je("recharts-surface",a);return N.createElement("svg",Sy({},ge(u,!0,"svg"),{className:c,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),N.createElement("title",null,s),N.createElement("desc",null,l),t)}var G6=["children","className"];function jy(){return jy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function q6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Ge=N.forwardRef(function(e,t){var r=e.children,n=e.className,i=K6(e,G6),a=je("recharts-layer",n);return N.createElement("g",jy({className:a},ge(i,!0),{ref:t}),r)}),Jn=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:Z6(e,t,r)}var J6=Q6,eF="\\ud800-\\udfff",tF="\\u0300-\\u036f",rF="\\ufe20-\\ufe2f",nF="\\u20d0-\\u20ff",iF=tF+rF+nF,aF="\\ufe0e\\ufe0f",oF="\\u200d",sF=RegExp("["+oF+eF+iF+aF+"]");function lF(e){return sF.test(e)}var n2=lF;function uF(e){return e.split("")}var cF=uF,i2="\\ud800-\\udfff",fF="\\u0300-\\u036f",dF="\\ufe20-\\ufe2f",pF="\\u20d0-\\u20ff",hF=fF+dF+pF,mF="\\ufe0e\\ufe0f",vF="["+i2+"]",Ay="["+hF+"]",ky="\\ud83c[\\udffb-\\udfff]",yF="(?:"+Ay+"|"+ky+")",a2="[^"+i2+"]",o2="(?:\\ud83c[\\udde6-\\uddff]){2}",s2="[\\ud800-\\udbff][\\udc00-\\udfff]",gF="\\u200d",l2=yF+"?",u2="["+mF+"]?",xF="(?:"+gF+"(?:"+[a2,o2,s2].join("|")+")"+u2+l2+")*",bF=u2+l2+xF,wF="(?:"+[a2+Ay+"?",Ay,o2,s2,vF].join("|")+")",_F=RegExp(ky+"(?="+ky+")|"+wF+bF,"g");function SF(e){return e.match(_F)||[]}var OF=SF,jF=cF,AF=n2,kF=OF;function EF(e){return AF(e)?kF(e):jF(e)}var PF=EF,CF=J6,TF=n2,NF=PF,$F=ZE;function RF(e){return function(t){t=$F(t);var r=TF(t)?NF(t):void 0,n=r?r[0]:t.charAt(0),i=r?CF(r,1).join(""):t.slice(1);return n[e]()+i}}var IF=RF,MF=IF,DF=MF("toUpperCase"),LF=DF;const Hp=qe(LF);function rt(e){return function(){return e}}const c2=Math.cos,nd=Math.sin,gn=Math.sqrt,id=Math.PI,Gp=2*id,Ey=Math.PI,Py=2*Ey,ma=1e-6,BF=Py-ma;function f2(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return f2;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;ima)if(!(Math.abs(c*l-u*f)>ma)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,x=i-s,v=l*l+u*u,y=h*h+x*x,g=Math.sqrt(v),m=Math.sqrt(p),w=a*Math.tan((Ey-Math.acos((v+p-y)/(2*g*m)))/2),S=w/m,b=w/g;Math.abs(S-1)>ma&&this._append`L${t+S*f},${r+S*c}`,this._append`A${a},${a},0,0,${+(c*h>f*x)},${this._x1=t+b*l},${this._y1=r+b*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,f=r+l,c=1^o,p=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>ma||Math.abs(this._y1-f)>ma)&&this._append`L${u},${f}`,n&&(p<0&&(p=p%Py+Py),p>BF?this._append`A${n},${n},0,1,${c},${t-s},${r-l}A${n},${n},0,1,${c},${this._x1=u},${this._y1=f}`:p>ma&&this._append`A${n},${n},0,${+(p>=Ey)},${c},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function gx(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new zF(t)}function xx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function d2(e){this._context=e}d2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Kp(e){return new d2(e)}function p2(e){return e[0]}function h2(e){return e[1]}function m2(e,t){var r=rt(!0),n=null,i=Kp,a=null,o=gx(s);e=typeof e=="function"?e:e===void 0?p2:rt(e),t=typeof t=="function"?t:t===void 0?h2:rt(t);function s(l){var u,f=(l=xx(l)).length,c,p=!1,h;for(n==null&&(a=i(h=o())),u=0;u<=f;++u)!(u=h;--x)s.point(w[x],S[x]);s.lineEnd(),s.areaEnd()}g&&(w[p]=+e(y,p,c),S[p]=+t(y,p,c),s.point(n?+n(y,p,c):w[p],r?+r(y,p,c):S[p]))}if(m)return s=null,m+""||null}function f(){return m2().defined(i).curve(o).context(a)}return u.x=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),n=null,u):e},u.x0=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),u):e},u.x1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:rt(+c),u):n},u.y=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),r=null,u):t},u.y0=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),u):t},u.y1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:rt(+c),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(c){return arguments.length?(i=typeof c=="function"?c:rt(!!c),u):i},u.curve=function(c){return arguments.length?(o=c,a!=null&&(s=o(a)),u):o},u.context=function(c){return arguments.length?(c==null?a=s=null:s=o(a=c),u):a},u}class v2{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function UF(e){return new v2(e,!0)}function VF(e){return new v2(e,!1)}const bx={draw(e,t){const r=gn(t/id);e.moveTo(r,0),e.arc(0,0,r,0,Gp)}},WF={draw(e,t){const r=gn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},y2=gn(1/3),HF=y2*2,GF={draw(e,t){const r=gn(t/HF),n=r*y2;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},KF={draw(e,t){const r=gn(t),n=-r/2;e.rect(n,n,r,r)}},qF=.8908130915292852,g2=nd(id/10)/nd(7*id/10),XF=nd(Gp/10)*g2,YF=-c2(Gp/10)*g2,ZF={draw(e,t){const r=gn(t*qF),n=XF*r,i=YF*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Gp*a/5,s=c2(o),l=nd(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},Am=gn(3),QF={draw(e,t){const r=-gn(t/(Am*3));e.moveTo(0,r*2),e.lineTo(-Am*r,-r),e.lineTo(Am*r,-r),e.closePath()}},Br=-.5,Fr=gn(3)/2,Cy=1/gn(12),JF=(Cy/2+1)*3,ez={draw(e,t){const r=gn(t/JF),n=r/2,i=r*Cy,a=n,o=r*Cy+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Br*n-Fr*i,Fr*n+Br*i),e.lineTo(Br*a-Fr*o,Fr*a+Br*o),e.lineTo(Br*s-Fr*l,Fr*s+Br*l),e.lineTo(Br*n+Fr*i,Br*i-Fr*n),e.lineTo(Br*a+Fr*o,Br*o-Fr*a),e.lineTo(Br*s+Fr*l,Br*l-Fr*s),e.closePath()}};function tz(e,t){let r=null,n=gx(i);e=typeof e=="function"?e:rt(e||bx),t=typeof t=="function"?t:rt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:rt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:rt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ad(){}function od(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function x2(e){this._context=e}x2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:od(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:od(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rz(e){return new x2(e)}function b2(e){this._context=e}b2.prototype={areaStart:ad,areaEnd:ad,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:od(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nz(e){return new b2(e)}function w2(e){this._context=e}w2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:od(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function iz(e){return new w2(e)}function _2(e){this._context=e}_2.prototype={areaStart:ad,areaEnd:ad,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function az(e){return new _2(e)}function Lw(e){return e<0?-1:1}function Bw(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Lw(a)+Lw(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Fw(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function km(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function sd(e){this._context=e}sd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:km(this,this._t0,Fw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,km(this,Fw(this,r=Bw(this,e,t)),r);break;default:km(this,this._t0,r=Bw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function S2(e){this._context=new O2(e)}(S2.prototype=Object.create(sd.prototype)).point=function(e,t){sd.prototype.point.call(this,t,e)};function O2(e){this._context=e}O2.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function oz(e){return new sd(e)}function sz(e){return new S2(e)}function j2(e){this._context=e}j2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=zw(e),i=zw(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function uz(e){return new qp(e,.5)}function cz(e){return new qp(e,0)}function fz(e){return new qp(e,1)}function Jo(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function dz(e,t){return e[t]}function pz(e){const t=[];return t.key=e,t}function hz(){var e=rt([]),t=Ty,r=Jo,n=dz;function i(a){var o=Array.from(e.apply(this,arguments),pz),s,l=o.length,u=-1,f;for(const c of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Sz(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var A2={symbolCircle:bx,symbolCross:WF,symbolDiamond:GF,symbolSquare:KF,symbolStar:ZF,symbolTriangle:QF,symbolWye:ez},Oz=Math.PI/180,jz=function(t){var r="symbol".concat(Hp(t));return A2[r]||bx},Az=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Oz;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},kz=function(t,r){A2["symbol".concat(Hp(t))]=r},wx=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=_z(t,gz),u=Vw(Vw({},l),{},{type:n,size:a,sizeType:s}),f=function(){var y=jz(n),g=tz().type(y).size(Az(a,s,n));return g()},c=u.className,p=u.cx,h=u.cy,x=ge(u,!0);return p===+p&&h===+h&&a===+a?N.createElement("path",Ny({},x,{className:je("recharts-symbols",c),transform:"translate(".concat(p,", ").concat(h,")"),d:f()})):null};wx.registerSymbol=kz;function es(e){"@babel/helpers - typeof";return es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},es(e)}function $y(){return $y=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var m=h.inactive?u:h.color;return N.createElement("li",$y({className:y,style:c,key:"legend-item-".concat(x)},Va(n.props,h,x)),N.createElement(Oy,{width:o,height:o,viewBox:f,style:p},n.renderIcon(h)),N.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},v?v(g,h,x):g))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return N.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(j.PureComponent);vu(_x,"displayName","Legend");vu(_x,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Dz=Np;function Lz(){this.__data__=new Dz,this.size=0}var Bz=Lz;function Fz(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var zz=Fz;function Uz(e){return this.__data__.get(e)}var Vz=Uz;function Wz(e){return this.__data__.has(e)}var Hz=Wz,Gz=Np,Kz=ux,qz=cx,Xz=200;function Yz(e,t){var r=this.__data__;if(r instanceof Gz){var n=r.__data__;if(!Kz||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var c=-1,p=!0,h=r&g8?new h8:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=_U}var Ax=SU,OU=hi,jU=Ax,AU=mi,kU="[object Arguments]",EU="[object Array]",PU="[object Boolean]",CU="[object Date]",TU="[object Error]",NU="[object Function]",$U="[object Map]",RU="[object Number]",IU="[object Object]",MU="[object RegExp]",DU="[object Set]",LU="[object String]",BU="[object WeakMap]",FU="[object ArrayBuffer]",zU="[object DataView]",UU="[object Float32Array]",VU="[object Float64Array]",WU="[object Int8Array]",HU="[object Int16Array]",GU="[object Int32Array]",KU="[object Uint8Array]",qU="[object Uint8ClampedArray]",XU="[object Uint16Array]",YU="[object Uint32Array]",st={};st[UU]=st[VU]=st[WU]=st[HU]=st[GU]=st[KU]=st[qU]=st[XU]=st[YU]=!0;st[kU]=st[EU]=st[FU]=st[PU]=st[zU]=st[CU]=st[TU]=st[NU]=st[$U]=st[RU]=st[IU]=st[MU]=st[DU]=st[LU]=st[BU]=!1;function ZU(e){return AU(e)&&jU(e.length)&&!!st[OU(e)]}var QU=ZU;function JU(e){return function(t){return e(t)}}var D2=JU,fd={exports:{}};fd.exports;(function(e,t){var r=HE,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(fd,fd.exports);var eV=fd.exports,tV=QU,rV=D2,Yw=eV,Zw=Yw&&Yw.isTypedArray,nV=Zw?rV(Zw):tV,L2=nV,iV=sU,aV=Ox,oV=_r,sV=M2,lV=jx,uV=L2,cV=Object.prototype,fV=cV.hasOwnProperty;function dV(e,t){var r=oV(e),n=!r&&aV(e),i=!r&&!n&&sV(e),a=!r&&!n&&!i&&uV(e),o=r||n||i||a,s=o?iV(e.length,String):[],l=s.length;for(var u in e)(t||fV.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lV(u,l)))&&s.push(u);return s}var pV=dV,hV=Object.prototype;function mV(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||hV;return e===r}var vV=mV;function yV(e,t){return function(r){return e(t(r))}}var B2=yV,gV=B2,xV=gV(Object.keys,Object),bV=xV,wV=vV,_V=bV,SV=Object.prototype,OV=SV.hasOwnProperty;function jV(e){if(!wV(e))return _V(e);var t=[];for(var r in Object(e))OV.call(e,r)&&r!="constructor"&&t.push(r);return t}var AV=jV,kV=sx,EV=Ax;function PV(e){return e!=null&&EV(e.length)&&!kV(e)}var Xp=PV,CV=pV,TV=AV,NV=Xp;function $V(e){return NV(e)?CV(e):TV(e)}var kx=$V,RV=X8,IV=aU,MV=kx;function DV(e){return RV(e,MV,IV)}var LV=DV,Qw=LV,BV=1,FV=Object.prototype,zV=FV.hasOwnProperty;function UV(e,t,r,n,i,a){var o=r&BV,s=Qw(e),l=s.length,u=Qw(t),f=u.length;if(l!=f&&!o)return!1;for(var c=l;c--;){var p=s[c];if(!(o?p in t:zV.call(t,p)))return!1}var h=a.get(e),x=a.get(t);if(h&&x)return h==t&&x==e;var v=!0;a.set(e,t),a.set(t,e);for(var y=o;++c-1}var zW=FW;function UW(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=nH){var u=t?null:tH(e);if(u)return rH(u);o=!1,i=eH,l=new ZW}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xH(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bH(e){return e.value}function wH(e,t){if(N.isValidElement(e))return N.cloneElement(e,t);if(typeof e=="function")return N.createElement(e,t);t.ref;var r=gH(t,cH);return N.createElement(_x,r)}var h_=1,Pa=function(e){function t(){var r;fH(this,t);for(var n=arguments.length,i=new Array(n),a=0;ah_||Math.abs(i.height-this.lastBoundingBox.height)>h_)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Bn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,c,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();c={left:((u||0)-h.width)/2}}else c=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var x=this.getBBoxSnapshot();p={top:((f||0)-x.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Bn(Bn({},c),p)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,c=Bn(Bn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return N.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(h){n.wrapperNode=h}},wH(a,Bn(Bn({},this.props),{},{payload:H2(f,u,bH)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Bn(Bn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&ne(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(j.PureComponent);Yp(Pa,"displayName","Legend");Yp(Pa,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var m_=lc,_H=Ox,SH=_r,v_=m_?m_.isConcatSpreadable:void 0;function OH(e){return SH(e)||_H(e)||!!(v_&&e&&e[v_])}var jH=OH,AH=R2,kH=jH;function q2(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=kH),i||(i=[]);++a0&&r(s)?t>1?q2(s,t-1,r,n,i):AH(i,s):n||(i[i.length]=s)}return i}var X2=q2;function EH(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var PH=EH,CH=PH,TH=CH(),NH=TH,$H=NH,RH=kx;function IH(e,t){return e&&$H(e,t,RH)}var Y2=IH,MH=Xp;function DH(e,t){return function(r,n){if(r==null)return r;if(!MH(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var ZH=YH,Tm=dx,QH=px,JH=aa,e7=Z2,t7=GH,r7=D2,n7=ZH,i7=Bs,a7=_r;function o7(e,t,r){t.length?t=Tm(t,function(a){return a7(a)?function(o){return QH(o,a.length===1?a[0]:a)}:a}):t=[i7];var n=-1;t=Tm(t,r7(JH));var i=e7(e,function(a,o,s){var l=Tm(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return t7(i,function(a,o){return n7(a,o,r)})}var s7=o7;function l7(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var u7=l7,c7=u7,g_=Math.max;function f7(e,t,r){return t=g_(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=g_(n.length-t,0),o=Array(a);++i0){if(++t>=w7)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var j7=O7,A7=b7,k7=j7,E7=k7(A7),P7=E7,C7=Bs,T7=d7,N7=P7;function $7(e,t){return N7(T7(e,t,C7),e+"")}var R7=$7,I7=lx,M7=Xp,D7=jx,L7=ia;function B7(e,t,r){if(!L7(r))return!1;var n=typeof t;return(n=="number"?M7(r)&&D7(t,r.length):n=="string"&&t in r)?I7(r[t],e):!1}var Zp=B7,F7=X2,z7=s7,U7=R7,b_=Zp,V7=U7(function(e,t){if(e==null)return[];var r=t.length;return r>1&&b_(e,t[0],t[1])?t=[]:r>2&&b_(t[0],t[1],t[2])&&(t=[t[0]]),z7(e,F7(t,1),[])}),W7=V7;const Cx=qe(W7);function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(al,"-left"),ne(r)&&t&&ne(t.x)&&r=t.y),"".concat(al,"-top"),ne(n)&&t&&ne(t.y)&&nv?Math.max(f,l[n]):Math.max(c,l[n])}function aG(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function oG(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,c;return o.height>0&&o.width>0&&r?(f=S_({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),c=S_({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=aG({translateX:f,translateY:c,useTranslate3d:s})):u=nG,{cssProperties:u,cssClasses:iG({translateX:f,translateY:c,coordinate:r})}}function rs(e){"@babel/helpers - typeof";return rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(e)}function O_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function j_(e){for(var t=1;tA_||Math.abs(n.height-this.state.lastBoundingBox.height)>A_)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,f=i.coordinate,c=i.hasPayload,p=i.isAnimationActive,h=i.offset,x=i.position,v=i.reverseDirection,y=i.useTranslate3d,g=i.viewBox,m=i.wrapperStyle,w=oG({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:x,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:g}),S=w.cssClasses,b=w.cssProperties,_=j_(j_({transition:p&&a?"transform ".concat(s,"ms ").concat(l):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&c?"visible":"hidden",position:"absolute",top:0,left:0},m);return N.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(k){n.wrapperNode=k}},u)}}])}(j.PureComponent),vG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Fs={isSsr:vG()};function ns(e){"@babel/helpers - typeof";return ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(e)}function k_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function E_(e){for(var t=1;t0;return N.createElement(mG,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:a,coordinate:f,hasPayload:_,offset:h,position:y,reverseDirection:g,useTranslate3d:m,viewBox:w,wrapperStyle:S},AG(u,E_(E_({},this.props),{},{payload:b})))}}])}(j.PureComponent);Tx(Pr,"displayName","Tooltip");Tx(Pr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Fs.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var kG=Mn,EG=function(){return kG.Date.now()},PG=EG,CG=/\s/;function TG(e){for(var t=e.length;t--&&CG.test(e.charAt(t)););return t}var NG=TG,$G=NG,RG=/^\s+/;function IG(e){return e&&e.slice(0,$G(e)+1).replace(RG,"")}var MG=IG,DG=MG,P_=ia,LG=Ns,C_=NaN,BG=/^[-+]0x[0-9a-f]+$/i,FG=/^0b[01]+$/i,zG=/^0o[0-7]+$/i,UG=parseInt;function VG(e){if(typeof e=="number")return e;if(LG(e))return C_;if(P_(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=P_(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=DG(e);var r=FG.test(e);return r||zG.test(e)?UG(e.slice(2),r?2:8):BG.test(e)?C_:+e}var nP=VG,WG=ia,$m=PG,T_=nP,HG="Expected a function",GG=Math.max,KG=Math.min;function qG(e,t,r){var n,i,a,o,s,l,u=0,f=!1,c=!1,p=!0;if(typeof e!="function")throw new TypeError(HG);t=T_(t)||0,WG(r)&&(f=!!r.leading,c="maxWait"in r,a=c?GG(T_(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p);function h(_){var O=n,k=i;return n=i=void 0,u=_,o=e.apply(k,O),o}function x(_){return u=_,s=setTimeout(g,t),f?h(_):o}function v(_){var O=_-l,k=_-u,P=t-O;return c?KG(P,a-k):P}function y(_){var O=_-l,k=_-u;return l===void 0||O>=t||O<0||c&&k>=a}function g(){var _=$m();if(y(_))return m(_);s=setTimeout(g,v(_))}function m(_){return s=void 0,p&&n?h(_):(n=i=void 0,o)}function w(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:m($m())}function b(){var _=$m(),O=y(_);if(n=arguments,i=this,l=_,O){if(s===void 0)return x(l);if(c)return clearTimeout(s),s=setTimeout(g,t),h(l)}return s===void 0&&(s=setTimeout(g,t)),o}return b.cancel=w,b.flush=S,b}var XG=qG,YG=XG,ZG=ia,QG="Expected a function";function JG(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(QG);return ZG(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),YG(e,t,{leading:n,maxWait:t,trailing:i})}var eK=JG;const iP=qe(eK);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function N_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(I=iP(I,v,{trailing:!0,leading:!1}));var D=new ResizeObserver(I),L=b.current.getBoundingClientRect(),z=L.width,U=L.height;return $(z,U),D.observe(b.current),function(){D.disconnect()}},[$,v]);var C=j.useMemo(function(){var I=P.containerWidth,D=P.containerHeight;if(I<0||D<0)return null;Jn(Sa(o)||Sa(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),Jn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var L=Sa(o)?I:o,z=Sa(l)?D:l;r&&r>0&&(L?z=L/r:z&&(L=z*r),p&&z>p&&(z=p)),Jn(L>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,L,z,o,l,f,c,r);var U=!Array.isArray(h)&&Qn(h.type).endsWith("Chart");return N.Children.map(h,function(M){return N.isValidElement(M)?j.cloneElement(M,Wc({width:L,height:z},U?{style:Wc({height:"100%",width:"100%",maxHeight:z,maxWidth:L},M.props.style)}:{})):M})},[r,h,l,p,c,f,P,o]);return N.createElement("div",{id:y?"".concat(y):void 0,className:je("recharts-responsive-container",g),style:Wc(Wc({},S),{},{width:o,height:l,minWidth:f,minHeight:c,maxHeight:p}),ref:b},C)}),Ca=function(t){return null};Ca.displayName="Cell";function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function R_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hy(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Fs.isSsr)return{width:0,height:0};var n=hK(r),i=JSON.stringify({text:t,copyStyle:n});if(io.widthCache[i])return io.widthCache[i];try{var a=document.getElementById(I_);a||(a=document.createElement("span"),a.setAttribute("id",I_),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Hy(Hy({},pK),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return io.widthCache[i]=l,++io.cacheCount>dK&&(io.cacheCount=0,io.widthCache={}),l}catch{return{width:0,height:0}}},mK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function md(e,t){return xK(e)||gK(e,t)||yK(e,t)||vK()}function vK(){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 yK(e,t){if(e){if(typeof e=="string")return M_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return M_(e,t)}}function M_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $K(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function U_(e,t){return DK(e)||MK(e,t)||IK(e,t)||RK()}function RK(){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 IK(e,t){if(e){if(typeof e=="string")return V_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V_(e,t)}}function V_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(z,U){var M=U.word,B=U.width,W=z[z.length-1];if(W&&(i==null||a||W.width+B+nU.width?z:U})};if(!f)return h;for(var v="…",y=function(L){var z=c.slice(0,L),U=lP({breakAll:u,style:l,children:z+v}).wordsWithComputedWidth,M=p(U),B=M.length>o||x(M).width>Number(i);return[B,M]},g=0,m=c.length-1,w=0,S;g<=m&&w<=c.length-1;){var b=Math.floor((g+m)/2),_=b-1,O=y(_),k=U_(O,2),P=k[0],R=k[1],$=y(b),C=U_($,1),I=C[0];if(!P&&!I&&(g=b+1),P&&I&&(m=b-1),!P&&I){S=R;break}w++}return S||h},W_=function(t){var r=Ee(t)?[]:t.toString().split(sP);return[{words:r}]},BK=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Fs.isSsr){var l,u,f=lP({breakAll:o,children:i,style:a});if(f){var c=f.wordsWithComputedWidth,p=f.spaceWidth;l=c,u=p}else return W_(i);return LK({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return W_(i)},H_="#808080",Wa=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,c=f===void 0?!1:f,p=t.textAnchor,h=p===void 0?"start":p,x=t.verticalAnchor,v=x===void 0?"end":x,y=t.fill,g=y===void 0?H_:y,m=z_(t,TK),w=j.useMemo(function(){return BK({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:c,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,c,m.style,m.width]),S=m.dx,b=m.dy,_=m.angle,O=m.className,k=m.breakAll,P=z_(m,NK);if(!It(n)||!It(a))return null;var R=n+(ne(S)?S:0),$=a+(ne(b)?b:0),C;switch(v){case"start":C=Rm("calc(".concat(u,")"));break;case"middle":C=Rm("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:C=Rm("calc(".concat(w.length-1," * -").concat(s,")"));break}var I=[];if(c){var D=w[0].width,L=m.width;I.push("scale(".concat((ne(L)?L/D:1)/D,")"))}return _&&I.push("rotate(".concat(_,", ").concat(R,", ").concat($,")")),I.length&&(P.transform=I.join(" ")),N.createElement("text",Gy({},ge(P,!0),{x:R,y:$,className:je("recharts-text",O),textAnchor:h,fill:g.includes("url")?H_:g}),w.map(function(z,U){var M=z.words.join(k?"":" ");return N.createElement("tspan",{x:R,dy:U===0?C:s,key:"".concat(M,"-").concat(U)},M)}))};function Hi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function FK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Nx(e){let t,r,n;e.length!==2?(t=Hi,r=(s,l)=>Hi(e(s),l),n=(s,l)=>e(s)-l):(t=e===Hi||e===FK?e:zK,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[c],l)<0?u=c+1:f=c}while(u>>1;r(s[c],l)<=0?u=c+1:f=c}while(uu&&n(s[c-1],l)>-n(s[c],l)?c-1:c}return{left:i,center:o,right:a}}function zK(){return 0}function uP(e){return e===null?NaN:+e}function*UK(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const VK=Nx(Hi),fc=VK.right;Nx(uP).center;class G_ extends Map{constructor(t,r=GK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(K_(this,t))}has(t){return super.has(K_(this,t))}set(t,r){return super.set(WK(this,t),r)}delete(t){return super.delete(HK(this,t))}}function K_({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function WK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function HK({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function GK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function KK(e=Hi){if(e===Hi)return cP;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function cP(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const qK=Math.sqrt(50),XK=Math.sqrt(10),YK=Math.sqrt(2);function vd(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=qK?10:a>=XK?5:a>=YK?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function X_(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function fP(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?cP:KK(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),c=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*c*(l-c)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*c/l+p)),x=Math.min(n,Math.floor(t+(l-u)*c/l+p));fP(e,t,h,x,i)}const a=e[t];let o=r,s=n;for(ol(e,r,t),i(e[n],a)>0&&ol(e,r,n);o0;)--s}i(e[r],a)===0?ol(e,r,s):(++s,ol(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function ol(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function ZK(e,t,r){if(e=Float64Array.from(UK(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return X_(e);if(t>=1)return q_(e);var n,i=(n-1)*t,a=Math.floor(i),o=q_(fP(e,a).subarray(0,a+1)),s=X_(e.subarray(a+1));return o+(s-o)*(i-a)}}function QK(e,t,r=uP){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function JK(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Gc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Gc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=tq.exec(e))?new yr(t[1],t[2],t[3],1):(t=rq.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nq.exec(e))?Gc(t[1],t[2],t[3],t[4]):(t=iq.exec(e))?Gc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=aq.exec(e))?rS(t[1],t[2]/100,t[3]/100,1):(t=oq.exec(e))?rS(t[1],t[2]/100,t[3]/100,t[4]):Y_.hasOwnProperty(e)?J_(Y_[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function J_(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function Gc(e,t,r,n){return n<=0&&(e=t=r=NaN),new yr(e,t,r,n)}function uq(e){return e instanceof dc||(e=ju(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function Zy(e,t,r,n){return arguments.length===1?uq(e):new yr(e,t,r,n??1)}function yr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Rx(yr,Zy,pP(dc,{brighter(e){return e=e==null?yd:Math.pow(yd,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Su:Math.pow(Su,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Ta(this.r),Ta(this.g),Ta(this.b),gd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:eS,formatHex:eS,formatHex8:cq,formatRgb:tS,toString:tS}));function eS(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}`}function cq(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}${Oa((isNaN(this.opacity)?1:this.opacity)*255)}`}function tS(){const e=gd(this.opacity);return`${e===1?"rgb(":"rgba("}${Ta(this.r)}, ${Ta(this.g)}, ${Ta(this.b)}${e===1?")":`, ${e})`}`}function gd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ta(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oa(e){return e=Ta(e),(e<16?"0":"")+e.toString(16)}function rS(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new dn(e,t,r,n)}function hP(e){if(e instanceof dn)return new dn(e.h,e.s,e.l,e.opacity);if(e instanceof dc||(e=ju(e)),!e)return new dn;if(e instanceof dn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new dn(o,s,l,e.opacity)}function fq(e,t,r,n){return arguments.length===1?hP(e):new dn(e,t,r,n??1)}function dn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Rx(dn,fq,pP(dc,{brighter(e){return e=e==null?yd:Math.pow(yd,e),new dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Su:Math.pow(Su,e),new dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new yr(Im(e>=240?e-240:e+120,i,n),Im(e,i,n),Im(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new dn(nS(this.h),Kc(this.s),Kc(this.l),gd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=gd(this.opacity);return`${e===1?"hsl(":"hsla("}${nS(this.h)}, ${Kc(this.s)*100}%, ${Kc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nS(e){return e=(e||0)%360,e<0?e+360:e}function Kc(e){return Math.max(0,Math.min(1,e||0))}function Im(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Ix=e=>()=>e;function dq(e,t){return function(r){return e+r*t}}function pq(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function hq(e){return(e=+e)==1?mP:function(t,r){return r-t?pq(t,r,e):Ix(isNaN(t)?r:t)}}function mP(e,t){var r=t-e;return r?dq(e,r):Ix(isNaN(e)?t:e)}const iS=function e(t){var r=hq(t);function n(i,a){var o=r((i=Zy(i)).r,(a=Zy(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=mP(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function mq(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:xd(n,i)})),r=Mm.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Aq(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?kq:Aq,l=u=null,c}function c(p){return p==null||isNaN(p=+p)?a:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return c.invert=function(p){return o(i((u||(u=s(t,e.map(n),xd)))(p)))},c.domain=function(p){return arguments.length?(e=Array.from(p,bd),f()):e.slice()},c.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},c.rangeRound=function(p){return t=Array.from(p),r=Mx,f()},c.clamp=function(p){return arguments.length?(o=p?!0:lr,f()):o!==lr},c.interpolate=function(p){return arguments.length?(r=p,f()):r},c.unknown=function(p){return arguments.length?(a=p,c):a},function(p,h){return n=p,i=h,f()}}function Dx(){return Qp()(lr,lr)}function Eq(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function is(e){return e=wd(Math.abs(e)),e?e[1]:NaN}function Pq(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Cq(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Tq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=Tq.exec(e)))throw new Error("invalid format: "+e);var t;return new Lx({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Au.prototype=Lx.prototype;function Lx(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Lx.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Nq(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var _d;function $q(e,t){var r=wd(e,t);if(!r)return _d=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(_d=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+wd(e,Math.max(0,t+a-1))[0]}function oS(e,t){var r=wd(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const sS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Eq,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>oS(e*100,t),r:oS,s:$q,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lS(e){return e}var uS=Array.prototype.map,cS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rq(e){var t=e.grouping===void 0||e.thousands===void 0?lS:Pq(uS.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?lS:Cq(uS.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(c,p){c=Au(c);var h=c.fill,x=c.align,v=c.sign,y=c.symbol,g=c.zero,m=c.width,w=c.comma,S=c.precision,b=c.trim,_=c.type;_==="n"?(w=!0,_="g"):sS[_]||(S===void 0&&(S=12),b=!0,_="g"),(g||h==="0"&&x==="=")&&(g=!0,h="0",x="=");var O=(p&&p.prefix!==void 0?p.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),k=(y==="$"?n:/[%p]/.test(_)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),P=sS[_],R=/[defgprs%]/.test(_);S=S===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function $(C){var I=O,D=k,L,z,U;if(_==="c")D=P(C)+D,C="";else{C=+C;var M=C<0||1/C<0;if(C=isNaN(C)?l:P(Math.abs(C),S),b&&(C=Nq(C)),M&&+C==0&&v!=="+"&&(M=!1),I=(M?v==="("?v:s:v==="-"||v==="("?"":v)+I,D=(_==="s"&&!isNaN(C)&&_d!==void 0?cS[8+_d/3]:"")+D+(M&&v==="("?")":""),R){for(L=-1,z=C.length;++LU||U>57){D=(U===46?i+C.slice(L+1):C.slice(L))+D,C=C.slice(0,L);break}}}w&&!g&&(C=t(C,1/0));var B=I.length+C.length+D.length,W=B>1)+I+C+D+W.slice(B);break;default:C=W+I+C+D;break}return a(C)}return $.toString=function(){return c+""},$}function f(c,p){var h=Math.max(-8,Math.min(8,Math.floor(is(p)/3)))*3,x=Math.pow(10,-h),v=u((c=Au(c),c.type="f",c),{suffix:cS[8+h/3]});return function(y){return v(x*y)}}return{format:u,formatPrefix:f}}var qc,Bx,vP;Iq({thousands:",",grouping:[3],currency:["$",""]});function Iq(e){return qc=Rq(e),Bx=qc.format,vP=qc.formatPrefix,qc}function Mq(e){return Math.max(0,-is(Math.abs(e)))}function Dq(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(is(t)/3)))*3-is(Math.abs(e)))}function Lq(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,is(t)-is(e))+1}function yP(e,t,r,n){var i=Xy(e,t,r),a;switch(n=Au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Dq(i,o))&&(n.precision=a),vP(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Lq(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Mq(i))&&(n.precision=a-(n.type==="%")*2);break}}return Bx(n)}function oa(e){var t=e.domain;return e.ticks=function(r){var n=t();return Ky(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return yP(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,f=10;for(s0;){if(u=qy(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Sd(){var e=Dx();return e.copy=function(){return pc(e,Sd())},rn.apply(e,arguments),oa(e)}function gP(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,bd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return gP(e).unknown(t)},e=arguments.length?Array.from(e,bd):[0,1],oa(r)}function xP(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function Vq(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function pS(e){return(t,r)=>-e(-t,r)}function Fx(e){const t=e(fS,dS),r=t.domain;let n=10,i,a;function o(){return i=Vq(n),a=Uq(n),r()[0]<0?(i=pS(i),a=pS(a),e(Bq,Fq)):e(fS,dS),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const c=f0){for(;p<=h;++p)for(x=1;xf)break;g.push(v)}}else for(;p<=h;++p)for(x=n-1;x>=1;--x)if(v=p>0?x/a(-p):x*a(p),!(vf)break;g.push(v)}g.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Au(l)).precision==null&&(l.trim=!0),l=Bx(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let c=f/a(Math.round(i(f)));return c*nr(xP(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function bP(){const e=Fx(Qp()).domain([1,10]);return e.copy=()=>pc(e,bP()).base(e.base()),rn.apply(e,arguments),e}function hS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function mS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function zx(e){var t=1,r=e(hS(t),mS(t));return r.constant=function(n){return arguments.length?e(hS(t=+n),mS(t)):t},oa(r)}function wP(){var e=zx(Qp());return e.copy=function(){return pc(e,wP()).constant(e.constant())},rn.apply(e,arguments)}function vS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Wq(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Hq(e){return e<0?-e*e:e*e}function Ux(e){var t=e(lr,lr),r=1;function n(){return r===1?e(lr,lr):r===.5?e(Wq,Hq):e(vS(r),vS(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},oa(t)}function Vx(){var e=Ux(Qp());return e.copy=function(){return pc(e,Vx()).exponent(e.exponent())},rn.apply(e,arguments),e}function Gq(){return Vx.apply(null,arguments).exponent(.5)}function yS(e){return Math.sign(e)*e*e}function Kq(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function _P(){var e=Dx(),t=[0,1],r=!1,n;function i(a){var o=Kq(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(yS(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,bd)).map(yS)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return _P(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},rn.apply(i,arguments),oa(i)}function SP(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return OP().domain([e,t]).range(i).unknown(a)},rn.apply(oa(o),arguments)}function jP(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[fc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return jP().domain(e).range(t).unknown(r)},rn.apply(i,arguments)}const Dm=new Date,Lm=new Date;function Mt(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uMt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Dm.setTime(+a),Lm.setTime(+o),e(Dm),e(Lm),Math.floor(r(Dm,Lm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Od=Mt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Od.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Mt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Od);Od.range;const qn=1e3,qr=qn*60,Xn=qr*60,si=Xn*24,Wx=si*7,gS=si*30,Bm=si*365,ja=Mt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*qn)},(e,t)=>(t-e)/qn,e=>e.getUTCSeconds());ja.range;const Hx=Mt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qn)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getMinutes());Hx.range;const Gx=Mt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getUTCMinutes());Gx.range;const Kx=Mt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qn-e.getMinutes()*qr)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getHours());Kx.range;const qx=Mt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getUTCHours());qx.range;const hc=Mt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qr)/si,e=>e.getDate()-1);hc.range;const Jp=Mt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/si,e=>e.getUTCDate()-1);Jp.range;const AP=Mt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/si,e=>Math.floor(e/si));AP.range;function Ya(e){return Mt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*qr)/Wx)}const eh=Ya(0),jd=Ya(1),qq=Ya(2),Xq=Ya(3),as=Ya(4),Yq=Ya(5),Zq=Ya(6);eh.range;jd.range;qq.range;Xq.range;as.range;Yq.range;Zq.range;function Za(e){return Mt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Wx)}const th=Za(0),Ad=Za(1),Qq=Za(2),Jq=Za(3),os=Za(4),eX=Za(5),tX=Za(6);th.range;Ad.range;Qq.range;Jq.range;os.range;eX.range;tX.range;const Xx=Mt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Xx.range;const Yx=Mt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Yx.range;const li=Mt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());li.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});li.range;const ui=Mt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ui.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ui.range;function kP(e,t,r,n,i,a){const o=[[ja,1,qn],[ja,5,5*qn],[ja,15,15*qn],[ja,30,30*qn],[a,1,qr],[a,5,5*qr],[a,15,15*qr],[a,30,30*qr],[i,1,Xn],[i,3,3*Xn],[i,6,6*Xn],[i,12,12*Xn],[n,1,si],[n,2,2*si],[r,1,Wx],[t,1,gS],[t,3,3*gS],[e,1,Bm]];function s(u,f,c){const p=fy).right(o,p);if(h===o.length)return e.every(Xy(u/Bm,f/Bm,c));if(h===0)return Od.every(Math.max(Xy(u,f,c),1));const[x,v]=o[p/o[h-1][2]53)return null;"w"in K||(K.w=1),"Z"in K?(he=zm(sl(K.y,0,1)),Me=he.getUTCDay(),he=Me>4||Me===0?Ad.ceil(he):Ad(he),he=Jp.offset(he,(K.V-1)*7),K.y=he.getUTCFullYear(),K.m=he.getUTCMonth(),K.d=he.getUTCDate()+(K.w+6)%7):(he=Fm(sl(K.y,0,1)),Me=he.getDay(),he=Me>4||Me===0?jd.ceil(he):jd(he),he=hc.offset(he,(K.V-1)*7),K.y=he.getFullYear(),K.m=he.getMonth(),K.d=he.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),Me="Z"in K?zm(sl(K.y,0,1)).getUTCDay():Fm(sl(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(Me+5)%7:K.w+K.U*7-(Me+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,zm(K)):Fm(K)}}function k(te,re,pe,K){for(var Pe=0,he=re.length,Me=pe.length,Be,ve;Pe=Me)return-1;if(Be=re.charCodeAt(Pe++),Be===37){if(Be=re.charAt(Pe++),ve=b[Be in xS?re.charAt(Pe++):Be],!ve||(K=ve(te,pe,K))<0)return-1}else if(Be!=pe.charCodeAt(K++))return-1}return K}function P(te,re,pe){var K=u.exec(re.slice(pe));return K?(te.p=f.get(K[0].toLowerCase()),pe+K[0].length):-1}function R(te,re,pe){var K=h.exec(re.slice(pe));return K?(te.w=x.get(K[0].toLowerCase()),pe+K[0].length):-1}function $(te,re,pe){var K=c.exec(re.slice(pe));return K?(te.w=p.get(K[0].toLowerCase()),pe+K[0].length):-1}function C(te,re,pe){var K=g.exec(re.slice(pe));return K?(te.m=m.get(K[0].toLowerCase()),pe+K[0].length):-1}function I(te,re,pe){var K=v.exec(re.slice(pe));return K?(te.m=y.get(K[0].toLowerCase()),pe+K[0].length):-1}function D(te,re,pe){return k(te,t,re,pe)}function L(te,re,pe){return k(te,r,re,pe)}function z(te,re,pe){return k(te,n,re,pe)}function U(te){return o[te.getDay()]}function M(te){return a[te.getDay()]}function B(te){return l[te.getMonth()]}function W(te){return s[te.getMonth()]}function J(te){return i[+(te.getHours()>=12)]}function G(te){return 1+~~(te.getMonth()/3)}function Q(te){return o[te.getUTCDay()]}function X(te){return a[te.getUTCDay()]}function de(te){return l[te.getUTCMonth()]}function ue(te){return s[te.getUTCMonth()]}function Se(te){return i[+(te.getUTCHours()>=12)]}function _e(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var re=_(te+="",w);return re.toString=function(){return te},re},parse:function(te){var re=O(te+="",!1);return re.toString=function(){return te},re},utcFormat:function(te){var re=_(te+="",S);return re.toString=function(){return te},re},utcParse:function(te){var re=O(te+="",!0);return re.toString=function(){return te},re}}}var xS={"-":"",_:" ",0:"0"},Ut=/^\s*\d+/,sX=/^%/,lX=/[\\^$*+?|[\]().{}]/g;function ze(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function cX(e,t,r){var n=Ut.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function fX(e,t,r){var n=Ut.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function dX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function pX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function hX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function bS(e,t,r){var n=Ut.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function wS(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function mX(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function vX(e,t,r){var n=Ut.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function yX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function _S(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function gX(e,t,r){var n=Ut.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function SS(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function xX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function bX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function wX(e,t,r){var n=Ut.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function _X(e,t,r){var n=Ut.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function SX(e,t,r){var n=sX.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function OX(e,t,r){var n=Ut.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function jX(e,t,r){var n=Ut.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function OS(e,t){return ze(e.getDate(),t,2)}function AX(e,t){return ze(e.getHours(),t,2)}function kX(e,t){return ze(e.getHours()%12||12,t,2)}function EX(e,t){return ze(1+hc.count(li(e),e),t,3)}function EP(e,t){return ze(e.getMilliseconds(),t,3)}function PX(e,t){return EP(e,t)+"000"}function CX(e,t){return ze(e.getMonth()+1,t,2)}function TX(e,t){return ze(e.getMinutes(),t,2)}function NX(e,t){return ze(e.getSeconds(),t,2)}function $X(e){var t=e.getDay();return t===0?7:t}function RX(e,t){return ze(eh.count(li(e)-1,e),t,2)}function PP(e){var t=e.getDay();return t>=4||t===0?as(e):as.ceil(e)}function IX(e,t){return e=PP(e),ze(as.count(li(e),e)+(li(e).getDay()===4),t,2)}function MX(e){return e.getDay()}function DX(e,t){return ze(jd.count(li(e)-1,e),t,2)}function LX(e,t){return ze(e.getFullYear()%100,t,2)}function BX(e,t){return e=PP(e),ze(e.getFullYear()%100,t,2)}function FX(e,t){return ze(e.getFullYear()%1e4,t,4)}function zX(e,t){var r=e.getDay();return e=r>=4||r===0?as(e):as.ceil(e),ze(e.getFullYear()%1e4,t,4)}function UX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ze(t/60|0,"0",2)+ze(t%60,"0",2)}function jS(e,t){return ze(e.getUTCDate(),t,2)}function VX(e,t){return ze(e.getUTCHours(),t,2)}function WX(e,t){return ze(e.getUTCHours()%12||12,t,2)}function HX(e,t){return ze(1+Jp.count(ui(e),e),t,3)}function CP(e,t){return ze(e.getUTCMilliseconds(),t,3)}function GX(e,t){return CP(e,t)+"000"}function KX(e,t){return ze(e.getUTCMonth()+1,t,2)}function qX(e,t){return ze(e.getUTCMinutes(),t,2)}function XX(e,t){return ze(e.getUTCSeconds(),t,2)}function YX(e){var t=e.getUTCDay();return t===0?7:t}function ZX(e,t){return ze(th.count(ui(e)-1,e),t,2)}function TP(e){var t=e.getUTCDay();return t>=4||t===0?os(e):os.ceil(e)}function QX(e,t){return e=TP(e),ze(os.count(ui(e),e)+(ui(e).getUTCDay()===4),t,2)}function JX(e){return e.getUTCDay()}function eY(e,t){return ze(Ad.count(ui(e)-1,e),t,2)}function tY(e,t){return ze(e.getUTCFullYear()%100,t,2)}function rY(e,t){return e=TP(e),ze(e.getUTCFullYear()%100,t,2)}function nY(e,t){return ze(e.getUTCFullYear()%1e4,t,4)}function iY(e,t){var r=e.getUTCDay();return e=r>=4||r===0?os(e):os.ceil(e),ze(e.getUTCFullYear()%1e4,t,4)}function aY(){return"+0000"}function AS(){return"%"}function kS(e){return+e}function ES(e){return Math.floor(+e/1e3)}var ao,NP,$P;oY({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function oY(e){return ao=oX(e),NP=ao.format,ao.parse,$P=ao.utcFormat,ao.utcParse,ao}function sY(e){return new Date(e)}function lY(e){return e instanceof Date?+e:+new Date(+e)}function Zx(e,t,r,n,i,a,o,s,l,u){var f=Dx(),c=f.invert,p=f.domain,h=u(".%L"),x=u(":%S"),v=u("%I:%M"),y=u("%I %p"),g=u("%a %d"),m=u("%b %d"),w=u("%B"),S=u("%Y");function b(_){return(l(_)<_?h:s(_)<_?x:o(_)<_?v:a(_)<_?y:n(_)<_?i(_)<_?g:m:r(_)<_?w:S)(_)}return f.invert=function(_){return new Date(c(_))},f.domain=function(_){return arguments.length?p(Array.from(_,lY)):p().map(sY)},f.ticks=function(_){var O=p();return e(O[0],O[O.length-1],_??10)},f.tickFormat=function(_,O){return O==null?b:u(O)},f.nice=function(_){var O=p();return(!_||typeof _.range!="function")&&(_=t(O[0],O[O.length-1],_??10)),_?p(xP(O,_)):f},f.copy=function(){return pc(f,Zx(e,t,r,n,i,a,o,s,l,u))},f}function uY(){return rn.apply(Zx(iX,aX,li,Xx,eh,hc,Kx,Hx,ja,NP).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function cY(){return rn.apply(Zx(rX,nX,ui,Yx,th,Jp,qx,Gx,ja,$P).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function rh(){var e=0,t=1,r,n,i,a,o=lr,s=!1,l;function u(c){return c==null||isNaN(c=+c)?l:o(i===0?.5:(c=(a(c)-r)*i,s?Math.max(0,Math.min(1,c)):c))}u.domain=function(c){return arguments.length?([e,t]=c,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(c){return arguments.length?(s=!!c,u):s},u.interpolator=function(c){return arguments.length?(o=c,u):o};function f(c){return function(p){var h,x;return arguments.length?([h,x]=p,o=c(h,x),u):[o(0),o(1)]}}return u.range=f(zs),u.rangeRound=f(Mx),u.unknown=function(c){return arguments.length?(l=c,u):l},function(c){return a=c,r=c(e),n=c(t),i=r===n?0:1/(n-r),u}}function sa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function RP(){var e=oa(rh()(lr));return e.copy=function(){return sa(e,RP())},vi.apply(e,arguments)}function IP(){var e=Fx(rh()).domain([1,10]);return e.copy=function(){return sa(e,IP()).base(e.base())},vi.apply(e,arguments)}function MP(){var e=zx(rh());return e.copy=function(){return sa(e,MP()).constant(e.constant())},vi.apply(e,arguments)}function Qx(){var e=Ux(rh());return e.copy=function(){return sa(e,Qx()).exponent(e.exponent())},vi.apply(e,arguments)}function fY(){return Qx.apply(null,arguments).exponent(.5)}function DP(){var e=[],t=lr;function r(n){if(n!=null&&!isNaN(n=+n))return t((fc(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Hi),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>ZK(e,a/n))},r.copy=function(){return DP(t).domain(e)},vi.apply(r,arguments)}function nh(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=lr,f,c=!1,p;function h(v){return isNaN(v=+v)?p:(v=.5+((v=+f(v))-a)*(n*vt}var zP=mY,vY=ih,yY=zP,gY=Bs;function xY(e){return e&&e.length?vY(e,gY,yY):void 0}var bY=xY;const ah=qe(bY);function wY(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};le.decimalPlaces=le.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*lt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};le.dividedBy=le.div=function(e){return ei(this,new this.constructor(e))};le.dividedToIntegerBy=le.idiv=function(e){var t=this,r=t.constructor;return Je(ei(t,new r(e),0,1),r.precision)};le.equals=le.eq=function(e){return!this.cmp(e)};le.exponent=function(){return kt(this)};le.greaterThan=le.gt=function(e){return this.cmp(e)>0};le.greaterThanOrEqualTo=le.gte=function(e){return this.cmp(e)>=0};le.isInteger=le.isint=function(){return this.e>this.d.length-2};le.isNegative=le.isneg=function(){return this.s<0};le.isPositive=le.ispos=function(){return this.s>0};le.isZero=function(){return this.s===0};le.lessThan=le.lt=function(e){return this.cmp(e)<0};le.lessThanOrEqualTo=le.lte=function(e){return this.cmp(e)<1};le.logarithm=le.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Cr))throw Error(Jr+"NaN");if(r.s<1)throw Error(Jr+(r.s?"NaN":"-Infinity"));return r.eq(Cr)?new n(0):(dt=!1,t=ei(ku(r,a),ku(e,a),a),dt=!0,Je(t,i))};le.minus=le.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GP(t,e):WP(t,(e.s=-e.s,e))};le.modulo=le.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Jr+"NaN");return r.s?(dt=!1,t=ei(r,e,0,1).times(e),dt=!0,r.minus(t)):Je(new n(r),i)};le.naturalExponential=le.exp=function(){return HP(this)};le.naturalLogarithm=le.ln=function(){return ku(this)};le.negated=le.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};le.plus=le.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?WP(t,e):GP(t,(e.s=-e.s,e))};le.precision=le.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Na+e);if(t=kt(i)+1,n=i.d.length-1,r=n*lt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};le.squareRoot=le.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Jr+"NaN")}for(e=kt(s),dt=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=En(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Vs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(ei(s,a,o+2)).times(.5),En(a.d).slice(0,o)===(t=En(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Je(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return dt=!0,Je(n,r)};le.times=le.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,c=f.constructor,p=f.d,h=(e=new c(e)).d;if(!f.s||!e.s)return new c(0);for(e.s*=f.s,r=f.e+e.e,l=p.length,u=h.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+h[n]*p[i-n-1]+t,a[i--]=s%Dt|0,t=s/Dt|0;a[i]=(a[i]+t)%Dt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,dt?Je(e,c.precision):e};le.toDecimalPlaces=le.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(In(e,0,Us),t===void 0?t=n.rounding:In(t,0,8),Je(r,e+kt(r)+1,t))};le.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ha(n,!0):(In(e,0,Us),t===void 0?t=i.rounding:In(t,0,8),n=Je(new i(n),e+1,t),r=Ha(n,!0,e+1)),r};le.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Ha(i):(In(e,0,Us),t===void 0?t=a.rounding:In(t,0,8),n=Je(new a(i),e+kt(i)+1,t),r=Ha(n.abs(),!1,e+kt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};le.toInteger=le.toint=function(){var e=this,t=e.constructor;return Je(new t(e),kt(e)+1,t.rounding)};le.toNumber=function(){return+this};le.toPower=le.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(Cr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Jr+"Infinity");return s}if(s.eq(Cr))return s;if(n=l.precision,e.eq(Cr))return Je(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=VP){for(i=new l(Cr),t=Math.ceil(n/lt+4),dt=!1;r%2&&(i=i.times(s),TS(i.d,t)),r=Vs(r/2),r!==0;)s=s.times(s),TS(s.d,t);return dt=!0,e.s<0?new l(Cr).div(i):Je(i,n)}}else if(a<0)throw Error(Jr+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,dt=!1,i=e.times(ku(s,n+u)),dt=!0,i=HP(i),i.s=a,i};le.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=kt(i),n=Ha(i,r<=a.toExpNeg||r>=a.toExpPos)):(In(e,1,Us),t===void 0?t=a.rounding:In(t,0,8),i=Je(new a(i),e,t),r=kt(i),n=Ha(i,e<=r||r<=a.toExpNeg,e)),n};le.toSignificantDigits=le.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(In(e,1,Us),t===void 0?t=n.rounding:In(t,0,8)),Je(new n(r),e,t)};le.toString=le.valueOf=le.val=le.toJSON=le[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kt(e),r=e.constructor;return Ha(e,t<=r.toExpNeg||t>=r.toExpPos)};function WP(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,c=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),dt?Je(t,c):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(c/lt),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/Dt|0,l[a]%=Dt;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,dt?Je(t,c):t}function In(e,t,r){if(e!==~~e||er)throw Error(Na+e)}function En(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,f,c,p,h,x,v,y,g,m,w,S,b,_,O,k,P=n.constructor,R=n.s==i.s?1:-1,$=n.d,C=i.d;if(!n.s)return new P(n);if(!i.s)throw Error(Jr+"Division by zero");for(l=n.e-i.e,O=C.length,b=$.length,h=new P(R),x=h.d=[],u=0;C[u]==($[u]||0);)++u;if(C[u]>($[u]||0)&&--l,a==null?m=a=P.precision:o?m=a+(kt(n)-kt(i))+1:m=a,m<0)return new P(0);if(m=m/lt+2|0,u=0,O==1)for(f=0,C=C[0],m++;(u1&&(C=e(C,f),$=e($,f),O=C.length,b=$.length),S=O,v=$.slice(0,O),y=v.length;y=Dt/2&&++_;do f=0,s=t(C,v,O,y),s<0?(g=v[0],O!=y&&(g=g*Dt+(v[1]||0)),f=g/_|0,f>1?(f>=Dt&&(f=Dt-1),c=e(C,f),p=c.length,y=v.length,s=t(c,v,p,y),s==1&&(f--,r(c,O16)throw Error(eb+kt(e));if(!e.s)return new f(Cr);for(dt=!1,s=c,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(ya(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(Cr),f.precision=s;;){if(i=Je(i.times(e),s),r=r.times(++l),o=a.plus(ei(i,r,s)),En(o.d).slice(0,s)===En(a.d).slice(0,s)){for(;u--;)a=Je(a.times(a),s);return f.precision=c,t==null?(dt=!0,Je(a,c)):a}a=o}}function kt(e){for(var t=e.e*lt,r=e.d[0];r>=10;r/=10)t++;return t}function Um(e,t,r){if(t>e.LN10.sd())throw dt=!0,r&&(e.precision=r),Error(Jr+"LN10 precision limit exceeded");return Je(new e(e.LN10),t)}function ki(e){for(var t="";e--;)t+="0";return t}function ku(e,t){var r,n,i,a,o,s,l,u,f,c=1,p=10,h=e,x=h.d,v=h.constructor,y=v.precision;if(h.s<1)throw Error(Jr+(h.s?"NaN":"-Infinity"));if(h.eq(Cr))return new v(0);if(t==null?(dt=!1,u=y):u=t,h.eq(10))return t==null&&(dt=!0),Um(v,u);if(u+=p,v.precision=u,r=En(x),n=r.charAt(0),a=kt(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=En(h.d),n=r.charAt(0),c++;a=kt(h),n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=Um(v,u+2,y).times(a+""),h=ku(new v(n+"."+r.slice(1)),u-p).plus(l),v.precision=y,t==null?(dt=!0,Je(h,y)):h;for(s=o=h=ei(h.minus(Cr),h.plus(Cr),u),f=Je(h.times(h),u),i=3;;){if(o=Je(o.times(f),u),l=s.plus(ei(o,new v(i),u)),En(l.d).slice(0,u)===En(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(Um(v,u+2,y).times(a+""))),s=ei(s,new v(c),u),v.precision=y,t==null?(dt=!0,Je(s,y)):s;s=l,i+=2}}function CS(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Vs(r/lt),e.d=[],n=(r+1)%lt,r<0&&(n+=lt),nkd||e.e<-kd))throw Error(eb+r)}else e.s=0,e.e=0,e.d=[0];return e}function Je(e,t,r){var n,i,a,o,s,l,u,f,c=e.d;for(o=1,a=c[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=lt,i=t,u=c[f=0];else{if(f=Math.ceil((n+1)/lt),a=c.length,f>=a)return e;for(u=a=c[f],o=1;a>=10;a/=10)o++;n%=lt,i=n-lt+o}if(r!==void 0&&(a=ya(10,o-i-1),s=u/a%10|0,l=t<0||c[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/ya(10,o-i):0:c[f-1])%10&1||r==(e.s<0?8:7))),t<1||!c[0])return l?(a=kt(e),c.length=1,t=t-a-1,c[0]=ya(10,(lt-t%lt)%lt),e.e=Vs(-t/lt)||0):(c.length=1,c[0]=e.e=e.s=0),e;if(n==0?(c.length=f,a=1,f--):(c.length=f+1,a=ya(10,lt-n),c[f]=i>0?(u/ya(10,o-i)%ya(10,i)|0)*a:0),l)for(;;)if(f==0){(c[0]+=a)==Dt&&(c[0]=1,++e.e);break}else{if(c[f]+=a,c[f]!=Dt)break;c[f--]=0,a=1}for(n=c.length;c[--n]===0;)c.pop();if(dt&&(e.e>kd||e.e<-kd))throw Error(eb+kt(e));return e}function GP(e,t){var r,n,i,a,o,s,l,u,f,c,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),dt?Je(t,h):t;if(l=e.d,c=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=c.length):(r=c,n=u,s=l.length),i=Math.max(Math.ceil(h/lt),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=c.length,f=i0;--i)l[s++]=0;for(i=c.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+ki(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ki(-i-1)+a,r&&(n=r-o)>0&&(a+=ki(n))):i>=o?(a+=ki(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+ki(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=ki(n))),e.s<0?"-"+a:a}function TS(e,t){if(e.length>t)return e.length=t,!0}function KP(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Na+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return CS(o,a.toString())}else if(typeof a!="string")throw Error(Na+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,UY.test(a))CS(o,a);else throw Error(Na+a)}if(i.prototype=le,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=KP,i.config=i.set=VY,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Na+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Na+r+": "+n);return this}var tb=KP(zY);Cr=new tb(1);const Ye=tb;function WY(e){return qY(e)||KY(e)||GY(e)||HY()}function HY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GY(e,t){if(e){if(typeof e=="string")return eg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eg(e,t)}}function KY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function qY(e){if(Array.isArray(e))return eg(e)}function eg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,NS(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function uZ(e){if(Array.isArray(e))return e}function QP(e){var t=Eu(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function JP(e,t,r){if(e.lte(0))return new Ye(0);var n=uh.getDigitCount(e.toNumber()),i=new Ye(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Ye(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Ye(Math.ceil(l))}function cZ(e,t,r){var n=1,i=new Ye(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Ye(10).pow(uh.getDigitCount(e)-1),i=new Ye(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Ye(Math.floor(e)))}else e===0?i=new Ye(Math.floor((t-1)/2)):r||(i=new Ye(Math.floor(e)));var o=Math.floor((t-1)/2),s=QY(ZY(function(l){return i.add(new Ye(l-o).mul(n)).toNumber()}),tg);return s(0,t)}function eC(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Ye(0),tickMin:new Ye(0),tickMax:new Ye(0)};var a=JP(new Ye(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Ye(0):(o=new Ye(e).add(t).div(2),o=o.sub(new Ye(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Ye(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?eC(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Ye(s).mul(a)),tickMax:o.add(new Ye(l).mul(a))})}function fZ(e){var t=Eu(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=QP([r,n]),l=Eu(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var c=f===1/0?[u].concat(ng(tg(0,i-1).map(function(){return 1/0}))):[].concat(ng(tg(0,i-1).map(function(){return-1/0})),[f]);return r>n?rg(c):c}if(u===f)return cZ(u,i,a);var p=eC(u,f,o,a),h=p.step,x=p.tickMin,v=p.tickMax,y=uh.rangeStep(x,v.add(new Ye(.1).mul(h)),h);return r>n?rg(y):y}function dZ(e,t){var r=Eu(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=QP([n,i]),s=Eu(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),c=JP(new Ye(u).sub(l).div(f-1),a,0),p=[].concat(ng(uh.rangeStep(new Ye(l),new Ye(u).sub(new Ye(.99).mul(c)),c)),[u]);return n>i?rg(p):p}var pZ=YP(fZ),hZ=YP(dZ),mZ="Invariant failed";function Ga(e,t){throw new Error(mZ)}var vZ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ss(e){"@babel/helpers - typeof";return ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ss(e)}function Ed(){return Ed=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function OZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jZ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,c=i[u].coordinate,p=u>=s-1?i[0].coordinate:i[u+1].coordinate,h=void 0;if(or(c-f)!==or(p-c)){var x=[];if(or(p-c)===or(l[1]-l[0])){h=p;var v=c+l[1]-l[0];x[0]=Math.min(v,(v+f)/2),x[1]=Math.max(v,(v+f)/2)}else{h=f;var y=p+l[1]-l[0];x[0]=Math.min(c,(y+c)/2),x[1]=Math.max(c,(y+c)/2)}var g=[Math.min(c,(h+c)/2),Math.max(c,(h+c)/2)];if(t>g[0]&&t<=g[1]||t>=x[0]&&t<=x[1]){o=i[u].index;break}}else{var m=Math.min(f,p),w=Math.max(f,p);if(t>(m+c)/2&&t<=(w+c)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},rb=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?xt(xt({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},UZ=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(g&&g.length){var m=g[0].type.defaultProps,w=m!==void 0?xt(xt({},m),g[0].props):g[0].props,S=w.barSize,b=w[y];o[b]||(o[b]=[]);var _=Ee(S)?r:S;o[b].push({item:g[0],stackList:g.slice(1),barSize:Ee(_)?void 0:sr(_,n,0)})}}return o},VZ=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=sr(r,i,0,!0),f,c=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=i/l,x=o.reduce(function(S,b){return S+b.barSize||0},0);x+=(l-1)*u,x>=i&&(x-=(l-1)*u,u=0),x>=i&&h>0&&(p=!0,h*=.9,x=l*h);var v=(i-x)/2>>0,y={offset:v-u,size:0};f=o.reduce(function(S,b){var _={item:b.item,position:{offset:y.offset+y.size+u,size:p?h:b.barSize}},O=[].concat(IS(S),[_]);return y=O[O.length-1].position,b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:y})}),O},c)}else{var g=sr(n,i,0,!0);i-2*g-(l-1)*u<=0&&(u=0);var m=(i-2*g-(l-1)*u)/l;m>1&&(m>>=0);var w=s===+s?Math.min(m,s):m;f=o.reduce(function(S,b,_){var O=[].concat(IS(S),[{item:b.item,position:{offset:g+(m+u)*_+(m-w)/2,size:w}}]);return b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:O[O.length-1].position})}),O},c)}return f},WZ=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=iC({children:a,legendWidth:l});if(u){var f=i||{},c=f.width,p=f.height,h=u.align,x=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&x==="middle")&&h!=="center"&&ne(t[h]))return xt(xt({},t),{},Bo({},h,t[h]+(c||0)));if((v==="horizontal"||v==="vertical"&&h==="center")&&x!=="middle"&&ne(t[x]))return xt(xt({},t),{},Bo({},x,t[x]+(p||0)))}return t},HZ=function(t,r,n){return Ee(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},aC=function(t,r,n,i,a){var o=r.props.children,s=Yr(o,ch).filter(function(u){return HZ(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var c=rr(f,n);if(Ee(c))return u;var p=Array.isArray(c)?[oh(c),ah(c)]:[c,c],h=l.reduce(function(x,v){var y=rr(f,v,0),g=p[0]-Math.abs(Array.isArray(y)?y[0]:y),m=p[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(g,x[0]),Math.max(m,x[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},GZ=function(t,r,n,i,a){var o=r.map(function(s){return aC(t,s,n,a,i)}).filter(function(s){return!Ee(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},oC=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&aC(t,l,u,i)||Fl(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,c=u.length;f=2?or(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(c){var p=a?a.indexOf(c):c;return{coordinate:i(p)+u,value:c,offset:u}});return f.filter(function(c){return!uc(c.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(c,p){return{coordinate:i(c)+u,value:c,index:p,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(c){return{coordinate:i(c)+u,value:c,offset:u}}):i.domain().map(function(c,p){return{coordinate:i(c)+u,value:a?a[c]:c,index:p,offset:u}})},Vm=new WeakMap,Xc=function(t,r){if(typeof r!="function")return t;Vm.has(t)||Vm.set(t,new WeakMap);var n=Vm.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},lC=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:_u(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Sd(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Bl(),realScaleType:"point"}:a==="category"?{scale:_u(),realScaleType:"band"}:{scale:Sd(),realScaleType:"linear"};if(Ua(i)){var l="scale".concat(Hp(i));return{scale:(PS[l]||Bl)(),realScaleType:PS[l]?l:"point"}}return we(i)?{scale:i}:{scale:Bl(),realScaleType:"point"}},DS=1e-4,uC=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-DS,o=Math.max(i[0],i[1])+DS,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},KZ=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},YZ=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},ZZ={sign:XZ,expand:mz,none:Jo,silhouette:vz,wiggle:yz,positive:YZ},QZ=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=ZZ[n],o=hz().keys(i).value(function(s,l){return+rr(s,l,0)}).order(Ty).offset(a);return o(t)},JZ=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(c,p){var h,x=(h=p.type)!==null&&h!==void 0&&h.defaultProps?xt(xt({},p.type.defaultProps),p.props):p.props,v=x.stackId,y=x.hide;if(y)return c;var g=x[n],m=c[g]||{hasStack:!1,stackGroups:{}};if(It(v)){var w=m.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(p),m.hasStack=!0,m.stackGroups[v]=w}else m.stackGroups[cc("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[p]};return xt(xt({},c),{},Bo({},g,m))},l),f={};return Object.keys(u).reduce(function(c,p){var h=u[p];if(h.hasStack){var x={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(v,y){var g=h.stackGroups[y];return xt(xt({},v),{},Bo({},y,{numericAxisId:n,cateAxisId:i,items:g.items,stackedData:QZ(t,g.items,a)}))},x)}return xt(xt({},c),{},Bo({},p,h))},f)},cC=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=pZ(u,a,s);return t.domain([oh(f),ah(f)]),{niceTicks:f}}if(a&&i==="number"){var c=t.domain(),p=hZ(c,a,s);return{niceTicks:p}}return null},LS=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=rr(o,r.dataKey,r.domain[s]);return Ee(l)?null:r.scale(l)-a/2+i},eQ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},tQ=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?xt(xt({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(It(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},rQ=function(t){return t.reduce(function(r,n){return[oh(n.concat([r[0]]).filter(ne)),ah(n.concat([r[1]]).filter(ne))]},[1/0,-1/0])},fC=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var c=rQ(f.slice(r,n+1));return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},BS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,FS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,sg=function(t,r,n){if(we(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(ne(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(BS.test(t[0])){var a=+BS.exec(t[0])[1];i[0]=r[0]-a}else we(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(ne(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(FS.test(t[1])){var o=+FS.exec(t[1])[1];i[1]=r[1]+o}else we(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Cd=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Cx(r,function(c){return c.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},fQ=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=sr(t.cx,o,o/2),c=sr(t.cy,s,s/2),p=hC(o,s,n),h=sr(t.innerRadius,p,0),x=sr(t.outerRadius,p,p*.8),v=Object.keys(r);return v.reduce(function(y,g){var m=r[g],w=m.domain,S=m.reversed,b;if(Ee(m.range))i==="angleAxis"?b=[l,u]:i==="radiusAxis"&&(b=[h,x]),S&&(b=[b[1],b[0]]);else{b=m.range;var _=b,O=aQ(_,2);l=O[0],u=O[1]}var k=lC(m,a),P=k.realScaleType,R=k.scale;R.domain(w).range(b),uC(R);var $=cC(R,zn(zn({},m),{},{realScaleType:P})),C=zn(zn(zn({},m),$),{},{range:b,radius:x,realScaleType:P,scale:R,cx:f,cy:c,innerRadius:h,outerRadius:x,startAngle:l,endAngle:u});return zn(zn({},y),{},pC({},g,C))},{})},dQ=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},pQ=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=dQ({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:cQ(u),angleInRadian:u}},hQ=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},mQ=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},WS=function(t,r){var n=t.x,i=t.y,a=pQ({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=hQ(r),c=f.startAngle,p=f.endAngle,h=s,x;if(c<=p){for(;h>p;)h-=360;for(;h=c&&h<=p}else{for(;h>c;)h-=360;for(;h=p&&h<=c}return x?zn(zn({},r),{},{radius:o,angle:mQ(h,r)}):null},mC=function(t){return!j.isValidElement(t)&&!we(t)&&typeof t!="boolean"?t.className:""};function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var vQ=["offset"];function yQ(e){return wQ(e)||bQ(e)||xQ(e)||gQ()}function gQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xQ(e,t){if(e){if(typeof e=="string")return lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lg(e,t)}}function bQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wQ(e){if(Array.isArray(e))return lg(e)}function lg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function HS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t=0?1:-1,w,S;i==="insideStart"?(w=h+m*o,S=v):i==="insideEnd"?(w=x-m*o,S=!v):i==="end"&&(w=x+m*o,S=v),S=g<=0?S:!S;var b=it(u,f,y,w),_=it(u,f,y,w+(S?1:-1)*359),O="M".concat(b.x,",").concat(b.y,` + A`).concat(y,",").concat(y,",0,1,").concat(S?0:1,`, + `).concat(_.x,",").concat(_.y),k=Ee(t.id)?cc("recharts-radial-line-"):t.id;return N.createElement("text",$u({},n,{dominantBaseline:"central",className:je("recharts-radial-bar-label",s)}),N.createElement("defs",null,N.createElement("path",{id:k,d:O})),N.createElement("textPath",{xlinkHref:"#".concat(k)},r))},CQ=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,f=a.startAngle,c=a.endAngle,p=(f+c)/2;if(i==="outside"){var h=it(o,s,u+n,p),x=h.x,v=h.y;return{x,y:v,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,g=it(o,s,y,p),m=g.x,w=g.y;return{x:m,y:w,textAnchor:"middle",verticalAnchor:"middle"}},TQ=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,c=f>=0?1:-1,p=c*i,h=c>0?"end":"start",x=c>0?"start":"end",v=u>=0?1:-1,y=v*i,g=v>0?"end":"start",m=v>0?"start":"end";if(a==="top"){var w={x:s+u/2,y:l-c*i,textAnchor:"middle",verticalAnchor:h};return Tt(Tt({},w),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+f+p,textAnchor:"middle",verticalAnchor:x};return Tt(Tt({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var b={x:s-y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"};return Tt(Tt({},b),n?{width:Math.max(b.x-n.x,0),height:f}:{})}if(a==="right"){var _={x:s+u+y,y:l+f/2,textAnchor:m,verticalAnchor:"middle"};return Tt(Tt({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return a==="insideLeft"?Tt({x:s+y,y:l+f/2,textAnchor:m,verticalAnchor:"middle"},O):a==="insideRight"?Tt({x:s+u-y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"},O):a==="insideTop"?Tt({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:x},O):a==="insideBottom"?Tt({x:s+u/2,y:l+f-p,textAnchor:"middle",verticalAnchor:h},O):a==="insideTopLeft"?Tt({x:s+y,y:l+p,textAnchor:m,verticalAnchor:x},O):a==="insideTopRight"?Tt({x:s+u-y,y:l+p,textAnchor:g,verticalAnchor:x},O):a==="insideBottomLeft"?Tt({x:s+y,y:l+f-p,textAnchor:m,verticalAnchor:h},O):a==="insideBottomRight"?Tt({x:s+u-y,y:l+f-p,textAnchor:g,verticalAnchor:h},O):$s(a)&&(ne(a.x)||Sa(a.x))&&(ne(a.y)||Sa(a.y))?Tt({x:s+sr(a.x,u),y:l+sr(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):Tt({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},NQ=function(t){return"cx"in t&&ne(t.cx)};function Ft(e){var t=e.offset,r=t===void 0?5:t,n=_Q(e,vQ),i=Tt({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,c=f===void 0?"":f,p=i.textBreakAll;if(!a||Ee(s)&&Ee(l)&&!j.isValidElement(u)&&!we(u))return null;if(j.isValidElement(u))return j.cloneElement(u,i);var h;if(we(u)){if(h=j.createElement(u,i),j.isValidElement(h))return h}else h=kQ(i);var x=NQ(a),v=ge(i,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return PQ(i,h,v);var y=x?CQ(i):TQ(i);return N.createElement(Wa,$u({className:je("recharts-label",c)},v,y,{breakAll:p}),h)}Ft.displayName="Label";var vC=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,c=t.x,p=t.y,h=t.top,x=t.left,v=t.width,y=t.height,g=t.clockWise,m=t.labelViewBox;if(m)return m;if(ne(v)&&ne(y)){if(ne(c)&&ne(p))return{x:c,y:p,width:v,height:y};if(ne(h)&&ne(x))return{x:h,y:x,width:v,height:y}}return ne(c)&&ne(p)?{x:c,y:p,width:0,height:0}:ne(r)&&ne(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:g}:t.viewBox?t.viewBox:{}},$Q=function(t,r){return t?t===!0?N.createElement(Ft,{key:"label-implicit",viewBox:r}):It(t)?N.createElement(Ft,{key:"label-implicit",viewBox:r,value:t}):j.isValidElement(t)?t.type===Ft?j.cloneElement(t,{key:"label-implicit",viewBox:r}):N.createElement(Ft,{key:"label-implicit",content:t,viewBox:r}):we(t)?N.createElement(Ft,{key:"label-implicit",content:t,viewBox:r}):$s(t)?N.createElement(Ft,$u({viewBox:r},t,{key:"label-implicit"})):null:null},RQ=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=vC(t),o=Yr(i,Ft).map(function(l,u){return j.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=$Q(t.label,r||a);return[s].concat(yQ(o))};Ft.parseViewBox=vC;Ft.renderCallByParent=RQ;function IQ(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var MQ=IQ;const DQ=qe(MQ);function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}var LQ=["valueAccessor"],BQ=["data","dataKey","clockWise","id","textBreakAll"];function FQ(e){return WQ(e)||VQ(e)||UQ(e)||zQ()}function zQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UQ(e,t){if(e){if(typeof e=="string")return ug(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ug(e,t)}}function VQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WQ(e){if(Array.isArray(e))return ug(e)}function ug(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var XQ=function(t){return Array.isArray(t.value)?DQ(t.value):t.value};function Gi(e){var t=e.valueAccessor,r=t===void 0?XQ:t,n=qS(e,LQ),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=qS(n,BQ);return!i||!i.length?null:N.createElement(Ge,{className:"recharts-label-list"},i.map(function(f,c){var p=Ee(a)?r(f,c):rr(f&&f.payload,a),h=Ee(s)?{}:{id:"".concat(s,"-").concat(c)};return N.createElement(Ft,Nd({},ge(f,!0),u,h,{parentViewBox:f.parentViewBox,value:p,textBreakAll:l,viewBox:Ft.parseViewBox(Ee(o)?f:KS(KS({},f),{},{clockWise:o})),key:"label-".concat(c),index:c}))}))}Gi.displayName="LabelList";function YQ(e,t){return e?e===!0?N.createElement(Gi,{key:"labelList-implicit",data:t}):N.isValidElement(e)||we(e)?N.createElement(Gi,{key:"labelList-implicit",data:t,content:e}):$s(e)?N.createElement(Gi,Nd({data:t},e,{key:"labelList-implicit"})):null:null}function ZQ(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Yr(n,Gi).map(function(o,s){return j.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=YQ(e.label,t);return[a].concat(FQ(i))}Gi.renderCallByParent=ZQ;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function cg(){return cg=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, + `).concat(c.x,",").concat(c.y,` + `);if(i>0){var h=it(r,n,i,o),x=it(r,n,i,u);p+="L ".concat(x.x,",").concat(x.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, + `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},rJ=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,c=or(f-u),p=Yc({cx:r,cy:n,radius:a,angle:u,sign:c,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,x=p.lineTangency,v=p.theta,y=Yc({cx:r,cy:n,radius:a,angle:f,sign:-c,cornerRadius:o,cornerIsExternal:l}),g=y.circleTangency,m=y.lineTangency,w=y.theta,S=l?Math.abs(u-f):Math.abs(u-f)-v-w;if(S<0)return s?"M ".concat(x.x,",").concat(x.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):yC({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var b="M ".concat(x.x,",").concat(x.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(h.x,",").concat(h.y,` + A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(c<0),",").concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(m.x,",").concat(m.y,` + `);if(i>0){var _=Yc({cx:r,cy:n,radius:i,angle:u,sign:c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=_.circleTangency,k=_.lineTangency,P=_.theta,R=Yc({cx:r,cy:n,radius:i,angle:f,sign:-c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),$=R.circleTangency,C=R.lineTangency,I=R.theta,D=l?Math.abs(u-f):Math.abs(u-f)-P-I;if(D<0&&o===0)return"".concat(b,"L").concat(r,",").concat(n,"Z");b+="L".concat(C.x,",").concat(C.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat($.x,",").concat($.y,` + A`).concat(i,",").concat(i,",0,").concat(+(D>180),",").concat(+(c>0),",").concat(O.x,",").concat(O.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(k.x,",").concat(k.y,"Z")}else b+="L".concat(r,",").concat(n,"Z");return b},nJ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},gC=function(t){var r=YS(YS({},nJ),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,c=r.endAngle,p=r.className;if(o0&&Math.abs(f-c)<360?y=rJ({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,x/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:c}):y=yC({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:c}),N.createElement("path",cg({},ge(r,!0),{className:h,d:y,role:"img"}))};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function fg(){return fg=Object.assign?Object.assign.bind():function(e){for(var t=1;tvJ.call(e,t));function Qa(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const xJ="__v",bJ="__o",wJ="_owner",{getOwnPropertyDescriptor:tO,keys:rO}=Object;function _J(e,t){return e.byteLength===t.byteLength&&$d(new Uint8Array(e),new Uint8Array(t))}function SJ(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function OJ(e,t){return e.byteLength===t.byteLength&&$d(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function jJ(e,t){return Qa(e.getTime(),t.getTime())}function AJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function kJ(e,t){return e===t}function nO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let f=!1,c=0;for(;(s=u.next())&&!s.done;){if(i[c]){c++;continue}const p=o.value,h=s.value;if(r.equals(p[0],h[0],l,c,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){f=i[c]=!0;break}c++}if(!f)return!1;l++}return!0}const EJ=Qa;function PJ(e,t,r){const n=rO(e);let i=n.length;if(rO(t).length!==i)return!1;for(;i-- >0;)if(!_C(e,t,r,n[i]))return!1;return!0}function dl(e,t,r){const n=eO(e);let i=n.length;if(eO(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!_C(e,t,r,a)||(o=tO(e,a),s=tO(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function CJ(e,t){return Qa(e.valueOf(),t.valueOf())}function TJ(e,t){return e.source===t.source&&e.flags===t.flags}function iO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function $d(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function NJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function _C(e,t,r,n){return(n===wJ||n===bJ||n===xJ)&&(e.$$typeof||t.$$typeof)?!0:gJ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const $J="[object ArrayBuffer]",RJ="[object Arguments]",IJ="[object Boolean]",MJ="[object DataView]",DJ="[object Date]",LJ="[object Error]",BJ="[object Map]",FJ="[object Number]",zJ="[object Object]",UJ="[object RegExp]",VJ="[object Set]",WJ="[object String]",HJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},GJ="[object URL]",KJ=Object.prototype.toString;function qJ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:c,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:x}){return function(y,g,m){if(y===g)return!0;if(y==null||g==null)return!1;const w=typeof y;if(w!==typeof g)return!1;if(w!=="object")return w==="number"?s(y,g,m):w==="function"?a(y,g,m):!1;const S=y.constructor;if(S!==g.constructor)return!1;if(S===Object)return l(y,g,m);if(Array.isArray(y))return t(y,g,m);if(S===Date)return n(y,g,m);if(S===RegExp)return f(y,g,m);if(S===Map)return o(y,g,m);if(S===Set)return c(y,g,m);const b=KJ.call(y);if(b===DJ)return n(y,g,m);if(b===UJ)return f(y,g,m);if(b===BJ)return o(y,g,m);if(b===VJ)return c(y,g,m);if(b===zJ)return typeof y.then!="function"&&typeof g.then!="function"&&l(y,g,m);if(b===GJ)return h(y,g,m);if(b===LJ)return i(y,g,m);if(b===RJ)return l(y,g,m);if(HJ[b])return p(y,g,m);if(b===$J)return e(y,g,m);if(b===MJ)return r(y,g,m);if(b===IJ||b===FJ||b===WJ)return u(y,g,m);if(x){let _=x[b];if(!_){const O=yJ(y);O&&(_=x[O])}if(_)return _(y,g,m)}return!1}}function XJ({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:_J,areArraysEqual:r?dl:SJ,areDataViewsEqual:OJ,areDatesEqual:jJ,areErrorsEqual:AJ,areFunctionsEqual:kJ,areMapsEqual:r?Wm(nO,dl):nO,areNumbersEqual:EJ,areObjectsEqual:r?dl:PJ,arePrimitiveWrappersEqual:CJ,areRegExpsEqual:TJ,areSetsEqual:r?Wm(iO,dl):iO,areTypedArraysEqual:r?Wm($d,dl):$d,areUrlsEqual:NJ,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=Qc(n.areArraysEqual),a=Qc(n.areMapsEqual),o=Qc(n.areObjectsEqual),s=Qc(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function YJ(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function ZJ({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const QJ=la();la({strict:!0});la({circular:!0});la({circular:!0,strict:!0});la({createInternalComparator:()=>Qa});la({strict:!0,createInternalComparator:()=>Qa});la({circular:!0,createInternalComparator:()=>Qa});la({circular:!0,createInternalComparator:()=>Qa,strict:!0});function la(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=XJ(e),o=qJ(a),s=r?r(o):YJ(o);return ZJ({circular:t,comparator:o,createState:n,equals:s,strict:i})}function JJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function aO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):JJ(i)};requestAnimationFrame(n)}function pg(e){"@babel/helpers - typeof";return pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pg(e)}function eee(e){return iee(e)||nee(e)||ree(e)||tee()}function tee(){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 ree(e,t){if(e){if(typeof e=="string")return oO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oO(e,t)}}function oO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:g<0?0:g},v=function(g){for(var m=g>1?1:g,w=m,S=0;S<8;++S){var b=c(w)-m,_=h(w);if(Math.abs(b-m)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(f,c,p){var h=-(f-c)*n,x=p*a,v=p+(h-x)*s/1e3,y=p*s/1e3+f;return Math.abs(y-c)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Iee(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Hm(e){return Bee(e)||Lee(e)||Dee(e)||Mee()}function Mee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dee(e,t){if(e){if(typeof e=="string")return gg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gg(e,t)}}function Lee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bee(e){if(Array.isArray(e))return gg(e)}function gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Md(e){return Md=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Md(e)}var ci=function(e){Wee(r,e);var t=Hee(r);function r(n,i){var a;Fee(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,c=o.steps,p=o.children,h=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(wg(a)),a.changeStyle=a.changeStyle.bind(wg(a)),!s||h<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:f}),bg(a);if(c&&c.length)a.state={style:c[0].style};else if(u){if(typeof p=="function")return a.state={style:u},bg(a);a.state={style:l?Sl({},l,u):u}}else a.state={style:{}};return a}return Uee(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,c=a.from,p=this.state.style;if(s){if(!o){var h={style:l?Sl({},l,f):f};this.state&&p&&(l&&p[l]!==f||!l&&p!==f)&&this.setState(h);return}if(!(QJ(i.to,f)&&i.canBegin&&i.isActive)){var x=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=x||u?c:i.to;if(this.state&&p){var y={style:l?Sl({},l,v):v};(l&&p[l]!==v||!l&&p!==v)&&this.setState(y)}this.runAnimation(an(an({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,f=i.begin,c=i.onAnimationEnd,p=i.onAnimationStart,h=Nee(o,s,wee(u),l,this.changeStyle),x=function(){a.stopJSAnimation=h()};this.manager.start([p,f,x,l,c])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,c=u.duration,p=c===void 0?0:c,h=function(v,y,g){if(g===0)return v;var m=y.duration,w=y.easing,S=w===void 0?"ease":w,b=y.style,_=y.properties,O=y.onAnimationEnd,k=g>0?o[g-1]:y,P=_||Object.keys(b);if(typeof S=="function"||S==="spring")return[].concat(Hm(v),[a.runJSAnimation.bind(a,{from:k.style,to:b,duration:m,easing:S}),m]);var R=uO(P,m,S),$=an(an(an({},k.style),b),{},{transition:R});return[].concat(Hm(v),[$,m,O]).filter(uee)};return this.manager.start([l].concat(Hm(o.reduce(h,[f,Math.max(p,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=aee());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,c=i.onAnimationEnd,p=i.steps,h=i.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(i);return}if(p.length>1){this.runStepAnimation(i);return}var v=s?Sl({},s,l):l,y=uO(Object.keys(v),o,u);x.start([f,a,an(an({},v),{},{transition:y}),o,c])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Ree(i,$ee),u=j.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var c=function(h){var x=h.props,v=x.style,y=v===void 0?{}:v,g=x.className,m=j.cloneElement(h,an(an({},l),{},{style:an(an({},y),f),className:g}));return m};return u===1?c(j.Children.only(a)):N.createElement("div",null,j.Children.map(a,function(p){return c(p)}))}}]),r}(j.PureComponent);ci.displayName="Animate";ci.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ci.propTypes={from:Ve.oneOfType([Ve.object,Ve.string]),to:Ve.oneOfType([Ve.object,Ve.string]),attributeName:Ve.string,duration:Ve.number,begin:Ve.number,easing:Ve.oneOfType([Ve.string,Ve.func]),steps:Ve.arrayOf(Ve.shape({duration:Ve.number.isRequired,style:Ve.object.isRequired,easing:Ve.oneOfType([Ve.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ve.func]),properties:Ve.arrayOf("string"),onAnimationEnd:Ve.func})),children:Ve.oneOfType([Ve.node,Ve.func]),isActive:Ve.bool,canBegin:Ve.bool,onAnimationEnd:Ve.func,shouldReAnimate:Ve.bool,onAnimationStart:Ve.func,onAnimationReStart:Ve.func};function Bu(e){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function Dd(){return Dd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var c=[0,0,0,0],p=0,h=4;po?o:a[p];f="M".concat(t,",").concat(r+s*c[0]),c[0]>0&&(f+="A ".concat(c[0],",").concat(c[0],",0,0,").concat(u,",").concat(t+l*c[0],",").concat(r)),f+="L ".concat(t+n-l*c[1],",").concat(r),c[1]>0&&(f+="A ".concat(c[1],",").concat(c[1],",0,0,").concat(u,`, + `).concat(t+n,",").concat(r+s*c[1])),f+="L ".concat(t+n,",").concat(r+i-s*c[2]),c[2]>0&&(f+="A ".concat(c[2],",").concat(c[2],",0,0,").concat(u,`, + `).concat(t+n-l*c[2],",").concat(r+i)),f+="L ".concat(t+l*c[3],",").concat(r+i),c[3]>0&&(f+="A ".concat(c[3],",").concat(c[3],",0,0,").concat(u,`, + `).concat(t,",").concat(r+i-s*c[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var x=Math.min(o,a);f="M ".concat(t,",").concat(r+s*x,` + A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+l*x,",").concat(r,` + L `).concat(t+n-l*x,",").concat(r,` + A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*x,` + L `).concat(t+n,",").concat(r+i-s*x,` + A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+n-l*x,",").concat(r+i,` + L `).concat(t+l*x,",").concat(r+i,` + A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*x," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},tte=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),c=Math.min(o,o+l),p=Math.max(o,o+l);return n>=u&&n<=f&&i>=c&&i<=p}return!1},rte={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},nb=function(t){var r=yO(yO({},rte),t),n=j.useRef(),i=j.useState(-1),a=Kee(i,2),o=a[0],s=a[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,c=r.height,p=r.radius,h=r.className,x=r.animationEasing,v=r.animationDuration,y=r.animationBegin,g=r.isAnimationActive,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||c!==+c||f===0||c===0)return null;var w=je("recharts-rectangle",h);return m?N.createElement(ci,{canBegin:o>0,from:{width:f,height:c,x:l,y:u},to:{width:f,height:c,x:l,y:u},duration:v,animationEasing:x,isActive:m},function(S){var b=S.width,_=S.height,O=S.x,k=S.y;return N.createElement(ci,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:v,isActive:g,easing:x},N.createElement("path",Dd({},ge(r,!0),{className:w,d:gO(O,k,b,_,p),ref:n})))}):N.createElement("path",Dd({},ge(r,!0),{className:w,d:gO(l,u,f,c,p)}))},nte=["points","className","baseLinePoints","connectNulls"];function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ate(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xO(e){return ute(e)||lte(e)||ste(e)||ote()}function ote(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ste(e,t){if(e){if(typeof e=="string")return _g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _g(e,t)}}function lte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ute(e){if(Array.isArray(e))return _g(e)}function _g(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){bO(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),bO(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Ul=function(t,r){var n=cte(t);r&&(n=[n.reduce(function(a,o){return[].concat(xO(a),xO(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},fte=function(t,r,n){var i=Ul(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Ul(r.reverse(),n).slice(1))},dte=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=ite(t,nte);if(!r||!r.length)return null;var s=je("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=fte(r,i,a);return N.createElement("g",{className:s},N.createElement("path",Oo({},ge(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?N.createElement("path",Oo({},ge(o,!0),{fill:"none",d:Ul(r,a)})):null,l?N.createElement("path",Oo({},ge(o,!0),{fill:"none",d:Ul(i,a)})):null)}var f=Ul(r,a);return N.createElement("path",Oo({},ge(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function Sg(){return Sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var bte=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},wte=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,c=f===void 0?0:f,p=t.height,h=p===void 0?0:p,x=t.className,v=gte(t,pte),y=hte({x:n,y:a,top:s,left:u,width:c,height:h},v);return!ne(n)||!ne(a)||!ne(c)||!ne(h)||!ne(s)||!ne(u)?null:N.createElement("path",Og({},ge(y,!0),{className:je("recharts-cross",x),d:bte(n,a,c,h,s,u)}))},_te=ih,Ste=zP,Ote=aa;function jte(e,t){return e&&e.length?_te(e,Ote(t),Ste):void 0}var Ate=jte;const kte=qe(Ate);var Ete=ih,Pte=aa,Cte=UP;function Tte(e,t){return e&&e.length?Ete(e,Pte(t),Cte):void 0}var Nte=Tte;const $te=qe(Nte);var Rte=["cx","cy","angle","ticks","axisLine"],Ite=["ticks","tick","angle","tickFormatter","stroke"];function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Dte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OO(e,t){for(var r=0;rkO?o=i==="outer"?"start":"end":a<-kO?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=da(da({},ge(this.props,!1)),{},{fill:"none"},ge(s,!1));if(l==="circle")return N.createElement(ib,ga({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,c=f.map(function(p){return it(i,a,o,p.coordinate)});return N.createElement(dte,ga({className:"recharts-polar-angle-axis-line"},u,{points:c}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=ge(this.props,!1),c=ge(o,!1),p=da(da({},f),{},{fill:"none"},ge(s,!1)),h=a.map(function(x,v){var y=n.getTickLineCoord(x),g=n.getTickTextAnchor(x),m=da(da(da({textAnchor:g},f),{},{stroke:"none",fill:u},c),{},{index:v,payload:x,x:y.x2,y:y.y2});return N.createElement(Ge,ga({className:je("recharts-polar-angle-axis-tick",mC(o)),key:"tick-".concat(x.coordinate)},Va(n.props,x,v)),s&&N.createElement("line",ga({className:"recharts-polar-angle-axis-tick-line"},p,y)),o&&t.renderTickItem(o,m,l?l(x.value,v):x.value))});return N.createElement(Ge,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:N.createElement(Ge,{className:je("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return N.isValidElement(n)?o=N.cloneElement(n,i):we(n)?o=n(i):o=N.createElement(Wa,ga({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(j.PureComponent);ph(hh,"displayName","PolarAngleAxis");ph(hh,"axisType","angleAxis");ph(hh,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Qte=B2,Jte=Qte(Object.getPrototypeOf,Object),ere=Jte,tre=hi,rre=ere,nre=mi,ire="[object Object]",are=Function.prototype,ore=Object.prototype,$C=are.toString,sre=ore.hasOwnProperty,lre=$C.call(Object);function ure(e){if(!nre(e)||tre(e)!=ire)return!1;var t=rre(e);if(t===null)return!0;var r=sre.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&$C.call(r)==lre}var cre=ure;const fre=qe(cre);var dre=hi,pre=mi,hre="[object Boolean]";function mre(e){return e===!0||e===!1||pre(e)&&dre(e)==hre}var vre=mre;const yre=qe(vre);function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function Fd(){return Fd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:f,lowerWidth:c,height:p,x:l,y:u},duration:v,animationEasing:x,isActive:g},function(w){var S=w.upperWidth,b=w.lowerWidth,_=w.height,O=w.x,k=w.y;return N.createElement(ci,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:v,easing:x},N.createElement("path",Fd({},ge(r,!0),{className:m,d:TO(O,k,S,b,_),ref:n})))}):N.createElement("g",null,N.createElement("path",Fd({},ge(r,!0),{className:m,d:TO(l,u,f,c,p)})))},Ere=["option","shapeType","propTransformer","activeClassName","isActive"];function Uu(e){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function Pre(e,t){if(e==null)return{};var r=Cre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function NO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zd(e){for(var t=1;t0?$r(w,"paddingAngle",0):0;if(b){var O=Ai(b.endAngle-b.startAngle,w.endAngle-w.startAngle),k=tt(tt({},w),{},{startAngle:m+_,endAngle:m+O(v)+_});y.push(k),m=k.endAngle}else{var P=w.endAngle,R=w.startAngle,$=Ai(0,P-R),C=$(v),I=tt(tt({},w),{},{startAngle:m+_,endAngle:m+C+_});y.push(I),m=I.endAngle}}),N.createElement(Ge,null,n.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!sh(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,f=i.cy,c=i.innerRadius,p=i.outerRadius,h=i.isAnimationActive,x=this.state.isAnimationFinished;if(a||!o||!o.length||!ne(u)||!ne(f)||!ne(c)||!ne(p))return null;var v=je("recharts-pie",s);return N.createElement(Ge,{tabIndex:this.props.rootTabIndex,className:v,ref:function(g){n.pieRef=g}},this.renderSectors(),l&&this.renderLabels(o),Ft.renderCallByParent(this.props,null,!1),(!h||x)&&Gi.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?m:m-1)*l,S=y-m*h-w,b=i.reduce(function(k,P){var R=rr(P,g,0);return k+(ne(R)?R:0)},0),_;if(b>0){var O;_=i.map(function(k,P){var R=rr(k,g,0),$=rr(k,f,P),C=(ne(R)?R:0)/b,I;P?I=O.endAngle+or(v)*l*(R!==0?1:0):I=o;var D=I+or(v)*((R!==0?h:0)+C*S),L=(I+D)/2,z=(x.innerRadius+x.outerRadius)/2,U=[{name:$,value:R,payload:k,dataKey:g,type:p}],M=it(x.cx,x.cy,z,L);return O=tt(tt(tt({percent:C,cornerRadius:a,name:$,tooltipPayload:U,midAngle:L,middleRadius:z,tooltipPosition:M},k),x),{},{value:rr(k,g),startAngle:I,endAngle:D,payload:k,paddingAngle:or(v)*l}),O})}return tt(tt({},x),{},{sectors:_,data:i})});var Zre=Math.ceil,Qre=Math.max;function Jre(e,t,r,n){for(var i=-1,a=Qre(Zre((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var ene=Jre,tne=nP,MO=1/0,rne=17976931348623157e292;function nne(e){if(!e)return e===0?e:0;if(e=tne(e),e===MO||e===-MO){var t=e<0?-1:1;return t*rne}return e===e?e:0}var ine=nne,ane=ene,one=Zp,Gm=ine;function sne(e){return function(t,r,n){return n&&typeof n!="number"&&one(t,r,n)&&(r=n=void 0),t=Gm(t),r===void 0?(r=t,t=0):r=Gm(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),Ar(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),Ar(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ar(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ar(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ar(n,"handleSlideDragStart",function(i){var a=zO(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return wne(t,e),yne(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,c=Math.min(i,a),p=Math.max(i,a),h=t.getIndexInRange(o,c),x=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:x===f?f:x-x%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=rr(a[n],s,n);return we(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,f=l.width,c=l.travellerWidth,p=l.startIndex,h=l.endIndex,x=l.onChange,v=n.pageX-a;v>0?v=Math.min(v,u+f-c-s,u+f-c-o):v<0&&(v=Math.max(v,u-o,u-s));var y=this.getIndex({startX:o+v,endX:s+v});(y.startIndex!==p||y.endIndex!==h)&&x&&x(y),this.setState({startX:o+v,endX:s+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=zO(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],f=this.props,c=f.x,p=f.width,h=f.travellerWidth,x=f.onChange,v=f.gap,y=f.data,g={startX:this.state.startX,endX:this.state.endX},m=n.pageX-a;m>0?m=Math.min(m,c+p-h-u):m<0&&(m=Math.max(m,c-u)),g[o]=u+m;var w=this.getIndex(g),S=w.startIndex,b=w.endIndex,_=function(){var k=y.length-1;return o==="startX"&&(s>l?S%v===0:b%v===0)||sl?b%v===0:S%v===0)||s>l&&b===k};this.setState(Ar(Ar({},o,u+m),"brushMoveStartX",n.pageX),function(){x&&_()&&x(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],c=s.indexOf(f);if(c!==-1){var p=c+n;if(!(p===-1||p>=s.length)){var h=s[p];i==="startX"&&h>=u||i==="endX"&&h<=l||this.setState(Ar({},i,h),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return N.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,c=j.Children.only(u);return c?N.cloneElement(c,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,c=l.height,p=l.traveller,h=l.ariaLabel,x=l.data,v=l.startIndex,y=l.endIndex,g=Math.max(n,this.props.x),m=Km(Km({},ge(this.props,!1)),{},{x:g,y:u,width:f,height:c}),w=h||"Min value: ".concat((a=x[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=x[y])===null||o===void 0?void 0:o.name);return N.createElement(Ge,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(b){["ArrowLeft","ArrowRight"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),s.handleTravellerMoveKeyboard(b.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,m))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,c=Math.max(Math.abs(i-n)-u,0);return N.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:c,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,c=f.startX,p=f.endX,h=5,x={pointerEvents:"none",fill:u};return N.createElement(Ge,{className:"recharts-brush-texts"},N.createElement(Wa,Wd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,p)-h,y:o+s/2},x),this.getTextOfTick(i)),N.createElement(Wa,Wd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,p)+l+h,y:o+s/2},x),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,c=n.alwaysShowText,p=this.state,h=p.startX,x=p.endX,v=p.isTextActive,y=p.isSlideMoving,g=p.isTravellerMoving,m=p.isTravellerFocused;if(!i||!i.length||!ne(s)||!ne(l)||!ne(u)||!ne(f)||u<=0||f<=0)return null;var w=je("recharts-brush",a),S=N.Children.count(o)===1,b=mne("userSelect","none");return N.createElement(Ge,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,x),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(x,"endX"),(v||y||g||m||c)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return N.createElement(N.Fragment,null,N.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),N.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),N.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return N.isValidElement(n)?a=N.cloneElement(n,i):we(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,c=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Km({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?Sne({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:c}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var p=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(j.PureComponent);Ar(ps,"displayName","Brush");Ar(ps,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var One=Px;function jne(e,t){var r;return One(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var Ane=jne,kne=T2,Ene=aa,Pne=Ane,Cne=_r,Tne=Zp;function Nne(e,t,r){var n=Cne(e)?kne:Pne;return r&&Tne(e,t,r)&&(t=void 0),n(e,Ene(t))}var $ne=Nne;const Rne=qe($ne);var $n=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},UO=Q2;function Ine(e,t,r){t=="__proto__"&&UO?UO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Mne=Ine,Dne=Mne,Lne=Y2,Bne=aa;function Fne(e,t){var r={};return t=Bne(t),Lne(e,function(n,i,a){Dne(r,i,t(n,i,a))}),r}var zne=Fne;const Une=qe(zne);function Vne(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lie(e,t){var r=e.x,n=e.y,i=oie(e,rie),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),c="".concat(t.width||i.width),p=parseInt(c,10);return pl(pl(pl(pl(pl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:p,name:t.name,radius:t.radius})}function WO(e){return N.createElement(RC,Pg({shapeType:"rectangle",propTransformer:lie,activeClassName:"recharts-active-bar"},e))}var uie=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=ne(n)||E6(n);return a?t(n,i):(a||Ga(),r)}},cie=["value","background"],FC;function hs(e){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(e)}function fie(e,t){if(e==null)return{};var r=die(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function die(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Gd(){return Gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(L)0&&Math.abs(D)0&&(I=Math.min((X||0)-(D[de-1]||0),I))}),Number.isFinite(I)){var L=I/C,z=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(O=L*z/2),v.padding==="no-gap"){var U=sr(t.barCategoryGap,L*z),M=L*z/2;O=M-U-(M-U)/z*U}}}i==="xAxis"?k=[n.left+(w.left||0)+(O||0),n.left+n.width-(w.right||0)-(O||0)]:i==="yAxis"?k=l==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(O||0),n.top+n.height-(w.bottom||0)-(O||0)]:k=v.range,b&&(k=[k[1],k[0]]);var B=lC(v,a,p),W=B.scale,J=B.realScaleType;W.domain(g).range(k),uC(W);var G=cC(W,un(un({},v),{},{realScaleType:J}));i==="xAxis"?($=y==="top"&&!S||y==="bottom"&&S,P=n.left,R=c[_]-$*v.height):i==="yAxis"&&($=y==="left"&&!S||y==="right"&&S,P=c[_]-$*v.width,R=n.top);var Q=un(un(un({},v),G),{},{realScaleType:J,x:P,y:R,scale:W,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return Q.bandSize=Cd(Q,G),!v.hide&&i==="xAxis"?c[_]+=($?-1:1)*Q.height:v.hide||(c[_]+=($?-1:1)*Q.width),un(un({},h),{},yh({},x,Q))},{})},WC=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},Oie=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return WC({x:r,y:n},{x:i,y:a})},HC=function(){function e(t){bie(this,e),this.scale=t}return wie(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();yh(HC,"EPS",1e-4);var ab=function(t){var r=Object.keys(t).reduce(function(n,i){return un(un({},n),{},yh({},i,HC.create(t[i])))},{});return un(un({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return Une(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return tie(i,function(a,o){return r[o].isInRange(a)})}})};function jie(e){return(e%180+180)%180}var Aie=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=jie(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&oe.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function pae(e,t){return lT(e,t+1)}function hae(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,c=function(){var x=n==null?void 0:n[l];if(x===void 0)return{v:lT(n,u)};var v=l,y,g=function(){return y===void 0&&(y=r(x,v)),y},m=x.coordinate,w=l===0||Zd(e,m,g,f,s);w||(l=0,f=o,u+=1),w&&(f=m+e*(g()/2+i),l+=u)},p;u<=a.length;)if(p=c(),p)return p.v;return[]}function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function nj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t0?h.coordinate-y*e:h.coordinate})}else a[p]=h=Jt(Jt({},h),{},{tickCoord:h.coordinate});var g=Zd(e,h.tickCoord,v,s,l);g&&(l=h.tickCoord-e*(v()/2+i),a[p]=Jt(Jt({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function xae(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],c=r(f,s-1),p=e*(f.coordinate+e*c/2-u);o[s-1]=f=Jt(Jt({},f),{},{tickCoord:p>0?f.coordinate-p*e:f.coordinate});var h=Zd(e,f.tickCoord,function(){return c},l,u);h&&(u=f.tickCoord-e*(c/2+i),o[s-1]=Jt(Jt({},f),{},{isShow:!0}))}for(var x=a?s-1:s,v=function(m){var w=o[m],S,b=function(){return S===void 0&&(S=r(w,m)),S};if(m===0){var _=e*(w.coordinate-e*b()/2-l);o[m]=w=Jt(Jt({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else o[m]=w=Jt(Jt({},w),{},{tickCoord:w.coordinate});var O=Zd(e,w.tickCoord,b,l,u);O&&(l=w.tickCoord+e*(b()/2+i),o[m]=Jt(Jt({},w),{},{isShow:!0}))},y=0;y=2?or(i[1].coordinate-i[0].coordinate):1,g=dae(a,y,h);return l==="equidistantPreserveStart"?hae(y,g,v,i,o):(l==="preserveStart"||l==="preserveStartEnd"?p=xae(y,g,v,i,o,l==="preserveStartEnd"):p=gae(y,g,v,i,o),p.filter(function(m){return m.isShow}))}var wae=["viewBox"],_ae=["viewBox"],Sae=["ticks"];function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Oae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function jae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aj(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!x||!x.length?null:N.createElement(Ge,{className:je("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),Ft.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=je(i.className,"recharts-cartesian-axis-tick-value");return N.isValidElement(n)?o=N.cloneElement(n,Ct(Ct({},i),{},{className:s})):we(n)?o=n(Ct(Ct({},i),{},{className:s})):o=N.createElement(Wa,Ao({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(j.Component);lb(_h,"displayName","CartesianAxis");lb(_h,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function Nae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $ae(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function boe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function woe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&ne(i)&&ne(a)?t.slice(i,a+1):[]};function OT(e){return e==="number"?[0,"auto"]:void 0}var Gg=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Sh(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,c=(f=u.props.data)!==null&&f!==void 0?f:r;c&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(c=c.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=c===void 0?s:c;p=by(h,o.dataKey,i)}else p=c&&c[n]||s[n];return p?[].concat(_s(l),[dC(u,p)]):l},[])},fj=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=$oe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=zZ(o,s,u,l);if(f>=0&&u){var c=u[f]&&u[f].value,p=Gg(t,r,f,c),h=Roe(n,s,f,a);return{activeTooltipIndex:f,activeLabel:c,activePayload:p,activeCoordinate:h}}return null},Ioe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,p=t.stackOffset,h=sC(f,a);return n.reduce(function(x,v){var y,g=v.type.defaultProps!==void 0?H(H({},v.type.defaultProps),v.props):v.props,m=g.type,w=g.dataKey,S=g.allowDataOverflow,b=g.allowDuplicatedCategory,_=g.scale,O=g.ticks,k=g.includeHidden,P=g[o];if(x[P])return x;var R=Sh(t.data,{graphicalItems:i.filter(function(G){var Q,X=o in G.props?G.props[o]:(Q=G.type.defaultProps)===null||Q===void 0?void 0:Q[o];return X===P}),dataStartIndex:l,dataEndIndex:u}),$=R.length,C,I,D;soe(g.domain,S,m)&&(C=sg(g.domain,null,S),h&&(m==="number"||_!=="auto")&&(D=Fl(R,w,"category")));var L=OT(m);if(!C||C.length===0){var z,U=(z=g.domain)!==null&&z!==void 0?z:L;if(w){if(C=Fl(R,w,m),m==="category"&&h){var M=C6(C);b&&M?(I=C,C=Vd(0,$)):b||(C=zS(U,C,v).reduce(function(G,Q){return G.indexOf(Q)>=0?G:[].concat(_s(G),[Q])},[]))}else if(m==="category")b?C=C.filter(function(G){return G!==""&&!Ee(G)}):C=zS(U,C,v).reduce(function(G,Q){return G.indexOf(Q)>=0||Q===""||Ee(Q)?G:[].concat(_s(G),[Q])},[]);else if(m==="number"){var B=GZ(R,i.filter(function(G){var Q,X,de=o in G.props?G.props[o]:(Q=G.type.defaultProps)===null||Q===void 0?void 0:Q[o],ue="hide"in G.props?G.props.hide:(X=G.type.defaultProps)===null||X===void 0?void 0:X.hide;return de===P&&(k||!ue)}),w,a,f);B&&(C=B)}h&&(m==="number"||_!=="auto")&&(D=Fl(R,w,"category"))}else h?C=Vd(0,$):s&&s[P]&&s[P].hasStack&&m==="number"?C=p==="expand"?[0,1]:fC(s[P].stackGroups,l,u):C=oC(R,i.filter(function(G){var Q=o in G.props?G.props[o]:G.type.defaultProps[o],X="hide"in G.props?G.props.hide:G.type.defaultProps.hide;return Q===P&&(k||!X)}),m,f,!0);if(m==="number")C=Vg(c,C,P,a,O),U&&(C=sg(U,C,S));else if(m==="category"&&U){var W=U,J=C.every(function(G){return W.indexOf(G)>=0});J&&(C=W)}}return H(H({},x),{},ye({},P,H(H({},g),{},{axisType:a,domain:C,categoricalDomain:D,duplicateDomain:I,originalDomain:(y=g.domain)!==null&&y!==void 0?y:L,isCategorical:h,layout:f})))},{})},Moe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,p=Sh(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=p.length,x=sC(f,a),v=-1;return n.reduce(function(y,g){var m=g.type.defaultProps!==void 0?H(H({},g.type.defaultProps),g.props):g.props,w=m[o],S=OT("number");if(!y[w]){v++;var b;return x?b=Vd(0,h):s&&s[w]&&s[w].hasStack?(b=fC(s[w].stackGroups,l,u),b=Vg(c,b,w,a)):(b=sg(S,oC(p,n.filter(function(_){var O,k,P=o in _.props?_.props[o]:(O=_.type.defaultProps)===null||O===void 0?void 0:O[o],R="hide"in _.props?_.props.hide:(k=_.type.defaultProps)===null||k===void 0?void 0:k.hide;return P===w&&!R}),"number",f),i.defaultProps.allowDataOverflow),b=Vg(c,b,w,a)),H(H({},y),{},ye({},w,H(H({axisType:a},i.defaultProps),{},{hide:!0,orientation:$r(Toe,"".concat(a,".").concat(v%2),null),domain:b,originalDomain:S,isCategorical:x,layout:f})))}return y},{})},Doe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,c="".concat(i,"Id"),p=Yr(f,a),h={};return p&&p.length?h=Ioe(t,{axes:p,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=Moe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Loe=function(t){var r=so(t),n=Aa(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Cx(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Cd(r,n)}},dj=function(t){var r=t.children,n=t.defaultShowTooltip,i=Er(r,ps),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Boe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Qn(r&&r.type);return n&&n.indexOf("Bar")>=0})},pj=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Foe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,c=n.children,p=n.margin||{},h=Er(c,ps),x=Er(c,Pa),v=Object.keys(l).reduce(function(b,_){var O=l[_],k=O.orientation;return!O.mirror&&!O.hide?H(H({},b),{},ye({},k,b[k]+O.width)):b},{left:p.left||0,right:p.right||0}),y=Object.keys(o).reduce(function(b,_){var O=o[_],k=O.orientation;return!O.mirror&&!O.hide?H(H({},b),{},ye({},k,$r(b,"".concat(k))+O.height)):b},{top:p.top||0,bottom:p.bottom||0}),g=H(H({},y),v),m=g.bottom;h&&(g.bottom+=h.props.height||ps.defaultProps.height),x&&r&&(g=WZ(g,i,n,r));var w=u-g.left-g.right,S=f-g.top-g.bottom;return H(H({brushBottom:m},g),{},{width:Math.max(w,0),height:Math.max(S,0)})},zoe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},jT=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,c=t.defaultProps,p=function(g,m){var w=m.graphicalItems,S=m.stackGroups,b=m.offset,_=m.updateId,O=m.dataStartIndex,k=m.dataEndIndex,P=g.barSize,R=g.layout,$=g.barGap,C=g.barCategoryGap,I=g.maxBarSize,D=pj(R),L=D.numericAxisName,z=D.cateAxisName,U=Boe(w),M=[];return w.forEach(function(B,W){var J=Sh(g.data,{graphicalItems:[B],dataStartIndex:O,dataEndIndex:k}),G=B.type.defaultProps!==void 0?H(H({},B.type.defaultProps),B.props):B.props,Q=G.dataKey,X=G.maxBarSize,de=G["".concat(L,"Id")],ue=G["".concat(z,"Id")],Se={},_e=l.reduce(function(He,Ue){var T=m["".concat(Ue.axisType,"Map")],A=G["".concat(Ue.axisType,"Id")];T&&T[A]||Ue.axisType==="zAxis"||Ga();var E=T[A];return H(H({},He),{},ye(ye({},Ue.axisType,E),"".concat(Ue.axisType,"Ticks"),Aa(E)))},Se),te=_e[z],re=_e["".concat(z,"Ticks")],pe=S&&S[de]&&S[de].hasStack&&tQ(B,S[de].stackGroups),K=Qn(B.type).indexOf("Bar")>=0,Pe=Cd(te,re),he=[],Me=U&&UZ({barSize:P,stackGroups:S,totalSize:zoe(_e,z)});if(K){var Be,ve,Ae=Ee(X)?I:X,$e=(Be=(ve=Cd(te,re,!0))!==null&&ve!==void 0?ve:Ae)!==null&&Be!==void 0?Be:0;he=VZ({barGap:$,barCategoryGap:C,bandSize:$e!==Pe?$e:Pe,sizeList:Me[ue],maxBarSize:Ae}),$e!==Pe&&(he=he.map(function(He){return H(H({},He),{},{position:H(H({},He.position),{},{offset:He.position.offset-$e/2})})}))}var Oe=B&&B.type&&B.type.getComposedData;Oe&&M.push({props:H(H({},Oe(H(H({},_e),{},{displayedData:J,props:g,dataKey:Q,item:B,bandSize:Pe,barPosition:he,offset:b,stackedData:pe,layout:R,dataStartIndex:O,dataEndIndex:k}))),{},ye(ye(ye({key:B.key||"item-".concat(W)},L,_e[L]),z,_e[z]),"animationId",_)),childIndex:U6(B,g.children),item:B})}),M},h=function(g,m){var w=g.props,S=g.dataStartIndex,b=g.dataEndIndex,_=g.updateId;if(!Iw({props:w}))return null;var O=w.children,k=w.layout,P=w.stackOffset,R=w.data,$=w.reverseStackOrder,C=pj(k),I=C.numericAxisName,D=C.cateAxisName,L=Yr(O,n),z=JZ(R,L,"".concat(I,"Id"),"".concat(D,"Id"),P,$),U=l.reduce(function(G,Q){var X="".concat(Q.axisType,"Map");return H(H({},G),{},ye({},X,Doe(w,H(H({},Q),{},{graphicalItems:L,stackGroups:Q.axisType===I&&z,dataStartIndex:S,dataEndIndex:b}))))},{}),M=Foe(H(H({},U),{},{props:w,graphicalItems:L}),m==null?void 0:m.legendBBox);Object.keys(U).forEach(function(G){U[G]=f(w,U[G],M,G.replace("Map",""),r)});var B=U["".concat(D,"Map")],W=Loe(B),J=p(w,H(H({},U),{},{dataStartIndex:S,dataEndIndex:b,updateId:_,graphicalItems:L,stackGroups:z,offset:M}));return H(H({formattedGraphicalItems:J,graphicalItems:L,offset:M,stackGroups:z},W),U)},x=function(y){function g(m){var w,S,b;return boe(this,g),b=Soe(this,g,[m]),ye(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ye(b,"accessibilityManager",new ooe),ye(b,"handleLegendBBoxUpdate",function(_){if(_){var O=b.state,k=O.dataStartIndex,P=O.dataEndIndex,R=O.updateId;b.setState(H({legendBBox:_},h({props:b.props,dataStartIndex:k,dataEndIndex:P,updateId:R},H(H({},b.state),{},{legendBBox:_}))))}}),ye(b,"handleReceiveSyncEvent",function(_,O,k){if(b.props.syncId===_){if(k===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(O)}}),ye(b,"handleBrushChange",function(_){var O=_.startIndex,k=_.endIndex;if(O!==b.state.dataStartIndex||k!==b.state.dataEndIndex){var P=b.state.updateId;b.setState(function(){return H({dataStartIndex:O,dataEndIndex:k},h({props:b.props,dataStartIndex:O,dataEndIndex:k,updateId:P},b.state))}),b.triggerSyncEvent({dataStartIndex:O,dataEndIndex:k})}}),ye(b,"handleMouseEnter",function(_){var O=b.getMouseInfo(_);if(O){var k=H(H({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var P=b.props.onMouseEnter;we(P)&&P(k,_)}}),ye(b,"triggeredAfterMouseMove",function(_){var O=b.getMouseInfo(_),k=O?H(H({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(k),b.triggerSyncEvent(k);var P=b.props.onMouseMove;we(P)&&P(k,_)}),ye(b,"handleItemMouseEnter",function(_){b.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),ye(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),ye(b,"handleMouseMove",function(_){_.persist(),b.throttleTriggeredAfterMouseMove(_)}),ye(b,"handleMouseLeave",function(_){b.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};b.setState(O),b.triggerSyncEvent(O);var k=b.props.onMouseLeave;we(k)&&k(O,_)}),ye(b,"handleOuterEvent",function(_){var O=z6(_),k=$r(b.props,"".concat(O));if(O&&we(k)){var P,R;/.*touch.*/i.test(O)?R=b.getMouseInfo(_.changedTouches[0]):R=b.getMouseInfo(_),k((P=R)!==null&&P!==void 0?P:{},_)}}),ye(b,"handleClick",function(_){var O=b.getMouseInfo(_);if(O){var k=H(H({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var P=b.props.onClick;we(P)&&P(k,_)}}),ye(b,"handleMouseDown",function(_){var O=b.props.onMouseDown;if(we(O)){var k=b.getMouseInfo(_);O(k,_)}}),ye(b,"handleMouseUp",function(_){var O=b.props.onMouseUp;if(we(O)){var k=b.getMouseInfo(_);O(k,_)}}),ye(b,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),ye(b,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseDown(_.changedTouches[0])}),ye(b,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseUp(_.changedTouches[0])}),ye(b,"handleDoubleClick",function(_){var O=b.props.onDoubleClick;if(we(O)){var k=b.getMouseInfo(_);O(k,_)}}),ye(b,"handleContextMenu",function(_){var O=b.props.onContextMenu;if(we(O)){var k=b.getMouseInfo(_);O(k,_)}}),ye(b,"triggerSyncEvent",function(_){b.props.syncId!==void 0&&Xm.emit(Ym,b.props.syncId,_,b.eventEmitterSymbol)}),ye(b,"applySyncEvent",function(_){var O=b.props,k=O.layout,P=O.syncMethod,R=b.state.updateId,$=_.dataStartIndex,C=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)b.setState(H({dataStartIndex:$,dataEndIndex:C},h({props:b.props,dataStartIndex:$,dataEndIndex:C,updateId:R},b.state)));else if(_.activeTooltipIndex!==void 0){var I=_.chartX,D=_.chartY,L=_.activeTooltipIndex,z=b.state,U=z.offset,M=z.tooltipTicks;if(!U)return;if(typeof P=="function")L=P(M,_);else if(P==="value"){L=-1;for(var B=0;B=0){var pe,K;if(I.dataKey&&!I.allowDuplicatedCategory){var Pe=typeof I.dataKey=="function"?re:"payload.".concat(I.dataKey.toString());pe=by(B,Pe,L),K=W&&J&&by(J,Pe,L)}else pe=B==null?void 0:B[D],K=W&&J&&J[D];if(ue||de){var he=_.props.activeIndex!==void 0?_.props.activeIndex:D;return[j.cloneElement(_,H(H(H({},P.props),_e),{},{activeIndex:he})),null,null]}if(!Ee(pe))return[te].concat(_s(b.renderActivePoints({item:P,activePoint:pe,basePoint:K,childIndex:D,isRange:W})))}else{var Me,Be=(Me=b.getItemByXY(b.state.activeCoordinate))!==null&&Me!==void 0?Me:{graphicalItem:te},ve=Be.graphicalItem,Ae=ve.item,$e=Ae===void 0?_:Ae,Oe=ve.childIndex,He=H(H(H({},P.props),_e),{},{activeIndex:Oe});return[j.cloneElement($e,He),null,null]}return W?[te,null,null]:[te,null]}),ye(b,"renderCustomized",function(_,O,k){return j.cloneElement(_,H(H({key:"recharts-customized-".concat(k)},b.props),b.state))}),ye(b,"renderMap",{CartesianGrid:{handler:ef,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:ef},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:ef},YAxis:{handler:ef},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((w=m.id)!==null&&w!==void 0?w:cc("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=iP(b.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),b.state={},b}return Aoe(g,y),_oe(g,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,b=w.data,_=w.height,O=w.layout,k=Er(S,Pr);if(k){var P=k.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var R=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,$=Gg(this.state,b,P,R),C=this.state.tooltipTicks[P].coordinate,I=(this.state.offset.top+_)/2,D=O==="horizontal",L=D?{x:C,y:I}:{y:C,x:I},z=this.state.formattedGraphicalItems.find(function(M){var B=M.item;return B.type.name==="Scatter"});z&&(L=H(H({},L),z.props.points[P].tooltipPosition),$=z.props.points[P].tooltipPayload);var U={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:R,activePayload:$,activeCoordinate:L};this.setState(U),this.renderCursor(k),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var b,_;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){_y([Er(w.children,Pr)],[Er(this.props.children,Pr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Er(this.props.children,Pr);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,b=S.getBoundingClientRect(),_=mK(b),O={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},k=b.width/S.offsetWidth||1,P=this.inRange(O.chartX,O.chartY,k);if(!P)return null;var R=this.state,$=R.xAxisMap,C=R.yAxisMap,I=this.getTooltipEventType(),D=fj(this.state,this.props.data,this.props.layout,P);if(I!=="axis"&&$&&C){var L=so($).scale,z=so(C).scale,U=L&&L.invert?L.invert(O.chartX):null,M=z&&z.invert?z.invert(O.chartY):null;return H(H({},O),{},{xValue:U,yValue:M},D)}return D?H(H({},O),D):null}},{key:"inRange",value:function(w,S){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,O=w/b,k=S/b;if(_==="horizontal"||_==="vertical"){var P=this.state.offset,R=O>=P.left&&O<=P.left+P.width&&k>=P.top&&k<=P.top+P.height;return R?{x:O,y:k}:null}var $=this.state,C=$.angleAxisMap,I=$.radiusAxisMap;if(C&&I){var D=so(C);return WS({x:O,y:k},D)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),b=Er(w,Pr),_={};b&&S==="axis"&&(b.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=rd(this.props,this.handleOuterEvent);return H(H({},O),_)}},{key:"addListener",value:function(){Xm.on(Ym,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Xm.removeListener(Ym,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,b){for(var _=this.state.formattedGraphicalItems,O=0,k=_.length;Oft(`/routing/list/active/${e}`)),n=t==null?void 0:t.find($=>{var C;return((C=$.algorithm_data||$.algorithm)==null?void 0:C.type)==="volume_split"}),[i,a]=j.useState([{id:hl(),name:"",split:50},{id:hl(),name:"",split:50}]),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,c]=j.useState(null),[p,h]=j.useState(null),[x,v]=j.useState(!1),[y,g]=j.useState(new Set),m=i.reduce(($,C)=>$+C.split,0);function w($,C,I){a(D=>D.map(L=>L.id===$?{...L,[C]:I}:L))}function S(){a($=>[...$,{id:hl(),name:"",split:0}])}function b($){a(C=>C.filter(I=>I.id!==$))}async function _(){if(!e)return c("Set a merchant ID first");if(!o.trim())return c("Enter a rule name");if(m!==100)return c(`Splits must sum to 100 (currently ${m})`);if(i.some($=>!$.name.trim()))return c("All gateways must have names");u(!0),c(null),h(null);try{await ft("/routing/create",{rule_id:null,name:o,description:"",created_by:e,algorithm_for:"payment",metadata:null,algorithm:{type:"volume_split",data:i.map($=>({split:$.split,output:{gateway_name:$.name.trim(),gateway_id:null}}))}}),h(`Rule "${o}" created successfully. Find it in the list below to activate.`),r(),s(""),a([{id:hl(),name:"",split:50},{id:hl(),name:"",split:50}])}catch($){c($ instanceof Error?$.message:"Failed to create rule")}finally{u(!1)}}async function O($){if(e)try{await ft("/routing/activate",{created_by:e,routing_algorithm_id:$}),r(),h("Rule activated.")}catch(C){c(C instanceof Error?C.message:"Failed to activate")}}function k($){g(C=>{const I=new Set(C);return I.has($)?I.delete($):I.add($),I})}const P=n?n.algorithm_data||n.algorithm:null,R=P&&"data"in P?P.data.map($=>{var C;return{name:((C=$.output)==null?void 0:C.gateway_name)??"?",value:$.split}}):[];return d.jsxs("div",{className:"space-y-6 max-w-4xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Volume Split Routing"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Distribute payment traffic across gateways by percentage."})]}),n&&d.jsxs(Ce,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Volume Split"}),d.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n.name})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Qt,{variant:"green",children:"Active"}),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:()=>v(!x),children:[d.jsx(_p,{size:14,className:"mr-1"}),x?"Hide":"View"]})]})]}),x&&d.jsxs(Te,{children:[d.jsx(mf,{width:"100%",height:220,children:d.jsxs(AT,{children:[d.jsx(Dn,{data:R,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:$,value:C})=>`${$}: ${C}%`,labelLine:{stroke:"#45454f"},children:R.map(($,C)=>d.jsx(Ca,{fill:mj[C%mj.length]},C))}),d.jsx(Pr,{formatter:$=>`${$}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),d.jsx(Pa,{wrapperStyle:{color:"#8e8ea0"}})]})}),d.jsxs("div",{className:"mt-4 text-xs text-slate-600",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"Rule ID:"})," ",n.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",n.created_at?new Date(n.created_at).toLocaleString():"Unknown"]})]})]})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"Create Volume Split Rule"})}),d.jsxs(Te,{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Rule Name"}),d.jsx("input",{value:o,onChange:$=>s($.target.value),placeholder:"e.g. ab-test-split",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 text-xs font-medium text-slate-500 px-1",children:[d.jsx("span",{children:"Gateway Name"}),d.jsx("span",{children:"Split %"}),d.jsx("span",{})]}),i.map($=>d.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 items-center",children:[d.jsx("input",{value:$.name,onChange:C=>w($.id,"name",C.target.value),placeholder:"e.g. stripe",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{type:"number",min:0,max:100,value:$.split,onChange:C=>w($.id,"split",Number(C.target.value)),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>b($.id),className:"text-slate-400 hover:text-red-500",children:d.jsx(ai,{size:15})})]},$.id)),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-sm text-brand-500 hover:text-brand-600",children:[d.jsx(Xi,{size:14})," Add Gateway"]}),d.jsxs("span",{className:`text-xs font-medium ${m===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",m,"%",m!==100&&" (must be 100)"]})]})]}),d.jsx(Zn,{error:f}),p&&d.jsx("p",{className:"text-sm text-emerald-400",children:p}),d.jsx(ht,{onClick:_,disabled:l||!e,children:l?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Creating…"]}):"Create Rule"})]})]}),d.jsx(Voe,{merchantId:e,onActivate:O,expandedRuleIds:y,onToggleExpand:k})]})}function Voe({merchantId:e,onActivate:t,expandedRuleIds:r,onToggleExpand:n}){const{data:i,isLoading:a}=vn(e?["routing-list",e]:null,()=>ft(`/routing/list/${e}`)),o=(i==null?void 0:i.filter(s=>{var l;return((l=s.algorithm_data||s.algorithm)==null?void 0:l.type)==="volume_split"}))??[];return e?a?d.jsx("div",{className:"flex justify-center py-4",children:d.jsx(kn,{})}):o.length?d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"Saved Volume Split Rules"})}),d.jsx(Te,{className:"p-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 uppercase tracking-wider",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2",children:"Name"}),d.jsx("th",{className:"text-left px-4 py-2",children:"Split"}),d.jsx("th",{className:"px-4 py-2"})]})}),d.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:o.map(s=>{const l=s.algorithm_data||s.algorithm,u=(l==null?void 0:l.data)||[],f=r.has(s.id);return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[d.jsx("td",{className:"px-4 py-2 font-medium text-slate-800",children:s.name}),d.jsx("td",{className:"px-4 py-2 text-slate-600 text-xs",children:u.map(c=>{var p;return`${(p=c.output)==null?void 0:p.gateway_name}:${c.split}%`}).join(" | ")}),d.jsx("td",{className:"px-4 py-2 text-right",children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsxs(ht,{size:"sm",variant:"ghost",onClick:()=>n(s.id),children:[d.jsx(_p,{size:14,className:"mr-1"}),f?"Hide":"View"]}),d.jsx(ht,{size:"sm",variant:"secondary",onClick:()=>t(s.id),children:"Activate"})]})})]},s.id),f&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"ID:"})," ",s.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Description:"})," ",s.description||"N/A"]}),s.created_at&&d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",new Date(s.created_at).toLocaleString()]}),d.jsxs("div",{children:[d.jsx("strong",{children:"Configuration:"}),d.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(l,null,2)})]})]})})})]})})})]})})]}):null:null}function Woe(){var m;const{merchantId:e}=na(),{data:t,mutate:r,isLoading:n}=vn(e?["rule-debit",e]:null,()=>ft("/rule/get",{merchant_id:e,config:{type:"debitRouting"}})),[i,a]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,c]=j.useState(null),[p,h]=j.useState(null),x=(m=t==null?void 0:t.config)==null?void 0:m.data,v=i||(x==null?void 0:x.merchant_category_code)||"",y=o||(x==null?void 0:x.acquirer_country)||"";async function g(){if(!e)return c("Set a merchant ID first");const w={merchant_id:e,config:{type:"debitRouting",data:{merchant_category_code:v.trim(),acquirer_country:y.trim()}}};u(!0),c(null);try{await ft(t?"/rule/update":"/rule/create",w),h("Debit routing config saved."),r()}catch(S){c(S instanceof Error?S.message:"Failed to save")}finally{u(!1)}}return d.jsxs("div",{className:"space-y-6 max-w-2xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Network / Debit Routing"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Configure network-based routing to optimise processing fees for debit card transactions. The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR)."})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Lk,{size:16,className:"text-brand-500"}),d.jsx("h2",{className:"font-medium text-slate-800",children:"Debit Routing Configuration"})]})}),d.jsx(Te,{className:"space-y-4",children:n?d.jsx("div",{className:"flex justify-center py-6",children:d.jsx(kn,{})}):d.jsxs(d.Fragment,{children:[!e&&d.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar to load configuration."}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Merchant Category Code (MCC)"}),d.jsx("input",{value:v,onChange:w=>a(w.target.value),placeholder:"e.g. 5411",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"4-digit ISO MCC for your business type"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Acquirer Country"}),d.jsx("input",{value:y,onChange:w=>s(w.target.value),placeholder:"e.g. US",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"ISO 3166-1 alpha-2 country code"})]})]}),d.jsx(Zn,{error:f}),p&&d.jsx("p",{className:"text-sm text-emerald-400",children:p}),d.jsx(ht,{onClick:g,disabled:l||!e,children:l?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Saving…"]}):t?"Update Config":"Save Config"})]})})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"How Network Routing Works"})}),d.jsxs(Te,{className:"text-sm text-slate-600 space-y-2",children:[d.jsx("p",{children:"For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee."}),d.jsxs("p",{children:["Supported networks: ",["VISA","MASTERCARD","ACCEL","NYCE","PULSE","STAR"].map(w=>d.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md mr-1 text-slate-700",children:w},w))]}),d.jsxs("p",{children:["Use the ",d.jsx("strong",{className:"text-slate-800",children:"Decision Explorer"})," to test network routing decisions with ",d.jsx("code",{className:"text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md text-brand-500",children:"NtwBasedRouting"})," algorithm."]})]})]})]})}const Hoe=["SR_BASED_ROUTING","PL_BASED_ROUTING","NTW_BASED_ROUTING"],Goe={SR_BASED_ROUTING:"Success Rate Based",PL_BASED_ROUTING:"Priority List Based",NTW_BASED_ROUTING:"Network Based"};function Koe(e){for(const[t,r]of Object.entries(QD))if(e.includes(t)||t.includes(e))return r;return"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8"}const dr=["#0069ED","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function yf(e=[]){return e.map(t=>t.trim()).filter(Boolean).map(t=>t.toUpperCase())}function Qm(e=[]){return Array.from(new Set(yf(e)))}function Jm(e){return e==="enum"?"enum_variant":e==="integer"?"number":e==="udf"||e==="global_ref"?"metadata_variant":"str_value"}function qoe(){const{merchantId:e}=na(),{routingKeysConfig:t,isLoading:r,error:n}=zE(),i=Object.keys(t).length>0,a=!r&&(!i||!!n),[o,s]=j.useState("single"),[l,u]=j.useState({amount:"1000",currency:"",payment_method_type:"",payment_method:"",card_brand:"",auth_type:"",eligible_gateways:"stripe, adyen",ranking_algorithm:"SR_BASED_ROUTING",elimination_enabled:!1}),[f,c]=j.useState({totalPayments:"10",successCount:"7",failureCount:"3"}),[p,h]=j.useState([{key:"payment_method_type",type:"enum_variant",value:"",metadataKey:""},{key:"currency",type:"enum_variant",value:"",metadataKey:""}]),[x,v]=j.useState([{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}]),[y,g]=j.useState("100"),[m,w]=j.useState(null),[S,b]=j.useState(null),[_,O]=j.useState([]),[k,P]=j.useState([]),[R,$]=j.useState(!1),[C,I]=j.useState(null),[D,L]=j.useState(!1),[z,U]=j.useState(!1),[M,B]=j.useState(!1),[W,J]=j.useState(!1),G=j.useMemo(()=>Object.keys(t).sort(),[t]),Q=j.useMemo(()=>{var A;return yf(((A=t.payment_method)==null?void 0:A.values)||[])},[t]),X=j.useMemo(()=>{var E;const A=l.payment_method_type.toLowerCase();return yf(((E=t[A])==null?void 0:E.values)||[])},[l.payment_method_type,t]),de=j.useMemo(()=>{var A;return Qm(((A=t.currency)==null?void 0:A.values)||[])},[t]),ue=j.useMemo(()=>{var A;return Qm(((A=t.card_network)==null?void 0:A.values)||[])},[t]),Se=j.useMemo(()=>{var A;return Qm(((A=t.authentication_type)==null?void 0:A.values)||[])},[t]);j.useEffect(()=>{a||r||(u(A=>{var V;const E={...A};de.length>0&&!de.includes(E.currency)&&(E.currency=de[0]),Q.length>0&&!Q.includes(E.payment_method_type)&&(E.payment_method_type=Q[0]);const F=yf(((V=t[E.payment_method_type.toLowerCase()])==null?void 0:V.values)||[]);return F.length>0&&!F.includes(E.payment_method)&&(E.payment_method=F[0]),Se.length>0&&!Se.includes(E.auth_type)&&(E.auth_type=Se[0]),ue.length>0&&!ue.includes(E.card_brand)&&(E.card_brand=ue[0]),E}),h(A=>A.map(E=>{if(!E.key||!t[E.key])return E;const F=t[E.key],V=Jm(F.type),q=F.values||[],Y=V==="enum_variant"?q.includes(E.value)?E.value:q[0]||"":E.value;return{...E,type:V,value:Y}})))},[a,r,t,de,Q,Se,ue]);function _e(A,E){u(F=>({...F,[A]:E}))}function te(){var q;if(G.length===0)return;const A=G[0],E=t[A],F=Jm(E==null?void 0:E.type),V=F==="enum_variant"&&((q=E==null?void 0:E.values)==null?void 0:q[0])||"";h([...p,{key:A,type:F,value:V,metadataKey:""}])}function re(A){h(p.filter((E,F)=>F!==A))}function pe(A,E,F){h(p.map((V,q)=>q===A?{...V,[E]:F}:V))}function K(A,E){h(p.map((F,V)=>V===A?{...F,metadataKey:E}:F))}function Pe(A,E){var Y;const F=t[E],V=Jm(F==null?void 0:F.type),q=V==="enum_variant"&&((Y=F==null?void 0:F.values)==null?void 0:Y[0])||"";h(p.map((ie,me)=>me===A?{...ie,key:E,type:V,value:q,metadataKey:""}:ie))}function he(){v([...x,{gateway_name:"",gateway_id:""}])}function Me(A){v(x.filter((E,F)=>F!==A))}function Be(A,E,F){v(x.map((V,q)=>q===A?{...V,[E]:F}:V))}async function ve(){if(!e)return I("Set a merchant ID in the top bar");if(a)return I("Routing key config unavailable. Fix /config/routing-keys and retry.");L(!0),I(null);const A=l.eligible_gateways.split(",").map(E=>E.trim()).filter(Boolean);try{const E=await ft("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:`explorer_${Date.now()}`,amount:parseFloat(l.amount)||1e3,currency:l.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:l.payment_method_type,paymentMethod:l.payment_method,authType:l.auth_type,cardBrand:l.card_brand},eligibleGatewayList:A,rankingAlgorithm:l.ranking_algorithm,eliminationEnabled:l.elimination_enabled});w(E)}catch(E){I(E instanceof Error?E.message:"Request failed")}finally{L(!1)}}async function Ae(){if(!e)return I("Set a merchant ID in the top bar");if(a)return I("Routing key config unavailable. Fix /config/routing-keys and retry.");const A=parseInt(f.totalPayments)||0,E=parseInt(f.successCount)||0,F=parseInt(f.failureCount)||0;if(A<=0)return I("Total Payments must be greater than 0");if(E+F!==A)return I("Success + Failure count must equal Total Payments");$(!0),I(null),P([]);const V=l.eligible_gateways.split(",").map(ie=>ie.trim()).filter(Boolean),q=[],Y=[...Array(E).fill("CHARGED"),...Array(F).fill("FAILURE")];for(let ie=Y.length-1;ie>0;ie--){const me=Math.floor(Math.random()*(ie+1));[Y[ie],Y[me]]=[Y[me],Y[ie]]}try{for(let ie=0;ie{F.key&&(F.type==="metadata_variant"?A[F.key]={type:F.type,value:{key:F.metadataKey||F.key,value:F.value}}:F.type==="number"?A[F.key]={type:F.type,value:parseFloat(F.value)||0}:A[F.key]={type:F.type,value:F.value})});const E=await ft("/routing/evaluate",{created_by:e||"test_user",fallback_output:x.filter(F=>F.gateway_name),parameters:A});if(b(E),E.output.type==="volume_split"&&E.output.splits){const F=parseInt(y)||100,V=E.output.splits.map(q=>({name:q.connector.gateway_name,count:Math.round(q.split/100*F),percentage:q.split}));O(V)}}catch(A){I(A instanceof Error?A.message:"Request failed")}finally{L(!1)}}async function Oe(){L(!0),I(null),O([]);try{const A=await ft("/routing/evaluate",{created_by:e||"test_user",fallback_output:[{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}],parameters:{}});if(b(A),A.output.type==="volume_split"&&A.output.splits){const E=parseInt(y)||100,F=A.output.splits.map(V=>({name:V.connector.gateway_name,count:Math.round(V.split/100*E),percentage:V.split}));O(F)}}catch(A){I(A instanceof Error?A.message:"Request failed")}finally{L(!1)}}const He=m!=null&&m.gateway_priority_map?Object.entries(m.gateway_priority_map).sort(([,A],[,E])=>E-A).map(([A,E])=>({name:A,score:Math.round(E*1e3)/10})):[],Ue=k.reduce((A,E)=>(A[E.decidedGateway]||(A[E.decidedGateway]={total:0,success:0,failure:0}),A[E.decidedGateway].total++,E.status==="CHARGED"?A[E.decidedGateway].success++:A[E.decidedGateway].failure++,A),{}),T=_.map(A=>({name:A.name,value:A.count}));return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Decision Explorer"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split."})]}),d.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-[#1c1c24]",children:[d.jsx("button",{onClick:()=>s("single"),className:`px-4 py-2 text-sm font-medium ${o==="single"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Single Test"}),d.jsx("button",{onClick:()=>s("batch"),className:`px-4 py-2 text-sm font-medium ${o==="batch"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Batch Simulation"}),d.jsx("button",{onClick:()=>s("rule"),className:`px-4 py-2 text-sm font-medium ${o==="rule"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Rule-Based"}),d.jsx("button",{onClick:()=>s("volume"),className:`px-4 py-2 text-sm font-medium ${o==="volume"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Volume Split"})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:o==="rule"?"Rule Evaluation Parameters":o==="volume"?"Volume Split Configuration":"Payment Parameters"})}),d.jsxs(Te,{className:"space-y-3",children:[!e&&o!=="volume"&&d.jsx("p",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar first."}),o!=="volume"&&r&&d.jsx("p",{className:"text-xs text-slate-600 bg-slate-50 border border-slate-200 rounded px-3 py-2",children:"Loading routing config from backend..."}),o!=="volume"&&a&&d.jsx(Zn,{error:"Routing config unavailable from /config/routing-keys. Parameter forms are disabled."}),o==="rule"?d.jsxs(d.Fragment,{children:[r&&d.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),a&&d.jsx(Zn,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Evaluation is disabled."}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Parameters"}),d.jsx("div",{className:"space-y-2",children:p.map((A,E)=>{var F;return d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("select",{value:A.key,onChange:V=>Pe(E,V.target.value),disabled:a||r,className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:G.length===0?d.jsx("option",{value:"",children:"No keys available"}):G.map(V=>d.jsx("option",{value:V,children:V},V))}),d.jsx("input",{value:A.type,readOnly:!0,className:"w-36 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>re(E),className:"p-1.5 text-slate-400 hover:text-red-500",children:d.jsx(ai,{size:14})})]}),A.type==="metadata_variant"?d.jsxs("div",{className:"flex gap-2 items-center pl-1",children:[d.jsx("input",{placeholder:"Metadata Key",value:A.metadataKey||"",onChange:V=>K(E,V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{placeholder:"Metadata Value",value:A.value,onChange:V=>pe(E,"value",V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}):A.type==="enum_variant"?d.jsx("div",{className:"flex gap-2 items-center pl-1",children:d.jsx("select",{value:A.value,onChange:V=>pe(E,"value",V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(((F=t[A.key])==null?void 0:F.values)||[]).map(V=>d.jsx("option",{value:V,children:V},V))})}):A.type==="number"?d.jsx("div",{className:"flex gap-2 items-center pl-1",children:d.jsx("input",{type:"number",placeholder:"Value",value:A.value,onChange:V=>pe(E,"value",V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})}):d.jsx("div",{className:"flex gap-2 items-center pl-1",children:d.jsx("input",{placeholder:"Value",value:A.value,onChange:V=>pe(E,"value",V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})})]},E)})}),d.jsxs("button",{onClick:te,disabled:a||r||G.length===0,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[d.jsx(Xi,{size:12})," Add Parameter"]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Fallback gateway_name/gateway_id"}),d.jsx("div",{className:"space-y-2",children:x.map((A,E)=>d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("input",{placeholder:"gateway_name",value:A.gateway_name,onChange:F=>Be(E,"gateway_name",F.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{placeholder:"gateway_id",value:A.gateway_id||"",onChange:F=>Be(E,"gateway_id",F.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>Me(E),className:"p-1.5 text-slate-400 hover:text-red-500",children:d.jsx(ai,{size:14})})]},E))}),d.jsxs("button",{onClick:he,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[d.jsx(Xi,{size:12})," Add Gateway"]})]})]}):o==="volume"?d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Number of Payments"}),d.jsx("input",{type:"text",value:y,onChange:A=>g(A.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Enter the total number of payments to visualize how they would be distributed across gateways."})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Amount"}),d.jsx("input",{value:l.amount,onChange:A=>_e("amount",A.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Currency"}),d.jsx("select",{value:l.currency,onChange:A=>_e("currency",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:de.map(A=>d.jsx("option",{children:A},A))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method Type"}),d.jsx("select",{value:l.payment_method_type,onChange:A=>_e("payment_method_type",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Q.map(A=>d.jsx("option",{children:A},A))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method"}),d.jsx("select",{value:l.payment_method,onChange:A=>_e("payment_method",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:X.map(A=>d.jsx("option",{children:A},A))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Card Brand"}),d.jsx("select",{value:l.card_brand,onChange:A=>_e("card_brand",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:ue.map(A=>d.jsx("option",{children:A},A))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Auth Type"}),d.jsx("select",{value:l.auth_type,onChange:A=>_e("auth_type",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Se.map(A=>d.jsx("option",{children:A},A))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Eligible Gateways (comma-separated)"}),d.jsx("input",{value:l.eligible_gateways,onChange:A=>_e("eligible_gateways",A.target.value),placeholder:"stripe, adyen",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Algorithm"}),d.jsx("select",{value:l.ranking_algorithm,onChange:A=>_e("ranking_algorithm",A.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Hoe.map(A=>d.jsx("option",{value:A,children:Goe[A]},A))})]}),d.jsx("div",{className:"flex items-end pb-1",children:d.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:l.elimination_enabled,onChange:A=>_e("elimination_enabled",A.target.checked),className:"rounded"}),"Elimination enabled"]})})]}),o==="batch"&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-4 mt-4 space-y-3",children:[d.jsxs("h3",{className:"text-sm font-medium text-slate-800 flex items-center gap-2",children:[d.jsx(Jh,{size:14}),"Simulation Configuration"]}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Total Payments"}),d.jsx("input",{type:"text",value:f.totalPayments,onChange:A=>c(E=>({...E,totalPayments:A.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Success Count"}),d.jsx("input",{type:"text",value:f.successCount,onChange:A=>c(E=>({...E,successCount:A.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Failure Count"}),d.jsx("input",{type:"text",value:f.failureCount,onChange:A=>c(E=>({...E,failureCount:A.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),d.jsxs("p",{className:"text-xs text-slate-500",children:["Will run ",f.totalPayments||0," payments: ",f.successCount||0," SUCCESS, ",f.failureCount||0," FAILURE"]})]})]}),d.jsx(Zn,{error:C}),o==="rule"?d.jsx(ht,{onClick:$e,disabled:D||a,className:"w-full justify-center",children:D?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Evaluating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Mc,{size:14})," Evaluate Rules"]})}):o==="volume"?d.jsx(ht,{onClick:Oe,disabled:D,className:"w-full justify-center",children:D?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Calculating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Wf,{size:14})," Visualize Distribution"]})}):o==="batch"?d.jsx(ht,{onClick:Ae,disabled:R||!e||a,className:"w-full justify-center",children:R?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14}),"Simulating ",k.length,"/",f.totalPayments||0,"..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Jh,{size:14})," Run Batch Simulation"]})}):d.jsx(ht,{onClick:ve,disabled:D||!e||a,className:"w-full justify-center",children:D?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Running…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Mc,{size:14})," Run Decision"]})})]})]}),d.jsx("div",{className:"space-y-4",children:o==="volume"?_.length>0?d.jsxs(d.Fragment,{children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Volume Distribution Overview"})}),d.jsxs(Te,{children:[d.jsxs("div",{className:"text-center mb-4",children:[d.jsx("p",{className:"text-3xl font-bold text-slate-900",children:y}),d.jsx("p",{className:"text-xs text-slate-500",children:"Total Payments"})]}),d.jsx("div",{className:"grid grid-cols-2 gap-4",children:_.map((A,E)=>d.jsxs("div",{className:"bg-slate-50 dark:bg-[#111114] rounded-lg p-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:dr[E%dr.length]}}),d.jsx("span",{className:"font-medium text-sm",children:A.name})]}),d.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[d.jsxs("span",{children:[A.percentage,"%"]}),d.jsxs("span",{className:"font-medium text-slate-700",children:[A.count," payments"]})]})]},E))})]})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Pie Chart"})}),d.jsx(Te,{children:d.jsx(mf,{width:"100%",height:250,children:d.jsxs(AT,{children:[d.jsx(Dn,{data:T,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:A,percent:E})=>`${A} ${(E*100).toFixed(0)}%`,labelLine:!1,children:T.map((A,E)=>d.jsx(Ca,{fill:dr[E%dr.length]},`cell-${E}`))}),d.jsx(Pr,{formatter:A=>[`${A} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}})]})})})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Bar Chart"})}),d.jsx(Te,{children:d.jsx(mf,{width:"100%",height:_.length*50+40,children:d.jsxs(hj,{data:_,layout:"vertical",margin:{left:20,right:40},children:[d.jsx(qu,{type:"number",tick:{fontSize:12,fill:"#666"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),d.jsx(Xu,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#666"},width:80,axisLine:!1,tickLine:!1}),d.jsx(Pr,{formatter:A=>[`${A} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}}),d.jsx(Ji,{dataKey:"count",radius:[0,6,6,0],children:_.map((A,E)=>d.jsx(Ca,{fill:dr[E%dr.length]},`cell-${E}`))})]})})})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Percentage Distribution"})}),d.jsxs(Te,{children:[d.jsx("div",{className:"h-4 rounded-full overflow-hidden flex",children:_.map((A,E)=>d.jsx("div",{style:{width:`${A.percentage}%`,backgroundColor:dr[E%dr.length]},className:"h-full transition-all duration-300",title:`${A.name}: ${A.percentage}%`},E))}),d.jsx("div",{className:"flex flex-wrap gap-3 mt-3",children:_.map((A,E)=>d.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[d.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:dr[E%dr.length]}}),d.jsx("span",{className:"text-slate-600",children:A.name}),d.jsxs("span",{className:"font-medium",children:[A.percentage,"%"]})]},E))})]})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Summary"})}),d.jsx(Te,{className:"p-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"}),d.jsx("th",{className:"text-right px-4 py-2",children:"Payments"}),d.jsx("th",{className:"text-right px-4 py-2",children:"Percentage"})]})}),d.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:[_.map((A,E)=>d.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[d.jsx("td",{className:"px-4 py-2",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:dr[E%dr.length]}}),d.jsx("span",{className:"font-medium",children:A.name})]})}),d.jsx("td",{className:"px-4 py-2 text-right font-medium",children:A.count}),d.jsxs("td",{className:"px-4 py-2 text-right text-slate-500",children:[A.percentage,"%"]})]},E)),d.jsxs("tr",{className:"bg-slate-50 dark:bg-[#111114] font-medium",children:[d.jsx("td",{className:"px-4 py-2",children:"Total"}),d.jsx("td",{className:"px-4 py-2 text-right",children:y}),d.jsx("td",{className:"px-4 py-2 text-right",children:"100%"})]})]})]})})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Payment Log"})}),d.jsx(Te,{className:"p-0 max-h-80 overflow-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500 sticky top-0",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2 w-20",children:"#"}),d.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"})]})}),d.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:Array.from({length:parseInt(y)||0}).map((A,E)=>{var Y;let F=0,V=((Y=_[0])==null?void 0:Y.name)||"",q=0;for(let ie=0;ie<_.length;ie++)if(F+=_[ie].count,EJ(A=>!A),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(em,{size:14}),"API Response"]}),W?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),W&&S&&d.jsx(Te,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(S,null,2)})})]})]}):d.jsx(Ce,{children:d.jsxs(Te,{className:"py-16 text-center",children:[d.jsx(Wf,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Enter the number of payments and click "Visualize Distribution" to see how payments are split across gateways.'})]})}):o==="rule"?S?d.jsxs(d.Fragment,{children:[d.jsx(Ce,{children:d.jsxs(Te,{children:[d.jsx("div",{className:"flex items-start justify-between mb-3",children:d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Status"}),d.jsx("p",{className:"text-2xl font-bold text-slate-900",children:S.status}),d.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["output_type: ",S.output.type]})]})}),S.output.type==="single"&&S.output.connector&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Selected gateway_name"}),d.jsx("p",{className:"text-lg font-semibold",children:S.output.connector.gateway_name}),S.output.connector.gateway_id&&d.jsxs("p",{className:"text-xs text-slate-500",children:["gateway_id: ",S.output.connector.gateway_id]})]}),S.output.type==="priority"&&S.output.connectors&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Priority gateway_name list"}),d.jsx("div",{className:"space-y-1",children:S.output.connectors.map((A,E)=>d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-500 text-white text-xs flex items-center justify-center",children:E+1}),d.jsx("span",{className:"font-medium",children:A.gateway_name}),A.gateway_id&&d.jsxs("span",{className:"text-xs text-slate-500",children:["(",A.gateway_id,")"]})]},E))})]}),S.output.type==="volume_split"&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Volume Split Result"}),d.jsx("p",{className:"text-sm text-slate-600",children:"See Volume Split tab for detailed visualization."})]})]})}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>B(A=>!A),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(em,{size:14}),"API Response"]}),M?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),M&&d.jsx(Te,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(S,null,2)})})]})]}):d.jsx(Ce,{children:d.jsxs(Te,{className:"py-16 text-center",children:[d.jsx(Mc,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Configure rule parameters and click "Evaluate Rules" to test routing.'})]})}):o==="batch"?k.length>0?d.jsxs(d.Fragment,{children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Simulation Progress"})}),d.jsxs(Te,{children:[d.jsxs("div",{className:"mb-4",children:[d.jsxs("div",{className:"flex justify-between text-xs text-slate-600 mb-1",children:[d.jsx("span",{children:"Progress"}),d.jsxs("span",{children:[Math.round(k.length/(parseInt(f.totalPayments)||1)*100),"%"]})]}),d.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:d.jsx("div",{className:"bg-brand-500 h-2 rounded-full transition-all duration-300",style:{width:`${k.length/(parseInt(f.totalPayments)||1)*100}%`}})})]}),Object.keys(Ue).length>0&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-xs font-medium text-slate-700",children:"Gateway Selection Summary"}),Object.entries(Ue).map(([A,E])=>d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"font-medium",children:A}),d.jsxs("div",{className:"flex gap-3 text-xs",children:[d.jsxs("span",{className:"text-emerald-600",children:[E.success," ✓"]}),d.jsxs("span",{className:"text-red-500",children:[E.failure," ✗"]}),d.jsxs("span",{className:"text-slate-500",children:["(",E.total," total)"]})]})]},A))]})]})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Transaction Log"})}),d.jsx(Te,{className:"p-0 max-h-96 overflow-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 sticky top-0",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-3 py-2",children:"#"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Payment ID"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Gateway"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Outcome"})]})}),d.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:k.map((A,E)=>d.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16]",children:[d.jsx("td",{className:"px-3 py-2 text-slate-500",children:E+1}),d.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:A.paymentId.slice(-8)}),d.jsx("td",{className:"px-3 py-2 font-medium",children:A.decidedGateway}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(Qt,{variant:A.status==="CHARGED"?"green":"red",children:A.status})})]},A.paymentId))})]})})]})]}):d.jsx(Ce,{children:d.jsxs(Te,{className:"py-16 text-center",children:[d.jsx(Jh,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.'})]})}):m?d.jsxs(d.Fragment,{children:[d.jsx(Ce,{children:d.jsxs(Te,{children:[d.jsxs("div",{className:"flex items-start justify-between mb-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Decided Gateway"}),d.jsx("p",{className:"text-3xl font-bold text-slate-900",children:m.decided_gateway})]}),d.jsxs("div",{className:"text-right space-y-1",children:[d.jsx("div",{children:d.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Koe(m.routing_approach)}`,children:m.routing_approach})}),m.is_scheduled_outage&&d.jsx(Qt,{variant:"red",children:"Scheduled Outage"}),m.latency!=null&&d.jsxs("p",{className:"text-xs text-slate-400",children:[m.latency,"ms"]})]})]}),m.routing_dimension&&d.jsxs("div",{className:"flex gap-4 text-sm text-slate-600 border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Dimension"}),d.jsx("p",{className:"font-medium",children:m.routing_dimension})]}),m.routing_dimension_level&&d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Level"}),d.jsx("p",{className:"font-medium",children:m.routing_dimension_level})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Reset"}),d.jsx("p",{className:"font-medium",children:m.reset_approach})]})]})]})}),He.length>0&&d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Scores"}),d.jsxs(ht,{size:"sm",variant:"ghost",onClick:ve,className:"text-xs",children:[d.jsx(AI,{size:12})," Refresh"]})]})}),d.jsx(Te,{children:d.jsx(mf,{width:"100%",height:He.length*40+20,children:d.jsxs(hj,{data:He,layout:"vertical",margin:{left:10,right:30},children:[d.jsx(qu,{type:"number",domain:[0,100],tickFormatter:A=>`${A}%`,tick:{fontSize:11,fill:"#66667a"},axisLine:{stroke:"#1c1c24"},tickLine:!1}),d.jsx(Xu,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#8e8ea0"},width:60,axisLine:!1,tickLine:!1}),d.jsx(Pr,{formatter:A=>`${A}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),d.jsx(Ji,{dataKey:"score",radius:[0,4,4,0],children:He.map((A,E)=>d.jsx(Ca,{fill:A.name===m.decided_gateway?"#0069ED":A.score<30?"#ef4444":A.score<60?"#f59e0b":"#10b981"},E))})]})})})]}),m.filter_wise_gateways&&d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>U(A=>!A),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:["Filter Chain",z?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),z&&d.jsx(Te,{className:"space-y-2",children:Object.entries(m.filter_wise_gateways).map(([A,E])=>d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("span",{className:"text-xs font-mono bg-slate-100 dark:bg-[#111118] text-slate-600 rounded-md px-2 py-0.5 mt-0.5 shrink-0 border border-slate-200 dark:border-[#1c1c24]",children:A}),d.jsx("div",{className:"flex flex-wrap gap-1",children:Array.isArray(E)?E.map(F=>d.jsx("span",{className:"text-xs bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20 rounded-md px-2 py-0.5",children:F},F)):d.jsx("span",{className:"text-xs text-slate-400",children:"—"})})]},A))})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>B(A=>!A),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(em,{size:14}),"API Response"]}),M?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),M&&d.jsx(Te,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(m,null,2)})})]})]}):d.jsx(Ce,{children:d.jsxs(Te,{className:"py-16 text-center",children:[d.jsx(Mc,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Fill in the parameters and click "Run Decision" to see the routing result.'})]})})})]})]})}function Xoe(){return d.jsx(XR,{children:d.jsxs(_n,{element:d.jsx(hM,{}),children:[d.jsx(_n,{index:!0,element:d.jsx(KM,{})}),d.jsx(_n,{path:"routing",element:d.jsx(qM,{})}),d.jsx(_n,{path:"routing/sr",element:d.jsx(nL,{})}),d.jsx(_n,{path:"routing/rules",element:d.jsx(Z4,{})}),d.jsx(_n,{path:"routing/volume",element:d.jsx(Uoe,{})}),d.jsx(_n,{path:"routing/debit",element:d.jsx(Woe,{})}),d.jsx(_n,{path:"decisions",element:d.jsx(qoe,{})}),d.jsx(_n,{path:"*",element:d.jsx(GR,{to:".",replace:!0})})]})})}class Yoe extends j.Component{constructor(){super(...arguments);ub(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(r){return{error:r,errorInfo:null}}componentDidCatch(r,n){console.log(` +`+"!".repeat(80)),console.log("[ERROR BOUNDARY] Component Error Caught"),console.log(`Timestamp: ${new Date().toISOString()}`),console.log("Error Message:",r.message),console.log("Error Stack:",r.stack),console.log("Component Stack:",n.componentStack),console.log("!".repeat(80)+` +`),this.setState({errorInfo:n})}render(){return this.state.error?d.jsxs("div",{style:{padding:32,fontFamily:"monospace",color:"red"},children:[d.jsx("h2",{children:"Dashboard Error"}),d.jsx("pre",{children:this.state.error.message}),d.jsx("pre",{children:this.state.error.stack}),this.state.errorInfo&&d.jsxs("pre",{style:{marginTop:16,color:"darkred"},children:["Component Stack:",this.state.errorInfo.componentStack]})]}):this.props.children}}console.log(` +`+"=".repeat(80));console.log("[APP STARTUP] Dashboard initializing...");console.log(`Timestamp: ${new Date().toISOString()}`);console.log("Environment: production");console.log("Base URL: /dashboard");console.log("=".repeat(80)+` +`);window.onerror=(e,t,r,n,i)=>{console.log(` +`+"!".repeat(80)),console.log("[WINDOW ERROR]"),console.log("Message:",e),console.log("Source:",t),console.log("Line:",r,"Column:",n),i&&(console.log("Error:",i.message),console.log("Stack:",i.stack)),console.log("!".repeat(80)+` +`)};window.onunhandledrejection=e=>{console.log(` +`+"!".repeat(80)),console.log("[UNHANDLED PROMISE REJECTION]"),console.log("Reason:",e.reason),e.reason instanceof Error&&console.log("Stack:",e.reason.stack),console.log("!".repeat(80)+` +`)};ev.createRoot(document.getElementById("root")).render(d.jsx(N.StrictMode,{children:d.jsx(Yoe,{children:d.jsx(nI,{basename:"/dashboard",children:d.jsx(Xoe,{})})})})); diff --git a/website/dist/assets/index-CT0UhhRt.js b/website/dist/assets/index-CT0UhhRt.js deleted file mode 100644 index 8ba1cad5..00000000 --- a/website/dist/assets/index-CT0UhhRt.js +++ /dev/null @@ -1,328 +0,0 @@ -var ST=Object.defineProperty;var OT=(e,t,r)=>t in e?ST(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ob=(e,t,r)=>OT(e,typeof t!="symbol"?t+"":t,r);function jT(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var gc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pj={exports:{}},tp={},hj={exports:{}},$e={};/** - * @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 Qu=Symbol.for("react.element"),AT=Symbol.for("react.portal"),ET=Symbol.for("react.fragment"),kT=Symbol.for("react.strict_mode"),PT=Symbol.for("react.profiler"),CT=Symbol.for("react.provider"),TT=Symbol.for("react.context"),NT=Symbol.for("react.forward_ref"),$T=Symbol.for("react.suspense"),RT=Symbol.for("react.memo"),IT=Symbol.for("react.lazy"),sb=Symbol.iterator;function MT(e){return e===null||typeof e!="object"?null:(e=sb&&e[sb]||e["@@iterator"],typeof e=="function"?e:null)}var mj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vj=Object.assign,yj={};function Ss(e,t,r){this.props=e,this.context=t,this.refs=yj,this.updater=r||mj}Ss.prototype.isReactComponent={};Ss.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ss.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gj(){}gj.prototype=Ss.prototype;function Wg(e,t,r){this.props=e,this.context=t,this.refs=yj,this.updater=r||mj}var Hg=Wg.prototype=new gj;Hg.constructor=Wg;vj(Hg,Ss.prototype);Hg.isPureReactComponent=!0;var lb=Array.isArray,xj=Object.prototype.hasOwnProperty,Gg={current:null},bj={key:!0,ref:!0,__self:!0,__source:!0};function wj(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)xj.call(t,n)&&!bj.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,W=R[q];if(0>>1;qi(Ae,L))xei(We,Ae)?(R[q]=We,R[xe]=L,q=xe):(R[q]=Ae,R[he]=L,q=he);else if(xei(We,L))R[q]=We,R[xe]=L,q=xe;else break e}}return F}function i(R,F){var L=R.sortIndex-F.sortIndex;return L!==0?L:R.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,c=null,p=3,h=!1,b=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(R){for(var F=r(u);F!==null;){if(F.callback===null)n(u);else if(F.startTime<=R)n(u),F.sortIndex=F.expirationTime,t(l,F);else break;F=r(u)}}function S(R){if(v=!1,w(R),!b)if(r(l)!==null)b=!0,V(x);else{var F=r(u);F!==null&&U(S,F.startTime-R)}}function x(R,F){b=!1,v&&(v=!1,y(A),A=-1),h=!0;var L=p;try{for(w(F),c=r(l);c!==null&&(!(c.expirationTime>F)||R&&!N());){var q=c.callback;if(typeof q=="function"){c.callback=null,p=c.priorityLevel;var W=q(c.expirationTime<=F);F=e.unstable_now(),typeof W=="function"?c.callback=W:c===r(l)&&n(l),w(F)}else n(l);c=r(l)}if(c!==null)var Y=!0;else{var he=r(u);he!==null&&U(S,he.startTime-F),Y=!1}return Y}finally{c=null,p=L,h=!1}}var _=!1,O=null,A=-1,E=5,$=-1;function N(){return!(e.unstable_now()-$R||125q?(R.sortIndex=L,t(u,R),r(l)===null&&R===r(u)&&(v?(y(A),A=-1):v=!0,U(S,L-q))):(R.sortIndex=W,t(l,R),b||h||(b=!0,V(x))),R},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(R){var F=p;return function(){var L=p;p=F;try{return R.apply(this,arguments)}finally{p=L}}}})(Aj);jj.exports=Aj;var qT=jj.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 XT=j,Rr=qT;function X(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qm=Object.prototype.hasOwnProperty,YT=/^[: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]*$/,cb={},fb={};function ZT(e){return Qm.call(fb,e)?!0:Qm.call(cb,e)?!1:YT.test(e)?fb[e]=!0:(cb[e]=!0,!1)}function QT(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function JT(e,t,r,n){if(t===null||typeof t>"u"||QT(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ht[e]=new fr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ht[t]=new fr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ht[e]=new fr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ht[e]=new fr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ht[e]=new fr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ht[e]=new fr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ht[e]=new fr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ht[e]=new fr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ht[e]=new fr(e,5,!1,e.toLowerCase(),null,!1,!1)});var qg=/[\-:]([a-z])/g;function Xg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(qg,Xg);Ht[t]=new fr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(qg,Xg);Ht[t]=new fr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(qg,Xg);Ht[t]=new fr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ht[e]=new fr(e,1,!1,e.toLowerCase(),null,!1,!1)});Ht.xlinkHref=new fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ht[e]=new fr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Yg(e,t,r,n){var i=Ht.hasOwnProperty(t)?Ht[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Eh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ml(e):""}function eN(e){switch(e.tag){case 5:return ml(e.type);case 16:return ml("Lazy");case 13:return ml("Suspense");case 19:return ml("SuspenseList");case 0:case 2:case 15:return e=kh(e.type,!1),e;case 11:return e=kh(e.type.render,!1),e;case 1:return e=kh(e.type,!0),e;default:return""}}function rv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case lo:return"Fragment";case so:return"Portal";case Jm:return"Profiler";case Zg:return"StrictMode";case ev:return"Suspense";case tv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pj:return(e.displayName||"Context")+".Consumer";case kj:return(e._context.displayName||"Context")+".Provider";case Qg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jg:return t=e.displayName||null,t!==null?t:rv(e.type)||"Memo";case wi:t=e._payload,e=e._init;try{return rv(e(t))}catch{}}return null}function tN(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rv(t);case 8:return t===Zg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Gi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rN(e){var t=Tj(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wc(e){e._valueTracker||(e._valueTracker=rN(e))}function Nj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Tj(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function yf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function nv(e,t){var r=t.checked;return yt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function pb(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Gi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $j(e,t){t=t.checked,t!=null&&Yg(e,"checked",t,!1)}function iv(e,t){$j(e,t);var r=Gi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?av(e,t.type,r):t.hasOwnProperty("defaultValue")&&av(e,t.type,Gi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hb(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function av(e,t,r){(t!=="number"||yf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var vl=Array.isArray;function Eo(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=_c.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ol={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},nN=["Webkit","ms","Moz","O"];Object.keys(Ol).forEach(function(e){nN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ol[t]=Ol[e]})});function Dj(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ol.hasOwnProperty(e)&&Ol[e]?(""+t).trim():t+"px"}function Lj(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Dj(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var iN=yt({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 lv(e,t){if(t){if(iN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function uv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cv=null;function e0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fv=null,ko=null,Po=null;function yb(e){if(e=tc(e)){if(typeof fv!="function")throw Error(X(280));var t=e.stateNode;t&&(t=op(t),fv(e.stateNode,e.type,t))}}function Bj(e){ko?Po?Po.push(e):Po=[e]:ko=e}function Fj(){if(ko){var e=ko,t=Po;if(Po=ko=null,yb(e),t)for(e=0;e>>=0,e===0?32:31-(mN(e)/vN|0)|0}var Sc=64,Oc=4194304;function yl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wf(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=yl(s):(a&=o,a!==0&&(n=yl(a)))}else o=r&~i,o!==0?n=yl(o):a!==0&&(n=yl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Ju(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=r}function bN(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Al),Ab=" ",Eb=!1;function oA(e,t){switch(e){case"keyup":return qN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uo=!1;function YN(e,t){switch(e){case"compositionend":return sA(t);case"keypress":return t.which!==32?null:(Eb=!0,Ab);case"textInput":return e=t.data,e===Ab&&Eb?null:e;default:return null}}function ZN(e,t){if(uo)return e==="compositionend"||!l0&&oA(e,t)?(e=iA(),af=a0=Ci=null,uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Tb(r)}}function fA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dA(){for(var e=window,t=yf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yf(e.document)}return t}function u0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function o$(e){var t=dA(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&fA(r.ownerDocument.documentElement,r)){if(n!==null&&u0(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=Nb(r,a);var o=Nb(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,co=null,yv=null,kl=null,gv=!1;function $b(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;gv||co==null||co!==yf(n)||(n=co,"selectionStart"in n&&u0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),kl&&Zl(kl,n)||(kl=n,n=Of(yv,"onSelect"),0ho||(e.current=Ov[ho],Ov[ho]=null,ho--)}function nt(e,t){ho++,Ov[ho]=e.current,e.current=t}var Ki={},nr=ea(Ki),gr=ea(!1),Na=Ki;function Fo(e,t){var r=e.type.contextTypes;if(!r)return Ki;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xr(e){return e=e.childContextTypes,e!=null}function Af(){ut(gr),ut(nr)}function Fb(e,t,r){if(nr.current!==Ki)throw Error(X(168));nt(nr,t),nt(gr,r)}function wA(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(X(108,tN(e)||"Unknown",i));return yt({},r,n)}function Ef(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ki,Na=nr.current,nt(nr,e),nt(gr,gr.current),!0}function zb(e,t,r){var n=e.stateNode;if(!n)throw Error(X(169));r?(e=wA(e,t,Na),n.__reactInternalMemoizedMergedChildContext=e,ut(gr),ut(nr),nt(nr,e)):ut(gr),nt(gr,r)}var Un=null,sp=!1,Uh=!1;function _A(e){Un===null?Un=[e]:Un.push(e)}function g$(e){sp=!0,_A(e)}function ta(){if(!Uh&&Un!==null){Uh=!0;var e=0,t=Ge;try{var r=Un;for(Ge=1;e>=o,i-=o,Wn=1<<32-pn(t)+i|r<A?(E=O,O=null):E=O.sibling;var $=p(y,O,w[A],S);if($===null){O===null&&(O=E);break}e&&O&&$.alternate===null&&t(y,O),m=a($,m,A),_===null?x=$:_.sibling=$,_=$,O=E}if(A===w.length)return r(y,O),ct&&da(y,A),x;if(O===null){for(;AA?(E=O,O=null):E=O.sibling;var N=p(y,O,$.value,S);if(N===null){O===null&&(O=E);break}e&&O&&N.alternate===null&&t(y,O),m=a(N,m,A),_===null?x=N:_.sibling=N,_=N,O=E}if($.done)return r(y,O),ct&&da(y,A),x;if(O===null){for(;!$.done;A++,$=w.next())$=c(y,$.value,S),$!==null&&(m=a($,m,A),_===null?x=$:_.sibling=$,_=$);return ct&&da(y,A),x}for(O=n(y,O);!$.done;A++,$=w.next())$=h(O,y,A,$.value,S),$!==null&&(e&&$.alternate!==null&&O.delete($.key===null?A:$.key),m=a($,m,A),_===null?x=$:_.sibling=$,_=$);return e&&O.forEach(function(P){return t(y,P)}),ct&&da(y,A),x}function g(y,m,w,S){if(typeof w=="object"&&w!==null&&w.type===lo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case bc:e:{for(var x=w.key,_=m;_!==null;){if(_.key===x){if(x=w.type,x===lo){if(_.tag===7){r(y,_.sibling),m=i(_,w.props.children),m.return=y,y=m;break e}}else if(_.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===wi&&Wb(x)===_.type){r(y,_.sibling),m=i(_,w.props),m.ref=el(y,_,w),m.return=y,y=m;break e}r(y,_);break}else t(y,_);_=_.sibling}w.type===lo?(m=Ea(w.props.children,y.mode,S,w.key),m.return=y,y=m):(S=pf(w.type,w.key,w.props,null,y.mode,S),S.ref=el(y,m,w),S.return=y,y=S)}return o(y);case so:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){r(y,m.sibling),m=i(m,w.children||[]),m.return=y,y=m;break e}else{r(y,m);break}else t(y,m);m=m.sibling}m=Yh(w,y.mode,S),m.return=y,y=m}return o(y);case wi:return _=w._init,g(y,m,_(w._payload),S)}if(vl(w))return b(y,m,w,S);if(Xs(w))return v(y,m,w,S);Tc(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(r(y,m.sibling),m=i(m,w),m.return=y,y=m):(r(y,m),m=Xh(w,y.mode,S),m.return=y,y=m),o(y)):r(y,m)}return g}var Uo=AA(!0),EA=AA(!1),Cf=ea(null),Tf=null,yo=null,p0=null;function h0(){p0=yo=Tf=null}function m0(e){var t=Cf.current;ut(Cf),e._currentValue=t}function Ev(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function To(e,t){Tf=e,p0=yo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mr=!0),e.firstContext=null)}function Zr(e){var t=e._currentValue;if(p0!==e)if(e={context:e,memoizedValue:t,next:null},yo===null){if(Tf===null)throw Error(X(308));yo=e,Tf.dependencies={lanes:0,firstContext:e}}else yo=yo.next=e;return t}var xa=null;function v0(e){xa===null?xa=[e]:xa.push(e)}function kA(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,v0(t)):(r.next=i.next,i.next=r),t.interleaved=r,ri(e,n)}function ri(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var _i=!1;function y0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function PA(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Li(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,De&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ri(e,r)}return i=n.interleaved,i===null?(t.next=t,v0(n)):(t.next=i.next,i.next=t),n.interleaved=t,ri(e,r)}function sf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,r0(e,r)}}function Hb(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Nf(e,t,r,n){var i=e.updateQueue;_i=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var c=i.baseState;o=0,f=u=l=null,s=a;do{var p=s.lane,h=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var b=e,v=s;switch(p=t,h=r,v.tag){case 1:if(b=v.payload,typeof b=="function"){c=b.call(h,c,p);break e}c=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=v.payload,p=typeof b=="function"?b.call(h,c,p):b,p==null)break e;c=yt({},c,p);break e;case 2:_i=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,l=c):f=f.next=h,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Ia|=o,e.lanes=o,e.memoizedState=c}}function Gb(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Wh.transition;Wh.transition={};try{e(!1),t()}finally{Ge=r,Wh.transition=n}}function GA(){return Qr().memoizedState}function _$(e,t,r){var n=Fi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},KA(e))qA(t,r);else if(r=kA(e,t,r,n),r!==null){var i=ur();hn(r,e,n,i),XA(r,t,n)}}function S$(e,t,r){var n=Fi(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(KA(e))qA(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,mn(s,o)){var l=t.interleaved;l===null?(i.next=i,v0(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=kA(e,t,i,n),r!==null&&(i=ur(),hn(r,e,n,i),XA(r,t,n))}}function KA(e){var t=e.alternate;return e===mt||t!==null&&t===mt}function qA(e,t){Pl=Rf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function XA(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,r0(e,r)}}var If={readContext:Zr,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},O$={readContext:Zr,useCallback:function(e,t){return Sn().memoizedState=[e,t===void 0?null:t],e},useContext:Zr,useEffect:qb,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,uf(4194308,4,zA.bind(null,t,e),r)},useLayoutEffect:function(e,t){return uf(4194308,4,e,t)},useInsertionEffect:function(e,t){return uf(4,2,e,t)},useMemo:function(e,t){var r=Sn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Sn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=_$.bind(null,mt,e),[n.memoizedState,e]},useRef:function(e){var t=Sn();return e={current:e},t.memoizedState=e},useState:Kb,useDebugValue:j0,useDeferredValue:function(e){return Sn().memoizedState=e},useTransition:function(){var e=Kb(!1),t=e[0];return e=w$.bind(null,e[1]),Sn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=mt,i=Sn();if(ct){if(r===void 0)throw Error(X(407));r=r()}else{if(r=t(),Bt===null)throw Error(X(349));Ra&30||$A(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,qb(IA.bind(null,n,a,e),[e]),n.flags|=2048,au(9,RA.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Sn(),t=Bt.identifierPrefix;if(ct){var r=Hn,n=Wn;r=(n&~(1<<32-pn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[jn]=t,e[eu]=n,aE(e,t,!1,!1),t.stateNode=e;e:{switch(o=uv(r,n),r){case"dialog":at("cancel",e),at("close",e),i=n;break;case"iframe":case"object":case"embed":at("load",e),i=n;break;case"video":case"audio":for(i=0;iHo&&(t.flags|=128,n=!0,tl(a,!1),t.lanes=4194304)}else{if(!n)if(e=$f(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),tl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ct)return Yt(t),null}else 2*wt()-a.renderingStartTime>Ho&&r!==1073741824&&(t.flags|=128,n=!0,tl(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=wt(),t.sibling=null,r=pt.current,nt(pt,n?r&1|2:r&1),t):(Yt(t),null);case 22:case 23:return T0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Er&1073741824&&(Yt(t),t.subtreeFlags&6&&(t.flags|=8192)):Yt(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function N$(e,t){switch(f0(t),t.tag){case 1:return xr(t.type)&&Af(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vo(),ut(gr),ut(nr),b0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return x0(t),null;case 13:if(ut(pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));zo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(pt),null;case 4:return Vo(),null;case 10:return m0(t.type._context),null;case 22:case 23:return T0(),null;case 24:return null;default:return null}}var $c=!1,er=!1,$$=typeof WeakSet=="function"?WeakSet:Set,se=null;function go(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){gt(e,t,n)}else r.current=null}function Mv(e,t,r){try{r()}catch(n){gt(e,t,n)}}var a1=!1;function R$(e,t){if(xv=_f,e=dA(),u0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,c=e,p=null;t:for(;;){for(var h;c!==r||i!==0&&c.nodeType!==3||(s=o+i),c!==a||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)p=c,c=h;for(;;){if(c===e)break t;if(p===r&&++u===i&&(s=o),p===a&&++f===n&&(l=o),(h=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(bv={focusedElem:e,selectionRange:r},_f=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var v=b.memoizedProps,g=b.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:sn(t.type,v),g);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(S){gt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return b=a1,a1=!1,b}function Cl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Mv(t,r,a)}i=i.next}while(i!==n)}}function cp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Dv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function lE(e){var t=e.alternate;t!==null&&(e.alternate=null,lE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jn],delete t[eu],delete t[Sv],delete t[v$],delete t[y$])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function uE(e){return e.tag===5||e.tag===3||e.tag===4}function o1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jf));else if(n!==4&&(e=e.child,e!==null))for(Lv(e,t,r),e=e.sibling;e!==null;)Lv(e,t,r),e=e.sibling}function Bv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Bv(e,t,r),e=e.sibling;e!==null;)Bv(e,t,r),e=e.sibling}var Vt=null,ln=!1;function xi(e,t,r){for(r=r.child;r!==null;)cE(e,t,r),r=r.sibling}function cE(e,t,r){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(rp,r)}catch{}switch(r.tag){case 5:er||go(r,t);case 6:var n=Vt,i=ln;Vt=null,xi(e,t,r),Vt=n,ln=i,Vt!==null&&(ln?(e=Vt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Vt.removeChild(r.stateNode));break;case 18:Vt!==null&&(ln?(e=Vt,r=r.stateNode,e.nodeType===8?zh(e.parentNode,r):e.nodeType===1&&zh(e,r),Xl(e)):zh(Vt,r.stateNode));break;case 4:n=Vt,i=ln,Vt=r.stateNode.containerInfo,ln=!0,xi(e,t,r),Vt=n,ln=i;break;case 0:case 11:case 14:case 15:if(!er&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Mv(r,t,o),i=i.next}while(i!==n)}xi(e,t,r);break;case 1:if(!er&&(go(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){gt(r,t,s)}xi(e,t,r);break;case 21:xi(e,t,r);break;case 22:r.mode&1?(er=(n=er)||r.memoizedState!==null,xi(e,t,r),er=n):xi(e,t,r);break;default:xi(e,t,r)}}function s1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new $$),t.forEach(function(n){var i=V$.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function nn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=wt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*M$(n/1960))-n,10e?16:e,Ti===null)var n=!1;else{if(e=Ti,Ti=null,Lf=0,De&6)throw Error(X(331));var i=De;for(De|=4,se=e.current;se!==null;){var a=se,o=a.child;if(se.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lwt()-P0?Aa(e,0):k0|=r),br(e,t)}function gE(e,t){t===0&&(e.mode&1?(t=Oc,Oc<<=1,!(Oc&130023424)&&(Oc=4194304)):t=1);var r=ur();e=ri(e,t),e!==null&&(Ju(e,t,r),br(e,r))}function U$(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),gE(e,r)}function V$(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(X(314))}n!==null&&n.delete(t),gE(e,r)}var xE;xE=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||gr.current)mr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return mr=!1,C$(e,t,r);mr=!!(e.flags&131072)}else mr=!1,ct&&t.flags&1048576&&SA(t,Pf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;cf(e,t),e=t.pendingProps;var i=Fo(t,nr.current);To(t,r),i=_0(null,t,n,e,i,r);var a=S0();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xr(n)?(a=!0,Ef(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,y0(t),i.updater=up,t.stateNode=i,i._reactInternals=t,Pv(t,n,e,r),t=Nv(null,t,n,!0,a,r)):(t.tag=0,ct&&a&&c0(t),ir(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(cf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=H$(n),e=sn(n,e),i){case 0:t=Tv(null,t,n,e,r);break e;case 1:t=r1(null,t,n,e,r);break e;case 11:t=e1(null,t,n,e,r);break e;case 14:t=t1(null,t,n,sn(n.type,e),r);break e}throw Error(X(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),Tv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),r1(e,t,n,i,r);case 3:e:{if(rE(t),e===null)throw Error(X(387));n=t.pendingProps,a=t.memoizedState,i=a.element,PA(e,t),Nf(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Wo(Error(X(423)),t),t=n1(e,t,n,r,i);break e}else if(n!==i){i=Wo(Error(X(424)),t),t=n1(e,t,n,r,i);break e}else for(Tr=Di(t.stateNode.containerInfo.firstChild),Nr=t,ct=!0,cn=null,r=EA(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(zo(),n===i){t=ni(e,t,r);break e}ir(e,t,n,r)}t=t.child}return t;case 5:return CA(t),e===null&&Av(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,wv(n,i)?o=null:a!==null&&wv(n,a)&&(t.flags|=32),tE(e,t),ir(e,t,o,r),t.child;case 6:return e===null&&Av(t),null;case 13:return nE(e,t,r);case 4:return g0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Uo(t,null,n,r):ir(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),e1(e,t,n,i,r);case 7:return ir(e,t,t.pendingProps,r),t.child;case 8:return ir(e,t,t.pendingProps.children,r),t.child;case 12:return ir(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,nt(Cf,n._currentValue),n._currentValue=o,a!==null)if(mn(a.value,o)){if(a.children===i.children&&!gr.current){t=ni(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Yn(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Ev(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(X(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Ev(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}ir(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,To(t,r),i=Zr(i),n=n(i),t.flags|=1,ir(e,t,n,r),t.child;case 14:return n=t.type,i=sn(n,t.pendingProps),i=sn(n.type,i),t1(e,t,n,i,r);case 15:return JA(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),cf(e,t),t.tag=1,xr(n)?(e=!0,Ef(t)):e=!1,To(t,r),YA(t,n,i),Pv(t,n,i,r),Nv(null,t,n,!0,e,r);case 19:return iE(e,t,r);case 22:return eE(e,t,r)}throw Error(X(156,t.tag))};function bE(e,t){return Kj(e,t)}function W$(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,r,n){return new W$(e,t,r,n)}function $0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function H$(e){if(typeof e=="function")return $0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qg)return 11;if(e===Jg)return 14}return 2}function zi(e,t){var r=e.alternate;return r===null?(r=Kr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function pf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")$0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case lo:return Ea(r.children,i,a,t);case Zg:o=8,i|=8;break;case Jm:return e=Kr(12,r,t,i|2),e.elementType=Jm,e.lanes=a,e;case ev:return e=Kr(13,r,t,i),e.elementType=ev,e.lanes=a,e;case tv:return e=Kr(19,r,t,i),e.elementType=tv,e.lanes=a,e;case Cj:return dp(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kj:o=10;break e;case Pj:o=9;break e;case Qg:o=11;break e;case Jg:o=14;break e;case wi:o=16,n=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=Kr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Ea(e,t,r,n){return e=Kr(7,e,n,t),e.lanes=r,e}function dp(e,t,r,n){return e=Kr(22,e,n,t),e.elementType=Cj,e.lanes=r,e.stateNode={isHidden:!1},e}function Xh(e,t,r){return e=Kr(6,e,null,t),e.lanes=r,e}function Yh(e,t,r){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function G$(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ch(0),this.expirationTimes=Ch(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ch(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function R0(e,t,r,n,i,a,o,s,l){return e=new G$(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Kr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},y0(a),e}function K$(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(OE)}catch(e){console.error(e)}}OE(),Oj.exports=Mr;var bo=Oj.exports,m1=bo;Zm.createRoot=m1.createRoot,Zm.hydrateRoot=m1.hydrateRoot;/** - * @remix-run/router v1.23.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function su(){return su=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function L0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function J$(){return Math.random().toString(36).substr(2,8)}function y1(e,t){return{usr:e.state,key:e.key,idx:t}}function Wv(e,t,r,n){return r===void 0&&(r=null),su({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?As(t):t,{state:r,key:t&&t.key||n||J$()})}function zf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function As(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function eR(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Ni.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(su({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){s=Ni.Pop;let g=f(),y=g==null?null:g-u;u=g,l&&l({action:s,location:v.location,delta:y})}function p(g,y){s=Ni.Push;let m=Wv(v.location,g,y);u=f()+1;let w=y1(m,u),S=v.createHref(m);try{o.pushState(w,"",S)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;i.location.assign(S)}a&&l&&l({action:s,location:v.location,delta:1})}function h(g,y){s=Ni.Replace;let m=Wv(v.location,g,y);u=f();let w=y1(m,u),S=v.createHref(m);o.replaceState(w,"",S),a&&l&&l({action:s,location:v.location,delta:0})}function b(g){let y=i.location.origin!=="null"?i.location.origin:i.location.href,m=typeof g=="string"?g:zf(g);return m=m.replace(/ $/,"%20"),vt(y,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,y)}let v={get action(){return s},get location(){return e(i,o)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(v1,c),l=g,()=>{i.removeEventListener(v1,c),l=null}},createHref(g){return t(i,g)},createURL:b,encodeLocation(g){let y=b(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:h,go(g){return o.go(g)}};return v}var g1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(g1||(g1={}));function tR(e,t,r){return r===void 0&&(r="/"),rR(e,t,r)}function rR(e,t,r,n){let i=typeof t=="string"?As(t):t,a=Go(i.pathname||"/",r);if(a==null)return null;let o=jE(e);nR(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(vt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Ui([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(vt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),jE(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:cR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of AE(a.path))i(a,o,l)}),t}function AE(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=AE(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function nR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:fR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const iR=/^:[\w-]+$/,aR=3,oR=2,sR=1,lR=10,uR=-2,x1=e=>e==="*";function cR(e,t){let r=e.split("/"),n=r.length;return r.some(x1)&&(n+=uR),t&&(n+=oR),r.filter(i=>!x1(i)).reduce((i,a)=>i+(iR.test(a)?aR:a===""?sR:lR),n)}function fR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function dR(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=f;if(p==="*"){let v=s[c]||"";o=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const b=s[c];return h&&!b?u[p]=void 0:u[p]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function pR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),L0(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function hR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return L0(!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 Go(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const mR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vR=e=>mR.test(e);function yR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?As(e):e,a;if(r)if(vR(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),L0(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=b1(r.substring(1),"/"):a=b1(r,t)}else a=t;return{pathname:a,search:bR(n),hash:wR(i)}}function b1(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Zh(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function gR(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function B0(e,t){let r=gR(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function F0(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=As(e):(i=su({},e),vt(!i.pathname||!i.pathname.includes("?"),Zh("?","pathname","search",i)),vt(!i.pathname||!i.pathname.includes("#"),Zh("#","pathname","hash",i)),vt(!i.search||!i.search.includes("#"),Zh("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let c=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),c-=1;i.pathname=p.join("/")}s=c>=0?t[c]:"/"}let l=yR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Ui=e=>e.join("/").replace(/\/\/+/g,"/"),xR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _R(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const EE=["post","put","patch","delete"];new Set(EE);const SR=["get",...EE];new Set(SR);/** - * React Router v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),j.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let c=F0(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Ui([t,c.pathname])),(f.replace?n.replace:n.push)(c,f.state,f)},[t,n,o,a,e])}const AR=j.createContext(null);function ER(e){let t=j.useContext(di).outlet;return t&&j.createElement(AR.Provider,{value:e},t)}function bp(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=j.useContext(fi),{matches:i}=j.useContext(di),{pathname:a}=ks(),o=JSON.stringify(B0(i,n.v7_relativeSplatPath));return j.useMemo(()=>F0(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function kR(e,t){return PR(e,t)}function PR(e,t,r,n){Es()||vt(!1);let{navigator:i}=j.useContext(fi),{matches:a}=j.useContext(di),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=ks(),f;if(t){var c;let g=typeof t=="string"?As(t):t;l==="/"||(c=g.pathname)!=null&&c.startsWith(l)||vt(!1),f=g}else f=u;let p=f.pathname||"/",h=p;if(l!=="/"){let g=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(g.length).join("/")}let b=tR(e,{pathname:h}),v=RR(b&&b.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:Ui([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:Ui([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),a,r,n);return t&&v?j.createElement(gp.Provider,{value:{location:lu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Ni.Pop}},v):v}function CR(){let e=LR(),t=_R(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:i},r):null,null)}const TR=j.createElement(CR,null);class NR extends j.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?j.createElement(di.Provider,{value:this.props.routeContext},j.createElement(PE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $R(e){let{routeContext:t,match:r,children:n}=e,i=j.useContext(yp);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(di.Provider,{value:t},n)}function RR(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);f>=0||vt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,c,p)=>{let h,b=!1,v=null,g=null;r&&(h=s&&c.route.id?s[c.route.id]:void 0,v=c.route.errorElement||TR,l&&(u<0&&p===0?(FR("route-fallback"),b=!0,g=null):u===p&&(b=!0,g=c.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=v:b?w=g:c.route.Component?w=j.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=f,j.createElement($R,{match:c,routeContext:{outlet:f,matches:y,isDataRoute:r!=null},children:w})};return r&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?j.createElement(NR,{location:r.location,revalidation:r.revalidation,component:v,error:h,children:m(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):m()},null)}var TE=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(TE||{}),NE=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}(NE||{});function IR(e){let t=j.useContext(yp);return t||vt(!1),t}function MR(e){let t=j.useContext(kE);return t||vt(!1),t}function DR(e){let t=j.useContext(di);return t||vt(!1),t}function $E(e){let t=DR(),r=t.matches[t.matches.length-1];return r.route.id||vt(!1),r.route.id}function LR(){var e;let t=j.useContext(PE),r=MR(),n=$E();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function BR(){let{router:e}=IR(TE.UseNavigateStable),t=$E(NE.UseNavigateStable),r=j.useRef(!1);return CE(()=>{r.current=!0}),j.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,lu({fromRouteId:t},a)))},[e,t])}const w1={};function FR(e,t,r){w1[e]||(w1[e]=!0)}function zR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function UR(e){let{to:t,replace:r,state:n,relative:i}=e;Es()||vt(!1);let{future:a,static:o}=j.useContext(fi),{matches:s}=j.useContext(di),{pathname:l}=ks(),u=xp(),f=F0(t,B0(s,a.v7_relativeSplatPath),l,i==="path"),c=JSON.stringify(f);return j.useEffect(()=>u(JSON.parse(c),{replace:r,state:n,relative:i}),[u,c,i,r,n]),null}function VR(e){return ER(e.context)}function _n(e){vt(!1)}function WR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Ni.Pop,navigator:a,static:o=!1,future:s}=e;Es()&&vt(!1);let l=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:l,navigator:a,static:o,future:lu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=As(n));let{pathname:f="/",search:c="",hash:p="",state:h=null,key:b="default"}=n,v=j.useMemo(()=>{let g=Go(f,l);return g==null?null:{location:{pathname:g,search:c,hash:p,state:h,key:b},navigationType:i}},[l,f,c,p,h,b,i]);return v==null?null:j.createElement(fi.Provider,{value:u},j.createElement(gp.Provider,{children:r,value:v}))}function HR(e){let{children:t,location:r}=e;return kR(Gv(t),r)}new Promise(()=>{});function Gv(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,i)=>{if(!j.isValidElement(n))return;let a=[...t,i];if(n.type===j.Fragment){r.push.apply(r,Gv(n.props.children,a));return}n.type!==_n&&vt(!1),!n.props.index||!n.props.children||vt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Gv(n.props.children,a)),r.push(o)}),r}/** - * React Router DOM v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Uf(){return Uf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function GR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KR(e,t){return e.button===0&&(!t||t==="_self")&&!GR(e)}const qR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],XR=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],YR="6";try{window.__reactRouterVersion=YR}catch{}const ZR=j.createContext({isTransitioning:!1}),QR="startTransition",_1=zT[QR];function JR(e){let{basename:t,children:r,future:n,window:i}=e,a=j.useRef();a.current==null&&(a.current=Q$({window:i,v5Compat:!0}));let o=a.current,[s,l]=j.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=j.useCallback(c=>{u&&_1?_1(()=>l(c)):l(c)},[l,u]);return j.useLayoutEffect(()=>o.listen(f),[o,f]),j.useEffect(()=>zR(n),[n]),j.createElement(WR,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const eI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rI=j.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:c}=t,p=RE(t,qR),{basename:h}=j.useContext(fi),b,v=!1;if(typeof u=="string"&&tI.test(u)&&(b=u,eI))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),x=Go(S.pathname,h);S.origin===w.origin&&x!=null?u=x+S.search+S.hash:v=!0}catch{}let g=OR(u,{relative:i}),y=aI(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:c});function m(w){n&&n(w),w.defaultPrevented||y(w)}return j.createElement("a",Uf({},p,{href:b||g,onClick:v||a?n:m,ref:r,target:l}))}),nI=j.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:o=!1,style:s,to:l,viewTransition:u,children:f}=t,c=RE(t,XR),p=bp(l,{relative:c.relative}),h=ks(),b=j.useContext(kE),{navigator:v,basename:g}=j.useContext(fi),y=b!=null&&oI(p)&&u===!0,m=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;i||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&g&&(S=Go(S,g)||S);const x=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!o&&w.startsWith(m)&&w.charAt(x)==="/",O=S!=null&&(S===m||!o&&S.startsWith(m)&&S.charAt(m.length)==="/"),A={isActive:_,isPending:O,isTransitioning:y},E=_?n:void 0,$;typeof a=="function"?$=a(A):$=[a,_?"active":null,O?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let N=typeof s=="function"?s(A):s;return j.createElement(rI,Uf({},c,{"aria-current":E,className:$,ref:r,style:N,to:l,viewTransition:u}),typeof f=="function"?f(A):f)});var Kv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Kv||(Kv={}));var S1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(S1||(S1={}));function iI(e){let t=j.useContext(yp);return t||vt(!1),t}function aI(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=xp(),u=ks(),f=bp(e,{relative:o});return j.useCallback(c=>{if(KR(c,r)){c.preventDefault();let p=n!==void 0?n:zf(u)===zf(f);l(e,{replace:p,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function oI(e,t){t===void 0&&(t={});let r=j.useContext(ZR);r==null&&vt(!1);let{basename:n}=iI(Kv.useViewTransitionState),i=bp(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=Go(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Go(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Hv(i.pathname,o)!=null||Hv(i.pathname,a)!=null}/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var sI={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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ye=(e,t)=>{const r=j.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>j.createElement("svg",{ref:f,...sI,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:["lucide",`lucide-${lI(e)}`,s].join(" "),...u},[...t.map(([c,p])=>j.createElement(c,p)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** - * @license lucide-react v0.363.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=Ye("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uI=Ye("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cI=Ye("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fI=Ye("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xl=Ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bl=Ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dI=Ye("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pI=Ye("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hI=Ye("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jh=Ye("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mI=Ye("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wp=Ye("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vI=Ye("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yI=Ye("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gI=Ye("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.363.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=Ye("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bI=Ye("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wI=Ye("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const IE=Ye("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vf=Ye("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mc=Ye("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qi=Ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _I=Ye("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const SI=Ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const OI=Ye("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ii=Ye("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ME=Ye("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jI=Ye("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"}]]);function AI(){return d.jsxs("aside",{className:"w-64 shrink-0 flex flex-col h-screen bg-white dark:bg-black border-r border-slate-200 dark:border-[#151515] relative z-20 transition-colors duration-300",children:[d.jsxs("div",{className:"h-20 px-6 flex items-center gap-3.5 border-b border-slate-200 dark:border-[#151515] transition-colors duration-300",children:[d.jsx("div",{className:"w-9 h-9 bg-brand-500 dark:bg-black border border-brand-600 dark:border-[#2a2a2e] rounded-xl flex items-center justify-center shadow-sm",children:d.jsx(jI,{size:18,className:"text-white",strokeWidth:2})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[16px] font-bold tracking-widest text-slate-900 dark:text-white leading-tight uppercase",children:"Decision"}),d.jsx("p",{className:"text-[10px] uppercase text-brand-600 dark:text-[#66666e] tracking-wider leading-tight font-semibold",children:"Engine"})]})]}),d.jsxs("nav",{className:"flex-1 px-4 py-8 space-y-1 overflow-y-auto",children:[d.jsx(la,{to:"/",icon:xI,end:!0,children:"Overview"}),d.jsx(la,{to:"/decisions",icon:SI,children:"Decision Explorer"}),d.jsx("div",{className:"pt-8 pb-3 px-3 flex items-center gap-2",children:d.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-slate-400 dark:text-[#66666e]",children:"Routing"})}),d.jsx(la,{to:"/routing",icon:vI,end:!0,children:"Routing Hub"}),d.jsx(la,{to:"/routing/sr",icon:ME,indent:!0,children:"Auth-Rate Based"}),d.jsx(la,{to:"/routing/rules",icon:cI,indent:!0,children:"Rule-Based (Euclid)"}),d.jsx(la,{to:"/routing/volume",icon:Vf,indent:!0,children:"Volume Split"}),d.jsx(la,{to:"/routing/debit",icon:IE,indent:!0,children:"Debit Routing"})]}),d.jsx("div",{className:"px-6 py-5 border-t border-slate-200 dark:border-[#151515] bg-slate-50 dark:bg-black transition-colors duration-300",children:d.jsx("span",{className:"text-[11px] text-slate-500 dark:text-[#66666e] font-medium tracking-wide",children:"v1.2.1"})})]})}function la({to:e,icon:t,children:r,end:n,indent:i}){return d.jsx(nI,{to:e,end:n,className:({isActive:a})=>`group relative flex items-center gap-3 px-4 py-3 rounded-[14px] text-[14px] font-medium transition-all duration-200 ${i?"ml-3 w-[calc(100%-12px)]":""} ${a?"bg-slate-100 text-brand-600 dark:bg-[#151518] dark:text-white shadow-sm":"text-slate-500 hover:text-slate-900 hover:bg-slate-50 dark:text-[#888891] dark:hover:text-white dark:hover:bg-[#0c0c0e]"}`,children:({isActive:a})=>d.jsxs(d.Fragment,{children:[d.jsx(t,{size:18,className:`transition-colors duration-200 ${a?"text-brand-600 dark:text-white":"text-slate-400 dark:text-[#55555e] group-hover:text-slate-600 dark:group-hover:text-white"}`,strokeWidth:a?2.5:2}),d.jsx("span",{className:"flex-1",children:r})]})})}const EI={},O1=e=>{let t;const r=new Set,n=(f,c)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=c??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(b=>b(t,h))}},i=()=>t,l={setState:n,getState:i,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(EI?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,i,l);return l},kI=e=>e?O1(e):O1;var DE={exports:{}},LE={},BE={exports:{}},FE={};/** - * @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 Ko=j;function PI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var CI=typeof Object.is=="function"?Object.is:PI,TI=Ko.useState,NI=Ko.useEffect,$I=Ko.useLayoutEffect,RI=Ko.useDebugValue;function II(e,t){var r=t(),n=TI({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return $I(function(){i.value=r,i.getSnapshot=t,em(i)&&a({inst:i})},[e,r,t]),NI(function(){return em(i)&&a({inst:i}),e(function(){em(i)&&a({inst:i})})},[e]),RI(r),r}function em(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!CI(e,r)}catch{return!0}}function MI(e,t){return t()}var DI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?MI:II;FE.useSyncExternalStore=Ko.useSyncExternalStore!==void 0?Ko.useSyncExternalStore:DI;BE.exports=FE;var qv=BE.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.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 _p=j,LI=qv;function BI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var FI=typeof Object.is=="function"?Object.is:BI,zI=LI.useSyncExternalStore,UI=_p.useRef,VI=_p.useEffect,WI=_p.useMemo,HI=_p.useDebugValue;LE.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=UI(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=WI(function(){function l(h){if(!u){if(u=!0,f=h,h=n(h),i!==void 0&&o.hasValue){var b=o.value;if(i(b,h))return c=b}return c=h}if(b=c,FI(f,h))return b;var v=n(h);return i!==void 0&&i(b,v)?(f=h,b):(f=h,c=v)}var u=!1,f,c,p=r===void 0?null:r;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,r,n,i]);var s=zI(e,a[0],a[1]);return VI(function(){o.hasValue=!0,o.value=s},[s]),HI(s),s};DE.exports=LE;var GI=DE.exports;const KI=Ke(GI),zE={},{useDebugValue:qI}=T,{useSyncExternalStoreWithSelector:XI}=KI;let j1=!1;const YI=e=>e;function ZI(e,t=YI,r){(zE?"production":void 0)!=="production"&&r&&!j1&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),j1=!0);const n=XI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return qI(n),n}const QI=e=>{(zE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?kI(e):e,r=(n,i)=>ZI(t,n,i);return Object.assign(r,t),r},JI=e=>QI,eM={};function tM(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var a;const o=l=>l===null?null:JSON.parse(l,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(o):o(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const uu=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return uu(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return uu(n)(r)}}}},rM=(e,t)=>(r,n,i)=>{let a={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},o=!1;const s=new Set,l=new Set;let u;try{u=a.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...g)},n,i);const f=uu(a.serialize),c=()=>{const g=a.partialize({...n()});let y;const m=f({state:g,version:a.version}).then(w=>u.setItem(a.name,w)).catch(w=>{y=w});if(y)throw y;return m},p=i.setState;i.setState=(g,y)=>{p(g,y),c()};const h=e((...g)=>{r(...g),c()},n,i);let b;const v=()=>{var g;if(!u)return;o=!1,s.forEach(m=>m(n()));const y=((g=a.onRehydrateStorage)==null?void 0:g.call(a,n()))||void 0;return uu(u.getItem.bind(u))(a.name).then(m=>{if(m)return a.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return a.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var w;return b=a.merge(m,(w=n())!=null?w:h),r(b,!0),c()}).then(()=>{y==null||y(b,void 0),o=!0,l.forEach(m=>m(b))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:g=>{a={...a,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},v(),b||h},nM=(e,t)=>(r,n,i)=>{let a={storage:tM(()=>localStorage),partialize:v=>v,version:0,merge:(v,g)=>({...g,...v}),...t},o=!1;const s=new Set,l=new Set;let u=a.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const f=()=>{const v=a.partialize({...n()});return u.setItem(a.name,{state:v,version:a.version})},c=i.setState;i.setState=(v,g)=>{c(v,g),f()};const p=e((...v)=>{r(...v),f()},n,i);i.getInitialState=()=>p;let h;const b=()=>{var v,g;if(!u)return;o=!1,s.forEach(m=>{var w;return m((w=n())!=null?w:p)});const y=((g=a.onRehydrateStorage)==null?void 0:g.call(a,(v=n())!=null?v:p))||void 0;return uu(u.getItem.bind(u))(a.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return[!0,a.migrate(m.state,m.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var w;const[S,x]=m;if(h=a.merge(x,(w=n())!=null?w:p),r(h,!0),S)return f()}).then(()=>{y==null||y(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:v=>{a={...a,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>b(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},a.skipHydration||b(),h||p},iM=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((eM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),rM(e,t)):nM(e,t),aM=iM,ra=JI()(aM(e=>({merchantId:"",setMerchantId:t=>{console.log(` -[STORE] Merchant ID changed: "${t}"`),e({merchantId:t})}}),{name:"merchant-store"}));function oM(e,t,r){console.log(` -`+"=".repeat(80)),console.log(`[API REQUEST] ${new Date().toISOString()}`),console.log(`Method: ${e}`),console.log(`Path: ${t}`),r!==void 0&&console.log("Body:",JSON.stringify(r,null,2)),console.log("=".repeat(80))}function sM(e,t,r,n){console.log(` -`+"-".repeat(80)),console.log(`[API RESPONSE] ${new Date().toISOString()}`),console.log(`Path: ${e}`),console.log(`Status: ${t} ${r}`),console.log("Response Body:",n),console.log("-".repeat(80)+` -`)}function A1(e,t){console.log(` -`+"!".repeat(80)),console.log(`[API ERROR] ${new Date().toISOString()}`),console.log(`Path: ${e}`),t instanceof Error?(console.log("Error:",t.message),console.log("Stack:",t.stack)):console.log("Error:",t),console.log("!".repeat(80)+` -`)}async function UE(e,t){const r=(t==null?void 0:t.method)||"GET",n=t!=null&&t.body?JSON.parse(t.body):void 0;oM(r,e,n);try{const i=await fetch(e,{headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t}),a=await i.text();let o;try{const s=JSON.parse(a);o=JSON.stringify(s,null,2)}catch{o=a}if(sM(e,i.status,i.statusText,o),!i.ok){const s=new Error(`API error ${i.status}: ${a}`);throw A1(e,s),s}return a.trim()?JSON.parse(a):void 0}catch(i){throw A1(e,i),i}}async function ft(e,t){return UE(e,{method:"POST",body:t!==void 0?JSON.stringify(t):void 0})}async function lM(e){return UE(e)}function uM(){const{merchantId:e,setMerchantId:t}=ra(),[r,n]=j.useState(e),[i,a]=j.useState(!1),[o,s]=j.useState(()=>localStorage.getItem("theme")==="dark");j.useEffect(()=>{const u=window.document.documentElement;o?(u.classList.add("dark"),localStorage.setItem("theme","dark")):(u.classList.remove("dark"),localStorage.setItem("theme","light"))},[o]);async function l(){const u=r.trim();if(u){t(u),a(!0);try{await ft("/merchant-account/create",{merchant_id:u,gateway_success_rate_based_decider_input:null})}catch{}finally{a(!1)}}}return d.jsxs("header",{className:"h-[76px] bg-white dark:bg-black border-b border-slate-200 dark:border-[#151515] flex items-center justify-between px-8 shrink-0 relative z-10 transition-colors duration-300",children:[d.jsx("div",{}),d.jsxs("div",{className:"flex items-center gap-6",children:[d.jsxs("div",{className:"relative",children:[d.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&l(),placeholder:"Set Merchant ID",className:"w-72 bg-slate-50 dark:bg-[#0f0f11] border border-slate-200 dark:border-[#222222] rounded-full px-4 py-2 text-sm text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-[#66666e] focus:outline-none focus:border-slate-400 dark:focus:border-[#444444] transition-colors"}),d.jsx("button",{onClick:l,disabled:i,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-slate-400 hover:text-brand-500 dark:text-[#66666e] dark:hover:text-white transition-colors",children:i?d.jsx(bI,{size:16,className:"animate-spin"}):d.jsx(uI,{size:16})})]}),e&&d.jsxs("div",{className:"flex items-center gap-2 pl-6 ml-2 border-l border-slate-200 dark:border-[#222222] transition-colors duration-300",children:[d.jsx(fI,{size:16,className:"text-brand-500 dark:text-[#66666e]"}),d.jsx("span",{className:"text-sm text-slate-800 dark:text-white font-medium",children:e})]}),d.jsx("button",{onClick:()=>s(!o),className:"p-2.5 rounded-full bg-slate-100 text-slate-600 hover:bg-slate-200 dark:bg-[#151515] dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#222222] transition-colors duration-200","aria-label":"Toggle theme",children:o?d.jsx(OI,{size:18}):d.jsx(wI,{size:18})})]})]})}function cM(){return d.jsxs("div",{className:"flex h-screen overflow-hidden bg-[#f8fafc] text-slate-900 dark:bg-[#000000] dark:text-white relative transition-colors duration-300",children:[d.jsx("div",{className:"aurora-top"}),d.jsx(AI,{}),d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[d.jsx(uM,{}),d.jsx("main",{className:"flex-1 overflow-y-auto p-8 relative",children:d.jsx(VR,{})})]})]})}const VE=0,WE=1,HE=2,E1=3;var k1=Object.prototype.hasOwnProperty;function Xv(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&Xv(e[n],t[n]););return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(k1.call(e,r)&&++n&&!k1.call(t,r)||!(r in t)||!Xv(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const Vn=new WeakMap,Gn=()=>{},tr=Gn(),Yv=Object,Re=e=>e===tr,An=e=>typeof e=="function",Xi=(e,t)=>({...e,...t}),GE=e=>An(e.then),tm={},Dc={},z0="undefined",nc=typeof window!=z0,Zv=typeof document!=z0,fM=nc&&"Deno"in window,dM=()=>nc&&typeof window.requestAnimationFrame!=z0,KE=(e,t)=>{const r=Vn.get(e);return[()=>!Re(t)&&e.get(t)||tm,n=>{if(!Re(t)){const i=e.get(t);t in Dc||(Dc[t]=i),r[5](t,Xi(i,n),i||tm)}},r[6],()=>!Re(t)&&t in Dc?Dc[t]:!Re(t)&&e.get(t)||tm]};let Qv=!0;const pM=()=>Qv,[Jv,ey]=nc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Gn,Gn],hM=()=>{const e=Zv&&document.visibilityState;return Re(e)||e!=="hidden"},mM=e=>(Zv&&document.addEventListener("visibilitychange",e),Jv("focus",e),()=>{Zv&&document.removeEventListener("visibilitychange",e),ey("focus",e)}),vM=e=>{const t=()=>{Qv=!0,e()},r=()=>{Qv=!1};return Jv("online",t),Jv("offline",r),()=>{ey("online",t),ey("offline",r)}},yM={isOnline:pM,isVisible:hM},gM={initFocus:mM,initReconnect:vM},P1=!T.useId,$o=!nc||fM,xM=e=>dM()?window.requestAnimationFrame(e):setTimeout(e,1),rm=$o?j.useEffect:j.useLayoutEffect,nm=typeof navigator<"u"&&navigator.connection,C1=!$o&&nm&&(["slow-2g","2g"].includes(nm.effectiveType)||nm.saveData),Lc=new WeakMap,bM=e=>Yv.prototype.toString.call(e),im=(e,t)=>e===`[object ${t}]`;let wM=0;const ty=e=>{const t=typeof e,r=bM(e),n=im(r,"Date"),i=im(r,"RegExp"),a=im(r,"Object");let o,s;if(Yv(e)===e&&!n&&!i){if(o=Lc.get(e),o)return o;if(o=++wM+"~",Lc.set(e,o),Array.isArray(e)){for(o="@",s=0;s{if(An(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ty(e):"",[e,t]};let _M=0;const ry=()=>++_M;async function qE(...e){const[t,r,n,i]=e,a=Xi({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let l=a.optimisticData;const u=p=>typeof s=="function"?s(p):s!==!1,f=a.throwOnError;if(An(r)){const p=r,h=[],b=t.keys();for(const v of b)!/^\$(inf|sub)\$/.test(v)&&p(t.get(v)._k)&&h.push(v);return Promise.all(h.map(c))}return c(r);async function c(p){const[h]=U0(p);if(!h)return;const[b,v]=KE(t,h),[g,y,m,w]=Vn.get(t),S=()=>{const D=g[h];return(An(a.revalidate)?a.revalidate(b().data,p):a.revalidate!==!1)&&(delete m[h],delete w[h],D&&D[0])?D[0](HE).then(()=>b().data):b().data};if(e.length<3)return S();let x=n,_,O=!1;const A=ry();y[h]=[A,0];const E=!Re(l),$=b(),N=$.data,P=$._c,I=Re(P)?N:P;if(E&&(l=An(l)?l(I,N):l,v({data:l,_c:I})),An(x))try{x=x(I)}catch(D){_=D,O=!0}if(x&&GE(x))if(x=await x.catch(D=>{_=D,O=!0}),A!==y[h][0]){if(O)throw _;return x}else O&&E&&u(_)&&(o=!0,v({data:I,_c:tr}));if(o&&!O)if(An(o)){const D=o(x,I);v({data:D,error:tr,_c:tr})}else v({data:x,error:tr,_c:tr});if(y[h][1]=ry(),Promise.resolve(S()).then(()=>{v({_c:tr})}),O){if(f)throw _;return}return x}}const T1=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},SM=(e,t)=>{if(!Vn.has(e)){const r=Xi(gM,t),n=Object.create(null),i=qE.bind(tr,e);let a=Gn;const o=Object.create(null),s=(f,c)=>{const p=o[f]||[];return o[f]=p,p.push(c),()=>p.splice(p.indexOf(c),1)},l=(f,c,p)=>{e.set(f,c);const h=o[f];if(h)for(const b of h)b(c,p)},u=()=>{if(!Vn.has(e)&&(Vn.set(e,[n,Object.create(null),Object.create(null),Object.create(null),i,l,s]),!$o)){const f=r.initFocus(setTimeout.bind(tr,T1.bind(tr,n,VE))),c=r.initReconnect(setTimeout.bind(tr,T1.bind(tr,n,WE)));a=()=>{f&&f(),c&&c(),Vn.delete(e)}}};return u(),[e,i,u,a]}return[e,Vn.get(e)[4]]},OM=(e,t,r,n,i)=>{const a=r.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!Re(a)&&o>a||setTimeout(n,s,i)},jM=Xv,[XE,AM]=SM(new Map),EM=Xi({onLoadingSlow:Gn,onSuccess:Gn,onError:Gn,onErrorRetry:OM,onDiscarded:Gn,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:C1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:C1?5e3:3e3,compare:jM,isPaused:()=>!1,cache:XE,mutate:AM,fallback:{}},yM),kM=(e,t)=>{const r=Xi(e,t);if(t){const{use:n,fallback:i}=e,{use:a,fallback:o}=t;n&&a&&(r.use=n.concat(a)),i&&o&&(r.fallback=Xi(i,o))}return r},PM=j.createContext({}),CM="$inf$",YE=nc&&window.__SWR_DEVTOOLS_USE__,TM=YE?window.__SWR_DEVTOOLS_USE__:[],NM=()=>{YE&&(window.__SWR_DEVTOOLS_REACT__=T)},$M=e=>An(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],RM=()=>{const e=j.useContext(PM);return j.useMemo(()=>Xi(EM,e),[e])},IM=e=>(t,r,n)=>e(t,r&&((...a)=>{const[o]=U0(t),[,,,s]=Vn.get(XE);if(o.startsWith(CM))return r(...a);const l=s[o];return Re(l)?r(...a):(delete s[o],l)}),n),MM=TM.concat(IM),DM=e=>function(...r){const n=RM(),[i,a,o]=$M(r),s=kM(n,o);let l=e;const{use:u}=s,f=(u||[]).concat(MM);for(let c=f.length;c--;)l=f[c](l);return l(i,a||s.fetcher||null,s)},LM=(e,t,r)=>{const n=t[e]||(t[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i>=0&&(n[i]=n[n.length-1],n.pop())}};NM();const am=T.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),om={dedupe:!0},N1=Promise.resolve(tr),BM=()=>Gn,FM=(e,t,r)=>{const{cache:n,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:p,strictServerPrefetchWarning:h}=r,[b,v,g,y]=Vn.get(n),[m,w]=U0(e),S=j.useRef(!1),x=j.useRef(!1),_=j.useRef(m),O=j.useRef(t),A=j.useRef(r),E=()=>A.current,$=()=>E().isVisible()&&E().isOnline(),[N,P,I,D]=KE(n,m),B=j.useRef({}).current,V=Re(o)?Re(r.fallback)?tr:r.fallback[m]:o,U=(de,fe)=>{for(const je in B){const ke=je;if(ke==="data"){if(!i(de[ke],fe[ke])&&(!Re(de[ke])||!i(xe,fe[ke])))return!1}else if(fe[ke]!==de[ke])return!1}return!0},R=!S.current,F=j.useMemo(()=>{const de=N(),fe=D(),je=C=>{const M=Xi(C);return delete M._k,(()=>{if(!m||!t||E().isPaused())return!1;if(R&&!Re(s))return s;const te=Re(V)?M.data:V;return Re(te)||l})()?{isValidating:!0,isLoading:!0,...M}:M},ke=je(de),Ze=de===fe?ke:je(fe);let ze=ke;return[()=>{const C=je(N());return U(C,ze)?(ze.data=C.data,ze.isLoading=C.isLoading,ze.isValidating=C.isValidating,ze.error=C.error,ze):(ze=C,C)},()=>Ze]},[n,m]),L=qv.useSyncExternalStore(j.useCallback(de=>I(m,(fe,je)=>{U(je,fe)||de()}),[n,m]),F[0],F[1]),q=b[m]&&b[m].length>0,W=L.data,Y=Re(W)?V&&GE(V)?am(V):V:W,he=L.error,Ae=j.useRef(Y),xe=p?Re(W)?Re(Ae.current)?Y:Ae.current:W:Y,We=m&&Re(Y),Me=j.useRef(null);!$o&&qv.useSyncExternalStore(BM,()=>(Me.current=!1,Me),()=>(Me.current=!0,Me));const Z=Me.current;h&&Z&&!a&&We&&console.warn(`Missing pre-initiated data for serialized key "${m}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const ne=!m||!t||E().isPaused()||q&&!Re(he)?!1:R&&!Re(s)?s:a?Re(Y)?!1:l:Re(Y)||l,pe=R&&ne,k=Re(L.isValidating)?pe:L.isValidating,H=Re(L.isLoading)?pe:L.isLoading,K=j.useCallback(async de=>{const fe=O.current;if(!m||!fe||x.current||E().isPaused())return!1;let je,ke,Ze=!0;const ze=de||{},C=!g[m]||!ze.dedupe,M=()=>P1?!x.current&&m===_.current&&S.current:m===_.current,z={isValidating:!1,isLoading:!1},te=()=>{P(z)},ee=()=>{const re=g[m];re&&re[1]===ke&&delete g[m]},Q={isValidating:!0};Re(N().data)&&(Q.isLoading=!0);try{if(C&&(P(Q),r.loadingTimeout&&Re(N().data)&&setTimeout(()=>{Ze&&M()&&E().onLoadingSlow(m,r)},r.loadingTimeout),g[m]=[fe(w),ry()]),[je,ke]=g[m],je=await je,C&&setTimeout(ee,r.dedupingInterval),!g[m]||g[m][1]!==ke)return C&&M()&&E().onDiscarded(m),!1;z.error=tr;const re=v[m];if(!Re(re)&&(ke<=re[0]||ke<=re[1]||re[1]===0))return te(),C&&M()&&E().onDiscarded(m),!1;const ve=N().data;z.data=i(ve,je)?ve:je,C&&M()&&E().onSuccess(je,m,r)}catch(re){ee();const ve=E(),{shouldRetryOnError:Se}=ve;ve.isPaused()||(z.error=re,C&&M()&&(ve.onError(re,m,ve),(Se===!0||An(Se)&&Se(re))&&(!E().revalidateOnFocus||!E().revalidateOnReconnect||$())&&ve.onErrorRetry(re,m,ve,St=>{const Gt=b[m];Gt&&Gt[0]&&Gt[0](E1,St)},{retryCount:(ze.retryCount||0)+1,dedupe:!0})))}return Ze=!1,te(),!0},[m,n]),me=j.useCallback((...de)=>qE(n,_.current,...de),[]);if(rm(()=>{O.current=t,A.current=r,Re(W)||(Ae.current=W)}),rm(()=>{if(!m)return;const de=K.bind(tr,om);let fe=0;E().revalidateOnFocus&&(fe=Date.now()+E().focusThrottleInterval);const ke=LM(m,b,(Ze,ze={})=>{if(Ze==VE){const C=Date.now();E().revalidateOnFocus&&C>fe&&$()&&(fe=C+E().focusThrottleInterval,de())}else if(Ze==WE)E().revalidateOnReconnect&&$()&&de();else{if(Ze==HE)return K();if(Ze==E1)return K(ze)}});return x.current=!1,_.current=m,S.current=!0,P({_k:w}),ne&&(g[m]||(Re(Y)||$o?de():xM(de))),()=>{x.current=!0,ke()}},[m]),rm(()=>{let de;function fe(){const ke=An(u)?u(N().data):u;ke&&de!==-1&&(de=setTimeout(je,ke))}function je(){!N().error&&(f||E().isVisible())&&(c||E().isOnline())?K(om).then(fe):fe()}return fe(),()=>{de&&(clearTimeout(de),de=-1)}},[u,f,c,m]),j.useDebugValue(xe),a){if(!P1&&$o&&We)throw new Error("Fallback data is required when using Suspense in SSR.");We&&(O.current=t,A.current=r,x.current=!1);const de=y[m],fe=!Re(de)&&We?me(de):N1;if(am(fe),!Re(he)&&We)throw he;const je=We?K(om):N1;!Re(xe)&&We&&(je.status="fulfilled",je.value=!0),am(je)}return{mutate:me,get data(){return B.data=!0,xe},get error(){return B.error=!0,he},get isValidating(){return B.isValidating=!0,k},get isLoading(){return B.isLoading=!0,H}}},vn=DM(FM);function Te({children:e,className:t="",onClick:r}){return d.jsx("div",{className:`glass-panel rounded-[20px] ${r?"glass-panel-hover cursor-pointer":""} ${t}`,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:e})}function et({children:e,className:t=""}){return d.jsx("div",{className:`px-6 py-5 border-b border-slate-200 dark:border-[#1c1c1f] bg-slate-50 dark:bg-[#0c0c0e] rounded-t-[20px] ${t}`,children:e})}function Ne({children:e,className:t=""}){return d.jsx("div",{className:`px-6 py-5 ${t}`,children:e})}const zM={green:"bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20",gray:"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8",blue:"bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20",red:"bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20",orange:"bg-orange-500/10 text-orange-400 ring-1 ring-inset ring-orange-500/20",purple:"bg-purple-500/10 text-purple-400 ring-1 ring-inset ring-purple-500/20"};function Qt({variant:e="gray",children:t}){return d.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${zM[e]}`,children:t})}function UM(){const[e,t]=j.useState("loading");return j.useEffect(()=>{console.log(` -[HEALTH CHECK] ${new Date().toISOString()}`),console.log("Fetching: GET /health"),fetch("/health").then(r=>{console.log(`[HEALTH CHECK] Response: ${r.status} ${r.statusText}`),t(r.ok?"up":"down")}).catch(r=>{console.log(`[HEALTH CHECK ERROR] ${r.message}`),t("down")})},[]),e}function VM(){var l,u;const e=xp(),{merchantId:t}=ra(),r=UM(),{data:n}=vn(t?`/routing/list/active/${t}`:null,()=>ft(`/routing/list/active/${t}`),{shouldRetryOnError:!1}),{data:i,error:a}=vn(t?["/rule/get","successRate",t]:null,()=>ft("/rule/get",{merchant_id:t,algorithm:"successRate"})),o=n&&n.length>0?n[0]:null,s=(n||[]).some(f=>{var c;return((c=f.algorithm_data||f.algorithm)==null?void 0:c.type)==="advanced"});return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Overview"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Decision Engine routing health and status"})]}),!t&&d.jsxs("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 flex items-center gap-2 text-sm text-yellow-800",children:[d.jsx(dI,{size:16}),"Set your Merchant ID in the top bar to load configuration."]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[d.jsx(Te,{children:d.jsxs(Ne,{className:"flex items-center gap-3",children:[r==="up"?d.jsx(pI,{className:"text-green-500",size:24}):r==="down"?d.jsx(hI,{className:"text-red-500",size:24}):d.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-gray-200 border-t-gray-500 animate-spin"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500",children:"API Health"}),d.jsx("p",{className:"text-sm font-medium",children:r==="up"?"Healthy":r==="down"?"Down":"Checking..."})]})]})}),d.jsx(Te,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:d.jsxs(Ne,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Active Routing Rule"}),t?o?d.jsxs("div",{children:[d.jsx(Qt,{variant:"green",children:"Active"}),d.jsx("p",{className:"text-sm font-medium mt-1 truncate",children:o.name}),d.jsx("p",{className:"text-xs text-slate-400",children:(l=o.algorithm_data||o.algorithm)==null?void 0:l.type})]}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})}),d.jsx(Te,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/sr"),children:d.jsxs(Ne,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Auth-Rate Config"}),t?a?d.jsx(Qt,{variant:"gray",children:"Not Configured"}):i!=null&&i.data?d.jsx(Qt,{variant:"green",children:"Configured"}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})}),d.jsx(Te,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/rules"),children:d.jsxs(Ne,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Rule-Based Routing"}),t?s?d.jsx(Qt,{variant:"green",children:"Configured"}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})})]}),o&&d.jsxs(Te,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Routing Configuration"})}),d.jsx(Ne,{children:d.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Name"}),d.jsx("dd",{className:"font-medium",children:o.name})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Type"}),d.jsx("dd",{className:"font-medium capitalize",children:(u=o.algorithm_data||o.algorithm)==null?void 0:u.type})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Algorithm For"}),d.jsx("dd",{className:"font-medium capitalize",children:o.algorithm_for})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"ID"}),d.jsx("dd",{className:"font-mono text-xs text-slate-600",children:o.id})]})]})})]})]})}function WM(){const e=xp(),{merchantId:t}=ra(),{data:r}=vn(t?`/routing/list/active/${t}`:null,()=>ft(`/routing/list/active/${t}`)),{data:n}=vn(t?["/rule/get","successRate",t]:null,()=>ft("/rule/get",{merchant_id:t,algorithm:"successRate"})),i=[{id:"sr",title:"Auth-Rate Based Routing",description:"Dynamically route to the best-performing gateway based on real-time authorization rates.",icon:ME,route:"/routing/sr",algorithmType:"successRate",checkConfigured:()=>{var a;return!!((a=n==null?void 0:n.config)!=null&&a.data)}},{id:"rules",title:"Rule-Based Routing",description:"Declarative Euclid DSL rules to route payments based on conditions and attributes.",icon:gI,route:"/routing/rules",algorithmType:"advanced",checkConfigured:()=>(r||[]).some(a=>{var o;return((o=a.algorithm_data||a.algorithm)==null?void 0:o.type)==="advanced"})},{id:"volume",title:"Volume Split",description:"Distribute payment traffic across gateways by configurable percentage splits.",icon:Vf,route:"/routing/volume",algorithmType:"volume_split",checkConfigured:()=>(r||[]).some(a=>{var o;return((o=a.algorithm_data||a.algorithm)==null?void 0:o.type)==="volume_split"})},{id:"debit",title:"Network Routing",description:"Optimise debit network fees with acquirer-aware network-based routing.",icon:mI,route:"/routing/debit",algorithmType:"debitRouting",checkConfigured:()=>!1}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Routing Hub"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Click on any routing strategy to configure"})]}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:i.map(a=>{const o=a.icon,s=a.checkConfigured();return d.jsx(Te,{className:"flex flex-col hover:border-brand-300 cursor-pointer transition-all hover:shadow-md",onClick:()=>e(a.route),children:d.jsxs(Ne,{className:"flex-1 flex flex-col gap-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"p-2 bg-brand-50 rounded-lg border border-[#1c2d50]",children:d.jsx(o,{size:20,className:"text-brand-500"})}),d.jsx(Qt,{variant:s?"green":"gray",children:s?"Configured":"Not Configured"})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-slate-900",children:a.title}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:a.description})]}),d.jsx("div",{className:"mt-auto pt-2",children:d.jsx("span",{className:"text-sm text-brand-600 font-medium",children:s?"Manage →":"Setup →"})})]})},a.id)})})]})}var ic=e=>e.type==="checkbox",wa=e=>e instanceof Date,pr=e=>e==null;const ZE=e=>typeof e=="object";var _t=e=>!pr(e)&&!Array.isArray(e)&&ZE(e)&&!wa(e),HM=e=>_t(e)&&e.target?ic(e.target)?e.target.checked:e.target.value:e,GM=(e,t)=>t.split(".").some((r,n,i)=>!isNaN(Number(r))&&e.has(i.slice(0,n).join("."))),KM=e=>{const t=e.constructor&&e.constructor.prototype;return _t(t)&&t.hasOwnProperty("isPrototypeOf")},V0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ot(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(V0&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(_t(e)&&KM(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=ot(e[i]));return n}var Sp=e=>/^\w*$/.test(e),Qe=e=>e===void 0,Op=e=>Array.isArray(e)?e.filter(Boolean):[],W0=e=>Op(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(e,t,r)=>{if(!t||!_t(e))return r;const n=(Sp(t)?[t]:W0(t)).reduce((i,a)=>pr(i)?i:i[a],e);return Qe(n)||n===e?Qe(e[t])?r:e[t]:n},On=e=>typeof e=="boolean",fn=e=>typeof e=="function",Ve=(e,t,r)=>{let n=-1;const i=Sp(t)?[t]:W0(t),a=i.length,o=a-1;for(;++nT.useContext(JE);var XM=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Hr.all&&(t._proxyFormState[o]=!n||Hr.all),e[o]}});return i};const ek=typeof window<"u"?T.useLayoutEffect:T.useEffect;var ar=e=>typeof e=="string",YM=(e,t,r,n,i)=>ar(e)?(n&&t.watch.add(e),ae(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),ae(r,a))):(n&&(t.watchAll=!0),r),ny=e=>pr(e)||!ZE(e);function Pi(e,t,r=new WeakSet){if(ny(e)||ny(t))return Object.is(e,t);if(wa(e)&&wa(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const o=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const s=t[a];if(wa(o)&&wa(s)||(_t(o)||Array.isArray(o))&&(_t(s)||Array.isArray(s))?!Pi(o,s,r):!Object.is(o,s))return!1}}return!0}const ZM=T.createContext(null);ZM.displayName="HookFormContext";var tk=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},vr=e=>Array.isArray(e)?e:[e],$1=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}};function rk(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],a=t[n];if(i&&_t(i)&&a){const o=rk(i,a);_t(o)&&(r[n]=o)}else e[n]&&(r[n]=a)}return r}var Zt=e=>_t(e)&&!Object.keys(e).length,H0=e=>e.type==="file",Wf=e=>{if(!V0)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},nk=e=>e.type==="select-multiple",G0=e=>e.type==="radio",QM=e=>G0(e)||ic(e),lm=e=>Wf(e)&&e.isConnected;function JM(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(fn(e[t]))return!0;return!1};function ik(e){return Array.isArray(e)||_t(e)&&!tD(e)}function iy(e,t={}){for(const r in e){const n=e[r];ik(n)?(t[r]=Array.isArray(n)?[]:{},iy(n,t[r])):Qe(n)||(t[r]=!0)}return t}function wl(e,t,r){r||(r=iy(t));for(const n in e){const i=e[n];if(ik(i))Qe(t)||ny(r[n])?r[n]=iy(i,Array.isArray(i)?[]:{}):wl(i,pr(t)?{}:t[n],r[n]);else{const a=t[n];r[n]=!Pi(i,a)}}return r}const R1={value:!1,isValid:!1},I1={value:!0,isValid:!0};var ak=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Qe(e[0].attributes.value)?Qe(e[0].value)||e[0].value===""?I1:{value:e[0].value,isValid:!0}:I1:R1}return R1},ok=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Qe(e)?e:t?e===""?NaN:e&&+e:r&&ar(e)?new Date(e):n?n(e):e;const M1={isValid:!1,value:null};var sk=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,M1):M1;function D1(e){const t=e.ref;return H0(t)?t.files:G0(t)?sk(e.refs).value:nk(t)?[...t.selectedOptions].map(({value:r})=>r):ic(t)?ak(e.refs).value:ok(Qe(t.value)?e.ref.value:t.value,e)}var rD=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,nD=(e,t,r,n)=>{const i={};for(const a of e){const o=ae(t,a);o&&Ve(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Hf=e=>e instanceof RegExp,nl=e=>Qe(e)?e:Hf(e)?e.source:_t(e)?Hf(e.value)?e.value.source:e.value:e,wo=e=>({isOnSubmit:!e||e===Hr.onSubmit,isOnBlur:e===Hr.onBlur,isOnChange:e===Hr.onChange,isOnAll:e===Hr.all,isOnTouch:e===Hr.onTouched});const L1="AsyncFunction";var iD=e=>!!e&&!!e.validate&&!!(fn(e.validate)&&e.validate.constructor.name===L1||_t(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===L1)),aD=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ay=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ro=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=ae(e,i);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Ro(s,t))break}else if(_t(s)&&Ro(s,t))break}}};function B1(e,t,r){const n=ae(e,r);if(n||Sp(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=ae(t,a),s=ae(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};i.pop()}return{name:r}}var oD=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return Zt(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||Hr.all))},sD=(e,t,r)=>!e||!t||e===t||vr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),lD=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,uD=(e,t)=>!Op(ae(e,t)).length&&bt(e,t),lk=(e,t,r)=>{const n=vr(ae(e,r));return Ve(n,QE,t[r]),Ve(e,r,n),e};function F1(e,t,r="validate"){if(ar(e)||Array.isArray(e)&&e.every(ar)||On(e)&&!e)return{type:r,message:ar(e)?e:"",ref:t}}var ro=e=>_t(e)&&!Hf(e)?e:{value:e,message:""},oy=async(e,t,r,n,i,a)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:f,min:c,max:p,pattern:h,validate:b,name:v,valueAsNumber:g,mount:y}=e._f,m=ae(r,v);if(!y||t.has(v))return{};const w=s?s[0]:o,S=P=>{i&&w.reportValidity&&(w.setCustomValidity(On(P)?"":P||""),w.reportValidity())},x={},_=G0(o),O=ic(o),A=_||O,E=(g||H0(o))&&Qe(o.value)&&Qe(m)||Wf(o)&&o.value===""||m===""||Array.isArray(m)&&!m.length,$=tk.bind(null,v,n,x),N=(P,I,D,B=on.maxLength,V=on.minLength)=>{const U=P?I:D;x[v]={type:P?B:V,message:U,ref:o,...$(P?B:V,U)}};if(a?!Array.isArray(m)||!m.length:l&&(!A&&(E||pr(m))||On(m)&&!m||O&&!ak(s).isValid||_&&!sk(s).isValid)){const{value:P,message:I}=ar(l)?{value:!!l,message:l}:ro(l);if(P&&(x[v]={type:on.required,message:I,ref:w,...$(on.required,I)},!n))return S(I),x}if(!E&&(!pr(c)||!pr(p))){let P,I;const D=ro(p),B=ro(c);if(!pr(m)&&!isNaN(m)){const V=o.valueAsNumber||m&&+m;pr(D.value)||(P=V>D.value),pr(B.value)||(I=Vnew Date(new Date().toDateString()+" "+L),R=o.type=="time",F=o.type=="week";ar(D.value)&&m&&(P=R?U(m)>U(D.value):F?m>D.value:V>new Date(D.value)),ar(B.value)&&m&&(I=R?U(m)+P.value,B=!pr(I.value)&&m.length<+I.value;if((D||B)&&(N(D,P.message,I.message),!n))return S(x[v].message),x}if(h&&!E&&ar(m)){const{value:P,message:I}=ro(h);if(Hf(P)&&!m.match(P)&&(x[v]={type:on.pattern,message:I,ref:o,...$(on.pattern,I)},!n))return S(I),x}if(b){if(fn(b)){const P=await b(m,r),I=F1(P,w);if(I&&(x[v]={...I,...$(on.validate,I.message)},!n))return S(I.message),x}else if(_t(b)){let P={};for(const I in b){if(!Zt(P)&&!n)break;const D=F1(await b[I](m,r),w,I);D&&(P={...D,...$(I,D.message)},S(D.message),n&&(x[v]=P))}if(!Zt(P)&&(x[v]={ref:w,...P},!n))return x}}return S(!0),x};const cD={mode:Hr.onSubmit,reValidateMode:Hr.onChange,shouldFocusError:!0};function fD(e={}){let t={...cD,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:fn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=_t(t.defaultValues)||_t(t.values)?ot(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ot(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},c={...f};let p={...c};const h={array:$1(),state:$1()},b=t.criteriaMode===Hr.all,v=C=>M=>{clearTimeout(u),u=setTimeout(C,M)},g=async C=>{if(!o.keepIsValid&&!t.disabled&&(c.isValid||p.isValid||C)){let M;t.resolver?(M=Zt((await E()).errors),y()):M=await P({fields:n,onlyCheckValid:!0,eventType:to.VALID}),M!==r.isValid&&h.state.next({isValid:M})}},y=(C,M)=>{!t.disabled&&(c.isValidating||c.validatingFields||p.isValidating||p.validatingFields)&&((C||Array.from(s.mount)).forEach(z=>{z&&(M?Ve(r.validatingFields,z,M):bt(r.validatingFields,z))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Zt(r.validatingFields)}))},m=C=>{const M=wl(i,a),z=rD(C);Ve(r.dirtyFields,z,ae(M,z))},w=(C,M=[],z,te,ee=!0,Q=!0)=>{if(te&&z&&!t.disabled){if(o.action=!0,Q&&Array.isArray(ae(n,C))){const re=z(ae(n,C),te.argA,te.argB);ee&&Ve(n,C,re)}if(Q&&Array.isArray(ae(r.errors,C))){const re=z(ae(r.errors,C),te.argA,te.argB);ee&&Ve(r.errors,C,re),uD(r.errors,C)}if((c.touchedFields||p.touchedFields)&&Q&&Array.isArray(ae(r.touchedFields,C))){const re=z(ae(r.touchedFields,C),te.argA,te.argB);ee&&Ve(r.touchedFields,C,re)}(c.dirtyFields||p.dirtyFields)&&m(C),h.state.next({name:C,isDirty:D(C,M),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ve(a,C,M)},S=(C,M)=>{Ve(r.errors,C,M),h.state.next({errors:r.errors})},x=C=>{r.errors=C,h.state.next({errors:r.errors,isValid:!1})},_=(C,M,z,te)=>{const ee=ae(n,C);if(ee){const Q=ae(a,C,Qe(z)?ae(i,C):z);Qe(Q)||te&&te.defaultChecked||M?Ve(a,C,M?Q:D1(ee._f)):U(C,Q),o.mount&&!o.action&&g()}},O=(C,M,z,te,ee)=>{let Q=!1,re=!1;const ve={name:C};if(!t.disabled){if(!z||te){(c.isDirty||p.isDirty)&&(re=r.isDirty,r.isDirty=ve.isDirty=D(),Q=re!==ve.isDirty);const Se=Pi(ae(i,C),M);re=!!ae(r.dirtyFields,C),Se?bt(r.dirtyFields,C):Ve(r.dirtyFields,C,!0),ve.dirtyFields=r.dirtyFields,Q=Q||(c.dirtyFields||p.dirtyFields)&&re!==!Se}if(z){const Se=ae(r.touchedFields,C);Se||(Ve(r.touchedFields,C,z),ve.touchedFields=r.touchedFields,Q=Q||(c.touchedFields||p.touchedFields)&&Se!==z)}Q&&ee&&h.state.next(ve)}return Q?ve:{}},A=(C,M,z,te)=>{const ee=ae(r.errors,C),Q=(c.isValid||p.isValid)&&On(M)&&r.isValid!==M;if(t.delayError&&z?(l=v(()=>S(C,z)),l(t.delayError)):(clearTimeout(u),l=null,z?Ve(r.errors,C,z):bt(r.errors,C)),(z?!Pi(ee,z):ee)||!Zt(te)||Q){const re={...te,...Q&&On(M)?{isValid:M}:{},errors:r.errors,name:C};r={...r,...re},h.state.next(re)}},E=async C=>(y(C,!0),await t.resolver(a,t.context,nD(C||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),$=async C=>{const{errors:M}=await E(C);if(y(C),C)for(const z of C){const te=ae(M,z);te?Ve(r.errors,z,te):bt(r.errors,z)}else r.errors=M;return M},N=async({name:C,eventType:M})=>{if(e.validate){const z=await e.validate({formValues:a,formState:r,name:C,eventType:M});if(_t(z))for(const te in z)z[te]&&xe(`${sm}.${te}`,{message:ar(z.message)?z.message:"",type:on.validate});else ar(z)||!z?xe(sm,{message:z||"",type:on.validate}):Ae(sm);return z}return!0},P=async({fields:C,onlyCheckValid:M,name:z,eventType:te,context:ee={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(ee.runRootValidation=!0,!await N({name:z,eventType:te})&&(ee.valid=!1,M)))return ee.valid;for(const Q in C){const re=C[Q];if(re){const{_f:ve,...Se}=re;if(ve){const St=s.array.has(ve.name),Gt=re._f&&iD(re._f);Gt&&c.validatingFields&&y([ve.name],!0);const Kt=await oy(re,s.disabled,a,b,t.shouldUseNativeValidation&&!M,St);if(Gt&&c.validatingFields&&y([ve.name]),Kt[ve.name]&&(ee.valid=!1,M)||(!M&&(ae(Kt,ve.name)?St?lk(r.errors,Kt,ve.name):Ve(r.errors,ve.name,Kt[ve.name]):bt(r.errors,ve.name)),e.shouldUseNativeValidation&&Kt[ve.name]))break}!Zt(Se)&&await P({context:ee,onlyCheckValid:M,fields:Se,name:Q,eventType:te})}}return ee.valid},I=()=>{for(const C of s.unMount){const M=ae(n,C);M&&(M._f.refs?M._f.refs.every(z=>!lm(z)):!lm(M._f.ref))&&ne(C)}s.unMount=new Set},D=(C,M)=>!t.disabled&&(C&&M&&Ve(a,C,M),!Pi(Y(),i)),B=(C,M,z)=>YM(C,s,{...o.mount?a:Qe(M)?i:ar(C)?{[C]:M}:M},z,M),V=C=>Op(ae(o.mount?a:i,C,t.shouldUnregister?ae(i,C,[]):[])),U=(C,M,z={})=>{const te=ae(n,C);let ee=M;if(te){const Q=te._f;Q&&(!Q.disabled&&Ve(a,C,ok(M,Q)),ee=Wf(Q.ref)&&pr(M)?"":M,nk(Q.ref)?[...Q.ref.options].forEach(re=>re.selected=ee.includes(re.value)):Q.refs?ic(Q.ref)?Q.refs.forEach(re=>{(!re.defaultChecked||!re.disabled)&&(Array.isArray(ee)?re.checked=!!ee.find(ve=>ve===re.value):re.checked=ee===re.value||!!ee)}):Q.refs.forEach(re=>re.checked=re.value===ee):H0(Q.ref)?Q.ref.value="":(Q.ref.value=ee,Q.ref.type||h.state.next({name:C,values:ot(a)})))}(z.shouldDirty||z.shouldTouch)&&O(C,ee,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&W(C)},R=(C,M,z)=>{for(const te in M){if(!M.hasOwnProperty(te))return;const ee=M[te],Q=C+"."+te,re=ae(n,Q);(s.array.has(C)||_t(ee)||re&&!re._f)&&!wa(ee)?R(Q,ee,z):U(Q,ee,z)}},F=(C,M,z={})=>{const te=ae(n,C),ee=s.array.has(C),Q=ot(M);Ve(a,C,Q),ee?(h.array.next({name:C,values:ot(a)}),(c.isDirty||c.dirtyFields||p.isDirty||p.dirtyFields)&&z.shouldDirty&&(m(C),h.state.next({name:C,dirtyFields:r.dirtyFields,isDirty:D(C,Q)}))):te&&!te._f&&!pr(Q)?R(C,Q,z):U(C,Q,z),ay(C,s)?h.state.next({...r,name:C,values:ot(a)}):h.state.next({name:o.mount?C:void 0,values:ot(a)})},L=async C=>{o.mount=!0;const M=C.target;let z=M.name,te=!0;const ee=ae(n,z),Q=Se=>{te=Number.isNaN(Se)||wa(Se)&&isNaN(Se.getTime())||Pi(Se,ae(a,z,Se))},re=wo(t.mode),ve=wo(t.reValidateMode);if(ee){let Se,St;const Gt=M.type?D1(ee._f):HM(C),Kt=C.type===to.BLUR||C.type===to.FOCUS_OUT,Ws=!aD(ee._f)&&!e.validate&&!t.resolver&&!ae(r.errors,z)&&!ee._f.deps||lD(Kt,ae(r.touchedFields,z),r.isSubmitted,ve,re),Qa=ay(z,s,Kt);Ve(a,z,Gt),Kt?(!M||!M.readOnly)&&(ee._f.onBlur&&ee._f.onBlur(C),l&&l(0)):ee._f.onChange&&ee._f.onChange(C);const Hs=O(z,Gt,Kt),mc=!Zt(Hs)||Qa;if(!Kt&&h.state.next({name:z,type:C.type,values:ot(a)}),Ws)return(c.isValid||p.isValid)&&(t.mode==="onBlur"?Kt&&g():Kt||g()),mc&&h.state.next({name:z,...Qa?{}:Hs});if(!t.resolver&&e.validate&&await N({name:z,eventType:C.type}),!Kt&&Qa&&h.state.next({...r}),t.resolver){const{errors:vc}=await E([z]);if(y([z]),Q(Gt),te){const Sh=B1(r.errors,n,z),yc=B1(vc,n,Sh.name||z);Se=yc.error,z=yc.name,St=Zt(vc)}}else y([z],!0),Se=(await oy(ee,s.disabled,a,b,t.shouldUseNativeValidation))[z],y([z]),Q(Gt),te&&(Se?St=!1:(c.isValid||p.isValid)&&(St=await P({fields:n,onlyCheckValid:!0,name:z,eventType:C.type})));te&&(ee._f.deps&&(!Array.isArray(ee._f.deps)||ee._f.deps.length>0)&&W(ee._f.deps),A(z,St,Se,Hs))}},q=(C,M)=>{if(ae(r.errors,M)&&C.focus)return C.focus(),1},W=async(C,M={})=>{let z,te;const ee=vr(C);if(t.resolver){const Q=await $(Qe(C)?C:ee);z=Zt(Q),te=C?!ee.some(re=>ae(Q,re)):z}else C?(te=(await Promise.all(ee.map(async Q=>{const re=ae(n,Q);return await P({fields:re&&re._f?{[Q]:re}:re,eventType:to.TRIGGER})}))).every(Boolean),!(!te&&!r.isValid)&&g()):te=z=await P({fields:n,name:C,eventType:to.TRIGGER});return h.state.next({...!ar(C)||(c.isValid||p.isValid)&&z!==r.isValid?{}:{name:C},...t.resolver||!C?{isValid:z}:{},errors:r.errors}),M.shouldFocus&&!te&&Ro(n,q,C?ee:s.mount),te},Y=(C,M)=>{let z={...o.mount?a:i};return M&&(z=rk(M.dirtyFields?r.dirtyFields:r.touchedFields,z)),Qe(C)?z:ar(C)?ae(z,C):C.map(te=>ae(z,te))},he=(C,M)=>({invalid:!!ae((M||r).errors,C),isDirty:!!ae((M||r).dirtyFields,C),error:ae((M||r).errors,C),isValidating:!!ae(r.validatingFields,C),isTouched:!!ae((M||r).touchedFields,C)}),Ae=C=>{const M=C?vr(C):void 0;M==null||M.forEach(z=>bt(r.errors,z)),M?M.forEach(z=>{h.state.next({name:z,errors:r.errors})}):h.state.next({errors:{}})},xe=(C,M,z)=>{const te=(ae(n,C,{_f:{}})._f||{}).ref,ee=ae(r.errors,C)||{},{ref:Q,message:re,type:ve,...Se}=ee;Ve(r.errors,C,{...Se,...M,ref:te}),h.state.next({name:C,errors:r.errors,isValid:!1}),z&&z.shouldFocus&&te&&te.focus&&te.focus()},We=(C,M)=>fn(C)?h.state.subscribe({next:z=>"values"in z&&C(B(void 0,M),z)}):B(C,M,!0),Me=C=>h.state.subscribe({next:M=>{sD(C.name,M.name,C.exact)&&oD(M,C.formState||c,ke,C.reRenderRoot)&&C.callback({values:{...a},...r,...M,defaultValues:i})}}).unsubscribe,Z=C=>(o.mount=!0,p={...p,...C.formState},Me({...C,formState:{...f,...C.formState}})),ne=(C,M={})=>{for(const z of C?vr(C):s.mount)s.mount.delete(z),s.array.delete(z),M.keepValue||(bt(n,z),bt(a,z)),!M.keepError&&bt(r.errors,z),!M.keepDirty&&bt(r.dirtyFields,z),!M.keepTouched&&bt(r.touchedFields,z),!M.keepIsValidating&&bt(r.validatingFields,z),!t.shouldUnregister&&!M.keepDefaultValue&&bt(i,z);h.state.next({values:ot(a)}),h.state.next({...r,...M.keepDirty?{isDirty:D()}:{}}),!M.keepIsValid&&g()},pe=({disabled:C,name:M})=>{if(On(C)&&o.mount||C||s.disabled.has(M)){const ee=s.disabled.has(M)!==!!C;C?s.disabled.add(M):s.disabled.delete(M),ee&&o.mount&&!o.action&&g()}},k=(C,M={})=>{let z=ae(n,C);const te=On(M.disabled)||On(t.disabled),ee=!s.registerName.has(C)&&z&&!z._f.mount;return Ve(n,C,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:C}},name:C,mount:!0,...M}}),s.mount.add(C),z&&!ee?pe({disabled:On(M.disabled)?M.disabled:t.disabled,name:C}):_(C,!0,M.value),{...te?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:nl(M.min),max:nl(M.max),minLength:nl(M.minLength),maxLength:nl(M.maxLength),pattern:nl(M.pattern)}:{},name:C,onChange:L,onBlur:L,ref:Q=>{if(Q){s.registerName.add(C),k(C,M),s.registerName.delete(C),z=ae(n,C);const re=Qe(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ve=QM(re),Se=z._f.refs||[];if(ve?Se.find(St=>St===re):re===z._f.ref)return;Ve(n,C,{_f:{...z._f,...ve?{refs:[...Se.filter(lm),re,...Array.isArray(ae(i,C))?[{}]:[]],ref:{type:re.type,name:C}}:{ref:re}}}),_(C,!1,void 0,re)}else z=ae(n,C,{}),z._f&&(z._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(GM(s.array,C)&&o.action)&&s.unMount.add(C)}}},H=()=>t.shouldFocusError&&Ro(n,q,s.mount),K=C=>{On(C)&&(h.state.next({disabled:C}),Ro(n,(M,z)=>{const te=ae(n,z);te&&(M.disabled=te._f.disabled||C,Array.isArray(te._f.refs)&&te._f.refs.forEach(ee=>{ee.disabled=te._f.disabled||C}))},0,!1))},me=(C,M)=>async z=>{let te;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let ee=ot(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:Q,values:re}=await E();y(),r.errors=Q,ee=ot(re)}else await P({fields:n,eventType:to.SUBMIT});if(s.disabled.size)for(const Q of s.disabled)bt(ee,Q);if(bt(r.errors,QE),Zt(r.errors)){h.state.next({errors:{}});try{await C(ee,z)}catch(Q){te=Q}}else M&&await M({...r.errors},z),H(),setTimeout(H);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Zt(r.errors)&&!te,submitCount:r.submitCount+1,errors:r.errors}),te)throw te},_e=(C,M={})=>{ae(n,C)&&(Qe(M.defaultValue)?F(C,ot(ae(i,C))):(F(C,M.defaultValue),Ve(i,C,ot(M.defaultValue))),M.keepTouched||bt(r.touchedFields,C),M.keepDirty||(bt(r.dirtyFields,C),r.isDirty=M.defaultValue?D(C,ot(ae(i,C))):D()),M.keepError||(bt(r.errors,C),c.isValid&&g()),h.state.next({...r}))},de=(C,M={})=>{const z=C?ot(C):i,te=ot(z),ee=Zt(C),Q=ee?i:te;if(M.keepDefaultValues||(i=z),!M.keepValues){if(M.keepDirtyValues){const re=new Set([...s.mount,...Object.keys(wl(i,a))]);for(const ve of Array.from(re)){const Se=ae(r.dirtyFields,ve),St=ae(a,ve),Gt=ae(Q,ve);Se&&!Qe(St)?Ve(Q,ve,St):!Se&&!Qe(Gt)&&F(ve,Gt)}}else{if(V0&&Qe(C))for(const re of s.mount){const ve=ae(n,re);if(ve&&ve._f){const Se=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(Wf(Se)){const St=Se.closest("form");if(St){St.reset();break}}}}if(M.keepFieldsRef)for(const re of s.mount)F(re,ae(Q,re));else n={}}a=t.shouldUnregister?M.keepDefaultValues?ot(i):{}:ot(Q),h.array.next({values:{...Q}}),h.state.next({values:{...Q}})}s={mount:M.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!c.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!Zt(Q),o.watch=!!t.shouldUnregister,o.keepIsValid=!!M.keepIsValid,o.action=!1,M.keepErrors||(r.errors={}),h.state.next({submitCount:M.keepSubmitCount?r.submitCount:0,isDirty:ee?!1:M.keepDirty?r.isDirty:!!(M.keepDefaultValues&&!Pi(C,i)),isSubmitted:M.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ee?{}:M.keepDirtyValues?M.keepDefaultValues&&a?wl(i,a):r.dirtyFields:M.keepDefaultValues&&C?wl(i,C):M.keepDirty?r.dirtyFields:{},touchedFields:M.keepTouched?r.touchedFields:{},errors:M.keepErrors?r.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},fe=(C,M)=>de(fn(C)?C(a):C,{...t.resetOptions,...M}),je=(C,M={})=>{const z=ae(n,C),te=z&&z._f;if(te){const ee=te.refs?te.refs[0]:te.ref;ee.focus&&setTimeout(()=>{ee.focus(),M.shouldSelect&&fn(ee.select)&&ee.select()})}},ke=C=>{r={...r,...C}},ze={control:{register:k,unregister:ne,getFieldState:he,handleSubmit:me,setError:xe,_subscribe:Me,_runSchema:E,_updateIsValidating:y,_focusError:H,_getWatch:B,_getDirty:D,_setValid:g,_setFieldArray:w,_setDisabledField:pe,_setErrors:x,_getFieldArray:V,_reset:de,_resetDefaultValues:()=>fn(t.defaultValues)&&t.defaultValues().then(C=>{fe(C,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:K,_subjects:h,_proxyFormState:c,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(C){o=C},get _defaultValues(){return i},get _names(){return s},set _names(C){s=C},get _formState(){return r},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:Z,trigger:W,register:k,handleSubmit:me,watch:We,setValue:F,getValues:Y,reset:fe,resetField:_e,clearErrors:Ae,unregister:ne,setError:xe,setFocus:je,getFieldState:he};return{...ze,formControl:ze}}var bi=()=>{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 r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},um=(e,t,r={})=>r.shouldFocus||Qe(r.shouldFocus)?r.focusName||`${e}.${Qe(r.focusIndex)?t:r.focusIndex}.`:"",cm=(e,t)=>[...e,...vr(t)],fm=e=>Array.isArray(e)?e.map(()=>{}):void 0;function dm(e,t,r){return[...e.slice(0,t),...vr(r),...e.slice(t)]}var pm=(e,t,r)=>Array.isArray(e)?(Qe(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],hm=(e,t)=>[...vr(t),...vr(e)];function dD(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return Op(n).length?n:[]}var mm=(e,t)=>Qe(t)?[]:dD(e,vr(t).sort((r,n)=>r-n)),vm=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},z1=(e,t,r)=>(e[t]=r,e);function pD(e){const t=qM(),{control:r=t,name:n,keyName:i="id",shouldUnregister:a,rules:o}=e,[s,l]=T.useState(r._getFieldArray(n)),u=T.useRef(r._getFieldArray(n).map(bi)),f=T.useRef(!1);r._names.array.add(n),T.useMemo(()=>o&&s.length>=0&&r.register(n,o),[r,n,s.length,o]),ek(()=>r._subjects.array.subscribe({next:({values:S,name:x})=>{if(x===n||!x){const _=ae(S,n);Array.isArray(_)&&(l(_),u.current=_.map(bi))}}}).unsubscribe,[r,n]);const c=T.useCallback(S=>{f.current=!0,r._setFieldArray(n,S)},[r,n]),p=(S,x)=>{const _=vr(ot(S)),O=cm(r._getFieldArray(n),_);r._names.focus=um(n,O.length-1,x),u.current=cm(u.current,_.map(bi)),c(O),l(O),r._setFieldArray(n,O,cm,{argA:fm(S)})},h=(S,x)=>{const _=vr(ot(S)),O=hm(r._getFieldArray(n),_);r._names.focus=um(n,0,x),u.current=hm(u.current,_.map(bi)),c(O),l(O),r._setFieldArray(n,O,hm,{argA:fm(S)})},b=S=>{const x=mm(r._getFieldArray(n),S);u.current=mm(u.current,S),c(x),l(x),!Array.isArray(ae(r._fields,n))&&Ve(r._fields,n,void 0),r._setFieldArray(n,x,mm,{argA:S})},v=(S,x,_)=>{const O=vr(ot(x)),A=dm(r._getFieldArray(n),S,O);r._names.focus=um(n,S,_),u.current=dm(u.current,S,O.map(bi)),c(A),l(A),r._setFieldArray(n,A,dm,{argA:S,argB:fm(x)})},g=(S,x)=>{const _=r._getFieldArray(n);vm(_,S,x),vm(u.current,S,x),c(_),l(_),r._setFieldArray(n,_,vm,{argA:S,argB:x},!1)},y=(S,x)=>{const _=r._getFieldArray(n);pm(_,S,x),pm(u.current,S,x),c(_),l(_),r._setFieldArray(n,_,pm,{argA:S,argB:x},!1)},m=(S,x)=>{const _=ot(x),O=z1(r._getFieldArray(n),S,_);u.current=[...O].map((A,E)=>!A||E===S?bi():u.current[E]),c(O),l([...O]),r._setFieldArray(n,O,z1,{argA:S,argB:_},!0,!1)},w=S=>{const x=vr(ot(S));u.current=x.map(bi),c([...x]),l([...x]),r._setFieldArray(n,[...x],_=>_,{},!0,!1)};return T.useEffect(()=>{if(r._state.action=!1,ay(n,r._names)&&r._subjects.state.next({...r._formState}),f.current&&(!wo(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!wo(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{r._updateIsValidating([n]);const x=ae(S.errors,n),_=ae(r._formState.errors,n);(_?!x&&_.type||x&&(_.type!==x.type||_.message!==x.message):x&&x.type)&&(x?Ve(r._formState.errors,n,x):bt(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=ae(r._fields,n);S&&S._f&&!(wo(r._options.reValidateMode).isOnSubmit&&wo(r._options.mode).isOnSubmit)&&oy(S,r._names.disabled,r._formValues,r._options.criteriaMode===Hr.all,r._options.shouldUseNativeValidation,!0).then(x=>!Zt(x)&&r._subjects.state.next({errors:lk(r._formState.errors,x,n)}))}r._subjects.state.next({name:n,values:ot(r._formValues)}),r._names.focus&&Ro(r._fields,(S,x)=>{if(r._names.focus&&x.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),f.current=!1},[s,n,r]),T.useEffect(()=>(!ae(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(x,_)=>{const O=ae(r._fields,x);O&&O._f&&(O._f.mount=_)};r._options.shouldUnregister||a?r.unregister(n):S(n,!1)}),[n,r,i,a]),{swap:T.useCallback(g,[c,n,r]),move:T.useCallback(y,[c,n,r]),prepend:T.useCallback(h,[c,n,r]),append:T.useCallback(p,[c,n,r]),remove:T.useCallback(b,[c,n,r]),insert:T.useCallback(v,[c,n,r]),update:T.useCallback(m,[c,n,r]),replace:T.useCallback(w,[c,n,r]),fields:T.useMemo(()=>s.map((S,x)=>({...S,[i]:u.current[x]||bi()})),[s,i])}}function hD(e={}){const t=T.useRef(void 0),r=T.useRef(void 0),[n,i]=T.useState({isDirty:!1,isValidating:!1,isLoading:fn(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:fn(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!fn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=fD(e);t.current={...s,formState:n}}const a=t.current.control;return a._options=e,ek(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(s=>({...s,isReady:!0})),a._formState.isReady=!0,o},[a]),T.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),T.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),T.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),T.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),T.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==n.isDirty&&a._subjects.state.next({isDirty:o})}},[a,n.isDirty]),T.useEffect(()=>{var o;e.values&&!Pi(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((o=a._options.resetOptions)===null||o===void 0)&&o.keepIsValid||a._setValid(),r.current=e.values,i(s=>({...s}))):a._resetDefaultValues()},[a,e.values]),T.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=T.useMemo(()=>XM(n,a),[a,n]),t.current}const U1=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ae(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},uk=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?U1(n.ref,r,e):n.refs&&n.refs.forEach(i=>U1(i,r,e))}},mD=(e,t)=>{t.shouldUseNativeValidation&&uk(e,t);const r={};for(const n in e){const i=ae(t.fields,n),a=Object.assign(e[n]||{},{ref:i&&i.ref});if(vD(t.names||Object.keys(e),n)){const o=Object.assign({},ae(r,n));Ve(o,"root",a),Ve(r,n,o)}else Ve(r,n,a)}return r},vD=(e,t)=>e.some(r=>r.startsWith(t+"."));var yD=function(e,t){for(var r={};e.length;){var n=e[0],i=n.code,a=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:a,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(c){return e.push(c)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=tk(o,t,r,i,u?[].concat(u,n.message):n.message)}e.shift()}return r},gD=function(e,t,r){return r===void 0&&(r={}),function(n,i,a){try{return Promise.resolve(function(o,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return a.shouldUseNativeValidation&&uk({},a),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:mD(yD(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}},Be;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Be||(Be={}));var V1;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(V1||(V1={}));const ue=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Si=e=>{switch(typeof e){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return Number.isNaN(e)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(e)?ue.array:e===null?ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ue.promise:typeof Map<"u"&&e instanceof Map?ue.map:typeof Set<"u"&&e instanceof Set?ue.set:typeof Date<"u"&&e instanceof Date?ue.date:ue.object;default:return ue.unknown}},J=Be.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 ai extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];r[a]=r[a]||[],r[a].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ai.create=e=>new ai(e);const sy=(e,t)=>{let r;switch(e.code){case J.invalid_type:e.received===ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case J.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Be.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:r=`Unrecognized key(s) in object: ${Be.joinValues(e.keys,", ")}`;break;case J.invalid_union:r="Invalid input";break;case J.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Be.joinValues(e.options)}`;break;case J.invalid_enum_value:r=`Invalid enum value. Expected ${Be.joinValues(e.options)}, received '${e.received}'`;break;case J.invalid_arguments:r="Invalid function arguments";break;case J.invalid_return_type:r="Invalid function return type";break;case J.invalid_date:r="Invalid date";break;case J.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Be.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case J.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case J.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case J.custom:r="Invalid input";break;case J.invalid_intersection_types:r="Intersection results could not be merged";break;case J.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case J.not_finite:r="Number must be finite";break;default:r=t.defaultError,Be.assertNever(e)}return{message:r}};let xD=sy;function bD(){return xD}const wD=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function oe(e,t){const r=bD(),n=wD({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===sy?void 0:sy].filter(i=>!!i)});e.common.issues.push(n)}class Ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return be;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const a=await i.key,o=await i.value;n.push({key:a,value:o})}return Ir.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return be;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}}const be=Object.freeze({status:"aborted"}),_l=e=>({status:"dirty",value:e}),en=e=>({status:"valid",value:e}),W1=e=>e.status==="aborted",H1=e=>e.status==="dirty",qo=e=>e.status==="valid",Gf=e=>typeof Promise<"u"&&e instanceof Promise;var ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ce||(ce={}));class Yi{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}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 G1=(e,t)=>{if(qo(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 r=new ai(e.common.issues);return this._error=r,this._error}}};function Pe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,s)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:i}}class Le{get description(){return this._def.description}_getType(t){return Si(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ir,ctx:{common:t.parent.common,data:t.data,parsedType:Si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Gf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)},i=this._parseSync({data:t,path:n.path,parent:n});return G1(n,i)}"~validate"(t){var n,i;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return qo(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(i=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>qo(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Gf(i)?i:Promise.resolve(i));return G1(n,a)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const o=t(i),s=()=>a.addIssue({code:J.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Fa({schema:this,typeName:we.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:r=>this["~validate"](r)}}optional(){return Vi.create(this,this._def)}nullable(){return Zo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tn.create(this)}promise(){return Yf.create(this,this._def)}or(t){return qf.create([this,t],this._def)}and(t){return Xf.create(this,t,this._def)}transform(t){return new Fa({...Pe(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new uy({...Pe(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new WD({typeName:we.ZodBranded,type:this,...Pe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new cy({...Pe(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return K0.create(this,t)}readonly(){return fy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _D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:){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])$/,ID=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ck="((\\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])))",DD=new RegExp(`^${ck}$`);function fk(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function LD(e){return new RegExp(`^${fk(e)}$`)}function BD(e){let t=`${ck}T${fk(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function FD(e,t){return!!((t==="v4"||!t)&&TD.test(e)||(t==="v6"||!t)&&$D.test(e))}function zD(e,t){if(!ED.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function UD(e,t){return!!((t==="v4"||!t)&&ND.test(e)||(t==="v6"||!t)&&RD.test(e))}class Kn extends Le{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){const a=this._getOrReturnCtx(t);return oe(a,{code:J.invalid_type,expected:ue.string,received:a.parsedType}),be}const n=new Ir;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,s=t.data.lengtht.test(i),{validation:r,code:J.invalid_string,...ce.errToObj(n)})}_addCheck(t){return new Kn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ce.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ce.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ce.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ce.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==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ce.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ce.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ce.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ce.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...ce.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ce.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ce.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ce.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ce.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ce.errToObj(r)})}nonempty(t){return this.min(1,ce.errToObj(t))}trim(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Kn({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Kn({checks:[],typeName:we.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Pe(e)});function VD(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return a%o/10**i}class Da extends Le{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)!==ue.number){const a=this._getOrReturnCtx(t);return oe(a,{code:J.invalid_type,expected:ue.number,received:a.parsedType}),be}let n;const i=new Ir;for(const a of this._def.checks)a.kind==="int"?Be.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:J.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:J.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?VD(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),oe(n,{code:J.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:J.not_finite,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ce.toString(r))}setLimit(t,r,n,i){return new Da({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ce.toString(i)}]})}_addCheck(t){return new Da({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Be.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew Da({checks:[],typeName:we.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class La extends Le{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)!==ue.bigint)return this._getInvalidInput(t);let n;const i=new Ir;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:J.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:J.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return oe(r,{code:J.invalid_type,expected:ue.bigint,received:r.parsedType}),be}gte(t,r){return this.setLimit("min",t,!0,ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ce.toString(r))}setLimit(t,r,n,i){return new La({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ce.toString(i)}]})}_addCheck(t){return new La({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew La({checks:[],typeName:we.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Pe(e)});class Kf extends Le{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.boolean,received:n.parsedType}),be}return en(t.data)}}Kf.create=e=>new Kf({typeName:we.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class Xo extends Le{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){const a=this._getOrReturnCtx(t);return oe(a,{code:J.invalid_type,expected:ue.date,received:a.parsedType}),be}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return oe(a,{code:J.invalid_date}),be}const n=new Ir;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Be.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Xo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ce.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ce.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Xo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:we.ZodDate,...Pe(e)});class K1 extends Le{_parse(t){if(this._getType(t)!==ue.symbol){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.symbol,received:n.parsedType}),be}return en(t.data)}}K1.create=e=>new K1({typeName:we.ZodSymbol,...Pe(e)});class q1 extends Le{_parse(t){if(this._getType(t)!==ue.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.undefined,received:n.parsedType}),be}return en(t.data)}}q1.create=e=>new q1({typeName:we.ZodUndefined,...Pe(e)});class X1 extends Le{_parse(t){if(this._getType(t)!==ue.null){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.null,received:n.parsedType}),be}return en(t.data)}}X1.create=e=>new X1({typeName:we.ZodNull,...Pe(e)});class Y1 extends Le{constructor(){super(...arguments),this._any=!0}_parse(t){return en(t.data)}}Y1.create=e=>new Y1({typeName:we.ZodAny,...Pe(e)});class Z1 extends Le{constructor(){super(...arguments),this._unknown=!0}_parse(t){return en(t.data)}}Z1.create=e=>new Z1({typeName:we.ZodUnknown,...Pe(e)});class Zi extends Le{_parse(t){const r=this._getOrReturnCtx(t);return oe(r,{code:J.invalid_type,expected:ue.never,received:r.parsedType}),be}}Zi.create=e=>new Zi({typeName:we.ZodNever,...Pe(e)});class Q1 extends Le{_parse(t){if(this._getType(t)!==ue.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.void,received:n.parsedType}),be}return en(t.data)}}Q1.create=e=>new Q1({typeName:we.ZodVoid,...Pe(e)});class Tn extends Le{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ue.array)return oe(r,{code:J.invalid_type,expected:ue.array,received:r.parsedType}),be;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,s=r.data.lengthi.maxLength.value&&(oe(r,{code:J.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new Yi(r,o,r.path,s)))).then(o=>Ir.mergeArray(n,o));const a=[...r.data].map((o,s)=>i.type._parseSync(new Yi(r,o,r.path,s)));return Ir.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new Tn({...this._def,minLength:{value:t,message:ce.toString(r)}})}max(t,r){return new Tn({...this._def,maxLength:{value:t,message:ce.toString(r)}})}length(t,r){return new Tn({...this._def,exactLength:{value:t,message:ce.toString(r)}})}nonempty(t){return this.min(1,t)}}Tn.create=(e,t)=>new Tn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Pe(t)});function ao(e){if(e instanceof jt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Vi.create(ao(n))}return new jt({...e._def,shape:()=>t})}else return e instanceof Tn?new Tn({...e._def,type:ao(e.element)}):e instanceof Vi?Vi.create(ao(e.unwrap())):e instanceof Zo?Zo.create(ao(e.unwrap())):e instanceof Ba?Ba.create(e.items.map(t=>ao(t))):e}class jt extends Le{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(),r=Be.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ue.object){const u=this._getOrReturnCtx(t);return oe(u,{code:J.invalid_type,expected:ue.object,received:u.parsedType}),be}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Zi&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const f=a[u],c=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new Yi(i,c,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Zi){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")s.length>0&&(oe(i,{code:J.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of s){const c=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new Yi(i,c,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const c=await f.key,p=await f.value;u.push({key:c,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>Ir.mergeObjectSync(n,u)):Ir.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return ce.errToObj,new jt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,o;const i=((o=(a=this._def).errorMap)==null?void 0:o.call(a,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:ce.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new jt({...this._def,unknownKeys:"strip"})}passthrough(){return new jt({...this._def,unknownKeys:"passthrough"})}extend(t){return new jt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new jt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new jt({...this._def,catchall:t})}pick(t){const r={};for(const n of Be.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new jt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Be.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new jt({...this._def,shape:()=>r})}deepPartial(){return ao(this)}partial(t){const r={};for(const n of Be.objectKeys(this.shape)){const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new jt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Be.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Vi;)a=a._def.innerType;r[n]=a}return new jt({...this._def,shape:()=>r})}keyof(){return dk(Be.objectKeys(this.shape))}}jt.create=(e,t)=>new jt({shape:()=>e,unknownKeys:"strip",catchall:Zi.create(),typeName:we.ZodObject,...Pe(t)});jt.strictCreate=(e,t)=>new jt({shape:()=>e,unknownKeys:"strict",catchall:Zi.create(),typeName:we.ZodObject,...Pe(t)});jt.lazycreate=(e,t)=>new jt({shape:e,unknownKeys:"strip",catchall:Zi.create(),typeName:we.ZodObject,...Pe(t)});class qf extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new ai(s.ctx.common.issues));return oe(r,{code:J.invalid_union,unionErrors:o}),be}if(r.common.async)return Promise.all(n.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new ai(l));return oe(r,{code:J.invalid_union,unionErrors:s}),be}}get options(){return this._def.options}}qf.create=(e,t)=>new qf({options:e,typeName:we.ZodUnion,...Pe(t)});function ly(e,t){const r=Si(e),n=Si(t);if(e===t)return{valid:!0,data:e};if(r===ue.object&&n===ue.object){const i=Be.objectKeys(t),a=Be.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...t};for(const s of a){const l=ly(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===ue.array&&n===ue.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a{if(W1(a)||W1(o))return be;const s=ly(a.value,o.value);return s.valid?((H1(a)||H1(o))&&r.dirty(),{status:r.value,value:s.data}):(oe(n,{code:J.invalid_intersection_types}),be)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Xf.create=(e,t,r)=>new Xf({left:e,right:t,typeName:we.ZodIntersection,...Pe(r)});class Ba extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.array)return oe(n,{code:J.invalid_type,expected:ue.array,received:n.parsedType}),be;if(n.data.lengththis._def.items.length&&(oe(n,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Yi(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Ir.mergeArray(r,o)):Ir.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Ba({...this._def,rest:t})}}Ba.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ba({items:e,typeName:we.ZodTuple,rest:null,...Pe(t)})};class J1 extends Le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.map)return oe(n,{code:J.invalid_type,expected:ue.map,received:n.parsedType}),be;const i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:i._parse(new Yi(n,s,n.path,[u,"key"])),value:a._parse(new Yi(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return be;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return be;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}}J1.create=(e,t,r)=>new J1({valueType:t,keyType:e,typeName:we.ZodMap,...Pe(r)});class cu extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.set)return oe(n,{code:J.invalid_type,expected:ue.set,received:n.parsedType}),be;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(oe(n,{code:J.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return be;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>a._parse(new Yi(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new cu({...this._def,minSize:{value:t,message:ce.toString(r)}})}max(t,r){return new cu({...this._def,maxSize:{value:t,message:ce.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}cu.create=(e,t)=>new cu({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...Pe(t)});class ew extends Le{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ew.create=(e,t)=>new ew({getter:e,typeName:we.ZodLazy,...Pe(t)});class tw extends Le{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return oe(r,{received:r.data,code:J.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}tw.create=(e,t)=>new tw({value:e,typeName:we.ZodLiteral,...Pe(t)});function dk(e,t){return new Yo({values:e,typeName:we.ZodEnum,...Pe(t)})}class Yo extends Le{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{expected:Be.joinValues(n),received:r.parsedType,code:J.invalid_type}),be}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{received:r.data,code:J.invalid_enum_value,options:n}),be}return en(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Yo.create(t,{...this._def,...r})}exclude(t,r=this._def){return Yo.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Yo.create=dk;class rw extends Le{_parse(t){const r=Be.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ue.string&&n.parsedType!==ue.number){const i=Be.objectValues(r);return oe(n,{expected:Be.joinValues(i),received:n.parsedType,code:J.invalid_type}),be}if(this._cache||(this._cache=new Set(Be.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Be.objectValues(r);return oe(n,{received:n.data,code:J.invalid_enum_value,options:i}),be}return en(t.data)}get enum(){return this._def.values}}rw.create=(e,t)=>new rw({values:e,typeName:we.ZodNativeEnum,...Pe(t)});class Yf extends Le{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.promise&&r.common.async===!1)return oe(r,{code:J.invalid_type,expected:ue.promise,received:r.parsedType}),be;const n=r.parsedType===ue.promise?r.data:Promise.resolve(r.data);return en(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Yf.create=(e,t)=>new Yf({type:e,typeName:we.ZodPromise,...Pe(t)});class Fa extends Le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{oe(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return be;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?be:l.status==="dirty"||r.value==="dirty"?_l(l.value):l});{if(r.value==="aborted")return be;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?be:s.status==="dirty"||r.value==="dirty"?_l(s.value):s}}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?be:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?be:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!qo(o))return be;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>qo(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):be);Be.assertNever(i)}}Fa.create=(e,t,r)=>new Fa({schema:e,typeName:we.ZodEffects,effect:t,...Pe(r)});Fa.createWithPreprocess=(e,t,r)=>new Fa({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...Pe(r)});class Vi extends Le{_parse(t){return this._getType(t)===ue.undefined?en(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Vi.create=(e,t)=>new Vi({innerType:e,typeName:we.ZodOptional,...Pe(t)});class Zo extends Le{_parse(t){return this._getType(t)===ue.null?en(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Zo.create=(e,t)=>new Zo({innerType:e,typeName:we.ZodNullable,...Pe(t)});class uy extends Le{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ue.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}uy.create=(e,t)=>new uy({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Pe(t)});class cy extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Gf(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ai(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ai(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}cy.create=(e,t)=>new cy({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Pe(t)});class nw extends Le{_parse(t){if(this._getType(t)!==ue.nan){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:ue.nan,received:n.parsedType}),be}return{status:"valid",value:t.data}}}nw.create=e=>new nw({typeName:we.ZodNaN,...Pe(e)});class WD extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class K0 extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?be:a.status==="dirty"?(r.dirty(),_l(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?be:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new K0({in:t,out:r,typeName:we.ZodPipeline})}}class fy extends Le{_parse(t){const r=this._def.innerType._parse(t),n=i=>(qo(i)&&(i.value=Object.freeze(i.value)),i);return Gf(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}fy.create=(e,t)=>new fy({innerType:e,typeName:we.ZodReadonly,...Pe(t)});var we;(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"})(we||(we={}));const iw=Kn.create,$l=Da.create;La.create;Kf.create;Xo.create;Zi.create;const HD=Tn.create,pk=jt.create;qf.create;Xf.create;Ba.create;Yo.create;Yf.create;Vi.create;Zo.create;const Rl=Fa.createWithPreprocess,hk={string:e=>Kn.create({...e,coerce:!0}),number:e=>Da.create({...e,coerce:!0}),boolean:e=>Kf.create({...e,coerce:!0}),bigint:e=>La.create({...e,coerce:!0}),date:e=>Xo.create({...e,coerce:!0})},GD={primary:"bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white",ghost:"text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]",danger:"bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]"},KD={sm:"px-4 py-1.5 text-xs font-semibold",md:"px-5 py-2.5 text-sm font-semibold"};function ht({variant:e="primary",size:t="md",className:r="",...n}){return d.jsx("button",{className:`relative inline-flex items-center justify-center gap-2 rounded-full transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/50 focus:ring-offset-1 focus:ring-offset-transparent focus:border-transparent ${GD[e]} ${KD[t]} ${r}`,...n,children:n.children})}function Qo({error:e}){return e?d.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/8 px-4 py-3 text-sm text-red-400 font-mono",children:e}):null}function En({size:e=20}){return d.jsxs("svg",{className:"animate-spin text-brand-500",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}const qD={payment_method:{type:"enum",values:["card","bank_debit","bank_transfer"]},amount:{type:"integer",values:[]},currency:{type:"enum",values:["USD","EUR","GBP","INR","JPY","CAD","AUD","SGD","AED"]},payment_type:{type:"enum",values:["normal","new_mandate","setup_mandate","recurring_mandate","non_mandate"]},card_network:{type:"enum",values:["visa","mastercard","amex","jcb","diners_club","discover","cartes_bancaires","union_pay","interac","rupay","maestro"]},authentication_type:{type:"enum",values:["three_ds","no_three_ds"]},card_type:{type:"enum",values:["debit","credit"]},card:{type:"enum",values:["debit","credit"]}},XD={SR_SELECTION_V3_ROUTING:"bg-blue-100 text-blue-800",PRIORITY_LOGIC:"bg-purple-100 text-purple-800",NTW_BASED_ROUTING:"bg-green-100 text-green-800",SR_SELECTION_V3_ROUTING_WITH_HEDGING:"bg-orange-100 text-orange-800",HEDGING:"bg-orange-100 text-orange-800"},YD=["card","card_redirect","pay_later","wallet","bank_redirect","bank_transfer","crypto","bank_debit","reward","real_time_payment","upi","voucher","gift_card","open_banking","mobile_payment"],ZD={card:["credit","debit"],bank_debit:["ach","sepa","bacs","becs"],bank_transfer:["ach","sepa","sepa_bank_transfer","bacs","multibanco","pix","pse","permata_bank_transfer","bca_bank_transfer","bni_va","bri_va","cimb_va","danamon_va","mandiri_va","local_bank_transfer","instant_bank_transfer"],wallet:["amazon_pay","apple_pay","google_pay","paypal","ali_pay","ali_pay_hk","dana","mb_way","mobile_pay","samsung_pay","twint","vipps","touch_n_go","swish","we_chat_pay","go_pay","gcash","momo","kakao_pay","cashapp","mifinity","paze"],pay_later:["affirm","alma","afterpay_clearpay","klarna","pay_bright","atome","walley"],upi:["upi_collect","upi_intent"],voucher:["boleto","efecty","pago_efectivo","red_compra","red_pagos","indomaret","alfamart","oxxo","seven_eleven","lawson","mini_stop","family_mart","seicomart","pay_easy"],bank_redirect:["giropay","ideal","sofort","eft","eps","bancontact_card","blik","local_bank_redirect","online_banking_thailand","online_banking_czech_republic","online_banking_finland","online_banking_fpx","online_banking_poland","online_banking_slovakia","przelewy24","trustly","bizum","interac","open_banking_uk","open_banking_pis"],gift_card:["givex","pay_safe_card"],card_redirect:["knet","benefit","momo_atm","card_redirect"],real_time_payment:["fps","duit_now","prompt_pay","viet_qr"],crypto:["crypto_currency"],reward:["evoucher","classic_reward"],open_banking:["open_banking_pis"],mobile_payment:["direct_carrier_billing"]},QD=pk({paymentMethodType:iw().min(1),paymentMethod:iw().min(1),bucketSize:hk.number().int().positive(),hedgingPercent:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),latencyThreshold:Rl(e=>e===""||e===null?null:Number(e),$l().nullable())}),JD=pk({defaultBucketSize:hk.number().int().positive(),defaultSuccessRate:Rl(e=>e===""||e===null?null:Number(e),$l().min(0).max(1).nullable()),defaultLatencyThreshold:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),defaultHedgingPercent:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),subLevelInputConfig:HD(QD)});function eL(){var I,D,B,V,U;const{merchantId:e}=ra(),[t,r]=j.useState(!1),[n,i]=j.useState(null),[a,o]=j.useState(!1),[s,l]=j.useState(!1),[u,f]=j.useState(!1),[c,p]=j.useState(null),{data:h,isLoading:b,mutate:v}=vn(e?["rule-sr",e]:null,()=>ft("/rule/get",{merchant_id:e,algorithm:"successRate"}),{shouldRetryOnError:!1}),{register:g,control:y,handleSubmit:m,reset:w,watch:S,formState:{errors:x}}=hD({resolver:gD(JD),defaultValues:{defaultBucketSize:200,defaultSuccessRate:.5,defaultLatencyThreshold:null,defaultHedgingPercent:null,subLevelInputConfig:[]}});j.useEffect(()=>{var R;if((R=h==null?void 0:h.config)!=null&&R.data){const F=h.config.data;w({defaultBucketSize:F.defaultBucketSize??200,defaultSuccessRate:F.defaultSuccessRate??.5,defaultLatencyThreshold:F.defaultLatencyThreshold??null,defaultHedgingPercent:F.defaultHedgingPercent??null,subLevelInputConfig:F.subLevelInputConfig??[]})}},[h,w]);const{fields:_,append:O,remove:A}=pD({control:y,name:"subLevelInputConfig"}),E=S("subLevelInputConfig");async function $(){try{await ft("/merchant-account/create",{merchant_id:e,gateway_success_rate_based_decider_input:null})}catch{}}async function N(R){if(!e){i("Set a Merchant ID first.");return}r(!0),i(null),o(!1);try{await $(),await ft(h?"/rule/update":"/rule/create",{merchant_id:e,config:{type:"successRate",data:{defaultBucketSize:R.defaultBucketSize,defaultSuccessRate:R.defaultSuccessRate,defaultLatencyThreshold:R.defaultLatencyThreshold,defaultHedgingPercent:R.defaultHedgingPercent,subLevelInputConfig:R.subLevelInputConfig.length>0?R.subLevelInputConfig:null}}}),o(!0),v()}catch(F){i(F instanceof Error?F.message:String(F))}finally{r(!1)}}async function P(){if(e){f(!0),p(null);try{await ft("/rule/delete",{merchant_id:e,algorithm:"successRate"}),v(void 0,{revalidate:!1})}catch(R){p(R instanceof Error?R.message:String(R))}finally{f(!1)}}}return d.jsxs("div",{className:"space-y-6 max-w-5xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Auth-Rate Based Routing"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure success-rate based gateway routing"})]}),!e&&d.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-800",children:"Set a Merchant ID in the top bar to load and save configuration."}),e&&!b&&d.jsxs(Te,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Configuration Status"}),d.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(I=h==null?void 0:h.config)!=null&&I.data?"Success Rate routing is configured and active":"No Success Rate configuration found"})]}),d.jsx(Qt,{variant:(D=h==null?void 0:h.config)!=null&&D.data?"green":"gray",children:(B=h==null?void 0:h.config)!=null&&B.data?"Active":"Not Configured"})]}),((V=h==null?void 0:h.config)==null?void 0:V.data)&&d.jsxs(Ne,{className:"border-t border-slate-100 dark:border-[#222226]",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Last Modified:"}),d.jsx("span",{className:"ml-1 font-medium",children:h.modified_at?new Date(h.modified_at).toLocaleString():"Unknown"})]}),d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>{confirm("Are you sure you want to clear the Success Rate configuration? This will disable SR-based routing.")&&P()},disabled:u,children:[d.jsx(ii,{size:14,className:"mr-1"}),u?"Clearing...":"Clear Configuration"]})]}),c&&d.jsx("p",{className:"text-xs text-red-500 mt-2",children:c})]})]}),b?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx(En,{})}):d.jsxs("form",{onSubmit:m(N),className:"space-y-6",children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Success Rate Config"})}),d.jsxs(Ne,{className:"overflow-x-auto p-0",children:[d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-200 dark:border-[#1c1c24] bg-slate-50 dark:bg-[#0a0a0f]",children:[d.jsx("th",{className:"px-4 py-2",children:"Payment Method Type"}),d.jsx("th",{className:"px-4 py-2",children:"Payment Method"}),d.jsx("th",{className:"px-4 py-2",children:"Bucket Size"}),d.jsx("th",{className:"px-4 py-2",children:"Success Rate"}),d.jsx("th",{className:"px-4 py-2",children:"Hedging %"}),d.jsx("th",{className:"px-4 py-2",children:"Latency Threshold (ms)"}),d.jsx("th",{className:"px-4 py-2"})]})}),d.jsxs("tbody",{children:[d.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] bg-brand-50/50 dark:bg-[#151518]",children:[d.jsx("td",{className:"px-4 py-2 text-slate-500 italic",children:"Default"}),d.jsx("td",{className:"px-4 py-2 text-slate-400",children:"—"}),d.jsxs("td",{className:"px-4 py-2",children:[d.jsx("input",{type:"number",...g("defaultBucketSize"),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"}),x.defaultBucketSize&&d.jsx("p",{className:"text-xs text-red-500 mt-0.5",children:x.defaultBucketSize.message})]}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",...g("defaultSuccessRate"),placeholder:"0.5",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",...g("defaultHedgingPercent"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...g("defaultLatencyThreshold"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2"})]}),_.map((R,F)=>{var W;const L=((W=E==null?void 0:E[F])==null?void 0:W.paymentMethodType)||"",q=ZD[L]||[];return d.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[d.jsx("td",{className:"px-4 py-2",children:d.jsx("select",{...g(`subLevelInputConfig.${F}.paymentMethodType`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:YD.map(Y=>d.jsx("option",{value:Y,children:Y},Y))})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("select",{...g(`subLevelInputConfig.${F}.paymentMethod`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(q.length?q:["credit","debit"]).map(Y=>d.jsx("option",{value:Y,children:Y},Y))})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...g(`subLevelInputConfig.${F}.bucketSize`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",...g(`subLevelInputConfig.${F}.hedgingPercent`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...g(`subLevelInputConfig.${F}.latencyThreshold`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("button",{type:"button",onClick:()=>A(F),className:"text-slate-400 hover:text-red-500",children:d.jsx(ii,{size:14})})})]},R.id)})]})]}),d.jsx("div",{className:"px-4 py-3",children:d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>O({paymentMethodType:"card",paymentMethod:"credit",bucketSize:20,hedgingPercent:null,latencyThreshold:null}),children:[d.jsx(qi,{size:14})," Add Level"]})})]})]}),d.jsx(Qo,{error:n}),a&&d.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-4 py-3 text-sm text-emerald-400",children:"Configuration saved successfully."}),((U=h==null?void 0:h.config)==null?void 0:U.data)&&d.jsxs(Te,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Current Active Configuration"}),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!s),children:[d.jsx(wp,{size:14,className:"mr-1"}),s?"Hide":"View"]})]}),s&&d.jsx(Ne,{children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-4",children:[d.jsxs("div",{className:"border-b border-slate-200 dark:border-[#222226] pb-3",children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Default Settings"}),d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultBucketSize})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Success Rate:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultSuccessRate??"Not set"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultHedgingPercent??"Not set"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),d.jsxs("p",{className:"font-medium",children:[h.config.data.defaultLatencyThreshold??"Not set"," ms"]})]})]})]}),h.config.data.subLevelInputConfig&&h.config.data.subLevelInputConfig.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Sub-Level Configurations"}),d.jsx("div",{className:"space-y-2",children:h.config.data.subLevelInputConfig.map((R,F)=>d.jsx("div",{className:"bg-slate-50 dark:bg-[#151518] rounded-lg p-3",children:d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Payment Type:"}),d.jsx("p",{className:"font-medium capitalize",children:R.paymentMethodType})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Payment Method:"}),d.jsx("p",{className:"font-medium",children:R.paymentMethod})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),d.jsx("p",{className:"font-medium",children:R.bucketSize})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),d.jsx("p",{className:"font-medium",children:R.hedgingPercent??"Default"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),d.jsxs("p",{className:"font-medium",children:[R.latencyThreshold??"Default"," ms"]})]})]})},F))})]}),d.jsxs("div",{className:"border-t border-gray-200 pt-3",children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Raw Configuration (JSON)"}),d.jsx("pre",{className:"bg-slate-900 dark:bg-[#0f0f11] text-slate-100 border border-transparent dark:border-[#222226] rounded-lg p-3 text-xs overflow-auto max-h-64",children:JSON.stringify(h.config,null,2)})]})]})})]}),d.jsx(ht,{type:"submit",disabled:t||!e,children:t?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Saving…"]}):"Save Configuration"})]})]})}function tL(){for(var e=arguments.length,t=new Array(e),r=0;rn=>{t.forEach(i=>i(n))},t)}const jp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ps(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function q0(e){return"nodeType"in e}function wr(e){var t,r;return e?Ps(e)?e:q0(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function X0(e){const{Document:t}=wr(e);return e instanceof t}function ac(e){return Ps(e)?!1:e instanceof wr(e).HTMLElement}function mk(e){return e instanceof wr(e).SVGElement}function Cs(e){return e?Ps(e)?e.document:q0(e)?X0(e)?e:ac(e)||mk(e)?e.ownerDocument:document:document:document}const Rn=jp?j.useLayoutEffect:j.useEffect;function Y0(e){const t=j.useRef(e);return Rn(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i{e.current=setInterval(n,i)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function fu(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return Rn(()=>{r.current!==e&&(r.current=e)},t),r}function oc(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Zf(e){const t=Y0(e),r=j.useRef(null),n=j.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function dy(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let gm={};function sc(e,t){return j.useMemo(()=>{if(t)return t;const r=gm[e]==null?0:gm[e]+1;return gm[e]=r,e+"-"+r},[e,t])}function vk(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i{const s=Object.entries(o);for(const[l,u]of s){const f=a[l];f!=null&&(a[l]=f+e*u)}return a},{...t})}}const Io=vk(1),du=vk(-1);function nL(e){return"clientX"in e&&"clientY"in e}function Z0(e){if(!e)return!1;const{KeyboardEvent:t}=wr(e.target);return t&&e instanceof t}function iL(e){if(!e)return!1;const{TouchEvent:t}=wr(e.target);return t&&e instanceof t}function py(e){if(iL(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return nL(e)?{x:e.clientX,y:e.clientY}:null}const pu=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[pu.Translate.toString(e),pu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),aw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function aL(e){return e.matches(aw)?e:e.querySelector(aw)}const oL={display:"none"};function sL(e){let{id:t,value:r}=e;return T.createElement("div",{id:t,style:oL},r)}function lL(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return T.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function uL(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const yk=j.createContext(null);function cL(e){const t=j.useContext(yk);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function fL(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.useCallback(n=>{let{type:i,event:a}=n;e.forEach(o=>{var s;return(s=o[i])==null?void 0:s.call(o,a)})},[e]),t]}const dL={draggable:` - To pick up a draggable item, press the space bar. - While dragging, use the arrow keys to move the item. - Press space again to drop the item in its new position, or press escape to cancel. - `},pL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function hL(e){let{announcements:t=pL,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=dL}=e;const{announce:a,announcement:o}=uL(),s=sc("DndLiveRegion"),[l,u]=j.useState(!1);if(j.useEffect(()=>{u(!0)},[]),cL(j.useMemo(()=>({onDragStart(c){let{active:p}=c;a(t.onDragStart({active:p}))},onDragMove(c){let{active:p,over:h}=c;t.onDragMove&&a(t.onDragMove({active:p,over:h}))},onDragOver(c){let{active:p,over:h}=c;a(t.onDragOver({active:p,over:h}))},onDragEnd(c){let{active:p,over:h}=c;a(t.onDragEnd({active:p,over:h}))},onDragCancel(c){let{active:p,over:h}=c;a(t.onDragCancel({active:p,over:h}))}}),[a,t])),!l)return null;const f=T.createElement(T.Fragment,null,T.createElement(sL,{id:n,value:i.draggable}),T.createElement(lL,{id:s,announcement:o}));return r?bo.createPortal(f,r):f}var Tt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Tt||(Tt={}));function Qf(){}function ow(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function mL(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const yn=Object.freeze({x:0,y:0});function gk(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xk(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function vL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function sw(e){let{left:t,top:r,height:n,width:i}=e;return[{x:t,y:r},{x:t+i,y:r},{x:t,y:r+n},{x:t+i,y:r+n}]}function bk(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function lw(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const yL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=lw(t,t.left,t.top),a=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=gk(lw(l),i);a.push({id:s,data:{droppableContainer:o,value:u}})}}return a.sort(xk)},gL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=sw(t),a=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=sw(l),f=i.reduce((p,h,b)=>p+gk(u[b],h),0),c=Number((f/4).toFixed(4));a.push({id:s,data:{droppableContainer:o,value:c}})}}return a.sort(xk)};function xL(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-n,s=a-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:o}=a,s=r.get(o);if(s){const l=xL(s,t);l>0&&i.push({id:o,data:{droppableContainer:a,value:l}})}}return i.sort(vL)};function wL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function wk(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:yn}function _L(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a({...o,top:o.top+e*s.y,bottom:o.bottom+e*s.y,left:o.left+e*s.x,right:o.right+e*s.x}),{...r})}}const SL=_L(1);function OL(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function jL(e,t,r){const n=OL(t);if(!n)return e;const{scaleX:i,scaleY:a,x:o,y:s}=n,l=e.left-o-(1-i)*parseFloat(r),u=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=i?e.width/i:e.width,c=a?e.height/a:e.height;return{width:f,height:c,top:u,right:l+f,bottom:u+c,left:l}}const AL={ignoreTransform:!1};function Ts(e,t){t===void 0&&(t=AL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=wr(e).getComputedStyle(e);u&&(r=jL(r,u,f))}const{top:n,left:i,width:a,height:o,bottom:s,right:l}=r;return{top:n,left:i,width:a,height:o,bottom:s,right:l}}function uw(e){return Ts(e,{ignoreTransform:!0})}function EL(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function kL(e,t){return t===void 0&&(t=wr(e).getComputedStyle(e)),t.position==="fixed"}function PL(e,t){t===void 0&&(t=wr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function Ap(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(X0(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!ac(i)||mk(i)||r.includes(i))return r;const a=wr(e).getComputedStyle(i);return i!==e&&PL(i,a)&&r.push(i),kL(i,a)?r:n(i.parentNode)}return e?n(e):r}function _k(e){const[t]=Ap(e,1);return t??null}function xm(e){return!jp||!e?null:Ps(e)?e:q0(e)?X0(e)||e===Cs(e).scrollingElement?window:ac(e)?e:null:null}function Sk(e){return Ps(e)?e.scrollX:e.scrollLeft}function Ok(e){return Ps(e)?e.scrollY:e.scrollTop}function hy(e){return{x:Sk(e),y:Ok(e)}}var Dt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Dt||(Dt={}));function jk(e){return!jp||!e?!1:e===document.scrollingElement}function Ak(e){const t={x:0,y:0},r=jk(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const CL={x:.2,y:.2};function TL(e,t,r,n,i){let{top:a,left:o,right:s,bottom:l}=r;n===void 0&&(n=10),i===void 0&&(i=CL);const{isTop:u,isBottom:f,isLeft:c,isRight:p}=Ak(e),h={x:0,y:0},b={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!u&&a<=t.top+v.height?(h.y=Dt.Backward,b.y=n*Math.abs((t.top+v.height-a)/v.height)):!f&&l>=t.bottom-v.height&&(h.y=Dt.Forward,b.y=n*Math.abs((t.bottom-v.height-l)/v.height)),!p&&s>=t.right-v.width?(h.x=Dt.Forward,b.x=n*Math.abs((t.right-v.width-s)/v.width)):!c&&o<=t.left+v.width&&(h.x=Dt.Backward,b.x=n*Math.abs((t.left+v.width-o)/v.width)),{direction:h,speed:b}}function NL(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:o}=window;return{top:0,left:0,right:a,bottom:o,width:a,height:o}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ek(e){return e.reduce((t,r)=>Io(t,hy(r)),yn)}function $L(e){return e.reduce((t,r)=>t+Sk(r),0)}function RL(e){return e.reduce((t,r)=>t+Ok(r),0)}function IL(e,t){if(t===void 0&&(t=Ts),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);_k(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ML=[["x",["left","right"],$L],["y",["top","bottom"],RL]];class Q0{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Ap(r),i=Ek(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,o,s]of ML)for(const l of o)Object.defineProperty(this,l,{get:()=>{const u=s(n),f=i[a]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Il{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function DL(e){const{EventTarget:t}=wr(e);return e instanceof t?e:Cs(e)}function bm(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ur;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ur||(Ur={}));function cw(e){e.preventDefault()}function LL(e){e.stopPropagation()}var Ie;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ie||(Ie={}));const kk={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter,Ie.Tab]},BL=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ie.Right:return{...r,x:r.x+25};case Ie.Left:return{...r,x:r.x-25};case Ie.Down:return{...r,y:r.y+25};case Ie.Up:return{...r,y:r.y-25}}};class J0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Il(Cs(r)),this.windowListeners=new Il(wr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ur.Resize,this.handleCancel),this.windowListeners.add(Ur.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ur.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&IL(n),r(yn)}handleKeyDown(t){if(Z0(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=kk,coordinateGetter:o=BL,scrollBehavior:s="smooth"}=i,{code:l}=t;if(a.end.includes(l)){this.handleEnd(t);return}if(a.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,f=u?{x:u.left,y:u.top}:yn;this.referenceCoordinates||(this.referenceCoordinates=f);const c=o(t,{active:r,context:n.current,currentCoordinates:f});if(c){const p=du(c,f),h={x:0,y:0},{scrollableAncestors:b}=n.current;for(const v of b){const g=t.code,{isTop:y,isRight:m,isLeft:w,isBottom:S,maxScroll:x,minScroll:_}=Ak(v),O=NL(v),A={x:Math.min(g===Ie.Right?O.right-O.width/2:O.right,Math.max(g===Ie.Right?O.left:O.left+O.width/2,c.x)),y:Math.min(g===Ie.Down?O.bottom-O.height/2:O.bottom,Math.max(g===Ie.Down?O.top:O.top+O.height/2,c.y))},E=g===Ie.Right&&!m||g===Ie.Left&&!w,$=g===Ie.Down&&!S||g===Ie.Up&&!y;if(E&&A.x!==c.x){const N=v.scrollLeft+p.x,P=g===Ie.Right&&N<=x.x||g===Ie.Left&&N>=_.x;if(P&&!p.y){v.scrollTo({left:N,behavior:s});return}P?h.x=v.scrollLeft-N:h.x=g===Ie.Right?v.scrollLeft-x.x:v.scrollLeft-_.x,h.x&&v.scrollBy({left:-h.x,behavior:s});break}else if($&&A.y!==c.y){const N=v.scrollTop+p.y,P=g===Ie.Down&&N<=x.y||g===Ie.Up&&N>=_.y;if(P&&!p.x){v.scrollTo({top:N,behavior:s});return}P?h.y=v.scrollTop-N:h.y=g===Ie.Down?v.scrollTop-x.y:v.scrollTop-_.y,h.y&&v.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,Io(du(c,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}J0.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=kk,onActivation:i}=t,{active:a}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function fw(e){return!!(e&&"distance"in e)}function dw(e){return!!(e&&"delay"in e)}class ex{constructor(t,r,n){var i;n===void 0&&(n=DL(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:o}=a;this.props=t,this.events=r,this.document=Cs(o),this.documentListeners=new Il(this.document),this.listeners=new Il(n),this.windowListeners=new Il(wr(o)),this.initialCoordinates=(i=py(a))!=null?i:yn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ur.Resize,this.handleCancel),this.windowListeners.add(Ur.DragStart,cw),this.windowListeners.add(Ur.VisibilityChange,this.handleCancel),this.windowListeners.add(Ur.ContextMenu,cw),this.documentListeners.add(Ur.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dw(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(fw(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ur.Click,LL,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ur.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:o,options:{activationConstraint:s}}=a;if(!i)return;const l=(r=py(t))!=null?r:yn,u=du(i,l);if(!n&&s){if(fw(s)){if(s.tolerance!=null&&bm(u,s.tolerance))return this.handleCancel();if(bm(u,s.distance))return this.handleStart()}if(dw(s)&&bm(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ie.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const FL={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tx extends ex{constructor(t){const{event:r}=t,n=Cs(r.target);super(t,FL,n)}}tx.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const zL={move:{name:"mousemove"},end:{name:"mouseup"}};var my;(function(e){e[e.RightClick=2]="RightClick"})(my||(my={}));class UL extends ex{constructor(t){super(t,zL,Cs(t.event.target))}}UL.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===my.RightClick?!1:(n==null||n({event:r}),!0)}}];const wm={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class VL extends ex{constructor(t){super(t,wm)}static setup(){return window.addEventListener(wm.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(wm.move.name,t)};function t(){}}}VL.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var Ml;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ml||(Ml={}));var Jf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Jf||(Jf={}));function WL(e){let{acceleration:t,activator:r=Ml.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:o=5,order:s=Jf.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:c,threshold:p}=e;const h=GL({delta:c,disabled:!a}),[b,v]=rL(),g=j.useRef({x:0,y:0}),y=j.useRef({x:0,y:0}),m=j.useMemo(()=>{switch(r){case Ml.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ml.DraggableRect:return i}},[r,i,l]),w=j.useRef(null),S=j.useCallback(()=>{const _=w.current;if(!_)return;const O=g.current.x*y.current.x,A=g.current.y*y.current.y;_.scrollBy(O,A)},[]),x=j.useMemo(()=>s===Jf.TreeOrder?[...u].reverse():u,[s,u]);j.useEffect(()=>{if(!a||!u.length||!m){v();return}for(const _ of x){if((n==null?void 0:n(_))===!1)continue;const O=u.indexOf(_),A=f[O];if(!A)continue;const{direction:E,speed:$}=TL(_,A,m,t,p);for(const N of["x","y"])h[N][E[N]]||($[N]=0,E[N]=0);if($.x>0||$.y>0){v(),w.current=_,b(S,o),g.current=$,y.current=E;return}}g.current={x:0,y:0},y.current={x:0,y:0},v()},[t,S,n,v,a,o,JSON.stringify(m),JSON.stringify(h),b,u,x,f,JSON.stringify(p)])}const HL={x:{[Dt.Backward]:!1,[Dt.Forward]:!1},y:{[Dt.Backward]:!1,[Dt.Forward]:!1}};function GL(e){let{delta:t,disabled:r}=e;const n=dy(t);return oc(i=>{if(r||!n||!i)return HL;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Dt.Backward]:i.x[Dt.Backward]||a.x===-1,[Dt.Forward]:i.x[Dt.Forward]||a.x===1},y:{[Dt.Backward]:i.y[Dt.Backward]||a.y===-1,[Dt.Forward]:i.y[Dt.Forward]||a.y===1}}},[r,t,n])}function KL(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return oc(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function qL(e,t){return j.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...a]},[]),[e,t])}var hu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hu||(hu={}));var vy;(function(e){e.Optimized="optimized"})(vy||(vy={}));const pw=new Map;function XL(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,o]=j.useState(null),{frequency:s,measure:l,strategy:u}=i,f=j.useRef(e),c=g(),p=fu(c),h=j.useCallback(function(y){y===void 0&&(y=[]),!p.current&&o(m=>m===null?y:m.concat(y.filter(w=>!m.includes(w))))},[p]),b=j.useRef(null),v=oc(y=>{if(c&&!r)return pw;if(!y||y===pw||f.current!==e||a!=null){const m=new Map;for(let w of e){if(!w)continue;if(a&&a.length>0&&!a.includes(w.id)&&w.rect.current){m.set(w.id,w.rect.current);continue}const S=w.node.current,x=S?new Q0(l(S),S):null;w.rect.current=x,x&&m.set(w.id,x)}return m}return y},[e,a,r,c,l]);return j.useEffect(()=>{f.current=e},[e]),j.useEffect(()=>{c||h()},[r,c]),j.useEffect(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),j.useEffect(()=>{c||typeof s!="number"||b.current!==null||(b.current=setTimeout(()=>{h(),b.current=null},s))},[s,c,h,...n]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:a!=null};function g(){switch(u){case hu.Always:return!1;case hu.BeforeDragging:return r;default:return!r}}}function Pk(e,t){return oc(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function YL(e,t){return Pk(e,t)}function ZL(e){let{callback:t,disabled:r}=e;const n=Y0(t),i=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return j.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ep(e){let{callback:t,disabled:r}=e;const n=Y0(t),i=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return j.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function QL(e){return new Q0(Ts(e),e)}function hw(e,t,r){t===void 0&&(t=QL);const[n,i]=j.useState(null);function a(){i(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=ZL({callback(l){if(e)for(const u of l){const{type:f,target:c}=u;if(f==="childList"&&c instanceof HTMLElement&&c.contains(e)){a();break}}}}),s=Ep({callback:a});return Rn(()=>{a(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),n}function JL(e){const t=Pk(e);return wk(e,t)}const mw=[];function e4(e){const t=j.useRef(e),r=oc(n=>e?n&&n!==mw&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ap(e):mw,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function t4(e){const[t,r]=j.useState(null),n=j.useRef(e),i=j.useCallback(a=>{const o=xm(a.target);o&&r(s=>s?(s.set(o,hy(o)),new Map(s)):null)},[]);return j.useEffect(()=>{const a=n.current;if(e!==a){o(a);const s=e.map(l=>{const u=xm(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,hy(u)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{o(e),o(a)};function o(s){s.forEach(l=>{const u=xm(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,o)=>Io(a,o),yn):Ek(e):yn,[e,t])}function vw(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==yn;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?du(e,r.current):yn}function r4(e){j.useEffect(()=>{if(!jp)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function n4(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=o=>{a(o,t)},r},{}),[e,t])}function Ck(e){return j.useMemo(()=>e?EL(e):null,[e])}const yw=[];function i4(e,t){t===void 0&&(t=Ts);const[r]=e,n=Ck(r?wr(r):null),[i,a]=j.useState(yw);function o(){a(()=>e.length?e.map(l=>jk(l)?n:new Q0(t(l),l)):yw)}const s=Ep({callback:o});return Rn(()=>{s==null||s.disconnect(),o(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),i}function a4(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ac(t)?t:e}function o4(e){let{measure:t}=e;const[r,n]=j.useState(null),i=j.useCallback(u=>{for(const{target:f}of u)if(ac(f)){n(c=>{const p=t(f);return c?{...c,width:p.width,height:p.height}:p});break}},[t]),a=Ep({callback:i}),o=j.useCallback(u=>{const f=a4(u);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[s,l]=Zf(o);return j.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const s4=[{sensor:tx,options:{}},{sensor:J0,options:{}}],l4={current:{}},hf={draggable:{measure:uw},droppable:{measure:uw,strategy:hu.WhileDragging,frequency:vy.Optimized},dragOverlay:{measure:Ts}};class Dl extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const u4={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:hf,measureDroppableContainers:Qf,windowRect:null,measuringScheduled:!1},c4={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qf,draggableNodes:new Map,over:null,measureDroppableContainers:Qf},kp=j.createContext(c4),Tk=j.createContext(u4);function f4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dl}}}function d4(e,t){switch(t.type){case Tt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Tt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Tt.DragEnd:case Tt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Tt.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new Dl(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case Tt.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const o=new Dl(e.droppable.containers);return o.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Tt.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new Dl(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function p4(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=j.useContext(kp),a=dy(n),o=dy(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&a&&o!=null){if(!Z0(a)||document.activeElement===a.target)return;const s=i.get(o);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const c=aL(f);if(c){c.focus();break}}})}},[n,t,i,o,a]),null}function h4(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function m4(e){return j.useMemo(()=>({draggable:{...hf.draggable,...e==null?void 0:e.draggable},droppable:{...hf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...hf.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function v4(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=j.useRef(!1),{x:o,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Rn(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=r(u),c=wk(f,n);if(o||(c.x=0),s||(c.y=0),a.current=!0,Math.abs(c.x)>0||Math.abs(c.y)>0){const p=_k(u);p&&p.scrollBy({top:c.y,left:c.x})}},[t,o,s,n,r])}const Nk=j.createContext({...yn,scaleX:1,scaleY:1});var Oi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Oi||(Oi={}));const y4=j.memo(function(t){var r,n,i,a;let{id:o,accessibility:s,autoScroll:l=!0,children:u,sensors:f=s4,collisionDetection:c=bL,measuring:p,modifiers:h,...b}=t;const v=j.useReducer(d4,void 0,f4),[g,y]=v,[m,w]=fL(),[S,x]=j.useState(Oi.Uninitialized),_=S===Oi.Initialized,{draggable:{active:O,nodes:A,translate:E},droppable:{containers:$}}=g,N=O!=null?A.get(O):null,P=j.useRef({initial:null,translated:null}),I=j.useMemo(()=>{var qt;return O!=null?{id:O,data:(qt=N==null?void 0:N.data)!=null?qt:l4,rect:P}:null},[O,N]),D=j.useRef(null),[B,V]=j.useState(null),[U,R]=j.useState(null),F=fu(b,Object.values(b)),L=sc("DndDescribedBy",o),q=j.useMemo(()=>$.getEnabled(),[$]),W=m4(p),{droppableRects:Y,measureDroppableContainers:he,measuringScheduled:Ae}=XL(q,{dragging:_,dependencies:[E.x,E.y],config:W.droppable}),xe=KL(A,O),We=j.useMemo(()=>U?py(U):null,[U]),Me=yc(),Z=YL(xe,W.draggable.measure);v4({activeNode:O!=null?A.get(O):null,config:Me.layoutShiftCompensation,initialRect:Z,measure:W.draggable.measure});const ne=hw(xe,W.draggable.measure,Z),pe=hw(xe?xe.parentElement:null),k=j.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),H=$.getNodeFor((r=k.current.over)==null?void 0:r.id),K=o4({measure:W.dragOverlay.measure}),me=(n=K.nodeRef.current)!=null?n:xe,_e=_?(i=K.rect)!=null?i:ne:null,de=!!(K.nodeRef.current&&K.rect),fe=JL(de?null:ne),je=Ck(me?wr(me):null),ke=e4(_?H??xe:null),Ze=i4(ke),ze=h4(h,{transform:{x:E.x-fe.x,y:E.y-fe.y,scaleX:1,scaleY:1},activatorEvent:U,active:I,activeNodeRect:ne,containerNodeRect:pe,draggingNodeRect:_e,over:k.current.over,overlayNodeRect:K.rect,scrollableAncestors:ke,scrollableAncestorRects:Ze,windowRect:je}),C=We?Io(We,E):null,M=t4(ke),z=vw(M),te=vw(M,[ne]),ee=Io(ze,z),Q=_e?SL(_e,ze):null,re=I&&Q?c({active:I,collisionRect:Q,droppableRects:Y,droppableContainers:q,pointerCoordinates:C}):null,ve=bk(re,"id"),[Se,St]=j.useState(null),Gt=de?ze:Io(ze,te),Kt=wL(Gt,(a=Se==null?void 0:Se.rect)!=null?a:null,ne),Ws=j.useRef(null),Qa=j.useCallback((qt,Sr)=>{let{sensor:Or,options:vi}=Sr;if(D.current==null)return;const Lr=A.get(D.current);if(!Lr)return;const jr=qt.nativeEvent,xn=new Or({active:D.current,activeNode:Lr,event:jr,options:vi,context:k,onAbort(zt){if(!A.get(zt))return;const{onDragAbort:bn}=F.current,Ln={id:zt};bn==null||bn(Ln),m({type:"onDragAbort",event:Ln})},onPending(zt,yi,bn,Ln){if(!A.get(zt))return;const{onDragPending:Ks}=F.current,gi={id:zt,constraint:yi,initialCoordinates:bn,offset:Ln};Ks==null||Ks(gi),m({type:"onDragPending",event:gi})},onStart(zt){const yi=D.current;if(yi==null)return;const bn=A.get(yi);if(!bn)return;const{onDragStart:Ln}=F.current,Gs={activatorEvent:jr,active:{id:yi,data:bn.data,rect:P}};bo.unstable_batchedUpdates(()=>{Ln==null||Ln(Gs),x(Oi.Initializing),y({type:Tt.DragStart,initialCoordinates:zt,active:yi}),m({type:"onDragStart",event:Gs}),V(Ws.current),R(jr)})},onMove(zt){y({type:Tt.DragMove,coordinates:zt})},onEnd:Ja(Tt.DragEnd),onCancel:Ja(Tt.DragCancel)});Ws.current=xn;function Ja(zt){return async function(){const{active:bn,collisions:Ln,over:Gs,scrollAdjustedTranslate:Ks}=k.current;let gi=null;if(bn&&Ks){const{cancelDrop:qs}=F.current;gi={activatorEvent:jr,active:bn,collisions:Ln,delta:Ks,over:Gs},zt===Tt.DragEnd&&typeof qs=="function"&&await Promise.resolve(qs(gi))&&(zt=Tt.DragCancel)}D.current=null,bo.unstable_batchedUpdates(()=>{y({type:zt}),x(Oi.Uninitialized),St(null),V(null),R(null),Ws.current=null;const qs=zt===Tt.DragEnd?"onDragEnd":"onDragCancel";if(gi){const Oh=F.current[qs];Oh==null||Oh(gi),m({type:qs,event:gi})}})}}},[A]),Hs=j.useCallback((qt,Sr)=>(Or,vi)=>{const Lr=Or.nativeEvent,jr=A.get(vi);if(D.current!==null||!jr||Lr.dndKit||Lr.defaultPrevented)return;const xn={active:jr};qt(Or,Sr.options,xn)===!0&&(Lr.dndKit={capturedBy:Sr.sensor},D.current=vi,Qa(Or,Sr))},[A,Qa]),mc=qL(f,Hs);r4(f),Rn(()=>{ne&&S===Oi.Initializing&&x(Oi.Initialized)},[ne,S]),j.useEffect(()=>{const{onDragMove:qt}=F.current,{active:Sr,activatorEvent:Or,collisions:vi,over:Lr}=k.current;if(!Sr||!Or)return;const jr={active:Sr,activatorEvent:Or,collisions:vi,delta:{x:ee.x,y:ee.y},over:Lr};bo.unstable_batchedUpdates(()=>{qt==null||qt(jr),m({type:"onDragMove",event:jr})})},[ee.x,ee.y]),j.useEffect(()=>{const{active:qt,activatorEvent:Sr,collisions:Or,droppableContainers:vi,scrollAdjustedTranslate:Lr}=k.current;if(!qt||D.current==null||!Sr||!Lr)return;const{onDragOver:jr}=F.current,xn=vi.get(ve),Ja=xn&&xn.rect.current?{id:xn.id,rect:xn.rect.current,data:xn.data,disabled:xn.disabled}:null,zt={active:qt,activatorEvent:Sr,collisions:Or,delta:{x:Lr.x,y:Lr.y},over:Ja};bo.unstable_batchedUpdates(()=>{St(Ja),jr==null||jr(zt),m({type:"onDragOver",event:zt})})},[ve]),Rn(()=>{k.current={activatorEvent:U,active:I,activeNode:xe,collisionRect:Q,collisions:re,droppableRects:Y,draggableNodes:A,draggingNode:me,draggingNodeRect:_e,droppableContainers:$,over:Se,scrollableAncestors:ke,scrollAdjustedTranslate:ee},P.current={initial:_e,translated:Q}},[I,xe,re,Q,A,me,_e,Y,$,Se,ke,ee]),WL({...Me,delta:E,draggingRect:Q,pointerCoordinates:C,scrollableAncestors:ke,scrollableAncestorRects:Ze});const vc=j.useMemo(()=>({active:I,activeNode:xe,activeNodeRect:ne,activatorEvent:U,collisions:re,containerNodeRect:pe,dragOverlay:K,draggableNodes:A,droppableContainers:$,droppableRects:Y,over:Se,measureDroppableContainers:he,scrollableAncestors:ke,scrollableAncestorRects:Ze,measuringConfiguration:W,measuringScheduled:Ae,windowRect:je}),[I,xe,ne,U,re,pe,K,A,$,Y,Se,he,ke,Ze,W,Ae,je]),Sh=j.useMemo(()=>({activatorEvent:U,activators:mc,active:I,activeNodeRect:ne,ariaDescribedById:{draggable:L},dispatch:y,draggableNodes:A,over:Se,measureDroppableContainers:he}),[U,mc,I,ne,y,L,A,Se,he]);return T.createElement(yk.Provider,{value:w},T.createElement(kp.Provider,{value:Sh},T.createElement(Tk.Provider,{value:vc},T.createElement(Nk.Provider,{value:Kt},u)),T.createElement(p4,{disabled:(s==null?void 0:s.restoreFocus)===!1})),T.createElement(hL,{...s,hiddenTextDescribedById:L}));function yc(){const qt=(B==null?void 0:B.autoScrollEnabled)===!1,Sr=typeof l=="object"?l.enabled===!1:l===!1,Or=_&&!qt&&!Sr;return typeof l=="object"?{...l,enabled:Or}:{enabled:Or}}}),g4=j.createContext(null),gw="button",x4="Draggable";function b4(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=sc(x4),{activators:o,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:c,over:p}=j.useContext(kp),{role:h=gw,roleDescription:b="draggable",tabIndex:v=0}=i??{},g=(l==null?void 0:l.id)===t,y=j.useContext(g?Nk:g4),[m,w]=Zf(),[S,x]=Zf(),_=n4(o,t),O=fu(r);Rn(()=>(c.set(t,{id:t,key:a,node:m,activatorNode:S,data:O}),()=>{const E=c.get(t);E&&E.key===a&&c.delete(t)}),[c,t]);const A=j.useMemo(()=>({role:h,tabIndex:v,"aria-disabled":n,"aria-pressed":g&&h===gw?!0:void 0,"aria-roledescription":b,"aria-describedby":f.draggable}),[n,h,v,g,b,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:A,isDragging:g,listeners:n?void 0:_,node:m,over:p,setNodeRef:w,setActivatorNodeRef:x,transform:y}}function w4(){return j.useContext(Tk)}const _4="Droppable",S4={timeout:25};function O4(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=sc(_4),{active:o,dispatch:s,over:l,measureDroppableContainers:u}=j.useContext(kp),f=j.useRef({disabled:r}),c=j.useRef(!1),p=j.useRef(null),h=j.useRef(null),{disabled:b,updateMeasurementsFor:v,timeout:g}={...S4,...i},y=fu(v??n),m=j.useCallback(()=>{if(!c.current){c.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),h.current=null},g)},[g]),w=Ep({callback:m,disabled:b||!o}),S=j.useCallback((A,E)=>{w&&(E&&(w.unobserve(E),c.current=!1),A&&w.observe(A))},[w]),[x,_]=Zf(S),O=fu(t);return j.useEffect(()=>{!w||!x.current||(w.disconnect(),c.current=!1,w.observe(x.current))},[x,w]),j.useEffect(()=>(s({type:Tt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:x,rect:p,data:O}}),()=>s({type:Tt.UnregisterDroppable,key:a,id:n})),[n]),j.useEffect(()=>{r!==f.current.disabled&&(s({type:Tt.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,s]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===n,node:x,over:l,setNodeRef:_}}function rx(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function j4(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function Bc(e){return e!==null&&e>=0}function A4(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=rx(t,n,r),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Fc={scaleX:1,scaleY:1},k4=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:o}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(i===r){const u=a[o];return u?{x:0,y:rr&&i<=o?{x:0,y:-s.height-l,...Fc}:i=o?{x:0,y:s.height+l,...Fc}:{x:0,y:0,...Fc}};function P4(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?rn.map(_=>typeof _=="object"&&"id"in _?_.id:_),[n]),b=o!=null,v=o?h.indexOf(o.id):-1,g=u?h.indexOf(u.id):-1,y=j.useRef(h),m=!A4(h,y.current),w=g!==-1&&v===-1||m,S=E4(a);Rn(()=>{m&&b&&f(h)},[m,h,b,f]),j.useEffect(()=>{y.current=h},[h]);const x=j.useMemo(()=>({activeIndex:v,containerId:c,disabled:S,disableTransforms:w,items:h,overIndex:g,useDragOverlay:p,sortedRects:j4(h,l),strategy:i}),[v,c,S.draggable,S.droppable,w,h,g,l,p,i]);return T.createElement(Ik.Provider,{value:x},t)}const T4=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return rx(r,n,i).indexOf(t)},N4=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!n||s!==a&&i===o?!1:r?!0:o!==i&&t===l},$4={duration:200,easing:"ease"},Mk="transform",R4=pu.Transition.toString({property:Mk,duration:0,easing:"linear"}),I4={roleDescription:"sortable"};function M4(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,o]=j.useState(null),s=j.useRef(r);return Rn(()=>{if(!t&&r!==s.current&&n.current){const l=i.current;if(l){const u=Ts(n.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&o(f)}}r!==s.current&&(s.current=r)},[t,r,n,i]),j.useEffect(()=>{a&&o(null)},[a]),a}function D4(e){let{animateLayoutChanges:t=N4,attributes:r,disabled:n,data:i,getNewIndex:a=T4,id:o,strategy:s,resizeObserverConfig:l,transition:u=$4}=e;const{items:f,containerId:c,activeIndex:p,disabled:h,disableTransforms:b,sortedRects:v,overIndex:g,useDragOverlay:y,strategy:m}=j.useContext(Ik),w=L4(n,h),S=f.indexOf(o),x=j.useMemo(()=>({sortable:{containerId:c,index:S,items:f},...i}),[c,i,S,f]),_=j.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:O,node:A,isOver:E,setNodeRef:$}=O4({id:o,data:x,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...l}}),{active:N,activatorEvent:P,activeNodeRect:I,attributes:D,setNodeRef:B,listeners:V,isDragging:U,over:R,setActivatorNodeRef:F,transform:L}=b4({id:o,data:x,attributes:{...I4,...r},disabled:w.draggable}),q=tL($,B),W=!!N,Y=W&&!b&&Bc(p)&&Bc(g),he=!y&&U,Ae=he&&Y?L:null,We=Y?Ae??(s??m)({rects:v,activeNodeRect:I,activeIndex:p,overIndex:g,index:S}):null,Me=Bc(p)&&Bc(g)?a({id:o,items:f,activeIndex:p,overIndex:g}):S,Z=N==null?void 0:N.id,ne=j.useRef({activeId:Z,items:f,newIndex:Me,containerId:c}),pe=f!==ne.current.items,k=t({active:N,containerId:c,isDragging:U,isSorting:W,id:o,index:S,items:f,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:u,wasDragging:ne.current.activeId!=null}),H=M4({disabled:!k,index:S,node:A,rect:O});return j.useEffect(()=>{W&&ne.current.newIndex!==Me&&(ne.current.newIndex=Me),c!==ne.current.containerId&&(ne.current.containerId=c),f!==ne.current.items&&(ne.current.items=f)},[W,Me,c,f]),j.useEffect(()=>{if(Z===ne.current.activeId)return;if(Z&&!ne.current.activeId){ne.current.activeId=Z;return}const me=setTimeout(()=>{ne.current.activeId=Z},50);return()=>clearTimeout(me)},[Z]),{active:N,activeIndex:p,attributes:D,data:x,rect:O,index:S,newIndex:Me,items:f,isOver:E,isSorting:W,isDragging:U,listeners:V,node:A,overIndex:g,over:R,setNodeRef:q,setActivatorNodeRef:F,setDroppableNodeRef:$,setDraggableNodeRef:B,transform:H??We,transition:K()};function K(){if(H||pe&&ne.current.newIndex===S)return R4;if(!(he&&!Z0(P)||!u)&&(W||k))return pu.Transition.toString({...u,property:Mk})}}function L4(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function ed(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const B4=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],F4=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(B4.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];a.getEnabled().forEach(c=>{if(!c||c!=null&&c.disabled)return;const p=i.get(c.id);if(p)switch(e.code){case Ie.Down:n.topp.top&&l.push(c);break;case Ie.Left:n.left>p.left&&l.push(c);break;case Ie.Right:n.left1&&(f=u[1].id),f!=null){const c=a.get(r.id),p=a.get(f),h=p?i.get(p.id):null,b=p==null?void 0:p.node.current;if(b&&h&&c&&p){const g=Ap(b).some((_,O)=>s[O]!==_),y=Dk(c,p),m=z4(c,p),w=g||!y?{x:0,y:0}:{x:m?n.width-h.width:0,y:m?n.height-h.height:0},S={x:h.left,y:h.top};return w.x&&w.y?S:du(S,w)}}}};function Dk(e,t){return!ed(e)||!ed(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function z4(e,t){return!ed(e)||!ed(t)||!Dk(e,t)?!1:e.data.current.sortable.index{const n={key:t,type:r.data_type.toLowerCase()};return r.values&&(n.values=r.values.split(",").map(i=>i.trim())),r.min_value!==void 0&&(n.min_value=r.min_value),r.max_value!==void 0&&(n.max_value=r.max_value),r.min_length!==void 0&&(n.min_length=r.min_length),r.max_length!==void 0&&(n.max_length=r.max_length),r.exact_length!==void 0&&(n.exact_length=r.exact_length),r.regex&&(n.regex=r.regex),n})}function V4(){const{data:e,error:t,isLoading:r}=vn("/config/routing-keys",lM,{refreshInterval:0,revalidateOnFocus:!1}),n=U4(e||null),i=n.reduce((o,s)=>(o[s.key]=s,o),{}),a={};return n.forEach(o=>{a[o.key]={type:o.type,values:o.values||[]}}),{config:e,keys:n,keysByName:i,routingKeysConfig:a,isLoading:r,error:t,getKeyValues:o=>{var s;return((s=i[o])==null?void 0:s.values)||[]},isIntegerKey:o=>{var s;return((s=i[o])==null?void 0:s.type)==="integer"},isEnumKey:o=>{var s;return((s=i[o])==null?void 0:s.type)==="enum"}}}const W4={"==":"equal","!=":"not_equal",">":"greater_than","<":"less_than",">=":"greater_than_equal","<=":"less_than_equal"};function H4({id:e,name:t,onRemove:r}){const{attributes:n,listeners:i,setNodeRef:a,transform:o,transition:s}=D4({id:e}),l={transform:pu.Transform.toString(o),transition:s};return d.jsxs("div",{ref:a,style:l,className:"flex items-center gap-2 bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] rounded-lg px-2 py-1.5",children:[d.jsx("span",{...n,...i,className:"cursor-grab text-slate-400",children:d.jsx(yI,{size:14})}),d.jsx("span",{className:"text-sm flex-1 font-mono",children:t}),d.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:d.jsx(ii,{size:12})})]})}function Lk({gateways:e,onChange:t}){const[r,n]=j.useState(""),i=mL(ow(tx),ow(J0,{coordinateGetter:F4}));function a(s){const{active:l,over:u}=s;if(u&&l.id!==u.id){const f=e.findIndex(p=>p.id===l.id),c=e.findIndex(p=>p.id===u.id);t(rx(e,f,c))}}function o(){r.trim()&&(t([...e,{id:crypto.randomUUID(),name:r.trim()}]),n(""))}return d.jsxs("div",{className:"space-y-2",children:[d.jsx(y4,{sensors:i,collisionDetection:yL,onDragEnd:a,children:d.jsx(C4,{items:e.map(s=>s.id),strategy:k4,children:e.map((s,l)=>d.jsx(H4,{id:s.id,name:`${l+1}. ${s.name}`,onRemove:()=>t(e.filter(u=>u.id!==s.id))},s.id))})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:r,onChange:s=>n(s.target.value),onKeyDown:s=>s.key==="Enter"&&(s.preventDefault(),o()),placeholder:"gateway name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs(ht,{type:"button",size:"sm",variant:"secondary",onClick:o,children:[d.jsx(qi,{size:13})," Add"]})]})]})}function Bk({gateways:e,onChange:t}){const[r,n]=j.useState(""),i=e.reduce((o,s)=>o+s.split,0);function a(){r.trim()&&(t([...e,{id:crypto.randomUUID(),name:r.trim(),split:0}]),n(""))}return d.jsxs("div",{className:"space-y-2",children:[e.map(o=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-mono w-24 truncate",children:o.name}),d.jsx("input",{type:"range",min:0,max:100,value:o.split,onChange:s=>t(e.map(l=>l.id===o.id?{...l,split:Number(s.target.value)}:l)),className:"flex-1 accent-brand-500"}),d.jsxs("span",{className:"text-sm w-10 text-right",children:[o.split,"%"]}),d.jsx("button",{type:"button",onClick:()=>t(e.filter(s=>s.id!==o.id)),className:"text-red-400 hover:text-red-600",children:d.jsx(ii,{size:12})})]},o.id)),d.jsxs("div",{className:`text-xs font-medium ${i===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",i,"% ",i!==100&&"(must equal 100)"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:r,onChange:o=>n(o.target.value),onKeyDown:o=>o.key==="Enter"&&(o.preventDefault(),a()),placeholder:"gateway name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs(ht,{type:"button",size:"sm",variant:"secondary",onClick:a,children:[d.jsx(qi,{size:13})," Add"]})]})]})}function G4({row:e,onChange:t,onRemove:r,routingKeys:n}){var l;const i=n[e.lhs],a=(i==null?void 0:i.type)==="enum",s=(i==null?void 0:i.type)==="integer"?[">","<",">=","<=","==","!="]:["==","!="];return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("select",{value:e.lhs,onChange:u=>t({...e,lhs:u.target.value,value:"",operator:"=="}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:Object.keys(n).map(u=>d.jsx("option",{value:u,children:u},u))}),d.jsx("select",{value:e.operator,onChange:u=>t({...e,operator:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:s.map(u=>d.jsx("option",{value:u,children:u},u))}),a?d.jsxs("select",{value:e.value,onChange:u=>t({...e,value:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:[d.jsx("option",{value:"",children:"select..."}),(((l=n[e.lhs])==null?void 0:l.values)||[]).map(u=>d.jsx("option",{value:u,children:u},u))]}):d.jsx("input",{type:"number",value:e.value,onChange:u=>t({...e,value:u.target.value}),placeholder:"value",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none"}),d.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:d.jsx(ii,{size:12})})]})}function K4({block:e,onChange:t,onRemove:r,routingKeys:n}){var f;const[i,a]=j.useState(!1),o=Object.keys(n)[0]||"payment_method",l=(((f=n[o])==null?void 0:f.values)||[])[0]||"";function u(){t({...e,conditions:[...e.conditions,{id:crypto.randomUUID(),lhs:o,operator:"==",value:l}]})}return d.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#0d0d12] rounded-t-xl cursor-pointer",onClick:()=>a(!i),children:[d.jsx("input",{value:e.name,onChange:c=>{c.stopPropagation(),t({...e,name:c.target.value})},onClick:c=>c.stopPropagation(),placeholder:"Rule name",className:"bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),r()},className:"text-red-400 hover:text-red-600",children:d.jsx(ii,{size:14})}),i?d.jsx(xl,{size:14}):d.jsx(bl,{size:14})]})]}),!i&&d.jsxs("div",{className:"px-4 py-3 space-y-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"CONDITIONS"}),d.jsxs("div",{className:"space-y-2",children:[e.conditions.map(c=>d.jsx(G4,{row:c,routingKeys:n,onChange:p=>t({...e,conditions:e.conditions.map(h=>h.id===c.id?p:h)}),onRemove:()=>t({...e,conditions:e.conditions.filter(p=>p.id!==c.id)})},c.id)),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:u,children:[d.jsx(qi,{size:12})," Add Condition"]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"OUTPUT"}),d.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(c=>d.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[d.jsx("input",{type:"radio",checked:e.outputType===c,onChange:()=>t({...e,outputType:c}),className:"accent-brand-500"}),c==="priority"?"Priority":"Volume Split"]},c))}),e.outputType==="priority"?d.jsx(Lk,{gateways:e.priorityGateways,onChange:c=>t({...e,priorityGateways:c})}):d.jsx(Bk,{gateways:e.volumeGateways,onChange:c=>t({...e,volumeGateways:c})})]})]})]})}function q4(e,t,r){function n(a,o,s){return a==="priority"?{priority:o.map(l=>({gateway_name:l.name,gateway_id:null}))}:{volume_split:s.map(l=>({split:l.split,output:{gateway_name:l.name,gateway_id:null}}))}}function i(a){return a==="priority"?"priority":"volume_split"}return{globals:{},default_selection:n(t.type,t.priorityGateways,t.volumeGateways),rules:e.map(a=>({name:a.name,routing_type:i(a.outputType),output:n(a.outputType,a.priorityGateways,a.volumeGateways),statements:[{condition:a.conditions.map(o=>{var s,l;return{lhs:o.lhs,comparison:W4[o.operator]||o.operator,value:{type:((s=r[o.lhs])==null?void 0:s.type)==="integer"?"number":"enum_variant",value:((l=r[o.lhs])==null?void 0:l.type)==="integer"?Number(o.value):o.value},metadata:{}}})}]}))}}function X4(){const{merchantId:e}=ra(),{routingKeysConfig:t}=V4(),r=Object.keys(t).length>0?t:qD,[n,i]=j.useState(""),[a,o]=j.useState(""),[s,l]=j.useState([]),[u,f]=j.useState({type:"priority",priorityGateways:[],volumeGateways:[]}),[c,p]=j.useState(!1),[h,b]=j.useState(!1),[v,g]=j.useState(null),[y,m]=j.useState(null),[w,S]=j.useState(!1),[x,_]=j.useState(null),[O,A]=j.useState(!1),[E,$]=j.useState(new Set),{data:N,mutate:P}=vn(e?`/routing/list/${e}`:null,()=>ft(`/routing/list/${e}`)),{data:I}=vn(e?`/routing/list/active/${e}`:null,()=>ft(`/routing/list/active/${e}`)),D=new Set((I||[]).map(L=>L.id)),B=q4(s,u,r);async function V(L){if(L.preventDefault(),!e){g("Set a Merchant ID first.");return}if(!n.trim()){g("Rule name is required.");return}b(!0),g(null),m(null);try{const q=await ft("/routing/create",{name:n.trim(),description:a,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:B}});m(q.id),P()}catch(q){g(String(q))}finally{b(!1)}}async function U(L){if(e){S(!0),_(null),A(!1);try{await ft("/routing/activate",{created_by:e,routing_algorithm_id:L}),A(!0),P()}catch(q){_(String(q))}finally{S(!1)}}}function R(L){$(q=>{const W=new Set(q);return W.has(L)?W.delete(L):W.add(L),W})}function F(){l(L=>[...L,{id:crypto.randomUUID(),name:`Rule ${L.length+1}`,conditions:[],outputType:"priority",priorityGateways:[],volumeGateways:[]}])}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Rule-Based Routing"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Create Euclid DSL declarative routing rules"})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[d.jsxs("div",{className:"lg:col-span-1 space-y-3",children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Existing Rules"})}),d.jsx(Ne,{className:"p-0",children:e?N?N.length===0?d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"No rules yet."}):d.jsx("table",{className:"w-full text-sm",children:d.jsx("tbody",{children:N.map(L=>{const q=D.has(L.id),W=E.has(L.id),Y=L.algorithm_data||L.algorithm;return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"border-b border-slate-100 dark:border-[#222226] last:border-0",children:[d.jsxs("td",{className:"px-4 py-3",children:[d.jsx("p",{className:"font-medium truncate",children:L.name}),d.jsx("p",{className:"text-xs text-slate-400 capitalize",children:Y==null?void 0:Y.type})]}),d.jsx("td",{className:"px-2 py-3",children:d.jsx(Qt,{variant:q?"green":"gray",children:q?"Active":"Inactive"})}),d.jsx("td",{className:"px-2 py-3",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsxs(ht,{size:"sm",variant:"ghost",onClick:()=>R(L.id),children:[d.jsx(wp,{size:14,className:"mr-1"}),W?"Hide":"View"]}),!q&&d.jsx(ht,{size:"sm",variant:"ghost",onClick:()=>U(L.id),disabled:w,children:"Activate"})]})})]},L.id),W&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"ID:"})," ",L.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Description:"})," ",L.description||"N/A"]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Algorithm For:"})," ",L.algorithm_for]}),L.created_at&&d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",new Date(L.created_at).toLocaleString()]}),d.jsxs("div",{children:[d.jsx("strong",{children:"Configuration:"}),d.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(Y,null,2)})]})]})})})]})})})}):d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Loading..."}):d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Set merchant ID to load rules."})})]}),x&&d.jsx(Qo,{error:x}),O&&d.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400",children:"Rule activated successfully."})]}),d.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[d.jsx("form",{onSubmit:V,className:"space-y-4",children:d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Rule Builder"})}),d.jsxs(Ne,{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rule Name *"}),d.jsx("input",{value:n,onChange:L=>i(L.target.value),placeholder:"my-rule",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),d.jsx("input",{value:a,onChange:L=>o(L.target.value),placeholder:"Optional description",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Rules"}),s.map(L=>d.jsx(K4,{block:L,routingKeys:r,onChange:q=>l(W=>W.map(Y=>Y.id===L.id?q:Y)),onRemove:()=>l(q=>q.filter(W=>W.id!==L.id))},L.id)),d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:F,children:[d.jsx(qi,{size:14})," Add Rule Block"]})]}),d.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl px-4 py-3",children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"DEFAULT SELECTION (Fallback)"}),d.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(L=>d.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[d.jsx("input",{type:"radio",checked:u.type===L,onChange:()=>f({...u,type:L}),className:"accent-brand-500"}),L==="priority"?"Priority":"Volume Split"]},L))}),u.type==="priority"?d.jsx(Lk,{gateways:u.priorityGateways,onChange:L=>f({...u,priorityGateways:L})}):d.jsx(Bk,{gateways:u.volumeGateways,onChange:L=>f({...u,volumeGateways:L})})]}),d.jsx(Qo,{error:v}),y&&d.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400 flex items-center justify-between",children:[d.jsxs("span",{children:["Rule created (ID: ",y,")"]}),d.jsx(ht,{type:"button",size:"sm",onClick:()=>U(y),disabled:w,children:"Activate Now"})]}),d.jsxs("div",{className:"flex gap-3",children:[d.jsx(ht,{type:"submit",disabled:h,children:h?"Creating...":"Create Rule"}),d.jsx(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>p(!c),children:c?"Hide JSON":"Preview JSON"})]})]})]})}),c&&d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"JSON Preview"})}),d.jsx(Ne,{children:d.jsx("pre",{className:"text-xs text-slate-600 overflow-auto max-h-64 bg-[#07070b] rounded-lg p-4 font-mono border border-slate-200 dark:border-[#1c1c24]",children:JSON.stringify({name:n,description:a,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:B}},null,2)})})]})]})]})]})}function Fk(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var q5=K5,X5=Cp;function Y5(e,t){var r=this.__data__,n=X5(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Z5=Y5,Q5=R5,J5=U5,eB=H5,tB=q5,rB=Z5;function Is(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},_a=function(t){return za(t)&&t.indexOf("%")===t.length-1},ie=function(t){return _6(t)&&!uc(t)},A6=function(t){return Ce(t)},$t=function(t){return ie(t)||za(t)},E6=0,cc=function(t){var r=++E6;return"".concat(t||"").concat(r)},sr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ie(t)&&!za(t))return n;var a;if(_a(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return uc(a)&&(a=n),i&&a>r&&(a=r),a},oo=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},k6=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function I6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Cw={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Zn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Tw=null,Om=null,hx=function e(t){if(t===Tw&&Array.isArray(Om))return Om;var r=[];return j.Children.forEach(t,function(n){Ce(n)||(y6.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Om=r,Tw=t,r};function Yr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Zn(i)}):n=[Zn(t)],hx(e).forEach(function(i){var a=$r(i,"type.displayName")||$r(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function kr(e,t){var r=Yr(e,t);return r&&r[0]}var Nw=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!ie(n)||n<=0||!ie(i)||i<=0)},M6=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],D6=function(t){return t&&t.type&&za(t.type)&&M6.indexOf(t.type)>=0},L6=function(t,r,n,i){var a,o=(a=Sm==null?void 0:Sm[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Oe(t)&&(i&&o.includes(r)||T6.includes(r))||n&&px.includes(r)},ge=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(j.isValidElement(t)&&(i=t.props),!$s(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;L6((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},xy=function e(t,r){if(t===r)return!0;var n=j.Children.count(t);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return $w(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function V6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wy(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=U6(e,z6),f=i||{width:r,height:n,x:0,y:0},c=Ee("recharts-surface",a);return T.createElement("svg",by({},ge(u,!0,"svg"),{className:c,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),T.createElement("title",null,s),T.createElement("desc",null,l),t)}var W6=["children","className"];function _y(){return _y=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function G6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var He=T.forwardRef(function(e,t){var r=e.children,n=e.className,i=H6(e,W6),a=Ee("recharts-layer",n);return T.createElement("g",_y({className:a},ge(i,!0),{ref:t}),r)}),Qn=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:X6(e,t,r)}var Z6=Y6,Q6="\\ud800-\\udfff",J6="\\u0300-\\u036f",eF="\\ufe20-\\ufe2f",tF="\\u20d0-\\u20ff",rF=J6+eF+tF,nF="\\ufe0e\\ufe0f",iF="\\u200d",aF=RegExp("["+iF+Q6+rF+nF+"]");function oF(e){return aF.test(e)}var Jk=oF;function sF(e){return e.split("")}var lF=sF,e2="\\ud800-\\udfff",uF="\\u0300-\\u036f",cF="\\ufe20-\\ufe2f",fF="\\u20d0-\\u20ff",dF=uF+cF+fF,pF="\\ufe0e\\ufe0f",hF="["+e2+"]",Sy="["+dF+"]",Oy="\\ud83c[\\udffb-\\udfff]",mF="(?:"+Sy+"|"+Oy+")",t2="[^"+e2+"]",r2="(?:\\ud83c[\\udde6-\\uddff]){2}",n2="[\\ud800-\\udbff][\\udc00-\\udfff]",vF="\\u200d",i2=mF+"?",a2="["+pF+"]?",yF="(?:"+vF+"(?:"+[t2,r2,n2].join("|")+")"+a2+i2+")*",gF=a2+i2+yF,xF="(?:"+[t2+Sy+"?",Sy,r2,n2,hF].join("|")+")",bF=RegExp(Oy+"(?="+Oy+")|"+xF+gF,"g");function wF(e){return e.match(bF)||[]}var _F=wF,SF=lF,OF=Jk,jF=_F;function AF(e){return OF(e)?jF(e):SF(e)}var EF=AF,kF=Z6,PF=Jk,CF=EF,TF=Kk;function NF(e){return function(t){t=TF(t);var r=PF(t)?CF(t):void 0,n=r?r[0]:t.charAt(0),i=r?kF(r,1).join(""):t.slice(1);return n[e]()+i}}var $F=NF,RF=$F,IF=RF("toUpperCase"),MF=IF;const Wp=Ke(MF);function rt(e){return function(){return e}}const o2=Math.cos,rd=Math.sin,gn=Math.sqrt,nd=Math.PI,Hp=2*nd,jy=Math.PI,Ay=2*jy,ha=1e-6,DF=Ay-ha;function s2(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return s2;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iha)if(!(Math.abs(c*l-u*f)>ha)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,b=i-s,v=l*l+u*u,g=h*h+b*b,y=Math.sqrt(v),m=Math.sqrt(p),w=a*Math.tan((jy-Math.acos((v+p-g)/(2*y*m)))/2),S=w/m,x=w/y;Math.abs(S-1)>ha&&this._append`L${t+S*f},${r+S*c}`,this._append`A${a},${a},0,0,${+(c*h>f*b)},${this._x1=t+x*l},${this._y1=r+x*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,f=r+l,c=1^o,p=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>ha||Math.abs(this._y1-f)>ha)&&this._append`L${u},${f}`,n&&(p<0&&(p=p%Ay+Ay),p>DF?this._append`A${n},${n},0,1,${c},${t-s},${r-l}A${n},${n},0,1,${c},${this._x1=u},${this._y1=f}`:p>ha&&this._append`A${n},${n},0,${+(p>=jy)},${c},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function mx(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new BF(t)}function vx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function l2(e){this._context=e}l2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Gp(e){return new l2(e)}function u2(e){return e[0]}function c2(e){return e[1]}function f2(e,t){var r=rt(!0),n=null,i=Gp,a=null,o=mx(s);e=typeof e=="function"?e:e===void 0?u2:rt(e),t=typeof t=="function"?t:t===void 0?c2:rt(t);function s(l){var u,f=(l=vx(l)).length,c,p=!1,h;for(n==null&&(a=i(h=o())),u=0;u<=f;++u)!(u=h;--b)s.point(w[b],S[b]);s.lineEnd(),s.areaEnd()}y&&(w[p]=+e(g,p,c),S[p]=+t(g,p,c),s.point(n?+n(g,p,c):w[p],r?+r(g,p,c):S[p]))}if(m)return s=null,m+""||null}function f(){return f2().defined(i).curve(o).context(a)}return u.x=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),n=null,u):e},u.x0=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),u):e},u.x1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:rt(+c),u):n},u.y=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),r=null,u):t},u.y0=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),u):t},u.y1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:rt(+c),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(c){return arguments.length?(i=typeof c=="function"?c:rt(!!c),u):i},u.curve=function(c){return arguments.length?(o=c,a!=null&&(s=o(a)),u):o},u.context=function(c){return arguments.length?(c==null?a=s=null:s=o(a=c),u):a},u}class d2{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function FF(e){return new d2(e,!0)}function zF(e){return new d2(e,!1)}const yx={draw(e,t){const r=gn(t/nd);e.moveTo(r,0),e.arc(0,0,r,0,Hp)}},UF={draw(e,t){const r=gn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},p2=gn(1/3),VF=p2*2,WF={draw(e,t){const r=gn(t/VF),n=r*p2;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},HF={draw(e,t){const r=gn(t),n=-r/2;e.rect(n,n,r,r)}},GF=.8908130915292852,h2=rd(nd/10)/rd(7*nd/10),KF=rd(Hp/10)*h2,qF=-o2(Hp/10)*h2,XF={draw(e,t){const r=gn(t*GF),n=KF*r,i=qF*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Hp*a/5,s=o2(o),l=rd(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},jm=gn(3),YF={draw(e,t){const r=-gn(t/(jm*3));e.moveTo(0,r*2),e.lineTo(-jm*r,-r),e.lineTo(jm*r,-r),e.closePath()}},Br=-.5,Fr=gn(3)/2,Ey=1/gn(12),ZF=(Ey/2+1)*3,QF={draw(e,t){const r=gn(t/ZF),n=r/2,i=r*Ey,a=n,o=r*Ey+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Br*n-Fr*i,Fr*n+Br*i),e.lineTo(Br*a-Fr*o,Fr*a+Br*o),e.lineTo(Br*s-Fr*l,Fr*s+Br*l),e.lineTo(Br*n+Fr*i,Br*i-Fr*n),e.lineTo(Br*a+Fr*o,Br*o-Fr*a),e.lineTo(Br*s+Fr*l,Br*l-Fr*s),e.closePath()}};function JF(e,t){let r=null,n=mx(i);e=typeof e=="function"?e:rt(e||yx),t=typeof t=="function"?t:rt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:rt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:rt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function id(){}function ad(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function m2(e){this._context=e}m2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ad(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ez(e){return new m2(e)}function v2(e){this._context=e}v2.prototype={areaStart:id,areaEnd:id,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tz(e){return new v2(e)}function y2(e){this._context=e}y2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rz(e){return new y2(e)}function g2(e){this._context=e}g2.prototype={areaStart:id,areaEnd:id,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function nz(e){return new g2(e)}function Iw(e){return e<0?-1:1}function Mw(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Iw(a)+Iw(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Dw(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Am(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function od(e){this._context=e}od.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Am(this,this._t0,Dw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Am(this,Dw(this,r=Mw(this,e,t)),r);break;default:Am(this,this._t0,r=Mw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function x2(e){this._context=new b2(e)}(x2.prototype=Object.create(od.prototype)).point=function(e,t){od.prototype.point.call(this,t,e)};function b2(e){this._context=e}b2.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function iz(e){return new od(e)}function az(e){return new x2(e)}function w2(e){this._context=e}w2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Lw(e),i=Lw(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function sz(e){return new Kp(e,.5)}function lz(e){return new Kp(e,0)}function uz(e){return new Kp(e,1)}function Jo(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function cz(e,t){return e[t]}function fz(e){const t=[];return t.key=e,t}function dz(){var e=rt([]),t=ky,r=Jo,n=cz;function i(a){var o=Array.from(e.apply(this,arguments),fz),s,l=o.length,u=-1,f;for(const c of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wz(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var _2={symbolCircle:yx,symbolCross:UF,symbolDiamond:WF,symbolSquare:HF,symbolStar:XF,symbolTriangle:YF,symbolWye:QF},_z=Math.PI/180,Sz=function(t){var r="symbol".concat(Wp(t));return _2[r]||yx},Oz=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*_z;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},jz=function(t,r){_2["symbol".concat(Wp(t))]=r},gx=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=bz(t,vz),u=Fw(Fw({},l),{},{type:n,size:a,sizeType:s}),f=function(){var g=Sz(n),y=JF().type(g).size(Oz(a,s,n));return y()},c=u.className,p=u.cx,h=u.cy,b=ge(u,!0);return p===+p&&h===+h&&a===+a?T.createElement("path",Py({},b,{className:Ee("recharts-symbols",c),transform:"translate(".concat(p,", ").concat(h,")"),d:f()})):null};gx.registerSymbol=jz;function es(e){"@babel/helpers - typeof";return es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},es(e)}function Cy(){return Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var m=h.inactive?u:h.color;return T.createElement("li",Cy({className:g,style:c,key:"legend-item-".concat(b)},Ua(n.props,h,b)),T.createElement(wy,{width:o,height:o,viewBox:f,style:p},n.renderIcon(h)),T.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},v?v(y,h,b):y))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return T.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(j.PureComponent);vu(xx,"displayName","Legend");vu(xx,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Iz=Tp;function Mz(){this.__data__=new Iz,this.size=0}var Dz=Mz;function Lz(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Bz=Lz;function Fz(e){return this.__data__.get(e)}var zz=Fz;function Uz(e){return this.__data__.has(e)}var Vz=Uz,Wz=Tp,Hz=ox,Gz=sx,Kz=200;function qz(e,t){var r=this.__data__;if(r instanceof Wz){var n=r.__data__;if(!Hz||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var c=-1,p=!0,h=r&v8?new d8:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=bU}var Sx=wU,_U=pi,SU=Sx,OU=hi,jU="[object Arguments]",AU="[object Array]",EU="[object Boolean]",kU="[object Date]",PU="[object Error]",CU="[object Function]",TU="[object Map]",NU="[object Number]",$U="[object Object]",RU="[object RegExp]",IU="[object Set]",MU="[object String]",DU="[object WeakMap]",LU="[object ArrayBuffer]",BU="[object DataView]",FU="[object Float32Array]",zU="[object Float64Array]",UU="[object Int8Array]",VU="[object Int16Array]",WU="[object Int32Array]",HU="[object Uint8Array]",GU="[object Uint8ClampedArray]",KU="[object Uint16Array]",qU="[object Uint32Array]",st={};st[FU]=st[zU]=st[UU]=st[VU]=st[WU]=st[HU]=st[GU]=st[KU]=st[qU]=!0;st[jU]=st[AU]=st[LU]=st[EU]=st[BU]=st[kU]=st[PU]=st[CU]=st[TU]=st[NU]=st[$U]=st[RU]=st[IU]=st[MU]=st[DU]=!1;function XU(e){return OU(e)&&SU(e.length)&&!!st[_U(e)]}var YU=XU;function ZU(e){return function(t){return e(t)}}var $2=ZU,cd={exports:{}};cd.exports;(function(e,t){var r=zk,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(cd,cd.exports);var QU=cd.exports,JU=YU,eV=$2,Kw=QU,qw=Kw&&Kw.isTypedArray,tV=qw?eV(qw):JU,R2=tV,rV=aU,nV=wx,iV=_r,aV=N2,oV=_x,sV=R2,lV=Object.prototype,uV=lV.hasOwnProperty;function cV(e,t){var r=iV(e),n=!r&&nV(e),i=!r&&!n&&aV(e),a=!r&&!n&&!i&&sV(e),o=r||n||i||a,s=o?rV(e.length,String):[],l=s.length;for(var u in e)(t||uV.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||oV(u,l)))&&s.push(u);return s}var fV=cV,dV=Object.prototype;function pV(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||dV;return e===r}var hV=pV;function mV(e,t){return function(r){return e(t(r))}}var I2=mV,vV=I2,yV=vV(Object.keys,Object),gV=yV,xV=hV,bV=gV,wV=Object.prototype,_V=wV.hasOwnProperty;function SV(e){if(!xV(e))return bV(e);var t=[];for(var r in Object(e))_V.call(e,r)&&r!="constructor"&&t.push(r);return t}var OV=SV,jV=ix,AV=Sx;function EV(e){return e!=null&&AV(e.length)&&!jV(e)}var qp=EV,kV=fV,PV=OV,CV=qp;function TV(e){return CV(e)?kV(e):PV(e)}var Ox=TV,NV=K8,$V=nU,RV=Ox;function IV(e){return NV(e,RV,$V)}var MV=IV,Xw=MV,DV=1,LV=Object.prototype,BV=LV.hasOwnProperty;function FV(e,t,r,n,i,a){var o=r&DV,s=Xw(e),l=s.length,u=Xw(t),f=u.length;if(l!=f&&!o)return!1;for(var c=l;c--;){var p=s[c];if(!(o?p in t:BV.call(t,p)))return!1}var h=a.get(e),b=a.get(t);if(h&&b)return h==t&&b==e;var v=!0;a.set(e,t),a.set(t,e);for(var g=o;++c-1}var BW=LW;function FW(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=tH){var u=t?null:JW(e);if(u)return eH(u);o=!1,i=QW,l=new XW}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yH(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gH(e){return e.value}function xH(e,t){if(T.isValidElement(e))return T.cloneElement(e,t);if(typeof e=="function")return T.createElement(e,t);t.ref;var r=vH(t,lH);return T.createElement(xx,r)}var f_=1,ka=function(e){function t(){var r;uH(this,t);for(var n=arguments.length,i=new Array(n),a=0;af_||Math.abs(i.height-this.lastBoundingBox.height)>f_)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Bn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,c,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();c={left:((u||0)-h.width)/2}}else c=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var b=this.getBBoxSnapshot();p={top:((f||0)-b.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Bn(Bn({},c),p)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,c=Bn(Bn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return T.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(h){n.wrapperNode=h}},xH(a,Bn(Bn({},this.props),{},{payload:z2(f,u,gH)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Bn(Bn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&ie(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(j.PureComponent);Xp(ka,"displayName","Legend");Xp(ka,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var d_=lc,bH=wx,wH=_r,p_=d_?d_.isConcatSpreadable:void 0;function _H(e){return wH(e)||bH(e)||!!(p_&&e&&e[p_])}var SH=_H,OH=C2,jH=SH;function W2(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=jH),i||(i=[]);++a0&&r(s)?t>1?W2(s,t-1,r,n,i):OH(i,s):n||(i[i.length]=s)}return i}var H2=W2;function AH(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var EH=AH,kH=EH,PH=kH(),CH=PH,TH=CH,NH=Ox;function $H(e,t){return e&&TH(e,t,NH)}var G2=$H,RH=qp;function IH(e,t){return function(r,n){if(r==null)return r;if(!RH(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var XH=qH,Cm=ux,YH=cx,ZH=ia,QH=K2,JH=WH,e7=$2,t7=XH,r7=Bs,n7=_r;function i7(e,t,r){t.length?t=Cm(t,function(a){return n7(a)?function(o){return YH(o,a.length===1?a[0]:a)}:a}):t=[r7];var n=-1;t=Cm(t,e7(ZH));var i=QH(e,function(a,o,s){var l=Cm(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return JH(i,function(a,o){return t7(a,o,r)})}var a7=i7;function o7(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var s7=o7,l7=s7,m_=Math.max;function u7(e,t,r){return t=m_(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=m_(n.length-t,0),o=Array(a);++i0){if(++t>=x7)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var S7=_7,O7=g7,j7=S7,A7=j7(O7),E7=A7,k7=Bs,P7=c7,C7=E7;function T7(e,t){return C7(P7(e,t,k7),e+"")}var N7=T7,$7=ax,R7=qp,I7=_x,M7=na;function D7(e,t,r){if(!M7(r))return!1;var n=typeof t;return(n=="number"?R7(r)&&I7(t,r.length):n=="string"&&t in r)?$7(r[t],e):!1}var Yp=D7,L7=H2,B7=a7,F7=N7,y_=Yp,z7=F7(function(e,t){if(e==null)return[];var r=t.length;return r>1&&y_(e,t[0],t[1])?t=[]:r>2&&y_(t[0],t[1],t[2])&&(t=[t[0]]),B7(e,L7(t,1),[])}),U7=z7;const Ex=Ke(U7);function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function Ly(){return Ly=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(al,"-left"),ie(r)&&t&&ie(t.x)&&r=t.y),"".concat(al,"-top"),ie(n)&&t&&ie(t.y)&&nv?Math.max(f,l[n]):Math.max(c,l[n])}function nG(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function iG(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,c;return o.height>0&&o.width>0&&r?(f=b_({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),c=b_({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=nG({translateX:f,translateY:c,useTranslate3d:s})):u=tG,{cssProperties:u,cssClasses:rG({translateX:f,translateY:c,coordinate:r})}}function rs(e){"@babel/helpers - typeof";return rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(e)}function w_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function __(e){for(var t=1;tS_||Math.abs(n.height-this.state.lastBoundingBox.height)>S_)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,f=i.coordinate,c=i.hasPayload,p=i.isAnimationActive,h=i.offset,b=i.position,v=i.reverseDirection,g=i.useTranslate3d,y=i.viewBox,m=i.wrapperStyle,w=iG({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:b,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:y}),S=w.cssClasses,x=w.cssProperties,_=__(__({transition:p&&a?"transform ".concat(s,"ms ").concat(l):void 0},x),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&c?"visible":"hidden",position:"absolute",top:0,left:0},m);return T.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(A){n.wrapperNode=A}},u)}}])}(j.PureComponent),hG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Fs={isSsr:hG()};function ns(e){"@babel/helpers - typeof";return ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(e)}function O_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function j_(e){for(var t=1;t0;return T.createElement(pG,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:a,coordinate:f,hasPayload:_,offset:h,position:g,reverseDirection:y,useTranslate3d:m,viewBox:w,wrapperStyle:S},OG(u,j_(j_({},this.props),{},{payload:x})))}}])}(j.PureComponent);kx(Pr,"displayName","Tooltip");kx(Pr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Fs.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var jG=Mn,AG=function(){return jG.Date.now()},EG=AG,kG=/\s/;function PG(e){for(var t=e.length;t--&&kG.test(e.charAt(t)););return t}var CG=PG,TG=CG,NG=/^\s+/;function $G(e){return e&&e.slice(0,TG(e)+1).replace(NG,"")}var RG=$G,IG=RG,A_=na,MG=Ns,E_=NaN,DG=/^[-+]0x[0-9a-f]+$/i,LG=/^0b[01]+$/i,BG=/^0o[0-7]+$/i,FG=parseInt;function zG(e){if(typeof e=="number")return e;if(MG(e))return E_;if(A_(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=A_(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=IG(e);var r=LG.test(e);return r||BG.test(e)?FG(e.slice(2),r?2:8):DG.test(e)?E_:+e}var J2=zG,UG=na,Nm=EG,k_=J2,VG="Expected a function",WG=Math.max,HG=Math.min;function GG(e,t,r){var n,i,a,o,s,l,u=0,f=!1,c=!1,p=!0;if(typeof e!="function")throw new TypeError(VG);t=k_(t)||0,UG(r)&&(f=!!r.leading,c="maxWait"in r,a=c?WG(k_(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p);function h(_){var O=n,A=i;return n=i=void 0,u=_,o=e.apply(A,O),o}function b(_){return u=_,s=setTimeout(y,t),f?h(_):o}function v(_){var O=_-l,A=_-u,E=t-O;return c?HG(E,a-A):E}function g(_){var O=_-l,A=_-u;return l===void 0||O>=t||O<0||c&&A>=a}function y(){var _=Nm();if(g(_))return m(_);s=setTimeout(y,v(_))}function m(_){return s=void 0,p&&n?h(_):(n=i=void 0,o)}function w(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:m(Nm())}function x(){var _=Nm(),O=g(_);if(n=arguments,i=this,l=_,O){if(s===void 0)return b(l);if(c)return clearTimeout(s),s=setTimeout(y,t),h(l)}return s===void 0&&(s=setTimeout(y,t)),o}return x.cancel=w,x.flush=S,x}var KG=GG,qG=KG,XG=na,YG="Expected a function";function ZG(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(YG);return XG(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),qG(e,t,{leading:n,maxWait:t,trailing:i})}var QG=ZG;const eP=Ke(QG);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function P_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(I=eP(I,v,{trailing:!0,leading:!1}));var D=new ResizeObserver(I),B=x.current.getBoundingClientRect(),V=B.width,U=B.height;return N(V,U),D.observe(x.current),function(){D.disconnect()}},[N,v]);var P=j.useMemo(function(){var I=E.containerWidth,D=E.containerHeight;if(I<0||D<0)return null;Qn(_a(o)||_a(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,l),Qn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var B=_a(o)?I:o,V=_a(l)?D:l;r&&r>0&&(B?V=B/r:V&&(B=V*r),p&&V>p&&(V=p)),Qn(B>0||V>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,B,V,o,l,f,c,r);var U=!Array.isArray(h)&&Zn(h.type).endsWith("Chart");return T.Children.map(h,function(R){return T.isValidElement(R)?j.cloneElement(R,Wc({width:B,height:V},U?{style:Wc({height:"100%",width:"100%",maxHeight:V,maxWidth:B},R.props.style)}:{})):R})},[r,h,l,p,c,f,E,o]);return T.createElement("div",{id:g?"".concat(g):void 0,className:Ee("recharts-responsive-container",y),style:Wc(Wc({},S),{},{width:o,height:l,minWidth:f,minHeight:c,maxHeight:p}),ref:x},P)}),Pa=function(t){return null};Pa.displayName="Cell";function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function T_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Uy(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Fs.isSsr)return{width:0,height:0};var n=dK(r),i=JSON.stringify({text:t,copyStyle:n});if(no.widthCache[i])return no.widthCache[i];try{var a=document.getElementById(N_);a||(a=document.createElement("span"),a.setAttribute("id",N_),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Uy(Uy({},fK),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return no.widthCache[i]=l,++no.cacheCount>cK&&(no.cacheCount=0,no.widthCache={}),l}catch{return{width:0,height:0}}},pK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function hd(e,t){return yK(e)||vK(e,t)||mK(e,t)||hK()}function hK(){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 mK(e,t){if(e){if(typeof e=="string")return $_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $_(e,t)}}function $_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function B_(e,t){return IK(e)||RK(e,t)||$K(e,t)||NK()}function NK(){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 $K(e,t){if(e){if(typeof e=="string")return F_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F_(e,t)}}function F_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return B.reduce(function(V,U){var R=U.word,F=U.width,L=V[V.length-1];if(L&&(i==null||a||L.width+F+nU.width?V:U})};if(!f)return h;for(var v="…",g=function(B){var V=c.slice(0,B),U=iP({breakAll:u,style:l,children:V+v}).wordsWithComputedWidth,R=p(U),F=R.length>o||b(R).width>Number(i);return[F,R]},y=0,m=c.length-1,w=0,S;y<=m&&w<=c.length-1;){var x=Math.floor((y+m)/2),_=x-1,O=g(_),A=B_(O,2),E=A[0],$=A[1],N=g(x),P=B_(N,1),I=P[0];if(!E&&!I&&(y=x+1),E&&I&&(m=x-1),!E&&I){S=$;break}w++}return S||h},z_=function(t){var r=Ce(t)?[]:t.toString().split(nP);return[{words:r}]},DK=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Fs.isSsr){var l,u,f=iP({breakAll:o,children:i,style:a});if(f){var c=f.wordsWithComputedWidth,p=f.spaceWidth;l=c,u=p}else return z_(i);return MK({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return z_(i)},U_="#808080",Va=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,c=f===void 0?!1:f,p=t.textAnchor,h=p===void 0?"start":p,b=t.verticalAnchor,v=b===void 0?"end":b,g=t.fill,y=g===void 0?U_:g,m=L_(t,PK),w=j.useMemo(function(){return DK({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:c,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,c,m.style,m.width]),S=m.dx,x=m.dy,_=m.angle,O=m.className,A=m.breakAll,E=L_(m,CK);if(!$t(n)||!$t(a))return null;var $=n+(ie(S)?S:0),N=a+(ie(x)?x:0),P;switch(v){case"start":P=$m("calc(".concat(u,")"));break;case"middle":P=$m("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:P=$m("calc(".concat(w.length-1," * -").concat(s,")"));break}var I=[];if(c){var D=w[0].width,B=m.width;I.push("scale(".concat((ie(B)?B/D:1)/D,")"))}return _&&I.push("rotate(".concat(_,", ").concat($,", ").concat(N,")")),I.length&&(E.transform=I.join(" ")),T.createElement("text",Vy({},ge(E,!0),{x:$,y:N,className:Ee("recharts-text",O),textAnchor:h,fill:y.includes("url")?U_:y}),w.map(function(V,U){var R=V.words.join(A?"":" ");return T.createElement("tspan",{x:$,dy:U===0?P:s,key:"".concat(R,"-").concat(U)},R)}))};function Wi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function LK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Px(e){let t,r,n;e.length!==2?(t=Wi,r=(s,l)=>Wi(e(s),l),n=(s,l)=>e(s)-l):(t=e===Wi||e===LK?e:BK,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[c],l)<0?u=c+1:f=c}while(u>>1;r(s[c],l)<=0?u=c+1:f=c}while(uu&&n(s[c-1],l)>-n(s[c],l)?c-1:c}return{left:i,center:o,right:a}}function BK(){return 0}function aP(e){return e===null?NaN:+e}function*FK(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const zK=Px(Wi),fc=zK.right;Px(aP).center;class V_ extends Map{constructor(t,r=WK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(W_(this,t))}has(t){return super.has(W_(this,t))}set(t,r){return super.set(UK(this,t),r)}delete(t){return super.delete(VK(this,t))}}function W_({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function UK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function VK({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function WK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function HK(e=Wi){if(e===Wi)return oP;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function oP(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const GK=Math.sqrt(50),KK=Math.sqrt(10),qK=Math.sqrt(2);function md(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=GK?10:a>=KK?5:a>=qK?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function G_(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function sP(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?oP:HK(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),c=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*c*(l-c)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*c/l+p)),b=Math.min(n,Math.floor(t+(l-u)*c/l+p));sP(e,t,h,b,i)}const a=e[t];let o=r,s=n;for(ol(e,r,t),i(e[n],a)>0&&ol(e,r,n);o0;)--s}i(e[r],a)===0?ol(e,r,s):(++s,ol(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function ol(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function XK(e,t,r){if(e=Float64Array.from(FK(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return G_(e);if(t>=1)return H_(e);var n,i=(n-1)*t,a=Math.floor(i),o=H_(sP(e,a).subarray(0,a+1)),s=G_(e.subarray(a+1));return o+(s-o)*(i-a)}}function YK(e,t,r=aP){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function ZK(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Gc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Gc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=JK.exec(e))?new yr(t[1],t[2],t[3],1):(t=eq.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tq.exec(e))?Gc(t[1],t[2],t[3],t[4]):(t=rq.exec(e))?Gc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nq.exec(e))?J_(t[1],t[2]/100,t[3]/100,1):(t=iq.exec(e))?J_(t[1],t[2]/100,t[3]/100,t[4]):K_.hasOwnProperty(e)?Y_(K_[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function Y_(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function Gc(e,t,r,n){return n<=0&&(e=t=r=NaN),new yr(e,t,r,n)}function sq(e){return e instanceof dc||(e=ju(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function qy(e,t,r,n){return arguments.length===1?sq(e):new yr(e,t,r,n??1)}function yr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Tx(yr,qy,uP(dc,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Su:Math.pow(Su,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Ca(this.r),Ca(this.g),Ca(this.b),yd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Z_,formatHex:Z_,formatHex8:lq,formatRgb:Q_,toString:Q_}));function Z_(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function lq(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function Q_(){const e=yd(this.opacity);return`${e===1?"rgb(":"rgba("}${Ca(this.r)}, ${Ca(this.g)}, ${Ca(this.b)}${e===1?")":`, ${e})`}`}function yd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ca(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sa(e){return e=Ca(e),(e<16?"0":"")+e.toString(16)}function J_(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new dn(e,t,r,n)}function cP(e){if(e instanceof dn)return new dn(e.h,e.s,e.l,e.opacity);if(e instanceof dc||(e=ju(e)),!e)return new dn;if(e instanceof dn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new dn(o,s,l,e.opacity)}function uq(e,t,r,n){return arguments.length===1?cP(e):new dn(e,t,r,n??1)}function dn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Tx(dn,uq,uP(dc,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Su:Math.pow(Su,e),new dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new yr(Rm(e>=240?e-240:e+120,i,n),Rm(e,i,n),Rm(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new dn(eS(this.h),Kc(this.s),Kc(this.l),yd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=yd(this.opacity);return`${e===1?"hsl(":"hsla("}${eS(this.h)}, ${Kc(this.s)*100}%, ${Kc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function eS(e){return e=(e||0)%360,e<0?e+360:e}function Kc(e){return Math.max(0,Math.min(1,e||0))}function Rm(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Nx=e=>()=>e;function cq(e,t){return function(r){return e+r*t}}function fq(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function dq(e){return(e=+e)==1?fP:function(t,r){return r-t?fq(t,r,e):Nx(isNaN(t)?r:t)}}function fP(e,t){var r=t-e;return r?cq(e,r):Nx(isNaN(e)?t:e)}const tS=function e(t){var r=dq(t);function n(i,a){var o=r((i=qy(i)).r,(a=qy(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=fP(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function pq(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:gd(n,i)})),r=Im.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Oq(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?jq:Oq,l=u=null,c}function c(p){return p==null||isNaN(p=+p)?a:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return c.invert=function(p){return o(i((u||(u=s(t,e.map(n),gd)))(p)))},c.domain=function(p){return arguments.length?(e=Array.from(p,xd),f()):e.slice()},c.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},c.rangeRound=function(p){return t=Array.from(p),r=$x,f()},c.clamp=function(p){return arguments.length?(o=p?!0:lr,f()):o!==lr},c.interpolate=function(p){return arguments.length?(r=p,f()):r},c.unknown=function(p){return arguments.length?(a=p,c):a},function(p,h){return n=p,i=h,f()}}function Rx(){return Zp()(lr,lr)}function Aq(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function bd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function is(e){return e=bd(Math.abs(e)),e?e[1]:NaN}function Eq(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function kq(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Pq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=Pq.exec(e)))throw new Error("invalid format: "+e);var t;return new Ix({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Au.prototype=Ix.prototype;function Ix(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ix.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Cq(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var wd;function Tq(e,t){var r=bd(e,t);if(!r)return wd=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(wd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+bd(e,Math.max(0,t+a-1))[0]}function nS(e,t){var r=bd(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const iS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Aq,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>nS(e*100,t),r:nS,s:Tq,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function aS(e){return e}var oS=Array.prototype.map,sS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nq(e){var t=e.grouping===void 0||e.thousands===void 0?aS:Eq(oS.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?aS:kq(oS.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(c,p){c=Au(c);var h=c.fill,b=c.align,v=c.sign,g=c.symbol,y=c.zero,m=c.width,w=c.comma,S=c.precision,x=c.trim,_=c.type;_==="n"?(w=!0,_="g"):iS[_]||(S===void 0&&(S=12),x=!0,_="g"),(y||h==="0"&&b==="=")&&(y=!0,h="0",b="=");var O=(p&&p.prefix!==void 0?p.prefix:"")+(g==="$"?r:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),A=(g==="$"?n:/[%p]/.test(_)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),E=iS[_],$=/[defgprs%]/.test(_);S=S===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function N(P){var I=O,D=A,B,V,U;if(_==="c")D=E(P)+D,P="";else{P=+P;var R=P<0||1/P<0;if(P=isNaN(P)?l:E(Math.abs(P),S),x&&(P=Cq(P)),R&&+P==0&&v!=="+"&&(R=!1),I=(R?v==="("?v:s:v==="-"||v==="("?"":v)+I,D=(_==="s"&&!isNaN(P)&&wd!==void 0?sS[8+wd/3]:"")+D+(R&&v==="("?")":""),$){for(B=-1,V=P.length;++BU||U>57){D=(U===46?i+P.slice(B+1):P.slice(B))+D,P=P.slice(0,B);break}}}w&&!y&&(P=t(P,1/0));var F=I.length+P.length+D.length,L=F>1)+I+P+D+L.slice(F);break;default:P=L+I+P+D;break}return a(P)}return N.toString=function(){return c+""},N}function f(c,p){var h=Math.max(-8,Math.min(8,Math.floor(is(p)/3)))*3,b=Math.pow(10,-h),v=u((c=Au(c),c.type="f",c),{suffix:sS[8+h/3]});return function(g){return v(b*g)}}return{format:u,formatPrefix:f}}var qc,Mx,dP;$q({thousands:",",grouping:[3],currency:["$",""]});function $q(e){return qc=Nq(e),Mx=qc.format,dP=qc.formatPrefix,qc}function Rq(e){return Math.max(0,-is(Math.abs(e)))}function Iq(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(is(t)/3)))*3-is(Math.abs(e)))}function Mq(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,is(t)-is(e))+1}function pP(e,t,r,n){var i=Gy(e,t,r),a;switch(n=Au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Iq(i,o))&&(n.precision=a),dP(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Mq(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Rq(i))&&(n.precision=a-(n.type==="%")*2);break}}return Mx(n)}function aa(e){var t=e.domain;return e.ticks=function(r){var n=t();return Wy(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return pP(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,f=10;for(s0;){if(u=Hy(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function _d(){var e=Rx();return e.copy=function(){return pc(e,_d())},rn.apply(e,arguments),aa(e)}function hP(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,xd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return hP(e).unknown(t)},e=arguments.length?Array.from(e,xd):[0,1],aa(r)}function mP(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function zq(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function cS(e){return(t,r)=>-e(-t,r)}function Dx(e){const t=e(lS,uS),r=t.domain;let n=10,i,a;function o(){return i=zq(n),a=Fq(n),r()[0]<0?(i=cS(i),a=cS(a),e(Dq,Lq)):e(lS,uS),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const c=f0){for(;p<=h;++p)for(b=1;bf)break;y.push(v)}}else for(;p<=h;++p)for(b=n-1;b>=1;--b)if(v=p>0?b/a(-p):b*a(p),!(vf)break;y.push(v)}y.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Au(l)).precision==null&&(l.trim=!0),l=Mx(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let c=f/a(Math.round(i(f)));return c*nr(mP(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function vP(){const e=Dx(Zp()).domain([1,10]);return e.copy=()=>pc(e,vP()).base(e.base()),rn.apply(e,arguments),e}function fS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function dS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Lx(e){var t=1,r=e(fS(t),dS(t));return r.constant=function(n){return arguments.length?e(fS(t=+n),dS(t)):t},aa(r)}function yP(){var e=Lx(Zp());return e.copy=function(){return pc(e,yP()).constant(e.constant())},rn.apply(e,arguments)}function pS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Uq(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Vq(e){return e<0?-e*e:e*e}function Bx(e){var t=e(lr,lr),r=1;function n(){return r===1?e(lr,lr):r===.5?e(Uq,Vq):e(pS(r),pS(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},aa(t)}function Fx(){var e=Bx(Zp());return e.copy=function(){return pc(e,Fx()).exponent(e.exponent())},rn.apply(e,arguments),e}function Wq(){return Fx.apply(null,arguments).exponent(.5)}function hS(e){return Math.sign(e)*e*e}function Hq(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function gP(){var e=Rx(),t=[0,1],r=!1,n;function i(a){var o=Hq(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(hS(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,xd)).map(hS)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return gP(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},rn.apply(i,arguments),aa(i)}function xP(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return bP().domain([e,t]).range(i).unknown(a)},rn.apply(aa(o),arguments)}function wP(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[fc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return wP().domain(e).range(t).unknown(r)},rn.apply(i,arguments)}const Mm=new Date,Dm=new Date;function Rt(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uRt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Mm.setTime(+a),Dm.setTime(+o),e(Mm),e(Dm),Math.floor(r(Mm,Dm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Sd=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Sd.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Sd);Sd.range;const qn=1e3,qr=qn*60,Xn=qr*60,oi=Xn*24,zx=oi*7,mS=oi*30,Lm=oi*365,Oa=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*qn)},(e,t)=>(t-e)/qn,e=>e.getUTCSeconds());Oa.range;const Ux=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qn)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getMinutes());Ux.range;const Vx=Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getUTCMinutes());Vx.range;const Wx=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qn-e.getMinutes()*qr)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getHours());Wx.range;const Hx=Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getUTCHours());Hx.range;const hc=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qr)/oi,e=>e.getDate()-1);hc.range;const Qp=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/oi,e=>e.getUTCDate()-1);Qp.range;const _P=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/oi,e=>Math.floor(e/oi));_P.range;function Xa(e){return Rt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*qr)/zx)}const Jp=Xa(0),Od=Xa(1),Gq=Xa(2),Kq=Xa(3),as=Xa(4),qq=Xa(5),Xq=Xa(6);Jp.range;Od.range;Gq.range;Kq.range;as.range;qq.range;Xq.range;function Ya(e){return Rt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/zx)}const eh=Ya(0),jd=Ya(1),Yq=Ya(2),Zq=Ya(3),os=Ya(4),Qq=Ya(5),Jq=Ya(6);eh.range;jd.range;Yq.range;Zq.range;os.range;Qq.range;Jq.range;const Gx=Rt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Gx.range;const Kx=Rt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Kx.range;const si=Rt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});si.range;const li=Rt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());li.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});li.range;function SP(e,t,r,n,i,a){const o=[[Oa,1,qn],[Oa,5,5*qn],[Oa,15,15*qn],[Oa,30,30*qn],[a,1,qr],[a,5,5*qr],[a,15,15*qr],[a,30,30*qr],[i,1,Xn],[i,3,3*Xn],[i,6,6*Xn],[i,12,12*Xn],[n,1,oi],[n,2,2*oi],[r,1,zx],[t,1,mS],[t,3,3*mS],[e,1,Lm]];function s(u,f,c){const p=fg).right(o,p);if(h===o.length)return e.every(Gy(u/Lm,f/Lm,c));if(h===0)return Sd.every(Math.max(Gy(u,f,c),1));const[b,v]=o[p/o[h-1][2]53)return null;"w"in k||(k.w=1),"Z"in k?(K=Fm(sl(k.y,0,1)),me=K.getUTCDay(),K=me>4||me===0?jd.ceil(K):jd(K),K=Qp.offset(K,(k.V-1)*7),k.y=K.getUTCFullYear(),k.m=K.getUTCMonth(),k.d=K.getUTCDate()+(k.w+6)%7):(K=Bm(sl(k.y,0,1)),me=K.getDay(),K=me>4||me===0?Od.ceil(K):Od(K),K=hc.offset(K,(k.V-1)*7),k.y=K.getFullYear(),k.m=K.getMonth(),k.d=K.getDate()+(k.w+6)%7)}else("W"in k||"U"in k)&&("w"in k||(k.w="u"in k?k.u%7:"W"in k?1:0),me="Z"in k?Fm(sl(k.y,0,1)).getUTCDay():Bm(sl(k.y,0,1)).getDay(),k.m=0,k.d="W"in k?(k.w+6)%7+k.W*7-(me+5)%7:k.w+k.U*7-(me+6)%7);return"Z"in k?(k.H+=k.Z/100|0,k.M+=k.Z%100,Fm(k)):Bm(k)}}function A(Z,ne,pe,k){for(var H=0,K=ne.length,me=pe.length,_e,de;H=me)return-1;if(_e=ne.charCodeAt(H++),_e===37){if(_e=ne.charAt(H++),de=x[_e in vS?ne.charAt(H++):_e],!de||(k=de(Z,pe,k))<0)return-1}else if(_e!=pe.charCodeAt(k++))return-1}return k}function E(Z,ne,pe){var k=u.exec(ne.slice(pe));return k?(Z.p=f.get(k[0].toLowerCase()),pe+k[0].length):-1}function $(Z,ne,pe){var k=h.exec(ne.slice(pe));return k?(Z.w=b.get(k[0].toLowerCase()),pe+k[0].length):-1}function N(Z,ne,pe){var k=c.exec(ne.slice(pe));return k?(Z.w=p.get(k[0].toLowerCase()),pe+k[0].length):-1}function P(Z,ne,pe){var k=y.exec(ne.slice(pe));return k?(Z.m=m.get(k[0].toLowerCase()),pe+k[0].length):-1}function I(Z,ne,pe){var k=v.exec(ne.slice(pe));return k?(Z.m=g.get(k[0].toLowerCase()),pe+k[0].length):-1}function D(Z,ne,pe){return A(Z,t,ne,pe)}function B(Z,ne,pe){return A(Z,r,ne,pe)}function V(Z,ne,pe){return A(Z,n,ne,pe)}function U(Z){return o[Z.getDay()]}function R(Z){return a[Z.getDay()]}function F(Z){return l[Z.getMonth()]}function L(Z){return s[Z.getMonth()]}function q(Z){return i[+(Z.getHours()>=12)]}function W(Z){return 1+~~(Z.getMonth()/3)}function Y(Z){return o[Z.getUTCDay()]}function he(Z){return a[Z.getUTCDay()]}function Ae(Z){return l[Z.getUTCMonth()]}function xe(Z){return s[Z.getUTCMonth()]}function We(Z){return i[+(Z.getUTCHours()>=12)]}function Me(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var ne=_(Z+="",w);return ne.toString=function(){return Z},ne},parse:function(Z){var ne=O(Z+="",!1);return ne.toString=function(){return Z},ne},utcFormat:function(Z){var ne=_(Z+="",S);return ne.toString=function(){return Z},ne},utcParse:function(Z){var ne=O(Z+="",!0);return ne.toString=function(){return Z},ne}}}var vS={"-":"",_:" ",0:"0"},Ft=/^\s*\d+/,aX=/^%/,oX=/[\\^$*+?|[\]().{}]/g;function Fe(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function lX(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function uX(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function cX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function fX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function dX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function yS(e,t,r){var n=Ft.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function gS(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function pX(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function hX(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function mX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function xS(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function vX(e,t,r){var n=Ft.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function bS(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function yX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function gX(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function xX(e,t,r){var n=Ft.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function bX(e,t,r){var n=Ft.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function wX(e,t,r){var n=aX.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function _X(e,t,r){var n=Ft.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function SX(e,t,r){var n=Ft.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function wS(e,t){return Fe(e.getDate(),t,2)}function OX(e,t){return Fe(e.getHours(),t,2)}function jX(e,t){return Fe(e.getHours()%12||12,t,2)}function AX(e,t){return Fe(1+hc.count(si(e),e),t,3)}function OP(e,t){return Fe(e.getMilliseconds(),t,3)}function EX(e,t){return OP(e,t)+"000"}function kX(e,t){return Fe(e.getMonth()+1,t,2)}function PX(e,t){return Fe(e.getMinutes(),t,2)}function CX(e,t){return Fe(e.getSeconds(),t,2)}function TX(e){var t=e.getDay();return t===0?7:t}function NX(e,t){return Fe(Jp.count(si(e)-1,e),t,2)}function jP(e){var t=e.getDay();return t>=4||t===0?as(e):as.ceil(e)}function $X(e,t){return e=jP(e),Fe(as.count(si(e),e)+(si(e).getDay()===4),t,2)}function RX(e){return e.getDay()}function IX(e,t){return Fe(Od.count(si(e)-1,e),t,2)}function MX(e,t){return Fe(e.getFullYear()%100,t,2)}function DX(e,t){return e=jP(e),Fe(e.getFullYear()%100,t,2)}function LX(e,t){return Fe(e.getFullYear()%1e4,t,4)}function BX(e,t){var r=e.getDay();return e=r>=4||r===0?as(e):as.ceil(e),Fe(e.getFullYear()%1e4,t,4)}function FX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Fe(t/60|0,"0",2)+Fe(t%60,"0",2)}function _S(e,t){return Fe(e.getUTCDate(),t,2)}function zX(e,t){return Fe(e.getUTCHours(),t,2)}function UX(e,t){return Fe(e.getUTCHours()%12||12,t,2)}function VX(e,t){return Fe(1+Qp.count(li(e),e),t,3)}function AP(e,t){return Fe(e.getUTCMilliseconds(),t,3)}function WX(e,t){return AP(e,t)+"000"}function HX(e,t){return Fe(e.getUTCMonth()+1,t,2)}function GX(e,t){return Fe(e.getUTCMinutes(),t,2)}function KX(e,t){return Fe(e.getUTCSeconds(),t,2)}function qX(e){var t=e.getUTCDay();return t===0?7:t}function XX(e,t){return Fe(eh.count(li(e)-1,e),t,2)}function EP(e){var t=e.getUTCDay();return t>=4||t===0?os(e):os.ceil(e)}function YX(e,t){return e=EP(e),Fe(os.count(li(e),e)+(li(e).getUTCDay()===4),t,2)}function ZX(e){return e.getUTCDay()}function QX(e,t){return Fe(jd.count(li(e)-1,e),t,2)}function JX(e,t){return Fe(e.getUTCFullYear()%100,t,2)}function eY(e,t){return e=EP(e),Fe(e.getUTCFullYear()%100,t,2)}function tY(e,t){return Fe(e.getUTCFullYear()%1e4,t,4)}function rY(e,t){var r=e.getUTCDay();return e=r>=4||r===0?os(e):os.ceil(e),Fe(e.getUTCFullYear()%1e4,t,4)}function nY(){return"+0000"}function SS(){return"%"}function OS(e){return+e}function jS(e){return Math.floor(+e/1e3)}var io,kP,PP;iY({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function iY(e){return io=iX(e),kP=io.format,io.parse,PP=io.utcFormat,io.utcParse,io}function aY(e){return new Date(e)}function oY(e){return e instanceof Date?+e:+new Date(+e)}function qx(e,t,r,n,i,a,o,s,l,u){var f=Rx(),c=f.invert,p=f.domain,h=u(".%L"),b=u(":%S"),v=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),m=u("%b %d"),w=u("%B"),S=u("%Y");function x(_){return(l(_)<_?h:s(_)<_?b:o(_)<_?v:a(_)<_?g:n(_)<_?i(_)<_?y:m:r(_)<_?w:S)(_)}return f.invert=function(_){return new Date(c(_))},f.domain=function(_){return arguments.length?p(Array.from(_,oY)):p().map(aY)},f.ticks=function(_){var O=p();return e(O[0],O[O.length-1],_??10)},f.tickFormat=function(_,O){return O==null?x:u(O)},f.nice=function(_){var O=p();return(!_||typeof _.range!="function")&&(_=t(O[0],O[O.length-1],_??10)),_?p(mP(O,_)):f},f.copy=function(){return pc(f,qx(e,t,r,n,i,a,o,s,l,u))},f}function sY(){return rn.apply(qx(rX,nX,si,Gx,Jp,hc,Wx,Ux,Oa,kP).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function lY(){return rn.apply(qx(eX,tX,li,Kx,eh,Qp,Hx,Vx,Oa,PP).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function th(){var e=0,t=1,r,n,i,a,o=lr,s=!1,l;function u(c){return c==null||isNaN(c=+c)?l:o(i===0?.5:(c=(a(c)-r)*i,s?Math.max(0,Math.min(1,c)):c))}u.domain=function(c){return arguments.length?([e,t]=c,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(c){return arguments.length?(s=!!c,u):s},u.interpolator=function(c){return arguments.length?(o=c,u):o};function f(c){return function(p){var h,b;return arguments.length?([h,b]=p,o=c(h,b),u):[o(0),o(1)]}}return u.range=f(zs),u.rangeRound=f($x),u.unknown=function(c){return arguments.length?(l=c,u):l},function(c){return a=c,r=c(e),n=c(t),i=r===n?0:1/(n-r),u}}function oa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function CP(){var e=aa(th()(lr));return e.copy=function(){return oa(e,CP())},mi.apply(e,arguments)}function TP(){var e=Dx(th()).domain([1,10]);return e.copy=function(){return oa(e,TP()).base(e.base())},mi.apply(e,arguments)}function NP(){var e=Lx(th());return e.copy=function(){return oa(e,NP()).constant(e.constant())},mi.apply(e,arguments)}function Xx(){var e=Bx(th());return e.copy=function(){return oa(e,Xx()).exponent(e.exponent())},mi.apply(e,arguments)}function uY(){return Xx.apply(null,arguments).exponent(.5)}function $P(){var e=[],t=lr;function r(n){if(n!=null&&!isNaN(n=+n))return t((fc(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Wi),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>XK(e,a/n))},r.copy=function(){return $P(t).domain(e)},mi.apply(r,arguments)}function rh(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=lr,f,c=!1,p;function h(v){return isNaN(v=+v)?p:(v=.5+((v=+f(v))-a)*(n*vt}var DP=pY,hY=nh,mY=DP,vY=Bs;function yY(e){return e&&e.length?hY(e,vY,mY):void 0}var gY=yY;const ih=Ke(gY);function xY(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};le.decimalPlaces=le.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*lt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};le.dividedBy=le.div=function(e){return Jn(this,new this.constructor(e))};le.dividedToIntegerBy=le.idiv=function(e){var t=this,r=t.constructor;return Je(Jn(t,new r(e),0,1),r.precision)};le.equals=le.eq=function(e){return!this.cmp(e)};le.exponent=function(){return Et(this)};le.greaterThan=le.gt=function(e){return this.cmp(e)>0};le.greaterThanOrEqualTo=le.gte=function(e){return this.cmp(e)>=0};le.isInteger=le.isint=function(){return this.e>this.d.length-2};le.isNegative=le.isneg=function(){return this.s<0};le.isPositive=le.ispos=function(){return this.s>0};le.isZero=function(){return this.s===0};le.lessThan=le.lt=function(e){return this.cmp(e)<0};le.lessThanOrEqualTo=le.lte=function(e){return this.cmp(e)<1};le.logarithm=le.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Cr))throw Error(Jr+"NaN");if(r.s<1)throw Error(Jr+(r.s?"NaN":"-Infinity"));return r.eq(Cr)?new n(0):(dt=!1,t=Jn(Eu(r,a),Eu(e,a),a),dt=!0,Je(t,i))};le.minus=le.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?UP(t,e):FP(t,(e.s=-e.s,e))};le.modulo=le.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Jr+"NaN");return r.s?(dt=!1,t=Jn(r,e,0,1).times(e),dt=!0,r.minus(t)):Je(new n(r),i)};le.naturalExponential=le.exp=function(){return zP(this)};le.naturalLogarithm=le.ln=function(){return Eu(this)};le.negated=le.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};le.plus=le.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?FP(t,e):UP(t,(e.s=-e.s,e))};le.precision=le.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ta+e);if(t=Et(i)+1,n=i.d.length-1,r=n*lt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};le.squareRoot=le.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Jr+"NaN")}for(e=Et(s),dt=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=kn(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Vs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Jn(s,a,o+2)).times(.5),kn(a.d).slice(0,o)===(t=kn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Je(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return dt=!0,Je(n,r)};le.times=le.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,c=f.constructor,p=f.d,h=(e=new c(e)).d;if(!f.s||!e.s)return new c(0);for(e.s*=f.s,r=f.e+e.e,l=p.length,u=h.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+h[n]*p[i-n-1]+t,a[i--]=s%It|0,t=s/It|0;a[i]=(a[i]+t)%It|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,dt?Je(e,c.precision):e};le.toDecimalPlaces=le.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(In(e,0,Us),t===void 0?t=n.rounding:In(t,0,8),Je(r,e+Et(r)+1,t))};le.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Wa(n,!0):(In(e,0,Us),t===void 0?t=i.rounding:In(t,0,8),n=Je(new i(n),e+1,t),r=Wa(n,!0,e+1)),r};le.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Wa(i):(In(e,0,Us),t===void 0?t=a.rounding:In(t,0,8),n=Je(new a(i),e+Et(i)+1,t),r=Wa(n.abs(),!1,e+Et(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};le.toInteger=le.toint=function(){var e=this,t=e.constructor;return Je(new t(e),Et(e)+1,t.rounding)};le.toNumber=function(){return+this};le.toPower=le.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(Cr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Jr+"Infinity");return s}if(s.eq(Cr))return s;if(n=l.precision,e.eq(Cr))return Je(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=BP){for(i=new l(Cr),t=Math.ceil(n/lt+4),dt=!1;r%2&&(i=i.times(s),kS(i.d,t)),r=Vs(r/2),r!==0;)s=s.times(s),kS(s.d,t);return dt=!0,e.s<0?new l(Cr).div(i):Je(i,n)}}else if(a<0)throw Error(Jr+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,dt=!1,i=e.times(Eu(s,n+u)),dt=!0,i=zP(i),i.s=a,i};le.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Et(i),n=Wa(i,r<=a.toExpNeg||r>=a.toExpPos)):(In(e,1,Us),t===void 0?t=a.rounding:In(t,0,8),i=Je(new a(i),e,t),r=Et(i),n=Wa(i,e<=r||r<=a.toExpNeg,e)),n};le.toSignificantDigits=le.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(In(e,1,Us),t===void 0?t=n.rounding:In(t,0,8)),Je(new n(r),e,t)};le.toString=le.valueOf=le.val=le.toJSON=le[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Et(e),r=e.constructor;return Wa(e,t<=r.toExpNeg||t>=r.toExpPos)};function FP(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,c=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),dt?Je(t,c):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(c/lt),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/It|0,l[a]%=It;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,dt?Je(t,c):t}function In(e,t,r){if(e!==~~e||er)throw Error(Ta+e)}function kn(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,f,c,p,h,b,v,g,y,m,w,S,x,_,O,A,E=n.constructor,$=n.s==i.s?1:-1,N=n.d,P=i.d;if(!n.s)return new E(n);if(!i.s)throw Error(Jr+"Division by zero");for(l=n.e-i.e,O=P.length,x=N.length,h=new E($),b=h.d=[],u=0;P[u]==(N[u]||0);)++u;if(P[u]>(N[u]||0)&&--l,a==null?m=a=E.precision:o?m=a+(Et(n)-Et(i))+1:m=a,m<0)return new E(0);if(m=m/lt+2|0,u=0,O==1)for(f=0,P=P[0],m++;(u1&&(P=e(P,f),N=e(N,f),O=P.length,x=N.length),S=O,v=N.slice(0,O),g=v.length;g=It/2&&++_;do f=0,s=t(P,v,O,g),s<0?(y=v[0],O!=g&&(y=y*It+(v[1]||0)),f=y/_|0,f>1?(f>=It&&(f=It-1),c=e(P,f),p=c.length,g=v.length,s=t(c,v,p,g),s==1&&(f--,r(c,O16)throw Error(Zx+Et(e));if(!e.s)return new f(Cr);for(dt=!1,s=c,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(va(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(Cr),f.precision=s;;){if(i=Je(i.times(e),s),r=r.times(++l),o=a.plus(Jn(i,r,s)),kn(o.d).slice(0,s)===kn(a.d).slice(0,s)){for(;u--;)a=Je(a.times(a),s);return f.precision=c,t==null?(dt=!0,Je(a,c)):a}a=o}}function Et(e){for(var t=e.e*lt,r=e.d[0];r>=10;r/=10)t++;return t}function zm(e,t,r){if(t>e.LN10.sd())throw dt=!0,r&&(e.precision=r),Error(Jr+"LN10 precision limit exceeded");return Je(new e(e.LN10),t)}function Ai(e){for(var t="";e--;)t+="0";return t}function Eu(e,t){var r,n,i,a,o,s,l,u,f,c=1,p=10,h=e,b=h.d,v=h.constructor,g=v.precision;if(h.s<1)throw Error(Jr+(h.s?"NaN":"-Infinity"));if(h.eq(Cr))return new v(0);if(t==null?(dt=!1,u=g):u=t,h.eq(10))return t==null&&(dt=!0),zm(v,u);if(u+=p,v.precision=u,r=kn(b),n=r.charAt(0),a=Et(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=kn(h.d),n=r.charAt(0),c++;a=Et(h),n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=zm(v,u+2,g).times(a+""),h=Eu(new v(n+"."+r.slice(1)),u-p).plus(l),v.precision=g,t==null?(dt=!0,Je(h,g)):h;for(s=o=h=Jn(h.minus(Cr),h.plus(Cr),u),f=Je(h.times(h),u),i=3;;){if(o=Je(o.times(f),u),l=s.plus(Jn(o,new v(i),u)),kn(l.d).slice(0,u)===kn(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(zm(v,u+2,g).times(a+""))),s=Jn(s,new v(c),u),v.precision=g,t==null?(dt=!0,Je(s,g)):s;s=l,i+=2}}function ES(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Vs(r/lt),e.d=[],n=(r+1)%lt,r<0&&(n+=lt),nAd||e.e<-Ad))throw Error(Zx+r)}else e.s=0,e.e=0,e.d=[0];return e}function Je(e,t,r){var n,i,a,o,s,l,u,f,c=e.d;for(o=1,a=c[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=lt,i=t,u=c[f=0];else{if(f=Math.ceil((n+1)/lt),a=c.length,f>=a)return e;for(u=a=c[f],o=1;a>=10;a/=10)o++;n%=lt,i=n-lt+o}if(r!==void 0&&(a=va(10,o-i-1),s=u/a%10|0,l=t<0||c[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/va(10,o-i):0:c[f-1])%10&1||r==(e.s<0?8:7))),t<1||!c[0])return l?(a=Et(e),c.length=1,t=t-a-1,c[0]=va(10,(lt-t%lt)%lt),e.e=Vs(-t/lt)||0):(c.length=1,c[0]=e.e=e.s=0),e;if(n==0?(c.length=f,a=1,f--):(c.length=f+1,a=va(10,lt-n),c[f]=i>0?(u/va(10,o-i)%va(10,i)|0)*a:0),l)for(;;)if(f==0){(c[0]+=a)==It&&(c[0]=1,++e.e);break}else{if(c[f]+=a,c[f]!=It)break;c[f--]=0,a=1}for(n=c.length;c[--n]===0;)c.pop();if(dt&&(e.e>Ad||e.e<-Ad))throw Error(Zx+Et(e));return e}function UP(e,t){var r,n,i,a,o,s,l,u,f,c,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),dt?Je(t,h):t;if(l=e.d,c=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=c.length):(r=c,n=u,s=l.length),i=Math.max(Math.ceil(h/lt),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=c.length,f=i0;--i)l[s++]=0;for(i=c.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Ai(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ai(-i-1)+a,r&&(n=r-o)>0&&(a+=Ai(n))):i>=o?(a+=Ai(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Ai(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Ai(n))),e.s<0?"-"+a:a}function kS(e,t){if(e.length>t)return e.length=t,!0}function VP(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ta+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return ES(o,a.toString())}else if(typeof a!="string")throw Error(Ta+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,FY.test(a))ES(o,a);else throw Error(Ta+a)}if(i.prototype=le,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=VP,i.config=i.set=zY,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Ta+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ta+r+": "+n);return this}var Qx=VP(BY);Cr=new Qx(1);const Xe=Qx;function UY(e){return GY(e)||HY(e)||WY(e)||VY()}function VY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WY(e,t){if(e){if(typeof e=="string")return Zy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zy(e,t)}}function HY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function GY(e){if(Array.isArray(e))return Zy(e)}function Zy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,PS(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function sZ(e){if(Array.isArray(e))return e}function qP(e){var t=ku(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function XP(e,t,r){if(e.lte(0))return new Xe(0);var n=lh.getDigitCount(e.toNumber()),i=new Xe(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Xe(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Xe(Math.ceil(l))}function lZ(e,t,r){var n=1,i=new Xe(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Xe(10).pow(lh.getDigitCount(e)-1),i=new Xe(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Xe(Math.floor(e)))}else e===0?i=new Xe(Math.floor((t-1)/2)):r||(i=new Xe(Math.floor(e)));var o=Math.floor((t-1)/2),s=YY(XY(function(l){return i.add(new Xe(l-o).mul(n)).toNumber()}),Qy);return s(0,t)}function YP(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Xe(0),tickMin:new Xe(0),tickMax:new Xe(0)};var a=XP(new Xe(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Xe(0):(o=new Xe(e).add(t).div(2),o=o.sub(new Xe(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Xe(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?YP(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Xe(s).mul(a)),tickMax:o.add(new Xe(l).mul(a))})}function uZ(e){var t=ku(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=qP([r,n]),l=ku(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var c=f===1/0?[u].concat(eg(Qy(0,i-1).map(function(){return 1/0}))):[].concat(eg(Qy(0,i-1).map(function(){return-1/0})),[f]);return r>n?Jy(c):c}if(u===f)return lZ(u,i,a);var p=YP(u,f,o,a),h=p.step,b=p.tickMin,v=p.tickMax,g=lh.rangeStep(b,v.add(new Xe(.1).mul(h)),h);return r>n?Jy(g):g}function cZ(e,t){var r=ku(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=qP([n,i]),s=ku(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),c=XP(new Xe(u).sub(l).div(f-1),a,0),p=[].concat(eg(lh.rangeStep(new Xe(l),new Xe(u).sub(new Xe(.99).mul(c)),c)),[u]);return n>i?Jy(p):p}var fZ=GP(uZ),dZ=GP(cZ),pZ="Invariant failed";function Ha(e,t){throw new Error(pZ)}var hZ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ss(e){"@babel/helpers - typeof";return ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ss(e)}function Ed(){return Ed=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SZ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,c=i[u].coordinate,p=u>=s-1?i[0].coordinate:i[u+1].coordinate,h=void 0;if(or(c-f)!==or(p-c)){var b=[];if(or(p-c)===or(l[1]-l[0])){h=p;var v=c+l[1]-l[0];b[0]=Math.min(v,(v+f)/2),b[1]=Math.max(v,(v+f)/2)}else{h=f;var g=p+l[1]-l[0];b[0]=Math.min(c,(g+c)/2),b[1]=Math.max(c,(g+c)/2)}var y=[Math.min(c,(h+c)/2),Math.max(c,(h+c)/2)];if(t>y[0]&&t<=y[1]||t>=b[0]&&t<=b[1]){o=i[u].index;break}}else{var m=Math.min(f,p),w=Math.max(f,p);if(t>(m+c)/2&&t<=(w+c)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},Jx=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?xt(xt({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},FZ=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(y&&y.length){var m=y[0].type.defaultProps,w=m!==void 0?xt(xt({},m),y[0].props):y[0].props,S=w.barSize,x=w[g];o[x]||(o[x]=[]);var _=Ce(S)?r:S;o[x].push({item:y[0],stackList:y.slice(1),barSize:Ce(_)?void 0:sr(_,n,0)})}}return o},zZ=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=sr(r,i,0,!0),f,c=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=i/l,b=o.reduce(function(S,x){return S+x.barSize||0},0);b+=(l-1)*u,b>=i&&(b-=(l-1)*u,u=0),b>=i&&h>0&&(p=!0,h*=.9,b=l*h);var v=(i-b)/2>>0,g={offset:v-u,size:0};f=o.reduce(function(S,x){var _={item:x.item,position:{offset:g.offset+g.size+u,size:p?h:x.barSize}},O=[].concat(NS(S),[_]);return g=O[O.length-1].position,x.stackList&&x.stackList.length&&x.stackList.forEach(function(A){O.push({item:A,position:g})}),O},c)}else{var y=sr(n,i,0,!0);i-2*y-(l-1)*u<=0&&(u=0);var m=(i-2*y-(l-1)*u)/l;m>1&&(m>>=0);var w=s===+s?Math.min(m,s):m;f=o.reduce(function(S,x,_){var O=[].concat(NS(S),[{item:x.item,position:{offset:y+(m+u)*_+(m-w)/2,size:w}}]);return x.stackList&&x.stackList.length&&x.stackList.forEach(function(A){O.push({item:A,position:O[O.length-1].position})}),O},c)}return f},UZ=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=eC({children:a,legendWidth:l});if(u){var f=i||{},c=f.width,p=f.height,h=u.align,b=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&b==="middle")&&h!=="center"&&ie(t[h]))return xt(xt({},t),{},Lo({},h,t[h]+(c||0)));if((v==="horizontal"||v==="vertical"&&h==="center")&&b!=="middle"&&ie(t[b]))return xt(xt({},t),{},Lo({},b,t[b]+(p||0)))}return t},VZ=function(t,r,n){return Ce(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},tC=function(t,r,n,i,a){var o=r.props.children,s=Yr(o,uh).filter(function(u){return VZ(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var c=rr(f,n);if(Ce(c))return u;var p=Array.isArray(c)?[ah(c),ih(c)]:[c,c],h=l.reduce(function(b,v){var g=rr(f,v,0),y=p[0]-Math.abs(Array.isArray(g)?g[0]:g),m=p[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(y,b[0]),Math.max(m,b[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},WZ=function(t,r,n,i,a){var o=r.map(function(s){return tC(t,s,n,a,i)}).filter(function(s){return!Ce(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},rC=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&tC(t,l,u,i)||Fl(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,c=u.length;f=2?or(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(c){var p=a?a.indexOf(c):c;return{coordinate:i(p)+u,value:c,offset:u}});return f.filter(function(c){return!uc(c.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(c,p){return{coordinate:i(c)+u,value:c,index:p,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(c){return{coordinate:i(c)+u,value:c,offset:u}}):i.domain().map(function(c,p){return{coordinate:i(c)+u,value:a?a[c]:c,index:p,offset:u}})},Um=new WeakMap,Xc=function(t,r){if(typeof r!="function")return t;Um.has(t)||Um.set(t,new WeakMap);var n=Um.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},iC=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:_u(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:_d(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Bl(),realScaleType:"point"}:a==="category"?{scale:_u(),realScaleType:"band"}:{scale:_d(),realScaleType:"linear"};if(za(i)){var l="scale".concat(Wp(i));return{scale:(AS[l]||Bl)(),realScaleType:AS[l]?l:"point"}}return Oe(i)?{scale:i}:{scale:Bl(),realScaleType:"point"}},RS=1e-4,aC=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-RS,o=Math.max(i[0],i[1])+RS,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},HZ=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},qZ=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},XZ={sign:KZ,expand:pz,none:Jo,silhouette:hz,wiggle:mz,positive:qZ},YZ=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=XZ[n],o=dz().keys(i).value(function(s,l){return+rr(s,l,0)}).order(ky).offset(a);return o(t)},ZZ=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(c,p){var h,b=(h=p.type)!==null&&h!==void 0&&h.defaultProps?xt(xt({},p.type.defaultProps),p.props):p.props,v=b.stackId,g=b.hide;if(g)return c;var y=b[n],m=c[y]||{hasStack:!1,stackGroups:{}};if($t(v)){var w=m.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(p),m.hasStack=!0,m.stackGroups[v]=w}else m.stackGroups[cc("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[p]};return xt(xt({},c),{},Lo({},y,m))},l),f={};return Object.keys(u).reduce(function(c,p){var h=u[p];if(h.hasStack){var b={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(v,g){var y=h.stackGroups[g];return xt(xt({},v),{},Lo({},g,{numericAxisId:n,cateAxisId:i,items:y.items,stackedData:YZ(t,y.items,a)}))},b)}return xt(xt({},c),{},Lo({},p,h))},f)},oC=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=fZ(u,a,s);return t.domain([ah(f),ih(f)]),{niceTicks:f}}if(a&&i==="number"){var c=t.domain(),p=dZ(c,a,s);return{niceTicks:p}}return null},IS=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=rr(o,r.dataKey,r.domain[s]);return Ce(l)?null:r.scale(l)-a/2+i},QZ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},JZ=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?xt(xt({},t.type.defaultProps),t.props):t.props,a=i.stackId;if($t(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},eQ=function(t){return t.reduce(function(r,n){return[ah(n.concat([r[0]]).filter(ie)),ih(n.concat([r[1]]).filter(ie))]},[1/0,-1/0])},sC=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var c=eQ(f.slice(r,n+1));return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},MS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,DS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ig=function(t,r,n){if(Oe(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(ie(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(MS.test(t[0])){var a=+MS.exec(t[0])[1];i[0]=r[0]-a}else Oe(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(ie(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(DS.test(t[1])){var o=+DS.exec(t[1])[1];i[1]=r[1]+o}else Oe(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Pd=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Ex(r,function(c){return c.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},uQ=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=sr(t.cx,o,o/2),c=sr(t.cy,s,s/2),p=cC(o,s,n),h=sr(t.innerRadius,p,0),b=sr(t.outerRadius,p,p*.8),v=Object.keys(r);return v.reduce(function(g,y){var m=r[y],w=m.domain,S=m.reversed,x;if(Ce(m.range))i==="angleAxis"?x=[l,u]:i==="radiusAxis"&&(x=[h,b]),S&&(x=[x[1],x[0]]);else{x=m.range;var _=x,O=nQ(_,2);l=O[0],u=O[1]}var A=iC(m,a),E=A.realScaleType,$=A.scale;$.domain(w).range(x),aC($);var N=oC($,zn(zn({},m),{},{realScaleType:E})),P=zn(zn(zn({},m),N),{},{range:x,radius:b,realScaleType:E,scale:$,cx:f,cy:c,innerRadius:h,outerRadius:b,startAngle:l,endAngle:u});return zn(zn({},g),{},uC({},y,P))},{})},cQ=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},fQ=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=cQ({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:lQ(u),angleInRadian:u}},dQ=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},pQ=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},zS=function(t,r){var n=t.x,i=t.y,a=fQ({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=dQ(r),c=f.startAngle,p=f.endAngle,h=s,b;if(c<=p){for(;h>p;)h-=360;for(;h=c&&h<=p}else{for(;h>c;)h-=360;for(;h=p&&h<=c}return b?zn(zn({},r),{},{radius:o,angle:pQ(h,r)}):null},fC=function(t){return!j.isValidElement(t)&&!Oe(t)&&typeof t!="boolean"?t.className:""};function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var hQ=["offset"];function mQ(e){return xQ(e)||gQ(e)||yQ(e)||vQ()}function vQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yQ(e,t){if(e){if(typeof e=="string")return ag(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ag(e,t)}}function gQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xQ(e){if(Array.isArray(e))return ag(e)}function ag(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function US(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pt(e){for(var t=1;t=0?1:-1,w,S;i==="insideStart"?(w=h+m*o,S=v):i==="insideEnd"?(w=b-m*o,S=!v):i==="end"&&(w=b+m*o,S=v),S=y<=0?S:!S;var x=it(u,f,g,w),_=it(u,f,g,w+(S?1:-1)*359),O="M".concat(x.x,",").concat(x.y,` - A`).concat(g,",").concat(g,",0,1,").concat(S?0:1,`, - `).concat(_.x,",").concat(_.y),A=Ce(t.id)?cc("recharts-radial-line-"):t.id;return T.createElement("text",$u({},n,{dominantBaseline:"central",className:Ee("recharts-radial-bar-label",s)}),T.createElement("defs",null,T.createElement("path",{id:A,d:O})),T.createElement("textPath",{xlinkHref:"#".concat(A)},r))},kQ=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,f=a.startAngle,c=a.endAngle,p=(f+c)/2;if(i==="outside"){var h=it(o,s,u+n,p),b=h.x,v=h.y;return{x:b,y:v,textAnchor:b>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+u)/2,y=it(o,s,g,p),m=y.x,w=y.y;return{x:m,y:w,textAnchor:"middle",verticalAnchor:"middle"}},PQ=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,c=f>=0?1:-1,p=c*i,h=c>0?"end":"start",b=c>0?"start":"end",v=u>=0?1:-1,g=v*i,y=v>0?"end":"start",m=v>0?"start":"end";if(a==="top"){var w={x:s+u/2,y:l-c*i,textAnchor:"middle",verticalAnchor:h};return Pt(Pt({},w),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+f+p,textAnchor:"middle",verticalAnchor:b};return Pt(Pt({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var x={x:s-g,y:l+f/2,textAnchor:y,verticalAnchor:"middle"};return Pt(Pt({},x),n?{width:Math.max(x.x-n.x,0),height:f}:{})}if(a==="right"){var _={x:s+u+g,y:l+f/2,textAnchor:m,verticalAnchor:"middle"};return Pt(Pt({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return a==="insideLeft"?Pt({x:s+g,y:l+f/2,textAnchor:m,verticalAnchor:"middle"},O):a==="insideRight"?Pt({x:s+u-g,y:l+f/2,textAnchor:y,verticalAnchor:"middle"},O):a==="insideTop"?Pt({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:b},O):a==="insideBottom"?Pt({x:s+u/2,y:l+f-p,textAnchor:"middle",verticalAnchor:h},O):a==="insideTopLeft"?Pt({x:s+g,y:l+p,textAnchor:m,verticalAnchor:b},O):a==="insideTopRight"?Pt({x:s+u-g,y:l+p,textAnchor:y,verticalAnchor:b},O):a==="insideBottomLeft"?Pt({x:s+g,y:l+f-p,textAnchor:m,verticalAnchor:h},O):a==="insideBottomRight"?Pt({x:s+u-g,y:l+f-p,textAnchor:y,verticalAnchor:h},O):$s(a)&&(ie(a.x)||_a(a.x))&&(ie(a.y)||_a(a.y))?Pt({x:s+sr(a.x,u),y:l+sr(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):Pt({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},CQ=function(t){return"cx"in t&&ie(t.cx)};function Lt(e){var t=e.offset,r=t===void 0?5:t,n=bQ(e,hQ),i=Pt({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,c=f===void 0?"":f,p=i.textBreakAll;if(!a||Ce(s)&&Ce(l)&&!j.isValidElement(u)&&!Oe(u))return null;if(j.isValidElement(u))return j.cloneElement(u,i);var h;if(Oe(u)){if(h=j.createElement(u,i),j.isValidElement(h))return h}else h=jQ(i);var b=CQ(a),v=ge(i,!0);if(b&&(o==="insideStart"||o==="insideEnd"||o==="end"))return EQ(i,h,v);var g=b?kQ(i):PQ(i);return T.createElement(Va,$u({className:Ee("recharts-label",c)},v,g,{breakAll:p}),h)}Lt.displayName="Label";var dC=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,c=t.x,p=t.y,h=t.top,b=t.left,v=t.width,g=t.height,y=t.clockWise,m=t.labelViewBox;if(m)return m;if(ie(v)&&ie(g)){if(ie(c)&&ie(p))return{x:c,y:p,width:v,height:g};if(ie(h)&&ie(b))return{x:h,y:b,width:v,height:g}}return ie(c)&&ie(p)?{x:c,y:p,width:0,height:0}:ie(r)&&ie(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:y}:t.viewBox?t.viewBox:{}},TQ=function(t,r){return t?t===!0?T.createElement(Lt,{key:"label-implicit",viewBox:r}):$t(t)?T.createElement(Lt,{key:"label-implicit",viewBox:r,value:t}):j.isValidElement(t)?t.type===Lt?j.cloneElement(t,{key:"label-implicit",viewBox:r}):T.createElement(Lt,{key:"label-implicit",content:t,viewBox:r}):Oe(t)?T.createElement(Lt,{key:"label-implicit",content:t,viewBox:r}):$s(t)?T.createElement(Lt,$u({viewBox:r},t,{key:"label-implicit"})):null:null},NQ=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=dC(t),o=Yr(i,Lt).map(function(l,u){return j.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=TQ(t.label,r||a);return[s].concat(mQ(o))};Lt.parseViewBox=dC;Lt.renderCallByParent=NQ;function $Q(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var RQ=$Q;const IQ=Ke(RQ);function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}var MQ=["valueAccessor"],DQ=["data","dataKey","clockWise","id","textBreakAll"];function LQ(e){return UQ(e)||zQ(e)||FQ(e)||BQ()}function BQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FQ(e,t){if(e){if(typeof e=="string")return og(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return og(e,t)}}function zQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UQ(e){if(Array.isArray(e))return og(e)}function og(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function GQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var KQ=function(t){return Array.isArray(t.value)?IQ(t.value):t.value};function Hi(e){var t=e.valueAccessor,r=t===void 0?KQ:t,n=HS(e,MQ),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=HS(n,DQ);return!i||!i.length?null:T.createElement(He,{className:"recharts-label-list"},i.map(function(f,c){var p=Ce(a)?r(f,c):rr(f&&f.payload,a),h=Ce(s)?{}:{id:"".concat(s,"-").concat(c)};return T.createElement(Lt,Td({},ge(f,!0),u,h,{parentViewBox:f.parentViewBox,value:p,textBreakAll:l,viewBox:Lt.parseViewBox(Ce(o)?f:WS(WS({},f),{},{clockWise:o})),key:"label-".concat(c),index:c}))}))}Hi.displayName="LabelList";function qQ(e,t){return e?e===!0?T.createElement(Hi,{key:"labelList-implicit",data:t}):T.isValidElement(e)||Oe(e)?T.createElement(Hi,{key:"labelList-implicit",data:t,content:e}):$s(e)?T.createElement(Hi,Td({data:t},e,{key:"labelList-implicit"})):null:null}function XQ(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Yr(n,Hi).map(function(o,s){return j.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=qQ(e.label,t);return[a].concat(LQ(i))}Hi.renderCallByParent=XQ;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, - `).concat(c.x,",").concat(c.y,` - `);if(i>0){var h=it(r,n,i,o),b=it(r,n,i,u);p+="L ".concat(b.x,",").concat(b.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},eJ=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,c=or(f-u),p=Yc({cx:r,cy:n,radius:a,angle:u,sign:c,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,b=p.lineTangency,v=p.theta,g=Yc({cx:r,cy:n,radius:a,angle:f,sign:-c,cornerRadius:o,cornerIsExternal:l}),y=g.circleTangency,m=g.lineTangency,w=g.theta,S=l?Math.abs(u-f):Math.abs(u-f)-v-w;if(S<0)return s?"M ".concat(b.x,",").concat(b.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):pC({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var x="M ".concat(b.x,",").concat(b.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(h.x,",").concat(h.y,` - A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(c<0),",").concat(y.x,",").concat(y.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(m.x,",").concat(m.y,` - `);if(i>0){var _=Yc({cx:r,cy:n,radius:i,angle:u,sign:c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=_.circleTangency,A=_.lineTangency,E=_.theta,$=Yc({cx:r,cy:n,radius:i,angle:f,sign:-c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),N=$.circleTangency,P=$.lineTangency,I=$.theta,D=l?Math.abs(u-f):Math.abs(u-f)-E-I;if(D<0&&o===0)return"".concat(x,"L").concat(r,",").concat(n,"Z");x+="L".concat(P.x,",").concat(P.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(N.x,",").concat(N.y,` - A`).concat(i,",").concat(i,",0,").concat(+(D>180),",").concat(+(c>0),",").concat(O.x,",").concat(O.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(A.x,",").concat(A.y,"Z")}else x+="L".concat(r,",").concat(n,"Z");return x},tJ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},hC=function(t){var r=KS(KS({},tJ),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,c=r.endAngle,p=r.className;if(o0&&Math.abs(f-c)<360?g=eJ({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,b/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:c}):g=pC({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:c}),T.createElement("path",sg({},ge(r,!0),{className:h,d:g,role:"img"}))};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;thJ.call(e,t));function Za(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const yJ="__v",gJ="__o",xJ="_owner",{getOwnPropertyDescriptor:QS,keys:JS}=Object;function bJ(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e),new Uint8Array(t))}function wJ(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function _J(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function SJ(e,t){return Za(e.getTime(),t.getTime())}function OJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function jJ(e,t){return e===t}function eO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let f=!1,c=0;for(;(s=u.next())&&!s.done;){if(i[c]){c++;continue}const p=o.value,h=s.value;if(r.equals(p[0],h[0],l,c,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){f=i[c]=!0;break}c++}if(!f)return!1;l++}return!0}const AJ=Za;function EJ(e,t,r){const n=JS(e);let i=n.length;if(JS(t).length!==i)return!1;for(;i-- >0;)if(!gC(e,t,r,n[i]))return!1;return!0}function dl(e,t,r){const n=ZS(e);let i=n.length;if(ZS(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!gC(e,t,r,a)||(o=QS(e,a),s=QS(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function kJ(e,t){return Za(e.valueOf(),t.valueOf())}function PJ(e,t){return e.source===t.source&&e.flags===t.flags}function tO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function Nd(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function CJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function gC(e,t,r,n){return(n===xJ||n===gJ||n===yJ)&&(e.$$typeof||t.$$typeof)?!0:vJ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const TJ="[object ArrayBuffer]",NJ="[object Arguments]",$J="[object Boolean]",RJ="[object DataView]",IJ="[object Date]",MJ="[object Error]",DJ="[object Map]",LJ="[object Number]",BJ="[object Object]",FJ="[object RegExp]",zJ="[object Set]",UJ="[object String]",VJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},WJ="[object URL]",HJ=Object.prototype.toString;function GJ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:c,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:b}){return function(g,y,m){if(g===y)return!0;if(g==null||y==null)return!1;const w=typeof g;if(w!==typeof y)return!1;if(w!=="object")return w==="number"?s(g,y,m):w==="function"?a(g,y,m):!1;const S=g.constructor;if(S!==y.constructor)return!1;if(S===Object)return l(g,y,m);if(Array.isArray(g))return t(g,y,m);if(S===Date)return n(g,y,m);if(S===RegExp)return f(g,y,m);if(S===Map)return o(g,y,m);if(S===Set)return c(g,y,m);const x=HJ.call(g);if(x===IJ)return n(g,y,m);if(x===FJ)return f(g,y,m);if(x===DJ)return o(g,y,m);if(x===zJ)return c(g,y,m);if(x===BJ)return typeof g.then!="function"&&typeof y.then!="function"&&l(g,y,m);if(x===WJ)return h(g,y,m);if(x===MJ)return i(g,y,m);if(x===NJ)return l(g,y,m);if(VJ[x])return p(g,y,m);if(x===TJ)return e(g,y,m);if(x===RJ)return r(g,y,m);if(x===$J||x===LJ||x===UJ)return u(g,y,m);if(b){let _=b[x];if(!_){const O=mJ(g);O&&(_=b[O])}if(_)return _(g,y,m)}return!1}}function KJ({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:bJ,areArraysEqual:r?dl:wJ,areDataViewsEqual:_J,areDatesEqual:SJ,areErrorsEqual:OJ,areFunctionsEqual:jJ,areMapsEqual:r?Vm(eO,dl):eO,areNumbersEqual:AJ,areObjectsEqual:r?dl:EJ,arePrimitiveWrappersEqual:kJ,areRegExpsEqual:PJ,areSetsEqual:r?Vm(tO,dl):tO,areTypedArraysEqual:r?Vm(Nd,dl):Nd,areUrlsEqual:CJ,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=Qc(n.areArraysEqual),a=Qc(n.areMapsEqual),o=Qc(n.areObjectsEqual),s=Qc(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function qJ(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function XJ({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const YJ=sa();sa({strict:!0});sa({circular:!0});sa({circular:!0,strict:!0});sa({createInternalComparator:()=>Za});sa({strict:!0,createInternalComparator:()=>Za});sa({circular:!0,createInternalComparator:()=>Za});sa({circular:!0,createInternalComparator:()=>Za,strict:!0});function sa(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=KJ(e),o=GJ(a),s=r?r(o):qJ(o);return XJ({circular:t,comparator:o,createState:n,equals:s,strict:i})}function ZJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function rO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):ZJ(i)};requestAnimationFrame(n)}function cg(e){"@babel/helpers - typeof";return cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cg(e)}function QJ(e){return ree(e)||tee(e)||eee(e)||JJ()}function JJ(){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 eee(e,t){if(e){if(typeof e=="string")return nO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nO(e,t)}}function nO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:y<0?0:y},v=function(y){for(var m=y>1?1:y,w=m,S=0;S<8;++S){var x=c(w)-m,_=h(w);if(Math.abs(x-m)<$d||_<$d)return p(w);w=b(w-x/_)}return p(w)};return v.isStepper=!1,v},gee=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(f,c,p){var h=-(f-c)*n,b=p*a,v=p+(h-b)*s/1e3,g=p*s/1e3+f;return Math.abs(g-c)<$d&&Math.abs(v)<$d?[c,0]:[g,v]};return l.isStepper=!0,l.dt=s,l},xee=function(){for(var t=arguments.length,r=new Array(t),n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $ee(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Wm(e){return Dee(e)||Mee(e)||Iee(e)||Ree()}function Ree(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iee(e,t){if(e){if(typeof e=="string")return mg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mg(e,t)}}function Mee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dee(e){if(Array.isArray(e))return mg(e)}function mg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Id(e){return Id=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Id(e)}var ui=function(e){Uee(r,e);var t=Vee(r);function r(n,i){var a;Lee(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,c=o.steps,p=o.children,h=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(gg(a)),a.changeStyle=a.changeStyle.bind(gg(a)),!s||h<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:f}),yg(a);if(c&&c.length)a.state={style:c[0].style};else if(u){if(typeof p=="function")return a.state={style:u},yg(a);a.state={style:l?Sl({},l,u):u}}else a.state={style:{}};return a}return Fee(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,c=a.from,p=this.state.style;if(s){if(!o){var h={style:l?Sl({},l,f):f};this.state&&p&&(l&&p[l]!==f||!l&&p!==f)&&this.setState(h);return}if(!(YJ(i.to,f)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=b||u?c:i.to;if(this.state&&p){var g={style:l?Sl({},l,v):v};(l&&p[l]!==v||!l&&p!==v)&&this.setState(g)}this.runAnimation(an(an({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,f=i.begin,c=i.onAnimationEnd,p=i.onAnimationStart,h=Cee(o,s,xee(u),l,this.changeStyle),b=function(){a.stopJSAnimation=h()};this.manager.start([p,f,b,l,c])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,c=u.duration,p=c===void 0?0:c,h=function(v,g,y){if(y===0)return v;var m=g.duration,w=g.easing,S=w===void 0?"ease":w,x=g.style,_=g.properties,O=g.onAnimationEnd,A=y>0?o[y-1]:g,E=_||Object.keys(x);if(typeof S=="function"||S==="spring")return[].concat(Wm(v),[a.runJSAnimation.bind(a,{from:A.style,to:x,duration:m,easing:S}),m]);var $=oO(E,m,S),N=an(an(an({},A.style),x),{},{transition:$});return[].concat(Wm(v),[N,m,O]).filter(see)};return this.manager.start([l].concat(Wm(o.reduce(h,[f,Math.max(p,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=nee());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,c=i.onAnimationEnd,p=i.steps,h=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(i);return}if(p.length>1){this.runStepAnimation(i);return}var v=s?Sl({},s,l):l,g=oO(Object.keys(v),o,u);b.start([f,a,an(an({},v),{},{transition:g}),o,c])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Nee(i,Tee),u=j.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var c=function(h){var b=h.props,v=b.style,g=v===void 0?{}:v,y=b.className,m=j.cloneElement(h,an(an({},l),{},{style:an(an({},g),f),className:y}));return m};return u===1?c(j.Children.only(a)):T.createElement("div",null,j.Children.map(a,function(p){return c(p)}))}}]),r}(j.PureComponent);ui.displayName="Animate";ui.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ui.propTypes={from:Ue.oneOfType([Ue.object,Ue.string]),to:Ue.oneOfType([Ue.object,Ue.string]),attributeName:Ue.string,duration:Ue.number,begin:Ue.number,easing:Ue.oneOfType([Ue.string,Ue.func]),steps:Ue.arrayOf(Ue.shape({duration:Ue.number.isRequired,style:Ue.object.isRequired,easing:Ue.oneOfType([Ue.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ue.func]),properties:Ue.arrayOf("string"),onAnimationEnd:Ue.func})),children:Ue.oneOfType([Ue.node,Ue.func]),isActive:Ue.bool,canBegin:Ue.bool,onAnimationEnd:Ue.func,shouldReAnimate:Ue.bool,onAnimationStart:Ue.func,onAnimationReStart:Ue.func};function Bu(e){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function Md(){return Md=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var c=[0,0,0,0],p=0,h=4;po?o:a[p];f="M".concat(t,",").concat(r+s*c[0]),c[0]>0&&(f+="A ".concat(c[0],",").concat(c[0],",0,0,").concat(u,",").concat(t+l*c[0],",").concat(r)),f+="L ".concat(t+n-l*c[1],",").concat(r),c[1]>0&&(f+="A ".concat(c[1],",").concat(c[1],",0,0,").concat(u,`, - `).concat(t+n,",").concat(r+s*c[1])),f+="L ".concat(t+n,",").concat(r+i-s*c[2]),c[2]>0&&(f+="A ".concat(c[2],",").concat(c[2],",0,0,").concat(u,`, - `).concat(t+n-l*c[2],",").concat(r+i)),f+="L ".concat(t+l*c[3],",").concat(r+i),c[3]>0&&(f+="A ".concat(c[3],",").concat(c[3],",0,0,").concat(u,`, - `).concat(t,",").concat(r+i-s*c[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var b=Math.min(o,a);f="M ".concat(t,",").concat(r+s*b,` - A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+l*b,",").concat(r,` - L `).concat(t+n-l*b,",").concat(r,` - A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*b,` - L `).concat(t+n,",").concat(r+i-s*b,` - A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+n-l*b,",").concat(r+i,` - L `).concat(t+l*b,",").concat(r+i,` - A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*b," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},Jee=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),c=Math.min(o,o+l),p=Math.max(o,o+l);return n>=u&&n<=f&&i>=c&&i<=p}return!1},ete={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},eb=function(t){var r=hO(hO({},ete),t),n=j.useRef(),i=j.useState(-1),a=Hee(i,2),o=a[0],s=a[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,c=r.height,p=r.radius,h=r.className,b=r.animationEasing,v=r.animationDuration,g=r.animationBegin,y=r.isAnimationActive,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||c!==+c||f===0||c===0)return null;var w=Ee("recharts-rectangle",h);return m?T.createElement(ui,{canBegin:o>0,from:{width:f,height:c,x:l,y:u},to:{width:f,height:c,x:l,y:u},duration:v,animationEasing:b,isActive:m},function(S){var x=S.width,_=S.height,O=S.x,A=S.y;return T.createElement(ui,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:y,easing:b},T.createElement("path",Md({},ge(r,!0),{className:w,d:mO(O,A,x,_,p),ref:n})))}):T.createElement("path",Md({},ge(r,!0),{className:w,d:mO(l,u,f,c,p)}))},tte=["points","className","baseLinePoints","connectNulls"];function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vO(e){return ste(e)||ote(e)||ate(e)||ite()}function ite(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ate(e,t){if(e){if(typeof e=="string")return xg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xg(e,t)}}function ote(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ste(e){if(Array.isArray(e))return xg(e)}function xg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){yO(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),yO(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Ul=function(t,r){var n=lte(t);r&&(n=[n.reduce(function(a,o){return[].concat(vO(a),vO(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},ute=function(t,r,n){var i=Ul(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Ul(r.reverse(),n).slice(1))},cte=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=rte(t,tte);if(!r||!r.length)return null;var s=Ee("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=ute(r,i,a);return T.createElement("g",{className:s},T.createElement("path",So({},ge(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?T.createElement("path",So({},ge(o,!0),{fill:"none",d:Ul(r,a)})):null,l?T.createElement("path",So({},ge(o,!0),{fill:"none",d:Ul(i,a)})):null)}var f=Ul(r,a);return T.createElement("path",So({},ge(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function bg(){return bg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var gte=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},xte=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,c=f===void 0?0:f,p=t.height,h=p===void 0?0:p,b=t.className,v=vte(t,fte),g=dte({x:n,y:a,top:s,left:u,width:c,height:h},v);return!ie(n)||!ie(a)||!ie(c)||!ie(h)||!ie(s)||!ie(u)?null:T.createElement("path",wg({},ge(g,!0),{className:Ee("recharts-cross",b),d:gte(n,a,c,h,s,u)}))},bte=nh,wte=DP,_te=ia;function Ste(e,t){return e&&e.length?bte(e,_te(t),wte):void 0}var Ote=Ste;const jte=Ke(Ote);var Ate=nh,Ete=ia,kte=LP;function Pte(e,t){return e&&e.length?Ate(e,Ete(t),kte):void 0}var Cte=Pte;const Tte=Ke(Cte);var Nte=["cx","cy","angle","ticks","axisLine"],$te=["ticks","tick","angle","tickFormatter","stroke"];function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Rte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ite(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wO(e,t){for(var r=0;rOO?o=i==="outer"?"start":"end":a<-OO?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=fa(fa({},ge(this.props,!1)),{},{fill:"none"},ge(s,!1));if(l==="circle")return T.createElement(tb,ya({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,c=f.map(function(p){return it(i,a,o,p.coordinate)});return T.createElement(cte,ya({className:"recharts-polar-angle-axis-line"},u,{points:c}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=ge(this.props,!1),c=ge(o,!1),p=fa(fa({},f),{},{fill:"none"},ge(s,!1)),h=a.map(function(b,v){var g=n.getTickLineCoord(b),y=n.getTickTextAnchor(b),m=fa(fa(fa({textAnchor:y},f),{},{stroke:"none",fill:u},c),{},{index:v,payload:b,x:g.x2,y:g.y2});return T.createElement(He,ya({className:Ee("recharts-polar-angle-axis-tick",fC(o)),key:"tick-".concat(b.coordinate)},Ua(n.props,b,v)),s&&T.createElement("line",ya({className:"recharts-polar-angle-axis-tick-line"},p,g)),o&&t.renderTickItem(o,m,l?l(b.value,v):b.value))});return T.createElement(He,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:T.createElement(He,{className:Ee("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return T.isValidElement(n)?o=T.cloneElement(n,i):Oe(n)?o=n(i):o=T.createElement(Va,ya({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(j.PureComponent);dh(ph,"displayName","PolarAngleAxis");dh(ph,"axisType","angleAxis");dh(ph,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Yte=I2,Zte=Yte(Object.getPrototypeOf,Object),Qte=Zte,Jte=pi,ere=Qte,tre=hi,rre="[object Object]",nre=Function.prototype,ire=Object.prototype,PC=nre.toString,are=ire.hasOwnProperty,ore=PC.call(Object);function sre(e){if(!tre(e)||Jte(e)!=rre)return!1;var t=ere(e);if(t===null)return!0;var r=are.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&PC.call(r)==ore}var lre=sre;const ure=Ke(lre);var cre=pi,fre=hi,dre="[object Boolean]";function pre(e){return e===!0||e===!1||fre(e)&&cre(e)==dre}var hre=pre;const mre=Ke(hre);function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function Bd(){return Bd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:f,lowerWidth:c,height:p,x:l,y:u},duration:v,animationEasing:b,isActive:y},function(w){var S=w.upperWidth,x=w.lowerWidth,_=w.height,O=w.x,A=w.y;return T.createElement(ui,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:b},T.createElement("path",Bd({},ge(r,!0),{className:m,d:kO(O,A,S,x,_),ref:n})))}):T.createElement("g",null,T.createElement("path",Bd({},ge(r,!0),{className:m,d:kO(l,u,f,c,p)})))},Are=["option","shapeType","propTransformer","activeClassName","isActive"];function Uu(e){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function Ere(e,t){if(e==null)return{};var r=kre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function PO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fd(e){for(var t=1;t0?$r(w,"paddingAngle",0):0;if(x){var O=ji(x.endAngle-x.startAngle,w.endAngle-w.startAngle),A=tt(tt({},w),{},{startAngle:m+_,endAngle:m+O(v)+_});g.push(A),m=A.endAngle}else{var E=w.endAngle,$=w.startAngle,N=ji(0,E-$),P=N(v),I=tt(tt({},w),{},{startAngle:m+_,endAngle:m+P+_});g.push(I),m=I.endAngle}}),T.createElement(He,null,n.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!oh(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,f=i.cy,c=i.innerRadius,p=i.outerRadius,h=i.isAnimationActive,b=this.state.isAnimationFinished;if(a||!o||!o.length||!ie(u)||!ie(f)||!ie(c)||!ie(p))return null;var v=Ee("recharts-pie",s);return T.createElement(He,{tabIndex:this.props.rootTabIndex,className:v,ref:function(y){n.pieRef=y}},this.renderSectors(),l&&this.renderLabels(o),Lt.renderCallByParent(this.props,null,!1),(!h||b)&&Hi.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?m:m-1)*l,S=g-m*h-w,x=i.reduce(function(A,E){var $=rr(E,y,0);return A+(ie($)?$:0)},0),_;if(x>0){var O;_=i.map(function(A,E){var $=rr(A,y,0),N=rr(A,f,E),P=(ie($)?$:0)/x,I;E?I=O.endAngle+or(v)*l*($!==0?1:0):I=o;var D=I+or(v)*(($!==0?h:0)+P*S),B=(I+D)/2,V=(b.innerRadius+b.outerRadius)/2,U=[{name:N,value:$,payload:A,dataKey:y,type:p}],R=it(b.cx,b.cy,V,B);return O=tt(tt(tt({percent:P,cornerRadius:a,name:N,tooltipPayload:U,midAngle:B,middleRadius:V,tooltipPosition:R},A),b),{},{value:rr(A,y),startAngle:I,endAngle:D,payload:A,paddingAngle:or(v)*l}),O})}return tt(tt({},b),{},{sectors:_,data:i})});var Xre=Math.ceil,Yre=Math.max;function Zre(e,t,r,n){for(var i=-1,a=Yre(Xre((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var Qre=Zre,Jre=J2,$O=1/0,ene=17976931348623157e292;function tne(e){if(!e)return e===0?e:0;if(e=Jre(e),e===$O||e===-$O){var t=e<0?-1:1;return t*ene}return e===e?e:0}var rne=tne,nne=Qre,ine=Yp,Hm=rne;function ane(e){return function(t,r,n){return n&&typeof n!="number"&&ine(t,r,n)&&(r=n=void 0),t=Hm(t),r===void 0?(r=t,t=0):r=Hm(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),Ar(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),Ar(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ar(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ar(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ar(n,"handleSlideDragStart",function(i){var a=LO(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return xne(t,e),mne(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,c=Math.min(i,a),p=Math.max(i,a),h=t.getIndexInRange(o,c),b=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:b===f?f:b-b%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=rr(a[n],s,n);return Oe(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,f=l.width,c=l.travellerWidth,p=l.startIndex,h=l.endIndex,b=l.onChange,v=n.pageX-a;v>0?v=Math.min(v,u+f-c-s,u+f-c-o):v<0&&(v=Math.max(v,u-o,u-s));var g=this.getIndex({startX:o+v,endX:s+v});(g.startIndex!==p||g.endIndex!==h)&&b&&b(g),this.setState({startX:o+v,endX:s+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=LO(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],f=this.props,c=f.x,p=f.width,h=f.travellerWidth,b=f.onChange,v=f.gap,g=f.data,y={startX:this.state.startX,endX:this.state.endX},m=n.pageX-a;m>0?m=Math.min(m,c+p-h-u):m<0&&(m=Math.max(m,c-u)),y[o]=u+m;var w=this.getIndex(y),S=w.startIndex,x=w.endIndex,_=function(){var A=g.length-1;return o==="startX"&&(s>l?S%v===0:x%v===0)||sl?x%v===0:S%v===0)||s>l&&x===A};this.setState(Ar(Ar({},o,u+m),"brushMoveStartX",n.pageX),function(){b&&_()&&b(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],c=s.indexOf(f);if(c!==-1){var p=c+n;if(!(p===-1||p>=s.length)){var h=s[p];i==="startX"&&h>=u||i==="endX"&&h<=l||this.setState(Ar({},i,h),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return T.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,c=j.Children.only(u);return c?T.cloneElement(c,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,c=l.height,p=l.traveller,h=l.ariaLabel,b=l.data,v=l.startIndex,g=l.endIndex,y=Math.max(n,this.props.x),m=Gm(Gm({},ge(this.props,!1)),{},{x:y,y:u,width:f,height:c}),w=h||"Min value: ".concat((a=b[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=b[g])===null||o===void 0?void 0:o.name);return T.createElement(He,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(x){["ArrowLeft","ArrowRight"].includes(x.key)&&(x.preventDefault(),x.stopPropagation(),s.handleTravellerMoveKeyboard(x.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,m))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,c=Math.max(Math.abs(i-n)-u,0);return T.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:c,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,c=f.startX,p=f.endX,h=5,b={pointerEvents:"none",fill:u};return T.createElement(He,{className:"recharts-brush-texts"},T.createElement(Va,Vd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,p)-h,y:o+s/2},b),this.getTextOfTick(i)),T.createElement(Va,Vd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,p)+l+h,y:o+s/2},b),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,c=n.alwaysShowText,p=this.state,h=p.startX,b=p.endX,v=p.isTextActive,g=p.isSlideMoving,y=p.isTravellerMoving,m=p.isTravellerFocused;if(!i||!i.length||!ie(s)||!ie(l)||!ie(u)||!ie(f)||u<=0||f<=0)return null;var w=Ee("recharts-brush",a),S=T.Children.count(o)===1,x=pne("userSelect","none");return T.createElement(He,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:x},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,b),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(b,"endX"),(v||g||y||m||c)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return T.createElement(T.Fragment,null,T.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),T.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),T.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return T.isValidElement(n)?a=T.cloneElement(n,i):Oe(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,c=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Gm({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?wne({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:c}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var p=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(j.PureComponent);Ar(ps,"displayName","Brush");Ar(ps,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var _ne=Ax;function Sne(e,t){var r;return _ne(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var One=Sne,jne=E2,Ane=ia,Ene=One,kne=_r,Pne=Yp;function Cne(e,t,r){var n=kne(e)?jne:Ene;return r&&Pne(e,t,r)&&(t=void 0),n(e,Ane(t))}var Tne=Cne;const Nne=Ke(Tne);var $n=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},BO=q2;function $ne(e,t,r){t=="__proto__"&&BO?BO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Rne=$ne,Ine=Rne,Mne=G2,Dne=ia;function Lne(e,t){var r={};return t=Dne(t),Mne(e,function(n,i,a){Ine(r,i,t(n,i,a))}),r}var Bne=Lne;const Fne=Ke(Bne);function zne(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function aie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function oie(e,t){var r=e.x,n=e.y,i=iie(e,eie),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),c="".concat(t.width||i.width),p=parseInt(c,10);return pl(pl(pl(pl(pl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:p,name:t.name,radius:t.radius})}function zO(e){return T.createElement(CC,Ag({shapeType:"rectangle",propTransformer:oie,activeClassName:"recharts-active-bar"},e))}var sie=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=ie(n)||A6(n);return a?t(n,i):(a||Ha(),r)}},lie=["value","background"],MC;function hs(e){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(e)}function uie(e,t){if(e==null)return{};var r=cie(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hd(){return Hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(B)0&&Math.abs(D)0&&(I=Math.min((he||0)-(D[Ae-1]||0),I))}),Number.isFinite(I)){var B=I/P,V=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(O=B*V/2),v.padding==="no-gap"){var U=sr(t.barCategoryGap,B*V),R=B*V/2;O=R-U-(R-U)/V*U}}}i==="xAxis"?A=[n.left+(w.left||0)+(O||0),n.left+n.width-(w.right||0)-(O||0)]:i==="yAxis"?A=l==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(O||0),n.top+n.height-(w.bottom||0)-(O||0)]:A=v.range,x&&(A=[A[1],A[0]]);var F=iC(v,a,p),L=F.scale,q=F.realScaleType;L.domain(y).range(A),aC(L);var W=oC(L,un(un({},v),{},{realScaleType:q}));i==="xAxis"?(N=g==="top"&&!S||g==="bottom"&&S,E=n.left,$=c[_]-N*v.height):i==="yAxis"&&(N=g==="left"&&!S||g==="right"&&S,E=c[_]-N*v.width,$=n.top);var Y=un(un(un({},v),W),{},{realScaleType:q,x:E,y:$,scale:L,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return Y.bandSize=Pd(Y,W),!v.hide&&i==="xAxis"?c[_]+=(N?-1:1)*Y.height:v.hide||(c[_]+=(N?-1:1)*Y.width),un(un({},h),{},vh({},b,Y))},{})},FC=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},_ie=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return FC({x:r,y:n},{x:i,y:a})},zC=function(){function e(t){gie(this,e),this.scale=t}return xie(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();vh(zC,"EPS",1e-4);var rb=function(t){var r=Object.keys(t).reduce(function(n,i){return un(un({},n),{},vh({},i,zC.create(t[i])))},{});return un(un({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return Fne(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return Jne(i,function(a,o){return r[o].isInRange(a)})}})};function Sie(e){return(e%180+180)%180}var Oie=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Sie(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&oe.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function fae(e,t){return iT(e,t+1)}function dae(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,c=function(){var b=n==null?void 0:n[l];if(b===void 0)return{v:iT(n,u)};var v=l,g,y=function(){return g===void 0&&(g=r(b,v)),g},m=b.coordinate,w=l===0||Yd(e,m,y,f,s);w||(l=0,f=o,u+=1),w&&(f=m+e*(y()/2+i),l+=u)},p;u<=a.length;)if(p=c(),p)return p.v;return[]}function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function ej(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t0?h.coordinate-g*e:h.coordinate})}else a[p]=h=Jt(Jt({},h),{},{tickCoord:h.coordinate});var y=Yd(e,h.tickCoord,v,s,l);y&&(l=h.tickCoord-e*(v()/2+i),a[p]=Jt(Jt({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function yae(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],c=r(f,s-1),p=e*(f.coordinate+e*c/2-u);o[s-1]=f=Jt(Jt({},f),{},{tickCoord:p>0?f.coordinate-p*e:f.coordinate});var h=Yd(e,f.tickCoord,function(){return c},l,u);h&&(u=f.tickCoord-e*(c/2+i),o[s-1]=Jt(Jt({},f),{},{isShow:!0}))}for(var b=a?s-1:s,v=function(m){var w=o[m],S,x=function(){return S===void 0&&(S=r(w,m)),S};if(m===0){var _=e*(w.coordinate-e*x()/2-l);o[m]=w=Jt(Jt({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else o[m]=w=Jt(Jt({},w),{},{tickCoord:w.coordinate});var O=Yd(e,w.tickCoord,x,l,u);O&&(l=w.tickCoord+e*(x()/2+i),o[m]=Jt(Jt({},w),{},{isShow:!0}))},g=0;g=2?or(i[1].coordinate-i[0].coordinate):1,y=cae(a,g,h);return l==="equidistantPreserveStart"?dae(g,y,v,i,o):(l==="preserveStart"||l==="preserveStartEnd"?p=yae(g,y,v,i,o,l==="preserveStartEnd"):p=vae(g,y,v,i,o),p.filter(function(m){return m.isShow}))}var xae=["viewBox"],bae=["viewBox"],wae=["ticks"];function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _ae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Sae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rj(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!b||!b.length?null:T.createElement(He,{className:Ee("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},a&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Lt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=Ee(i.className,"recharts-cartesian-axis-tick-value");return T.isValidElement(n)?o=T.cloneElement(n,kt(kt({},i),{},{className:s})):Oe(n)?o=n(kt(kt({},i),{},{className:s})):o=T.createElement(Va,jo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(j.Component);ab(wh,"displayName","CartesianAxis");ab(wh,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function Cae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tae(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function goe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xoe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&ie(i)&&ie(a)?t.slice(i,a+1):[]};function bT(e){return e==="number"?[0,"auto"]:void 0}var Vg=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=_h(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,c=(f=u.props.data)!==null&&f!==void 0?f:r;c&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(c=c.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=c===void 0?s:c;p=yy(h,o.dataKey,i)}else p=c&&c[n]||s[n];return p?[].concat(_s(l),[lC(u,p)]):l},[])},lj=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=Toe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=BZ(o,s,u,l);if(f>=0&&u){var c=u[f]&&u[f].value,p=Vg(t,r,f,c),h=Noe(n,s,f,a);return{activeTooltipIndex:f,activeLabel:c,activePayload:p,activeCoordinate:h}}return null},$oe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,p=t.stackOffset,h=nC(f,a);return n.reduce(function(b,v){var g,y=v.type.defaultProps!==void 0?G(G({},v.type.defaultProps),v.props):v.props,m=y.type,w=y.dataKey,S=y.allowDataOverflow,x=y.allowDuplicatedCategory,_=y.scale,O=y.ticks,A=y.includeHidden,E=y[o];if(b[E])return b;var $=_h(t.data,{graphicalItems:i.filter(function(W){var Y,he=o in W.props?W.props[o]:(Y=W.type.defaultProps)===null||Y===void 0?void 0:Y[o];return he===E}),dataStartIndex:l,dataEndIndex:u}),N=$.length,P,I,D;aoe(y.domain,S,m)&&(P=ig(y.domain,null,S),h&&(m==="number"||_!=="auto")&&(D=Fl($,w,"category")));var B=bT(m);if(!P||P.length===0){var V,U=(V=y.domain)!==null&&V!==void 0?V:B;if(w){if(P=Fl($,w,m),m==="category"&&h){var R=k6(P);x&&R?(I=P,P=Ud(0,N)):x||(P=LS(U,P,v).reduce(function(W,Y){return W.indexOf(Y)>=0?W:[].concat(_s(W),[Y])},[]))}else if(m==="category")x?P=P.filter(function(W){return W!==""&&!Ce(W)}):P=LS(U,P,v).reduce(function(W,Y){return W.indexOf(Y)>=0||Y===""||Ce(Y)?W:[].concat(_s(W),[Y])},[]);else if(m==="number"){var F=WZ($,i.filter(function(W){var Y,he,Ae=o in W.props?W.props[o]:(Y=W.type.defaultProps)===null||Y===void 0?void 0:Y[o],xe="hide"in W.props?W.props.hide:(he=W.type.defaultProps)===null||he===void 0?void 0:he.hide;return Ae===E&&(A||!xe)}),w,a,f);F&&(P=F)}h&&(m==="number"||_!=="auto")&&(D=Fl($,w,"category"))}else h?P=Ud(0,N):s&&s[E]&&s[E].hasStack&&m==="number"?P=p==="expand"?[0,1]:sC(s[E].stackGroups,l,u):P=rC($,i.filter(function(W){var Y=o in W.props?W.props[o]:W.type.defaultProps[o],he="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return Y===E&&(A||!he)}),m,f,!0);if(m==="number")P=Fg(c,P,E,a,O),U&&(P=ig(U,P,S));else if(m==="category"&&U){var L=U,q=P.every(function(W){return L.indexOf(W)>=0});q&&(P=L)}}return G(G({},b),{},ye({},E,G(G({},y),{},{axisType:a,domain:P,categoricalDomain:D,duplicateDomain:I,originalDomain:(g=y.domain)!==null&&g!==void 0?g:B,isCategorical:h,layout:f})))},{})},Roe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,p=_h(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=p.length,b=nC(f,a),v=-1;return n.reduce(function(g,y){var m=y.type.defaultProps!==void 0?G(G({},y.type.defaultProps),y.props):y.props,w=m[o],S=bT("number");if(!g[w]){v++;var x;return b?x=Ud(0,h):s&&s[w]&&s[w].hasStack?(x=sC(s[w].stackGroups,l,u),x=Fg(c,x,w,a)):(x=ig(S,rC(p,n.filter(function(_){var O,A,E=o in _.props?_.props[o]:(O=_.type.defaultProps)===null||O===void 0?void 0:O[o],$="hide"in _.props?_.props.hide:(A=_.type.defaultProps)===null||A===void 0?void 0:A.hide;return E===w&&!$}),"number",f),i.defaultProps.allowDataOverflow),x=Fg(c,x,w,a)),G(G({},g),{},ye({},w,G(G({axisType:a},i.defaultProps),{},{hide:!0,orientation:$r(Poe,"".concat(a,".").concat(v%2),null),domain:x,originalDomain:S,isCategorical:b,layout:f})))}return g},{})},Ioe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,c="".concat(i,"Id"),p=Yr(f,a),h={};return p&&p.length?h=$oe(t,{axes:p,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=Roe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Moe=function(t){var r=oo(t),n=ja(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Ex(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Pd(r,n)}},uj=function(t){var r=t.children,n=t.defaultShowTooltip,i=kr(r,ps),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Doe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Zn(r&&r.type);return n&&n.indexOf("Bar")>=0})},cj=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Loe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,c=n.children,p=n.margin||{},h=kr(c,ps),b=kr(c,ka),v=Object.keys(l).reduce(function(x,_){var O=l[_],A=O.orientation;return!O.mirror&&!O.hide?G(G({},x),{},ye({},A,x[A]+O.width)):x},{left:p.left||0,right:p.right||0}),g=Object.keys(o).reduce(function(x,_){var O=o[_],A=O.orientation;return!O.mirror&&!O.hide?G(G({},x),{},ye({},A,$r(x,"".concat(A))+O.height)):x},{top:p.top||0,bottom:p.bottom||0}),y=G(G({},g),v),m=y.bottom;h&&(y.bottom+=h.props.height||ps.defaultProps.height),b&&r&&(y=UZ(y,i,n,r));var w=u-y.left-y.right,S=f-y.top-y.bottom;return G(G({brushBottom:m},y),{},{width:Math.max(w,0),height:Math.max(S,0)})},Boe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},wT=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,c=t.defaultProps,p=function(y,m){var w=m.graphicalItems,S=m.stackGroups,x=m.offset,_=m.updateId,O=m.dataStartIndex,A=m.dataEndIndex,E=y.barSize,$=y.layout,N=y.barGap,P=y.barCategoryGap,I=y.maxBarSize,D=cj($),B=D.numericAxisName,V=D.cateAxisName,U=Doe(w),R=[];return w.forEach(function(F,L){var q=_h(y.data,{graphicalItems:[F],dataStartIndex:O,dataEndIndex:A}),W=F.type.defaultProps!==void 0?G(G({},F.type.defaultProps),F.props):F.props,Y=W.dataKey,he=W.maxBarSize,Ae=W["".concat(B,"Id")],xe=W["".concat(V,"Id")],We={},Me=l.reduce(function(Ze,ze){var C=m["".concat(ze.axisType,"Map")],M=W["".concat(ze.axisType,"Id")];C&&C[M]||ze.axisType==="zAxis"||Ha();var z=C[M];return G(G({},Ze),{},ye(ye({},ze.axisType,z),"".concat(ze.axisType,"Ticks"),ja(z)))},We),Z=Me[V],ne=Me["".concat(V,"Ticks")],pe=S&&S[Ae]&&S[Ae].hasStack&&JZ(F,S[Ae].stackGroups),k=Zn(F.type).indexOf("Bar")>=0,H=Pd(Z,ne),K=[],me=U&&FZ({barSize:E,stackGroups:S,totalSize:Boe(Me,V)});if(k){var _e,de,fe=Ce(he)?I:he,je=(_e=(de=Pd(Z,ne,!0))!==null&&de!==void 0?de:fe)!==null&&_e!==void 0?_e:0;K=zZ({barGap:N,barCategoryGap:P,bandSize:je!==H?je:H,sizeList:me[xe],maxBarSize:fe}),je!==H&&(K=K.map(function(Ze){return G(G({},Ze),{},{position:G(G({},Ze.position),{},{offset:Ze.position.offset-je/2})})}))}var ke=F&&F.type&&F.type.getComposedData;ke&&R.push({props:G(G({},ke(G(G({},Me),{},{displayedData:q,props:y,dataKey:Y,item:F,bandSize:H,barPosition:K,offset:x,stackedData:pe,layout:$,dataStartIndex:O,dataEndIndex:A}))),{},ye(ye(ye({key:F.key||"item-".concat(L)},B,Me[B]),V,Me[V]),"animationId",_)),childIndex:F6(F,y.children),item:F})}),R},h=function(y,m){var w=y.props,S=y.dataStartIndex,x=y.dataEndIndex,_=y.updateId;if(!Nw({props:w}))return null;var O=w.children,A=w.layout,E=w.stackOffset,$=w.data,N=w.reverseStackOrder,P=cj(A),I=P.numericAxisName,D=P.cateAxisName,B=Yr(O,n),V=ZZ($,B,"".concat(I,"Id"),"".concat(D,"Id"),E,N),U=l.reduce(function(W,Y){var he="".concat(Y.axisType,"Map");return G(G({},W),{},ye({},he,Ioe(w,G(G({},Y),{},{graphicalItems:B,stackGroups:Y.axisType===I&&V,dataStartIndex:S,dataEndIndex:x}))))},{}),R=Loe(G(G({},U),{},{props:w,graphicalItems:B}),m==null?void 0:m.legendBBox);Object.keys(U).forEach(function(W){U[W]=f(w,U[W],R,W.replace("Map",""),r)});var F=U["".concat(D,"Map")],L=Moe(F),q=p(w,G(G({},U),{},{dataStartIndex:S,dataEndIndex:x,updateId:_,graphicalItems:B,stackGroups:V,offset:R}));return G(G({formattedGraphicalItems:q,graphicalItems:B,offset:R,stackGroups:V},L),U)},b=function(g){function y(m){var w,S,x;return goe(this,y),x=woe(this,y,[m]),ye(x,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ye(x,"accessibilityManager",new ioe),ye(x,"handleLegendBBoxUpdate",function(_){if(_){var O=x.state,A=O.dataStartIndex,E=O.dataEndIndex,$=O.updateId;x.setState(G({legendBBox:_},h({props:x.props,dataStartIndex:A,dataEndIndex:E,updateId:$},G(G({},x.state),{},{legendBBox:_}))))}}),ye(x,"handleReceiveSyncEvent",function(_,O,A){if(x.props.syncId===_){if(A===x.eventEmitterSymbol&&typeof x.props.syncMethod!="function")return;x.applySyncEvent(O)}}),ye(x,"handleBrushChange",function(_){var O=_.startIndex,A=_.endIndex;if(O!==x.state.dataStartIndex||A!==x.state.dataEndIndex){var E=x.state.updateId;x.setState(function(){return G({dataStartIndex:O,dataEndIndex:A},h({props:x.props,dataStartIndex:O,dataEndIndex:A,updateId:E},x.state))}),x.triggerSyncEvent({dataStartIndex:O,dataEndIndex:A})}}),ye(x,"handleMouseEnter",function(_){var O=x.getMouseInfo(_);if(O){var A=G(G({},O),{},{isTooltipActive:!0});x.setState(A),x.triggerSyncEvent(A);var E=x.props.onMouseEnter;Oe(E)&&E(A,_)}}),ye(x,"triggeredAfterMouseMove",function(_){var O=x.getMouseInfo(_),A=O?G(G({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};x.setState(A),x.triggerSyncEvent(A);var E=x.props.onMouseMove;Oe(E)&&E(A,_)}),ye(x,"handleItemMouseEnter",function(_){x.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),ye(x,"handleItemMouseLeave",function(){x.setState(function(){return{isTooltipActive:!1}})}),ye(x,"handleMouseMove",function(_){_.persist(),x.throttleTriggeredAfterMouseMove(_)}),ye(x,"handleMouseLeave",function(_){x.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};x.setState(O),x.triggerSyncEvent(O);var A=x.props.onMouseLeave;Oe(A)&&A(O,_)}),ye(x,"handleOuterEvent",function(_){var O=B6(_),A=$r(x.props,"".concat(O));if(O&&Oe(A)){var E,$;/.*touch.*/i.test(O)?$=x.getMouseInfo(_.changedTouches[0]):$=x.getMouseInfo(_),A((E=$)!==null&&E!==void 0?E:{},_)}}),ye(x,"handleClick",function(_){var O=x.getMouseInfo(_);if(O){var A=G(G({},O),{},{isTooltipActive:!0});x.setState(A),x.triggerSyncEvent(A);var E=x.props.onClick;Oe(E)&&E(A,_)}}),ye(x,"handleMouseDown",function(_){var O=x.props.onMouseDown;if(Oe(O)){var A=x.getMouseInfo(_);O(A,_)}}),ye(x,"handleMouseUp",function(_){var O=x.props.onMouseUp;if(Oe(O)){var A=x.getMouseInfo(_);O(A,_)}}),ye(x,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&x.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),ye(x,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&x.handleMouseDown(_.changedTouches[0])}),ye(x,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&x.handleMouseUp(_.changedTouches[0])}),ye(x,"handleDoubleClick",function(_){var O=x.props.onDoubleClick;if(Oe(O)){var A=x.getMouseInfo(_);O(A,_)}}),ye(x,"handleContextMenu",function(_){var O=x.props.onContextMenu;if(Oe(O)){var A=x.getMouseInfo(_);O(A,_)}}),ye(x,"triggerSyncEvent",function(_){x.props.syncId!==void 0&&qm.emit(Xm,x.props.syncId,_,x.eventEmitterSymbol)}),ye(x,"applySyncEvent",function(_){var O=x.props,A=O.layout,E=O.syncMethod,$=x.state.updateId,N=_.dataStartIndex,P=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)x.setState(G({dataStartIndex:N,dataEndIndex:P},h({props:x.props,dataStartIndex:N,dataEndIndex:P,updateId:$},x.state)));else if(_.activeTooltipIndex!==void 0){var I=_.chartX,D=_.chartY,B=_.activeTooltipIndex,V=x.state,U=V.offset,R=V.tooltipTicks;if(!U)return;if(typeof E=="function")B=E(R,_);else if(E==="value"){B=-1;for(var F=0;F=0){var pe,k;if(I.dataKey&&!I.allowDuplicatedCategory){var H=typeof I.dataKey=="function"?ne:"payload.".concat(I.dataKey.toString());pe=yy(F,H,B),k=L&&q&&yy(q,H,B)}else pe=F==null?void 0:F[D],k=L&&q&&q[D];if(xe||Ae){var K=_.props.activeIndex!==void 0?_.props.activeIndex:D;return[j.cloneElement(_,G(G(G({},E.props),Me),{},{activeIndex:K})),null,null]}if(!Ce(pe))return[Z].concat(_s(x.renderActivePoints({item:E,activePoint:pe,basePoint:k,childIndex:D,isRange:L})))}else{var me,_e=(me=x.getItemByXY(x.state.activeCoordinate))!==null&&me!==void 0?me:{graphicalItem:Z},de=_e.graphicalItem,fe=de.item,je=fe===void 0?_:fe,ke=de.childIndex,Ze=G(G(G({},E.props),Me),{},{activeIndex:ke});return[j.cloneElement(je,Ze),null,null]}return L?[Z,null,null]:[Z,null]}),ye(x,"renderCustomized",function(_,O,A){return j.cloneElement(_,G(G({key:"recharts-customized-".concat(A)},x.props),x.state))}),ye(x,"renderMap",{CartesianGrid:{handler:ef,once:!0},ReferenceArea:{handler:x.renderReferenceElement},ReferenceLine:{handler:ef},ReferenceDot:{handler:x.renderReferenceElement},XAxis:{handler:ef},YAxis:{handler:ef},Brush:{handler:x.renderBrush,once:!0},Bar:{handler:x.renderGraphicChild},Line:{handler:x.renderGraphicChild},Area:{handler:x.renderGraphicChild},Radar:{handler:x.renderGraphicChild},RadialBar:{handler:x.renderGraphicChild},Scatter:{handler:x.renderGraphicChild},Pie:{handler:x.renderGraphicChild},Funnel:{handler:x.renderGraphicChild},Tooltip:{handler:x.renderCursor,once:!0},PolarGrid:{handler:x.renderPolarGrid,once:!0},PolarAngleAxis:{handler:x.renderPolarAxis},PolarRadiusAxis:{handler:x.renderPolarAxis},Customized:{handler:x.renderCustomized}}),x.clipPathId="".concat((w=m.id)!==null&&w!==void 0?w:cc("recharts"),"-clip"),x.throttleTriggeredAfterMouseMove=eP(x.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),x.state={},x}return Ooe(y,g),boe(y,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,x=w.data,_=w.height,O=w.layout,A=kr(S,Pr);if(A){var E=A.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,N=Vg(this.state,x,E,$),P=this.state.tooltipTicks[E].coordinate,I=(this.state.offset.top+_)/2,D=O==="horizontal",B=D?{x:P,y:I}:{y:P,x:I},V=this.state.formattedGraphicalItems.find(function(R){var F=R.item;return F.type.name==="Scatter"});V&&(B=G(G({},B),V.props.points[E].tooltipPosition),N=V.props.points[E].tooltipPayload);var U={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:$,activePayload:N,activeCoordinate:B};this.setState(U),this.renderCursor(A),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var x,_;this.accessibilityManager.setDetails({offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){xy([kr(w.children,Pr)],[kr(this.props.children,Pr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=kr(this.props.children,Pr);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,x=S.getBoundingClientRect(),_=pK(x),O={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},A=x.width/S.offsetWidth||1,E=this.inRange(O.chartX,O.chartY,A);if(!E)return null;var $=this.state,N=$.xAxisMap,P=$.yAxisMap,I=this.getTooltipEventType(),D=lj(this.state,this.props.data,this.props.layout,E);if(I!=="axis"&&N&&P){var B=oo(N).scale,V=oo(P).scale,U=B&&B.invert?B.invert(O.chartX):null,R=V&&V.invert?V.invert(O.chartY):null;return G(G({},O),{},{xValue:U,yValue:R},D)}return D?G(G({},O),D):null}},{key:"inRange",value:function(w,S){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,O=w/x,A=S/x;if(_==="horizontal"||_==="vertical"){var E=this.state.offset,$=O>=E.left&&O<=E.left+E.width&&A>=E.top&&A<=E.top+E.height;return $?{x:O,y:A}:null}var N=this.state,P=N.angleAxisMap,I=N.radiusAxisMap;if(P&&I){var D=oo(P);return zS({x:O,y:A},D)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),x=kr(w,Pr),_={};x&&S==="axis"&&(x.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=td(this.props,this.handleOuterEvent);return G(G({},O),_)}},{key:"addListener",value:function(){qm.on(Xm,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){qm.removeListener(Xm,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,x){for(var _=this.state.formattedGraphicalItems,O=0,A=_.length;Oft(`/routing/list/active/${e}`)),n=t==null?void 0:t.find(N=>{var P;return((P=N.algorithm_data||N.algorithm)==null?void 0:P.type)==="volume_split"}),[i,a]=j.useState([{id:hl(),name:"",split:50},{id:hl(),name:"",split:50}]),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,c]=j.useState(null),[p,h]=j.useState(null),[b,v]=j.useState(!1),[g,y]=j.useState(new Set),m=i.reduce((N,P)=>N+P.split,0);function w(N,P,I){a(D=>D.map(B=>B.id===N?{...B,[P]:I}:B))}function S(){a(N=>[...N,{id:hl(),name:"",split:0}])}function x(N){a(P=>P.filter(I=>I.id!==N))}async function _(){if(!e)return c("Set a merchant ID first");if(!o.trim())return c("Enter a rule name");if(m!==100)return c(`Splits must sum to 100 (currently ${m})`);if(i.some(N=>!N.name.trim()))return c("All gateways must have names");u(!0),c(null),h(null);try{await ft("/routing/create",{rule_id:null,name:o,description:"",created_by:e,algorithm_for:"payment",metadata:null,algorithm:{type:"volume_split",data:i.map(N=>({split:N.split,output:{gateway_name:N.name.trim(),gateway_id:null}}))}}),h(`Rule "${o}" created successfully. Find it in the list below to activate.`),r(),s(""),a([{id:hl(),name:"",split:50},{id:hl(),name:"",split:50}])}catch(N){c(N instanceof Error?N.message:"Failed to create rule")}finally{u(!1)}}async function O(N){if(e)try{await ft("/routing/activate",{created_by:e,routing_algorithm_id:N}),r(),h("Rule activated.")}catch(P){c(P instanceof Error?P.message:"Failed to activate")}}function A(N){y(P=>{const I=new Set(P);return I.has(N)?I.delete(N):I.add(N),I})}const E=n?n.algorithm_data||n.algorithm:null,$=E&&"data"in E?E.data.map(N=>{var P;return{name:((P=N.output)==null?void 0:P.gateway_name)??"?",value:N.split}}):[];return d.jsxs("div",{className:"space-y-6 max-w-4xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Volume Split Routing"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Distribute payment traffic across gateways by percentage."})]}),n&&d.jsxs(Te,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Volume Split"}),d.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n.name})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Qt,{variant:"green",children:"Active"}),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:()=>v(!b),children:[d.jsx(wp,{size:14,className:"mr-1"}),b?"Hide":"View"]})]})]}),b&&d.jsxs(Ne,{children:[d.jsx(mf,{width:"100%",height:220,children:d.jsxs(_T,{children:[d.jsx(Dn,{data:$,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:N,value:P})=>`${N}: ${P}%`,labelLine:{stroke:"#45454f"},children:$.map((N,P)=>d.jsx(Pa,{fill:dj[P%dj.length]},P))}),d.jsx(Pr,{formatter:N=>`${N}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),d.jsx(ka,{wrapperStyle:{color:"#8e8ea0"}})]})}),d.jsxs("div",{className:"mt-4 text-xs text-slate-600",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"Rule ID:"})," ",n.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",n.created_at?new Date(n.created_at).toLocaleString():"Unknown"]})]})]})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"Create Volume Split Rule"})}),d.jsxs(Ne,{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Rule Name"}),d.jsx("input",{value:o,onChange:N=>s(N.target.value),placeholder:"e.g. ab-test-split",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 text-xs font-medium text-slate-500 px-1",children:[d.jsx("span",{children:"Gateway Name"}),d.jsx("span",{children:"Split %"}),d.jsx("span",{})]}),i.map(N=>d.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 items-center",children:[d.jsx("input",{value:N.name,onChange:P=>w(N.id,"name",P.target.value),placeholder:"e.g. stripe",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{type:"number",min:0,max:100,value:N.split,onChange:P=>w(N.id,"split",Number(P.target.value)),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>x(N.id),className:"text-slate-400 hover:text-red-500",children:d.jsx(ii,{size:15})})]},N.id)),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-sm text-brand-500 hover:text-brand-600",children:[d.jsx(qi,{size:14})," Add Gateway"]}),d.jsxs("span",{className:`text-xs font-medium ${m===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",m,"%",m!==100&&" (must be 100)"]})]})]}),d.jsx(Qo,{error:f}),p&&d.jsx("p",{className:"text-sm text-emerald-400",children:p}),d.jsx(ht,{onClick:_,disabled:l||!e,children:l?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Creating…"]}):"Create Rule"})]})]}),d.jsx(zoe,{merchantId:e,onActivate:O,expandedRuleIds:g,onToggleExpand:A})]})}function zoe({merchantId:e,onActivate:t,expandedRuleIds:r,onToggleExpand:n}){const{data:i,isLoading:a}=vn(e?["routing-list",e]:null,()=>ft(`/routing/list/${e}`)),o=(i==null?void 0:i.filter(s=>{var l;return((l=s.algorithm_data||s.algorithm)==null?void 0:l.type)==="volume_split"}))??[];return e?a?d.jsx("div",{className:"flex justify-center py-4",children:d.jsx(En,{})}):o.length?d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"Saved Volume Split Rules"})}),d.jsx(Ne,{className:"p-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 uppercase tracking-wider",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2",children:"Name"}),d.jsx("th",{className:"text-left px-4 py-2",children:"Split"}),d.jsx("th",{className:"px-4 py-2"})]})}),d.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:o.map(s=>{const l=s.algorithm_data||s.algorithm,u=(l==null?void 0:l.data)||[],f=r.has(s.id);return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[d.jsx("td",{className:"px-4 py-2 font-medium text-slate-800",children:s.name}),d.jsx("td",{className:"px-4 py-2 text-slate-600 text-xs",children:u.map(c=>{var p;return`${(p=c.output)==null?void 0:p.gateway_name}:${c.split}%`}).join(" | ")}),d.jsx("td",{className:"px-4 py-2 text-right",children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsxs(ht,{size:"sm",variant:"ghost",onClick:()=>n(s.id),children:[d.jsx(wp,{size:14,className:"mr-1"}),f?"Hide":"View"]}),d.jsx(ht,{size:"sm",variant:"secondary",onClick:()=>t(s.id),children:"Activate"})]})})]},s.id),f&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"ID:"})," ",s.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Description:"})," ",s.description||"N/A"]}),s.created_at&&d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",new Date(s.created_at).toLocaleString()]}),d.jsxs("div",{children:[d.jsx("strong",{children:"Configuration:"}),d.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(l,null,2)})]})]})})})]})})})]})})]}):null:null}function Uoe(){var m;const{merchantId:e}=ra(),{data:t,mutate:r,isLoading:n}=vn(e?["rule-debit",e]:null,()=>ft("/rule/get",{merchant_id:e,config:{type:"debitRouting"}})),[i,a]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,c]=j.useState(null),[p,h]=j.useState(null),b=(m=t==null?void 0:t.config)==null?void 0:m.data,v=i||(b==null?void 0:b.merchant_category_code)||"",g=o||(b==null?void 0:b.acquirer_country)||"";async function y(){if(!e)return c("Set a merchant ID first");const w={merchant_id:e,config:{type:"debitRouting",data:{merchant_category_code:v.trim(),acquirer_country:g.trim()}}};u(!0),c(null);try{await ft(t?"/rule/update":"/rule/create",w),h("Debit routing config saved."),r()}catch(S){c(S instanceof Error?S.message:"Failed to save")}finally{u(!1)}}return d.jsxs("div",{className:"space-y-6 max-w-2xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Network / Debit Routing"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Configure network-based routing to optimise processing fees for debit card transactions. The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR)."})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(IE,{size:16,className:"text-brand-500"}),d.jsx("h2",{className:"font-medium text-slate-800",children:"Debit Routing Configuration"})]})}),d.jsx(Ne,{className:"space-y-4",children:n?d.jsx("div",{className:"flex justify-center py-6",children:d.jsx(En,{})}):d.jsxs(d.Fragment,{children:[!e&&d.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar to load configuration."}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Merchant Category Code (MCC)"}),d.jsx("input",{value:v,onChange:w=>a(w.target.value),placeholder:"e.g. 5411",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"4-digit ISO MCC for your business type"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Acquirer Country"}),d.jsx("input",{value:g,onChange:w=>s(w.target.value),placeholder:"e.g. US",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"ISO 3166-1 alpha-2 country code"})]})]}),d.jsx(Qo,{error:f}),p&&d.jsx("p",{className:"text-sm text-emerald-400",children:p}),d.jsx(ht,{onClick:y,disabled:l||!e,children:l?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Saving…"]}):t?"Update Config":"Save Config"})]})})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"How Network Routing Works"})}),d.jsxs(Ne,{className:"text-sm text-slate-600 space-y-2",children:[d.jsx("p",{children:"For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee."}),d.jsxs("p",{children:["Supported networks: ",["VISA","MASTERCARD","ACCEL","NYCE","PULSE","STAR"].map(w=>d.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md mr-1 text-slate-700",children:w},w))]}),d.jsxs("p",{children:["Use the ",d.jsx("strong",{className:"text-slate-800",children:"Decision Explorer"})," to test network routing decisions with ",d.jsx("code",{className:"text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md text-brand-500",children:"NtwBasedRouting"})," algorithm."]})]})]})]})}const Voe=["CARD","UPI","WALLET","NETBANKING","interac"],Woe=["CREDIT","DEBIT","PREPAID"],Hoe=["USD","EUR","GBP","INR","SGD","AUD","CAD"],Goe=["VISA","MASTERCARD","AMEX","RUPAY","DINERS"],Koe=["THREE_DS","NO_THREE_DS"],qoe=["SR_BASED_ROUTING","PL_BASED_ROUTING","NTW_BASED_ROUTING"],Xoe={SR_BASED_ROUTING:"Success Rate Based",PL_BASED_ROUTING:"Priority List Based",NTW_BASED_ROUTING:"Network Based"};function Yoe(e){for(const[t,r]of Object.entries(XD))if(e.includes(t)||t.includes(e))return r;return"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8"}const dr=["#0069ED","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function Zoe(){const{merchantId:e}=ra(),[t,r]=j.useState("single"),[n,i]=j.useState({amount:"1000",currency:"USD",payment_method_type:"CARD",payment_method:"CREDIT",card_brand:"VISA",auth_type:"THREE_DS",eligible_gateways:"stripe, adyen",ranking_algorithm:"SR_BASED_ROUTING",elimination_enabled:!1}),[a,o]=j.useState({totalPayments:"10",successCount:"7",failureCount:"3"}),[s,l]=j.useState([{key:"payment_method_type",type:"enum_variant",value:"credit",metadataKey:""},{key:"currency",type:"enum_variant",value:"USD",metadataKey:""}]),[u,f]=j.useState([{gateway_name:"stripe",gateway_id:"mca_001"},{gateway_name:"adyen",gateway_id:"mca_002"}]),[c,p]=j.useState("100"),[h,b]=j.useState(null),[v,g]=j.useState(null),[y,m]=j.useState([]),[w,S]=j.useState([]),[x,_]=j.useState(!1),[O,A]=j.useState(null),[E,$]=j.useState(!1),[N,P]=j.useState(!1),[I,D]=j.useState(!1),[B,V]=j.useState(!1);function U(k,H){i(K=>({...K,[k]:H}))}function R(){l([...s,{key:"",type:"enum_variant",value:"",metadataKey:""}])}function F(k){l(s.filter((H,K)=>K!==k))}function L(k,H,K){l(s.map((me,_e)=>_e===k?{...me,[H]:K}:me))}function q(k,H){l(s.map((K,me)=>me===k?{...K,metadataKey:H}:K))}function W(){f([...u,{gateway_name:"",gateway_id:""}])}function Y(k){f(u.filter((H,K)=>K!==k))}function he(k,H,K){f(u.map((me,_e)=>_e===k?{...me,[H]:K}:me))}async function Ae(){if(!e)return A("Set a merchant ID in the top bar");$(!0),A(null);const k=n.eligible_gateways.split(",").map(H=>H.trim()).filter(Boolean);try{const H=await ft("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:`explorer_${Date.now()}`,amount:parseFloat(n.amount)||1e3,currency:n.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:n.payment_method_type,paymentMethod:n.payment_method,authType:n.auth_type,cardBrand:n.card_brand},eligibleGatewayList:k,rankingAlgorithm:n.ranking_algorithm,eliminationEnabled:n.elimination_enabled});b(H)}catch(H){A(H instanceof Error?H.message:"Request failed")}finally{$(!1)}}async function xe(){if(!e)return A("Set a merchant ID in the top bar");const k=parseInt(a.totalPayments)||0,H=parseInt(a.successCount)||0,K=parseInt(a.failureCount)||0;if(k<=0)return A("Total Payments must be greater than 0");if(H+K!==k)return A("Success + Failure count must equal Total Payments");_(!0),A(null),S([]);const me=n.eligible_gateways.split(",").map(fe=>fe.trim()).filter(Boolean),_e=[],de=[...Array(H).fill("CHARGED"),...Array(K).fill("FAILURE")];for(let fe=de.length-1;fe>0;fe--){const je=Math.floor(Math.random()*(fe+1));[de[fe],de[je]]=[de[je],de[fe]]}try{for(let fe=0;fe{K.key&&(K.type==="metadata_variant"?k[K.key]={type:K.type,value:{key:K.metadataKey||K.key,value:K.value}}:K.type==="number"?k[K.key]={type:K.type,value:parseFloat(K.value)||0}:k[K.key]={type:K.type,value:K.value})});const H=await ft("/routing/evaluate",{created_by:e||"test_user",fallback_output:u.filter(K=>K.gateway_name),parameters:k});if(g(H),H.output.type==="volume_split"&&H.output.splits){const K=parseInt(c)||100,me=H.output.splits.map(_e=>({name:_e.connector.gateway_name,count:Math.round(_e.split/100*K),percentage:_e.split}));m(me)}}catch(k){A(k instanceof Error?k.message:"Request failed")}finally{$(!1)}}async function Me(){$(!0),A(null),m([]);try{const k=await ft("/routing/evaluate",{created_by:e||"test_user",fallback_output:[{gateway_name:"stripe",gateway_id:"mca_001"},{gateway_name:"adyen",gateway_id:"mca_002"}],parameters:{}});if(g(k),k.output.type==="volume_split"&&k.output.splits){const H=parseInt(c)||100,K=k.output.splits.map(me=>({name:me.connector.gateway_name,count:Math.round(me.split/100*H),percentage:me.split}));m(K)}}catch(k){A(k instanceof Error?k.message:"Request failed")}finally{$(!1)}}const Z=h!=null&&h.gateway_priority_map?Object.entries(h.gateway_priority_map).sort(([,k],[,H])=>H-k).map(([k,H])=>({name:k,score:Math.round(H*1e3)/10})):[],ne=w.reduce((k,H)=>(k[H.decidedGateway]||(k[H.decidedGateway]={total:0,success:0,failure:0}),k[H.decidedGateway].total++,H.status==="CHARGED"?k[H.decidedGateway].success++:k[H.decidedGateway].failure++,k),{}),pe=y.map(k=>({name:k.name,value:k.count}));return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Decision Explorer"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split."})]}),d.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-[#1c1c24]",children:[d.jsx("button",{onClick:()=>r("single"),className:`px-4 py-2 text-sm font-medium ${t==="single"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Single Test"}),d.jsx("button",{onClick:()=>r("batch"),className:`px-4 py-2 text-sm font-medium ${t==="batch"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Batch Simulation"}),d.jsx("button",{onClick:()=>r("rule"),className:`px-4 py-2 text-sm font-medium ${t==="rule"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Rule-Based"}),d.jsx("button",{onClick:()=>r("volume"),className:`px-4 py-2 text-sm font-medium ${t==="volume"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Volume Split"})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:t==="rule"?"Rule Evaluation Parameters":t==="volume"?"Volume Split Configuration":"Payment Parameters"})}),d.jsxs(Ne,{className:"space-y-3",children:[!e&&t!=="volume"&&d.jsx("p",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar first."}),t==="rule"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Parameters"}),d.jsx("div",{className:"space-y-2",children:s.map((k,H)=>d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("input",{placeholder:"Key (e.g. payment_method_type)",value:k.key,onChange:K=>L(H,"key",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs("select",{value:k.type,onChange:K=>L(H,"type",K.target.value),className:"w-36 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:[d.jsx("option",{value:"enum_variant",children:"enum_variant"}),d.jsx("option",{value:"str_value",children:"str_value"}),d.jsx("option",{value:"number",children:"number"}),d.jsx("option",{value:"metadata_variant",children:"metadata_variant"})]}),d.jsx("button",{onClick:()=>F(H),className:"p-1.5 text-slate-400 hover:text-red-500",children:d.jsx(ii,{size:14})})]}),k.type==="metadata_variant"?d.jsxs("div",{className:"flex gap-2 items-center pl-1",children:[d.jsx("input",{placeholder:"Metadata Key",value:k.metadataKey||"",onChange:K=>q(H,K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{placeholder:"Metadata Value",value:k.value,onChange:K=>L(H,"value",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}):d.jsx("div",{className:"flex gap-2 items-center pl-1",children:d.jsx("input",{placeholder:"Value",value:k.value,onChange:K=>L(H,"value",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})})]},H))}),d.jsxs("button",{onClick:R,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[d.jsx(qi,{size:12})," Add Parameter"]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Fallback Connectors"}),d.jsx("div",{className:"space-y-2",children:u.map((k,H)=>d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("input",{placeholder:"Gateway Name",value:k.gateway_name,onChange:K=>he(H,"gateway_name",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{placeholder:"Gateway ID",value:k.gateway_id||"",onChange:K=>he(H,"gateway_id",K.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>Y(H),className:"p-1.5 text-slate-400 hover:text-red-500",children:d.jsx(ii,{size:14})})]},H))}),d.jsxs("button",{onClick:W,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[d.jsx(qi,{size:12})," Add Connector"]})]})]}):t==="volume"?d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Number of Payments"}),d.jsx("input",{type:"text",value:c,onChange:k=>p(k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Enter the total number of payments to visualize how they would be distributed across connectors."})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Amount"}),d.jsx("input",{value:n.amount,onChange:k=>U("amount",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Currency"}),d.jsx("select",{value:n.currency,onChange:k=>U("currency",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Hoe.map(k=>d.jsx("option",{children:k},k))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method Type"}),d.jsx("select",{value:n.payment_method_type,onChange:k=>U("payment_method_type",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Voe.map(k=>d.jsx("option",{children:k},k))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method"}),d.jsx("select",{value:n.payment_method,onChange:k=>U("payment_method",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Woe.map(k=>d.jsx("option",{children:k},k))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Card Brand"}),d.jsx("select",{value:n.card_brand,onChange:k=>U("card_brand",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Goe.map(k=>d.jsx("option",{children:k},k))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Auth Type"}),d.jsx("select",{value:n.auth_type,onChange:k=>U("auth_type",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Koe.map(k=>d.jsx("option",{children:k},k))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Eligible Gateways (comma-separated)"}),d.jsx("input",{value:n.eligible_gateways,onChange:k=>U("eligible_gateways",k.target.value),placeholder:"stripe, adyen",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Algorithm"}),d.jsx("select",{value:n.ranking_algorithm,onChange:k=>U("ranking_algorithm",k.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:qoe.map(k=>d.jsx("option",{value:k,children:Xoe[k]},k))})]}),d.jsx("div",{className:"flex items-end pb-1",children:d.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:n.elimination_enabled,onChange:k=>U("elimination_enabled",k.target.checked),className:"rounded"}),"Elimination enabled"]})})]}),t==="batch"&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-4 mt-4 space-y-3",children:[d.jsxs("h3",{className:"text-sm font-medium text-slate-800 flex items-center gap-2",children:[d.jsx(Qh,{size:14}),"Simulation Configuration"]}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Total Payments"}),d.jsx("input",{type:"text",value:a.totalPayments,onChange:k=>o(H=>({...H,totalPayments:k.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Success Count"}),d.jsx("input",{type:"text",value:a.successCount,onChange:k=>o(H=>({...H,successCount:k.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Failure Count"}),d.jsx("input",{type:"text",value:a.failureCount,onChange:k=>o(H=>({...H,failureCount:k.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),d.jsxs("p",{className:"text-xs text-slate-500",children:["Will run ",a.totalPayments||0," payments: ",a.successCount||0," SUCCESS, ",a.failureCount||0," FAILURE"]})]})]}),d.jsx(Qo,{error:O}),t==="rule"?d.jsx(ht,{onClick:We,disabled:E,className:"w-full justify-center",children:E?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Evaluating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Mc,{size:14})," Evaluate Rules"]})}):t==="volume"?d.jsx(ht,{onClick:Me,disabled:E,className:"w-full justify-center",children:E?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Calculating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Vf,{size:14})," Visualize Distribution"]})}):t==="batch"?d.jsx(ht,{onClick:xe,disabled:x||!e,className:"w-full justify-center",children:x?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14}),"Simulating ",w.length,"/",a.totalPayments||0,"..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Qh,{size:14})," Run Batch Simulation"]})}):d.jsx(ht,{onClick:Ae,disabled:E||!e,className:"w-full justify-center",children:E?d.jsxs(d.Fragment,{children:[d.jsx(En,{size:14})," Running…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Mc,{size:14})," Run Decision"]})})]})]}),d.jsx("div",{className:"space-y-4",children:t==="volume"?y.length>0?d.jsxs(d.Fragment,{children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Volume Distribution Overview"})}),d.jsxs(Ne,{children:[d.jsxs("div",{className:"text-center mb-4",children:[d.jsx("p",{className:"text-3xl font-bold text-slate-900",children:c}),d.jsx("p",{className:"text-xs text-slate-500",children:"Total Payments"})]}),d.jsx("div",{className:"grid grid-cols-2 gap-4",children:y.map((k,H)=>d.jsxs("div",{className:"bg-slate-50 dark:bg-[#111114] rounded-lg p-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:dr[H%dr.length]}}),d.jsx("span",{className:"font-medium text-sm",children:k.name})]}),d.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[d.jsxs("span",{children:[k.percentage,"%"]}),d.jsxs("span",{className:"font-medium text-slate-700",children:[k.count," payments"]})]})]},H))})]})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Pie Chart"})}),d.jsx(Ne,{children:d.jsx(mf,{width:"100%",height:250,children:d.jsxs(_T,{children:[d.jsx(Dn,{data:pe,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:k,percent:H})=>`${k} ${(H*100).toFixed(0)}%`,labelLine:!1,children:pe.map((k,H)=>d.jsx(Pa,{fill:dr[H%dr.length]},`cell-${H}`))}),d.jsx(Pr,{formatter:k=>[`${k} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}})]})})})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Bar Chart"})}),d.jsx(Ne,{children:d.jsx(mf,{width:"100%",height:y.length*50+40,children:d.jsxs(fj,{data:y,layout:"vertical",margin:{left:20,right:40},children:[d.jsx(qu,{type:"number",tick:{fontSize:12,fill:"#666"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),d.jsx(Xu,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#666"},width:80,axisLine:!1,tickLine:!1}),d.jsx(Pr,{formatter:k=>[`${k} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}}),d.jsx(Qi,{dataKey:"count",radius:[0,6,6,0],children:y.map((k,H)=>d.jsx(Pa,{fill:dr[H%dr.length]},`cell-${H}`))})]})})})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Percentage Distribution"})}),d.jsxs(Ne,{children:[d.jsx("div",{className:"h-4 rounded-full overflow-hidden flex",children:y.map((k,H)=>d.jsx("div",{style:{width:`${k.percentage}%`,backgroundColor:dr[H%dr.length]},className:"h-full transition-all duration-300",title:`${k.name}: ${k.percentage}%`},H))}),d.jsx("div",{className:"flex flex-wrap gap-3 mt-3",children:y.map((k,H)=>d.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[d.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:dr[H%dr.length]}}),d.jsx("span",{className:"text-slate-600",children:k.name}),d.jsxs("span",{className:"font-medium",children:[k.percentage,"%"]})]},H))})]})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Connector Summary"})}),d.jsx(Ne,{className:"p-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2",children:"Connector"}),d.jsx("th",{className:"text-right px-4 py-2",children:"Payments"}),d.jsx("th",{className:"text-right px-4 py-2",children:"Percentage"})]})}),d.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:[y.map((k,H)=>d.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[d.jsx("td",{className:"px-4 py-2",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:dr[H%dr.length]}}),d.jsx("span",{className:"font-medium",children:k.name})]})}),d.jsx("td",{className:"px-4 py-2 text-right font-medium",children:k.count}),d.jsxs("td",{className:"px-4 py-2 text-right text-slate-500",children:[k.percentage,"%"]})]},H)),d.jsxs("tr",{className:"bg-slate-50 dark:bg-[#111114] font-medium",children:[d.jsx("td",{className:"px-4 py-2",children:"Total"}),d.jsx("td",{className:"px-4 py-2 text-right",children:c}),d.jsx("td",{className:"px-4 py-2 text-right",children:"100%"})]})]})]})})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Payment Log"})}),d.jsx(Ne,{className:"p-0 max-h-80 overflow-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500 sticky top-0",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2 w-20",children:"#"}),d.jsx("th",{className:"text-left px-4 py-2",children:"Connector"})]})}),d.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:Array.from({length:parseInt(c)||0}).map((k,H)=>{var de;let K=0,me=((de=y[0])==null?void 0:de.name)||"",_e=0;for(let fe=0;feV(k=>!k),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(Jh,{size:14}),"API Response"]}),B?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),B&&v&&d.jsx(Ne,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(v,null,2)})})]})]}):d.jsx(Te,{children:d.jsxs(Ne,{className:"py-16 text-center",children:[d.jsx(Vf,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Enter the number of payments and click "Visualize Distribution" to see how payments are split across connectors.'})]})}):t==="rule"?v?d.jsxs(d.Fragment,{children:[d.jsx(Te,{children:d.jsxs(Ne,{children:[d.jsx("div",{className:"flex items-start justify-between mb-3",children:d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Output Type"}),d.jsx("p",{className:"text-2xl font-bold text-slate-900",children:v.output.type})]})}),v.output.type==="single"&&v.output.connector&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Selected Gateway"}),d.jsx("p",{className:"text-lg font-semibold",children:v.output.connector.gateway_name}),v.output.connector.gateway_id&&d.jsxs("p",{className:"text-xs text-slate-500",children:["ID: ",v.output.connector.gateway_id]})]}),v.output.type==="priority"&&v.output.connectors&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Priority List"}),d.jsx("div",{className:"space-y-1",children:v.output.connectors.map((k,H)=>d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-500 text-white text-xs flex items-center justify-center",children:H+1}),d.jsx("span",{className:"font-medium",children:k.gateway_name}),k.gateway_id&&d.jsxs("span",{className:"text-xs text-slate-500",children:["(",k.gateway_id,")"]})]},H))})]}),v.output.type==="volume_split"&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Volume Split Result"}),d.jsx("p",{className:"text-sm text-slate-600",children:"See Volume Split tab for detailed visualization."})]})]})}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>D(k=>!k),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(Jh,{size:14}),"API Response"]}),I?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),I&&d.jsx(Ne,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(v,null,2)})})]})]}):d.jsx(Te,{children:d.jsxs(Ne,{className:"py-16 text-center",children:[d.jsx(Mc,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Configure rule parameters and click "Evaluate Rules" to test routing.'})]})}):t==="batch"?w.length>0?d.jsxs(d.Fragment,{children:[d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Simulation Progress"})}),d.jsxs(Ne,{children:[d.jsxs("div",{className:"mb-4",children:[d.jsxs("div",{className:"flex justify-between text-xs text-slate-600 mb-1",children:[d.jsx("span",{children:"Progress"}),d.jsxs("span",{children:[Math.round(w.length/(parseInt(a.totalPayments)||1)*100),"%"]})]}),d.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:d.jsx("div",{className:"bg-brand-500 h-2 rounded-full transition-all duration-300",style:{width:`${w.length/(parseInt(a.totalPayments)||1)*100}%`}})})]}),Object.keys(ne).length>0&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-xs font-medium text-slate-700",children:"Gateway Selection Summary"}),Object.entries(ne).map(([k,H])=>d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"font-medium",children:k}),d.jsxs("div",{className:"flex gap-3 text-xs",children:[d.jsxs("span",{className:"text-emerald-600",children:[H.success," ✓"]}),d.jsxs("span",{className:"text-red-500",children:[H.failure," ✗"]}),d.jsxs("span",{className:"text-slate-500",children:["(",H.total," total)"]})]})]},k))]})]})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Transaction Log"})}),d.jsx(Ne,{className:"p-0 max-h-96 overflow-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 sticky top-0",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-3 py-2",children:"#"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Payment ID"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Gateway"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Outcome"})]})}),d.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:w.map((k,H)=>d.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16]",children:[d.jsx("td",{className:"px-3 py-2 text-slate-500",children:H+1}),d.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:k.paymentId.slice(-8)}),d.jsx("td",{className:"px-3 py-2 font-medium",children:k.decidedGateway}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(Qt,{variant:k.status==="CHARGED"?"green":"red",children:k.status})})]},k.paymentId))})]})})]})]}):d.jsx(Te,{children:d.jsxs(Ne,{className:"py-16 text-center",children:[d.jsx(Qh,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.'})]})}):h?d.jsxs(d.Fragment,{children:[d.jsx(Te,{children:d.jsxs(Ne,{children:[d.jsxs("div",{className:"flex items-start justify-between mb-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Decided Gateway"}),d.jsx("p",{className:"text-3xl font-bold text-slate-900",children:h.decided_gateway})]}),d.jsxs("div",{className:"text-right space-y-1",children:[d.jsx("div",{children:d.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Yoe(h.routing_approach)}`,children:h.routing_approach})}),h.is_scheduled_outage&&d.jsx(Qt,{variant:"red",children:"Scheduled Outage"}),h.latency!=null&&d.jsxs("p",{className:"text-xs text-slate-400",children:[h.latency,"ms"]})]})]}),h.routing_dimension&&d.jsxs("div",{className:"flex gap-4 text-sm text-slate-600 border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Dimension"}),d.jsx("p",{className:"font-medium",children:h.routing_dimension})]}),h.routing_dimension_level&&d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Level"}),d.jsx("p",{className:"font-medium",children:h.routing_dimension_level})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Reset"}),d.jsx("p",{className:"font-medium",children:h.reset_approach})]})]})]})}),Z.length>0&&d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Scores"}),d.jsxs(ht,{size:"sm",variant:"ghost",onClick:Ae,className:"text-xs",children:[d.jsx(_I,{size:12})," Refresh"]})]})}),d.jsx(Ne,{children:d.jsx(mf,{width:"100%",height:Z.length*40+20,children:d.jsxs(fj,{data:Z,layout:"vertical",margin:{left:10,right:30},children:[d.jsx(qu,{type:"number",domain:[0,100],tickFormatter:k=>`${k}%`,tick:{fontSize:11,fill:"#66667a"},axisLine:{stroke:"#1c1c24"},tickLine:!1}),d.jsx(Xu,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#8e8ea0"},width:60,axisLine:!1,tickLine:!1}),d.jsx(Pr,{formatter:k=>`${k}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),d.jsx(Qi,{dataKey:"score",radius:[0,4,4,0],children:Z.map((k,H)=>d.jsx(Pa,{fill:k.name===h.decided_gateway?"#0069ED":k.score<30?"#ef4444":k.score<60?"#f59e0b":"#10b981"},H))})]})})})]}),h.filter_wise_gateways&&d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>P(k=>!k),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:["Filter Chain",N?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),N&&d.jsx(Ne,{className:"space-y-2",children:Object.entries(h.filter_wise_gateways).map(([k,H])=>d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("span",{className:"text-xs font-mono bg-slate-100 dark:bg-[#111118] text-slate-600 rounded-md px-2 py-0.5 mt-0.5 shrink-0 border border-slate-200 dark:border-[#1c1c24]",children:k}),d.jsx("div",{className:"flex flex-wrap gap-1",children:Array.isArray(H)?H.map(K=>d.jsx("span",{className:"text-xs bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20 rounded-md px-2 py-0.5",children:K},K)):d.jsx("span",{className:"text-xs text-slate-400",children:"—"})})]},k))})]}),d.jsxs(Te,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>D(k=>!k),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(Jh,{size:14}),"API Response"]}),I?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),I&&d.jsx(Ne,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(h,null,2)})})]})]}):d.jsx(Te,{children:d.jsxs(Ne,{className:"py-16 text-center",children:[d.jsx(Mc,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Fill in the parameters and click "Run Decision" to see the routing result.'})]})})})]})]})}function Qoe(){return d.jsx(HR,{children:d.jsxs(_n,{element:d.jsx(cM,{}),children:[d.jsx(_n,{index:!0,element:d.jsx(VM,{})}),d.jsx(_n,{path:"routing",element:d.jsx(WM,{})}),d.jsx(_n,{path:"routing/sr",element:d.jsx(eL,{})}),d.jsx(_n,{path:"routing/rules",element:d.jsx(X4,{})}),d.jsx(_n,{path:"routing/volume",element:d.jsx(Foe,{})}),d.jsx(_n,{path:"routing/debit",element:d.jsx(Uoe,{})}),d.jsx(_n,{path:"decisions",element:d.jsx(Zoe,{})}),d.jsx(_n,{path:"*",element:d.jsx(UR,{to:".",replace:!0})})]})})}class Joe extends j.Component{constructor(){super(...arguments);ob(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(r){return{error:r,errorInfo:null}}componentDidCatch(r,n){console.log(` -`+"!".repeat(80)),console.log("[ERROR BOUNDARY] Component Error Caught"),console.log(`Timestamp: ${new Date().toISOString()}`),console.log("Error Message:",r.message),console.log("Error Stack:",r.stack),console.log("Component Stack:",n.componentStack),console.log("!".repeat(80)+` -`),this.setState({errorInfo:n})}render(){return this.state.error?d.jsxs("div",{style:{padding:32,fontFamily:"monospace",color:"red"},children:[d.jsx("h2",{children:"Dashboard Error"}),d.jsx("pre",{children:this.state.error.message}),d.jsx("pre",{children:this.state.error.stack}),this.state.errorInfo&&d.jsxs("pre",{style:{marginTop:16,color:"darkred"},children:["Component Stack:",this.state.errorInfo.componentStack]})]}):this.props.children}}console.log(` -`+"=".repeat(80));console.log("[APP STARTUP] Dashboard initializing...");console.log(`Timestamp: ${new Date().toISOString()}`);console.log("Environment: production");console.log("Base URL: /dashboard");console.log("=".repeat(80)+` -`);window.onerror=(e,t,r,n,i)=>{console.log(` -`+"!".repeat(80)),console.log("[WINDOW ERROR]"),console.log("Message:",e),console.log("Source:",t),console.log("Line:",r,"Column:",n),i&&(console.log("Error:",i.message),console.log("Stack:",i.stack)),console.log("!".repeat(80)+` -`)};window.onunhandledrejection=e=>{console.log(` -`+"!".repeat(80)),console.log("[UNHANDLED PROMISE REJECTION]"),console.log("Reason:",e.reason),e.reason instanceof Error&&console.log("Stack:",e.reason.stack),console.log("!".repeat(80)+` -`)};Zm.createRoot(document.getElementById("root")).render(d.jsx(T.StrictMode,{children:d.jsx(Joe,{children:d.jsx(JR,{basename:"/dashboard",children:d.jsx(Qoe,{})})})})); diff --git a/website/dist/assets/index-D41MAvos.css b/website/dist/assets/index-D41MAvos.css deleted file mode 100644 index bd5680e1..00000000 --- a/website/dist/assets/index-D41MAvos.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Menlo,Monaco,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html{color-scheme:light}html.dark{color-scheme:dark}html,body{font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark html,.dark body{color:#f1f5f9}html,body{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}html:is(.dark *),body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark p,.dark span,.dark h1,.dark h2,.dark h3,.dark h4,.dark h5,.dark h6{color:#f1f5f9}p,span,h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}p:is(.dark *),span:is(.dark *),h1:is(.dark *),h2:is(.dark *),h3:is(.dark *),h4:is(.dark *),h5:is(.dark *),h6:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark p.text-slate-500:is(.dark *),.dark span.text-slate-500:is(.dark *),.dark div.text-slate-500:is(.dark *){color:#64748b}p.text-slate-500:is(.dark *),span.text-slate-500:is(.dark *),div.text-slate-500:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}p.text-slate-600:is(.dark *),span.text-slate-600:is(.dark *),div.text-slate-600:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .text-slate-900,.dark .text-slate-800{color:#f1f5f9!important}.dark .text-slate-700{color:#e2e8f0!important}.dark .text-slate-600{color:#cbd5e1!important}.dark .text-slate-500{color:#94a3b8!important}.dark .text-slate-400{color:#64748b!important}.dark .text-blue-800,.dark .text-blue-700{color:#93c5fd!important}.dark .text-blue-600{color:#60a5fa!important}.dark .text-brand-500{color:#818cf8!important}.dark .bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .bg-slate-100{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1));-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.dark :where(input:not([type=checkbox]):not([type=radio]):not([type=range])),.dark :where(select),.dark :where(textarea){color:#f1f5f9}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){border-radius:9999px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::-moz-placeholder,:where(select)::-moz-placeholder,:where(textarea)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::placeholder,:where(select)::placeholder,:where(textarea)::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus,:where(select):focus,:where(textarea):focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(99 102 241 / .2)}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *),:where(select):is(.dark *),:where(textarea):is(.dark *){border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::-moz-placeholder,:where(select):is(.dark *)::-moz-placeholder,:where(textarea):is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::placeholder,:where(select):is(.dark *)::placeholder,:where(textarea):is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus:is(.dark *),:where(select):focus:is(.dark *),:where(textarea):focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 51 56 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){box-shadow:0 1px 2px #0000000d!important;font-family:Outfit,sans-serif}.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),.dark select,.dark textarea{box-shadow:none!important}.dark select option{color:#f1f5f9}select option{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}select option:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}input[type=range]{accent-color:#6366f1}input[type=range]:is(.dark *){accent-color:#fff}input[type=radio],input[type=checkbox]{height:1rem;width:1rem;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));accent-color:#6366f1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}input[type=radio]:is(.dark *),input[type=checkbox]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));accent-color:#fff}input[type=radio]{border-radius:50%}input[type=checkbox]{border-radius:4px}input[type=radio]:checked,input[type=checkbox]:checked{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}input[type=radio]:checked:is(.dark *),input[type=checkbox]:checked:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-20{z-index:20}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-\[76px\]{height:76px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-36{width:9rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-9{width:2.25rem}.w-\[calc\(100\%-12px\)\]{width:calc(100% - 12px)}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.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-\[1fr_100px_32px\]{grid-template-columns:1fr 100px 32px}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\.5{gap:.875rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#1c1c24\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(28 28 36 / var(--tw-divide-opacity, 1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-\[14px\]{border-radius:14px}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[\#1c2d50\]{--tw-border-opacity: 1;border-color:rgb(28 45 80 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-brand-600{--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity, 1))}.border-emerald-500\/20{border-color:#10b98133}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-t-gray-500{--tw-border-opacity: 1;border-top-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.bg-\[\#07070b\]{--tw-bg-opacity: 1;background-color:rgb(7 7 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#f8fafc\]{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-brand-50\/50{background-color:#eef2ff80}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-brand-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-3{padding-bottom:.75rem}.pl-1{padding-left:.25rem}.pl-6{padding-left:1.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Menlo,Monaco,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.text-\[16px\]{font-size:16px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.accent-brand-500{accent-color:#6366f1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.ring-emerald-500\/20{--tw-ring-color: rgb(16 185 129 / .2)}.ring-orange-500\/20{--tw-ring-color: rgb(249 115 22 / .2)}.ring-purple-500\/20{--tw-ring-color: rgb(168 85 247 / .2)}.ring-red-500\/20{--tw-ring-color: rgb(239 68 68 / .2)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.glass-panel{position:relative;overflow:hidden;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.glass-panel:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 26 29 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1));--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark .glass-panel-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.glass-panel-hover:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.glass-panel-hover:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #a855f7 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient:is(.dark *){--tw-gradient-from: #9b51e0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(155 81 224 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #4f46e5 var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-gradient-to: #0ea5e9 var(--tw-gradient-to-position)}.aurora-top{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#9b51e0,#4f46e5,#0ea5e9,transparent);opacity:.8;z-index:100}.dark .hover\:text-slate-900:hover{color:#f1f5f9!important}.dark .hover\:text-slate-700:hover{color:#e2e8f0!important}.dark .hover\:text-brand-500:hover{color:#818cf8!important}.dark .hover\:bg-slate-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .hover\:bg-slate-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}.group:hover .group-hover\:text-slate-600p:is(.dark *),.group:hover .group-hover\:text-slate-600 span:is(.dark *),.group:hover .group-hover\:text-slate-600 div:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .group:hover .group-hover\:text-slate-600{color:#cbd5e1!important}.last\:border-0:last-child{border-width:0px}.hover\:bg-brand-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#28282f\]:focus{--tw-border-opacity: 1;border-color:rgb(40 40 47 / var(--tw-border-opacity, 1))}.focus\:border-slate-400:focus{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-brand-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-offset-1:focus{--tw-ring-offset-width: 1px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.dark\:divide-\[\#222226\]:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(34 34 38 / var(--tw-divide-opacity, 1))}.dark\:border-\[\#151515\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 21 21 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c1f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 31 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c24\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 36 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222222\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222226\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#27272a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:border-\[\#2a2a2e\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 46 / var(--tw-border-opacity, 1))}.dark\:border-\[\#5c1c1c\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(92 28 28 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#000000\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0a0a0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c0e\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f11\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f16\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 22 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111114\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111118\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121214\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151515\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151518\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#2a0505\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(42 5 5 / var(--tw-bg-opacity, 1))}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:text-\[\#55555e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(85 85 94 / var(--tw-text-opacity, 1))}.dark\:text-\[\#66666e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(102 102 110 / var(--tw-text-opacity, 1))}.dark\:text-\[\#888891\]:is(.dark *){--tw-text-opacity: 1;color:rgb(136 136 145 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a1a1aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:hover\:bg-\[\#0c0c0e\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#121214\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#18181b\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#222222\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#380808\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(56 8 8 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-slate-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:border-\[\#444444\]:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(68 68 68 / var(--tw-border-opacity, 1))}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 768px){.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/website/dist/assets/index-_ClGteNY.css b/website/dist/assets/index-_ClGteNY.css new file mode 100644 index 00000000..b8be9034 --- /dev/null +++ b/website/dist/assets/index-_ClGteNY.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Menlo,Monaco,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html{color-scheme:light}html.dark{color-scheme:dark}html,body{font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark html,.dark body{color:#f1f5f9}html,body{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}html:is(.dark *),body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark p,.dark span,.dark h1,.dark h2,.dark h3,.dark h4,.dark h5,.dark h6{color:#f1f5f9}p,span,h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}p:is(.dark *),span:is(.dark *),h1:is(.dark *),h2:is(.dark *),h3:is(.dark *),h4:is(.dark *),h5:is(.dark *),h6:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark p.text-slate-500:is(.dark *),.dark span.text-slate-500:is(.dark *),.dark div.text-slate-500:is(.dark *){color:#64748b}p.text-slate-500:is(.dark *),span.text-slate-500:is(.dark *),div.text-slate-500:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}p.text-slate-600:is(.dark *),span.text-slate-600:is(.dark *),div.text-slate-600:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .text-slate-900,.dark .text-slate-800{color:#f1f5f9!important}.dark .text-slate-700{color:#e2e8f0!important}.dark .text-slate-600{color:#cbd5e1!important}.dark .text-slate-500{color:#94a3b8!important}.dark .text-slate-400{color:#64748b!important}.dark .text-blue-800,.dark .text-blue-700{color:#93c5fd!important}.dark .text-blue-600{color:#60a5fa!important}.dark .text-brand-500{color:#818cf8!important}.dark .bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .bg-slate-100{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1));-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.dark :where(input:not([type=checkbox]):not([type=radio]):not([type=range])),.dark :where(select),.dark :where(textarea){color:#f1f5f9}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){border-radius:9999px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::-moz-placeholder,:where(select)::-moz-placeholder,:where(textarea)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::placeholder,:where(select)::placeholder,:where(textarea)::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus,:where(select):focus,:where(textarea):focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(99 102 241 / .2)}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *),:where(select):is(.dark *),:where(textarea):is(.dark *){border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::-moz-placeholder,:where(select):is(.dark *)::-moz-placeholder,:where(textarea):is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::placeholder,:where(select):is(.dark *)::placeholder,:where(textarea):is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus:is(.dark *),:where(select):focus:is(.dark *),:where(textarea):focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 51 56 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){box-shadow:0 1px 2px #0000000d!important;font-family:Outfit,sans-serif}.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),.dark select,.dark textarea{box-shadow:none!important}.dark select option{color:#f1f5f9}select option{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}select option:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}input[type=range]{accent-color:#6366f1}input[type=range]:is(.dark *){accent-color:#fff}input[type=radio],input[type=checkbox]{height:1rem;width:1rem;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));accent-color:#6366f1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}input[type=radio]:is(.dark *),input[type=checkbox]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));accent-color:#fff}input[type=radio]{border-radius:50%}input[type=checkbox]{border-radius:4px}input[type=radio]:checked,input[type=checkbox]:checked{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}input[type=radio]:checked:is(.dark *),input[type=checkbox]:checked:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-20{z-index:20}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-\[76px\]{height:76px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-32{width:8rem}.w-36{width:9rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-9{width:2.25rem}.w-\[calc\(100\%-12px\)\]{width:calc(100% - 12px)}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.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-\[1fr_100px_32px\]{grid-template-columns:1fr 100px 32px}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\.5{gap:.875rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#1c1c24\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(28 28 36 / var(--tw-divide-opacity, 1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-\[14px\]{border-radius:14px}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[\#1c2d50\]{--tw-border-opacity: 1;border-color:rgb(28 45 80 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-brand-600{--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity, 1))}.border-emerald-500\/20{border-color:#10b98133}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-t-gray-500{--tw-border-opacity: 1;border-top-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.bg-\[\#07070b\]{--tw-bg-opacity: 1;background-color:rgb(7 7 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#f8fafc\]{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-brand-50\/50{background-color:#eef2ff80}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-brand-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-3{padding-bottom:.75rem}.pl-1{padding-left:.25rem}.pl-6{padding-left:1.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Menlo,Monaco,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.text-\[16px\]{font-size:16px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.accent-brand-500{accent-color:#6366f1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.ring-emerald-500\/20{--tw-ring-color: rgb(16 185 129 / .2)}.ring-orange-500\/20{--tw-ring-color: rgb(249 115 22 / .2)}.ring-purple-500\/20{--tw-ring-color: rgb(168 85 247 / .2)}.ring-red-500\/20{--tw-ring-color: rgb(239 68 68 / .2)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.glass-panel{position:relative;overflow:hidden;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.glass-panel:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 26 29 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1));--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark .glass-panel-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.glass-panel-hover:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.glass-panel-hover:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #a855f7 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient:is(.dark *){--tw-gradient-from: #9b51e0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(155 81 224 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #4f46e5 var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-gradient-to: #0ea5e9 var(--tw-gradient-to-position)}.aurora-top{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#9b51e0,#4f46e5,#0ea5e9,transparent);opacity:.8;z-index:100}.dark .hover\:text-slate-900:hover{color:#f1f5f9!important}.dark .hover\:text-slate-700:hover{color:#e2e8f0!important}.dark .hover\:text-brand-500:hover{color:#818cf8!important}.dark .hover\:bg-slate-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .hover\:bg-slate-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}.group:hover .group-hover\:text-slate-600p:is(.dark *),.group:hover .group-hover\:text-slate-600 span:is(.dark *),.group:hover .group-hover\:text-slate-600 div:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .group:hover .group-hover\:text-slate-600{color:#cbd5e1!important}.last\:border-0:last-child{border-width:0px}.hover\:bg-brand-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#28282f\]:focus{--tw-border-opacity: 1;border-color:rgb(40 40 47 / var(--tw-border-opacity, 1))}.focus\:border-slate-400:focus{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-brand-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-offset-1:focus{--tw-ring-offset-width: 1px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.dark\:divide-\[\#222226\]:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(34 34 38 / var(--tw-divide-opacity, 1))}.dark\:border-\[\#151515\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 21 21 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c1f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 31 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c24\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 36 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222222\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222226\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#27272a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:border-\[\#2a2a2e\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 46 / var(--tw-border-opacity, 1))}.dark\:border-\[\#5c1c1c\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(92 28 28 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#000000\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0a0a0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c0e\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f11\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f16\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 22 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111114\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111118\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121214\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151515\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151518\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#2a0505\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(42 5 5 / var(--tw-bg-opacity, 1))}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:text-\[\#55555e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(85 85 94 / var(--tw-text-opacity, 1))}.dark\:text-\[\#66666e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(102 102 110 / var(--tw-text-opacity, 1))}.dark\:text-\[\#888891\]:is(.dark *){--tw-text-opacity: 1;color:rgb(136 136 145 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a1a1aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:hover\:bg-\[\#0c0c0e\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#121214\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#18181b\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#222222\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#380808\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(56 8 8 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-slate-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:border-\[\#444444\]:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(68 68 68 / var(--tw-border-opacity, 1))}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 768px){.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/website/dist/index.html b/website/dist/index.html index b5bb5705..09ad7193 100644 --- a/website/dist/index.html +++ b/website/dist/index.html @@ -5,8 +5,8 @@ Decision Engine Dashboard - - + +
diff --git a/website/src/components/pages/DecisionExplorerPage.tsx b/website/src/components/pages/DecisionExplorerPage.tsx index 941bfac9..2e6dc363 100644 --- a/website/src/components/pages/DecisionExplorerPage.tsx +++ b/website/src/components/pages/DecisionExplorerPage.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { useEffect, useMemo, useState } from 'react' import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, Cell, PieChart, Pie } from 'recharts' import { Card, CardBody, CardHeader } from '../ui/Card' import { Button } from '../ui/Button' @@ -9,13 +9,9 @@ import { useMerchantStore } from '../../store/merchantStore' import { apiPost } from '../../lib/api' import { DecideGatewayResponse, GatewayConnector } from '../../types/api' import { ROUTING_APPROACH_COLORS } from '../../lib/constants' +import { useDynamicRoutingConfig } from '../../hooks/useDynamicRoutingConfig' import { Play, RefreshCw, ChevronDown, ChevronUp, Activity, Code, Plus, Trash2, PieChart as PieChartIcon } from 'lucide-react' -const PAYMENT_METHOD_TYPES = ['CARD', 'UPI', 'WALLET', 'NETBANKING', 'interac'] -const PAYMENT_METHODS = ['CREDIT', 'DEBIT', 'PREPAID'] -const CURRENCIES = ['USD', 'EUR', 'GBP', 'INR', 'SGD', 'AUD', 'CAD'] -const CARD_BRANDS = ['VISA', 'MASTERCARD', 'AMEX', 'RUPAY', 'DINERS'] -const AUTH_TYPES = ['THREE_DS', 'NO_THREE_DS'] const ALGORITHMS = ['SR_BASED_ROUTING', 'PL_BASED_ROUTING', 'NTW_BASED_ROUTING'] const ALGORITHM_LABELS: Record = { @@ -80,17 +76,37 @@ function approachColor(approach: string): string { const COLORS = ['#0069ED', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6', '#ec4899', '#06b6d4', '#84cc16'] +function toUpperOptions(values: string[] = []): string[] { + return values.map(v => v.trim()).filter(Boolean).map(v => v.toUpperCase()) +} + +function uniqueUpperOptions(values: string[] = []): string[] { + return Array.from(new Set(toUpperOptions(values))) +} + +function mapRoutingTypeToRuleParamType( + keyType?: 'enum' | 'integer' | 'udf' | 'str_value' | 'global_ref' +): RuleEvaluateParams['type'] { + if (keyType === 'enum') return 'enum_variant' + if (keyType === 'integer') return 'number' + if (keyType === 'udf' || keyType === 'global_ref') return 'metadata_variant' + return 'str_value' +} + export function DecisionExplorerPage() { const { merchantId } = useMerchantStore() + const { routingKeysConfig, isLoading: routingKeysLoading, error: routingKeysError } = useDynamicRoutingConfig() + const hasRoutingKeys = Object.keys(routingKeysConfig).length > 0 + const routingConfigUnavailable = !routingKeysLoading && (!hasRoutingKeys || Boolean(routingKeysError)) const [activeTab, setActiveTab] = useState('single') const [form, setForm] = useState({ amount: '1000', - currency: 'USD', - payment_method_type: 'CARD', - payment_method: 'CREDIT', - card_brand: 'VISA', - auth_type: 'THREE_DS', + currency: '', + payment_method_type: '', + payment_method: '', + card_brand: '', + auth_type: '', eligible_gateways: 'stripe, adyen', ranking_algorithm: 'SR_BASED_ROUTING', elimination_enabled: false, @@ -103,13 +119,13 @@ export function DecisionExplorerPage() { }) const [ruleParams, setRuleParams] = useState([ - { key: 'payment_method_type', type: 'enum_variant', value: 'credit', metadataKey: '' }, - { key: 'currency', type: 'enum_variant', value: 'USD', metadataKey: '' }, + { key: 'payment_method_type', type: 'enum_variant', value: '', metadataKey: '' }, + { key: 'currency', type: 'enum_variant', value: '', metadataKey: '' }, ]) const [fallbackConnectors, setFallbackConnectors] = useState([ - { gateway_name: 'stripe', gateway_id: 'mca_001' }, - { gateway_name: 'adyen', gateway_id: 'mca_002' }, + { gateway_name: 'stripe', gateway_id: 'gateway_001' }, + { gateway_name: 'adyen', gateway_id: 'gateway_002' }, ]) const [volumePayments, setVolumePayments] = useState('100') @@ -125,12 +141,101 @@ export function DecisionExplorerPage() { const [responseOpen, setResponseOpen] = useState(false) const [volumeResponseOpen, setVolumeResponseOpen] = useState(false) + const routingKeyNames = useMemo( + () => Object.keys(routingKeysConfig).sort(), + [routingKeysConfig] + ) + + const paymentMethodTypeOptions = useMemo( + () => toUpperOptions(routingKeysConfig.payment_method?.values || []), + [routingKeysConfig] + ) + + const paymentMethodOptions = useMemo(() => { + const methodTypeKey = form.payment_method_type.toLowerCase() + return toUpperOptions(routingKeysConfig[methodTypeKey]?.values || []) + }, [form.payment_method_type, routingKeysConfig]) + + const currencyOptions = useMemo( + () => uniqueUpperOptions(routingKeysConfig.currency?.values || []), + [routingKeysConfig] + ) + + const cardBrandOptions = useMemo( + () => uniqueUpperOptions(routingKeysConfig.card_network?.values || []), + [routingKeysConfig] + ) + + const authTypeOptions = useMemo( + () => uniqueUpperOptions(routingKeysConfig.authentication_type?.values || []), + [routingKeysConfig] + ) + + useEffect(() => { + if (routingConfigUnavailable || routingKeysLoading) return + + setForm(prev => { + const next = { ...prev } + + if (currencyOptions.length > 0 && !currencyOptions.includes(next.currency)) { + next.currency = currencyOptions[0] + } + + if (paymentMethodTypeOptions.length > 0 && !paymentMethodTypeOptions.includes(next.payment_method_type)) { + next.payment_method_type = paymentMethodTypeOptions[0] + } + + const methodsForType = toUpperOptions( + routingKeysConfig[next.payment_method_type.toLowerCase()]?.values || [] + ) + if (methodsForType.length > 0 && !methodsForType.includes(next.payment_method)) { + next.payment_method = methodsForType[0] + } + + if (authTypeOptions.length > 0 && !authTypeOptions.includes(next.auth_type)) { + next.auth_type = authTypeOptions[0] + } + + if (cardBrandOptions.length > 0 && !cardBrandOptions.includes(next.card_brand)) { + next.card_brand = cardBrandOptions[0] + } + + return next + }) + + setRuleParams(prev => + prev.map(param => { + if (!param.key || !routingKeysConfig[param.key]) return param + const keyConfig = routingKeysConfig[param.key] + const mappedType = mapRoutingTypeToRuleParamType(keyConfig.type) + const enumValues = keyConfig.values || [] + const nextValue = mappedType === 'enum_variant' + ? (enumValues.includes(param.value) ? param.value : (enumValues[0] || '')) + : param.value + return { ...param, type: mappedType, value: nextValue } + }) + ) + }, [ + routingConfigUnavailable, + routingKeysLoading, + routingKeysConfig, + currencyOptions, + paymentMethodTypeOptions, + authTypeOptions, + cardBrandOptions, + ]) + function set(field: keyof FormState, value: string | boolean) { setForm(f => ({ ...f, [field]: value })) } function addRuleParam() { - setRuleParams([...ruleParams, { key: '', type: 'enum_variant', value: '', metadataKey: '' }]) + if (routingKeyNames.length === 0) return + const firstKey = routingKeyNames[0] + const firstConfig = routingKeysConfig[firstKey] + const mappedType = mapRoutingTypeToRuleParamType(firstConfig?.type) + const firstValue = mappedType === 'enum_variant' ? (firstConfig?.values?.[0] || '') : '' + setRuleParams([...ruleParams, { key: firstKey, type: mappedType, value: firstValue, metadataKey: '' }]) } function removeRuleParam(index: number) { @@ -145,6 +250,15 @@ export function DecisionExplorerPage() { setRuleParams(ruleParams.map((p, i) => i === index ? { ...p, metadataKey: value } : p)) } + function updateRuleParamKey(index: number, key: string) { + const keyConfig = routingKeysConfig[key] + const mappedType = mapRoutingTypeToRuleParamType(keyConfig?.type) + const nextValue = mappedType === 'enum_variant' ? (keyConfig?.values?.[0] || '') : '' + setRuleParams(ruleParams.map((p, i) => ( + i === index ? { ...p, key, type: mappedType, value: nextValue, metadataKey: '' } : p + ))) + } + function addFallbackConnector() { setFallbackConnectors([...fallbackConnectors, { gateway_name: '', gateway_id: '' }]) } @@ -159,6 +273,7 @@ export function DecisionExplorerPage() { async function run() { if (!merchantId) return setError('Set a merchant ID in the top bar') + if (routingConfigUnavailable) return setError('Routing key config unavailable. Fix /config/routing-keys and retry.') setLoading(true); setError(null) const gateways = form.eligible_gateways.split(',').map(s => s.trim()).filter(Boolean) try { @@ -188,6 +303,7 @@ export function DecisionExplorerPage() { async function runSimulation() { if (!merchantId) return setError('Set a merchant ID in the top bar') + if (routingConfigUnavailable) return setError('Routing key config unavailable. Fix /config/routing-keys and retry.') const total = parseInt(simulationConfig.totalPayments) || 0 const success = parseInt(simulationConfig.successCount) || 0 @@ -265,6 +381,7 @@ export function DecisionExplorerPage() { } async function runRuleEvaluation() { + if (routingConfigUnavailable) return setError('Routing key config unavailable. Fix /config/routing-keys and retry.') setLoading(true) setError(null) setRuleResult(null) @@ -320,8 +437,8 @@ export function DecisionExplorerPage() { const res = await apiPost('/routing/evaluate', { created_by: merchantId || 'test_user', fallback_output: [ - { gateway_name: 'stripe', gateway_id: 'mca_001' }, - { gateway_name: 'adyen', gateway_id: 'mca_002' }, + { gateway_name: 'stripe', gateway_id: 'gateway_001' }, + { gateway_name: 'adyen', gateway_id: 'gateway_002' }, ], parameters: {}, }) @@ -413,31 +530,46 @@ export function DecisionExplorerPage() { Set a merchant ID in the top bar first.

)} + {activeTab !== 'volume' && routingKeysLoading && ( +

+ Loading routing config from backend... +

+ )} + {activeTab !== 'volume' && routingConfigUnavailable && ( + + )} {activeTab === 'rule' ? ( <> + {routingKeysLoading && ( +

Loading routing keys from backend...

+ )} + {routingConfigUnavailable && ( + + )}
{ruleParams.map((param, idx) => (
- updateRuleParam(idx, 'key', e.target.value)} + onChange={e => updateRuleParamKey(idx, e.target.value)} + disabled={routingConfigUnavailable || routingKeysLoading} className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" - /> - +
+ ) : param.type === 'enum_variant' ? ( +
+ +
+ ) : param.type === 'number' ? ( +
+ updateRuleParam(idx, 'value', e.target.value)} + className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" + /> +
) : (
- +
{fallbackConnectors.map((connector, idx) => (
updateFallbackConnector(idx, 'gateway_name', e.target.value)} className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" /> updateFallbackConnector(idx, 'gateway_id', e.target.value)} className="flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" @@ -511,7 +666,7 @@ export function DecisionExplorerPage() { onClick={addFallbackConnector} className="mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600" > - Add Connector + Add Gateway
@@ -525,7 +680,7 @@ export function DecisionExplorerPage() { className="w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500" />

- Enter the total number of payments to visualize how they would be distributed across connectors. + Enter the total number of payments to visualize how they would be distributed across gateways.

) : ( @@ -539,36 +694,41 @@ export function DecisionExplorerPage() {
@@ -644,7 +804,7 @@ export function DecisionExplorerPage() { {activeTab === 'rule' ? ( - ) : activeTab === 'volume' ? ( @@ -652,7 +812,7 @@ export function DecisionExplorerPage() { {loading ? <> Calculating… : <> Visualize Distribution} ) : activeTab === 'batch' ? ( - ) : ( - )} @@ -794,13 +954,13 @@ export function DecisionExplorerPage() { -

Connector Summary

+

Gateway Summary

- + @@ -840,7 +1000,7 @@ export function DecisionExplorerPage() { - + @@ -904,7 +1064,7 @@ export function DecisionExplorerPage() { -

Enter the number of payments and click "Visualize Distribution" to see how payments are split across connectors.

+

Enter the number of payments and click "Visualize Distribution" to see how payments are split across gateways.

) @@ -915,24 +1075,25 @@ export function DecisionExplorerPage() {
-

Output Type

-

{ruleResult.output.type}

+

Status

+

{ruleResult.status}

+

output_type: {ruleResult.output.type}

{ruleResult.output.type === 'single' && ruleResult.output.connector && (
-

Selected Gateway

+

Selected gateway_name

{ruleResult.output.connector.gateway_name}

{ruleResult.output.connector.gateway_id && ( -

ID: {ruleResult.output.connector.gateway_id}

+

gateway_id: {ruleResult.output.connector.gateway_id}

)}
)} {ruleResult.output.type === 'priority' && ruleResult.output.connectors && (
-

Priority List

+

Priority gateway_name list

{ruleResult.output.connectors.map((gw, idx) => (
diff --git a/website/src/components/pages/EuclidRulesPage.tsx b/website/src/components/pages/EuclidRulesPage.tsx index c4755077..d9fd5d03 100644 --- a/website/src/components/pages/EuclidRulesPage.tsx +++ b/website/src/components/pages/EuclidRulesPage.tsx @@ -25,7 +25,6 @@ import { useMerchantStore } from '../../store/merchantStore' import { apiPost } from '../../lib/api' import { RoutingAlgorithm } from '../../types/api' import { useDynamicRoutingConfig, RoutingKeyConfig } from '../../hooks/useDynamicRoutingConfig' -import { STATIC_ROUTING_KEYS } from '../../lib/constants' import { Plus, Trash2, GripVertical, ChevronDown, ChevronUp, Eye } from 'lucide-react' const OPERATOR_TO_API: Record = { @@ -40,12 +39,14 @@ const OPERATOR_TO_API: Record = { // ---- Types for builder ---- interface GatewayEntry { id: string - name: string + gatewayName: string + gatewayId: string } interface VolSplitEntry { id: string - name: string + gatewayName: string + gatewayId: string split: number } @@ -108,7 +109,8 @@ function PriorityEditor({ gateways: GatewayEntry[] onChange: (gws: GatewayEntry[]) => void }) { - const [newName, setNewName] = useState('') + const [newGatewayName, setNewGatewayName] = useState('') + const [newGatewayId, setNewGatewayId] = useState('') const sensors = useSensors( useSensor(PointerSensor), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }) @@ -124,9 +126,17 @@ function PriorityEditor({ } function add() { - if (!newName.trim()) return - onChange([...gateways, { id: crypto.randomUUID(), name: newName.trim() }]) - setNewName('') + if (!newGatewayName.trim()) return + onChange([ + ...gateways, + { + id: crypto.randomUUID(), + gatewayName: newGatewayName.trim(), + gatewayId: newGatewayId.trim(), + }, + ]) + setNewGatewayName('') + setNewGatewayId('') } return ( @@ -137,7 +147,7 @@ function PriorityEditor({ onChange(gateways.filter((g) => g.id !== gw.id))} /> ))} @@ -145,10 +155,17 @@ function PriorityEditor({
setNewName(e.target.value)} + value={newGatewayName} + onChange={(e) => setNewGatewayName(e.target.value)} onKeyDown={(e) => e.key === 'Enter' && (e.preventDefault(), add())} - placeholder="gateway name" + placeholder="gateway_name" + className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500" + /> + setNewGatewayId(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && (e.preventDefault(), add())} + placeholder="gateway_id" className="border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500" />
@@ -775,7 +841,7 @@ export function EuclidRulesPage() {
)}
-
Connectorgateway_name Payments Percentage
#Connectorgateway_name
- - - - -
- -### 🧠 Intelligent Routing - -| Feature | What It Does | -|---------|--------------| -| **Eligibility Check** | Filters out ineligible gateways before routing | -| **Rule-Based Ordering** | Apply merchant-specific priority rules | -| **Dynamic Ordering** | Success rate based gateway optimization | -| **Downtime Detection** | Auto-pause failing gateways | - - - -### 🛠 Built for Production - -| Capability | Details | -|------------|---------| -| **⚡ Blazing Fast** | Fast routing decisions | -| **🔐 Memory Safe** | Built in Rust — no data races | -| **📊 Multi-DB** | MySQL & PostgreSQL support | -| **🐳 Docker Ready** | One-command deployment | -| **☸️ K8s Native** | Helm charts included | - -
- ---- - -## 📊 Performance at a Glance - -
- -| Metric | Value | -|--------|-------| -| Routing Decision Time | **Low latency** | -| Memory Footprint | **~50MB** | -| Concurrent Requests | **100K+** | -| Uptime SLA Support | **99.99%** | - -
- ---- - -## 🏃 Quick Start - -### 🐳 Docker (Recommended) +### API Only ```bash -# Clone and run git clone https://github.com/juspay/decision-engine.git cd decision-engine docker compose --profile postgres-ghcr up -d -# That's it! API ready at http://localhost:8080 +curl http://localhost:8080/health ``` -### 🦀 From Source - -```bash -# Prerequisites: Rust 1.85+, MySQL/PostgreSQL, Redis +Expected response: -git clone https://github.com/juspay/decision-engine.git -cd decision-engine -cargo build --release - -# Configure -cp config.example.toml config/development.toml -# Edit config with your settings - -# Run migrations & start -diesel migration run -./target/release/open_router +```json +{"message":"Health is good"} ``` -### ✅ Verify +### Dashboard + Docs ```bash -curl http://localhost:8080/health -# → {"message":"Health is good"} +docker compose --profile dashboard-postgres-ghcr up -d ``` ---- - -## 📖 Documentation - -| 📘 Resource | Description | -|-------------|-------------| -| [Local Setup Guide](docs/local-setup.md) | Canonical guide for CLI, Docker, Compose profiles, and Helm | -| [MySQL Setup Guide](docs/setup-guide-mysql.md) | MySQL-specific walkthrough | -| [PostgreSQL Setup Guide](docs/setup-guide-postgres.md) | PostgreSQL-specific walkthrough | -| [API Reference](docs/api-reference1.md) | Complete REST API documentation | -| [Configuration Guide](docs/configuration.md) | All config options explained | -| [Deep Dive Blog](https://juspay.io/blog/juspay-orchestrator-and-merchant-controlled-routing-engine) | How routing logic works | - ---- - -## 🏗 Architecture - -### High-Level Flow - -
- Decision Engine Architecture -
- -### Integration Pattern - -Decision Engine integrates seamlessly into your existing payment stack: - -
- Integration Pattern -
- -**Integration Steps:** - -| Step | Direction | Component | Action | -|:----:|:---------:|-----------|--------| -| 1 | → | Your App | Initiates payment request | -| 2 | → | Orchestrator | Forwards to Decision Engine | -| 3 | → | Decision Engine | Selects optimal gateway | -| 4 | → | Vault | Returns card token (PCI-safe) | -| 5 | → | Gateway | Processes payment | -| 6 | ← | Gateway | Returns result | -| 7 | ← | Orchestrator | Routes response back | -| 8 | ← | Your App | Receives final result | - -**Key Benefits:** -- **Zero PCI scope** — Vault handles all card data -- **Drop-in integration** — Works with any orchestrator -- **Intelligent fallback** — Auto-switches on gateway failure - ---- - -## 🗺 Roadmap - -| Status | Feature | Description | -|:------:|---------|-------------| -| ✅ | Rule-based routing | Merchant-defined priority rules | -| ✅ | Dynamic ordering | SR-based gateway selection | -| ✅ | Downtime detection | Automatic health monitoring | -| ✅ | Multi-database | MySQL & PostgreSQL support | -| 🔄 | Enhanced routing models | Better success rate prediction | -| 🔄 | Admin dashboard | Visual rule management UI | -| 📋 | Multi-tenant analytics | Per-tenant routing insights | -| 📋 | GraphQL API | Alternative query interface | +Available URLs: + +- API: `http://localhost:8080` +- Dashboard: `http://localhost:8081/dashboard/` +- Docs: `http://localhost:8081/introduction` + +## Local Development Paths + +Use `docs/local-setup.md` as the canonical startup guide. + +Common options: + +- Published PostgreSQL image track: + `docker compose --profile postgres-ghcr up -d` +- Local PostgreSQL build track: + `docker compose --profile postgres-local up -d --build` +- Makefile wrappers: + `make init-pg-ghcr` + `make init-pg-local` +- PostgreSQL source build: + `cargo build --release --no-default-features --features middleware,kms-aws,postgres` +- PostgreSQL migration: + `just migrate-pg` + +## Documentation Map + +| File | Purpose | +|------|---------| +| `docs/local-setup.md` | Canonical local, Compose, source-run, and Helm guide | +| `docs/configuration.md` | Config files, env overrides, and runtime config model | +| `docs/dashboard.mdx` | Dashboard availability, routes, and local usage | +| `docs/api-reference.md` | API overview and endpoint families | +| `docs/api-reference1.md` | Curl examples and local smoke-test flows | +| `docs/openapi.json` | OpenAPI source used by Mintlify | +| `docs/setup-guide-postgres.md` | PostgreSQL-focused setup commands | +| `docs/setup-guide-mysql.md` | MySQL-focused setup commands | + +## Runtime Shape + +At a high level: + +```text +client or orchestrator + | + v +POST /decide-gateway + | + v +Decision Engine evaluates the request against merchant config, +routing rules, score data, and eligible gateways + | + v +response with the selected gateway and routing metadata +``` ---- +Related flows: -## 🤝 Contributing +- `POST /update-gateway-score` feeds transaction outcomes back into scoring +- `POST /routing/*` manages routing algorithms +- `POST /rule/*` manages service-level routing configuration -We ❤️ contributions! +## Development Commands ```bash -# 1. Fork & clone -git clone https://github.com/YOUR_USERNAME/decision-engine.git - -# 2. Create branch -git checkout -b feature/your-feature +# lint and compile coverage +just clippy +just check -# 3. Make changes & test +# tests cargo test -# 4. Submit PR! +# postgres migrations +just migrate-pg ``` -👉 See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. - -🌱 **New to open source?** Check out [good first issues](https://github.com/juspay/decision-engine/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)! - ---- +CI-relevant compile matrix lives in `scripts/ci-checks.sh`. -## 💬 Community +## Contributing -| Platform | What It's For | -|----------|---------------| -| [![Slack](https://img.shields.io/badge/Slack-Join_Chat-4A154B?logo=slack)](https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2jqxmpsbm-WXUENx022HjNEy~Ark7Orw) | Real-time help, discussions | -| [GitHub Discussions](https://github.com/juspay/decision-engine/discussions) | Ideas, feature requests | -| [GitHub Issues](https://github.com/juspay/decision-engine/issues) | Bug reports | +See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution workflow and expectations. ---- - -## 📜 License +## License Licensed under [GNU AGPL v3.0](LICENSE). - ---- - -
- -### Built with ❤️ by [Juspay](https://juspay.io) - -*Reliable, open-source payments infrastructure for the world.* - -**[⬆ Back to Top](#-decision-engine)** - -
diff --git a/docs/api-reference.md b/docs/api-reference.md index f249414f..a744232e 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -1,9 +1,44 @@ -# API Reference +# API Overview -Decision Engine API documentation is available in: +The canonical API contract for the docs site is `docs/openapi.json`. -- [Primary API Reference](api-reference1.md) -- Mint API pages under `docs/api-reference/endpoint/*` +Use this page to find the right endpoint family. Use the OpenAPI-backed endpoint pages for schema details. -If you run docs locally (`dashboard-*` profiles), browse: -- `http://localhost:8081/introduction` +## Endpoint Families + +### Health + +- [Health Check](api-reference/endpoint/healthCheck) + +### Gateway Decision + +- [Decide Gateway](api-reference/endpoint/decideGateway) + +### Score Feedback + +- [Update Gateway Score](api-reference/endpoint/updateGatewayScore) + +### Merchant Account + +- [Create Merchant](api-reference/endpoint/createMerchant) +- [Get Merchant](api-reference/endpoint/getMerchant) +- [Delete Merchant](api-reference/endpoint/deleteMerchant) + +### Routing Rules + +- [Create Routing Rule](api-reference/endpoint/createRoutingRule) +- [Activate Routing Rule](api-reference/endpoint/activateRoutingRule) +- [List Routing Rules](api-reference/endpoint/listRoutingRules) +- [Get Active Routing Rule](api-reference/endpoint/getActiveRoutingRule) +- [Evaluate Routing Rule](api-reference/endpoint/evaluateRoutingRule) + +### Rule Configuration + +- [Create Rule Config](api-reference/endpoint/createRuleConfig) +- [Get Rule Config](api-reference/endpoint/getRuleConfig) +- [Update Rule Config](api-reference/endpoint/updateRuleConfig) +- [Delete Rule Config](api-reference/endpoint/deleteRuleConfig) + +## Curl Examples + +For local smoke-test examples, use [API Examples](api-reference1.md). diff --git a/docs/api-reference/endpoint/activateRoutingRule.mdx b/docs/api-reference/endpoint/activateRoutingRule.mdx index 16c99020..dae80c51 100644 --- a/docs/api-reference/endpoint/activateRoutingRule.mdx +++ b/docs/api-reference/endpoint/activateRoutingRule.mdx @@ -1,4 +1,7 @@ --- title: "Activate Routing Rule" +description: "Activate an existing routing algorithm for a given created_by scope." openapi: "POST /routing/activate" --- + +Use this endpoint to make a routing algorithm active for the supplied `created_by` value. diff --git a/docs/api-reference/endpoint/createMerchant.mdx b/docs/api-reference/endpoint/createMerchant.mdx index 65411968..5a67650a 100644 --- a/docs/api-reference/endpoint/createMerchant.mdx +++ b/docs/api-reference/endpoint/createMerchant.mdx @@ -1,4 +1,7 @@ --- title: "Create Merchant" +description: "Create a merchant account used by later routing and scoring requests." openapi: "POST /merchant-account/create" --- + +Use this endpoint before calling routing or score-feedback APIs for a new merchant. diff --git a/docs/api-reference/endpoint/createRoutingRule.mdx b/docs/api-reference/endpoint/createRoutingRule.mdx index 353ee9fc..9589114c 100644 --- a/docs/api-reference/endpoint/createRoutingRule.mdx +++ b/docs/api-reference/endpoint/createRoutingRule.mdx @@ -1,4 +1,7 @@ --- title: "Create Routing Rule" +description: "Create a routing algorithm for a given created_by scope." openapi: "POST /routing/create" --- + +Use this endpoint to store a priority, single, volume-split, or advanced routing algorithm. diff --git a/docs/api-reference/endpoint/createRuleConfig.mdx b/docs/api-reference/endpoint/createRuleConfig.mdx index 08b4b20c..20ec9bc7 100644 --- a/docs/api-reference/endpoint/createRuleConfig.mdx +++ b/docs/api-reference/endpoint/createRuleConfig.mdx @@ -1,4 +1,7 @@ --- title: "Create Rule Config" +description: "Create service-level rule configuration such as success-rate settings." openapi: "POST /rule/create" --- + +Use this endpoint to create routing configuration tied to a merchant. diff --git a/docs/api-reference/endpoint/decideGateway.mdx b/docs/api-reference/endpoint/decideGateway.mdx index d954c5fb..bd264449 100644 --- a/docs/api-reference/endpoint/decideGateway.mdx +++ b/docs/api-reference/endpoint/decideGateway.mdx @@ -1,4 +1,7 @@ --- title: "Decide Gateway" +description: "Evaluate the current routing logic for a payment context and eligible gateway list." openapi: "POST /decide-gateway" --- + +This is the main routing decision endpoint exposed by the service. diff --git a/docs/api-reference/endpoint/deleteMerchant.mdx b/docs/api-reference/endpoint/deleteMerchant.mdx index 934ba803..4408d8e3 100644 --- a/docs/api-reference/endpoint/deleteMerchant.mdx +++ b/docs/api-reference/endpoint/deleteMerchant.mdx @@ -1,4 +1,7 @@ --- title: "Delete Merchant" +description: "Delete a merchant account by ID." openapi: "DELETE /merchant-account/{merchantId}" --- + +Use this endpoint to remove a merchant record and its associated service-level configuration. diff --git a/docs/api-reference/endpoint/deleteRuleConfig.mdx b/docs/api-reference/endpoint/deleteRuleConfig.mdx index 64a58043..0f2b8b1e 100644 --- a/docs/api-reference/endpoint/deleteRuleConfig.mdx +++ b/docs/api-reference/endpoint/deleteRuleConfig.mdx @@ -1,4 +1,7 @@ --- title: "Delete Rule Config" +description: "Delete service-level routing configuration for a merchant." openapi: "POST /rule/delete" --- + +Use this endpoint when a stored rule configuration should no longer apply. diff --git a/docs/api-reference/endpoint/evaluateRoutingRule.mdx b/docs/api-reference/endpoint/evaluateRoutingRule.mdx index a6569396..01254a1c 100644 --- a/docs/api-reference/endpoint/evaluateRoutingRule.mdx +++ b/docs/api-reference/endpoint/evaluateRoutingRule.mdx @@ -1,4 +1,7 @@ --- title: "Evaluate Routing Rule" +description: "Evaluate the active routing rule without calling the gateway-selection API." openapi: "POST /routing/evaluate" --- + +Use this endpoint to inspect routing-rule output for a payment context. diff --git a/docs/api-reference/endpoint/getActiveRoutingRule.mdx b/docs/api-reference/endpoint/getActiveRoutingRule.mdx index 1619bffc..8453d0e8 100644 --- a/docs/api-reference/endpoint/getActiveRoutingRule.mdx +++ b/docs/api-reference/endpoint/getActiveRoutingRule.mdx @@ -1,4 +1,7 @@ --- title: "Get Active Routing Rule" +description: "Fetch the currently active routing rule for a created_by scope." openapi: "POST /routing/list/active/{created_by}" --- + +Use this endpoint to inspect which routing algorithm is currently active. diff --git a/docs/api-reference/endpoint/getMerchant.mdx b/docs/api-reference/endpoint/getMerchant.mdx index 05ad50f7..ec3e6976 100644 --- a/docs/api-reference/endpoint/getMerchant.mdx +++ b/docs/api-reference/endpoint/getMerchant.mdx @@ -1,4 +1,7 @@ --- title: "Get Merchant" +description: "Retrieve a merchant account by ID." openapi: "GET /merchant-account/{merchantId}" --- + +Use this endpoint to inspect the stored merchant account record. diff --git a/docs/api-reference/endpoint/getRuleConfig.mdx b/docs/api-reference/endpoint/getRuleConfig.mdx index f4ed063b..a00375a2 100644 --- a/docs/api-reference/endpoint/getRuleConfig.mdx +++ b/docs/api-reference/endpoint/getRuleConfig.mdx @@ -1,4 +1,7 @@ --- title: "Get Rule Config" +description: "Fetch service-level routing configuration for a merchant." openapi: "POST /rule/get" --- + +Use this endpoint to inspect the currently stored rule configuration for a merchant. diff --git a/docs/api-reference/endpoint/healthCheck.mdx b/docs/api-reference/endpoint/healthCheck.mdx index 8f7349b3..c58182b5 100644 --- a/docs/api-reference/endpoint/healthCheck.mdx +++ b/docs/api-reference/endpoint/healthCheck.mdx @@ -1,4 +1,7 @@ --- title: "Health Check" +description: "Verify that the main API server is responding." openapi: "GET /health" --- + +Use this endpoint for the simplest local or deployment liveness check. diff --git a/docs/api-reference/endpoint/listRoutingRules.mdx b/docs/api-reference/endpoint/listRoutingRules.mdx index c9c79ef5..c71d203e 100644 --- a/docs/api-reference/endpoint/listRoutingRules.mdx +++ b/docs/api-reference/endpoint/listRoutingRules.mdx @@ -1,4 +1,7 @@ --- title: "List Routing Rules" -openapi: "POST /routing/list/{merchantId}" +description: "List stored routing algorithms for a created_by scope." +openapi: "POST /routing/list/{created_by}" --- + +Use this endpoint to inspect the routing algorithms stored for a merchant or platform scope. diff --git a/docs/api-reference/endpoint/updateGatewayScore.mdx b/docs/api-reference/endpoint/updateGatewayScore.mdx index d6b5a1e9..ff080b2e 100644 --- a/docs/api-reference/endpoint/updateGatewayScore.mdx +++ b/docs/api-reference/endpoint/updateGatewayScore.mdx @@ -1,4 +1,7 @@ --- title: "Update Gateway Score" +description: "Record a transaction outcome for later routing decisions." openapi: "POST /update-gateway-score" --- + +Use this endpoint after a payment outcome is known so score data can be updated. diff --git a/docs/api-reference/endpoint/updateRuleConfig.mdx b/docs/api-reference/endpoint/updateRuleConfig.mdx index 5fa04701..8c194563 100644 --- a/docs/api-reference/endpoint/updateRuleConfig.mdx +++ b/docs/api-reference/endpoint/updateRuleConfig.mdx @@ -1,4 +1,7 @@ --- title: "Update Rule Config" +description: "Update stored service-level routing configuration for a merchant." openapi: "POST /rule/update" --- + +Use this endpoint to modify an existing rule configuration without recreating it. diff --git a/docs/api-reference1.md b/docs/api-reference1.md index 673c9c6d..f5937d60 100644 --- a/docs/api-reference1.md +++ b/docs/api-reference1.md @@ -1,995 +1,167 @@ -# API REFERENCE +# API Examples -## Decision Gateway API +Use these examples for local smoke tests. For request and response schemas, use the OpenAPI-backed endpoint pages and `docs/openapi.json`. -### Sample curl for decide-gateway +Base URL: -#### Request: SR BASED ROUTING ```bash -curl --location 'http://localhost:8080/decide-gateway' \ ---header 'Content-Type: application/json' \ ---data '{ - "merchantId": "test_merchant1", - "eligibleGatewayList": ["GatewayA", "GatewayB", "GatewayC"], - "rankingAlgorithm": "SR_BASED_ROUTING", - "eliminationEnabled": true, - "paymentInfo": { - "paymentId": "PAY12359", - "amount": 100.50, - "currency": "USD", - "customerId": "CUST12345", - "udfs": null, - "preferredGateway": null, - "paymentType": "ORDER_PAYMENT", - "metadata": null, - "internalMetadata": null, - "isEmi": false, - "emiBank": null, - "emiTenure": null, - "paymentMethodType": "UPI", - "paymentMethod": "UPI_PAY", - "paymentSource": null, - "authType": null, - "cardIssuerBankName": null, - "cardIsin": null, - "cardType": null, - "cardSwitchProvider": null - } -}' +export BASE_URL=http://localhost:8080 ``` -#### Response: -```json -{ - "decided_gateway": "GatewayA", - "gateway_priority_map": { - "GatewayA": 1.0, - "GatewayB": 1.0, - "GatewayC": 1.0 - }, - "filter_wise_gateways": null, - "priority_logic_tag": null, - "routing_approach": "SR_SELECTION_V3_ROUTING", - "gateway_before_evaluation": "GatewayA", - "priority_logic_output": { - "isEnforcement": false, - "gws": [ - "GatewayA", - "GatewayB", - "GatewayC" - ], - "priorityLogicTag": null, - "gatewayReferenceIds": {}, - "primaryLogic": null, - "fallbackLogic": null - }, - "reset_approach": "NO_RESET", - "routing_dimension": "ORDER_PAYMENT, UPI, UPI_PAY", - "routing_dimension_level": "PM_LEVEL", - "is_scheduled_outage": false, - "is_dynamic_mga_enabled": false, - "gateway_mga_id_map": null -} -``` -##### Routing Approach -This field available in the response for the decide-gateway api call provides visibility into the routing logic applied by the decision engine for a transaction. The possible values are as follows: - -- **SR_SELECTION_V3_ROUTING** : Routing is based on the gateway with the highest Success Rate (SR) score for the merchant, evaluated at the dimension on which routing is happening - -- **SR_V3_DOWNTIME_ROUTING** : Routing uses SR-based selection, but one or more (not all) eligible gateways have been deprioritized due to downtime (i.e., having a score below the elimination threshold). The system selects the best available gateway (based on SR) amongst the gateways which are not facing downtime. - -- **SR_V3_ALL_DOWNTIME_ROUTING** : All eligible gateways are facing downtime and have been deprioritized via elimination. Routing still uses SR scores at the configured dimension level to select the best among the degraded options. - -- **SR_V3_HEDGING** : Routing is done across all eligible gateways irrespective of their SR performance. This mode is used for exploration and evaluation of gateway SR performance and is controlled via configuration in the SR routing setup. +## Health -- **SR_V3_DOWNTIME_HEDGING** : Routing follows the hedging strategy, where SR performance is not a strict criterion. However, one or more (but not all) eligible gateways are facing downtime. The system prefers gateways that are currently healthy while maintaining the exploration objective. - -- **SR_V3_ALL_DOWNTIME_HEDGING** : Routing follows the configured hedging strategy, but all eligible gateways are experiencing downtime. In this scenario, routing proceeds without reprioritization, in accordance with the defined hedging configuration. - -#### Request: DEBIT ROUTING ```bash -curl --location 'http://localhost:8080/decide-gateway' \ ---header 'Content-Type: application/json' \ ---data '{ - "merchantId": "pro_OiJkBiFuCYbYAkCG9X02", - "eligibleGatewayList": ["PAYU", "RAZORPAY", "PAYTM_V2"], - "rankingAlgorithm": "NTW_BASED_ROUTING", - "eliminationEnabled": true, - "paymentInfo": { - "paymentId": "PAY12345", - "amount": 100.50, - "currency": "USD", - "customerId": "CUST12345", - "udfs": null, - "preferredGateway": null, - "paymentType": "ORDER_PAYMENT", - "metadata": "{\"merchant_category_code\":\"merchant_category_code_0001\",\"acquirer_country\":\"US\"}", - "internalMetadata": null, - "isEmi": false, - "emiBank": null, - "emiTenure": null, - "paymentMethodType": "UPI", - "paymentMethod": "UPI_PAY", - "paymentSource": null, - "authType": null, - "cardIssuerBankName": null, - "cardIsin": "440000", - "cardType": null, - "cardSwitchProvider": null - } -}' -``` - -#### Response: -```json -{ - "decided_gateway": "PAYU", - "gateway_priority_map": null, - "filter_wise_gateways": null, - "priority_logic_tag": null, - "routing_approach": "NONE", - "gateway_before_evaluation": null, - "priority_logic_output": null, - "debit_routing_output": { - "co_badged_card_networks": [ - "STAR", - "VISA" - ], - "issuer_country": "US", - "is_regulated": false, - "regulated_name": "GOVERNMENT EXEMPT INTERCHANGE FEE", - "card_type": "debit" - }, - "reset_approach": "NO_RESET", - "routing_dimension": null, - "routing_dimension_level": null, - "is_scheduled_outage": false, - "is_dynamic_mga_enabled": false, - "gateway_mga_id_map": null -} +curl "$BASE_URL/health" ``` -## Update Gateway Score API - -### Sample curl for update-gateway-score +## Create Merchant -#### Request: ```bash -curl --location 'http://localhost:8080/update-gateway-score' \ ---header 'Content-Type: application/json' \ ---data '{ - "merchantId" : "test_merchant1", - "gateway": "RAZORPAY", - "gatewayReferenceId": null, - "status": "FAILURE", - "paymentId": "PAY12359", - "enforceDynamicRoutingFailure" : null -}' -``` - -#### Response: -``` -Success +curl -X POST "$BASE_URL/merchant-account/create" \ + -H "Content-Type: application/json" \ + -d '{ + "merchant_id": "demo_merchant", + "gateway_success_rate_based_decider_input": null + }' ``` -## Config APIs +## Decide Gateway -#### Request: Success Rate Config Create ```bash -curl -X POST http://localhost:8080/rule/create \ +curl -X POST "$BASE_URL/decide-gateway" \ -H "Content-Type: application/json" \ -d '{ - "merchant_id": "test_merchant_123423", - "config": { - "type": "successRate", - "data": { - "defaultLatencyThreshold": 90, - "defaultSuccessRate": 0.5, - "defaultBucketSize": 200, - "defaultHedgingPercent": 5, - "subLevelInputConfig": [ - { - "paymentMethodType": "upi", - "paymentMethod": "upi_collect", - "bucketSize": 250, - "hedgingPercent": 1 - } - ] - } - } + "merchantId": "demo_merchant", + "paymentInfo": { + "paymentId": "pay_001", + "amount": 1000.0, + "currency": "USD", + "paymentType": "ORDER_PAYMENT", + "paymentMethodType": "CARD", + "paymentMethod": "CREDIT" + }, + "eligibleGatewayList": ["stripe", "paypal", "adyen"], + "rankingAlgorithm": "SrBasedRouting", + "eliminationEnabled": false }' ``` -#### Response: -```json -{ - "Success Rate Configuration created successfully" -} -``` +## Update Gateway Score -#### Request: Success Rate Config retrieve ```bash -curl -X POST http://localhost:8080/rule/get \ - -H "Content-Type: application/json" \ - -d '{ - "merchant_id": "test_merchant_123423", - "algorithm": "successRate" - }' +curl -X POST "$BASE_URL/update-gateway-score" \ + -H "Content-Type: application/json" \ + -d '{ + "merchantId": "demo_merchant", + "gateway": "stripe", + "paymentId": "pay_001", + "status": "CHARGED", + "gatewayReferenceId": null, + "enforceDynamicRoutingFailure": null + }' ``` -#### Response: -```json -{ - "merchant_id": "test_merchant_123423", - "config": { - "type": "successRate", - "data": { - "defaultLatencyThreshold": 90, - "defaultSuccessRate": 0.5, - "defaultBucketSize": 200, - "defaultHedgingPercent": 5, - "subLevelInputConfig": [ - { - "paymentMethodType": "upi", - "paymentMethod": "upi_collect", - "bucketSize": 250, - "hedgingPercent": 1 - } - ] - } - } -} -``` +## Create Routing Rule -#### Request: Success Rate Config update ```bash -curl -X POST http://localhost:8080/rule/update \ +curl -X POST "$BASE_URL/routing/create" \ -H "Content-Type: application/json" \ -d '{ - "merchant_id": "test_merchant_123423", - "config": { - "type": "successRate", - "data": { - "defaultLatencyThreshold": 90, - "defaultSuccessRate": 0.5, - "defaultBucketSize": 200, - "defaultHedgingPercent": 5, - "subLevelInputConfig": [ - { - "paymentMethodType": "upi", - "paymentMethod": "upi_collect", - "bucketSize": 250, - "hedgingPercent": 1 - } - ] - } + "name": "default-priority", + "description": "route to stripe first", + "created_by": "demo_merchant", + "algorithm_for": "payment", + "algorithm": { + "type": "priority", + "data": [ + { "gateway_name": "stripe", "gateway_id": null }, + { "gateway_name": "paypal", "gateway_id": null } + ] } }' ``` -#### Response: -```json -{ - "Success Rate Configuration updated successfully" -} -``` +## List Routing Rules -#### Request: Success Rate Config delete ```bash -curl -X POST http://localhost:8080/rule/delete \ - -H "Content-Type: application/json" \ - -d '{ - "merchant_id": "test_merchant_123423", - "algorithm": "successRate" - }' +curl -X POST "$BASE_URL/routing/list/demo_merchant" ``` -#### Response: -```json -{ - "Success Rate Configuration deleted successfully" -} -``` +## Activate Routing Rule -#### Request: Elimination Config Create ```bash -curl -X POST http://localhost:8080/rule/create \ +curl -X POST "$BASE_URL/routing/activate" \ -H "Content-Type: application/json" \ -d '{ - "merchant_id": "test_merchant_123423", - "config": { - "type": "elimination", - "data": { - "threshold": 0.35 - } - } + "created_by": "demo_merchant", + "routing_algorithm_id": "rule_id_here" }' ``` -#### Response: -```json -{ - "Elimination Configuration created successfully" -} -``` +## Get Active Routing Rule -#### Request: Elimination Config retrieve ```bash -curl -X POST http://localhost:8080/rule/get \ - -H "Content-Type: application/json" \ - -d '{ - "merchant_id": "test_merchant_123423", - "algorithm": "elimination" - }' +curl -X POST "$BASE_URL/routing/list/active/demo_merchant" ``` -#### Response: -```json -{ - "merchant_id": "test_merchant_123423", - "config": { - "type": "elimination", - "data": { - "threshold": 0.35 - } - } -} -``` +## Create Rule Config -#### Request: Elimination Config update ```bash -curl -X POST http://localhost:8080/rule/update \ +curl -X POST "$BASE_URL/rule/create" \ -H "Content-Type: application/json" \ -d '{ - "merchant_id": "test_merchant_123423", + "merchant_id": "demo_merchant", "config": { - "type": "elimination", + "type": "successRate", "data": { - "threshold": 0.35 + "defaultLatencyThreshold": 90, + "defaultSuccessRate": 0.5, + "defaultBucketSize": 200, + "defaultHedgingPercent": 5, + "subLevelInputConfig": [] } } }' ``` -#### Response: -```json -{ - "Elimination Configuration updated successfully" -} -``` - -#### Request: Elimination Config delete -```bash -curl -X POST http://localhost:8080/rule/delete \ - -H "Content-Type: application/json" \ - -d '{ - "merchant_id": "test_merchant_123423", - "algorithm": "elimination" - }' -``` - -#### Response: -```json -{ - "Elimination Configuration deleted successfully" -} -``` +## Get Rule Config -#### Request: Merchant account create ```bash -curl --location --request POST 'http://localhost:8080/merchant-account/create' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "merchant_id": "test_merchant_123423" -}' -``` - -#### Response: -```json -{ - "Merchant account created successfully" -} -``` - -#### Request: Merchant account retrieve -```bash -curl -X GET http://localhost:8080/merchant-account/test_merchant_123423 -``` - -#### Response: -```json -{ - "merchant_id": "test_merchant_123423", - "gateway_success_rate_based_decider_input": null -} -``` - -#### Request: Merchant account delete -```bash -curl -X DELETE http://localhost:8080/merchant-account/test_merchant_123423 -``` - -#### Response: -```json -{ - "Merchant account deleted successfully" -} -``` - -# Priority Logic V2 ---- - -**A rule engine to enable merchants to create complex logical expressions based on various payment related [parameters](https://github.com/juspay/decision-engine/blob/main/config/development.toml). These rules are executed on the payment payload to evaluate the gateway to be used.** - -## Table of Contents -1. [API Components](#components) -2. [API Reference](#PL-api-reference) -   2.1 [Create](#create) -   2.2 [Evaluate](#evaluate) -   2.3 [Operations](#operations) -    2.3.1 [List](#list) -    2.3.2 [Activate](#activate) -    2.3.e [List-Activated](#list_activated) -3. [Algorithm Types](#algorithm-types) -   3.1 Advanced Logic -     3.1.1 [AND](#and-rule) -     3.1.2 [OR](#or-rule) -     3.1.3 [AND-OR (Nested)](#and-or-rule) -     3.1.4 [Enum variant](#enum-variant) -     3.1.5 [Number array](#number-array) -     3.1.6 [Number comparison array](#number-comparison-array) -   3.2 [Priority](#priority) -   3.3 [Single Connector](#single) -   3.4 [Volume Split](#volume-split) - ---- - -## 1 · API Components - -| Components | Description & Accepted Values | -|------------------------------|----------------------------------------------------------------------------------------------------------------| -| `name` | Name of the rule (**string**, required) | -| `created_by` | Merchant or platform ID (**string**, required) | -| `description` | Rule description (**string**) | -| `algorithm_for` | Routing scope (**enum**): `payment` (default), `payout`, `three_ds_authentication` | -| `algorithm.type` | Routing algorithm type (**enum**): [`advanced`](#advanced), [`single`](#single), [`priority`](#priority), [`volume_split`](#volume-split) | -| `algorithm.data.globals` | Optional constants (**object**): reusable values for expressions | -| `default_selection` | Fallback connectors if no rule matches (**object**) with `priority: [{ gateway_name, gateway_id }]` | -| `rules[].name` | Name of an individual rule (**string**) | -| `rules[].routing_type` | Rule behavior (**enum**): `priority`, `volume_split`, Required only in advanced rule. | -| `output.priority[]` | Priority connector list (**array**): `[ { gateway_name, gateway_id } ]` | -| `output.volume_split[]` | Volume split rule (**array**): `[ { split: number, output: { gateway_name, gateway_id } } ]`, either priority or volume can be present at once in output. | -| `statements[].condition[]` | AND logic conditions (**array**): each with `lhs`, `comparison`, `value`, and optional `metadata` | -| `condition.lhs` | Field to evaluate (**string**): e.g., `amount`, `payment_method`, `card_network`. Can be checked from development.toml. | -| `condition.comparison` | Comparator (**enum**): `equal`, `greater_than`, `less_than`, `greater_than_equals`, etc. | -| `condition.value.type` | Value type (**enum**): `number`, [`number_array`](#number-array), [`enum_variant`](#enum-variant), `str_value`, [`number_comparison_array`](#number-comparison-array), etc. | -| `condition.value.value` | Value being compared (**any**): e.g., `100`, `"card"`, `[1000, 2000]` | -| `condition.metadata` | Optional metadata for tracing/debug (**object**) | -| `statements[].nested` | Nested OR conditions (**array**) of `condition[]` blocks | -| `algorithm.metadata` | Algorithm-level metadata (**object**, optional) | -| `rules[].metadata` | Rule-level metadata (**object**, optional) | - - -**Tip**: Use multiple `statements[]` blocks for OR logic. Use `nested` inside a `statement` for AND+OR nesting. - ---- - - -##
2 · API Reference - -### 2.1 Create Routing Algorithm - -```bash -curl --location 'http://127.0.0.1:8082/routing/create' \ ---header 'Content-Type: application/json' \ ---data ' -{ - "name": "Priority rule", - "created_by": "merchant_1234", - "description": "this is my priority rule", - "algorithm_for": "payment", - "algorithm": { - "type": "advanced", - "data": { - "globals": {}, - "default_selection": { - "priority": [ - { - "gateway_name": "stripe", - "gateway_id": "mca_111" - }, - { - "gateway_name": "adyen", - "gateway_id": "mca_112" - }, - { - "gateway_name": "checkout", - "gateway_id": "mca_113" - } - ] - }, - "rules": [ - { - "name": "Card Rule", - "routingType": "priority", - "output": { - "priority": [ - { - "gateway_name": "Paytm", - "gateway_id": "mca_114" - }, - { - "gateway_name": "adyen", - "gateway_id": "mca_112" - } - ] - }, - "statements": [ - { - "condition": [ - { - "lhs": "payment_method", - "comparison": "equal", - "value": { - "type": "enum_variant", - "value": "card" - }, - "metadata": {} - } - ] - }, - { - "condition": [ - { - "lhs": "amount", - "comparison": "greater_than", - "value": { - "type": "number", - "value": 100 - }, - "metadata": {} - } - ] - } - ] - } - ] - } - }, - "metadata": {} -} -' -``` - -**Success Response** -```json -{ - "rule_id": "routing_e641380c-6f24-4405-8454-5ae6cbceb7a0", - "name": "Priority rule", - "created_at": "2025-04-22 11:45:03.411134513", - "modified_at": "2025-04-22 11:45:03.411134513" -} -``` - ---- - -### 2.2 Evaluate Routing Algorithm - -```bash -curl --location 'http://127.0.0.1:8082/routing/evaluate' \ ---header 'Content-Type: application/json' \ ---data '{ - "created_by": "merchant_1234", - "parameters": { - "payment_method": { "type": "enum_variant", "value": "upi" }, - "amount": { "type": "number", "value": 10 } - } -}' -``` - -**Example Response** -```json -{ - "status": "default_selection", - "output": { - "type": "priority", - "connectors": [ - { "gateway_name": "stripe", "gateway_id": "mca_111" }, - { "gateway_name": "adyen", "gateway_id": "mca_112" }, - { "gateway_name": "checkout", "gateway_id": "mca_113" } - ] - }, - "evaluated_output": [ - { "gateway_name": "stripe", "gateway_id": "mca_111" } - ], - "eligible_connectors": [] -} -``` - ---- - -## 2.3 Operations - -### 2.3.1 List Algorithms - -```bash -curl --request POST 'http://127.0.0.1:8082/routing/list/merchant_1234' -``` - -Returns an array of algorithms for `merchant_1234`. - -### 2.3.2 Activate Algorithm - -```bash -curl --location 'http://127.0.0.1:8082/routing/activate' \ ---header 'Content-Type: application/json' \ ---data '{ - "created_by": "merchant_1234", - "routing_algorithm_id": "routing_8711ce52-33e2-473f-9c8f-91a406acb850" -}' +curl -X POST "$BASE_URL/rule/get" \ + -H "Content-Type: application/json" \ + -d '{ + "merchant_id": "demo_merchant", + "algorithm": "successRate" + }' ``` -At a given time one algorithm for each transaction_type (`payment`, `payout`, `three_ds_authentication`) can be active for one created_by id. -HTTP 200 ⇒ algorithm is now active. -### 2.3.3 List Activated algorithm +## Update Rule Config ```bash -curl --location --request POST 'http://127.0.0.1:8082/routing/list/active/merchant_31' \ ---header 'Content-Type: application/json' -``` - -Returns algorithms currently active for the merchant. - ---- - -## 3 · Algorithm Types - -### 3.1 Advanced Logic (AND / OR / AND-OR) - -| Use-case | Description | -|---------------------|--------------------------------------| -| **AND** | All conditions must be true | -| **OR** | Any one condition may be true | -| **AND-OR (nested)** | Parent condition + any nested match | - ---- -Note: for advanced algorithm kinds we always require statements to be evaluated upoun, unlike the below priority, single and volume_split, which donot requires any statements and directly provide output. -
-AND Rule - -```json -{ - "name": "HDFC Rule", - "routing_type": "volume_split", - "output": { - "volume_split": [ - { - "split": 60, - "output": { "gateway_name": "hdfc", "gateway_id": "mca_114" } - }, - { - "split": 40, - "output": { "gateway_name": "instamojo", "gateway_id": "mca_115" } +curl -X POST "$BASE_URL/rule/update" \ + -H "Content-Type: application/json" \ + -d '{ + "merchant_id": "demo_merchant", + "config": { + "type": "successRate", + "data": { + "defaultLatencyThreshold": 95, + "defaultSuccessRate": 0.5, + "defaultBucketSize": 250, + "defaultHedgingPercent": 5, + "subLevelInputConfig": [] } - ] - }, - "statements": [ - { - "condition": [ - { - "lhs": "amount", - "comparison": "greater_than", - "value": { "type": "number", "value": 100 } - }, - { - "lhs": "billing_country", - "comparison": "equal", - "value": { "type": "enum_variant", "value": "Netherlands" } - } - ] } - ] -} -``` - -All conditions must match → volume split applies -
- ---- - -
-OR Rule - -```json -{ - "name": "Card Rule", - "routing_type": "priority", - "output": { - "priority": [ - { "gateway_name": "Paytm", "gateway_id": "mca_114" }, - { "gateway_name": "adyen", "gateway_id": "mca_112" } - ] - }, - "statements": [ - { - "condition": [ - { - "lhs": "payment_method", - "comparison": "equal", - "value": { "type": "enum_variant", "value": "card" } - } - ] - }, - { - "condition": [ - { - "lhs": "amount", - "comparison": "greater_than", - "value": { "type": "number", "value": 100 } - } - ] - } - ] -} -``` - -Any one condition match triggers the rule -
- ---- - -
-AND + OR (Nested) - -```json -{ - "name": "RBL Rule", - "routing_type": "priority", - "output": { - "priority": [ - { "gateway_name": "rbl", "gateway_id": "mca_114" }, - { "gateway_name": "instamojo", "gateway_id": "mca_115" } - ] - }, - "statements": [ - { - "condition": [ - { - "lhs": "amount", - "comparison": "greater_than", - "value": { "type": "number", "value": 10 } - } - ], - "nested": [ - { - "condition": [ - { - "lhs": "card_network", - "comparison": "equal", - "value": { "type": "enum_variant", "value": "Visa" } - } - ] - }, - { - "condition": [ - { - "lhs": "billing_country", - "comparison": "equal", - "value": { "type": "enum_variant", "value": "India" } - } - ] - } - ] - } - ] -} -``` - -Main condition must match + any one nested condition -
- ---- - -
-Enum variant - -```json -{ - "name": "Card Rule", - "routing_type": "priority", - "output": { - "priority": [ - { - "gateway_name": "rbl", - "gateway_id": "mca_114" - } - ] - }, - "statements": [ - { - "condition": [ - { - "lhs": "card_network", - "comparison": "equal", - "value": { - "type": "enum_variant_array", - "value": [ - "Visa", - "Mastercard" - ] - }, - "metadata": {} - } - ] - } - ] -} -``` - -The input for evaluation parameter must be one of the mentioned types in array. -
- ---- - -
-Number array - -```json -{ - "name": "Card Rule", - "routing_type": "priority", - "output": { - "priority": [ - { - "gateway_name": "rbl", - "gateway_id": "mca_114" - } - ] - }, - "statements": [ - { - "condition": [ - { - "lhs": "amount", - "comparison": "equal", - "value": { - "type": "number_array", - "value": [ - 1000, - 2000, - 5000 - ] - }, - "metadata": {} - } - ] - } - ] -} -``` - -The input for evaluation parameter must be one of the mentioned values in array. -
- ---- -
-Number comparison array - -```json -{ - "name": "Card Rule", - "routing_type": "priority", - "output": { - "priority": [ - { - "gateway_name": "rbl", - "gateway_id": "mca_114" - } - ] - }, - "statements": [ - { - "condition": [ - { - "lhs": "amount", - "comparison": "equal", - "value": { - "type": "number_comparison_array", - "value": [ - { - "comparison_type": "greater_than", - "number": 1000 - }, - { - "comparison_type": "less_than_equal", - "number": 5000 - } - ] - }, - "metadata": {} - } - ] - } - ] -} -``` - -The input for evaluation parameter must be in the specified thresholds. -
- ---- - - -### 3.2 Priority Routing - -```bash -curl --location 'http://127.0.0.1:8082/routing/create' \ ---header 'Content-Type: application/json' \ ---data '{ - "name": "priority rule test", - "created_by": "merchant_123", - "algorithm": { - "type": "priority", - "data": [ - { "gateway_name": "stripe", "gateway_id": "mca_001" }, - { "gateway_name": "razorpay", "gateway_id": "mca_002" } - ] - } -}' -``` - -Always returns the connectors **in the given order**. - ---- - -### 3.3 Single Connector (straight-through) - -```bash -curl --location 'http://127.0.0.1:8082/routing/create' \ ---header 'Content-Type: application/json' \ ---data '{ - "name": "single connector rule", - "created_by": "merchant_123", - "algorithm": { - "type": "single", - "data": { "gateway_name": "stripe", "gateway_id": "mca_00123" } - } -}' + }' ``` -Regardless of parameters, Routing decision will always be **Stripe (mca_00123)**. - ---- - -### 3.4 Volume Split +## Delete Rule Config ```bash -curl --location 'http://127.0.0.1:8082/routing/create' \ ---header 'Content-Type: application/json' \ ---data '{ - "name": "volume split test rule", - "created_by": "merchant_31", - "algorithm_for": "payout", - "algorithm": { - "type": "volume_split", - "data": [ - { - "split": 70, - "output": { "gateway_name": "stripe", "gateway_id": "mca_001" } - }, - { - "split": 30, - "output": { "gateway_name": "paytm", "gateway_id": "mca_002" } - } - ] - } -}' +curl -X POST "$BASE_URL/rule/delete" \ + -H "Content-Type: application/json" \ + -d '{ + "merchant_id": "demo_merchant", + "algorithm": "successRate" + }' ``` - -Provides **70 %** of decisions as Stripe and **30 %** as Paytm. - ---- - -**Note:** Full routing rule example is provided in the [initial request section](#create). Use that as template to compose complex rules (AND / OR / AND-OR). - ---- diff --git a/docs/configuration.md b/docs/configuration.md index a78d1742..5ab4636f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,14 +1,60 @@ # Configuration Guide -This document explains how to configure Decision Engine for local and on-prem deployments. +This page describes the runtime configuration model used by Decision Engine. -## Primary Config Files +## How Configuration Is Loaded -- `config/development.toml`: host/source runs -- `config/docker-configuration.toml`: Docker/Compose runs -- `helm-charts/config/development.toml`: Kubernetes chart template config +The application loads config in this order: -## Core Sections +1. file selected by `APP_ENV` +2. environment overrides with the `DECISION_ENGINE__` prefix + +From `src/config.rs`: + +- `APP_ENV=dev` or unset -> `config/development.toml` +- `APP_ENV=sandbox` -> `config/sandbox.toml` +- `APP_ENV=production` -> `config/production.toml` + +Environment overrides use `__` as the separator. + +Example: + +```bash +DECISION_ENGINE__SERVER__PORT=8080 +DECISION_ENGINE__METRICS__PORT=9090 +``` + +## Primary Files + +- `config.example.toml`: sample config +- `config/development.toml`: source-run default +- `config/docker-configuration.toml`: Compose-mounted config +- `src/config.rs`: actual config structs and load rules + +For deployment behavior, also inspect: + +- `docker-compose.yaml` +- `helm-charts/templates/*` + +## Main Config Sections + +The runtime config model in `src/config.rs` includes: + +- `log` +- `server` +- `metrics` +- `database` or `pg_database` +- `redis` +- `cache_config` +- `tenant_secrets` +- `tls` +- `api_client` +- `routing_config` +- `pm_filters` +- `debit_routing_config` +- `compression_filepath` + +## Common Areas ### Server @@ -37,10 +83,10 @@ log_format = "default" ### Database -Use either MySQL or PostgreSQL as required by your deployment mode. +Use one backend path: -For Docker Compose profiles, connection details are pre-wired via service names and mounted config. -For source runs, ensure your database URL in config matches your local DB. +- MySQL via `[database]` +- PostgreSQL via `[pg_database]` ### Redis @@ -50,20 +96,23 @@ host = "127.0.0.1" port = 6379 ``` -### Secrets Manager +### TLS -`secrets_manager` controls encryption/key-management behavior. In local environments this is commonly set to `no_encryption`. +TLS is optional and configured through the `tls` section. -## Environment Overrides +### Tenant Config -Use environment variables to override selected runtime values when needed (for example in Helm via `extraEnvVars`). +Tenant-aware behavior is driven by `tenant_secrets` and tenant-specific app-state wiring in `src/tenant.rs`. -For deployment-specific examples, see: +## Deployment Notes -- [Local Setup Guide](local-setup.md) -- [Helm Chart README](../helm-charts/README.md) +- Source runs default to `config/development.toml` +- Compose mounts `config/docker-configuration.toml` at `/local/config/development.toml` +- Helm behavior should be verified against the chart templates directly ## Related Docs - [Local Setup Guide](local-setup.md) -- [API Reference](api-reference1.md) +- [PostgreSQL Setup Guide](setup-guide-postgres.md) +- [MySQL Setup Guide](setup-guide-mysql.md) +- [API Overview](api-reference.md) diff --git a/docs/dashboard.mdx b/docs/dashboard.mdx new file mode 100644 index 00000000..1bc3ec71 --- /dev/null +++ b/docs/dashboard.mdx @@ -0,0 +1,48 @@ +--- +title: "Dashboard" +description: "Local dashboard routes and how they are served" +--- + +## Availability + +The dashboard is available in the `dashboard-*` Docker Compose profiles. + +Example: + +```bash +docker compose --profile dashboard-postgres-ghcr up -d +``` + +Then open: + +- `http://localhost:8081/dashboard/` + +The dashboard is served by Nginx from the built assets in `website/dist`. + +## What It Includes + +Based on the React routes in `website/src/App.tsx`, the dashboard exposes: + +- `/dashboard/` +- `/dashboard/routing` +- `/dashboard/routing/sr` +- `/dashboard/routing/rules` +- `/dashboard/routing/volume` +- `/dashboard/routing/debit` +- `/dashboard/decisions` + +## Docs And API In The Same Profile + +The same `dashboard-*` profiles also expose: + +- Mintlify docs at `http://localhost:8081/introduction` +- the API at `http://localhost:8080` + +Proxy behavior is defined in `nginx/nginx.conf`. + +## Related Files + +- `website/src/App.tsx` +- `website/src/components/pages/*` +- `docker-compose.yaml` +- `nginx/nginx.conf` diff --git a/docs/dual-protocol-layer.md b/docs/dual-protocol-layer.md index 44dbf4dd..4aca7ff9 100644 --- a/docs/dual-protocol-layer.md +++ b/docs/dual-protocol-layer.md @@ -1,8 +1,48 @@ # Protocol Notes -Decision Engine exposes HTTP REST endpoints documented in [api-reference1.md](api-reference1.md). +This repository currently documents and ships the following public surfaces: -For local execution, deployment tracks, and integration flow, see: +## Main HTTP API -- [Local Setup Guide](local-setup.md) -- [Introduction](introduction.mdx) +Served by the main application server. + +Key endpoints include: + +- `GET /health` +- `POST /decide-gateway` +- `POST /update-gateway-score` +- `POST /merchant-account/create` +- `GET /merchant-account/{merchantId}` +- `DELETE /merchant-account/{merchantId}` +- `POST /routing/*` +- `POST /rule/*` + +Main server wiring lives in `src/app.rs`. + +## Health Variants + +The health router in `src/routes/health.rs` exposes: + +- `/health` +- `/health/ready` +- `/health/diagnostics` + +Use `/health` for basic liveness checks. + +## Metrics + +Metrics are served by a separate server built in `src/metrics.rs`. + +Default local metrics endpoint: + +- `http://localhost:9094/metrics` for source or compose runs that expose the metrics port directly + +## Dashboard And Docs Proxy + +In the `dashboard-*` compose profiles, Nginx serves: + +- the React dashboard at `/dashboard/` +- Mintlify docs pages such as `/introduction` +- proxied API traffic + +The proxy config lives in `nginx/nginx.conf`. diff --git a/docs/installation.md b/docs/installation.md index c5df66d1..f5a6433a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,11 +1,30 @@ # Installation Guide -The canonical installation and local run instructions are maintained in: +Use this page to choose the right installation path. For actual commands, use the linked guides. -- [Local Setup Guide](local-setup.md) +## Supported Paths -This includes: -- CLI build and run -- Docker image build and run -- Docker Compose GHCR vs local profile tracks -- Helm installation examples +| Path | Best for | Primary doc | +|------|----------|-------------| +| Docker Compose with published images | fastest local or on-prem style bring-up | [Local Setup Guide](local-setup.md) | +| Docker Compose with local builds | validating local source changes | [Local Setup Guide](local-setup.md) | +| Source build | backend debugging and feature-specific runs | [Local Setup Guide](local-setup.md) | +| Helm | Kubernetes and on-prem deployment work | [Local Setup Guide](local-setup.md) and `helm-charts/README.md` | + +## Database-Specific Shortcuts + +- PostgreSQL commands: [PostgreSQL Setup Guide](setup-guide-postgres.md) +- MySQL commands: [MySQL Setup Guide](setup-guide-mysql.md) + +## Dashboard And Docs + +If you want the React dashboard and Mintlify docs, use one of the `dashboard-*` compose profiles from [Local Setup Guide](local-setup.md). + +That exposes: + +- Dashboard: `http://localhost:8081/dashboard/` +- Docs: `http://localhost:8081/introduction` + +## Canonical Source + +Treat [Local Setup Guide](local-setup.md) as the canonical installation and startup document for this repository. diff --git a/docs/introduction.mdx b/docs/introduction.mdx index e6ccdbf9..0d121d13 100644 --- a/docs/introduction.mdx +++ b/docs/introduction.mdx @@ -1,90 +1,78 @@ --- title: "Decision Engine" -description: "Open-source payment gateway routing service by Juspay" +description: "Routing API, local run paths, dashboard, and docs entrypoints" --- -## What is Decision Engine? +## What It Is -Decision Engine is a real-time payment gateway routing service. Given a payment and a list of eligible gateways, it returns the **optimal gateway** to route to — using live success-rate scoring, rule-based logic, and automatic failure elimination. +Decision Engine is a Rust service that picks a gateway from an eligible list and records transaction outcomes for later routing decisions. -## How it works +The repository currently ships: -``` -Your Payment Orchestrator - ↓ -POST /decide-gateway ←── payment context + eligible gateways - ↓ -┌─────────────────────────────────────┐ -│ Filter Phase (25+ filters) │ -│ currency · card brand · auth type │ -│ EMI · payment method · surcharge │ -├─────────────────────────────────────┤ -│ Score Phase │ -│ success rate v3 · elimination │ -│ contract scores · outage detection │ -└─────────────────────────────────────┘ - ↓ -{ "decided_gateway": "stripe", ... } -``` +- the routing API +- merchant and routing configuration APIs +- Docker Compose profiles for local bring-up +- Helm chart assets +- a React dashboard under `/dashboard/` +- Mintlify docs served in the dashboard profiles -## Quick start +## Main API Surface -**1. Create a merchant** +The main endpoint groups are: -```bash -curl -X POST http://localhost:8080/merchant-account/create \ - -H "Content-Type: application/json" \ - -d '{"merchant_id": "my_merchant"}' -``` +- `GET /health` +- `POST /decide-gateway` +- `POST /update-gateway-score` +- `POST /merchant-account/create` +- `GET /merchant-account/{merchantId}` +- `DELETE /merchant-account/{merchantId}` +- `POST /routing/*` +- `POST /rule/*` -**2. Route a payment** +Use the OpenAPI-backed endpoint pages for request and response schemas. + +## Run Locally + +For API only: ```bash -curl -X POST http://localhost:8080/decide-gateway \ - -H "Content-Type: application/json" \ - -d '{ - "merchantId": "my_merchant", - "paymentInfo": { - "paymentId": "pay_001", - "amount": 1000.0, - "currency": "USD", - "paymentType": "ORDER_PAYMENT", - "paymentMethodType": "CARD", - "paymentMethod": "CREDIT" - }, - "eligibleGatewayList": ["stripe", "paypal", "adyen"], - "rankingAlgorithm": "SrBasedRouting", - "eliminationEnabled": false - }' +docker compose --profile postgres-ghcr up -d +curl http://localhost:8080/health ``` -**3. Record the outcome** +For API + dashboard + docs: ```bash -curl -X POST http://localhost:8080/update-gateway-score \ - -H "Content-Type: application/json" \ - -d '{ - "merchantId": "my_merchant", - "gateway": "stripe", - "paymentId": "pay_001", - "status": "CHARGED" - }' +docker compose --profile dashboard-postgres-ghcr up -d ``` -## Routing algorithms +URLs: -| Algorithm | Description | -|-----------|-------------| -| `SrBasedRouting` | Ranks gateways by real-time success rate. Default. | -| `PlBasedRouting` | Uses merchant-defined priority logic rules | -| `NtwBasedRouting` | Network-based routing for debit cards | +- API: `http://localhost:8080` +- Dashboard: `http://localhost:8081/dashboard/` +- Docs: `http://localhost:8081/introduction` -## Running locally +Use [Local Setup](local-setup) for the full Compose, source-build, and Helm matrix. -```bash -docker compose --profile dashboard-postgres-ghcr up -d -curl http://localhost:8080/health -# {"message":"Health is good"} -``` +## Dashboard Routes + +When the dashboard profile is running, the React app is available at: + +- `/dashboard/` +- `/dashboard/routing` +- `/dashboard/routing/sr` +- `/dashboard/routing/rules` +- `/dashboard/routing/volume` +- `/dashboard/routing/debit` +- `/dashboard/decisions` + +Use [Dashboard](dashboard) for route-by-route details. + +## Where To Go Next -**Dashboard**: http://localhost:8081/dashboard/ +- [Installation](installation) +- [Local Setup](local-setup) +- [Configuration](configuration) +- [Dashboard](dashboard) +- [API Overview](api-reference) +- [API Examples](api-reference1) diff --git a/docs/local-setup.md b/docs/local-setup.md index b9620172..d3f86c71 100644 --- a/docs/local-setup.md +++ b/docs/local-setup.md @@ -1,19 +1,6 @@ # Local Setup Guide -This is the canonical setup guide for running Decision Engine locally and for on-prem style validation. - -## Table of Contents - -- [Prerequisites](#prerequisites) -- [Image Strategy](#image-strategy) -- [Quick Start (Compose)](#quick-start-compose) -- [Docker Compose Profiles](#docker-compose-profiles) -- [Build and Run from CLI (Cargo)](#build-and-run-from-cli-cargo) -- [Build and Run with Docker (Without Compose)](#build-and-run-with-docker-without-compose) -- [Helm Chart Deployment](#helm-chart-deployment) -- [Verification](#verification) -- [Common Commands](#common-commands) -- [Troubleshooting](#troubleshooting) +This is the canonical local startup guide for Decision Engine. ## Prerequisites @@ -21,134 +8,114 @@ This is the canonical setup guide for running Decision Engine locally and for on - Docker Compose v2+ - Git 2+ -Optional for source builds: +Optional for source runs: + - Rust 1.85+ -- `just` (recommended) -- PostgreSQL/MySQL + Redis if running without Docker Compose +- `just` +- PostgreSQL or MySQL +- Redis -## Image Strategy +## Runtime Tracks -Decision Engine supports two deployment tracks: +Decision Engine supports two local tracks: -1. `ghcr` track (recommended for on-prem): pulls pinned images from GHCR. -2. `local` track: builds images from your current local source. +1. published-image track: pull existing images +2. local-build track: build images or binaries from the current source tree -Default pinned tags: +Default tags used in this repo: - `DECISION_ENGINE_TAG=v1.4` - `GROOVY_RUNNER_TAG=v1.4` -Override example: - -```bash -export DECISION_ENGINE_TAG=v1.4 -export GROOVY_RUNNER_TAG=v1.4 -``` - -## Quick Start (Compose) - -```bash -git clone https://github.com/juspay/decision-engine.git -cd decision-engine - -# On-prem style run: GHCR pinned image + PostgreSQL -docker compose --profile postgres-ghcr up -d -``` - -For dashboard + docs: - -```bash -docker compose --profile dashboard-postgres-ghcr up -d -``` - ## Docker Compose Profiles You must pass at least one profile. ### Core runtime profiles -| Profile | Image Source | DB | Includes | -|---|---|---|---| -| `postgres-ghcr` | GHCR | PostgreSQL | API + PostgreSQL + Redis + PG migrations | -| `postgres-local` | Local build | PostgreSQL | API + PostgreSQL + Redis + PG migrations | -| `mysql-ghcr` | GHCR | MySQL | API + MySQL + Redis + MySQL migrations + routing-config | -| `mysql-local` | Local build | MySQL | API + MySQL + Redis + MySQL migrations + routing-config | +| Profile | DB | Includes | +|---|---|---| +| `postgres-ghcr` | PostgreSQL | API + PostgreSQL + Redis + PG migrations | +| `postgres-local` | PostgreSQL | API + PostgreSQL + Redis + PG migrations | +| `mysql-ghcr` | MySQL | API + MySQL + Redis + MySQL migrations + routing-config | +| `mysql-local` | MySQL | API + MySQL + Redis + MySQL migrations + routing-config | ### Dashboard profiles -| Profile | Image Source | DB | Includes | -|---|---|---|---| -| `dashboard-postgres-ghcr` | GHCR | PostgreSQL | Core PG stack + Nginx dashboard + Mintlify docs | -| `dashboard-postgres-local` | Local build | PostgreSQL | Core PG stack + Nginx dashboard + Mintlify docs | -| `dashboard-mysql-ghcr` | GHCR | MySQL | Core MySQL stack + Nginx dashboard + Mintlify docs | -| `dashboard-mysql-local` | Local build | MySQL | Core MySQL stack + Nginx dashboard + Mintlify docs | +| Profile | DB | Includes | +|---|---|---| +| `dashboard-postgres-ghcr` | PostgreSQL | core PG stack + dashboard + Mintlify docs | +| `dashboard-postgres-local` | PostgreSQL | core PG stack + dashboard + Mintlify docs | +| `dashboard-mysql-ghcr` | MySQL | core MySQL stack + dashboard + Mintlify docs | +| `dashboard-mysql-local` | MySQL | core MySQL stack + dashboard + Mintlify docs | ### Optional profiles -| Profile | Description | +| Profile | Adds | |---|---| | `monitoring` | Prometheus + Grafana | -| `groovy-ghcr` | Groovy runner from GHCR (`GROOVY_RUNNER_TAG`) | -| `groovy-local` | Groovy runner built from local `groovy.Dockerfile` | +| `groovy-ghcr` | Groovy runner image | +| `groovy-local` | Groovy runner built from local source | -### Common combinations +## Fastest Bring-Up -```bash -# PostgreSQL (GHCR) + monitoring -docker compose --profile postgres-ghcr --profile monitoring up -d - -# PostgreSQL (local build) + dashboard + docs -docker compose --profile dashboard-postgres-local up -d --build +### API Only -# MySQL (GHCR) + dashboard + docs -docker compose --profile dashboard-mysql-ghcr up -d +```bash +docker compose --profile postgres-ghcr up -d ``` -## Build and Run from CLI (Cargo) - -### PostgreSQL build +### API + Dashboard + Docs ```bash -cargo build --release --no-default-features --features middleware,kms-aws,postgres +docker compose --profile dashboard-postgres-ghcr up -d ``` -Run migrations: +### With Monitoring ```bash -just migrate-pg +docker compose --profile postgres-ghcr --profile monitoring up -d ``` -Run service: +## Make Targets + +Common wrappers: ```bash -RUSTFLAGS="-Awarnings" cargo run --no-default-features --features postgres +make init-pg-ghcr +make init-pg-local +make init-mysql-ghcr +make init-mysql-local +make run-pg-ghcr +make run-mysql-local +make stop ``` -### MySQL build +## Source Build And Run + +### PostgreSQL ```bash -cargo build --release --features release +cargo build --release --no-default-features --features middleware,kms-aws,postgres +just migrate-pg +RUSTFLAGS="-Awarnings" cargo run --no-default-features --features postgres ``` -Run service: +### MySQL ```bash +cargo build --release --features release RUSTFLAGS="-Awarnings" cargo run --features release ``` -## Build and Run with Docker (Without Compose) - -### Build images locally +## Docker Builds Without Compose ```bash -# MySQL-target binary image docker build --platform=linux/amd64 -t decision-engine-mysql:local -f Dockerfile . - -# PostgreSQL-target binary image docker build --platform=linux/amd64 -t decision-engine-pg:local -f Dockerfile.postgres . ``` -### Run image +Example container run: ```bash docker run --platform=linux/amd64 \ @@ -157,35 +124,17 @@ docker run --platform=linux/amd64 \ decision-engine-pg:local ``` -## Helm Chart Deployment +## Helm Chart location: `helm-charts/` -### Install with defaults - ```bash cd helm-charts helm dependency build helm install my-release . ``` -### Pin GHCR tag explicitly - -```bash -helm install my-release . \ - --set image.repository=ghcr.io/juspay/decision-engine/postgres \ - --set image.version=v1.4 \ - --set image.pullPolicy=Always -``` - -### Use local/private registry image - -```bash -helm install my-release . \ - --set image.repository=/decision-engine/postgres \ - --set image.version= \ - --set image.pullPolicy=IfNotPresent -``` +For image overrides, use `image.repository`, `image.version`, and `image.pullPolicy`. Verify the rendered templates directly when troubleshooting chart behavior. ## Verification @@ -199,51 +148,35 @@ Expected response: {"message":"Health is good"} ``` -Dashboard/docs (if dashboard profile is used): +Dashboard profiles also expose: - Dashboard: `http://localhost:8081/dashboard/` - Docs: `http://localhost:8081/introduction` -## Common Commands - -Make targets are aligned to ghcr/local tracks: +Monitoring profile also exposes: -```bash -# GHCR tracks -make init-pg-ghcr -make init-mysql-ghcr - -# Local build tracks -make init-pg-local -make init-mysql-local - -# Run one API service (when infra is ready) -make run-pg-ghcr -make run-mysql-local - -# Stop everything -make stop -``` +- Prometheus: `http://localhost:9090` +- Grafana: `http://localhost:3000` ## Troubleshooting -### Port conflicts - -```bash -lsof -ti:8080 | xargs kill -9 -lsof -ti:8081 | xargs kill -9 -``` - -### Recreate stack with clean volumes +### Recreate a profile with clean volumes ```bash docker compose --profile postgres-ghcr down -v docker compose --profile postgres-ghcr up -d ``` -### Verify migration jobs +### Inspect migration jobs ```bash docker compose logs db-migrator-postgres docker compose logs db-migrator ``` + +### Common next files to inspect + +- `docker-compose.yaml` +- `config/docker-configuration.toml` +- `src/config.rs` +- `src/app.rs` diff --git a/docs/mint.json b/docs/mint.json index 408ae864..8cee4e83 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -21,7 +21,23 @@ "navigation": [ { "group": "Overview", - "pages": ["introduction"] + "pages": [ + "introduction", + "installation", + "local-setup", + "configuration", + "dashboard", + "api-reference", + "api-reference1", + "dual-protocol-layer" + ] + }, + { + "group": "Database Setup", + "pages": [ + "setup-guide-postgres", + "setup-guide-mysql" + ] }, { "group": "Health", @@ -29,15 +45,11 @@ }, { "group": "Gateway Decision", - "pages": [ - "api-reference/endpoint/decideGateway" - ] + "pages": ["api-reference/endpoint/decideGateway"] }, { "group": "Score Feedback", - "pages": [ - "api-reference/endpoint/updateGatewayScore" - ] + "pages": ["api-reference/endpoint/updateGatewayScore"] }, { "group": "Merchant Account", diff --git a/docs/openapi.json b/docs/openapi.json index 4c29ee3e..2b8d98d7 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Decision Engine", - "description": "Open-source payment gateway routing service by Juspay. Selects the optimal payment processor for each transaction in real-time using success-rate scoring, rule-based routing, and elimination logic.", + "description": "HTTP API for gateway decisions, score feedback, merchant configuration, and routing rule management.", "version": "1.2.1", "contact": { "name": "Juspay", @@ -359,15 +359,15 @@ } } }, - "/routing/list/{merchantId}": { + "/routing/list/{created_by}": { "post": { "operationId": "listRoutingRules", "tags": ["Routing Rules"], "summary": "List routing rules", - "description": "List all routing rules for a merchant.", + "description": "List all routing rules for a given `created_by` scope.", "parameters": [ { - "name": "merchantId", + "name": "created_by", "in": "path", "required": true, "schema": { "type": "string" }, diff --git a/docs/setup-guide-mysql.md b/docs/setup-guide-mysql.md index 0b113d04..cd3b051a 100644 --- a/docs/setup-guide-mysql.md +++ b/docs/setup-guide-mysql.md @@ -1,47 +1,55 @@ # MySQL Setup Guide -This page provides MySQL-focused commands. The full end-to-end setup (CLI, Docker, Compose, Helm) is in [local-setup.md](local-setup.md). +Use this page when the task is explicitly MySQL-specific. For the full local matrix, use [Local Setup Guide](local-setup.md). -## Docker Compose (GHCR track) +## Compose Commands + +### Published-image track ```bash export DECISION_ENGINE_TAG=v1.4 docker compose --profile mysql-ghcr up -d ``` -With dashboard + docs: +### Published-image track with dashboard + docs ```bash docker compose --profile dashboard-mysql-ghcr up -d ``` -## Docker Compose (Local build track) +### Local-build track ```bash docker compose --profile mysql-local up -d --build ``` -With dashboard + docs: +### Local-build track with dashboard + docs ```bash docker compose --profile dashboard-mysql-local up -d --build ``` -## Make targets +## Make Targets ```bash make init-mysql-ghcr make init-mysql-local ``` +## Source Run + +```bash +cargo build --release --features release +RUSTFLAGS="-Awarnings" cargo run --features release +``` + ## Verify ```bash curl http://localhost:8080/health ``` -Expected response: +Dashboard profiles also expose: -```json -{"message":"Health is good"} -``` +- `http://localhost:8081/dashboard/` +- `http://localhost:8081/introduction` diff --git a/docs/setup-guide-postgres.md b/docs/setup-guide-postgres.md index 13c14551..d6a47758 100644 --- a/docs/setup-guide-postgres.md +++ b/docs/setup-guide-postgres.md @@ -1,47 +1,56 @@ # PostgreSQL Setup Guide -This page provides PostgreSQL-focused commands. The full end-to-end setup (CLI, Docker, Compose, Helm) is in [local-setup.md](local-setup.md). +Use this page when the task is explicitly PostgreSQL-specific. For the complete local matrix, use [Local Setup Guide](local-setup.md). -## Docker Compose (GHCR track) +## Compose Commands + +### Published-image track ```bash export DECISION_ENGINE_TAG=v1.4 docker compose --profile postgres-ghcr up -d ``` -With dashboard + docs: +### Published-image track with dashboard + docs ```bash docker compose --profile dashboard-postgres-ghcr up -d ``` -## Docker Compose (Local build track) +### Local-build track ```bash docker compose --profile postgres-local up -d --build ``` -With dashboard + docs: +### Local-build track with dashboard + docs ```bash docker compose --profile dashboard-postgres-local up -d --build ``` -## Make targets +## Make Targets ```bash make init-pg-ghcr make init-pg-local ``` +## Source Run + +```bash +cargo build --release --no-default-features --features middleware,kms-aws,postgres +just migrate-pg +RUSTFLAGS="-Awarnings" cargo run --no-default-features --features postgres +``` + ## Verify ```bash curl http://localhost:8080/health ``` -Expected response: +Dashboard profiles also expose: -```json -{"message":"Health is good"} -``` +- `http://localhost:8081/dashboard/` +- `http://localhost:8081/introduction` diff --git a/docs/setup-guide.md b/docs/setup-guide.md index 90b30f7d..f0ce7bc8 100644 --- a/docs/setup-guide.md +++ b/docs/setup-guide.md @@ -1,11 +1,18 @@ # Setup Guide -This page has been consolidated. +Use this page as an index, not as the primary source. -Use the canonical guide: +## Canonical Guide - [Local Setup Guide](local-setup.md) -For database-specific walkthroughs: +## Database-Specific Guides + - [PostgreSQL Setup Guide](setup-guide-postgres.md) - [MySQL Setup Guide](setup-guide-mysql.md) + +## When To Use Which Page + +- full local bring-up, Compose profiles, source builds, and Helm: `local-setup.md` +- PostgreSQL-specific shortcuts: `setup-guide-postgres.md` +- MySQL-specific shortcuts: `setup-guide-mysql.md` From 685048e5cded6670a5f17ea597a85429832e28db Mon Sep 17 00:00:00 2001 From: Prajjwal kumar Date: Tue, 14 Apr 2026 10:43:21 +0530 Subject: [PATCH 82/95] docs: improve readme presentation --- README.md | 147 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 93 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 628e4f9c..96ed0288 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,43 @@ # Decision Engine -Decision Engine is a Rust service that selects a gateway from an eligible list and updates routing scores from transaction outcomes. +
-## What Exists In This Repository +Rust 1.85+ +AGPL v3 +PostgreSQL and MySQL +Docker Compose profiles +React dashboard -- HTTP APIs for: - - gateway selection: `/decide-gateway` - - score feedback: `/update-gateway-score` - - merchant account management: `/merchant-account/*` - - routing rule management: `/routing/*` - - rule configuration: `/rule/*` +Rust routing service for selecting a gateway from an eligible list and recording outcome feedback used by routing decisions. + +**[Quick Start](#quick-start)** • +**[Docs Map](#docs-map)** • +**[Dashboard](#dashboard--docs)** • +**[Development](#development-commands)** • +**[Contributing](#contributing)** + +
+ +## What Ships In This Repository + +- HTTP APIs for gateway selection, routing configuration, rule configuration, and merchant account configuration - PostgreSQL and MySQL runtime tracks -- Docker Compose profiles for API-only, dashboard + docs, and monitoring setups -- Helm chart assets under `helm-charts/` -- A React dashboard served at `/dashboard/` in the `dashboard-*` compose profiles -- Mintlify docs served alongside the dashboard in the `dashboard-*` compose profiles +- Docker Compose profiles for API-only, dashboard, docs, and monitoring flows +- Helm chart assets under [`helm-charts/`](helm-charts/) +- A React dashboard under [`website/`](website/) served at `/dashboard/` in the `dashboard-*` Compose profiles +- Mintlify docs under [`docs/`](docs/) served alongside the dashboard in the `dashboard-*` Compose profiles + +## Start Here + +| If you want to... | Open this first | +|---|---| +| Run the API locally | [`docs/local-setup.md`](docs/local-setup.md) | +| Understand configuration | [`docs/configuration.md`](docs/configuration.md) | +| Browse the API surface | [`docs/api-reference.md`](docs/api-reference.md) | +| Use ready-made curl flows | [`docs/api-reference1.md`](docs/api-reference1.md) | +| Inspect request and response schemas | [`docs/openapi.json`](docs/openapi.json) | +| Bring up the dashboard | [`docs/dashboard.mdx`](docs/dashboard.mdx) | +| Inspect Kubernetes/on-prem assets | [`helm-charts/`](helm-charts/) | ## Quick Start @@ -24,7 +47,6 @@ Decision Engine is a Rust service that selects a gateway from an eligible list a git clone https://github.com/juspay/decision-engine.git cd decision-engine docker compose --profile postgres-ghcr up -d - curl http://localhost:8080/health ``` @@ -46,40 +68,23 @@ Available URLs: - Dashboard: `http://localhost:8081/dashboard/` - Docs: `http://localhost:8081/introduction` -## Local Development Paths - -Use `docs/local-setup.md` as the canonical startup guide. - -Common options: - -- Published PostgreSQL image track: - `docker compose --profile postgres-ghcr up -d` -- Local PostgreSQL build track: - `docker compose --profile postgres-local up -d --build` -- Makefile wrappers: - `make init-pg-ghcr` - `make init-pg-local` -- PostgreSQL source build: - `cargo build --release --no-default-features --features middleware,kms-aws,postgres` -- PostgreSQL migration: - `just migrate-pg` - -## Documentation Map - -| File | Purpose | -|------|---------| -| `docs/local-setup.md` | Canonical local, Compose, source-run, and Helm guide | -| `docs/configuration.md` | Config files, env overrides, and runtime config model | -| `docs/dashboard.mdx` | Dashboard availability, routes, and local usage | -| `docs/api-reference.md` | API overview and endpoint families | -| `docs/api-reference1.md` | Curl examples and local smoke-test flows | -| `docs/openapi.json` | OpenAPI source used by Mintlify | -| `docs/setup-guide-postgres.md` | PostgreSQL-focused setup commands | -| `docs/setup-guide-mysql.md` | MySQL-focused setup commands | +For source builds, Helm installs, and MySQL-specific flows, use [`docs/local-setup.md`](docs/local-setup.md). -## Runtime Shape +## Docs Map + +| Path | What it is for | +|---|---| +| [`docs/introduction.mdx`](docs/introduction.mdx) | Product-level docs landing page | +| [`docs/local-setup.md`](docs/local-setup.md) | Canonical local, Compose, source-run, and Helm setup guide | +| [`docs/configuration.md`](docs/configuration.md) | Config files, env overrides, and runtime config model | +| [`docs/dashboard.mdx`](docs/dashboard.mdx) | Dashboard routes, availability, and serving model | +| [`docs/api-reference.md`](docs/api-reference.md) | API overview grouped by endpoint family | +| [`docs/api-reference1.md`](docs/api-reference1.md) | Local curl examples and smoke-test flows | +| [`docs/openapi.json`](docs/openapi.json) | OpenAPI source consumed by the docs site | +| [`docs/setup-guide-postgres.md`](docs/setup-guide-postgres.md) | PostgreSQL-focused setup commands | +| [`docs/setup-guide-mysql.md`](docs/setup-guide-mysql.md) | MySQL-focused setup commands | -At a high level: +## Runtime Shape ```text client or orchestrator @@ -88,24 +93,47 @@ client or orchestrator POST /decide-gateway | v -Decision Engine evaluates the request against merchant config, -routing rules, score data, and eligible gateways +Decision Engine evaluates eligible gateways against merchant config, +routing rules, and stored score data | v -response with the selected gateway and routing metadata +response with selected gateway and routing metadata ``` Related flows: -- `POST /update-gateway-score` feeds transaction outcomes back into scoring -- `POST /routing/*` manages routing algorithms -- `POST /rule/*` manages service-level routing configuration +- `POST /update-gateway-score` records transaction outcomes used by routing +- `POST /routing/*` manages routing algorithms and routing metadata +- `POST /rule/*` manages service-level rule configuration +- `POST /merchant-account/*` manages merchant account configuration + +## Dashboard & Docs + +When the `dashboard-*` Compose profiles are running, Nginx serves: + +- the React dashboard at `/dashboard/` +- Mintlify docs at `/introduction` +- built frontend assets from `website/dist` + +Documented dashboard routes include: + +- `/dashboard/` +- `/dashboard/routing` +- `/dashboard/routing/sr` +- `/dashboard/routing/rules` +- `/dashboard/routing/volume` +- `/dashboard/routing/debit` +- `/dashboard/decisions` + +See [`docs/dashboard.mdx`](docs/dashboard.mdx), [`website/src/App.tsx`](website/src/App.tsx), and [`nginx/nginx.conf`](nginx/nginx.conf). ## Development Commands ```bash -# lint and compile coverage +# lint just clippy + +# compile matrix checks just check # tests @@ -115,11 +143,22 @@ cargo test just migrate-pg ``` -CI-relevant compile matrix lives in `scripts/ci-checks.sh`. +CI-sensitive compile and lint coverage is driven by [`scripts/ci-checks.sh`](scripts/ci-checks.sh) and [`.github/workflows/`](.github/workflows/). + +## Repository Pointers + +- Runtime entrypoint: [`src/bin/open_router.rs`](src/bin/open_router.rs) +- Router and middleware wiring: [`src/app.rs`](src/app.rs) +- API handlers: [`src/routes/`](src/routes/) +- Config loading: [`src/config.rs`](src/config.rs) +- Tenant state wiring: [`src/tenant.rs`](src/tenant.rs) +- Frontend dashboard: [`website/`](website/) +- Local deployment topology: [`docker-compose.yaml`](docker-compose.yaml) +- Kubernetes assets: [`helm-charts/`](helm-charts/) ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution workflow and expectations. +See [`CONTRIBUTING.md`](CONTRIBUTING.md) for contribution workflow and expectations. ## License From 3d664d995829dcb53158c3d9ed72784abb768e2b Mon Sep 17 00:00:00 2001 From: Prajjwal kumar Date: Wed, 15 Apr 2026 15:47:33 +0530 Subject: [PATCH 83/95] analytics --- .gitignore | 2 + README.md | 6 + docs/dashboard.mdx | 2 + docs/introduction.mdx | 20 ++ docs/mint.json | 2 + oneclick.sh | 3 + src/app.rs | 1 + src/decider/gatewaydecider/flow_new.rs | 18 ++ src/decider/gatewaydecider/flows.rs | 18 ++ src/decider/gatewaydecider/types.rs | 12 + src/decider/gatewaydecider/utils.rs | 1 - src/feedback/gateway_scoring_service.rs | 30 +- src/lib.rs | 1 + src/metrics.rs | 21 ++ src/routes.rs | 1 + src/routes/decide_gateway.rs | 128 ++++++++- src/routes/decision_gateway.rs | 2 +- src/routes/update_gateway_score.rs | 45 +++ src/routes/update_score.rs | 36 +++ src/storage/schema.rs | 41 +++ src/storage/schema_pg.rs | 41 +++ website/dist/assets/index-BtfYF3zd.js | 328 ---------------------- website/dist/assets/index-_ClGteNY.css | 1 - website/dist/index.html | 4 +- website/src/App.tsx | 4 + website/src/components/layout/Sidebar.tsx | 4 + website/src/lib/api.ts | 7 +- website/src/types/api.ts | 199 +++++++++++++ website/vite.config.ts | 17 ++ 29 files changed, 656 insertions(+), 339 deletions(-) delete mode 100644 website/dist/assets/index-BtfYF3zd.js delete mode 100644 website/dist/assets/index-_ClGteNY.css diff --git a/.gitignore b/.gitignore index fa207feb..613469d1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ dump.rdb cypress/screenshots cypress/videos cypress/fixtures +# Added by code-review-graph +.code-review-graph/ diff --git a/README.md b/README.md index 96ed0288..936eb653 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Rust routing service for selecting a gateway from an eligible list and recording - Docker Compose profiles for API-only, dashboard, docs, and monitoring flows - Helm chart assets under [`helm-charts/`](helm-charts/) - A React dashboard under [`website/`](website/) served at `/dashboard/` in the `dashboard-*` Compose profiles +- An Analytics surface under `/analytics` in the dashboard - Mintlify docs under [`docs/`](docs/) served alongside the dashboard in the `dashboard-*` Compose profiles ## Start Here @@ -37,6 +38,7 @@ Rust routing service for selecting a gateway from an eligible list and recording | Use ready-made curl flows | [`docs/api-reference1.md`](docs/api-reference1.md) | | Inspect request and response schemas | [`docs/openapi.json`](docs/openapi.json) | | Bring up the dashboard | [`docs/dashboard.mdx`](docs/dashboard.mdx) | +| Inspect analytics | [`docs/analytics.mdx`](docs/analytics.mdx) | | Inspect Kubernetes/on-prem assets | [`helm-charts/`](helm-charts/) | ## Quick Start @@ -78,6 +80,8 @@ For source builds, Helm installs, and MySQL-specific flows, use [`docs/local-set | [`docs/local-setup.md`](docs/local-setup.md) | Canonical local, Compose, source-run, and Helm setup guide | | [`docs/configuration.md`](docs/configuration.md) | Config files, env overrides, and runtime config model | | [`docs/dashboard.mdx`](docs/dashboard.mdx) | Dashboard routes, availability, and serving model | +| [`docs/analytics.mdx`](docs/analytics.mdx) | Analytics page, data sources, and operator scope | +| [`docs/payment-audit.mdx`](docs/payment-audit.mdx) | Per-payment audit search and timeline view | | [`docs/api-reference.md`](docs/api-reference.md) | API overview grouped by endpoint family | | [`docs/api-reference1.md`](docs/api-reference1.md) | Local curl examples and smoke-test flows | | [`docs/openapi.json`](docs/openapi.json) | OpenAPI source consumed by the docs site | @@ -124,6 +128,8 @@ Documented dashboard routes include: - `/dashboard/routing/volume` - `/dashboard/routing/debit` - `/dashboard/decisions` +- `/dashboard/analytics` +- `/dashboard/audit` See [`docs/dashboard.mdx`](docs/dashboard.mdx), [`website/src/App.tsx`](website/src/App.tsx), and [`nginx/nginx.conf`](nginx/nginx.conf). diff --git a/docs/dashboard.mdx b/docs/dashboard.mdx index 1bc3ec71..91b6a953 100644 --- a/docs/dashboard.mdx +++ b/docs/dashboard.mdx @@ -30,6 +30,8 @@ Based on the React routes in `website/src/App.tsx`, the dashboard exposes: - `/dashboard/routing/volume` - `/dashboard/routing/debit` - `/dashboard/decisions` +- `/dashboard/analytics` +- `/dashboard/audit` ## Docs And API In The Same Profile diff --git a/docs/introduction.mdx b/docs/introduction.mdx index 0d121d13..210e7680 100644 --- a/docs/introduction.mdx +++ b/docs/introduction.mdx @@ -3,6 +3,22 @@ title: "Decision Engine" description: "Routing API, local run paths, dashboard, and docs entrypoints" --- +
+ + + Juspay Decision Engine + +

+ Juspay Decision Engine +
+ Routing infrastructure docs for setup, operations, analytics, and API usage. +

+
+ ## What It Is Decision Engine is a Rust service that picks a gateway from an eligible list and records transaction outcomes for later routing decisions. @@ -14,6 +30,7 @@ The repository currently ships: - Docker Compose profiles for local bring-up - Helm chart assets - a React dashboard under `/dashboard/` +- an Analytics surface under `/analytics` - Mintlify docs served in the dashboard profiles ## Main API Surface @@ -28,6 +45,7 @@ The main endpoint groups are: - `DELETE /merchant-account/{merchantId}` - `POST /routing/*` - `POST /rule/*` +- `GET /analytics/*` Use the OpenAPI-backed endpoint pages for request and response schemas. @@ -65,6 +83,7 @@ When the dashboard profile is running, the React app is available at: - `/dashboard/routing/volume` - `/dashboard/routing/debit` - `/dashboard/decisions` +- `/dashboard/analytics` Use [Dashboard](dashboard) for route-by-route details. @@ -74,5 +93,6 @@ Use [Dashboard](dashboard) for route-by-route details. - [Local Setup](local-setup) - [Configuration](configuration) - [Dashboard](dashboard) +- [Analytics](analytics) - [API Overview](api-reference) - [API Examples](api-reference1) diff --git a/docs/mint.json b/docs/mint.json index 8cee4e83..389fccc4 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -27,6 +27,8 @@ "local-setup", "configuration", "dashboard", + "analytics", + "payment-audit", "api-reference", "api-reference1", "dual-protocol-layer" diff --git a/oneclick.sh b/oneclick.sh index 9f5cf28f..02019cf0 100755 --- a/oneclick.sh +++ b/oneclick.sh @@ -79,6 +79,9 @@ trap cleanup SIGINT SIGTERM check_and_kill_ports +echo "Running Postgres migrations..." +just migrate-pg + echo "Starting Decision Engine server..." cargo run --no-default-features --features postgres & SERVER_PID=$! diff --git a/src/app.rs b/src/app.rs index 28fc50ee..a2b31ace 100644 --- a/src/app.rs +++ b/src/app.rs @@ -271,6 +271,7 @@ where "/update-gateway-score", post(routes::update_gateway_score::update_gateway_score), ); + let router = router.nest("/analytics", routes::analytics::serve()); let middleware = ServiceBuilder::new() .layer(middleware::from_fn(ensure_request_id)) diff --git a/src/decider/gatewaydecider/flow_new.rs b/src/decider/gatewaydecider/flow_new.rs index 55ad61bd..2795293d 100644 --- a/src/decider/gatewaydecider/flow_new.rs +++ b/src/decider/gatewaydecider/flow_new.rs @@ -434,6 +434,24 @@ pub async fn run_decider_flow( ¤tGatewayScoreMap, decider_flow.writer.gwDeciderApproach.clone(), ); + if let Some(rule_name) = updatedPriorityLogicOutput.priority_logic_tag.clone() { + crate::analytics::record_rule_hit_event( + Some(crate::types::merchant::id::merchant_id_to_text( + deciderParams.dpMerchantAccount.merchantId.clone(), + )), + rule_name, + decidedGateway.clone(), + Some(format!("{:?}", finalDeciderApproach.clone())), + serde_json::to_string(&serde_json::json!({ + "functional_gateways": uniqueFunctionalGateways.clone(), + "experiment_tag": experimentTag.clone(), + })) + .ok(), + Some(deciderParams.dpTxnDetail.txnUuid.clone()), + decider_flow.logger.get("x-request-id").cloned(), + Some("rule_applied".to_string()), + ); + } Utils::log_gateway_decider_approach( &mut decider_flow, decidedGateway.clone(), diff --git a/src/decider/gatewaydecider/flows.rs b/src/decider/gatewaydecider/flows.rs index 9850f59b..49123a13 100644 --- a/src/decider/gatewaydecider/flows.rs +++ b/src/decider/gatewaydecider/flows.rs @@ -605,6 +605,24 @@ pub async fn run_decider_flow( ¤tGatewayScoreMap, decider_flow.writer.gwDeciderApproach.clone(), ); + if let Some(rule_name) = updatedPriorityLogicOutput.priority_logic_tag.clone() { + crate::analytics::record_rule_hit_event( + Some(crate::types::merchant::id::merchant_id_to_text( + deciderParams.dpMerchantAccount.merchantId.clone(), + )), + rule_name, + decidedGateway.clone(), + Some(format!("{:?}", finalDeciderApproach.clone())), + serde_json::to_string(&serde_json::json!({ + "functional_gateways": uniqueFunctionalGateways.clone(), + "experiment_tag": experimentTag.clone(), + })) + .ok(), + Some(deciderParams.dpTxnDetail.txnUuid.clone()), + decider_flow.logger.get("x-request-id").cloned(), + Some("rule_applied".to_string()), + ); + } Utils::log_gateway_decider_approach( &mut decider_flow, decidedGateway.clone(), diff --git a/src/decider/gatewaydecider/types.rs b/src/decider/gatewaydecider/types.rs index 6b98af82..1c484b83 100644 --- a/src/decider/gatewaydecider/types.rs +++ b/src/decider/gatewaydecider/types.rs @@ -991,6 +991,18 @@ pub struct PaymentInfo { // write a function to transfer DomainDeciderRequestForApiCallV2 to DomainDeciderRequest impl DomainDeciderRequestForApiCallV2 { + pub fn payment_id(&self) -> &str { + &self.payment_info.payment_id + } + + pub fn payment_method_type(&self) -> &str { + &self.payment_info.payment_method_type + } + + pub fn payment_method(&self) -> &str { + &self.payment_info.payment_method + } + pub async fn to_domain_decider_request(&self) -> DomainDeciderRequest { DomainDeciderRequest { orderReference: ETO::Order { diff --git a/src/decider/gatewaydecider/utils.rs b/src/decider/gatewaydecider/utils.rs index 4d58537f..86d0c254 100644 --- a/src/decider/gatewaydecider/utils.rs +++ b/src/decider/gatewaydecider/utils.rs @@ -812,7 +812,6 @@ pub async fn log_gateway_decider_approach( let x_req_id = decider_flow.logger.get("x-request-id").cloned(); let txn_creation_time = txn_detail.dateCreated.to_string(); // Assuming dateCreated is a DateTime field let consume_from_router = decider_flow.get().dpShouldConsumeResult; - let mp = types::DeciderApproachLogData { decided_gateway: m_decided_gateway, routing_approach: gateway_decider_approach, diff --git a/src/feedback/gateway_scoring_service.rs b/src/feedback/gateway_scoring_service.rs index b4d19ffb..1cda05b9 100644 --- a/src/feedback/gateway_scoring_service.rs +++ b/src/feedback/gateway_scoring_service.rs @@ -674,7 +674,7 @@ pub async fn update_gateway_score( get_metric_entry_data( merchant_id_str, pmt_str, - m_source_object, + m_source_object.clone(), txn_obj_type_str, card_type_str, false, @@ -694,7 +694,7 @@ pub async fn update_gateway_score( get_metric_entry_data( merchant_id_str, pmt_str, - m_source_object, + m_source_object.clone(), txn_obj_type_str, card_type_str, gateway_scoring_data.isGriEnabledForElimination, @@ -710,10 +710,34 @@ pub async fn update_gateway_score( gateway_scoring_type.clone(), mer_acc.clone(), txn_latency.clone(), - m_metric_entry, + m_metric_entry.clone(), ) .await; + if let Some(metric_entry) = m_metric_entry.clone() { + crate::analytics::record_score_snapshot_event( + Some(MID::merchant_id_to_text(txn_detail.clone().merchantId)), + Some(txn_card_info.paymentMethodType.to_string()), + Some(m_source_object.clone().unwrap_or_default()), + txn_detail.gateway.clone().or(gateway_reference_id.clone()), + Some(metric_entry.success_rate.into()), + Some(metric_entry.sigma_factor.into()), + Some(metric_entry.average_latency.into()), + Some(metric_entry.tp99_latency.into()), + Some(metric_entry.n_value as i64), + "update_gateway_score", + serde_json::to_string(&serde_json::json!({ + "routing_approach": format!("{:?}", routing_approach), + "gateway_scoring_type": format!("{:?}", gateway_scoring_type), + "message": "Gateway score updated successfully", + })) + .ok(), + Some(txn_detail.txnUuid.clone()), + None, + Some("score_updated".to_string()), + ); + } + if should_update_srv3_gateway_score && should_isolate_srv3_producer && should_update_explore_txn diff --git a/src/lib.rs b/src/lib.rs index cfd92378..87169512 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,7 @@ #![allow(clippy::single_match)] #![allow(clippy::manual_ok_err)] +pub mod analytics; pub mod api_client; pub mod app; pub mod config; diff --git a/src/metrics.rs b/src/metrics.rs index c49ddcda..ec142985 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -28,6 +28,27 @@ lazy_static! { &["endpoint"], exponential_buckets(0.0005, 2.0, 10).unwrap() ).unwrap(); + + /// Count of routing decisions grouped by routing approach and result status + pub static ref ROUTING_DECISION_COUNTER: IntCounterVec = register_int_counter_vec!( + "routing_decisions_total", + "Count of routing decisions grouped by routing approach and result status", + &["approach", "status"] + ).unwrap(); + + /// Count of priority logic rule hits grouped by rule name + pub static ref ROUTING_RULE_HIT_COUNTER: IntCounterVec = register_int_counter_vec!( + "routing_rule_hits_total", + "Count of priority logic rule hits grouped by rule name", + &["rule_name"] + ).unwrap(); + + /// Count of analytics events captured by type + pub static ref ANALYTICS_EVENT_COUNTER: IntCounterVec = register_int_counter_vec!( + "analytics_events_total", + "Count of analytics events captured by type", + &["event_type"] + ).unwrap(); } pub async fn metrics_handler() -> error_stack::Result { diff --git a/src/routes.rs b/src/routes.rs index d7a8bf25..484b138d 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -1,5 +1,6 @@ pub mod hybrid_routing; // pub mod data; +pub mod analytics; pub mod decide_gateway; pub mod decision_gateway; pub mod health; diff --git a/src/routes/decide_gateway.rs b/src/routes/decide_gateway.rs index ae2c0f85..1a00ed67 100644 --- a/src/routes/decide_gateway.rs +++ b/src/routes/decide_gateway.rs @@ -45,7 +45,12 @@ pub async fn decide_gateway( .with_label_values(&["decide_gateway"]) .inc(); - let headers = req.headers(); + let headers = req.headers().clone(); + let x_request_id = headers + .get("x-request-id") + .and_then(|value| value.to_str().ok()) + .unwrap_or("unknown") + .to_string(); for (name, value) in headers.iter() { logger::debug!(tag = "DecideGateway", "Header: {}: {:?}", name, value); } @@ -56,6 +61,31 @@ pub async fn decide_gateway( } Err(e) => { logger::debug!(tag = "DecideGateway", "Error: {:?}", e); + crate::analytics::record_error_event( + "decide_gateway", + None, + None, + Some(x_request_id.clone()), + None, + None, + "400".to_string(), + "Error parsing request".to_string(), + serde_json::to_string(&serde_json::json!({ + "request_id": x_request_id, + "response": { + "status": "400", + "error_code": "400", + "error_message": "Error parsing request", + "error_info": { + "code": "INVALID_INPUT", + "user_message": "Invalid request params. Please verify your input.", + "developer_message": e.to_string(), + } + } + })) + .ok(), + Some("request_parse_failed".to_string()), + ); metrics::API_REQUEST_COUNTER .with_label_values(&["decide_gateway", "failure"]) .inc(); @@ -80,8 +110,39 @@ pub async fn decide_gateway( let api_decider_request: Result = serde_json::from_slice(&body); let result = match api_decider_request { - Ok(payload) => match decider_full_payload_hs_function(payload, cpu_start).await { + Ok(payload) => match decider_full_payload_hs_function(payload.clone(), cpu_start).await { Ok(decided_gateway) => { + let routing_approach = serde_json::to_string(&decided_gateway.routing_approach) + .unwrap_or_else(|_| format!("{:?}", decided_gateway.routing_approach)) + .trim_matches('"') + .to_string(); + + crate::analytics::record_decision_event( + Some(payload.merchant_id.clone()), + Some(routing_approach), + Some(decided_gateway.decided_gateway.clone()), + Some("success".to_string()), + "decide_gateway", + decided_gateway.priority_logic_tag.clone(), + serde_json::to_string(&serde_json::json!({ + "request": &payload, + "response": &decided_gateway, + "score_context": decided_gateway.gateway_priority_map.clone(), + "selection_reason": { + "decided_gateway": decided_gateway.decided_gateway.clone(), + "routing_approach": decided_gateway.routing_approach.clone(), + "gateway_before_evaluation": decided_gateway.gateway_before_evaluation.clone(), + "priority_logic_tag": decided_gateway.priority_logic_tag.clone(), + "reset_approach": decided_gateway.reset_approach.clone(), + } + })) + .ok(), + Some(payload.payment_id().to_string()), + Some(x_request_id.clone()), + Some("gateway_decided".to_string()), + Some(payload.payment_method_type().to_string()), + Some(payload.payment_method().to_string()), + ); metrics::API_REQUEST_COUNTER .with_label_values(&["decide_gateway", "success"]) .inc(); @@ -89,6 +150,43 @@ pub async fn decide_gateway( } Err(e) => { logger::debug!(tag = "DecideGateway", "Error: {:?}", e); + crate::analytics::record_error_event( + "decide_gateway", + Some(payload.merchant_id.clone()), + Some(payload.payment_id().to_string()), + Some(x_request_id.clone()), + None, + e.routing_approach.clone().map(|approach| { + serde_json::to_string(&approach) + .unwrap_or_else(|_| format!("{:?}", approach)) + .trim_matches('"') + .to_string() + }), + e.error_code.clone(), + e.error_message.clone(), + serde_json::to_string(&serde_json::json!({ + "request_id": x_request_id, + "request": &payload, + "routing_approach": e.routing_approach.clone(), + "response": { + "status": e.status.clone(), + "error_code": e.error_code.clone(), + "error_message": e.error_message.clone(), + "priority_logic_tag": e.priority_logic_tag.clone(), + "routing_approach": e.routing_approach.clone(), + "filter_wise_gateways": e.filter_wise_gateways.clone(), + "priority_logic_output": e.priority_logic_output.clone(), + "is_dynamic_mga_enabled": e.is_dynamic_mga_enabled, + "error_info": { + "code": e.error_info.code.clone(), + "user_message": e.error_info.user_message.clone(), + "developer_message": e.error_info.developer_message.clone(), + } + } + })) + .ok(), + Some("request_failed".to_string()), + ); metrics::API_REQUEST_COUNTER .with_label_values(&["decide_gateway", "failure"]) .inc(); @@ -97,6 +195,32 @@ pub async fn decide_gateway( }, Err(e) => { logger::debug!(tag = "DecideGateway", "Error: {:?}", e); + crate::analytics::record_error_event( + "decide_gateway", + None, + None, + Some(x_request_id.clone()), + None, + None, + "400".to_string(), + "Error parsing request".to_string(), + serde_json::to_string(&serde_json::json!({ + "request_id": x_request_id, + "raw_request": String::from_utf8_lossy(&body).to_string(), + "response": { + "status": "400", + "error_code": "400", + "error_message": "Error parsing request", + "error_info": { + "code": "INVALID_INPUT", + "user_message": "Invalid request params. Please verify your input.", + "developer_message": e.to_string(), + } + } + })) + .ok(), + Some("request_parse_failed".to_string()), + ); metrics::API_REQUEST_COUNTER .with_label_values(&["decide_gateway", "failure"]) .inc(); diff --git a/src/routes/decision_gateway.rs b/src/routes/decision_gateway.rs index 586a2927..4a2b18c2 100644 --- a/src/routes/decision_gateway.rs +++ b/src/routes/decision_gateway.rs @@ -185,7 +185,6 @@ where filter_list, latency: Some(cpu_time), }; - // Serialize response body and headers for logging let res_body = serde_json::to_string(&response).unwrap_or("{}".to_string()); // let res_headers = r#"{"Content-Type": "application/json"}"#; @@ -223,6 +222,7 @@ where Err(e) => { let latency = start_time.elapsed().as_millis() as u64; let cpu_time = cpu_start.elapsed().as_millis() as u64; + logger::error!( url = original_url, method = "POST", diff --git a/src/routes/update_gateway_score.rs b/src/routes/update_gateway_score.rs index 2d745329..18cfe21f 100644 --- a/src/routes/update_gateway_score.rs +++ b/src/routes/update_gateway_score.rs @@ -31,6 +31,11 @@ use axum::extract::Json; pub async fn update_gateway_score( req: axum::http::Request, ) -> Result, ErrorResponse> { + let x_request_id = req + .headers() + .get("x-request-id") + .and_then(|value| value.to_str().ok()) + .map(str::to_string); let timer = API_LATENCY_HISTOGRAM .with_label_values(&["update_gateway_score"]) .start_timer(); @@ -50,6 +55,18 @@ pub async fn update_gateway_score( } Err(e) => { crate::logger::debug!(tag = "UpdateGatewayScore", "Error: {:?}", e); + crate::analytics::record_error_event( + "update_gateway_score", + None, + None, + None, + None, + x_request_id.clone(), + "400".to_string(), + "Error parsing request".to_string(), + Some("request body parse failure".to_string()), + Some("request_parse_failed".to_string()), + ); API_REQUEST_COUNTER .with_label_values(&["update_gateway_score", "failure"]) .inc(); @@ -96,6 +113,22 @@ pub async fn update_gateway_score( API_REQUEST_COUNTER .with_label_values(&["update_gateway_score", "failure"]) .inc(); + crate::analytics::record_error_event( + "update_gateway_score", + Some(merchant_id.clone()), + Some(payment_id.clone()), + x_request_id.clone(), + Some(gateway.clone()), + None, + e.error_code.clone(), + e.error_message.clone(), + serde_json::to_string(&serde_json::json!({ + "payment_id": payment_id, + "request_id": x_request_id, + })) + .ok(), + Some("score_update_failed".to_string()), + ); timer.observe_duration(); println!("Error: {:?}", e); Err(e) @@ -104,6 +137,18 @@ pub async fn update_gateway_score( } Err(e) => { crate::logger::debug!(tag = "UpdateScoreRequest", "Error: {:?}", e); + crate::analytics::record_error_event( + "update_gateway_score", + None, + None, + None, + None, + x_request_id.clone(), + "400".to_string(), + "Error parsing request".to_string(), + Some("request body parse failure".to_string()), + Some("request_parse_failed".to_string()), + ); API_REQUEST_COUNTER .with_label_values(&["update_gateway_score", "failure"]) .inc(); diff --git a/src/routes/update_score.rs b/src/routes/update_score.rs index 2c005cfe..82622234 100644 --- a/src/routes/update_score.rs +++ b/src/routes/update_score.rs @@ -84,6 +84,24 @@ pub async fn update_score( // Log the error let latency = start_time.elapsed().as_millis() as u64; let cpu_time = cpu_start.elapsed().as_millis() as u64; + + crate::analytics::record_error_event( + "update_score", + None, + None, + None, + None, + Some(x_request_id.to_string()), + error_response.error_code.clone(), + error_response.error_message.clone(), + serde_json::to_string(&serde_json::json!({ + "request_id": x_request_id, + "query_params": query_params, + })) + .ok(), + Some("request_parse_failed".to_string()), + ); + logger::error!( url = original_url, method = "POST", @@ -140,6 +158,24 @@ pub async fn update_score( // Log the error let latency = start_time.elapsed().as_millis() as u64; let cpu_time = cpu_start.elapsed().as_millis() as u64; + + crate::analytics::record_error_event( + "update_score", + Some(merchant_id_txt.clone()), + None, + None, + None, + Some(x_request_id.to_string()), + error_response.error_code.clone(), + error_response.error_message.clone(), + serde_json::to_string(&serde_json::json!({ + "request_id": x_request_id, + "reason": "gateway_missing", + })) + .ok(), + Some("validation_failed".to_string()), + ); + logger::error!( url = original_url, method = "POST", diff --git a/src/storage/schema.rs b/src/storage/schema.rs index c021cb28..19fdf6c8 100644 --- a/src/storage/schema.rs +++ b/src/storage/schema.rs @@ -520,6 +520,46 @@ diesel::table! { } } +diesel::table! { + analytics_event (id) { + id -> Int4, + #[max_length = 64] + event_type -> Varchar, + #[max_length = 255] + merchant_id -> Nullable, + #[max_length = 255] + payment_id -> Nullable, + #[max_length = 255] + request_id -> Nullable, + #[max_length = 255] + payment_method_type -> Nullable, + #[max_length = 255] + payment_method -> Nullable, + #[max_length = 255] + gateway -> Nullable, + #[max_length = 128] + event_stage -> Nullable, + #[max_length = 128] + routing_approach -> Nullable, + #[max_length = 255] + rule_name -> Nullable, + #[max_length = 64] + status -> Nullable, + #[max_length = 64] + error_code -> Nullable, + error_message -> Nullable, + score_value -> Nullable, + sigma_factor -> Nullable, + average_latency -> Nullable, + tp99_latency -> Nullable, + transaction_count -> Nullable, + #[max_length = 128] + route -> Nullable, + details -> Nullable, + created_at_ms -> Bigint, + } +} + diesel::allow_tables_to_appear_in_same_query!( card_brand_routes, card_info, @@ -541,6 +581,7 @@ diesel::allow_tables_to_appear_in_same_query!( merchant_gateway_payment_method_flow, merchant_iframe_preferences, merchant_priority_logic, + analytics_event, payment_method, service_configuration, tenant_config, diff --git a/src/storage/schema_pg.rs b/src/storage/schema_pg.rs index 10307faa..5a58db46 100644 --- a/src/storage/schema_pg.rs +++ b/src/storage/schema_pg.rs @@ -1,5 +1,45 @@ // @generated automatically by Diesel CLI. +diesel::table! { + analytics_event (id) { + id -> Int4, + #[max_length = 64] + event_type -> Varchar, + #[max_length = 255] + merchant_id -> Nullable, + #[max_length = 255] + payment_method_type -> Nullable, + #[max_length = 255] + payment_method -> Nullable, + #[max_length = 255] + gateway -> Nullable, + #[max_length = 128] + routing_approach -> Nullable, + #[max_length = 255] + rule_name -> Nullable, + #[max_length = 64] + status -> Nullable, + #[max_length = 64] + error_code -> Nullable, + error_message -> Nullable, + score_value -> Nullable, + sigma_factor -> Nullable, + average_latency -> Nullable, + tp99_latency -> Nullable, + transaction_count -> Nullable, + #[max_length = 128] + route -> Nullable, + details -> Nullable, + created_at_ms -> Int8, + #[max_length = 255] + payment_id -> Nullable, + #[max_length = 255] + request_id -> Nullable, + #[max_length = 128] + event_stage -> Nullable, + } +} + diesel::table! { card_brand_routes (id) { id -> Int8, @@ -514,6 +554,7 @@ diesel::table! { } diesel::allow_tables_to_appear_in_same_query!( + analytics_event, card_brand_routes, card_info, co_badged_cards_info_test, diff --git a/website/dist/assets/index-BtfYF3zd.js b/website/dist/assets/index-BtfYF3zd.js deleted file mode 100644 index 5e8dd83b..00000000 --- a/website/dist/assets/index-BtfYF3zd.js +++ /dev/null @@ -1,328 +0,0 @@ -var kT=Object.defineProperty;var ET=(e,t,r)=>t in e?kT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ub=(e,t,r)=>ET(e,typeof t!="symbol"?t+"":t,r);function PT(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var gc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vj={exports:{}},rp={},yj={exports:{}},Ne={};/** - * @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 Qu=Symbol.for("react.element"),CT=Symbol.for("react.portal"),TT=Symbol.for("react.fragment"),NT=Symbol.for("react.strict_mode"),$T=Symbol.for("react.profiler"),RT=Symbol.for("react.provider"),IT=Symbol.for("react.context"),MT=Symbol.for("react.forward_ref"),DT=Symbol.for("react.suspense"),LT=Symbol.for("react.memo"),BT=Symbol.for("react.lazy"),cb=Symbol.iterator;function FT(e){return e===null||typeof e!="object"?null:(e=cb&&e[cb]||e["@@iterator"],typeof e=="function"?e:null)}var gj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xj=Object.assign,bj={};function Ss(e,t,r){this.props=e,this.context=t,this.refs=bj,this.updater=r||gj}Ss.prototype.isReactComponent={};Ss.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ss.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wj(){}wj.prototype=Ss.prototype;function Kg(e,t,r){this.props=e,this.context=t,this.refs=bj,this.updater=r||gj}var qg=Kg.prototype=new wj;qg.constructor=Kg;xj(qg,Ss.prototype);qg.isPureReactComponent=!0;var fb=Array.isArray,_j=Object.prototype.hasOwnProperty,Xg={current:null},Sj={key:!0,ref:!0,__self:!0,__source:!0};function Oj(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)_j.call(t,n)&&!Sj.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,G=M[J];if(0>>1;Ji(de,W))uei(Se,de)?(M[J]=Se,M[ue]=W,J=ue):(M[J]=de,M[X]=W,J=X);else if(uei(Se,W))M[J]=Se,M[ue]=W,J=ue;else break e}}return B}function i(M,B){var W=M.sortIndex-B.sortIndex;return W!==0?W:M.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,c=null,p=3,h=!1,x=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var B=r(u);B!==null;){if(B.callback===null)n(u);else if(B.startTime<=M)n(u),B.sortIndex=B.expirationTime,t(l,B);else break;B=r(u)}}function S(M){if(v=!1,w(M),!x)if(r(l)!==null)x=!0,z(b);else{var B=r(u);B!==null&&U(S,B.startTime-M)}}function b(M,B){x=!1,v&&(v=!1,g(k),k=-1),h=!0;var W=p;try{for(w(B),c=r(l);c!==null&&(!(c.expirationTime>B)||M&&!$());){var J=c.callback;if(typeof J=="function"){c.callback=null,p=c.priorityLevel;var G=J(c.expirationTime<=B);B=e.unstable_now(),typeof G=="function"?c.callback=G:c===r(l)&&n(l),w(B)}else n(l);c=r(l)}if(c!==null)var Q=!0;else{var X=r(u);X!==null&&U(S,X.startTime-B),Q=!1}return Q}finally{c=null,p=W,h=!1}}var _=!1,O=null,k=-1,P=5,R=-1;function $(){return!(e.unstable_now()-RM||125J?(M.sortIndex=W,t(u,M),r(l)===null&&M===r(u)&&(v?(g(k),k=-1):v=!0,U(S,W-J))):(M.sortIndex=G,t(l,M),x||h||(x=!0,z(b))),M},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(M){var B=p;return function(){var W=p;p=B;try{return M.apply(this,arguments)}finally{p=W}}}})(Pj);Ej.exports=Pj;var QT=Ej.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 JT=j,Rr=QT;function Z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tv=Object.prototype.hasOwnProperty,eN=/^[: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]*$/,pb={},hb={};function tN(e){return tv.call(hb,e)?!0:tv.call(pb,e)?!1:eN.test(e)?hb[e]=!0:(pb[e]=!0,!1)}function rN(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nN(e,t,r,n){if(t===null||typeof t>"u"||rN(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Kt[e]=new fr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Kt[t]=new fr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Kt[e]=new fr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Kt[e]=new fr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Kt[e]=new fr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Kt[e]=new fr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Kt[e]=new fr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Kt[e]=new fr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Kt[e]=new fr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zg=/[\-:]([a-z])/g;function Qg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Zg,Qg);Kt[t]=new fr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zg,Qg);Kt[t]=new fr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zg,Qg);Kt[t]=new fr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Kt[e]=new fr(e,1,!1,e.toLowerCase(),null,!1,!1)});Kt.xlinkHref=new fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Kt[e]=new fr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jg(e,t,r,n){var i=Kt.hasOwnProperty(t)?Kt[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Eh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ml(e):""}function iN(e){switch(e.tag){case 5:return ml(e.type);case 16:return ml("Lazy");case 13:return ml("Suspense");case 19:return ml("SuspenseList");case 0:case 2:case 15:return e=Ph(e.type,!1),e;case 11:return e=Ph(e.type.render,!1),e;case 1:return e=Ph(e.type,!0),e;default:return""}}function av(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case uo:return"Fragment";case lo:return"Portal";case rv:return"Profiler";case e0:return"StrictMode";case nv:return"Suspense";case iv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Nj:return(e.displayName||"Context")+".Consumer";case Tj:return(e._context.displayName||"Context")+".Provider";case t0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case r0:return t=e.displayName||null,t!==null?t:av(e.type)||"Memo";case _i:t=e._payload,e=e._init;try{return av(e(t))}catch{}}return null}function aN(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return av(t);case 8:return t===e0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ki(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oN(e){var t=Rj(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wc(e){e._valueTracker||(e._valueTracker=oN(e))}function Ij(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Rj(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function gf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ov(e,t){var r=t.checked;return yt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function vb(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ki(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mj(e,t){t=t.checked,t!=null&&Jg(e,"checked",t,!1)}function sv(e,t){Mj(e,t);var r=Ki(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?lv(e,t.type,r):t.hasOwnProperty("defaultValue")&&lv(e,t.type,Ki(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yb(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function lv(e,t,r){(t!=="number"||gf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var vl=Array.isArray;function Eo(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=_c.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ol={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},sN=["Webkit","ms","Moz","O"];Object.keys(Ol).forEach(function(e){sN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ol[t]=Ol[e]})});function Fj(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ol.hasOwnProperty(e)&&Ol[e]?(""+t).trim():t+"px"}function zj(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Fj(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var lN=yt({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 fv(e,t){if(t){if(lN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function dv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pv=null;function n0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hv=null,Po=null,Co=null;function bb(e){if(e=tc(e)){if(typeof hv!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=sp(t),hv(e.stateNode,e.type,t))}}function Uj(e){Po?Co?Co.push(e):Co=[e]:Po=e}function Vj(){if(Po){var e=Po,t=Co;if(Co=Po=null,bb(e),t)for(e=0;e>>=0,e===0?32:31-(xN(e)/bN|0)|0}var Sc=64,Oc=4194304;function yl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function _f(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=yl(s):(a&=o,a!==0&&(n=yl(a)))}else o=r&~i,o!==0?n=yl(o):a!==0&&(n=yl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Ju(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=r}function ON(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Al),Pb=" ",Cb=!1;function uA(e,t){switch(e){case"keyup":return QN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var co=!1;function e$(e,t){switch(e){case"compositionend":return cA(t);case"keypress":return t.which!==32?null:(Cb=!0,Pb);case"textInput":return e=t.data,e===Pb&&Cb?null:e;default:return null}}function t$(e,t){if(co)return e==="compositionend"||!f0&&uA(e,t)?(e=sA(),af=l0=Ti=null,co=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Rb(r)}}function hA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mA(){for(var e=window,t=gf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=gf(e.document)}return t}function d0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function c$(e){var t=mA(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&hA(r.ownerDocument.documentElement,r)){if(n!==null&&d0(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=Ib(r,a);var o=Ib(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,fo=null,bv=null,El=null,wv=!1;function Mb(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wv||fo==null||fo!==gf(n)||(n=fo,"selectionStart"in n&&d0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),El&&Zl(El,n)||(El=n,n=jf(bv,"onSelect"),0mo||(e.current=kv[mo],kv[mo]=null,mo--)}function nt(e,t){mo++,kv[mo]=e.current,e.current=t}var qi={},nr=ta(qi),gr=ta(!1),$a=qi;function zo(e,t){var r=e.type.contextTypes;if(!r)return qi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xr(e){return e=e.childContextTypes,e!=null}function kf(){ut(gr),ut(nr)}function Vb(e,t,r){if(nr.current!==qi)throw Error(Z(168));nt(nr,t),nt(gr,r)}function OA(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Z(108,aN(e)||"Unknown",i));return yt({},r,n)}function Ef(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qi,$a=nr.current,nt(nr,e),nt(gr,gr.current),!0}function Wb(e,t,r){var n=e.stateNode;if(!n)throw Error(Z(169));r?(e=OA(e,t,$a),n.__reactInternalMemoizedMergedChildContext=e,ut(gr),ut(nr),nt(nr,e)):ut(gr),nt(gr,r)}var Un=null,lp=!1,Vh=!1;function jA(e){Un===null?Un=[e]:Un.push(e)}function _$(e){lp=!0,jA(e)}function ra(){if(!Vh&&Un!==null){Vh=!0;var e=0,t=Ke;try{var r=Un;for(Ke=1;e>=o,i-=o,Wn=1<<32-pn(t)+i|r<k?(P=O,O=null):P=O.sibling;var R=p(g,O,w[k],S);if(R===null){O===null&&(O=P);break}e&&O&&R.alternate===null&&t(g,O),m=a(R,m,k),_===null?b=R:_.sibling=R,_=R,O=P}if(k===w.length)return r(g,O),ct&&pa(g,k),b;if(O===null){for(;kk?(P=O,O=null):P=O.sibling;var $=p(g,O,R.value,S);if($===null){O===null&&(O=P);break}e&&O&&$.alternate===null&&t(g,O),m=a($,m,k),_===null?b=$:_.sibling=$,_=$,O=P}if(R.done)return r(g,O),ct&&pa(g,k),b;if(O===null){for(;!R.done;k++,R=w.next())R=c(g,R.value,S),R!==null&&(m=a(R,m,k),_===null?b=R:_.sibling=R,_=R);return ct&&pa(g,k),b}for(O=n(g,O);!R.done;k++,R=w.next())R=h(O,g,k,R.value,S),R!==null&&(e&&R.alternate!==null&&O.delete(R.key===null?k:R.key),m=a(R,m,k),_===null?b=R:_.sibling=R,_=R);return e&&O.forEach(function(C){return t(g,C)}),ct&&pa(g,k),b}function y(g,m,w,S){if(typeof w=="object"&&w!==null&&w.type===uo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case bc:e:{for(var b=w.key,_=m;_!==null;){if(_.key===b){if(b=w.type,b===uo){if(_.tag===7){r(g,_.sibling),m=i(_,w.props.children),m.return=g,g=m;break e}}else if(_.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===_i&&Kb(b)===_.type){r(g,_.sibling),m=i(_,w.props),m.ref=el(g,_,w),m.return=g,g=m;break e}r(g,_);break}else t(g,_);_=_.sibling}w.type===uo?(m=Ea(w.props.children,g.mode,S,w.key),m.return=g,g=m):(S=pf(w.type,w.key,w.props,null,g.mode,S),S.ref=el(g,m,w),S.return=g,g=S)}return o(g);case lo:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){r(g,m.sibling),m=i(m,w.children||[]),m.return=g,g=m;break e}else{r(g,m);break}else t(g,m);m=m.sibling}m=Zh(w,g.mode,S),m.return=g,g=m}return o(g);case _i:return _=w._init,y(g,m,_(w._payload),S)}if(vl(w))return x(g,m,w,S);if(Xs(w))return v(g,m,w,S);Tc(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(r(g,m.sibling),m=i(m,w),m.return=g,g=m):(r(g,m),m=Yh(w,g.mode,S),m.return=g,g=m),o(g)):r(g,m)}return y}var Vo=PA(!0),CA=PA(!1),Tf=ta(null),Nf=null,go=null,v0=null;function y0(){v0=go=Nf=null}function g0(e){var t=Tf.current;ut(Tf),e._currentValue=t}function Cv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function No(e,t){Nf=e,v0=go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mr=!0),e.firstContext=null)}function Zr(e){var t=e._currentValue;if(v0!==e)if(e={context:e,memoizedValue:t,next:null},go===null){if(Nf===null)throw Error(Z(308));go=e,Nf.dependencies={lanes:0,firstContext:e}}else go=go.next=e;return t}var ba=null;function x0(e){ba===null?ba=[e]:ba.push(e)}function TA(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,x0(t)):(r.next=i.next,i.next=r),t.interleaved=r,ni(e,n)}function ni(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Si=!1;function b0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function NA(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,De&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ni(e,r)}return i=n.interleaved,i===null?(t.next=t,x0(n)):(t.next=i.next,i.next=t),n.interleaved=t,ni(e,r)}function sf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,a0(e,r)}}function qb(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function $f(e,t,r,n){var i=e.updateQueue;Si=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var c=i.baseState;o=0,f=u=l=null,s=a;do{var p=s.lane,h=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,v=s;switch(p=t,h=r,v.tag){case 1:if(x=v.payload,typeof x=="function"){c=x.call(h,c,p);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,p=typeof x=="function"?x.call(h,c,p):x,p==null)break e;c=yt({},c,p);break e;case 2:Si=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,l=c):f=f.next=h,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Ma|=o,e.lanes=o,e.memoizedState=c}}function Xb(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Hh.transition;Hh.transition={};try{e(!1),t()}finally{Ke=r,Hh.transition=n}}function XA(){return Qr().memoizedState}function A$(e,t,r){var n=zi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},YA(e))ZA(t,r);else if(r=TA(e,t,r,n),r!==null){var i=ur();hn(r,e,n,i),QA(r,t,n)}}function k$(e,t,r){var n=zi(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(YA(e))ZA(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,mn(s,o)){var l=t.interleaved;l===null?(i.next=i,x0(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=TA(e,t,i,n),r!==null&&(i=ur(),hn(r,e,n,i),QA(r,t,n))}}function YA(e){var t=e.alternate;return e===mt||t!==null&&t===mt}function ZA(e,t){Pl=If=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function QA(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,a0(e,r)}}var Mf={readContext:Zr,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},E$={readContext:Zr,useCallback:function(e,t){return Sn().memoizedState=[e,t===void 0?null:t],e},useContext:Zr,useEffect:Zb,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,uf(4194308,4,WA.bind(null,t,e),r)},useLayoutEffect:function(e,t){return uf(4194308,4,e,t)},useInsertionEffect:function(e,t){return uf(4,2,e,t)},useMemo:function(e,t){var r=Sn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Sn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=A$.bind(null,mt,e),[n.memoizedState,e]},useRef:function(e){var t=Sn();return e={current:e},t.memoizedState=e},useState:Yb,useDebugValue:E0,useDeferredValue:function(e){return Sn().memoizedState=e},useTransition:function(){var e=Yb(!1),t=e[0];return e=j$.bind(null,e[1]),Sn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=mt,i=Sn();if(ct){if(r===void 0)throw Error(Z(407));r=r()}else{if(r=t(),zt===null)throw Error(Z(349));Ia&30||MA(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,Zb(LA.bind(null,n,a,e),[e]),n.flags|=2048,au(9,DA.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Sn(),t=zt.identifierPrefix;if(ct){var r=Hn,n=Wn;r=(n&~(1<<32-pn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[jn]=t,e[eu]=n,lk(e,t,!1,!1),t.stateNode=e;e:{switch(o=dv(r,n),r){case"dialog":at("cancel",e),at("close",e),i=n;break;case"iframe":case"object":case"embed":at("load",e),i=n;break;case"video":case"audio":for(i=0;iGo&&(t.flags|=128,n=!0,tl(a,!1),t.lanes=4194304)}else{if(!n)if(e=Rf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),tl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ct)return Yt(t),null}else 2*_t()-a.renderingStartTime>Go&&r!==1073741824&&(t.flags|=128,n=!0,tl(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=_t(),t.sibling=null,r=pt.current,nt(pt,n?r&1|2:r&1),t):(Yt(t),null);case 22:case 23:return R0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?kr&1073741824&&(Yt(t),t.subtreeFlags&6&&(t.flags|=8192)):Yt(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function M$(e,t){switch(h0(t),t.tag){case 1:return xr(t.type)&&kf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wo(),ut(gr),ut(nr),S0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _0(t),null;case 13:if(ut(pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(pt),null;case 4:return Wo(),null;case 10:return g0(t.type._context),null;case 22:case 23:return R0(),null;case 24:return null;default:return null}}var $c=!1,er=!1,D$=typeof WeakSet=="function"?WeakSet:Set,se=null;function xo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){gt(e,t,n)}else r.current=null}function Bv(e,t,r){try{r()}catch(n){gt(e,t,n)}}var l1=!1;function L$(e,t){if(_v=Sf,e=mA(),d0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,c=e,p=null;t:for(;;){for(var h;c!==r||i!==0&&c.nodeType!==3||(s=o+i),c!==a||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)p=c,c=h;for(;;){if(c===e)break t;if(p===r&&++u===i&&(s=o),p===a&&++f===n&&(l=o),(h=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Sv={focusedElem:e,selectionRange:r},Sf=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,y=x.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:sn(t.type,v),y);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(S){gt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return x=l1,l1=!1,x}function Cl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Bv(t,r,a)}i=i.next}while(i!==n)}}function fp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Fv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function fk(e){var t=e.alternate;t!==null&&(e.alternate=null,fk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jn],delete t[eu],delete t[Av],delete t[b$],delete t[w$])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dk(e){return e.tag===5||e.tag===3||e.tag===4}function u1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dk(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Af));else if(n!==4&&(e=e.child,e!==null))for(zv(e,t,r),e=e.sibling;e!==null;)zv(e,t,r),e=e.sibling}function Uv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Uv(e,t,r),e=e.sibling;e!==null;)Uv(e,t,r),e=e.sibling}var Ht=null,ln=!1;function bi(e,t,r){for(r=r.child;r!==null;)pk(e,t,r),r=r.sibling}function pk(e,t,r){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(np,r)}catch{}switch(r.tag){case 5:er||xo(r,t);case 6:var n=Ht,i=ln;Ht=null,bi(e,t,r),Ht=n,ln=i,Ht!==null&&(ln?(e=Ht,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ht.removeChild(r.stateNode));break;case 18:Ht!==null&&(ln?(e=Ht,r=r.stateNode,e.nodeType===8?Uh(e.parentNode,r):e.nodeType===1&&Uh(e,r),Xl(e)):Uh(Ht,r.stateNode));break;case 4:n=Ht,i=ln,Ht=r.stateNode.containerInfo,ln=!0,bi(e,t,r),Ht=n,ln=i;break;case 0:case 11:case 14:case 15:if(!er&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Bv(r,t,o),i=i.next}while(i!==n)}bi(e,t,r);break;case 1:if(!er&&(xo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){gt(r,t,s)}bi(e,t,r);break;case 21:bi(e,t,r);break;case 22:r.mode&1?(er=(n=er)||r.memoizedState!==null,bi(e,t,r),er=n):bi(e,t,r);break;default:bi(e,t,r)}}function c1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new D$),t.forEach(function(n){var i=K$.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function nn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=_t()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*F$(n/1960))-n,10e?16:e,Ni===null)var n=!1;else{if(e=Ni,Ni=null,Bf=0,De&6)throw Error(Z(331));var i=De;for(De|=4,se=e.current;se!==null;){var a=se,o=a.child;if(se.flags&16){var s=a.deletions;if(s!==null){for(var l=0;l_t()-N0?ka(e,0):T0|=r),br(e,t)}function wk(e,t){t===0&&(e.mode&1?(t=Oc,Oc<<=1,!(Oc&130023424)&&(Oc=4194304)):t=1);var r=ur();e=ni(e,t),e!==null&&(Ju(e,t,r),br(e,r))}function G$(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),wk(e,r)}function K$(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Z(314))}n!==null&&n.delete(t),wk(e,r)}var _k;_k=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||gr.current)mr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return mr=!1,R$(e,t,r);mr=!!(e.flags&131072)}else mr=!1,ct&&t.flags&1048576&&AA(t,Cf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;cf(e,t),e=t.pendingProps;var i=zo(t,nr.current);No(t,r),i=j0(null,t,n,e,i,r);var a=A0();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xr(n)?(a=!0,Ef(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,b0(t),i.updater=cp,t.stateNode=i,i._reactInternals=t,Nv(t,n,e,r),t=Iv(null,t,n,!0,a,r)):(t.tag=0,ct&&a&&p0(t),ir(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(cf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=X$(n),e=sn(n,e),i){case 0:t=Rv(null,t,n,e,r);break e;case 1:t=a1(null,t,n,e,r);break e;case 11:t=n1(null,t,n,e,r);break e;case 14:t=i1(null,t,n,sn(n.type,e),r);break e}throw Error(Z(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),Rv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),a1(e,t,n,i,r);case 3:e:{if(ak(t),e===null)throw Error(Z(387));n=t.pendingProps,a=t.memoizedState,i=a.element,NA(e,t),$f(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Ho(Error(Z(423)),t),t=o1(e,t,n,r,i);break e}else if(n!==i){i=Ho(Error(Z(424)),t),t=o1(e,t,n,r,i);break e}else for(Tr=Li(t.stateNode.containerInfo.firstChild),Nr=t,ct=!0,cn=null,r=CA(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Uo(),n===i){t=ii(e,t,r);break e}ir(e,t,n,r)}t=t.child}return t;case 5:return $A(t),e===null&&Pv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Ov(n,i)?o=null:a!==null&&Ov(n,a)&&(t.flags|=32),ik(e,t),ir(e,t,o,r),t.child;case 6:return e===null&&Pv(t),null;case 13:return ok(e,t,r);case 4:return w0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Vo(t,null,n,r):ir(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),n1(e,t,n,i,r);case 7:return ir(e,t,t.pendingProps,r),t.child;case 8:return ir(e,t,t.pendingProps.children,r),t.child;case 12:return ir(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,nt(Tf,n._currentValue),n._currentValue=o,a!==null)if(mn(a.value,o)){if(a.children===i.children&&!gr.current){t=ii(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Yn(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Cv(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Z(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Cv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}ir(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,No(t,r),i=Zr(i),n=n(i),t.flags|=1,ir(e,t,n,r),t.child;case 14:return n=t.type,i=sn(n,t.pendingProps),i=sn(n.type,i),i1(e,t,n,i,r);case 15:return rk(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),cf(e,t),t.tag=1,xr(n)?(e=!0,Ef(t)):e=!1,No(t,r),JA(t,n,i),Nv(t,n,i,r),Iv(null,t,n,!0,e,r);case 19:return sk(e,t,r);case 22:return nk(e,t,r)}throw Error(Z(156,t.tag))};function Sk(e,t){return Yj(e,t)}function q$(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,r,n){return new q$(e,t,r,n)}function M0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function X$(e){if(typeof e=="function")return M0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===t0)return 11;if(e===r0)return 14}return 2}function Ui(e,t){var r=e.alternate;return r===null?(r=Kr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function pf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")M0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case uo:return Ea(r.children,i,a,t);case e0:o=8,i|=8;break;case rv:return e=Kr(12,r,t,i|2),e.elementType=rv,e.lanes=a,e;case nv:return e=Kr(13,r,t,i),e.elementType=nv,e.lanes=a,e;case iv:return e=Kr(19,r,t,i),e.elementType=iv,e.lanes=a,e;case $j:return pp(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Tj:o=10;break e;case Nj:o=9;break e;case t0:o=11;break e;case r0:o=14;break e;case _i:o=16,n=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=Kr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Ea(e,t,r,n){return e=Kr(7,e,n,t),e.lanes=r,e}function pp(e,t,r,n){return e=Kr(22,e,n,t),e.elementType=$j,e.lanes=r,e.stateNode={isHidden:!1},e}function Yh(e,t,r){return e=Kr(6,e,null,t),e.lanes=r,e}function Zh(e,t,r){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Y$(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Th(0),this.expirationTimes=Th(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Th(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function D0(e,t,r,n,i,a,o,s,l){return e=new Y$(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Kr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},b0(a),e}function Z$(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kk)}catch(e){console.error(e)}}kk(),kj.exports=Mr;var wo=kj.exports,g1=wo;ev.createRoot=g1.createRoot,ev.hydrateRoot=g1.hydrateRoot;/** - * @remix-run/router v1.23.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function su(){return su=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function z0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function nR(){return Math.random().toString(36).substr(2,8)}function b1(e,t){return{usr:e.state,key:e.key,idx:t}}function Kv(e,t,r,n){return r===void 0&&(r=null),su({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?As(t):t,{state:r,key:t&&t.key||n||nR()})}function Uf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function As(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function iR(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=$i.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(su({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){s=$i.Pop;let y=f(),g=y==null?null:y-u;u=y,l&&l({action:s,location:v.location,delta:g})}function p(y,g){s=$i.Push;let m=Kv(v.location,y,g);u=f()+1;let w=b1(m,u),S=v.createHref(m);try{o.pushState(w,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;i.location.assign(S)}a&&l&&l({action:s,location:v.location,delta:1})}function h(y,g){s=$i.Replace;let m=Kv(v.location,y,g);u=f();let w=b1(m,u),S=v.createHref(m);o.replaceState(w,"",S),a&&l&&l({action:s,location:v.location,delta:0})}function x(y){let g=i.location.origin!=="null"?i.location.origin:i.location.href,m=typeof y=="string"?y:Uf(y);return m=m.replace(/ $/,"%20"),vt(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let v={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(x1,c),l=y,()=>{i.removeEventListener(x1,c),l=null}},createHref(y){return t(i,y)},createURL:x,encodeLocation(y){let g=x(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:h,go(y){return o.go(y)}};return v}var w1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(w1||(w1={}));function aR(e,t,r){return r===void 0&&(r="/"),oR(e,t,r)}function oR(e,t,r,n){let i=typeof t=="string"?As(t):t,a=Ko(i.pathname||"/",r);if(a==null)return null;let o=Ek(e);sR(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(vt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Vi([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(vt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Ek(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:hR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of Pk(a.path))i(a,o,l)}),t}function Pk(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=Pk(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function sR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:mR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const lR=/^:[\w-]+$/,uR=3,cR=2,fR=1,dR=10,pR=-2,_1=e=>e==="*";function hR(e,t){let r=e.split("/"),n=r.length;return r.some(_1)&&(n+=pR),t&&(n+=cR),r.filter(i=>!_1(i)).reduce((i,a)=>i+(lR.test(a)?uR:a===""?fR:dR),n)}function mR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function vR(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=f;if(p==="*"){let v=s[c]||"";o=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const x=s[c];return h&&!x?u[p]=void 0:u[p]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function yR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),z0(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function gR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return z0(!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 Ko(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const xR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bR=e=>xR.test(e);function wR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?As(e):e,a;if(r)if(bR(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),z0(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=S1(r.substring(1),"/"):a=S1(r,t)}else a=t;return{pathname:a,search:OR(n),hash:jR(i)}}function S1(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Qh(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function _R(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function U0(e,t){let r=_R(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function V0(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=As(e):(i=su({},e),vt(!i.pathname||!i.pathname.includes("?"),Qh("?","pathname","search",i)),vt(!i.pathname||!i.pathname.includes("#"),Qh("#","pathname","hash",i)),vt(!i.search||!i.search.includes("#"),Qh("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let c=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),c-=1;i.pathname=p.join("/")}s=c>=0?t[c]:"/"}let l=wR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Vi=e=>e.join("/").replace(/\/\/+/g,"/"),SR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),OR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function AR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ck=["post","put","patch","delete"];new Set(Ck);const kR=["get",...Ck];new Set(kR);/** - * React Router v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),j.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let c=V0(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Vi([t,c.pathname])),(f.replace?n.replace:n.push)(c,f.state,f)},[t,n,o,a,e])}const CR=j.createContext(null);function TR(e){let t=j.useContext(pi).outlet;return t&&j.createElement(CR.Provider,{value:e},t)}function wp(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=j.useContext(di),{matches:i}=j.useContext(pi),{pathname:a}=Es(),o=JSON.stringify(U0(i,n.v7_relativeSplatPath));return j.useMemo(()=>V0(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function NR(e,t){return $R(e,t)}function $R(e,t,r,n){ks()||vt(!1);let{navigator:i}=j.useContext(di),{matches:a}=j.useContext(pi),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Es(),f;if(t){var c;let y=typeof t=="string"?As(t):t;l==="/"||(c=y.pathname)!=null&&c.startsWith(l)||vt(!1),f=y}else f=u;let p=f.pathname||"/",h=p;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let x=aR(e,{pathname:h}),v=LR(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Vi([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Vi([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&v?j.createElement(xp.Provider,{value:{location:lu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:$i.Pop}},v):v}function RR(){let e=UR(),t=AR(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:i},r):null,null)}const IR=j.createElement(RR,null);class MR extends j.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?j.createElement(pi.Provider,{value:this.props.routeContext},j.createElement(Nk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function DR(e){let{routeContext:t,match:r,children:n}=e,i=j.useContext(gp);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(pi.Provider,{value:t},n)}function LR(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);f>=0||vt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,c,p)=>{let h,x=!1,v=null,y=null;r&&(h=s&&c.route.id?s[c.route.id]:void 0,v=c.route.errorElement||IR,l&&(u<0&&p===0?(WR("route-fallback"),x=!0,y=null):u===p&&(x=!0,y=c.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=v:x?w=y:c.route.Component?w=j.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=f,j.createElement(DR,{match:c,routeContext:{outlet:f,matches:g,isDataRoute:r!=null},children:w})};return r&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?j.createElement(MR,{location:r.location,revalidation:r.revalidation,component:v,error:h,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var Rk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Rk||{}),Ik=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}(Ik||{});function BR(e){let t=j.useContext(gp);return t||vt(!1),t}function FR(e){let t=j.useContext(Tk);return t||vt(!1),t}function zR(e){let t=j.useContext(pi);return t||vt(!1),t}function Mk(e){let t=zR(),r=t.matches[t.matches.length-1];return r.route.id||vt(!1),r.route.id}function UR(){var e;let t=j.useContext(Nk),r=FR(),n=Mk();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function VR(){let{router:e}=BR(Rk.UseNavigateStable),t=Mk(Ik.UseNavigateStable),r=j.useRef(!1);return $k(()=>{r.current=!0}),j.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,lu({fromRouteId:t},a)))},[e,t])}const O1={};function WR(e,t,r){O1[e]||(O1[e]=!0)}function HR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function GR(e){let{to:t,replace:r,state:n,relative:i}=e;ks()||vt(!1);let{future:a,static:o}=j.useContext(di),{matches:s}=j.useContext(pi),{pathname:l}=Es(),u=bp(),f=V0(t,U0(s,a.v7_relativeSplatPath),l,i==="path"),c=JSON.stringify(f);return j.useEffect(()=>u(JSON.parse(c),{replace:r,state:n,relative:i}),[u,c,i,r,n]),null}function KR(e){return TR(e.context)}function _n(e){vt(!1)}function qR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=$i.Pop,navigator:a,static:o=!1,future:s}=e;ks()&&vt(!1);let l=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:l,navigator:a,static:o,future:lu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=As(n));let{pathname:f="/",search:c="",hash:p="",state:h=null,key:x="default"}=n,v=j.useMemo(()=>{let y=Ko(f,l);return y==null?null:{location:{pathname:y,search:c,hash:p,state:h,key:x},navigationType:i}},[l,f,c,p,h,x,i]);return v==null?null:j.createElement(di.Provider,{value:u},j.createElement(xp.Provider,{children:r,value:v}))}function XR(e){let{children:t,location:r}=e;return NR(Xv(t),r)}new Promise(()=>{});function Xv(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,i)=>{if(!j.isValidElement(n))return;let a=[...t,i];if(n.type===j.Fragment){r.push.apply(r,Xv(n.props.children,a));return}n.type!==_n&&vt(!1),!n.props.index||!n.props.children||vt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Xv(n.props.children,a)),r.push(o)}),r}/** - * React Router DOM v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Vf(){return Vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function YR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZR(e,t){return e.button===0&&(!t||t==="_self")&&!YR(e)}const QR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],JR=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],eI="6";try{window.__reactRouterVersion=eI}catch{}const tI=j.createContext({isTransitioning:!1}),rI="startTransition",j1=HT[rI];function nI(e){let{basename:t,children:r,future:n,window:i}=e,a=j.useRef();a.current==null&&(a.current=rR({window:i,v5Compat:!0}));let o=a.current,[s,l]=j.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=j.useCallback(c=>{u&&j1?j1(()=>l(c)):l(c)},[l,u]);return j.useLayoutEffect(()=>o.listen(f),[o,f]),j.useEffect(()=>HR(n),[n]),j.createElement(qR,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const iI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oI=j.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:c}=t,p=Dk(t,QR),{basename:h}=j.useContext(di),x,v=!1;if(typeof u=="string"&&aI.test(u)&&(x=u,iI))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),b=Ko(S.pathname,h);S.origin===w.origin&&b!=null?u=b+S.search+S.hash:v=!0}catch{}let y=ER(u,{relative:i}),g=uI(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:c});function m(w){n&&n(w),w.defaultPrevented||g(w)}return j.createElement("a",Vf({},p,{href:x||y,onClick:v||a?n:m,ref:r,target:l}))}),sI=j.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:o=!1,style:s,to:l,viewTransition:u,children:f}=t,c=Dk(t,JR),p=wp(l,{relative:c.relative}),h=Es(),x=j.useContext(Tk),{navigator:v,basename:y}=j.useContext(di),g=x!=null&&cI(p)&&u===!0,m=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&y&&(S=Ko(S,y)||S);const b=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!o&&w.startsWith(m)&&w.charAt(b)==="/",O=S!=null&&(S===m||!o&&S.startsWith(m)&&S.charAt(m.length)==="/"),k={isActive:_,isPending:O,isTransitioning:g},P=_?n:void 0,R;typeof a=="function"?R=a(k):R=[a,_?"active":null,O?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let $=typeof s=="function"?s(k):s;return j.createElement(oI,Vf({},c,{"aria-current":P,className:R,ref:r,style:$,to:l,viewTransition:u}),typeof f=="function"?f(k):f)});var Yv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Yv||(Yv={}));var A1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(A1||(A1={}));function lI(e){let t=j.useContext(gp);return t||vt(!1),t}function uI(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=bp(),u=Es(),f=wp(e,{relative:o});return j.useCallback(c=>{if(ZR(c,r)){c.preventDefault();let p=n!==void 0?n:Uf(u)===Uf(f);l(e,{replace:p,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function cI(e,t){t===void 0&&(t={});let r=j.useContext(tI);r==null&&vt(!1);let{basename:n}=lI(Yv.useViewTransitionState),i=wp(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=Ko(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Ko(r.nextLocation.pathname,n)||r.nextLocation.pathname;return qv(i.pathname,o)!=null||qv(i.pathname,a)!=null}/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var fI={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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ze=(e,t)=>{const r=j.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>j.createElement("svg",{ref:f,...fI,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:["lucide",`lucide-${dI(e)}`,s].join(" "),...u},[...t.map(([c,p])=>j.createElement(c,p)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jh=Ze("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pI=Ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hI=Ze("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mI=Ze("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xl=Ze("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bl=Ze("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vI=Ze("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yI=Ze("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gI=Ze("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.363.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=Ze("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** - * @license lucide-react v0.363.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=Ze("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _p=Ze("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bI=Ze("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wI=Ze("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _I=Ze("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const SI=Ze("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const OI=Ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jI=Ze("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lk=Ze("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wf=Ze("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mc=Ze("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.363.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=Ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const AI=Ze("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kI=Ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const EI=Ze("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ai=Ze("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bk=Ze("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const PI=Ze("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"}]]);function CI(){return d.jsxs("aside",{className:"w-64 shrink-0 flex flex-col h-screen bg-white dark:bg-black border-r border-slate-200 dark:border-[#151515] relative z-20 transition-colors duration-300",children:[d.jsxs("div",{className:"h-20 px-6 flex items-center gap-3.5 border-b border-slate-200 dark:border-[#151515] transition-colors duration-300",children:[d.jsx("div",{className:"w-9 h-9 bg-brand-500 dark:bg-black border border-brand-600 dark:border-[#2a2a2e] rounded-xl flex items-center justify-center shadow-sm",children:d.jsx(PI,{size:18,className:"text-white",strokeWidth:2})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[16px] font-bold tracking-widest text-slate-900 dark:text-white leading-tight uppercase",children:"Decision"}),d.jsx("p",{className:"text-[10px] uppercase text-brand-600 dark:text-[#66666e] tracking-wider leading-tight font-semibold",children:"Engine"})]})]}),d.jsxs("nav",{className:"flex-1 px-4 py-8 space-y-1 overflow-y-auto",children:[d.jsx(ua,{to:"/",icon:SI,end:!0,children:"Overview"}),d.jsx(ua,{to:"/decisions",icon:kI,children:"Decision Explorer"}),d.jsx("div",{className:"pt-8 pb-3 px-3 flex items-center gap-2",children:d.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-slate-400 dark:text-[#66666e]",children:"Routing"})}),d.jsx(ua,{to:"/routing",icon:bI,end:!0,children:"Routing Hub"}),d.jsx(ua,{to:"/routing/sr",icon:Bk,indent:!0,children:"Auth-Rate Based"}),d.jsx(ua,{to:"/routing/rules",icon:hI,indent:!0,children:"Rule-Based (Euclid)"}),d.jsx(ua,{to:"/routing/volume",icon:Wf,indent:!0,children:"Volume Split"}),d.jsx(ua,{to:"/routing/debit",icon:Lk,indent:!0,children:"Debit Routing"})]}),d.jsx("div",{className:"px-6 py-5 border-t border-slate-200 dark:border-[#151515] bg-slate-50 dark:bg-black transition-colors duration-300",children:d.jsx("span",{className:"text-[11px] text-slate-500 dark:text-[#66666e] font-medium tracking-wide",children:"v1.4"})})]})}function ua({to:e,icon:t,children:r,end:n,indent:i}){return d.jsx(sI,{to:e,end:n,className:({isActive:a})=>`group relative flex items-center gap-3 px-4 py-3 rounded-[14px] text-[14px] font-medium transition-all duration-200 ${i?"ml-3 w-[calc(100%-12px)]":""} ${a?"bg-slate-100 text-brand-600 dark:bg-[#151518] dark:text-white shadow-sm":"text-slate-500 hover:text-slate-900 hover:bg-slate-50 dark:text-[#888891] dark:hover:text-white dark:hover:bg-[#0c0c0e]"}`,children:({isActive:a})=>d.jsxs(d.Fragment,{children:[d.jsx(t,{size:18,className:`transition-colors duration-200 ${a?"text-brand-600 dark:text-white":"text-slate-400 dark:text-[#55555e] group-hover:text-slate-600 dark:group-hover:text-white"}`,strokeWidth:a?2.5:2}),d.jsx("span",{className:"flex-1",children:r})]})})}const TI={},k1=e=>{let t;const r=new Set,n=(f,c)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=c??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(x=>x(t,h))}},i=()=>t,l={setState:n,getState:i,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(TI?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,i,l);return l},NI=e=>e?k1(e):k1;var Fk={exports:{}},zk={},Uk={exports:{}},Vk={};/** - * @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 qo=j;function $I(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var RI=typeof Object.is=="function"?Object.is:$I,II=qo.useState,MI=qo.useEffect,DI=qo.useLayoutEffect,LI=qo.useDebugValue;function BI(e,t){var r=t(),n=II({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return DI(function(){i.value=r,i.getSnapshot=t,tm(i)&&a({inst:i})},[e,r,t]),MI(function(){return tm(i)&&a({inst:i}),e(function(){tm(i)&&a({inst:i})})},[e]),LI(r),r}function tm(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!RI(e,r)}catch{return!0}}function FI(e,t){return t()}var zI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?FI:BI;Vk.useSyncExternalStore=qo.useSyncExternalStore!==void 0?qo.useSyncExternalStore:zI;Uk.exports=Vk;var Zv=Uk.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.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 Sp=j,UI=Zv;function VI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var WI=typeof Object.is=="function"?Object.is:VI,HI=UI.useSyncExternalStore,GI=Sp.useRef,KI=Sp.useEffect,qI=Sp.useMemo,XI=Sp.useDebugValue;zk.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=GI(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=qI(function(){function l(h){if(!u){if(u=!0,f=h,h=n(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return c=x}return c=h}if(x=c,WI(f,h))return x;var v=n(h);return i!==void 0&&i(x,v)?(f=h,x):(f=h,c=v)}var u=!1,f,c,p=r===void 0?null:r;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,r,n,i]);var s=HI(e,a[0],a[1]);return KI(function(){o.hasValue=!0,o.value=s},[s]),XI(s),s};Fk.exports=zk;var YI=Fk.exports;const ZI=qe(YI),Wk={},{useDebugValue:QI}=N,{useSyncExternalStoreWithSelector:JI}=ZI;let E1=!1;const eM=e=>e;function tM(e,t=eM,r){(Wk?"production":void 0)!=="production"&&r&&!E1&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),E1=!0);const n=JI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return QI(n),n}const rM=e=>{(Wk?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?NI(e):e,r=(n,i)=>tM(t,n,i);return Object.assign(r,t),r},nM=e=>rM,iM={};function aM(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var a;const o=l=>l===null?null:JSON.parse(l,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(o):o(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const uu=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return uu(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return uu(n)(r)}}}},oM=(e,t)=>(r,n,i)=>{let a={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,g)=>({...g,...y}),...t},o=!1;const s=new Set,l=new Set;let u;try{u=a.getStorage()}catch{}if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...y)},n,i);const f=uu(a.serialize),c=()=>{const y=a.partialize({...n()});let g;const m=f({state:y,version:a.version}).then(w=>u.setItem(a.name,w)).catch(w=>{g=w});if(g)throw g;return m},p=i.setState;i.setState=(y,g)=>{p(y,g),c()};const h=e((...y)=>{r(...y),c()},n,i);let x;const v=()=>{var y;if(!u)return;o=!1,s.forEach(m=>m(n()));const g=((y=a.onRehydrateStorage)==null?void 0:y.call(a,n()))||void 0;return uu(u.getItem.bind(u))(a.name).then(m=>{if(m)return a.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return a.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var w;return x=a.merge(m,(w=n())!=null?w:h),r(x,!0),c()}).then(()=>{g==null||g(x,void 0),o=!0,l.forEach(m=>m(x))}).catch(m=>{g==null||g(void 0,m)})};return i.persist={setOptions:y=>{a={...a,...y},y.getStorage&&(u=y.getStorage())},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},v(),x||h},sM=(e,t)=>(r,n,i)=>{let a={storage:aM(()=>localStorage),partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...t},o=!1;const s=new Set,l=new Set;let u=a.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const f=()=>{const v=a.partialize({...n()});return u.setItem(a.name,{state:v,version:a.version})},c=i.setState;i.setState=(v,y)=>{c(v,y),f()};const p=e((...v)=>{r(...v),f()},n,i);i.getInitialState=()=>p;let h;const x=()=>{var v,y;if(!u)return;o=!1,s.forEach(m=>{var w;return m((w=n())!=null?w:p)});const g=((y=a.onRehydrateStorage)==null?void 0:y.call(a,(v=n())!=null?v:p))||void 0;return uu(u.getItem.bind(u))(a.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return[!0,a.migrate(m.state,m.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var w;const[S,b]=m;if(h=a.merge(b,(w=n())!=null?w:p),r(h,!0),S)return f()}).then(()=>{g==null||g(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{g==null||g(void 0,m)})};return i.persist={setOptions:v=>{a={...a,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},a.skipHydration||x(),h||p},lM=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((iM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),oM(e,t)):sM(e,t),uM=lM,na=nM()(uM(e=>({merchantId:"",setMerchantId:t=>{console.log(` -[STORE] Merchant ID changed: "${t}"`),e({merchantId:t})}}),{name:"merchant-store"}));function cM(e,t,r){console.log(` -`+"=".repeat(80)),console.log(`[API REQUEST] ${new Date().toISOString()}`),console.log(`Method: ${e}`),console.log(`Path: ${t}`),r!==void 0&&console.log("Body:",JSON.stringify(r,null,2)),console.log("=".repeat(80))}function fM(e,t,r,n){console.log(` -`+"-".repeat(80)),console.log(`[API RESPONSE] ${new Date().toISOString()}`),console.log(`Path: ${e}`),console.log(`Status: ${t} ${r}`),console.log("Response Body:",n),console.log("-".repeat(80)+` -`)}function P1(e,t){console.log(` -`+"!".repeat(80)),console.log(`[API ERROR] ${new Date().toISOString()}`),console.log(`Path: ${e}`),t instanceof Error?(console.log("Error:",t.message),console.log("Stack:",t.stack)):console.log("Error:",t),console.log("!".repeat(80)+` -`)}async function Hk(e,t){const r=(t==null?void 0:t.method)||"GET",n=t!=null&&t.body?JSON.parse(t.body):void 0;cM(r,e,n);try{const i=await fetch(e,{headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t}),a=await i.text();let o;try{const s=JSON.parse(a);o=JSON.stringify(s,null,2)}catch{o=a}if(fM(e,i.status,i.statusText,o),!i.ok){const s=new Error(`API error ${i.status}: ${a}`);throw P1(e,s),s}return a.trim()?JSON.parse(a):void 0}catch(i){throw P1(e,i),i}}async function ft(e,t){return Hk(e,{method:"POST",body:t!==void 0?JSON.stringify(t):void 0})}async function dM(e){return Hk(e)}function pM(){const{merchantId:e,setMerchantId:t}=na(),[r,n]=j.useState(e),[i,a]=j.useState(!1),[o,s]=j.useState(()=>localStorage.getItem("theme")==="dark");j.useEffect(()=>{const u=window.document.documentElement;o?(u.classList.add("dark"),localStorage.setItem("theme","dark")):(u.classList.remove("dark"),localStorage.setItem("theme","light"))},[o]);async function l(){const u=r.trim();if(u){t(u),a(!0);try{await ft("/merchant-account/create",{merchant_id:u,gateway_success_rate_based_decider_input:null})}catch{}finally{a(!1)}}}return d.jsxs("header",{className:"h-[76px] bg-white dark:bg-black border-b border-slate-200 dark:border-[#151515] flex items-center justify-between px-8 shrink-0 relative z-10 transition-colors duration-300",children:[d.jsx("div",{}),d.jsxs("div",{className:"flex items-center gap-6",children:[d.jsxs("div",{className:"relative",children:[d.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&l(),placeholder:"Set Merchant ID",className:"w-72 bg-slate-50 dark:bg-[#0f0f11] border border-slate-200 dark:border-[#222222] rounded-full px-4 py-2 text-sm text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-[#66666e] focus:outline-none focus:border-slate-400 dark:focus:border-[#444444] transition-colors"}),d.jsx("button",{onClick:l,disabled:i,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-slate-400 hover:text-brand-500 dark:text-[#66666e] dark:hover:text-white transition-colors",children:i?d.jsx(OI,{size:16,className:"animate-spin"}):d.jsx(pI,{size:16})})]}),e&&d.jsxs("div",{className:"flex items-center gap-2 pl-6 ml-2 border-l border-slate-200 dark:border-[#222222] transition-colors duration-300",children:[d.jsx(mI,{size:16,className:"text-brand-500 dark:text-[#66666e]"}),d.jsx("span",{className:"text-sm text-slate-800 dark:text-white font-medium",children:e})]}),d.jsx("button",{onClick:()=>s(!o),className:"p-2.5 rounded-full bg-slate-100 text-slate-600 hover:bg-slate-200 dark:bg-[#151515] dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#222222] transition-colors duration-200","aria-label":"Toggle theme",children:o?d.jsx(EI,{size:18}):d.jsx(jI,{size:18})})]})]})}function hM(){return d.jsxs("div",{className:"flex h-screen overflow-hidden bg-[#f8fafc] text-slate-900 dark:bg-[#000000] dark:text-white relative transition-colors duration-300",children:[d.jsx("div",{className:"aurora-top"}),d.jsx(CI,{}),d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[d.jsx(pM,{}),d.jsx("main",{className:"flex-1 overflow-y-auto p-8 relative",children:d.jsx(KR,{})})]})]})}const Gk=0,Kk=1,qk=2,C1=3;var T1=Object.prototype.hasOwnProperty;function Qv(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&Qv(e[n],t[n]););return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(T1.call(e,r)&&++n&&!T1.call(t,r)||!(r in t)||!Qv(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const Vn=new WeakMap,Gn=()=>{},tr=Gn(),Jv=Object,Re=e=>e===tr,An=e=>typeof e=="function",Yi=(e,t)=>({...e,...t}),Xk=e=>An(e.then),rm={},Dc={},W0="undefined",nc=typeof window!=W0,ey=typeof document!=W0,mM=nc&&"Deno"in window,vM=()=>nc&&typeof window.requestAnimationFrame!=W0,Yk=(e,t)=>{const r=Vn.get(e);return[()=>!Re(t)&&e.get(t)||rm,n=>{if(!Re(t)){const i=e.get(t);t in Dc||(Dc[t]=i),r[5](t,Yi(i,n),i||rm)}},r[6],()=>!Re(t)&&t in Dc?Dc[t]:!Re(t)&&e.get(t)||rm]};let ty=!0;const yM=()=>ty,[ry,ny]=nc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Gn,Gn],gM=()=>{const e=ey&&document.visibilityState;return Re(e)||e!=="hidden"},xM=e=>(ey&&document.addEventListener("visibilitychange",e),ry("focus",e),()=>{ey&&document.removeEventListener("visibilitychange",e),ny("focus",e)}),bM=e=>{const t=()=>{ty=!0,e()},r=()=>{ty=!1};return ry("online",t),ry("offline",r),()=>{ny("online",t),ny("offline",r)}},wM={isOnline:yM,isVisible:gM},_M={initFocus:xM,initReconnect:bM},N1=!N.useId,Ro=!nc||mM,SM=e=>vM()?window.requestAnimationFrame(e):setTimeout(e,1),nm=Ro?j.useEffect:j.useLayoutEffect,im=typeof navigator<"u"&&navigator.connection,$1=!Ro&&im&&(["slow-2g","2g"].includes(im.effectiveType)||im.saveData),Lc=new WeakMap,OM=e=>Jv.prototype.toString.call(e),am=(e,t)=>e===`[object ${t}]`;let jM=0;const iy=e=>{const t=typeof e,r=OM(e),n=am(r,"Date"),i=am(r,"RegExp"),a=am(r,"Object");let o,s;if(Jv(e)===e&&!n&&!i){if(o=Lc.get(e),o)return o;if(o=++jM+"~",Lc.set(e,o),Array.isArray(e)){for(o="@",s=0;s{if(An(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?iy(e):"",[e,t]};let AM=0;const ay=()=>++AM;async function Zk(...e){const[t,r,n,i]=e,a=Yi({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let l=a.optimisticData;const u=p=>typeof s=="function"?s(p):s!==!1,f=a.throwOnError;if(An(r)){const p=r,h=[],x=t.keys();for(const v of x)!/^\$(inf|sub)\$/.test(v)&&p(t.get(v)._k)&&h.push(v);return Promise.all(h.map(c))}return c(r);async function c(p){const[h]=H0(p);if(!h)return;const[x,v]=Yk(t,h),[y,g,m,w]=Vn.get(t),S=()=>{const D=y[h];return(An(a.revalidate)?a.revalidate(x().data,p):a.revalidate!==!1)&&(delete m[h],delete w[h],D&&D[0])?D[0](qk).then(()=>x().data):x().data};if(e.length<3)return S();let b=n,_,O=!1;const k=ay();g[h]=[k,0];const P=!Re(l),R=x(),$=R.data,C=R._c,I=Re(C)?$:C;if(P&&(l=An(l)?l(I,$):l,v({data:l,_c:I})),An(b))try{b=b(I)}catch(D){_=D,O=!0}if(b&&Xk(b))if(b=await b.catch(D=>{_=D,O=!0}),k!==g[h][0]){if(O)throw _;return b}else O&&P&&u(_)&&(o=!0,v({data:I,_c:tr}));if(o&&!O)if(An(o)){const D=o(b,I);v({data:D,error:tr,_c:tr})}else v({data:b,error:tr,_c:tr});if(g[h][1]=ay(),Promise.resolve(S()).then(()=>{v({_c:tr})}),O){if(f)throw _;return}return b}}const R1=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},kM=(e,t)=>{if(!Vn.has(e)){const r=Yi(_M,t),n=Object.create(null),i=Zk.bind(tr,e);let a=Gn;const o=Object.create(null),s=(f,c)=>{const p=o[f]||[];return o[f]=p,p.push(c),()=>p.splice(p.indexOf(c),1)},l=(f,c,p)=>{e.set(f,c);const h=o[f];if(h)for(const x of h)x(c,p)},u=()=>{if(!Vn.has(e)&&(Vn.set(e,[n,Object.create(null),Object.create(null),Object.create(null),i,l,s]),!Ro)){const f=r.initFocus(setTimeout.bind(tr,R1.bind(tr,n,Gk))),c=r.initReconnect(setTimeout.bind(tr,R1.bind(tr,n,Kk)));a=()=>{f&&f(),c&&c(),Vn.delete(e)}}};return u(),[e,i,u,a]}return[e,Vn.get(e)[4]]},EM=(e,t,r,n,i)=>{const a=r.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!Re(a)&&o>a||setTimeout(n,s,i)},PM=Qv,[Qk,CM]=kM(new Map),TM=Yi({onLoadingSlow:Gn,onSuccess:Gn,onError:Gn,onErrorRetry:EM,onDiscarded:Gn,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:$1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:$1?5e3:3e3,compare:PM,isPaused:()=>!1,cache:Qk,mutate:CM,fallback:{}},wM),NM=(e,t)=>{const r=Yi(e,t);if(t){const{use:n,fallback:i}=e,{use:a,fallback:o}=t;n&&a&&(r.use=n.concat(a)),i&&o&&(r.fallback=Yi(i,o))}return r},$M=j.createContext({}),RM="$inf$",Jk=nc&&window.__SWR_DEVTOOLS_USE__,IM=Jk?window.__SWR_DEVTOOLS_USE__:[],MM=()=>{Jk&&(window.__SWR_DEVTOOLS_REACT__=N)},DM=e=>An(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],LM=()=>{const e=j.useContext($M);return j.useMemo(()=>Yi(TM,e),[e])},BM=e=>(t,r,n)=>e(t,r&&((...a)=>{const[o]=H0(t),[,,,s]=Vn.get(Qk);if(o.startsWith(RM))return r(...a);const l=s[o];return Re(l)?r(...a):(delete s[o],l)}),n),FM=IM.concat(BM),zM=e=>function(...r){const n=LM(),[i,a,o]=DM(r),s=NM(n,o);let l=e;const{use:u}=s,f=(u||[]).concat(FM);for(let c=f.length;c--;)l=f[c](l);return l(i,a||s.fetcher||null,s)},UM=(e,t,r)=>{const n=t[e]||(t[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i>=0&&(n[i]=n[n.length-1],n.pop())}};MM();const om=N.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),sm={dedupe:!0},I1=Promise.resolve(tr),VM=()=>Gn,WM=(e,t,r)=>{const{cache:n,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:p,strictServerPrefetchWarning:h}=r,[x,v,y,g]=Vn.get(n),[m,w]=H0(e),S=j.useRef(!1),b=j.useRef(!1),_=j.useRef(m),O=j.useRef(t),k=j.useRef(r),P=()=>k.current,R=()=>P().isVisible()&&P().isOnline(),[$,C,I,D]=Yk(n,m),L=j.useRef({}).current,z=Re(o)?Re(r.fallback)?tr:r.fallback[m]:o,U=(ve,Ae)=>{for(const $e in L){const Oe=$e;if(Oe==="data"){if(!i(ve[Oe],Ae[Oe])&&(!Re(ve[Oe])||!i(ue,Ae[Oe])))return!1}else if(Ae[Oe]!==ve[Oe])return!1}return!0},M=!S.current,B=j.useMemo(()=>{const ve=$(),Ae=D(),$e=T=>{const A=Yi(T);return delete A._k,(()=>{if(!m||!t||P().isPaused())return!1;if(M&&!Re(s))return s;const F=Re(z)?A.data:z;return Re(F)||l})()?{isValidating:!0,isLoading:!0,...A}:A},Oe=$e(ve),He=ve===Ae?Oe:$e(Ae);let Ue=Oe;return[()=>{const T=$e($());return U(T,Ue)?(Ue.data=T.data,Ue.isLoading=T.isLoading,Ue.isValidating=T.isValidating,Ue.error=T.error,Ue):(Ue=T,T)},()=>He]},[n,m]),W=Zv.useSyncExternalStore(j.useCallback(ve=>I(m,(Ae,$e)=>{U($e,Ae)||ve()}),[n,m]),B[0],B[1]),J=x[m]&&x[m].length>0,G=W.data,Q=Re(G)?z&&Xk(z)?om(z):z:G,X=W.error,de=j.useRef(Q),ue=p?Re(G)?Re(de.current)?Q:de.current:G:Q,Se=m&&Re(Q),_e=j.useRef(null);!Ro&&Zv.useSyncExternalStore(VM,()=>(_e.current=!1,_e),()=>(_e.current=!0,_e));const te=_e.current;h&&te&&!a&&Se&&console.warn(`Missing pre-initiated data for serialized key "${m}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const re=!m||!t||P().isPaused()||J&&!Re(X)?!1:M&&!Re(s)?s:a?Re(Q)?!1:l:Re(Q)||l,pe=M&&re,K=Re(W.isValidating)?pe:W.isValidating,Pe=Re(W.isLoading)?pe:W.isLoading,he=j.useCallback(async ve=>{const Ae=O.current;if(!m||!Ae||b.current||P().isPaused())return!1;let $e,Oe,He=!0;const Ue=ve||{},T=!y[m]||!Ue.dedupe,A=()=>N1?!b.current&&m===_.current&&S.current:m===_.current,E={isValidating:!1,isLoading:!1},F=()=>{C(E)},V=()=>{const Y=y[m];Y&&Y[1]===Oe&&delete y[m]},q={isValidating:!0};Re($().data)&&(q.isLoading=!0);try{if(T&&(C(q),r.loadingTimeout&&Re($().data)&&setTimeout(()=>{He&&A()&&P().onLoadingSlow(m,r)},r.loadingTimeout),y[m]=[Ae(w),ay()]),[$e,Oe]=y[m],$e=await $e,T&&setTimeout(V,r.dedupingInterval),!y[m]||y[m][1]!==Oe)return T&&A()&&P().onDiscarded(m),!1;E.error=tr;const Y=v[m];if(!Re(Y)&&(Oe<=Y[0]||Oe<=Y[1]||Y[1]===0))return F(),T&&A()&&P().onDiscarded(m),!1;const ie=$().data;E.data=i(ie,$e)?ie:$e,T&&A()&&P().onSuccess($e,m,r)}catch(Y){V();const ie=P(),{shouldRetryOnError:me}=ie;ie.isPaused()||(E.error=Y,T&&A()&&(ie.onError(Y,m,ie),(me===!0||An(me)&&me(Y))&&(!P().revalidateOnFocus||!P().revalidateOnReconnect||R())&&ie.onErrorRetry(Y,m,ie,bt=>{const Et=x[m];Et&&Et[0]&&Et[0](C1,bt)},{retryCount:(Ue.retryCount||0)+1,dedupe:!0})))}return He=!1,F(),!0},[m,n]),Me=j.useCallback((...ve)=>Zk(n,_.current,...ve),[]);if(nm(()=>{O.current=t,k.current=r,Re(G)||(de.current=G)}),nm(()=>{if(!m)return;const ve=he.bind(tr,sm);let Ae=0;P().revalidateOnFocus&&(Ae=Date.now()+P().focusThrottleInterval);const Oe=UM(m,x,(He,Ue={})=>{if(He==Gk){const T=Date.now();P().revalidateOnFocus&&T>Ae&&R()&&(Ae=T+P().focusThrottleInterval,ve())}else if(He==Kk)P().revalidateOnReconnect&&R()&&ve();else{if(He==qk)return he();if(He==C1)return he(Ue)}});return b.current=!1,_.current=m,S.current=!0,C({_k:w}),re&&(y[m]||(Re(Q)||Ro?ve():SM(ve))),()=>{b.current=!0,Oe()}},[m]),nm(()=>{let ve;function Ae(){const Oe=An(u)?u($().data):u;Oe&&ve!==-1&&(ve=setTimeout($e,Oe))}function $e(){!$().error&&(f||P().isVisible())&&(c||P().isOnline())?he(sm).then(Ae):Ae()}return Ae(),()=>{ve&&(clearTimeout(ve),ve=-1)}},[u,f,c,m]),j.useDebugValue(ue),a){if(!N1&&Ro&&Se)throw new Error("Fallback data is required when using Suspense in SSR.");Se&&(O.current=t,k.current=r,b.current=!1);const ve=g[m],Ae=!Re(ve)&&Se?Me(ve):I1;if(om(Ae),!Re(X)&&Se)throw X;const $e=Se?he(sm):I1;!Re(ue)&&Se&&($e.status="fulfilled",$e.value=!0),om($e)}return{mutate:Me,get data(){return L.data=!0,ue},get error(){return L.error=!0,X},get isValidating(){return L.isValidating=!0,K},get isLoading(){return L.isLoading=!0,Pe}}},vn=zM(WM);function Ce({children:e,className:t="",onClick:r}){return d.jsx("div",{className:`glass-panel rounded-[20px] ${r?"glass-panel-hover cursor-pointer":""} ${t}`,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:e})}function et({children:e,className:t=""}){return d.jsx("div",{className:`px-6 py-5 border-b border-slate-200 dark:border-[#1c1c1f] bg-slate-50 dark:bg-[#0c0c0e] rounded-t-[20px] ${t}`,children:e})}function Te({children:e,className:t=""}){return d.jsx("div",{className:`px-6 py-5 ${t}`,children:e})}const HM={green:"bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20",gray:"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8",blue:"bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20",red:"bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20",orange:"bg-orange-500/10 text-orange-400 ring-1 ring-inset ring-orange-500/20",purple:"bg-purple-500/10 text-purple-400 ring-1 ring-inset ring-purple-500/20"};function Qt({variant:e="gray",children:t}){return d.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${HM[e]}`,children:t})}function GM(){const[e,t]=j.useState("loading");return j.useEffect(()=>{console.log(` -[HEALTH CHECK] ${new Date().toISOString()}`),console.log("Fetching: GET /health"),fetch("/health").then(r=>{console.log(`[HEALTH CHECK] Response: ${r.status} ${r.statusText}`),t(r.ok?"up":"down")}).catch(r=>{console.log(`[HEALTH CHECK ERROR] ${r.message}`),t("down")})},[]),e}function KM(){var l,u;const e=bp(),{merchantId:t}=na(),r=GM(),{data:n}=vn(t?`/routing/list/active/${t}`:null,()=>ft(`/routing/list/active/${t}`),{shouldRetryOnError:!1}),{data:i,error:a}=vn(t?["/rule/get","successRate",t]:null,()=>ft("/rule/get",{merchant_id:t,algorithm:"successRate"})),o=n&&n.length>0?n[0]:null,s=(n||[]).some(f=>{var c;return((c=f.algorithm_data||f.algorithm)==null?void 0:c.type)==="advanced"});return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Overview"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Decision Engine routing health and status"})]}),!t&&d.jsxs("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 flex items-center gap-2 text-sm text-yellow-800",children:[d.jsx(vI,{size:16}),"Set your Merchant ID in the top bar to load configuration."]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[d.jsx(Ce,{children:d.jsxs(Te,{className:"flex items-center gap-3",children:[r==="up"?d.jsx(yI,{className:"text-green-500",size:24}):r==="down"?d.jsx(gI,{className:"text-red-500",size:24}):d.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-gray-200 border-t-gray-500 animate-spin"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500",children:"API Health"}),d.jsx("p",{className:"text-sm font-medium",children:r==="up"?"Healthy":r==="down"?"Down":"Checking..."})]})]})}),d.jsx(Ce,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:d.jsxs(Te,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Active Routing Rule"}),t?o?d.jsxs("div",{children:[d.jsx(Qt,{variant:"green",children:"Active"}),d.jsx("p",{className:"text-sm font-medium mt-1 truncate",children:o.name}),d.jsx("p",{className:"text-xs text-slate-400",children:(l=o.algorithm_data||o.algorithm)==null?void 0:l.type})]}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})}),d.jsx(Ce,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/sr"),children:d.jsxs(Te,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Auth-Rate Config"}),t?a?d.jsx(Qt,{variant:"gray",children:"Not Configured"}):i!=null&&i.data?d.jsx(Qt,{variant:"green",children:"Configured"}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})}),d.jsx(Ce,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/rules"),children:d.jsxs(Te,{children:[d.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Rule-Based Routing"}),t?s?d.jsx(Qt,{variant:"green",children:"Configured"}):d.jsx(Qt,{variant:"gray",children:"Not Configured"}):d.jsx(Qt,{variant:"gray",children:"Not set"})]})})]}),o&&d.jsxs(Ce,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Routing Configuration"})}),d.jsx(Te,{children:d.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Name"}),d.jsx("dd",{className:"font-medium",children:o.name})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Type"}),d.jsx("dd",{className:"font-medium capitalize",children:(u=o.algorithm_data||o.algorithm)==null?void 0:u.type})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"Algorithm For"}),d.jsx("dd",{className:"font-medium capitalize",children:o.algorithm_for})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-slate-500",children:"ID"}),d.jsx("dd",{className:"font-mono text-xs text-slate-600",children:o.id})]})]})})]})]})}function qM(){const e=bp(),{merchantId:t}=na(),{data:r}=vn(t?`/routing/list/active/${t}`:null,()=>ft(`/routing/list/active/${t}`)),{data:n}=vn(t?["/rule/get","successRate",t]:null,()=>ft("/rule/get",{merchant_id:t,algorithm:"successRate"})),i=[{id:"sr",title:"Auth-Rate Based Routing",description:"Dynamically route to the best-performing gateway based on real-time authorization rates.",icon:Bk,route:"/routing/sr",algorithmType:"successRate",checkConfigured:()=>{var a;return!!((a=n==null?void 0:n.config)!=null&&a.data)}},{id:"rules",title:"Rule-Based Routing",description:"Declarative Euclid DSL rules to route payments based on conditions and attributes.",icon:_I,route:"/routing/rules",algorithmType:"advanced",checkConfigured:()=>(r||[]).some(a=>{var o;return((o=a.algorithm_data||a.algorithm)==null?void 0:o.type)==="advanced"})},{id:"volume",title:"Volume Split",description:"Distribute payment traffic across gateways by configurable percentage splits.",icon:Wf,route:"/routing/volume",algorithmType:"volume_split",checkConfigured:()=>(r||[]).some(a=>{var o;return((o=a.algorithm_data||a.algorithm)==null?void 0:o.type)==="volume_split"})},{id:"debit",title:"Network Routing",description:"Optimise debit network fees with acquirer-aware network-based routing.",icon:xI,route:"/routing/debit",algorithmType:"debitRouting",checkConfigured:()=>!1}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Routing Hub"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Click on any routing strategy to configure"})]}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:i.map(a=>{const o=a.icon,s=a.checkConfigured();return d.jsx(Ce,{className:"flex flex-col hover:border-brand-300 cursor-pointer transition-all hover:shadow-md",onClick:()=>e(a.route),children:d.jsxs(Te,{className:"flex-1 flex flex-col gap-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"p-2 bg-brand-50 rounded-lg border border-[#1c2d50]",children:d.jsx(o,{size:20,className:"text-brand-500"})}),d.jsx(Qt,{variant:s?"green":"gray",children:s?"Configured":"Not Configured"})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-slate-900",children:a.title}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:a.description})]}),d.jsx("div",{className:"mt-auto pt-2",children:d.jsx("span",{className:"text-sm text-brand-600 font-medium",children:s?"Manage →":"Setup →"})})]})},a.id)})})]})}var ic=e=>e.type==="checkbox",_a=e=>e instanceof Date,pr=e=>e==null;const eE=e=>typeof e=="object";var St=e=>!pr(e)&&!Array.isArray(e)&&eE(e)&&!_a(e),XM=e=>St(e)&&e.target?ic(e.target)?e.target.checked:e.target.value:e,YM=(e,t)=>t.split(".").some((r,n,i)=>!isNaN(Number(r))&&e.has(i.slice(0,n).join("."))),ZM=e=>{const t=e.constructor&&e.constructor.prototype;return St(t)&&t.hasOwnProperty("isPrototypeOf")},G0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ot(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(G0&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(St(e)&&ZM(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=ot(e[i]));return n}var Op=e=>/^\w*$/.test(e),Qe=e=>e===void 0,jp=e=>Array.isArray(e)?e.filter(Boolean):[],K0=e=>jp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(e,t,r)=>{if(!t||!St(e))return r;const n=(Op(t)?[t]:K0(t)).reduce((i,a)=>pr(i)?i:i[a],e);return Qe(n)||n===e?Qe(e[t])?r:e[t]:n},On=e=>typeof e=="boolean",fn=e=>typeof e=="function",We=(e,t,r)=>{let n=-1;const i=Op(t)?[t]:K0(t),a=i.length,o=a-1;for(;++nN.useContext(rE);var JM=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Hr.all&&(t._proxyFormState[o]=!n||Hr.all),e[o]}});return i};const nE=typeof window<"u"?N.useLayoutEffect:N.useEffect;var ar=e=>typeof e=="string",eD=(e,t,r,n,i)=>ar(e)?(n&&t.watch.add(e),ae(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),ae(r,a))):(n&&(t.watchAll=!0),r),oy=e=>pr(e)||!eE(e);function Ci(e,t,r=new WeakSet){if(oy(e)||oy(t))return Object.is(e,t);if(_a(e)&&_a(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const o=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const s=t[a];if(_a(o)&&_a(s)||(St(o)||Array.isArray(o))&&(St(s)||Array.isArray(s))?!Ci(o,s,r):!Object.is(o,s))return!1}}return!0}const tD=N.createContext(null);tD.displayName="HookFormContext";var iE=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},vr=e=>Array.isArray(e)?e:[e],M1=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}};function aE(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],a=t[n];if(i&&St(i)&&a){const o=aE(i,a);St(o)&&(r[n]=o)}else e[n]&&(r[n]=a)}return r}var Zt=e=>St(e)&&!Object.keys(e).length,q0=e=>e.type==="file",Hf=e=>{if(!G0)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},oE=e=>e.type==="select-multiple",X0=e=>e.type==="radio",rD=e=>X0(e)||ic(e),um=e=>Hf(e)&&e.isConnected;function nD(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(fn(e[t]))return!0;return!1};function sE(e){return Array.isArray(e)||St(e)&&!aD(e)}function sy(e,t={}){for(const r in e){const n=e[r];sE(n)?(t[r]=Array.isArray(n)?[]:{},sy(n,t[r])):Qe(n)||(t[r]=!0)}return t}function wl(e,t,r){r||(r=sy(t));for(const n in e){const i=e[n];if(sE(i))Qe(t)||oy(r[n])?r[n]=sy(i,Array.isArray(i)?[]:{}):wl(i,pr(t)?{}:t[n],r[n]);else{const a=t[n];r[n]=!Ci(i,a)}}return r}const D1={value:!1,isValid:!1},L1={value:!0,isValid:!0};var lE=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Qe(e[0].attributes.value)?Qe(e[0].value)||e[0].value===""?L1:{value:e[0].value,isValid:!0}:L1:D1}return D1},uE=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Qe(e)?e:t?e===""?NaN:e&&+e:r&&ar(e)?new Date(e):n?n(e):e;const B1={isValid:!1,value:null};var cE=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,B1):B1;function F1(e){const t=e.ref;return q0(t)?t.files:X0(t)?cE(e.refs).value:oE(t)?[...t.selectedOptions].map(({value:r})=>r):ic(t)?lE(e.refs).value:uE(Qe(t.value)?e.ref.value:t.value,e)}var oD=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,sD=(e,t,r,n)=>{const i={};for(const a of e){const o=ae(t,a);o&&We(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Gf=e=>e instanceof RegExp,nl=e=>Qe(e)?e:Gf(e)?e.source:St(e)?Gf(e.value)?e.value.source:e.value:e,_o=e=>({isOnSubmit:!e||e===Hr.onSubmit,isOnBlur:e===Hr.onBlur,isOnChange:e===Hr.onChange,isOnAll:e===Hr.all,isOnTouch:e===Hr.onTouched});const z1="AsyncFunction";var lD=e=>!!e&&!!e.validate&&!!(fn(e.validate)&&e.validate.constructor.name===z1||St(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===z1)),uD=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ly=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Io=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=ae(e,i);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Io(s,t))break}else if(St(s)&&Io(s,t))break}}};function U1(e,t,r){const n=ae(e,r);if(n||Op(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=ae(t,a),s=ae(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};i.pop()}return{name:r}}var cD=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return Zt(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||Hr.all))},fD=(e,t,r)=>!e||!t||e===t||vr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),dD=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,pD=(e,t)=>!jp(ae(e,t)).length&&wt(e,t),fE=(e,t,r)=>{const n=vr(ae(e,r));return We(n,tE,t[r]),We(e,r,n),e};function V1(e,t,r="validate"){if(ar(e)||Array.isArray(e)&&e.every(ar)||On(e)&&!e)return{type:r,message:ar(e)?e:"",ref:t}}var no=e=>St(e)&&!Gf(e)?e:{value:e,message:""},uy=async(e,t,r,n,i,a)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:f,min:c,max:p,pattern:h,validate:x,name:v,valueAsNumber:y,mount:g}=e._f,m=ae(r,v);if(!g||t.has(v))return{};const w=s?s[0]:o,S=C=>{i&&w.reportValidity&&(w.setCustomValidity(On(C)?"":C||""),w.reportValidity())},b={},_=X0(o),O=ic(o),k=_||O,P=(y||q0(o))&&Qe(o.value)&&Qe(m)||Hf(o)&&o.value===""||m===""||Array.isArray(m)&&!m.length,R=iE.bind(null,v,n,b),$=(C,I,D,L=on.maxLength,z=on.minLength)=>{const U=C?I:D;b[v]={type:C?L:z,message:U,ref:o,...R(C?L:z,U)}};if(a?!Array.isArray(m)||!m.length:l&&(!k&&(P||pr(m))||On(m)&&!m||O&&!lE(s).isValid||_&&!cE(s).isValid)){const{value:C,message:I}=ar(l)?{value:!!l,message:l}:no(l);if(C&&(b[v]={type:on.required,message:I,ref:w,...R(on.required,I)},!n))return S(I),b}if(!P&&(!pr(c)||!pr(p))){let C,I;const D=no(p),L=no(c);if(!pr(m)&&!isNaN(m)){const z=o.valueAsNumber||m&&+m;pr(D.value)||(C=z>D.value),pr(L.value)||(I=znew Date(new Date().toDateString()+" "+W),M=o.type=="time",B=o.type=="week";ar(D.value)&&m&&(C=M?U(m)>U(D.value):B?m>D.value:z>new Date(D.value)),ar(L.value)&&m&&(I=M?U(m)+C.value,L=!pr(I.value)&&m.length<+I.value;if((D||L)&&($(D,C.message,I.message),!n))return S(b[v].message),b}if(h&&!P&&ar(m)){const{value:C,message:I}=no(h);if(Gf(C)&&!m.match(C)&&(b[v]={type:on.pattern,message:I,ref:o,...R(on.pattern,I)},!n))return S(I),b}if(x){if(fn(x)){const C=await x(m,r),I=V1(C,w);if(I&&(b[v]={...I,...R(on.validate,I.message)},!n))return S(I.message),b}else if(St(x)){let C={};for(const I in x){if(!Zt(C)&&!n)break;const D=V1(await x[I](m,r),w,I);D&&(C={...D,...R(I,D.message)},S(D.message),n&&(b[v]=C))}if(!Zt(C)&&(b[v]={ref:w,...C},!n))return b}}return S(!0),b};const hD={mode:Hr.onSubmit,reValidateMode:Hr.onChange,shouldFocusError:!0};function mD(e={}){let t={...hD,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:fn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=St(t.defaultValues)||St(t.values)?ot(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ot(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},c={...f};let p={...c};const h={array:M1(),state:M1()},x=t.criteriaMode===Hr.all,v=T=>A=>{clearTimeout(u),u=setTimeout(T,A)},y=async T=>{if(!o.keepIsValid&&!t.disabled&&(c.isValid||p.isValid||T)){let A;t.resolver?(A=Zt((await P()).errors),g()):A=await C({fields:n,onlyCheckValid:!0,eventType:ro.VALID}),A!==r.isValid&&h.state.next({isValid:A})}},g=(T,A)=>{!t.disabled&&(c.isValidating||c.validatingFields||p.isValidating||p.validatingFields)&&((T||Array.from(s.mount)).forEach(E=>{E&&(A?We(r.validatingFields,E,A):wt(r.validatingFields,E))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Zt(r.validatingFields)}))},m=T=>{const A=wl(i,a),E=oD(T);We(r.dirtyFields,E,ae(A,E))},w=(T,A=[],E,F,V=!0,q=!0)=>{if(F&&E&&!t.disabled){if(o.action=!0,q&&Array.isArray(ae(n,T))){const Y=E(ae(n,T),F.argA,F.argB);V&&We(n,T,Y)}if(q&&Array.isArray(ae(r.errors,T))){const Y=E(ae(r.errors,T),F.argA,F.argB);V&&We(r.errors,T,Y),pD(r.errors,T)}if((c.touchedFields||p.touchedFields)&&q&&Array.isArray(ae(r.touchedFields,T))){const Y=E(ae(r.touchedFields,T),F.argA,F.argB);V&&We(r.touchedFields,T,Y)}(c.dirtyFields||p.dirtyFields)&&m(T),h.state.next({name:T,isDirty:D(T,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else We(a,T,A)},S=(T,A)=>{We(r.errors,T,A),h.state.next({errors:r.errors})},b=T=>{r.errors=T,h.state.next({errors:r.errors,isValid:!1})},_=(T,A,E,F)=>{const V=ae(n,T);if(V){const q=ae(a,T,Qe(E)?ae(i,T):E);Qe(q)||F&&F.defaultChecked||A?We(a,T,A?q:F1(V._f)):U(T,q),o.mount&&!o.action&&y()}},O=(T,A,E,F,V)=>{let q=!1,Y=!1;const ie={name:T};if(!t.disabled){if(!E||F){(c.isDirty||p.isDirty)&&(Y=r.isDirty,r.isDirty=ie.isDirty=D(),q=Y!==ie.isDirty);const me=Ci(ae(i,T),A);Y=!!ae(r.dirtyFields,T),me?wt(r.dirtyFields,T):We(r.dirtyFields,T,!0),ie.dirtyFields=r.dirtyFields,q=q||(c.dirtyFields||p.dirtyFields)&&Y!==!me}if(E){const me=ae(r.touchedFields,T);me||(We(r.touchedFields,T,E),ie.touchedFields=r.touchedFields,q=q||(c.touchedFields||p.touchedFields)&&me!==E)}q&&V&&h.state.next(ie)}return q?ie:{}},k=(T,A,E,F)=>{const V=ae(r.errors,T),q=(c.isValid||p.isValid)&&On(A)&&r.isValid!==A;if(t.delayError&&E?(l=v(()=>S(T,E)),l(t.delayError)):(clearTimeout(u),l=null,E?We(r.errors,T,E):wt(r.errors,T)),(E?!Ci(V,E):V)||!Zt(F)||q){const Y={...F,...q&&On(A)?{isValid:A}:{},errors:r.errors,name:T};r={...r,...Y},h.state.next(Y)}},P=async T=>(g(T,!0),await t.resolver(a,t.context,sD(T||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),R=async T=>{const{errors:A}=await P(T);if(g(T),T)for(const E of T){const F=ae(A,E);F?We(r.errors,E,F):wt(r.errors,E)}else r.errors=A;return A},$=async({name:T,eventType:A})=>{if(e.validate){const E=await e.validate({formValues:a,formState:r,name:T,eventType:A});if(St(E))for(const F in E)E[F]&&ue(`${lm}.${F}`,{message:ar(E.message)?E.message:"",type:on.validate});else ar(E)||!E?ue(lm,{message:E||"",type:on.validate}):de(lm);return E}return!0},C=async({fields:T,onlyCheckValid:A,name:E,eventType:F,context:V={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(V.runRootValidation=!0,!await $({name:E,eventType:F})&&(V.valid=!1,A)))return V.valid;for(const q in T){const Y=T[q];if(Y){const{_f:ie,...me}=Y;if(ie){const bt=s.array.has(ie.name),Et=Y._f&&lD(Y._f);Et&&c.validatingFields&&g([ie.name],!0);const Pt=await uy(Y,s.disabled,a,x,t.shouldUseNativeValidation&&!A,bt);if(Et&&c.validatingFields&&g([ie.name]),Pt[ie.name]&&(V.valid=!1,A)||(!A&&(ae(Pt,ie.name)?bt?fE(r.errors,Pt,ie.name):We(r.errors,ie.name,Pt[ie.name]):wt(r.errors,ie.name)),e.shouldUseNativeValidation&&Pt[ie.name]))break}!Zt(me)&&await C({context:V,onlyCheckValid:A,fields:me,name:q,eventType:F})}}return V.valid},I=()=>{for(const T of s.unMount){const A=ae(n,T);A&&(A._f.refs?A._f.refs.every(E=>!um(E)):!um(A._f.ref))&&re(T)}s.unMount=new Set},D=(T,A)=>!t.disabled&&(T&&A&&We(a,T,A),!Ci(Q(),i)),L=(T,A,E)=>eD(T,s,{...o.mount?a:Qe(A)?i:ar(T)?{[T]:A}:A},E,A),z=T=>jp(ae(o.mount?a:i,T,t.shouldUnregister?ae(i,T,[]):[])),U=(T,A,E={})=>{const F=ae(n,T);let V=A;if(F){const q=F._f;q&&(!q.disabled&&We(a,T,uE(A,q)),V=Hf(q.ref)&&pr(A)?"":A,oE(q.ref)?[...q.ref.options].forEach(Y=>Y.selected=V.includes(Y.value)):q.refs?ic(q.ref)?q.refs.forEach(Y=>{(!Y.defaultChecked||!Y.disabled)&&(Array.isArray(V)?Y.checked=!!V.find(ie=>ie===Y.value):Y.checked=V===Y.value||!!V)}):q.refs.forEach(Y=>Y.checked=Y.value===V):q0(q.ref)?q.ref.value="":(q.ref.value=V,q.ref.type||h.state.next({name:T,values:ot(a)})))}(E.shouldDirty||E.shouldTouch)&&O(T,V,E.shouldTouch,E.shouldDirty,!0),E.shouldValidate&&G(T)},M=(T,A,E)=>{for(const F in A){if(!A.hasOwnProperty(F))return;const V=A[F],q=T+"."+F,Y=ae(n,q);(s.array.has(T)||St(V)||Y&&!Y._f)&&!_a(V)?M(q,V,E):U(q,V,E)}},B=(T,A,E={})=>{const F=ae(n,T),V=s.array.has(T),q=ot(A);We(a,T,q),V?(h.array.next({name:T,values:ot(a)}),(c.isDirty||c.dirtyFields||p.isDirty||p.dirtyFields)&&E.shouldDirty&&(m(T),h.state.next({name:T,dirtyFields:r.dirtyFields,isDirty:D(T,q)}))):F&&!F._f&&!pr(q)?M(T,q,E):U(T,q,E),ly(T,s)?h.state.next({...r,name:T,values:ot(a)}):h.state.next({name:o.mount?T:void 0,values:ot(a)})},W=async T=>{o.mount=!0;const A=T.target;let E=A.name,F=!0;const V=ae(n,E),q=me=>{F=Number.isNaN(me)||_a(me)&&isNaN(me.getTime())||Ci(me,ae(a,E,me))},Y=_o(t.mode),ie=_o(t.reValidateMode);if(V){let me,bt;const Et=A.type?F1(V._f):XM(T),Pt=T.type===ro.BLUR||T.type===ro.FOCUS_OUT,Ws=!uD(V._f)&&!e.validate&&!t.resolver&&!ae(r.errors,E)&&!V._f.deps||dD(Pt,ae(r.touchedFields,E),r.isSubmitted,ie,Y),Ja=ly(E,s,Pt);We(a,E,Et),Pt?(!A||!A.readOnly)&&(V._f.onBlur&&V._f.onBlur(T),l&&l(0)):V._f.onChange&&V._f.onChange(T);const Hs=O(E,Et,Pt),mc=!Zt(Hs)||Ja;if(!Pt&&h.state.next({name:E,type:T.type,values:ot(a)}),Ws)return(c.isValid||p.isValid)&&(t.mode==="onBlur"?Pt&&y():Pt||y()),mc&&h.state.next({name:E,...Ja?{}:Hs});if(!t.resolver&&e.validate&&await $({name:E,eventType:T.type}),!Pt&&Ja&&h.state.next({...r}),t.resolver){const{errors:vc}=await P([E]);if(g([E]),q(Et),F){const Oh=U1(r.errors,n,E),yc=U1(vc,n,Oh.name||E);me=yc.error,E=yc.name,bt=Zt(vc)}}else g([E],!0),me=(await uy(V,s.disabled,a,x,t.shouldUseNativeValidation))[E],g([E]),q(Et),F&&(me?bt=!1:(c.isValid||p.isValid)&&(bt=await C({fields:n,onlyCheckValid:!0,name:E,eventType:T.type})));F&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&G(V._f.deps),k(E,bt,me,Hs))}},J=(T,A)=>{if(ae(r.errors,A)&&T.focus)return T.focus(),1},G=async(T,A={})=>{let E,F;const V=vr(T);if(t.resolver){const q=await R(Qe(T)?T:V);E=Zt(q),F=T?!V.some(Y=>ae(q,Y)):E}else T?(F=(await Promise.all(V.map(async q=>{const Y=ae(n,q);return await C({fields:Y&&Y._f?{[q]:Y}:Y,eventType:ro.TRIGGER})}))).every(Boolean),!(!F&&!r.isValid)&&y()):F=E=await C({fields:n,name:T,eventType:ro.TRIGGER});return h.state.next({...!ar(T)||(c.isValid||p.isValid)&&E!==r.isValid?{}:{name:T},...t.resolver||!T?{isValid:E}:{},errors:r.errors}),A.shouldFocus&&!F&&Io(n,J,T?V:s.mount),F},Q=(T,A)=>{let E={...o.mount?a:i};return A&&(E=aE(A.dirtyFields?r.dirtyFields:r.touchedFields,E)),Qe(T)?E:ar(T)?ae(E,T):T.map(F=>ae(E,F))},X=(T,A)=>({invalid:!!ae((A||r).errors,T),isDirty:!!ae((A||r).dirtyFields,T),error:ae((A||r).errors,T),isValidating:!!ae(r.validatingFields,T),isTouched:!!ae((A||r).touchedFields,T)}),de=T=>{const A=T?vr(T):void 0;A==null||A.forEach(E=>wt(r.errors,E)),A?A.forEach(E=>{h.state.next({name:E,errors:r.errors})}):h.state.next({errors:{}})},ue=(T,A,E)=>{const F=(ae(n,T,{_f:{}})._f||{}).ref,V=ae(r.errors,T)||{},{ref:q,message:Y,type:ie,...me}=V;We(r.errors,T,{...me,...A,ref:F}),h.state.next({name:T,errors:r.errors,isValid:!1}),E&&E.shouldFocus&&F&&F.focus&&F.focus()},Se=(T,A)=>fn(T)?h.state.subscribe({next:E=>"values"in E&&T(L(void 0,A),E)}):L(T,A,!0),_e=T=>h.state.subscribe({next:A=>{fD(T.name,A.name,T.exact)&&cD(A,T.formState||c,Oe,T.reRenderRoot)&&T.callback({values:{...a},...r,...A,defaultValues:i})}}).unsubscribe,te=T=>(o.mount=!0,p={...p,...T.formState},_e({...T,formState:{...f,...T.formState}})),re=(T,A={})=>{for(const E of T?vr(T):s.mount)s.mount.delete(E),s.array.delete(E),A.keepValue||(wt(n,E),wt(a,E)),!A.keepError&&wt(r.errors,E),!A.keepDirty&&wt(r.dirtyFields,E),!A.keepTouched&&wt(r.touchedFields,E),!A.keepIsValidating&&wt(r.validatingFields,E),!t.shouldUnregister&&!A.keepDefaultValue&&wt(i,E);h.state.next({values:ot(a)}),h.state.next({...r,...A.keepDirty?{isDirty:D()}:{}}),!A.keepIsValid&&y()},pe=({disabled:T,name:A})=>{if(On(T)&&o.mount||T||s.disabled.has(A)){const V=s.disabled.has(A)!==!!T;T?s.disabled.add(A):s.disabled.delete(A),V&&o.mount&&!o.action&&y()}},K=(T,A={})=>{let E=ae(n,T);const F=On(A.disabled)||On(t.disabled),V=!s.registerName.has(T)&&E&&!E._f.mount;return We(n,T,{...E||{},_f:{...E&&E._f?E._f:{ref:{name:T}},name:T,mount:!0,...A}}),s.mount.add(T),E&&!V?pe({disabled:On(A.disabled)?A.disabled:t.disabled,name:T}):_(T,!0,A.value),{...F?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:nl(A.min),max:nl(A.max),minLength:nl(A.minLength),maxLength:nl(A.maxLength),pattern:nl(A.pattern)}:{},name:T,onChange:W,onBlur:W,ref:q=>{if(q){s.registerName.add(T),K(T,A),s.registerName.delete(T),E=ae(n,T);const Y=Qe(q.value)&&q.querySelectorAll&&q.querySelectorAll("input,select,textarea")[0]||q,ie=rD(Y),me=E._f.refs||[];if(ie?me.find(bt=>bt===Y):Y===E._f.ref)return;We(n,T,{_f:{...E._f,...ie?{refs:[...me.filter(um),Y,...Array.isArray(ae(i,T))?[{}]:[]],ref:{type:Y.type,name:T}}:{ref:Y}}}),_(T,!1,void 0,Y)}else E=ae(n,T,{}),E._f&&(E._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(YM(s.array,T)&&o.action)&&s.unMount.add(T)}}},Pe=()=>t.shouldFocusError&&Io(n,J,s.mount),he=T=>{On(T)&&(h.state.next({disabled:T}),Io(n,(A,E)=>{const F=ae(n,E);F&&(A.disabled=F._f.disabled||T,Array.isArray(F._f.refs)&&F._f.refs.forEach(V=>{V.disabled=F._f.disabled||T}))},0,!1))},Me=(T,A)=>async E=>{let F;E&&(E.preventDefault&&E.preventDefault(),E.persist&&E.persist());let V=ot(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:q,values:Y}=await P();g(),r.errors=q,V=ot(Y)}else await C({fields:n,eventType:ro.SUBMIT});if(s.disabled.size)for(const q of s.disabled)wt(V,q);if(wt(r.errors,tE),Zt(r.errors)){h.state.next({errors:{}});try{await T(V,E)}catch(q){F=q}}else A&&await A({...r.errors},E),Pe(),setTimeout(Pe);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Zt(r.errors)&&!F,submitCount:r.submitCount+1,errors:r.errors}),F)throw F},Be=(T,A={})=>{ae(n,T)&&(Qe(A.defaultValue)?B(T,ot(ae(i,T))):(B(T,A.defaultValue),We(i,T,ot(A.defaultValue))),A.keepTouched||wt(r.touchedFields,T),A.keepDirty||(wt(r.dirtyFields,T),r.isDirty=A.defaultValue?D(T,ot(ae(i,T))):D()),A.keepError||(wt(r.errors,T),c.isValid&&y()),h.state.next({...r}))},ve=(T,A={})=>{const E=T?ot(T):i,F=ot(E),V=Zt(T),q=V?i:F;if(A.keepDefaultValues||(i=E),!A.keepValues){if(A.keepDirtyValues){const Y=new Set([...s.mount,...Object.keys(wl(i,a))]);for(const ie of Array.from(Y)){const me=ae(r.dirtyFields,ie),bt=ae(a,ie),Et=ae(q,ie);me&&!Qe(bt)?We(q,ie,bt):!me&&!Qe(Et)&&B(ie,Et)}}else{if(G0&&Qe(T))for(const Y of s.mount){const ie=ae(n,Y);if(ie&&ie._f){const me=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(Hf(me)){const bt=me.closest("form");if(bt){bt.reset();break}}}}if(A.keepFieldsRef)for(const Y of s.mount)B(Y,ae(q,Y));else n={}}a=t.shouldUnregister?A.keepDefaultValues?ot(i):{}:ot(q),h.array.next({values:{...q}}),h.state.next({values:{...q}})}s={mount:A.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!c.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!t.shouldUnregister&&!Zt(q),o.watch=!!t.shouldUnregister,o.keepIsValid=!!A.keepIsValid,o.action=!1,A.keepErrors||(r.errors={}),h.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:V?!1:A.keepDirty?r.isDirty:!!(A.keepDefaultValues&&!Ci(T,i)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:V?{}:A.keepDirtyValues?A.keepDefaultValues&&a?wl(i,a):r.dirtyFields:A.keepDefaultValues&&T?wl(i,T):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Ae=(T,A)=>ve(fn(T)?T(a):T,{...t.resetOptions,...A}),$e=(T,A={})=>{const E=ae(n,T),F=E&&E._f;if(F){const V=F.refs?F.refs[0]:F.ref;V.focus&&setTimeout(()=>{V.focus(),A.shouldSelect&&fn(V.select)&&V.select()})}},Oe=T=>{r={...r,...T}},Ue={control:{register:K,unregister:re,getFieldState:X,handleSubmit:Me,setError:ue,_subscribe:_e,_runSchema:P,_updateIsValidating:g,_focusError:Pe,_getWatch:L,_getDirty:D,_setValid:y,_setFieldArray:w,_setDisabledField:pe,_setErrors:b,_getFieldArray:z,_reset:ve,_resetDefaultValues:()=>fn(t.defaultValues)&&t.defaultValues().then(T=>{Ae(T,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:he,_subjects:h,_proxyFormState:c,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(T){o=T},get _defaultValues(){return i},get _names(){return s},set _names(T){s=T},get _formState(){return r},get _options(){return t},set _options(T){t={...t,...T}}},subscribe:te,trigger:G,register:K,handleSubmit:Me,watch:Se,setValue:B,getValues:Q,reset:Ae,resetField:Be,clearErrors:de,unregister:re,setError:ue,setFocus:$e,getFieldState:X};return{...Ue,formControl:Ue}}var wi=()=>{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 r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},cm=(e,t,r={})=>r.shouldFocus||Qe(r.shouldFocus)?r.focusName||`${e}.${Qe(r.focusIndex)?t:r.focusIndex}.`:"",fm=(e,t)=>[...e,...vr(t)],dm=e=>Array.isArray(e)?e.map(()=>{}):void 0;function pm(e,t,r){return[...e.slice(0,t),...vr(r),...e.slice(t)]}var hm=(e,t,r)=>Array.isArray(e)?(Qe(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],mm=(e,t)=>[...vr(t),...vr(e)];function vD(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return jp(n).length?n:[]}var vm=(e,t)=>Qe(t)?[]:vD(e,vr(t).sort((r,n)=>r-n)),ym=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},W1=(e,t,r)=>(e[t]=r,e);function yD(e){const t=QM(),{control:r=t,name:n,keyName:i="id",shouldUnregister:a,rules:o}=e,[s,l]=N.useState(r._getFieldArray(n)),u=N.useRef(r._getFieldArray(n).map(wi)),f=N.useRef(!1);r._names.array.add(n),N.useMemo(()=>o&&s.length>=0&&r.register(n,o),[r,n,s.length,o]),nE(()=>r._subjects.array.subscribe({next:({values:S,name:b})=>{if(b===n||!b){const _=ae(S,n);Array.isArray(_)&&(l(_),u.current=_.map(wi))}}}).unsubscribe,[r,n]);const c=N.useCallback(S=>{f.current=!0,r._setFieldArray(n,S)},[r,n]),p=(S,b)=>{const _=vr(ot(S)),O=fm(r._getFieldArray(n),_);r._names.focus=cm(n,O.length-1,b),u.current=fm(u.current,_.map(wi)),c(O),l(O),r._setFieldArray(n,O,fm,{argA:dm(S)})},h=(S,b)=>{const _=vr(ot(S)),O=mm(r._getFieldArray(n),_);r._names.focus=cm(n,0,b),u.current=mm(u.current,_.map(wi)),c(O),l(O),r._setFieldArray(n,O,mm,{argA:dm(S)})},x=S=>{const b=vm(r._getFieldArray(n),S);u.current=vm(u.current,S),c(b),l(b),!Array.isArray(ae(r._fields,n))&&We(r._fields,n,void 0),r._setFieldArray(n,b,vm,{argA:S})},v=(S,b,_)=>{const O=vr(ot(b)),k=pm(r._getFieldArray(n),S,O);r._names.focus=cm(n,S,_),u.current=pm(u.current,S,O.map(wi)),c(k),l(k),r._setFieldArray(n,k,pm,{argA:S,argB:dm(b)})},y=(S,b)=>{const _=r._getFieldArray(n);ym(_,S,b),ym(u.current,S,b),c(_),l(_),r._setFieldArray(n,_,ym,{argA:S,argB:b},!1)},g=(S,b)=>{const _=r._getFieldArray(n);hm(_,S,b),hm(u.current,S,b),c(_),l(_),r._setFieldArray(n,_,hm,{argA:S,argB:b},!1)},m=(S,b)=>{const _=ot(b),O=W1(r._getFieldArray(n),S,_);u.current=[...O].map((k,P)=>!k||P===S?wi():u.current[P]),c(O),l([...O]),r._setFieldArray(n,O,W1,{argA:S,argB:_},!0,!1)},w=S=>{const b=vr(ot(S));u.current=b.map(wi),c([...b]),l([...b]),r._setFieldArray(n,[...b],_=>_,{},!0,!1)};return N.useEffect(()=>{if(r._state.action=!1,ly(n,r._names)&&r._subjects.state.next({...r._formState}),f.current&&(!_o(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!_o(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{r._updateIsValidating([n]);const b=ae(S.errors,n),_=ae(r._formState.errors,n);(_?!b&&_.type||b&&(_.type!==b.type||_.message!==b.message):b&&b.type)&&(b?We(r._formState.errors,n,b):wt(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=ae(r._fields,n);S&&S._f&&!(_o(r._options.reValidateMode).isOnSubmit&&_o(r._options.mode).isOnSubmit)&&uy(S,r._names.disabled,r._formValues,r._options.criteriaMode===Hr.all,r._options.shouldUseNativeValidation,!0).then(b=>!Zt(b)&&r._subjects.state.next({errors:fE(r._formState.errors,b,n)}))}r._subjects.state.next({name:n,values:ot(r._formValues)}),r._names.focus&&Io(r._fields,(S,b)=>{if(r._names.focus&&b.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),f.current=!1},[s,n,r]),N.useEffect(()=>(!ae(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(b,_)=>{const O=ae(r._fields,b);O&&O._f&&(O._f.mount=_)};r._options.shouldUnregister||a?r.unregister(n):S(n,!1)}),[n,r,i,a]),{swap:N.useCallback(y,[c,n,r]),move:N.useCallback(g,[c,n,r]),prepend:N.useCallback(h,[c,n,r]),append:N.useCallback(p,[c,n,r]),remove:N.useCallback(x,[c,n,r]),insert:N.useCallback(v,[c,n,r]),update:N.useCallback(m,[c,n,r]),replace:N.useCallback(w,[c,n,r]),fields:N.useMemo(()=>s.map((S,b)=>({...S,[i]:u.current[b]||wi()})),[s,i])}}function gD(e={}){const t=N.useRef(void 0),r=N.useRef(void 0),[n,i]=N.useState({isDirty:!1,isValidating:!1,isLoading:fn(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:fn(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!fn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=mD(e);t.current={...s,formState:n}}const a=t.current.control;return a._options=e,nE(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(s=>({...s,isReady:!0})),a._formState.isReady=!0,o},[a]),N.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),N.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),N.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),N.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),N.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==n.isDirty&&a._subjects.state.next({isDirty:o})}},[a,n.isDirty]),N.useEffect(()=>{var o;e.values&&!Ci(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((o=a._options.resetOptions)===null||o===void 0)&&o.keepIsValid||a._setValid(),r.current=e.values,i(s=>({...s}))):a._resetDefaultValues()},[a,e.values]),N.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=N.useMemo(()=>JM(n,a),[a,n]),t.current}const H1=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ae(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},dE=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?H1(n.ref,r,e):n.refs&&n.refs.forEach(i=>H1(i,r,e))}},xD=(e,t)=>{t.shouldUseNativeValidation&&dE(e,t);const r={};for(const n in e){const i=ae(t.fields,n),a=Object.assign(e[n]||{},{ref:i&&i.ref});if(bD(t.names||Object.keys(e),n)){const o=Object.assign({},ae(r,n));We(o,"root",a),We(r,n,o)}else We(r,n,a)}return r},bD=(e,t)=>e.some(r=>r.startsWith(t+"."));var wD=function(e,t){for(var r={};e.length;){var n=e[0],i=n.code,a=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:a,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(c){return e.push(c)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=iE(o,t,r,i,u?[].concat(u,n.message):n.message)}e.shift()}return r},_D=function(e,t,r){return r===void 0&&(r={}),function(n,i,a){try{return Promise.resolve(function(o,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return a.shouldUseNativeValidation&&dE({},a),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:xD(wD(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}},Fe;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Fe||(Fe={}));var G1;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(G1||(G1={}));const ce=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=e=>{switch(typeof e){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return Number.isNaN(e)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"symbol":return ce.symbol;case"object":return Array.isArray(e)?ce.array:e===null?ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ce.promise:typeof Map<"u"&&e instanceof Map?ce.map:typeof Set<"u"&&e instanceof Set?ce.set:typeof Date<"u"&&e instanceof Date?ce.date:ce.object;default:return ce.unknown}},ee=Fe.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 oi extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];r[a]=r[a]||[],r[a].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}oi.create=e=>new oi(e);const cy=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===ce.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Fe.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fe.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fe.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${Fe.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Fe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,Fe.assertNever(e)}return{message:r}};let SD=cy;function OD(){return SD}const jD=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function oe(e,t){const r=OD(),n=jD({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===cy?void 0:cy].filter(i=>!!i)});e.common.issues.push(n)}class Ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return xe;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const a=await i.key,o=await i.value;n.push({key:a,value:o})}return Ir.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return xe;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}}const xe=Object.freeze({status:"aborted"}),_l=e=>({status:"dirty",value:e}),en=e=>({status:"valid",value:e}),K1=e=>e.status==="aborted",q1=e=>e.status==="dirty",Xo=e=>e.status==="valid",Kf=e=>typeof Promise<"u"&&e instanceof Promise;var fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(fe||(fe={}));class Zi{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}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 X1=(e,t)=>{if(Xo(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 r=new oi(e.common.issues);return this._error=r,this._error}}};function ke(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,s)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:i}}class Le{get description(){return this._def.description}_getType(t){return Oi(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ir,ctx:{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Kf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},i=this._parseSync({data:t,path:n.path,parent:n});return X1(n,i)}"~validate"(t){var n,i;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return Xo(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(i=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>Xo(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Kf(i)?i:Promise.resolve(i));return X1(n,a)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const o=t(i),s=()=>a.addIssue({code:ee.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new za({schema:this,typeName:be.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:r=>this["~validate"](r)}}optional(){return Wi.create(this,this._def)}nullable(){return Qo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tn.create(this)}promise(){return Zf.create(this,this._def)}or(t){return Xf.create([this,t],this._def)}and(t){return Yf.create(this,t,this._def)}transform(t){return new za({...ke(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new dy({...ke(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new qD({typeName:be.ZodBranded,type:this,...ke(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new py({...ke(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Y0.create(this,t)}readonly(){return hy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const AD=/^c[^\s-]{8,}$/i,kD=/^[0-9a-z]+$/,ED=/^[0-9A-HJKMNP-TV-Z]{26}$/i,PD=/^[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,CD=/^[a-z0-9_-]{21}$/i,TD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ND=/^[-+]?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)?)??$/,$D=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let gm;const ID=/^(?:(?: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])$/,MD=/^(?:(?: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][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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])$/,BD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,FD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pE="((\\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])))",zD=new RegExp(`^${pE}$`);function hE(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function UD(e){return new RegExp(`^${hE(e)}$`)}function VD(e){let t=`${pE}T${hE(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function WD(e,t){return!!((t==="v4"||!t)&&ID.test(e)||(t==="v6"||!t)&&DD.test(e))}function HD(e,t){if(!TD.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function GD(e,t){return!!((t==="v4"||!t)&&MD.test(e)||(t==="v6"||!t)&&LD.test(e))}class Kn extends Le{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ce.string){const a=this._getOrReturnCtx(t);return oe(a,{code:ee.invalid_type,expected:ce.string,received:a.parsedType}),xe}const n=new Ir;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,s=t.data.lengtht.test(i),{validation:r,code:ee.invalid_string,...fe.errToObj(n)})}_addCheck(t){return new Kn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...fe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...fe.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==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...fe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...fe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...fe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...fe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...fe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...fe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...fe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...fe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...fe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...fe.errToObj(r)})}nonempty(t){return this.min(1,fe.errToObj(t))}trim(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Kn({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Kn({checks:[],typeName:be.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ke(e)});function KD(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return a%o/10**i}class La extends Le{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)!==ce.number){const a=this._getOrReturnCtx(t);return oe(a,{code:ee.invalid_type,expected:ce.number,received:a.parsedType}),xe}let n;const i=new Ir;for(const a of this._def.checks)a.kind==="int"?Fe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?KD(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.not_finite,message:a.message}),i.dirty()):Fe.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,i){return new La({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(i)}]})}_addCheck(t){return new La({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Fe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew La({checks:[],typeName:be.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ke(e)});class Ba extends Le{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)!==ce.bigint)return this._getInvalidInput(t);let n;const i=new Ir;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Fe.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return oe(r,{code:ee.invalid_type,expected:ce.bigint,received:r.parsedType}),xe}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,i){return new Ba({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(i)}]})}_addCheck(t){return new Ba({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Ba({checks:[],typeName:be.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ke(e)});class qf extends Le{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ce.boolean){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.boolean,received:n.parsedType}),xe}return en(t.data)}}qf.create=e=>new qf({typeName:be.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ke(e)});class Yo extends Le{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ce.date){const a=this._getOrReturnCtx(t);return oe(a,{code:ee.invalid_type,expected:ce.date,received:a.parsedType}),xe}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return oe(a,{code:ee.invalid_date}),xe}const n=new Ir;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Fe.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Yo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:fe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:fe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Yo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:be.ZodDate,...ke(e)});class Y1 extends Le{_parse(t){if(this._getType(t)!==ce.symbol){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.symbol,received:n.parsedType}),xe}return en(t.data)}}Y1.create=e=>new Y1({typeName:be.ZodSymbol,...ke(e)});class Z1 extends Le{_parse(t){if(this._getType(t)!==ce.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.undefined,received:n.parsedType}),xe}return en(t.data)}}Z1.create=e=>new Z1({typeName:be.ZodUndefined,...ke(e)});class Q1 extends Le{_parse(t){if(this._getType(t)!==ce.null){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.null,received:n.parsedType}),xe}return en(t.data)}}Q1.create=e=>new Q1({typeName:be.ZodNull,...ke(e)});class J1 extends Le{constructor(){super(...arguments),this._any=!0}_parse(t){return en(t.data)}}J1.create=e=>new J1({typeName:be.ZodAny,...ke(e)});class ew extends Le{constructor(){super(...arguments),this._unknown=!0}_parse(t){return en(t.data)}}ew.create=e=>new ew({typeName:be.ZodUnknown,...ke(e)});class Qi extends Le{_parse(t){const r=this._getOrReturnCtx(t);return oe(r,{code:ee.invalid_type,expected:ce.never,received:r.parsedType}),xe}}Qi.create=e=>new Qi({typeName:be.ZodNever,...ke(e)});class tw extends Le{_parse(t){if(this._getType(t)!==ce.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.void,received:n.parsedType}),xe}return en(t.data)}}tw.create=e=>new tw({typeName:be.ZodVoid,...ke(e)});class Tn extends Le{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ce.array)return oe(r,{code:ee.invalid_type,expected:ce.array,received:r.parsedType}),xe;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,s=r.data.lengthi.maxLength.value&&(oe(r,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new Zi(r,o,r.path,s)))).then(o=>Ir.mergeArray(n,o));const a=[...r.data].map((o,s)=>i.type._parseSync(new Zi(r,o,r.path,s)));return Ir.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new Tn({...this._def,minLength:{value:t,message:fe.toString(r)}})}max(t,r){return new Tn({...this._def,maxLength:{value:t,message:fe.toString(r)}})}length(t,r){return new Tn({...this._def,exactLength:{value:t,message:fe.toString(r)}})}nonempty(t){return this.min(1,t)}}Tn.create=(e,t)=>new Tn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...ke(t)});function oo(e){if(e instanceof jt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Wi.create(oo(n))}return new jt({...e._def,shape:()=>t})}else return e instanceof Tn?new Tn({...e._def,type:oo(e.element)}):e instanceof Wi?Wi.create(oo(e.unwrap())):e instanceof Qo?Qo.create(oo(e.unwrap())):e instanceof Fa?Fa.create(e.items.map(t=>oo(t))):e}class jt extends Le{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(),r=Fe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ce.object){const u=this._getOrReturnCtx(t);return oe(u,{code:ee.invalid_type,expected:ce.object,received:u.parsedType}),xe}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Qi&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const f=a[u],c=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new Zi(i,c,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Qi){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")s.length>0&&(oe(i,{code:ee.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of s){const c=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new Zi(i,c,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const c=await f.key,p=await f.value;u.push({key:c,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>Ir.mergeObjectSync(n,u)):Ir.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return fe.errToObj,new jt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,o;const i=((o=(a=this._def).errorMap)==null?void 0:o.call(a,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:fe.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new jt({...this._def,unknownKeys:"strip"})}passthrough(){return new jt({...this._def,unknownKeys:"passthrough"})}extend(t){return new jt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new jt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:be.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new jt({...this._def,catchall:t})}pick(t){const r={};for(const n of Fe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new jt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Fe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new jt({...this._def,shape:()=>r})}deepPartial(){return oo(this)}partial(t){const r={};for(const n of Fe.objectKeys(this.shape)){const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new jt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Fe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Wi;)a=a._def.innerType;r[n]=a}return new jt({...this._def,shape:()=>r})}keyof(){return mE(Fe.objectKeys(this.shape))}}jt.create=(e,t)=>new jt({shape:()=>e,unknownKeys:"strip",catchall:Qi.create(),typeName:be.ZodObject,...ke(t)});jt.strictCreate=(e,t)=>new jt({shape:()=>e,unknownKeys:"strict",catchall:Qi.create(),typeName:be.ZodObject,...ke(t)});jt.lazycreate=(e,t)=>new jt({shape:e,unknownKeys:"strip",catchall:Qi.create(),typeName:be.ZodObject,...ke(t)});class Xf extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new oi(s.ctx.common.issues));return oe(r,{code:ee.invalid_union,unionErrors:o}),xe}if(r.common.async)return Promise.all(n.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new oi(l));return oe(r,{code:ee.invalid_union,unionErrors:s}),xe}}get options(){return this._def.options}}Xf.create=(e,t)=>new Xf({options:e,typeName:be.ZodUnion,...ke(t)});function fy(e,t){const r=Oi(e),n=Oi(t);if(e===t)return{valid:!0,data:e};if(r===ce.object&&n===ce.object){const i=Fe.objectKeys(t),a=Fe.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...t};for(const s of a){const l=fy(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===ce.array&&n===ce.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a{if(K1(a)||K1(o))return xe;const s=fy(a.value,o.value);return s.valid?((q1(a)||q1(o))&&r.dirty(),{status:r.value,value:s.data}):(oe(n,{code:ee.invalid_intersection_types}),xe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Yf.create=(e,t,r)=>new Yf({left:e,right:t,typeName:be.ZodIntersection,...ke(r)});class Fa extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.array)return oe(n,{code:ee.invalid_type,expected:ce.array,received:n.parsedType}),xe;if(n.data.lengththis._def.items.length&&(oe(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Zi(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Ir.mergeArray(r,o)):Ir.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Fa({...this._def,rest:t})}}Fa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fa({items:e,typeName:be.ZodTuple,rest:null,...ke(t)})};class rw extends Le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.map)return oe(n,{code:ee.invalid_type,expected:ce.map,received:n.parsedType}),xe;const i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:i._parse(new Zi(n,s,n.path,[u,"key"])),value:a._parse(new Zi(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return xe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return xe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}}rw.create=(e,t,r)=>new rw({valueType:t,keyType:e,typeName:be.ZodMap,...ke(r)});class cu extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.set)return oe(n,{code:ee.invalid_type,expected:ce.set,received:n.parsedType}),xe;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(oe(n,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return xe;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>a._parse(new Zi(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new cu({...this._def,minSize:{value:t,message:fe.toString(r)}})}max(t,r){return new cu({...this._def,maxSize:{value:t,message:fe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}cu.create=(e,t)=>new cu({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...ke(t)});class nw extends Le{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}nw.create=(e,t)=>new nw({getter:e,typeName:be.ZodLazy,...ke(t)});class iw extends Le{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return oe(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:t.data}}get value(){return this._def.value}}iw.create=(e,t)=>new iw({value:e,typeName:be.ZodLiteral,...ke(t)});function mE(e,t){return new Zo({values:e,typeName:be.ZodEnum,...ke(t)})}class Zo extends Le{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{expected:Fe.joinValues(n),received:r.parsedType,code:ee.invalid_type}),xe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{received:r.data,code:ee.invalid_enum_value,options:n}),xe}return en(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Zo.create(t,{...this._def,...r})}exclude(t,r=this._def){return Zo.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Zo.create=mE;class aw extends Le{_parse(t){const r=Fe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ce.string&&n.parsedType!==ce.number){const i=Fe.objectValues(r);return oe(n,{expected:Fe.joinValues(i),received:n.parsedType,code:ee.invalid_type}),xe}if(this._cache||(this._cache=new Set(Fe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Fe.objectValues(r);return oe(n,{received:n.data,code:ee.invalid_enum_value,options:i}),xe}return en(t.data)}get enum(){return this._def.values}}aw.create=(e,t)=>new aw({values:e,typeName:be.ZodNativeEnum,...ke(t)});class Zf extends Le{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.promise&&r.common.async===!1)return oe(r,{code:ee.invalid_type,expected:ce.promise,received:r.parsedType}),xe;const n=r.parsedType===ce.promise?r.data:Promise.resolve(r.data);return en(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Zf.create=(e,t)=>new Zf({type:e,typeName:be.ZodPromise,...ke(t)});class za extends Le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{oe(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return xe;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?xe:l.status==="dirty"||r.value==="dirty"?_l(l.value):l});{if(r.value==="aborted")return xe;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?xe:s.status==="dirty"||r.value==="dirty"?_l(s.value):s}}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?xe:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?xe:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Xo(o))return xe;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Xo(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):xe);Fe.assertNever(i)}}za.create=(e,t,r)=>new za({schema:e,typeName:be.ZodEffects,effect:t,...ke(r)});za.createWithPreprocess=(e,t,r)=>new za({schema:t,effect:{type:"preprocess",transform:e},typeName:be.ZodEffects,...ke(r)});class Wi extends Le{_parse(t){return this._getType(t)===ce.undefined?en(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Wi.create=(e,t)=>new Wi({innerType:e,typeName:be.ZodOptional,...ke(t)});class Qo extends Le{_parse(t){return this._getType(t)===ce.null?en(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Qo.create=(e,t)=>new Qo({innerType:e,typeName:be.ZodNullable,...ke(t)});class dy extends Le{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ce.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}dy.create=(e,t)=>new dy({innerType:e,typeName:be.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ke(t)});class py extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Kf(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new oi(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new oi(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}py.create=(e,t)=>new py({innerType:e,typeName:be.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ke(t)});class ow extends Le{_parse(t){if(this._getType(t)!==ce.nan){const n=this._getOrReturnCtx(t);return oe(n,{code:ee.invalid_type,expected:ce.nan,received:n.parsedType}),xe}return{status:"valid",value:t.data}}}ow.create=e=>new ow({typeName:be.ZodNaN,...ke(e)});class qD extends Le{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Y0 extends Le{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?xe:a.status==="dirty"?(r.dirty(),_l(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?xe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new Y0({in:t,out:r,typeName:be.ZodPipeline})}}class hy extends Le{_parse(t){const r=this._def.innerType._parse(t),n=i=>(Xo(i)&&(i.value=Object.freeze(i.value)),i);return Kf(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}hy.create=(e,t)=>new hy({innerType:e,typeName:be.ZodReadonly,...ke(t)});var be;(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"})(be||(be={}));const sw=Kn.create,$l=La.create;Ba.create;qf.create;Yo.create;Qi.create;const XD=Tn.create,vE=jt.create;Xf.create;Yf.create;Fa.create;Zo.create;Zf.create;Wi.create;Qo.create;const Rl=za.createWithPreprocess,yE={string:e=>Kn.create({...e,coerce:!0}),number:e=>La.create({...e,coerce:!0}),boolean:e=>qf.create({...e,coerce:!0}),bigint:e=>Ba.create({...e,coerce:!0}),date:e=>Yo.create({...e,coerce:!0})},YD={primary:"bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white",ghost:"text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]",danger:"bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]"},ZD={sm:"px-4 py-1.5 text-xs font-semibold",md:"px-5 py-2.5 text-sm font-semibold"};function ht({variant:e="primary",size:t="md",className:r="",...n}){return d.jsx("button",{className:`relative inline-flex items-center justify-center gap-2 rounded-full transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/50 focus:ring-offset-1 focus:ring-offset-transparent focus:border-transparent ${YD[e]} ${ZD[t]} ${r}`,...n,children:n.children})}function Zn({error:e}){return e?d.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/8 px-4 py-3 text-sm text-red-400 font-mono",children:e}):null}function kn({size:e=20}){return d.jsxs("svg",{className:"animate-spin text-brand-500",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}const QD={SR_SELECTION_V3_ROUTING:"bg-blue-100 text-blue-800",PRIORITY_LOGIC:"bg-purple-100 text-purple-800",NTW_BASED_ROUTING:"bg-green-100 text-green-800",SR_SELECTION_V3_ROUTING_WITH_HEDGING:"bg-orange-100 text-orange-800",HEDGING:"bg-orange-100 text-orange-800"},JD=["card","card_redirect","pay_later","wallet","bank_redirect","bank_transfer","crypto","bank_debit","reward","real_time_payment","upi","voucher","gift_card","open_banking","mobile_payment"],eL={card:["credit","debit"],bank_debit:["ach","sepa","bacs","becs"],bank_transfer:["ach","sepa","sepa_bank_transfer","bacs","multibanco","pix","pse","permata_bank_transfer","bca_bank_transfer","bni_va","bri_va","cimb_va","danamon_va","mandiri_va","local_bank_transfer","instant_bank_transfer"],wallet:["amazon_pay","apple_pay","google_pay","paypal","ali_pay","ali_pay_hk","dana","mb_way","mobile_pay","samsung_pay","twint","vipps","touch_n_go","swish","we_chat_pay","go_pay","gcash","momo","kakao_pay","cashapp","mifinity","paze"],pay_later:["affirm","alma","afterpay_clearpay","klarna","pay_bright","atome","walley"],upi:["upi_collect","upi_intent"],voucher:["boleto","efecty","pago_efectivo","red_compra","red_pagos","indomaret","alfamart","oxxo","seven_eleven","lawson","mini_stop","family_mart","seicomart","pay_easy"],bank_redirect:["giropay","ideal","sofort","eft","eps","bancontact_card","blik","local_bank_redirect","online_banking_thailand","online_banking_czech_republic","online_banking_finland","online_banking_fpx","online_banking_poland","online_banking_slovakia","przelewy24","trustly","bizum","interac","open_banking_uk","open_banking_pis"],gift_card:["givex","pay_safe_card"],card_redirect:["knet","benefit","momo_atm","card_redirect"],real_time_payment:["fps","duit_now","prompt_pay","viet_qr"],crypto:["crypto_currency"],reward:["evoucher","classic_reward"],open_banking:["open_banking_pis"],mobile_payment:["direct_carrier_billing"]},tL=vE({paymentMethodType:sw().min(1),paymentMethod:sw().min(1),bucketSize:yE.number().int().positive(),hedgingPercent:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),latencyThreshold:Rl(e=>e===""||e===null?null:Number(e),$l().nullable())}),rL=vE({defaultBucketSize:yE.number().int().positive(),defaultSuccessRate:Rl(e=>e===""||e===null?null:Number(e),$l().min(0).max(1).nullable()),defaultLatencyThreshold:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),defaultHedgingPercent:Rl(e=>e===""||e===null?null:Number(e),$l().nullable()),subLevelInputConfig:XD(tL)});function nL(){var I,D,L,z,U;const{merchantId:e}=na(),[t,r]=j.useState(!1),[n,i]=j.useState(null),[a,o]=j.useState(!1),[s,l]=j.useState(!1),[u,f]=j.useState(!1),[c,p]=j.useState(null),{data:h,isLoading:x,mutate:v}=vn(e?["rule-sr",e]:null,()=>ft("/rule/get",{merchant_id:e,algorithm:"successRate"}),{shouldRetryOnError:!1}),{register:y,control:g,handleSubmit:m,reset:w,watch:S,formState:{errors:b}}=gD({resolver:_D(rL),defaultValues:{defaultBucketSize:200,defaultSuccessRate:.5,defaultLatencyThreshold:null,defaultHedgingPercent:null,subLevelInputConfig:[]}});j.useEffect(()=>{var M;if((M=h==null?void 0:h.config)!=null&&M.data){const B=h.config.data;w({defaultBucketSize:B.defaultBucketSize??200,defaultSuccessRate:B.defaultSuccessRate??.5,defaultLatencyThreshold:B.defaultLatencyThreshold??null,defaultHedgingPercent:B.defaultHedgingPercent??null,subLevelInputConfig:B.subLevelInputConfig??[]})}},[h,w]);const{fields:_,append:O,remove:k}=yD({control:g,name:"subLevelInputConfig"}),P=S("subLevelInputConfig");async function R(){try{await ft("/merchant-account/create",{merchant_id:e,gateway_success_rate_based_decider_input:null})}catch{}}async function $(M){if(!e){i("Set a Merchant ID first.");return}r(!0),i(null),o(!1);try{await R(),await ft(h?"/rule/update":"/rule/create",{merchant_id:e,config:{type:"successRate",data:{defaultBucketSize:M.defaultBucketSize,defaultSuccessRate:M.defaultSuccessRate,defaultLatencyThreshold:M.defaultLatencyThreshold,defaultHedgingPercent:M.defaultHedgingPercent,subLevelInputConfig:M.subLevelInputConfig.length>0?M.subLevelInputConfig:null}}}),o(!0),v()}catch(B){i(B instanceof Error?B.message:String(B))}finally{r(!1)}}async function C(){if(e){f(!0),p(null);try{await ft("/rule/delete",{merchant_id:e,algorithm:"successRate"}),v(void 0,{revalidate:!1})}catch(M){p(M instanceof Error?M.message:String(M))}finally{f(!1)}}}return d.jsxs("div",{className:"space-y-6 max-w-5xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Auth-Rate Based Routing"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure success-rate based gateway routing"})]}),!e&&d.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-800",children:"Set a Merchant ID in the top bar to load and save configuration."}),e&&!x&&d.jsxs(Ce,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Configuration Status"}),d.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(I=h==null?void 0:h.config)!=null&&I.data?"Success Rate routing is configured and active":"No Success Rate configuration found"})]}),d.jsx(Qt,{variant:(D=h==null?void 0:h.config)!=null&&D.data?"green":"gray",children:(L=h==null?void 0:h.config)!=null&&L.data?"Active":"Not Configured"})]}),((z=h==null?void 0:h.config)==null?void 0:z.data)&&d.jsxs(Te,{className:"border-t border-slate-100 dark:border-[#222226]",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Last Modified:"}),d.jsx("span",{className:"ml-1 font-medium",children:h.modified_at?new Date(h.modified_at).toLocaleString():"Unknown"})]}),d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>{confirm("Are you sure you want to clear the Success Rate configuration? This will disable SR-based routing.")&&C()},disabled:u,children:[d.jsx(ai,{size:14,className:"mr-1"}),u?"Clearing...":"Clear Configuration"]})]}),c&&d.jsx("p",{className:"text-xs text-red-500 mt-2",children:c})]})]}),x?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx(kn,{})}):d.jsxs("form",{onSubmit:m($),className:"space-y-6",children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Success Rate Config"})}),d.jsxs(Te,{className:"overflow-x-auto p-0",children:[d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-200 dark:border-[#1c1c24] bg-slate-50 dark:bg-[#0a0a0f]",children:[d.jsx("th",{className:"px-4 py-2",children:"Payment Method Type"}),d.jsx("th",{className:"px-4 py-2",children:"Payment Method"}),d.jsx("th",{className:"px-4 py-2",children:"Bucket Size"}),d.jsx("th",{className:"px-4 py-2",children:"Success Rate"}),d.jsx("th",{className:"px-4 py-2",children:"Hedging %"}),d.jsx("th",{className:"px-4 py-2",children:"Latency Threshold (ms)"}),d.jsx("th",{className:"px-4 py-2"})]})}),d.jsxs("tbody",{children:[d.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] bg-brand-50/50 dark:bg-[#151518]",children:[d.jsx("td",{className:"px-4 py-2 text-slate-500 italic",children:"Default"}),d.jsx("td",{className:"px-4 py-2 text-slate-400",children:"—"}),d.jsxs("td",{className:"px-4 py-2",children:[d.jsx("input",{type:"number",...y("defaultBucketSize"),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"}),b.defaultBucketSize&&d.jsx("p",{className:"text-xs text-red-500 mt-0.5",children:b.defaultBucketSize.message})]}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",...y("defaultSuccessRate"),placeholder:"0.5",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",...y("defaultHedgingPercent"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...y("defaultLatencyThreshold"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2"})]}),_.map((M,B)=>{var G;const W=((G=P==null?void 0:P[B])==null?void 0:G.paymentMethodType)||"",J=eL[W]||[];return d.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[d.jsx("td",{className:"px-4 py-2",children:d.jsx("select",{...y(`subLevelInputConfig.${B}.paymentMethodType`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:JD.map(Q=>d.jsx("option",{value:Q,children:Q},Q))})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("select",{...y(`subLevelInputConfig.${B}.paymentMethod`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(J.length?J:["credit","debit"]).map(Q=>d.jsx("option",{value:Q,children:Q},Q))})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...y(`subLevelInputConfig.${B}.bucketSize`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",step:"0.1",...y(`subLevelInputConfig.${B}.hedgingPercent`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("input",{type:"number",...y(`subLevelInputConfig.${B}.latencyThreshold`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),d.jsx("td",{className:"px-4 py-2",children:d.jsx("button",{type:"button",onClick:()=>k(B),className:"text-slate-400 hover:text-red-500",children:d.jsx(ai,{size:14})})})]},M.id)})]})]}),d.jsx("div",{className:"px-4 py-3",children:d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>O({paymentMethodType:"card",paymentMethod:"credit",bucketSize:20,hedgingPercent:null,latencyThreshold:null}),children:[d.jsx(Xi,{size:14})," Add Level"]})})]})]}),d.jsx(Zn,{error:n}),a&&d.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-4 py-3 text-sm text-emerald-400",children:"Configuration saved successfully."}),((U=h==null?void 0:h.config)==null?void 0:U.data)&&d.jsxs(Ce,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Current Active Configuration"}),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!s),children:[d.jsx(_p,{size:14,className:"mr-1"}),s?"Hide":"View"]})]}),s&&d.jsx(Te,{children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-4",children:[d.jsxs("div",{className:"border-b border-slate-200 dark:border-[#222226] pb-3",children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Default Settings"}),d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultBucketSize})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Success Rate:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultSuccessRate??"Not set"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),d.jsx("p",{className:"font-medium",children:h.config.data.defaultHedgingPercent??"Not set"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),d.jsxs("p",{className:"font-medium",children:[h.config.data.defaultLatencyThreshold??"Not set"," ms"]})]})]})]}),h.config.data.subLevelInputConfig&&h.config.data.subLevelInputConfig.length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Sub-Level Configurations"}),d.jsx("div",{className:"space-y-2",children:h.config.data.subLevelInputConfig.map((M,B)=>d.jsx("div",{className:"bg-slate-50 dark:bg-[#151518] rounded-lg p-3",children:d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Payment Type:"}),d.jsx("p",{className:"font-medium capitalize",children:M.paymentMethodType})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Payment Method:"}),d.jsx("p",{className:"font-medium",children:M.paymentMethod})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),d.jsx("p",{className:"font-medium",children:M.bucketSize})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),d.jsx("p",{className:"font-medium",children:M.hedgingPercent??"Default"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),d.jsxs("p",{className:"font-medium",children:[M.latencyThreshold??"Default"," ms"]})]})]})},B))})]}),d.jsxs("div",{className:"border-t border-gray-200 pt-3",children:[d.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Raw Configuration (JSON)"}),d.jsx("pre",{className:"bg-slate-900 dark:bg-[#0f0f11] text-slate-100 border border-transparent dark:border-[#222226] rounded-lg p-3 text-xs overflow-auto max-h-64",children:JSON.stringify(h.config,null,2)})]})]})})]}),d.jsx(ht,{type:"submit",disabled:t||!e,children:t?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Saving…"]}):"Save Configuration"})]})]})}function iL(){for(var e=arguments.length,t=new Array(e),r=0;rn=>{t.forEach(i=>i(n))},t)}const Ap=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ps(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Z0(e){return"nodeType"in e}function wr(e){var t,r;return e?Ps(e)?e:Z0(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Q0(e){const{Document:t}=wr(e);return e instanceof t}function ac(e){return Ps(e)?!1:e instanceof wr(e).HTMLElement}function gE(e){return e instanceof wr(e).SVGElement}function Cs(e){return e?Ps(e)?e.document:Z0(e)?Q0(e)?e:ac(e)||gE(e)?e.ownerDocument:document:document:document}const Rn=Ap?j.useLayoutEffect:j.useEffect;function J0(e){const t=j.useRef(e);return Rn(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i{e.current=setInterval(n,i)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function fu(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return Rn(()=>{r.current!==e&&(r.current=e)},t),r}function oc(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Qf(e){const t=J0(e),r=j.useRef(null),n=j.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function my(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let xm={};function sc(e,t){return j.useMemo(()=>{if(t)return t;const r=xm[e]==null?0:xm[e]+1;return xm[e]=r,e+"-"+r},[e,t])}function xE(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i{const s=Object.entries(o);for(const[l,u]of s){const f=a[l];f!=null&&(a[l]=f+e*u)}return a},{...t})}}const Mo=xE(1),du=xE(-1);function oL(e){return"clientX"in e&&"clientY"in e}function ex(e){if(!e)return!1;const{KeyboardEvent:t}=wr(e.target);return t&&e instanceof t}function sL(e){if(!e)return!1;const{TouchEvent:t}=wr(e.target);return t&&e instanceof t}function vy(e){if(sL(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return oL(e)?{x:e.clientX,y:e.clientY}:null}const pu=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[pu.Translate.toString(e),pu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),lw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function lL(e){return e.matches(lw)?e:e.querySelector(lw)}const uL={display:"none"};function cL(e){let{id:t,value:r}=e;return N.createElement("div",{id:t,style:uL},r)}function fL(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return N.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function dL(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const bE=j.createContext(null);function pL(e){const t=j.useContext(bE);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function hL(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.useCallback(n=>{let{type:i,event:a}=n;e.forEach(o=>{var s;return(s=o[i])==null?void 0:s.call(o,a)})},[e]),t]}const mL={draggable:` - To pick up a draggable item, press the space bar. - While dragging, use the arrow keys to move the item. - Press space again to drop the item in its new position, or press escape to cancel. - `},vL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function yL(e){let{announcements:t=vL,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=mL}=e;const{announce:a,announcement:o}=dL(),s=sc("DndLiveRegion"),[l,u]=j.useState(!1);if(j.useEffect(()=>{u(!0)},[]),pL(j.useMemo(()=>({onDragStart(c){let{active:p}=c;a(t.onDragStart({active:p}))},onDragMove(c){let{active:p,over:h}=c;t.onDragMove&&a(t.onDragMove({active:p,over:h}))},onDragOver(c){let{active:p,over:h}=c;a(t.onDragOver({active:p,over:h}))},onDragEnd(c){let{active:p,over:h}=c;a(t.onDragEnd({active:p,over:h}))},onDragCancel(c){let{active:p,over:h}=c;a(t.onDragCancel({active:p,over:h}))}}),[a,t])),!l)return null;const f=N.createElement(N.Fragment,null,N.createElement(cL,{id:n,value:i.draggable}),N.createElement(fL,{id:s,announcement:o}));return r?wo.createPortal(f,r):f}var $t;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})($t||($t={}));function Jf(){}function uw(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function gL(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const yn=Object.freeze({x:0,y:0});function wE(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function _E(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function xL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function cw(e){let{left:t,top:r,height:n,width:i}=e;return[{x:t,y:r},{x:t+i,y:r},{x:t,y:r+n},{x:t+i,y:r+n}]}function SE(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function fw(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const bL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=fw(t,t.left,t.top),a=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=wE(fw(l),i);a.push({id:s,data:{droppableContainer:o,value:u}})}}return a.sort(_E)},wL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=cw(t),a=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=cw(l),f=i.reduce((p,h,x)=>p+wE(u[x],h),0),c=Number((f/4).toFixed(4));a.push({id:s,data:{droppableContainer:o,value:c}})}}return a.sort(_E)};function _L(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-n,s=a-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:o}=a,s=r.get(o);if(s){const l=_L(s,t);l>0&&i.push({id:o,data:{droppableContainer:a,value:l}})}}return i.sort(xL)};function OL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function OE(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:yn}function jL(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a({...o,top:o.top+e*s.y,bottom:o.bottom+e*s.y,left:o.left+e*s.x,right:o.right+e*s.x}),{...r})}}const AL=jL(1);function kL(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function EL(e,t,r){const n=kL(t);if(!n)return e;const{scaleX:i,scaleY:a,x:o,y:s}=n,l=e.left-o-(1-i)*parseFloat(r),u=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=i?e.width/i:e.width,c=a?e.height/a:e.height;return{width:f,height:c,top:u,right:l+f,bottom:u+c,left:l}}const PL={ignoreTransform:!1};function Ts(e,t){t===void 0&&(t=PL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=wr(e).getComputedStyle(e);u&&(r=EL(r,u,f))}const{top:n,left:i,width:a,height:o,bottom:s,right:l}=r;return{top:n,left:i,width:a,height:o,bottom:s,right:l}}function dw(e){return Ts(e,{ignoreTransform:!0})}function CL(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function TL(e,t){return t===void 0&&(t=wr(e).getComputedStyle(e)),t.position==="fixed"}function NL(e,t){t===void 0&&(t=wr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function kp(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(Q0(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!ac(i)||gE(i)||r.includes(i))return r;const a=wr(e).getComputedStyle(i);return i!==e&&NL(i,a)&&r.push(i),TL(i,a)?r:n(i.parentNode)}return e?n(e):r}function jE(e){const[t]=kp(e,1);return t??null}function bm(e){return!Ap||!e?null:Ps(e)?e:Z0(e)?Q0(e)||e===Cs(e).scrollingElement?window:ac(e)?e:null:null}function AE(e){return Ps(e)?e.scrollX:e.scrollLeft}function kE(e){return Ps(e)?e.scrollY:e.scrollTop}function yy(e){return{x:AE(e),y:kE(e)}}var Bt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Bt||(Bt={}));function EE(e){return!Ap||!e?!1:e===document.scrollingElement}function PE(e){const t={x:0,y:0},r=EE(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const $L={x:.2,y:.2};function RL(e,t,r,n,i){let{top:a,left:o,right:s,bottom:l}=r;n===void 0&&(n=10),i===void 0&&(i=$L);const{isTop:u,isBottom:f,isLeft:c,isRight:p}=PE(e),h={x:0,y:0},x={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!u&&a<=t.top+v.height?(h.y=Bt.Backward,x.y=n*Math.abs((t.top+v.height-a)/v.height)):!f&&l>=t.bottom-v.height&&(h.y=Bt.Forward,x.y=n*Math.abs((t.bottom-v.height-l)/v.height)),!p&&s>=t.right-v.width?(h.x=Bt.Forward,x.x=n*Math.abs((t.right-v.width-s)/v.width)):!c&&o<=t.left+v.width&&(h.x=Bt.Backward,x.x=n*Math.abs((t.left+v.width-o)/v.width)),{direction:h,speed:x}}function IL(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:o}=window;return{top:0,left:0,right:a,bottom:o,width:a,height:o}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function CE(e){return e.reduce((t,r)=>Mo(t,yy(r)),yn)}function ML(e){return e.reduce((t,r)=>t+AE(r),0)}function DL(e){return e.reduce((t,r)=>t+kE(r),0)}function LL(e,t){if(t===void 0&&(t=Ts),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);jE(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const BL=[["x",["left","right"],ML],["y",["top","bottom"],DL]];class tx{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=kp(r),i=CE(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,o,s]of BL)for(const l of o)Object.defineProperty(this,l,{get:()=>{const u=s(n),f=i[a]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Il{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function FL(e){const{EventTarget:t}=wr(e);return e instanceof t?e:Cs(e)}function wm(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ur;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ur||(Ur={}));function pw(e){e.preventDefault()}function zL(e){e.stopPropagation()}var Ie;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ie||(Ie={}));const TE={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter,Ie.Tab]},UL=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ie.Right:return{...r,x:r.x+25};case Ie.Left:return{...r,x:r.x-25};case Ie.Down:return{...r,y:r.y+25};case Ie.Up:return{...r,y:r.y-25}}};class rx{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Il(Cs(r)),this.windowListeners=new Il(wr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ur.Resize,this.handleCancel),this.windowListeners.add(Ur.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ur.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&LL(n),r(yn)}handleKeyDown(t){if(ex(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=TE,coordinateGetter:o=UL,scrollBehavior:s="smooth"}=i,{code:l}=t;if(a.end.includes(l)){this.handleEnd(t);return}if(a.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,f=u?{x:u.left,y:u.top}:yn;this.referenceCoordinates||(this.referenceCoordinates=f);const c=o(t,{active:r,context:n.current,currentCoordinates:f});if(c){const p=du(c,f),h={x:0,y:0},{scrollableAncestors:x}=n.current;for(const v of x){const y=t.code,{isTop:g,isRight:m,isLeft:w,isBottom:S,maxScroll:b,minScroll:_}=PE(v),O=IL(v),k={x:Math.min(y===Ie.Right?O.right-O.width/2:O.right,Math.max(y===Ie.Right?O.left:O.left+O.width/2,c.x)),y:Math.min(y===Ie.Down?O.bottom-O.height/2:O.bottom,Math.max(y===Ie.Down?O.top:O.top+O.height/2,c.y))},P=y===Ie.Right&&!m||y===Ie.Left&&!w,R=y===Ie.Down&&!S||y===Ie.Up&&!g;if(P&&k.x!==c.x){const $=v.scrollLeft+p.x,C=y===Ie.Right&&$<=b.x||y===Ie.Left&&$>=_.x;if(C&&!p.y){v.scrollTo({left:$,behavior:s});return}C?h.x=v.scrollLeft-$:h.x=y===Ie.Right?v.scrollLeft-b.x:v.scrollLeft-_.x,h.x&&v.scrollBy({left:-h.x,behavior:s});break}else if(R&&k.y!==c.y){const $=v.scrollTop+p.y,C=y===Ie.Down&&$<=b.y||y===Ie.Up&&$>=_.y;if(C&&!p.x){v.scrollTo({top:$,behavior:s});return}C?h.y=v.scrollTop-$:h.y=y===Ie.Down?v.scrollTop-b.y:v.scrollTop-_.y,h.y&&v.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,Mo(du(c,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}rx.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=TE,onActivation:i}=t,{active:a}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function hw(e){return!!(e&&"distance"in e)}function mw(e){return!!(e&&"delay"in e)}class nx{constructor(t,r,n){var i;n===void 0&&(n=FL(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:o}=a;this.props=t,this.events=r,this.document=Cs(o),this.documentListeners=new Il(this.document),this.listeners=new Il(n),this.windowListeners=new Il(wr(o)),this.initialCoordinates=(i=vy(a))!=null?i:yn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ur.Resize,this.handleCancel),this.windowListeners.add(Ur.DragStart,pw),this.windowListeners.add(Ur.VisibilityChange,this.handleCancel),this.windowListeners.add(Ur.ContextMenu,pw),this.documentListeners.add(Ur.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(mw(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(hw(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ur.Click,zL,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ur.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:o,options:{activationConstraint:s}}=a;if(!i)return;const l=(r=vy(t))!=null?r:yn,u=du(i,l);if(!n&&s){if(hw(s)){if(s.tolerance!=null&&wm(u,s.tolerance))return this.handleCancel();if(wm(u,s.distance))return this.handleStart()}if(mw(s)&&wm(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ie.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const VL={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ix extends nx{constructor(t){const{event:r}=t,n=Cs(r.target);super(t,VL,n)}}ix.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const WL={move:{name:"mousemove"},end:{name:"mouseup"}};var gy;(function(e){e[e.RightClick=2]="RightClick"})(gy||(gy={}));class HL extends nx{constructor(t){super(t,WL,Cs(t.event.target))}}HL.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===gy.RightClick?!1:(n==null||n({event:r}),!0)}}];const _m={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class GL extends nx{constructor(t){super(t,_m)}static setup(){return window.addEventListener(_m.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(_m.move.name,t)};function t(){}}}GL.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var Ml;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ml||(Ml={}));var ed;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ed||(ed={}));function KL(e){let{acceleration:t,activator:r=Ml.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:o=5,order:s=ed.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:c,threshold:p}=e;const h=XL({delta:c,disabled:!a}),[x,v]=aL(),y=j.useRef({x:0,y:0}),g=j.useRef({x:0,y:0}),m=j.useMemo(()=>{switch(r){case Ml.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ml.DraggableRect:return i}},[r,i,l]),w=j.useRef(null),S=j.useCallback(()=>{const _=w.current;if(!_)return;const O=y.current.x*g.current.x,k=y.current.y*g.current.y;_.scrollBy(O,k)},[]),b=j.useMemo(()=>s===ed.TreeOrder?[...u].reverse():u,[s,u]);j.useEffect(()=>{if(!a||!u.length||!m){v();return}for(const _ of b){if((n==null?void 0:n(_))===!1)continue;const O=u.indexOf(_),k=f[O];if(!k)continue;const{direction:P,speed:R}=RL(_,k,m,t,p);for(const $ of["x","y"])h[$][P[$]]||(R[$]=0,P[$]=0);if(R.x>0||R.y>0){v(),w.current=_,x(S,o),y.current=R,g.current=P;return}}y.current={x:0,y:0},g.current={x:0,y:0},v()},[t,S,n,v,a,o,JSON.stringify(m),JSON.stringify(h),x,u,b,f,JSON.stringify(p)])}const qL={x:{[Bt.Backward]:!1,[Bt.Forward]:!1},y:{[Bt.Backward]:!1,[Bt.Forward]:!1}};function XL(e){let{delta:t,disabled:r}=e;const n=my(t);return oc(i=>{if(r||!n||!i)return qL;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Bt.Backward]:i.x[Bt.Backward]||a.x===-1,[Bt.Forward]:i.x[Bt.Forward]||a.x===1},y:{[Bt.Backward]:i.y[Bt.Backward]||a.y===-1,[Bt.Forward]:i.y[Bt.Forward]||a.y===1}}},[r,t,n])}function YL(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return oc(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function ZL(e,t){return j.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...a]},[]),[e,t])}var hu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hu||(hu={}));var xy;(function(e){e.Optimized="optimized"})(xy||(xy={}));const vw=new Map;function QL(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,o]=j.useState(null),{frequency:s,measure:l,strategy:u}=i,f=j.useRef(e),c=y(),p=fu(c),h=j.useCallback(function(g){g===void 0&&(g=[]),!p.current&&o(m=>m===null?g:m.concat(g.filter(w=>!m.includes(w))))},[p]),x=j.useRef(null),v=oc(g=>{if(c&&!r)return vw;if(!g||g===vw||f.current!==e||a!=null){const m=new Map;for(let w of e){if(!w)continue;if(a&&a.length>0&&!a.includes(w.id)&&w.rect.current){m.set(w.id,w.rect.current);continue}const S=w.node.current,b=S?new tx(l(S),S):null;w.rect.current=b,b&&m.set(w.id,b)}return m}return g},[e,a,r,c,l]);return j.useEffect(()=>{f.current=e},[e]),j.useEffect(()=>{c||h()},[r,c]),j.useEffect(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),j.useEffect(()=>{c||typeof s!="number"||x.current!==null||(x.current=setTimeout(()=>{h(),x.current=null},s))},[s,c,h,...n]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:a!=null};function y(){switch(u){case hu.Always:return!1;case hu.BeforeDragging:return r;default:return!r}}}function NE(e,t){return oc(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function JL(e,t){return NE(e,t)}function e4(e){let{callback:t,disabled:r}=e;const n=J0(t),i=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return j.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ep(e){let{callback:t,disabled:r}=e;const n=J0(t),i=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return j.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function t4(e){return new tx(Ts(e),e)}function yw(e,t,r){t===void 0&&(t=t4);const[n,i]=j.useState(null);function a(){i(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=e4({callback(l){if(e)for(const u of l){const{type:f,target:c}=u;if(f==="childList"&&c instanceof HTMLElement&&c.contains(e)){a();break}}}}),s=Ep({callback:a});return Rn(()=>{a(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),n}function r4(e){const t=NE(e);return OE(e,t)}const gw=[];function n4(e){const t=j.useRef(e),r=oc(n=>e?n&&n!==gw&&e&&t.current&&e.parentNode===t.current.parentNode?n:kp(e):gw,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function i4(e){const[t,r]=j.useState(null),n=j.useRef(e),i=j.useCallback(a=>{const o=bm(a.target);o&&r(s=>s?(s.set(o,yy(o)),new Map(s)):null)},[]);return j.useEffect(()=>{const a=n.current;if(e!==a){o(a);const s=e.map(l=>{const u=bm(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,yy(u)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{o(e),o(a)};function o(s){s.forEach(l=>{const u=bm(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,o)=>Mo(a,o),yn):CE(e):yn,[e,t])}function xw(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==yn;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?du(e,r.current):yn}function a4(e){j.useEffect(()=>{if(!Ap)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function o4(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=o=>{a(o,t)},r},{}),[e,t])}function $E(e){return j.useMemo(()=>e?CL(e):null,[e])}const bw=[];function s4(e,t){t===void 0&&(t=Ts);const[r]=e,n=$E(r?wr(r):null),[i,a]=j.useState(bw);function o(){a(()=>e.length?e.map(l=>EE(l)?n:new tx(t(l),l)):bw)}const s=Ep({callback:o});return Rn(()=>{s==null||s.disconnect(),o(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),i}function l4(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ac(t)?t:e}function u4(e){let{measure:t}=e;const[r,n]=j.useState(null),i=j.useCallback(u=>{for(const{target:f}of u)if(ac(f)){n(c=>{const p=t(f);return c?{...c,width:p.width,height:p.height}:p});break}},[t]),a=Ep({callback:i}),o=j.useCallback(u=>{const f=l4(u);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[s,l]=Qf(o);return j.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const c4=[{sensor:ix,options:{}},{sensor:rx,options:{}}],f4={current:{}},hf={draggable:{measure:dw},droppable:{measure:dw,strategy:hu.WhileDragging,frequency:xy.Optimized},dragOverlay:{measure:Ts}};class Dl extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const d4={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Jf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:hf,measureDroppableContainers:Jf,windowRect:null,measuringScheduled:!1},p4={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Jf,draggableNodes:new Map,over:null,measureDroppableContainers:Jf},Pp=j.createContext(p4),RE=j.createContext(d4);function h4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dl}}}function m4(e,t){switch(t.type){case $t.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case $t.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case $t.DragEnd:case $t.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $t.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new Dl(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case $t.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const o=new Dl(e.droppable.containers);return o.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case $t.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new Dl(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function v4(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=j.useContext(Pp),a=my(n),o=my(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&a&&o!=null){if(!ex(a)||document.activeElement===a.target)return;const s=i.get(o);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const c=lL(f);if(c){c.focus();break}}})}},[n,t,i,o,a]),null}function y4(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function g4(e){return j.useMemo(()=>({draggable:{...hf.draggable,...e==null?void 0:e.draggable},droppable:{...hf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...hf.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function x4(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=j.useRef(!1),{x:o,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Rn(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=r(u),c=OE(f,n);if(o||(c.x=0),s||(c.y=0),a.current=!0,Math.abs(c.x)>0||Math.abs(c.y)>0){const p=jE(u);p&&p.scrollBy({top:c.y,left:c.x})}},[t,o,s,n,r])}const IE=j.createContext({...yn,scaleX:1,scaleY:1});var ji;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ji||(ji={}));const b4=j.memo(function(t){var r,n,i,a;let{id:o,accessibility:s,autoScroll:l=!0,children:u,sensors:f=c4,collisionDetection:c=SL,measuring:p,modifiers:h,...x}=t;const v=j.useReducer(m4,void 0,h4),[y,g]=v,[m,w]=hL(),[S,b]=j.useState(ji.Uninitialized),_=S===ji.Initialized,{draggable:{active:O,nodes:k,translate:P},droppable:{containers:R}}=y,$=O!=null?k.get(O):null,C=j.useRef({initial:null,translated:null}),I=j.useMemo(()=>{var qt;return O!=null?{id:O,data:(qt=$==null?void 0:$.data)!=null?qt:f4,rect:C}:null},[O,$]),D=j.useRef(null),[L,z]=j.useState(null),[U,M]=j.useState(null),B=fu(x,Object.values(x)),W=sc("DndDescribedBy",o),J=j.useMemo(()=>R.getEnabled(),[R]),G=g4(p),{droppableRects:Q,measureDroppableContainers:X,measuringScheduled:de}=QL(J,{dragging:_,dependencies:[P.x,P.y],config:G.droppable}),ue=YL(k,O),Se=j.useMemo(()=>U?vy(U):null,[U]),_e=yc(),te=JL(ue,G.draggable.measure);x4({activeNode:O!=null?k.get(O):null,config:_e.layoutShiftCompensation,initialRect:te,measure:G.draggable.measure});const re=yw(ue,G.draggable.measure,te),pe=yw(ue?ue.parentElement:null),K=j.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Pe=R.getNodeFor((r=K.current.over)==null?void 0:r.id),he=u4({measure:G.dragOverlay.measure}),Me=(n=he.nodeRef.current)!=null?n:ue,Be=_?(i=he.rect)!=null?i:re:null,ve=!!(he.nodeRef.current&&he.rect),Ae=r4(ve?null:re),$e=$E(Me?wr(Me):null),Oe=n4(_?Pe??ue:null),He=s4(Oe),Ue=y4(h,{transform:{x:P.x-Ae.x,y:P.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:U,active:I,activeNodeRect:re,containerNodeRect:pe,draggingNodeRect:Be,over:K.current.over,overlayNodeRect:he.rect,scrollableAncestors:Oe,scrollableAncestorRects:He,windowRect:$e}),T=Se?Mo(Se,P):null,A=i4(Oe),E=xw(A),F=xw(A,[re]),V=Mo(Ue,E),q=Be?AL(Be,Ue):null,Y=I&&q?c({active:I,collisionRect:q,droppableRects:Q,droppableContainers:J,pointerCoordinates:T}):null,ie=SE(Y,"id"),[me,bt]=j.useState(null),Et=ve?Ue:Mo(Ue,F),Pt=OL(Et,(a=me==null?void 0:me.rect)!=null?a:null,re),Ws=j.useRef(null),Ja=j.useCallback((qt,Sr)=>{let{sensor:Or,options:yi}=Sr;if(D.current==null)return;const Lr=k.get(D.current);if(!Lr)return;const jr=qt.nativeEvent,xn=new Or({active:D.current,activeNode:Lr,event:jr,options:yi,context:K,onAbort(Vt){if(!k.get(Vt))return;const{onDragAbort:bn}=B.current,Ln={id:Vt};bn==null||bn(Ln),m({type:"onDragAbort",event:Ln})},onPending(Vt,gi,bn,Ln){if(!k.get(Vt))return;const{onDragPending:Ks}=B.current,xi={id:Vt,constraint:gi,initialCoordinates:bn,offset:Ln};Ks==null||Ks(xi),m({type:"onDragPending",event:xi})},onStart(Vt){const gi=D.current;if(gi==null)return;const bn=k.get(gi);if(!bn)return;const{onDragStart:Ln}=B.current,Gs={activatorEvent:jr,active:{id:gi,data:bn.data,rect:C}};wo.unstable_batchedUpdates(()=>{Ln==null||Ln(Gs),b(ji.Initializing),g({type:$t.DragStart,initialCoordinates:Vt,active:gi}),m({type:"onDragStart",event:Gs}),z(Ws.current),M(jr)})},onMove(Vt){g({type:$t.DragMove,coordinates:Vt})},onEnd:eo($t.DragEnd),onCancel:eo($t.DragCancel)});Ws.current=xn;function eo(Vt){return async function(){const{active:bn,collisions:Ln,over:Gs,scrollAdjustedTranslate:Ks}=K.current;let xi=null;if(bn&&Ks){const{cancelDrop:qs}=B.current;xi={activatorEvent:jr,active:bn,collisions:Ln,delta:Ks,over:Gs},Vt===$t.DragEnd&&typeof qs=="function"&&await Promise.resolve(qs(xi))&&(Vt=$t.DragCancel)}D.current=null,wo.unstable_batchedUpdates(()=>{g({type:Vt}),b(ji.Uninitialized),bt(null),z(null),M(null),Ws.current=null;const qs=Vt===$t.DragEnd?"onDragEnd":"onDragCancel";if(xi){const jh=B.current[qs];jh==null||jh(xi),m({type:qs,event:xi})}})}}},[k]),Hs=j.useCallback((qt,Sr)=>(Or,yi)=>{const Lr=Or.nativeEvent,jr=k.get(yi);if(D.current!==null||!jr||Lr.dndKit||Lr.defaultPrevented)return;const xn={active:jr};qt(Or,Sr.options,xn)===!0&&(Lr.dndKit={capturedBy:Sr.sensor},D.current=yi,Ja(Or,Sr))},[k,Ja]),mc=ZL(f,Hs);a4(f),Rn(()=>{re&&S===ji.Initializing&&b(ji.Initialized)},[re,S]),j.useEffect(()=>{const{onDragMove:qt}=B.current,{active:Sr,activatorEvent:Or,collisions:yi,over:Lr}=K.current;if(!Sr||!Or)return;const jr={active:Sr,activatorEvent:Or,collisions:yi,delta:{x:V.x,y:V.y},over:Lr};wo.unstable_batchedUpdates(()=>{qt==null||qt(jr),m({type:"onDragMove",event:jr})})},[V.x,V.y]),j.useEffect(()=>{const{active:qt,activatorEvent:Sr,collisions:Or,droppableContainers:yi,scrollAdjustedTranslate:Lr}=K.current;if(!qt||D.current==null||!Sr||!Lr)return;const{onDragOver:jr}=B.current,xn=yi.get(ie),eo=xn&&xn.rect.current?{id:xn.id,rect:xn.rect.current,data:xn.data,disabled:xn.disabled}:null,Vt={active:qt,activatorEvent:Sr,collisions:Or,delta:{x:Lr.x,y:Lr.y},over:eo};wo.unstable_batchedUpdates(()=>{bt(eo),jr==null||jr(Vt),m({type:"onDragOver",event:Vt})})},[ie]),Rn(()=>{K.current={activatorEvent:U,active:I,activeNode:ue,collisionRect:q,collisions:Y,droppableRects:Q,draggableNodes:k,draggingNode:Me,draggingNodeRect:Be,droppableContainers:R,over:me,scrollableAncestors:Oe,scrollAdjustedTranslate:V},C.current={initial:Be,translated:q}},[I,ue,Y,q,k,Me,Be,Q,R,me,Oe,V]),KL({..._e,delta:P,draggingRect:q,pointerCoordinates:T,scrollableAncestors:Oe,scrollableAncestorRects:He});const vc=j.useMemo(()=>({active:I,activeNode:ue,activeNodeRect:re,activatorEvent:U,collisions:Y,containerNodeRect:pe,dragOverlay:he,draggableNodes:k,droppableContainers:R,droppableRects:Q,over:me,measureDroppableContainers:X,scrollableAncestors:Oe,scrollableAncestorRects:He,measuringConfiguration:G,measuringScheduled:de,windowRect:$e}),[I,ue,re,U,Y,pe,he,k,R,Q,me,X,Oe,He,G,de,$e]),Oh=j.useMemo(()=>({activatorEvent:U,activators:mc,active:I,activeNodeRect:re,ariaDescribedById:{draggable:W},dispatch:g,draggableNodes:k,over:me,measureDroppableContainers:X}),[U,mc,I,re,g,W,k,me,X]);return N.createElement(bE.Provider,{value:w},N.createElement(Pp.Provider,{value:Oh},N.createElement(RE.Provider,{value:vc},N.createElement(IE.Provider,{value:Pt},u)),N.createElement(v4,{disabled:(s==null?void 0:s.restoreFocus)===!1})),N.createElement(yL,{...s,hiddenTextDescribedById:W}));function yc(){const qt=(L==null?void 0:L.autoScrollEnabled)===!1,Sr=typeof l=="object"?l.enabled===!1:l===!1,Or=_&&!qt&&!Sr;return typeof l=="object"?{...l,enabled:Or}:{enabled:Or}}}),w4=j.createContext(null),ww="button",_4="Draggable";function S4(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=sc(_4),{activators:o,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:c,over:p}=j.useContext(Pp),{role:h=ww,roleDescription:x="draggable",tabIndex:v=0}=i??{},y=(l==null?void 0:l.id)===t,g=j.useContext(y?IE:w4),[m,w]=Qf(),[S,b]=Qf(),_=o4(o,t),O=fu(r);Rn(()=>(c.set(t,{id:t,key:a,node:m,activatorNode:S,data:O}),()=>{const P=c.get(t);P&&P.key===a&&c.delete(t)}),[c,t]);const k=j.useMemo(()=>({role:h,tabIndex:v,"aria-disabled":n,"aria-pressed":y&&h===ww?!0:void 0,"aria-roledescription":x,"aria-describedby":f.draggable}),[n,h,v,y,x,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:k,isDragging:y,listeners:n?void 0:_,node:m,over:p,setNodeRef:w,setActivatorNodeRef:b,transform:g}}function O4(){return j.useContext(RE)}const j4="Droppable",A4={timeout:25};function k4(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=sc(j4),{active:o,dispatch:s,over:l,measureDroppableContainers:u}=j.useContext(Pp),f=j.useRef({disabled:r}),c=j.useRef(!1),p=j.useRef(null),h=j.useRef(null),{disabled:x,updateMeasurementsFor:v,timeout:y}={...A4,...i},g=fu(v??n),m=j.useCallback(()=>{if(!c.current){c.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),h.current=null},y)},[y]),w=Ep({callback:m,disabled:x||!o}),S=j.useCallback((k,P)=>{w&&(P&&(w.unobserve(P),c.current=!1),k&&w.observe(k))},[w]),[b,_]=Qf(S),O=fu(t);return j.useEffect(()=>{!w||!b.current||(w.disconnect(),c.current=!1,w.observe(b.current))},[b,w]),j.useEffect(()=>(s({type:$t.RegisterDroppable,element:{id:n,key:a,disabled:r,node:b,rect:p,data:O}}),()=>s({type:$t.UnregisterDroppable,key:a,id:n})),[n]),j.useEffect(()=>{r!==f.current.disabled&&(s({type:$t.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,s]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===n,node:b,over:l,setNodeRef:_}}function ax(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function E4(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function Bc(e){return e!==null&&e>=0}function P4(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=ax(t,n,r),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Fc={scaleX:1,scaleY:1},T4=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:o}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(i===r){const u=a[o];return u?{x:0,y:rr&&i<=o?{x:0,y:-s.height-l,...Fc}:i=o?{x:0,y:s.height+l,...Fc}:{x:0,y:0,...Fc}};function N4(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?rn.map(_=>typeof _=="object"&&"id"in _?_.id:_),[n]),x=o!=null,v=o?h.indexOf(o.id):-1,y=u?h.indexOf(u.id):-1,g=j.useRef(h),m=!P4(h,g.current),w=y!==-1&&v===-1||m,S=C4(a);Rn(()=>{m&&x&&f(h)},[m,h,x,f]),j.useEffect(()=>{g.current=h},[h]);const b=j.useMemo(()=>({activeIndex:v,containerId:c,disabled:S,disableTransforms:w,items:h,overIndex:y,useDragOverlay:p,sortedRects:E4(h,l),strategy:i}),[v,c,S.draggable,S.droppable,w,h,y,l,p,i]);return N.createElement(LE.Provider,{value:b},t)}const R4=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return ax(r,n,i).indexOf(t)},I4=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!n||s!==a&&i===o?!1:r?!0:o!==i&&t===l},M4={duration:200,easing:"ease"},BE="transform",D4=pu.Transition.toString({property:BE,duration:0,easing:"linear"}),L4={roleDescription:"sortable"};function B4(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,o]=j.useState(null),s=j.useRef(r);return Rn(()=>{if(!t&&r!==s.current&&n.current){const l=i.current;if(l){const u=Ts(n.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&o(f)}}r!==s.current&&(s.current=r)},[t,r,n,i]),j.useEffect(()=>{a&&o(null)},[a]),a}function F4(e){let{animateLayoutChanges:t=I4,attributes:r,disabled:n,data:i,getNewIndex:a=R4,id:o,strategy:s,resizeObserverConfig:l,transition:u=M4}=e;const{items:f,containerId:c,activeIndex:p,disabled:h,disableTransforms:x,sortedRects:v,overIndex:y,useDragOverlay:g,strategy:m}=j.useContext(LE),w=z4(n,h),S=f.indexOf(o),b=j.useMemo(()=>({sortable:{containerId:c,index:S,items:f},...i}),[c,i,S,f]),_=j.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:O,node:k,isOver:P,setNodeRef:R}=k4({id:o,data:b,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...l}}),{active:$,activatorEvent:C,activeNodeRect:I,attributes:D,setNodeRef:L,listeners:z,isDragging:U,over:M,setActivatorNodeRef:B,transform:W}=S4({id:o,data:b,attributes:{...L4,...r},disabled:w.draggable}),J=iL(R,L),G=!!$,Q=G&&!x&&Bc(p)&&Bc(y),X=!g&&U,de=X&&Q?W:null,Se=Q?de??(s??m)({rects:v,activeNodeRect:I,activeIndex:p,overIndex:y,index:S}):null,_e=Bc(p)&&Bc(y)?a({id:o,items:f,activeIndex:p,overIndex:y}):S,te=$==null?void 0:$.id,re=j.useRef({activeId:te,items:f,newIndex:_e,containerId:c}),pe=f!==re.current.items,K=t({active:$,containerId:c,isDragging:U,isSorting:G,id:o,index:S,items:f,newIndex:re.current.newIndex,previousItems:re.current.items,previousContainerId:re.current.containerId,transition:u,wasDragging:re.current.activeId!=null}),Pe=B4({disabled:!K,index:S,node:k,rect:O});return j.useEffect(()=>{G&&re.current.newIndex!==_e&&(re.current.newIndex=_e),c!==re.current.containerId&&(re.current.containerId=c),f!==re.current.items&&(re.current.items=f)},[G,_e,c,f]),j.useEffect(()=>{if(te===re.current.activeId)return;if(te&&!re.current.activeId){re.current.activeId=te;return}const Me=setTimeout(()=>{re.current.activeId=te},50);return()=>clearTimeout(Me)},[te]),{active:$,activeIndex:p,attributes:D,data:b,rect:O,index:S,newIndex:_e,items:f,isOver:P,isSorting:G,isDragging:U,listeners:z,node:k,overIndex:y,over:M,setNodeRef:J,setActivatorNodeRef:B,setDroppableNodeRef:R,setDraggableNodeRef:L,transform:Pe??Se,transition:he()};function he(){if(Pe||pe&&re.current.newIndex===S)return D4;if(!(X&&!ex(C)||!u)&&(G||K))return pu.Transition.toString({...u,property:BE})}}function z4(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function td(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const U4=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],V4=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(U4.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];a.getEnabled().forEach(c=>{if(!c||c!=null&&c.disabled)return;const p=i.get(c.id);if(p)switch(e.code){case Ie.Down:n.topp.top&&l.push(c);break;case Ie.Left:n.left>p.left&&l.push(c);break;case Ie.Right:n.left1&&(f=u[1].id),f!=null){const c=a.get(r.id),p=a.get(f),h=p?i.get(p.id):null,x=p==null?void 0:p.node.current;if(x&&h&&c&&p){const y=kp(x).some((_,O)=>s[O]!==_),g=FE(c,p),m=W4(c,p),w=y||!g?{x:0,y:0}:{x:m?n.width-h.width:0,y:m?n.height-h.height:0},S={x:h.left,y:h.top};return w.x&&w.y?S:du(S,w)}}}};function FE(e,t){return!td(e)||!td(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function W4(e,t){return!td(e)||!td(t)||!FE(e,t)?!1:e.data.current.sortable.index{if(!i||typeof i!="object")return{};const a=i.keys;return a&&typeof a=="object"?a:i},r={...t(e.keys),...t((n=e.routing_config)==null?void 0:n.keys)};return Object.keys(r).length===0?[]:Object.entries(r).map(([i,a])=>{const o=(a.type||a.data_type||"str_value").toString().toLowerCase(),s={key:i,type:o};return a.values&&(s.values=Array.isArray(a.values)?a.values.map(l=>l.trim()):a.values.split(",").map(l=>l.trim())),a.min_value!==void 0&&(s.min_value=a.min_value),a.max_value!==void 0&&(s.max_value=a.max_value),a.min_length!==void 0&&(s.min_length=a.min_length),a.max_length!==void 0&&(s.max_length=a.max_length),a.exact_length!==void 0&&(s.exact_length=a.exact_length),a.regex&&(s.regex=a.regex),s})}function zE(){const{data:e,error:t,isLoading:r}=vn("/config/routing-keys",dM,{refreshInterval:0,revalidateOnFocus:!1}),n=H4(e||null),i=n.reduce((o,s)=>(o[s.key]=s,o),{}),a={};return n.forEach(o=>{a[o.key]={type:o.type,values:o.values||[]}}),{config:e,keys:n,keysByName:i,routingKeysConfig:a,isLoading:r,error:t,getKeyValues:o=>{var s;return((s=i[o])==null?void 0:s.values)||[]},isIntegerKey:o=>{var s;return((s=i[o])==null?void 0:s.type)==="integer"},isEnumKey:o=>{var s;return((s=i[o])==null?void 0:s.type)==="enum"}}}const G4={"==":"equal","!=":"not_equal",">":"greater_than","<":"less_than",">=":"greater_than_equal","<=":"less_than_equal"};function K4({id:e,name:t,onRemove:r}){const{attributes:n,listeners:i,setNodeRef:a,transform:o,transition:s}=F4({id:e}),l={transform:pu.Transform.toString(o),transition:s};return d.jsxs("div",{ref:a,style:l,className:"flex items-center gap-2 bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] rounded-lg px-2 py-1.5",children:[d.jsx("span",{...n,...i,className:"cursor-grab text-slate-400",children:d.jsx(wI,{size:14})}),d.jsx("span",{className:"text-sm flex-1 font-mono",children:t}),d.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:d.jsx(ai,{size:12})})]})}function UE({gateways:e,onChange:t}){const[r,n]=j.useState(""),[i,a]=j.useState(""),o=gL(uw(ix),uw(rx,{coordinateGetter:V4}));function s(u){const{active:f,over:c}=u;if(c&&f.id!==c.id){const p=e.findIndex(x=>x.id===f.id),h=e.findIndex(x=>x.id===c.id);t(ax(e,p,h))}}function l(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:i.trim()}]),n(""),a(""))}return d.jsxs("div",{className:"space-y-2",children:[d.jsx(b4,{sensors:o,collisionDetection:bL,onDragEnd:s,children:d.jsx($4,{items:e.map(u=>u.id),strategy:T4,children:e.map((u,f)=>d.jsx(K4,{id:u.id,name:`${f+1}. ${u.gatewayName}${u.gatewayId?` (${u.gatewayId})`:""}`,onRemove:()=>t(e.filter(c=>c.id!==u.id))},u.id))})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{value:i,onChange:u=>a(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs(ht,{type:"button",size:"sm",variant:"secondary",onClick:l,children:[d.jsx(Xi,{size:13})," Add"]})]})]})}function VE({gateways:e,onChange:t}){const[r,n]=j.useState(""),[i,a]=j.useState(""),o=e.reduce((l,u)=>l+u.split,0);function s(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:i.trim(),split:0}]),n(""),a(""))}return d.jsxs("div",{className:"space-y-2",children:[e.map(l=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{value:l.gatewayName,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayName:u.target.value}:f)),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-32 focus:outline-none"}),d.jsx("input",{value:l.gatewayId,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayId:u.target.value}:f)),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-28 focus:outline-none"}),d.jsx("input",{type:"range",min:0,max:100,value:l.split,onChange:u=>t(e.map(f=>f.id===l.id?{...f,split:Number(u.target.value)}:f)),className:"flex-1 accent-brand-500"}),d.jsxs("span",{className:"text-sm w-10 text-right",children:[l.split,"%"]}),d.jsx("button",{type:"button",onClick:()=>t(e.filter(u=>u.id!==l.id)),className:"text-red-400 hover:text-red-600",children:d.jsx(ai,{size:12})})]},l.id)),d.jsxs("div",{className:`text-xs font-medium ${o===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",o,"% ",o!==100&&"(must equal 100)"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:r,onChange:l=>n(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{value:i,onChange:l=>a(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsxs(ht,{type:"button",size:"sm",variant:"secondary",onClick:s,children:[d.jsx(Xi,{size:13})," Add"]})]})]})}function q4({row:e,onChange:t,onRemove:r,routingKeys:n}){var l;const i=n[e.lhs],a=(i==null?void 0:i.type)==="enum",s=(i==null?void 0:i.type)==="integer"?[">","<",">=","<=","==","!="]:["==","!="];return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("select",{value:e.lhs,onChange:u=>t({...e,lhs:u.target.value,value:"",operator:"=="}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:Object.keys(n).map(u=>d.jsx("option",{value:u,children:u},u))}),d.jsx("select",{value:e.operator,onChange:u=>t({...e,operator:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:s.map(u=>d.jsx("option",{value:u,children:u},u))}),a?d.jsxs("select",{value:e.value,onChange:u=>t({...e,value:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:[d.jsx("option",{value:"",children:"select..."}),(((l=n[e.lhs])==null?void 0:l.values)||[]).map(u=>d.jsx("option",{value:u,children:u},u))]}):d.jsx("input",{type:"number",value:e.value,onChange:u=>t({...e,value:u.target.value}),placeholder:"value",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none"}),d.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:d.jsx(ai,{size:12})})]})}function X4({block:e,onChange:t,onRemove:r,routingKeys:n}){var f;const[i,a]=j.useState(!1),o=Object.keys(n)[0]||"payment_method",l=(((f=n[o])==null?void 0:f.values)||[])[0]||"";function u(){t({...e,conditions:[...e.conditions,{id:crypto.randomUUID(),lhs:o,operator:"==",value:l}]})}return d.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#0d0d12] rounded-t-xl cursor-pointer",onClick:()=>a(!i),children:[d.jsx("input",{value:e.name,onChange:c=>{c.stopPropagation(),t({...e,name:c.target.value})},onClick:c=>c.stopPropagation(),placeholder:"Rule name",className:"bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),r()},className:"text-red-400 hover:text-red-600",children:d.jsx(ai,{size:14})}),i?d.jsx(xl,{size:14}):d.jsx(bl,{size:14})]})]}),!i&&d.jsxs("div",{className:"px-4 py-3 space-y-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"CONDITIONS"}),d.jsxs("div",{className:"space-y-2",children:[e.conditions.map(c=>d.jsx(q4,{row:c,routingKeys:n,onChange:p=>t({...e,conditions:e.conditions.map(h=>h.id===c.id?p:h)}),onRemove:()=>t({...e,conditions:e.conditions.filter(p=>p.id!==c.id)})},c.id)),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:u,children:[d.jsx(Xi,{size:12})," Add Condition"]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"OUTPUT"}),d.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(c=>d.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[d.jsx("input",{type:"radio",checked:e.outputType===c,onChange:()=>t({...e,outputType:c}),className:"accent-brand-500"}),c==="priority"?"Priority":"Volume Split"]},c))}),e.outputType==="priority"?d.jsx(UE,{gateways:e.priorityGateways,onChange:c=>t({...e,priorityGateways:c})}):d.jsx(VE,{gateways:e.volumeGateways,onChange:c=>t({...e,volumeGateways:c})})]})]})]})}function Y4(e,t,r){function n(a,o,s){return a==="priority"?{priority:o.map(l=>({gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}))}:{volume_split:s.map(l=>({split:l.split,output:{gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}}))}}function i(a){return a==="priority"?"priority":"volume_split"}return{globals:{},default_selection:n(t.type,t.priorityGateways,t.volumeGateways),rules:e.map(a=>({name:a.name,routing_type:i(a.outputType),output:n(a.outputType,a.priorityGateways,a.volumeGateways),statements:[{condition:a.conditions.map(o=>{var s,l;return{lhs:o.lhs,comparison:G4[o.operator]||o.operator,value:{type:((s=r[o.lhs])==null?void 0:s.type)==="integer"?"number":"enum_variant",value:((l=r[o.lhs])==null?void 0:l.type)==="integer"?Number(o.value):o.value},metadata:{}}})}]}))}}function Z4(){const{merchantId:e}=na(),{routingKeysConfig:t,isLoading:r,error:n}=zE(),i=t,a=Object.keys(i).length>0,o=!r&&(!a||!!n),[s,l]=j.useState(""),[u,f]=j.useState(""),[c,p]=j.useState([]),[h,x]=j.useState({type:"priority",priorityGateways:[],volumeGateways:[]}),[v,y]=j.useState(!1),[g,m]=j.useState(!1),[w,S]=j.useState(null),[b,_]=j.useState(null),[O,k]=j.useState(!1),[P,R]=j.useState(null),[$,C]=j.useState(!1),[I,D]=j.useState(new Set),{data:L,mutate:z}=vn(e?`/routing/list/${e}`:null,()=>ft(`/routing/list/${e}`)),{data:U}=vn(e?`/routing/list/active/${e}`:null,()=>ft(`/routing/list/active/${e}`)),M=new Set((U||[]).map(X=>X.id)),B=Y4(c,h,i);async function W(X){if(X.preventDefault(),!e){S("Set a Merchant ID first.");return}if(o){S("Routing key config is unavailable. Ensure backend /config/routing-keys is reachable and valid.");return}if(!s.trim()){S("Rule name is required.");return}m(!0),S(null),_(null);try{const de=await ft("/routing/create",{name:s.trim(),description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:B}});_(de.id),z()}catch(de){S(String(de))}finally{m(!1)}}async function J(X){if(e){k(!0),R(null),C(!1);try{await ft("/routing/activate",{created_by:e,routing_algorithm_id:X}),C(!0),z()}catch(de){R(String(de))}finally{k(!1)}}}function G(X){D(de=>{const ue=new Set(de);return ue.has(X)?ue.delete(X):ue.add(X),ue})}function Q(){p(X=>[...X,{id:crypto.randomUUID(),name:`Rule ${X.length+1}`,conditions:[],outputType:"priority",priorityGateways:[],volumeGateways:[]}])}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Rule-Based Routing"}),d.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Create Euclid DSL declarative routing rules"})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[d.jsxs("div",{className:"lg:col-span-1 space-y-3",children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Existing Rules"})}),d.jsx(Te,{className:"p-0",children:e?L?L.length===0?d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"No rules yet."}):d.jsx("table",{className:"w-full text-sm",children:d.jsx("tbody",{children:L.map(X=>{const de=M.has(X.id),ue=I.has(X.id),Se=X.algorithm_data||X.algorithm;return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"border-b border-slate-100 dark:border-[#222226] last:border-0",children:[d.jsxs("td",{className:"px-4 py-3",children:[d.jsx("p",{className:"font-medium truncate",children:X.name}),d.jsx("p",{className:"text-xs text-slate-400 capitalize",children:Se==null?void 0:Se.type})]}),d.jsx("td",{className:"px-2 py-3",children:d.jsx(Qt,{variant:de?"green":"gray",children:de?"Active":"Inactive"})}),d.jsx("td",{className:"px-2 py-3",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsxs(ht,{size:"sm",variant:"ghost",onClick:()=>G(X.id),children:[d.jsx(_p,{size:14,className:"mr-1"}),ue?"Hide":"View"]}),!de&&d.jsx(ht,{size:"sm",variant:"ghost",onClick:()=>J(X.id),disabled:O,children:"Activate"})]})})]},X.id),ue&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"ID:"})," ",X.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Description:"})," ",X.description||"N/A"]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Algorithm For:"})," ",X.algorithm_for]}),X.created_at&&d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",new Date(X.created_at).toLocaleString()]}),d.jsxs("div",{children:[d.jsx("strong",{children:"Configuration:"}),d.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(Se,null,2)})]})]})})})]})})})}):d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Loading..."}):d.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Set merchant ID to load rules."})})]}),P&&d.jsx(Zn,{error:P}),$&&d.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400",children:"Rule activated successfully."})]}),d.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[d.jsx("form",{onSubmit:W,className:"space-y-4",children:d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Rule Builder"})}),d.jsxs(Te,{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rule Name *"}),d.jsx("input",{value:s,onChange:X=>l(X.target.value),placeholder:"my-rule",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),d.jsx("input",{value:u,onChange:X=>f(X.target.value),placeholder:"Optional description",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Rules"}),r&&d.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),o&&d.jsx(Zn,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Builder is disabled until this is fixed."}),c.map(X=>d.jsx(X4,{block:X,routingKeys:i,onChange:de=>p(ue=>ue.map(Se=>Se.id===X.id?de:Se)),onRemove:()=>p(de=>de.filter(ue=>ue.id!==X.id))},X.id)),d.jsxs(ht,{type:"button",variant:"secondary",size:"sm",onClick:Q,disabled:o,children:[d.jsx(Xi,{size:14})," Add Rule Block"]})]}),d.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl px-4 py-3",children:[d.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"DEFAULT SELECTION (Fallback)"}),d.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(X=>d.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[d.jsx("input",{type:"radio",checked:h.type===X,onChange:()=>x({...h,type:X}),className:"accent-brand-500"}),X==="priority"?"Priority":"Volume Split"]},X))}),h.type==="priority"?d.jsx(UE,{gateways:h.priorityGateways,onChange:X=>x({...h,priorityGateways:X})}):d.jsx(VE,{gateways:h.volumeGateways,onChange:X=>x({...h,volumeGateways:X})})]}),d.jsx(Zn,{error:w}),b&&d.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400 flex items-center justify-between",children:[d.jsxs("span",{children:["Rule created (ID: ",b,")"]}),d.jsx(ht,{type:"button",size:"sm",onClick:()=>J(b),disabled:O,children:"Activate Now"})]}),d.jsxs("div",{className:"flex gap-3",children:[d.jsx(ht,{type:"submit",disabled:g||o,children:g?"Creating...":"Create Rule"}),d.jsx(ht,{type:"button",variant:"secondary",size:"sm",onClick:()=>y(!v),children:v?"Hide JSON":"Preview JSON"})]})]})]})}),v&&d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"JSON Preview"})}),d.jsx(Te,{children:d.jsx("pre",{className:"text-xs text-slate-600 overflow-auto max-h-64 bg-[#07070b] rounded-lg p-4 font-mono border border-slate-200 dark:border-[#1c1c24]",children:JSON.stringify({name:s,description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:B}},null,2)})})]})]})]})]})}function WE(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var Y5=X5,Z5=Tp;function Q5(e,t){var r=this.__data__,n=Z5(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var J5=Q5,eB=M5,tB=W5,rB=K5,nB=Y5,iB=J5;function Is(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Sa=function(t){return Ua(t)&&t.indexOf("%")===t.length-1},ne=function(t){return O6(t)&&!uc(t)},E6=function(t){return Ee(t)},It=function(t){return ne(t)||Ua(t)},P6=0,cc=function(t){var r=++P6;return"".concat(t||"").concat(r)},sr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ne(t)&&!Ua(t))return n;var a;if(Sa(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return uc(a)&&(a=n),i&&a>r&&(a=r),a},so=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},C6=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function D6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var $w={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Qn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Rw=null,jm=null,yx=function e(t){if(t===Rw&&Array.isArray(jm))return jm;var r=[];return j.Children.forEach(t,function(n){Ee(n)||(x6.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),jm=r,Rw=t,r};function Yr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Qn(i)}):n=[Qn(t)],yx(e).forEach(function(i){var a=$r(i,"type.displayName")||$r(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Er(e,t){var r=Yr(e,t);return r&&r[0]}var Iw=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!ne(n)||n<=0||!ne(i)||i<=0)},L6=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],B6=function(t){return t&&t.type&&Ua(t.type)&&L6.indexOf(t.type)>=0},F6=function(t,r,n,i){var a,o=(a=Om==null?void 0:Om[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!we(t)&&(i&&o.includes(r)||$6.includes(r))||n&&vx.includes(r)},ge=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(j.isValidElement(t)&&(i=t.props),!$s(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;F6((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},_y=function e(t,r){if(t===r)return!0;var n=j.Children.count(t);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Mw(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function H6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Oy(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=W6(e,V6),f=i||{width:r,height:n,x:0,y:0},c=je("recharts-surface",a);return N.createElement("svg",Sy({},ge(u,!0,"svg"),{className:c,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),N.createElement("title",null,s),N.createElement("desc",null,l),t)}var G6=["children","className"];function jy(){return jy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function q6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Ge=N.forwardRef(function(e,t){var r=e.children,n=e.className,i=K6(e,G6),a=je("recharts-layer",n);return N.createElement("g",jy({className:a},ge(i,!0),{ref:t}),r)}),Jn=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:Z6(e,t,r)}var J6=Q6,eF="\\ud800-\\udfff",tF="\\u0300-\\u036f",rF="\\ufe20-\\ufe2f",nF="\\u20d0-\\u20ff",iF=tF+rF+nF,aF="\\ufe0e\\ufe0f",oF="\\u200d",sF=RegExp("["+oF+eF+iF+aF+"]");function lF(e){return sF.test(e)}var n2=lF;function uF(e){return e.split("")}var cF=uF,i2="\\ud800-\\udfff",fF="\\u0300-\\u036f",dF="\\ufe20-\\ufe2f",pF="\\u20d0-\\u20ff",hF=fF+dF+pF,mF="\\ufe0e\\ufe0f",vF="["+i2+"]",Ay="["+hF+"]",ky="\\ud83c[\\udffb-\\udfff]",yF="(?:"+Ay+"|"+ky+")",a2="[^"+i2+"]",o2="(?:\\ud83c[\\udde6-\\uddff]){2}",s2="[\\ud800-\\udbff][\\udc00-\\udfff]",gF="\\u200d",l2=yF+"?",u2="["+mF+"]?",xF="(?:"+gF+"(?:"+[a2,o2,s2].join("|")+")"+u2+l2+")*",bF=u2+l2+xF,wF="(?:"+[a2+Ay+"?",Ay,o2,s2,vF].join("|")+")",_F=RegExp(ky+"(?="+ky+")|"+wF+bF,"g");function SF(e){return e.match(_F)||[]}var OF=SF,jF=cF,AF=n2,kF=OF;function EF(e){return AF(e)?kF(e):jF(e)}var PF=EF,CF=J6,TF=n2,NF=PF,$F=ZE;function RF(e){return function(t){t=$F(t);var r=TF(t)?NF(t):void 0,n=r?r[0]:t.charAt(0),i=r?CF(r,1).join(""):t.slice(1);return n[e]()+i}}var IF=RF,MF=IF,DF=MF("toUpperCase"),LF=DF;const Hp=qe(LF);function rt(e){return function(){return e}}const c2=Math.cos,nd=Math.sin,gn=Math.sqrt,id=Math.PI,Gp=2*id,Ey=Math.PI,Py=2*Ey,ma=1e-6,BF=Py-ma;function f2(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return f2;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;ima)if(!(Math.abs(c*l-u*f)>ma)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,x=i-s,v=l*l+u*u,y=h*h+x*x,g=Math.sqrt(v),m=Math.sqrt(p),w=a*Math.tan((Ey-Math.acos((v+p-y)/(2*g*m)))/2),S=w/m,b=w/g;Math.abs(S-1)>ma&&this._append`L${t+S*f},${r+S*c}`,this._append`A${a},${a},0,0,${+(c*h>f*x)},${this._x1=t+b*l},${this._y1=r+b*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,f=r+l,c=1^o,p=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>ma||Math.abs(this._y1-f)>ma)&&this._append`L${u},${f}`,n&&(p<0&&(p=p%Py+Py),p>BF?this._append`A${n},${n},0,1,${c},${t-s},${r-l}A${n},${n},0,1,${c},${this._x1=u},${this._y1=f}`:p>ma&&this._append`A${n},${n},0,${+(p>=Ey)},${c},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function gx(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new zF(t)}function xx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function d2(e){this._context=e}d2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Kp(e){return new d2(e)}function p2(e){return e[0]}function h2(e){return e[1]}function m2(e,t){var r=rt(!0),n=null,i=Kp,a=null,o=gx(s);e=typeof e=="function"?e:e===void 0?p2:rt(e),t=typeof t=="function"?t:t===void 0?h2:rt(t);function s(l){var u,f=(l=xx(l)).length,c,p=!1,h;for(n==null&&(a=i(h=o())),u=0;u<=f;++u)!(u=h;--x)s.point(w[x],S[x]);s.lineEnd(),s.areaEnd()}g&&(w[p]=+e(y,p,c),S[p]=+t(y,p,c),s.point(n?+n(y,p,c):w[p],r?+r(y,p,c):S[p]))}if(m)return s=null,m+""||null}function f(){return m2().defined(i).curve(o).context(a)}return u.x=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),n=null,u):e},u.x0=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),u):e},u.x1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:rt(+c),u):n},u.y=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),r=null,u):t},u.y0=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),u):t},u.y1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:rt(+c),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(c){return arguments.length?(i=typeof c=="function"?c:rt(!!c),u):i},u.curve=function(c){return arguments.length?(o=c,a!=null&&(s=o(a)),u):o},u.context=function(c){return arguments.length?(c==null?a=s=null:s=o(a=c),u):a},u}class v2{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function UF(e){return new v2(e,!0)}function VF(e){return new v2(e,!1)}const bx={draw(e,t){const r=gn(t/id);e.moveTo(r,0),e.arc(0,0,r,0,Gp)}},WF={draw(e,t){const r=gn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},y2=gn(1/3),HF=y2*2,GF={draw(e,t){const r=gn(t/HF),n=r*y2;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},KF={draw(e,t){const r=gn(t),n=-r/2;e.rect(n,n,r,r)}},qF=.8908130915292852,g2=nd(id/10)/nd(7*id/10),XF=nd(Gp/10)*g2,YF=-c2(Gp/10)*g2,ZF={draw(e,t){const r=gn(t*qF),n=XF*r,i=YF*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Gp*a/5,s=c2(o),l=nd(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},Am=gn(3),QF={draw(e,t){const r=-gn(t/(Am*3));e.moveTo(0,r*2),e.lineTo(-Am*r,-r),e.lineTo(Am*r,-r),e.closePath()}},Br=-.5,Fr=gn(3)/2,Cy=1/gn(12),JF=(Cy/2+1)*3,ez={draw(e,t){const r=gn(t/JF),n=r/2,i=r*Cy,a=n,o=r*Cy+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Br*n-Fr*i,Fr*n+Br*i),e.lineTo(Br*a-Fr*o,Fr*a+Br*o),e.lineTo(Br*s-Fr*l,Fr*s+Br*l),e.lineTo(Br*n+Fr*i,Br*i-Fr*n),e.lineTo(Br*a+Fr*o,Br*o-Fr*a),e.lineTo(Br*s+Fr*l,Br*l-Fr*s),e.closePath()}};function tz(e,t){let r=null,n=gx(i);e=typeof e=="function"?e:rt(e||bx),t=typeof t=="function"?t:rt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:rt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:rt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ad(){}function od(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function x2(e){this._context=e}x2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:od(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:od(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rz(e){return new x2(e)}function b2(e){this._context=e}b2.prototype={areaStart:ad,areaEnd:ad,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:od(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nz(e){return new b2(e)}function w2(e){this._context=e}w2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:od(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function iz(e){return new w2(e)}function _2(e){this._context=e}_2.prototype={areaStart:ad,areaEnd:ad,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function az(e){return new _2(e)}function Lw(e){return e<0?-1:1}function Bw(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Lw(a)+Lw(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Fw(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function km(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function sd(e){this._context=e}sd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:km(this,this._t0,Fw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,km(this,Fw(this,r=Bw(this,e,t)),r);break;default:km(this,this._t0,r=Bw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function S2(e){this._context=new O2(e)}(S2.prototype=Object.create(sd.prototype)).point=function(e,t){sd.prototype.point.call(this,t,e)};function O2(e){this._context=e}O2.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function oz(e){return new sd(e)}function sz(e){return new S2(e)}function j2(e){this._context=e}j2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=zw(e),i=zw(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function uz(e){return new qp(e,.5)}function cz(e){return new qp(e,0)}function fz(e){return new qp(e,1)}function Jo(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function dz(e,t){return e[t]}function pz(e){const t=[];return t.key=e,t}function hz(){var e=rt([]),t=Ty,r=Jo,n=dz;function i(a){var o=Array.from(e.apply(this,arguments),pz),s,l=o.length,u=-1,f;for(const c of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Sz(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var A2={symbolCircle:bx,symbolCross:WF,symbolDiamond:GF,symbolSquare:KF,symbolStar:ZF,symbolTriangle:QF,symbolWye:ez},Oz=Math.PI/180,jz=function(t){var r="symbol".concat(Hp(t));return A2[r]||bx},Az=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Oz;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},kz=function(t,r){A2["symbol".concat(Hp(t))]=r},wx=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=_z(t,gz),u=Vw(Vw({},l),{},{type:n,size:a,sizeType:s}),f=function(){var y=jz(n),g=tz().type(y).size(Az(a,s,n));return g()},c=u.className,p=u.cx,h=u.cy,x=ge(u,!0);return p===+p&&h===+h&&a===+a?N.createElement("path",Ny({},x,{className:je("recharts-symbols",c),transform:"translate(".concat(p,", ").concat(h,")"),d:f()})):null};wx.registerSymbol=kz;function es(e){"@babel/helpers - typeof";return es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},es(e)}function $y(){return $y=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var m=h.inactive?u:h.color;return N.createElement("li",$y({className:y,style:c,key:"legend-item-".concat(x)},Va(n.props,h,x)),N.createElement(Oy,{width:o,height:o,viewBox:f,style:p},n.renderIcon(h)),N.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},v?v(g,h,x):g))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return N.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(j.PureComponent);vu(_x,"displayName","Legend");vu(_x,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Dz=Np;function Lz(){this.__data__=new Dz,this.size=0}var Bz=Lz;function Fz(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var zz=Fz;function Uz(e){return this.__data__.get(e)}var Vz=Uz;function Wz(e){return this.__data__.has(e)}var Hz=Wz,Gz=Np,Kz=ux,qz=cx,Xz=200;function Yz(e,t){var r=this.__data__;if(r instanceof Gz){var n=r.__data__;if(!Kz||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var c=-1,p=!0,h=r&g8?new h8:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=_U}var Ax=SU,OU=hi,jU=Ax,AU=mi,kU="[object Arguments]",EU="[object Array]",PU="[object Boolean]",CU="[object Date]",TU="[object Error]",NU="[object Function]",$U="[object Map]",RU="[object Number]",IU="[object Object]",MU="[object RegExp]",DU="[object Set]",LU="[object String]",BU="[object WeakMap]",FU="[object ArrayBuffer]",zU="[object DataView]",UU="[object Float32Array]",VU="[object Float64Array]",WU="[object Int8Array]",HU="[object Int16Array]",GU="[object Int32Array]",KU="[object Uint8Array]",qU="[object Uint8ClampedArray]",XU="[object Uint16Array]",YU="[object Uint32Array]",st={};st[UU]=st[VU]=st[WU]=st[HU]=st[GU]=st[KU]=st[qU]=st[XU]=st[YU]=!0;st[kU]=st[EU]=st[FU]=st[PU]=st[zU]=st[CU]=st[TU]=st[NU]=st[$U]=st[RU]=st[IU]=st[MU]=st[DU]=st[LU]=st[BU]=!1;function ZU(e){return AU(e)&&jU(e.length)&&!!st[OU(e)]}var QU=ZU;function JU(e){return function(t){return e(t)}}var D2=JU,fd={exports:{}};fd.exports;(function(e,t){var r=HE,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(fd,fd.exports);var eV=fd.exports,tV=QU,rV=D2,Yw=eV,Zw=Yw&&Yw.isTypedArray,nV=Zw?rV(Zw):tV,L2=nV,iV=sU,aV=Ox,oV=_r,sV=M2,lV=jx,uV=L2,cV=Object.prototype,fV=cV.hasOwnProperty;function dV(e,t){var r=oV(e),n=!r&&aV(e),i=!r&&!n&&sV(e),a=!r&&!n&&!i&&uV(e),o=r||n||i||a,s=o?iV(e.length,String):[],l=s.length;for(var u in e)(t||fV.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lV(u,l)))&&s.push(u);return s}var pV=dV,hV=Object.prototype;function mV(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||hV;return e===r}var vV=mV;function yV(e,t){return function(r){return e(t(r))}}var B2=yV,gV=B2,xV=gV(Object.keys,Object),bV=xV,wV=vV,_V=bV,SV=Object.prototype,OV=SV.hasOwnProperty;function jV(e){if(!wV(e))return _V(e);var t=[];for(var r in Object(e))OV.call(e,r)&&r!="constructor"&&t.push(r);return t}var AV=jV,kV=sx,EV=Ax;function PV(e){return e!=null&&EV(e.length)&&!kV(e)}var Xp=PV,CV=pV,TV=AV,NV=Xp;function $V(e){return NV(e)?CV(e):TV(e)}var kx=$V,RV=X8,IV=aU,MV=kx;function DV(e){return RV(e,MV,IV)}var LV=DV,Qw=LV,BV=1,FV=Object.prototype,zV=FV.hasOwnProperty;function UV(e,t,r,n,i,a){var o=r&BV,s=Qw(e),l=s.length,u=Qw(t),f=u.length;if(l!=f&&!o)return!1;for(var c=l;c--;){var p=s[c];if(!(o?p in t:zV.call(t,p)))return!1}var h=a.get(e),x=a.get(t);if(h&&x)return h==t&&x==e;var v=!0;a.set(e,t),a.set(t,e);for(var y=o;++c-1}var zW=FW;function UW(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=nH){var u=t?null:tH(e);if(u)return rH(u);o=!1,i=eH,l=new ZW}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xH(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bH(e){return e.value}function wH(e,t){if(N.isValidElement(e))return N.cloneElement(e,t);if(typeof e=="function")return N.createElement(e,t);t.ref;var r=gH(t,cH);return N.createElement(_x,r)}var h_=1,Pa=function(e){function t(){var r;fH(this,t);for(var n=arguments.length,i=new Array(n),a=0;ah_||Math.abs(i.height-this.lastBoundingBox.height)>h_)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Bn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,c,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();c={left:((u||0)-h.width)/2}}else c=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var x=this.getBBoxSnapshot();p={top:((f||0)-x.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Bn(Bn({},c),p)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,c=Bn(Bn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return N.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(h){n.wrapperNode=h}},wH(a,Bn(Bn({},this.props),{},{payload:H2(f,u,bH)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Bn(Bn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&ne(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(j.PureComponent);Yp(Pa,"displayName","Legend");Yp(Pa,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var m_=lc,_H=Ox,SH=_r,v_=m_?m_.isConcatSpreadable:void 0;function OH(e){return SH(e)||_H(e)||!!(v_&&e&&e[v_])}var jH=OH,AH=R2,kH=jH;function q2(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=kH),i||(i=[]);++a0&&r(s)?t>1?q2(s,t-1,r,n,i):AH(i,s):n||(i[i.length]=s)}return i}var X2=q2;function EH(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var PH=EH,CH=PH,TH=CH(),NH=TH,$H=NH,RH=kx;function IH(e,t){return e&&$H(e,t,RH)}var Y2=IH,MH=Xp;function DH(e,t){return function(r,n){if(r==null)return r;if(!MH(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var ZH=YH,Tm=dx,QH=px,JH=aa,e7=Z2,t7=GH,r7=D2,n7=ZH,i7=Bs,a7=_r;function o7(e,t,r){t.length?t=Tm(t,function(a){return a7(a)?function(o){return QH(o,a.length===1?a[0]:a)}:a}):t=[i7];var n=-1;t=Tm(t,r7(JH));var i=e7(e,function(a,o,s){var l=Tm(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return t7(i,function(a,o){return n7(a,o,r)})}var s7=o7;function l7(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var u7=l7,c7=u7,g_=Math.max;function f7(e,t,r){return t=g_(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=g_(n.length-t,0),o=Array(a);++i0){if(++t>=w7)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var j7=O7,A7=b7,k7=j7,E7=k7(A7),P7=E7,C7=Bs,T7=d7,N7=P7;function $7(e,t){return N7(T7(e,t,C7),e+"")}var R7=$7,I7=lx,M7=Xp,D7=jx,L7=ia;function B7(e,t,r){if(!L7(r))return!1;var n=typeof t;return(n=="number"?M7(r)&&D7(t,r.length):n=="string"&&t in r)?I7(r[t],e):!1}var Zp=B7,F7=X2,z7=s7,U7=R7,b_=Zp,V7=U7(function(e,t){if(e==null)return[];var r=t.length;return r>1&&b_(e,t[0],t[1])?t=[]:r>2&&b_(t[0],t[1],t[2])&&(t=[t[0]]),z7(e,F7(t,1),[])}),W7=V7;const Cx=qe(W7);function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(al,"-left"),ne(r)&&t&&ne(t.x)&&r=t.y),"".concat(al,"-top"),ne(n)&&t&&ne(t.y)&&nv?Math.max(f,l[n]):Math.max(c,l[n])}function aG(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function oG(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,c;return o.height>0&&o.width>0&&r?(f=S_({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),c=S_({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=aG({translateX:f,translateY:c,useTranslate3d:s})):u=nG,{cssProperties:u,cssClasses:iG({translateX:f,translateY:c,coordinate:r})}}function rs(e){"@babel/helpers - typeof";return rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(e)}function O_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function j_(e){for(var t=1;tA_||Math.abs(n.height-this.state.lastBoundingBox.height)>A_)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,f=i.coordinate,c=i.hasPayload,p=i.isAnimationActive,h=i.offset,x=i.position,v=i.reverseDirection,y=i.useTranslate3d,g=i.viewBox,m=i.wrapperStyle,w=oG({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:x,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:g}),S=w.cssClasses,b=w.cssProperties,_=j_(j_({transition:p&&a?"transform ".concat(s,"ms ").concat(l):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&c?"visible":"hidden",position:"absolute",top:0,left:0},m);return N.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(k){n.wrapperNode=k}},u)}}])}(j.PureComponent),vG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Fs={isSsr:vG()};function ns(e){"@babel/helpers - typeof";return ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(e)}function k_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function E_(e){for(var t=1;t0;return N.createElement(mG,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:a,coordinate:f,hasPayload:_,offset:h,position:y,reverseDirection:g,useTranslate3d:m,viewBox:w,wrapperStyle:S},AG(u,E_(E_({},this.props),{},{payload:b})))}}])}(j.PureComponent);Tx(Pr,"displayName","Tooltip");Tx(Pr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Fs.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var kG=Mn,EG=function(){return kG.Date.now()},PG=EG,CG=/\s/;function TG(e){for(var t=e.length;t--&&CG.test(e.charAt(t)););return t}var NG=TG,$G=NG,RG=/^\s+/;function IG(e){return e&&e.slice(0,$G(e)+1).replace(RG,"")}var MG=IG,DG=MG,P_=ia,LG=Ns,C_=NaN,BG=/^[-+]0x[0-9a-f]+$/i,FG=/^0b[01]+$/i,zG=/^0o[0-7]+$/i,UG=parseInt;function VG(e){if(typeof e=="number")return e;if(LG(e))return C_;if(P_(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=P_(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=DG(e);var r=FG.test(e);return r||zG.test(e)?UG(e.slice(2),r?2:8):BG.test(e)?C_:+e}var nP=VG,WG=ia,$m=PG,T_=nP,HG="Expected a function",GG=Math.max,KG=Math.min;function qG(e,t,r){var n,i,a,o,s,l,u=0,f=!1,c=!1,p=!0;if(typeof e!="function")throw new TypeError(HG);t=T_(t)||0,WG(r)&&(f=!!r.leading,c="maxWait"in r,a=c?GG(T_(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p);function h(_){var O=n,k=i;return n=i=void 0,u=_,o=e.apply(k,O),o}function x(_){return u=_,s=setTimeout(g,t),f?h(_):o}function v(_){var O=_-l,k=_-u,P=t-O;return c?KG(P,a-k):P}function y(_){var O=_-l,k=_-u;return l===void 0||O>=t||O<0||c&&k>=a}function g(){var _=$m();if(y(_))return m(_);s=setTimeout(g,v(_))}function m(_){return s=void 0,p&&n?h(_):(n=i=void 0,o)}function w(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:m($m())}function b(){var _=$m(),O=y(_);if(n=arguments,i=this,l=_,O){if(s===void 0)return x(l);if(c)return clearTimeout(s),s=setTimeout(g,t),h(l)}return s===void 0&&(s=setTimeout(g,t)),o}return b.cancel=w,b.flush=S,b}var XG=qG,YG=XG,ZG=ia,QG="Expected a function";function JG(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(QG);return ZG(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),YG(e,t,{leading:n,maxWait:t,trailing:i})}var eK=JG;const iP=qe(eK);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function N_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(I=iP(I,v,{trailing:!0,leading:!1}));var D=new ResizeObserver(I),L=b.current.getBoundingClientRect(),z=L.width,U=L.height;return $(z,U),D.observe(b.current),function(){D.disconnect()}},[$,v]);var C=j.useMemo(function(){var I=P.containerWidth,D=P.containerHeight;if(I<0||D<0)return null;Jn(Sa(o)||Sa(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,l),Jn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var L=Sa(o)?I:o,z=Sa(l)?D:l;r&&r>0&&(L?z=L/r:z&&(L=z*r),p&&z>p&&(z=p)),Jn(L>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,L,z,o,l,f,c,r);var U=!Array.isArray(h)&&Qn(h.type).endsWith("Chart");return N.Children.map(h,function(M){return N.isValidElement(M)?j.cloneElement(M,Wc({width:L,height:z},U?{style:Wc({height:"100%",width:"100%",maxHeight:z,maxWidth:L},M.props.style)}:{})):M})},[r,h,l,p,c,f,P,o]);return N.createElement("div",{id:y?"".concat(y):void 0,className:je("recharts-responsive-container",g),style:Wc(Wc({},S),{},{width:o,height:l,minWidth:f,minHeight:c,maxHeight:p}),ref:b},C)}),Ca=function(t){return null};Ca.displayName="Cell";function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function R_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hy(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Fs.isSsr)return{width:0,height:0};var n=hK(r),i=JSON.stringify({text:t,copyStyle:n});if(io.widthCache[i])return io.widthCache[i];try{var a=document.getElementById(I_);a||(a=document.createElement("span"),a.setAttribute("id",I_),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Hy(Hy({},pK),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return io.widthCache[i]=l,++io.cacheCount>dK&&(io.cacheCount=0,io.widthCache={}),l}catch{return{width:0,height:0}}},mK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function md(e,t){return xK(e)||gK(e,t)||yK(e,t)||vK()}function vK(){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 yK(e,t){if(e){if(typeof e=="string")return M_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return M_(e,t)}}function M_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $K(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function U_(e,t){return DK(e)||MK(e,t)||IK(e,t)||RK()}function RK(){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 IK(e,t){if(e){if(typeof e=="string")return V_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V_(e,t)}}function V_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(z,U){var M=U.word,B=U.width,W=z[z.length-1];if(W&&(i==null||a||W.width+B+nU.width?z:U})};if(!f)return h;for(var v="…",y=function(L){var z=c.slice(0,L),U=lP({breakAll:u,style:l,children:z+v}).wordsWithComputedWidth,M=p(U),B=M.length>o||x(M).width>Number(i);return[B,M]},g=0,m=c.length-1,w=0,S;g<=m&&w<=c.length-1;){var b=Math.floor((g+m)/2),_=b-1,O=y(_),k=U_(O,2),P=k[0],R=k[1],$=y(b),C=U_($,1),I=C[0];if(!P&&!I&&(g=b+1),P&&I&&(m=b-1),!P&&I){S=R;break}w++}return S||h},W_=function(t){var r=Ee(t)?[]:t.toString().split(sP);return[{words:r}]},BK=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Fs.isSsr){var l,u,f=lP({breakAll:o,children:i,style:a});if(f){var c=f.wordsWithComputedWidth,p=f.spaceWidth;l=c,u=p}else return W_(i);return LK({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return W_(i)},H_="#808080",Wa=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,c=f===void 0?!1:f,p=t.textAnchor,h=p===void 0?"start":p,x=t.verticalAnchor,v=x===void 0?"end":x,y=t.fill,g=y===void 0?H_:y,m=z_(t,TK),w=j.useMemo(function(){return BK({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:c,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,c,m.style,m.width]),S=m.dx,b=m.dy,_=m.angle,O=m.className,k=m.breakAll,P=z_(m,NK);if(!It(n)||!It(a))return null;var R=n+(ne(S)?S:0),$=a+(ne(b)?b:0),C;switch(v){case"start":C=Rm("calc(".concat(u,")"));break;case"middle":C=Rm("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:C=Rm("calc(".concat(w.length-1," * -").concat(s,")"));break}var I=[];if(c){var D=w[0].width,L=m.width;I.push("scale(".concat((ne(L)?L/D:1)/D,")"))}return _&&I.push("rotate(".concat(_,", ").concat(R,", ").concat($,")")),I.length&&(P.transform=I.join(" ")),N.createElement("text",Gy({},ge(P,!0),{x:R,y:$,className:je("recharts-text",O),textAnchor:h,fill:g.includes("url")?H_:g}),w.map(function(z,U){var M=z.words.join(k?"":" ");return N.createElement("tspan",{x:R,dy:U===0?C:s,key:"".concat(M,"-").concat(U)},M)}))};function Hi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function FK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Nx(e){let t,r,n;e.length!==2?(t=Hi,r=(s,l)=>Hi(e(s),l),n=(s,l)=>e(s)-l):(t=e===Hi||e===FK?e:zK,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[c],l)<0?u=c+1:f=c}while(u>>1;r(s[c],l)<=0?u=c+1:f=c}while(uu&&n(s[c-1],l)>-n(s[c],l)?c-1:c}return{left:i,center:o,right:a}}function zK(){return 0}function uP(e){return e===null?NaN:+e}function*UK(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const VK=Nx(Hi),fc=VK.right;Nx(uP).center;class G_ extends Map{constructor(t,r=GK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(K_(this,t))}has(t){return super.has(K_(this,t))}set(t,r){return super.set(WK(this,t),r)}delete(t){return super.delete(HK(this,t))}}function K_({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function WK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function HK({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function GK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function KK(e=Hi){if(e===Hi)return cP;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function cP(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const qK=Math.sqrt(50),XK=Math.sqrt(10),YK=Math.sqrt(2);function vd(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=qK?10:a>=XK?5:a>=YK?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function X_(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function fP(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?cP:KK(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),c=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*c*(l-c)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*c/l+p)),x=Math.min(n,Math.floor(t+(l-u)*c/l+p));fP(e,t,h,x,i)}const a=e[t];let o=r,s=n;for(ol(e,r,t),i(e[n],a)>0&&ol(e,r,n);o0;)--s}i(e[r],a)===0?ol(e,r,s):(++s,ol(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function ol(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function ZK(e,t,r){if(e=Float64Array.from(UK(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return X_(e);if(t>=1)return q_(e);var n,i=(n-1)*t,a=Math.floor(i),o=q_(fP(e,a).subarray(0,a+1)),s=X_(e.subarray(a+1));return o+(s-o)*(i-a)}}function QK(e,t,r=uP){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function JK(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Gc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Gc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=tq.exec(e))?new yr(t[1],t[2],t[3],1):(t=rq.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nq.exec(e))?Gc(t[1],t[2],t[3],t[4]):(t=iq.exec(e))?Gc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=aq.exec(e))?rS(t[1],t[2]/100,t[3]/100,1):(t=oq.exec(e))?rS(t[1],t[2]/100,t[3]/100,t[4]):Y_.hasOwnProperty(e)?J_(Y_[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function J_(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function Gc(e,t,r,n){return n<=0&&(e=t=r=NaN),new yr(e,t,r,n)}function uq(e){return e instanceof dc||(e=ju(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function Zy(e,t,r,n){return arguments.length===1?uq(e):new yr(e,t,r,n??1)}function yr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Rx(yr,Zy,pP(dc,{brighter(e){return e=e==null?yd:Math.pow(yd,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Su:Math.pow(Su,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Ta(this.r),Ta(this.g),Ta(this.b),gd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:eS,formatHex:eS,formatHex8:cq,formatRgb:tS,toString:tS}));function eS(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}`}function cq(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}${Oa((isNaN(this.opacity)?1:this.opacity)*255)}`}function tS(){const e=gd(this.opacity);return`${e===1?"rgb(":"rgba("}${Ta(this.r)}, ${Ta(this.g)}, ${Ta(this.b)}${e===1?")":`, ${e})`}`}function gd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ta(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oa(e){return e=Ta(e),(e<16?"0":"")+e.toString(16)}function rS(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new dn(e,t,r,n)}function hP(e){if(e instanceof dn)return new dn(e.h,e.s,e.l,e.opacity);if(e instanceof dc||(e=ju(e)),!e)return new dn;if(e instanceof dn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new dn(o,s,l,e.opacity)}function fq(e,t,r,n){return arguments.length===1?hP(e):new dn(e,t,r,n??1)}function dn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Rx(dn,fq,pP(dc,{brighter(e){return e=e==null?yd:Math.pow(yd,e),new dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Su:Math.pow(Su,e),new dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new yr(Im(e>=240?e-240:e+120,i,n),Im(e,i,n),Im(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new dn(nS(this.h),Kc(this.s),Kc(this.l),gd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=gd(this.opacity);return`${e===1?"hsl(":"hsla("}${nS(this.h)}, ${Kc(this.s)*100}%, ${Kc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nS(e){return e=(e||0)%360,e<0?e+360:e}function Kc(e){return Math.max(0,Math.min(1,e||0))}function Im(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Ix=e=>()=>e;function dq(e,t){return function(r){return e+r*t}}function pq(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function hq(e){return(e=+e)==1?mP:function(t,r){return r-t?pq(t,r,e):Ix(isNaN(t)?r:t)}}function mP(e,t){var r=t-e;return r?dq(e,r):Ix(isNaN(e)?t:e)}const iS=function e(t){var r=hq(t);function n(i,a){var o=r((i=Zy(i)).r,(a=Zy(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=mP(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function mq(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:xd(n,i)})),r=Mm.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Aq(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?kq:Aq,l=u=null,c}function c(p){return p==null||isNaN(p=+p)?a:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return c.invert=function(p){return o(i((u||(u=s(t,e.map(n),xd)))(p)))},c.domain=function(p){return arguments.length?(e=Array.from(p,bd),f()):e.slice()},c.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},c.rangeRound=function(p){return t=Array.from(p),r=Mx,f()},c.clamp=function(p){return arguments.length?(o=p?!0:lr,f()):o!==lr},c.interpolate=function(p){return arguments.length?(r=p,f()):r},c.unknown=function(p){return arguments.length?(a=p,c):a},function(p,h){return n=p,i=h,f()}}function Dx(){return Qp()(lr,lr)}function Eq(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function is(e){return e=wd(Math.abs(e)),e?e[1]:NaN}function Pq(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Cq(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Tq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=Tq.exec(e)))throw new Error("invalid format: "+e);var t;return new Lx({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Au.prototype=Lx.prototype;function Lx(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Lx.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Nq(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var _d;function $q(e,t){var r=wd(e,t);if(!r)return _d=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(_d=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+wd(e,Math.max(0,t+a-1))[0]}function oS(e,t){var r=wd(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const sS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Eq,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>oS(e*100,t),r:oS,s:$q,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lS(e){return e}var uS=Array.prototype.map,cS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rq(e){var t=e.grouping===void 0||e.thousands===void 0?lS:Pq(uS.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?lS:Cq(uS.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(c,p){c=Au(c);var h=c.fill,x=c.align,v=c.sign,y=c.symbol,g=c.zero,m=c.width,w=c.comma,S=c.precision,b=c.trim,_=c.type;_==="n"?(w=!0,_="g"):sS[_]||(S===void 0&&(S=12),b=!0,_="g"),(g||h==="0"&&x==="=")&&(g=!0,h="0",x="=");var O=(p&&p.prefix!==void 0?p.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),k=(y==="$"?n:/[%p]/.test(_)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),P=sS[_],R=/[defgprs%]/.test(_);S=S===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function $(C){var I=O,D=k,L,z,U;if(_==="c")D=P(C)+D,C="";else{C=+C;var M=C<0||1/C<0;if(C=isNaN(C)?l:P(Math.abs(C),S),b&&(C=Nq(C)),M&&+C==0&&v!=="+"&&(M=!1),I=(M?v==="("?v:s:v==="-"||v==="("?"":v)+I,D=(_==="s"&&!isNaN(C)&&_d!==void 0?cS[8+_d/3]:"")+D+(M&&v==="("?")":""),R){for(L=-1,z=C.length;++LU||U>57){D=(U===46?i+C.slice(L+1):C.slice(L))+D,C=C.slice(0,L);break}}}w&&!g&&(C=t(C,1/0));var B=I.length+C.length+D.length,W=B>1)+I+C+D+W.slice(B);break;default:C=W+I+C+D;break}return a(C)}return $.toString=function(){return c+""},$}function f(c,p){var h=Math.max(-8,Math.min(8,Math.floor(is(p)/3)))*3,x=Math.pow(10,-h),v=u((c=Au(c),c.type="f",c),{suffix:cS[8+h/3]});return function(y){return v(x*y)}}return{format:u,formatPrefix:f}}var qc,Bx,vP;Iq({thousands:",",grouping:[3],currency:["$",""]});function Iq(e){return qc=Rq(e),Bx=qc.format,vP=qc.formatPrefix,qc}function Mq(e){return Math.max(0,-is(Math.abs(e)))}function Dq(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(is(t)/3)))*3-is(Math.abs(e)))}function Lq(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,is(t)-is(e))+1}function yP(e,t,r,n){var i=Xy(e,t,r),a;switch(n=Au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Dq(i,o))&&(n.precision=a),vP(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Lq(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Mq(i))&&(n.precision=a-(n.type==="%")*2);break}}return Bx(n)}function oa(e){var t=e.domain;return e.ticks=function(r){var n=t();return Ky(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return yP(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,f=10;for(s0;){if(u=qy(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Sd(){var e=Dx();return e.copy=function(){return pc(e,Sd())},rn.apply(e,arguments),oa(e)}function gP(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,bd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return gP(e).unknown(t)},e=arguments.length?Array.from(e,bd):[0,1],oa(r)}function xP(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function Vq(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function pS(e){return(t,r)=>-e(-t,r)}function Fx(e){const t=e(fS,dS),r=t.domain;let n=10,i,a;function o(){return i=Vq(n),a=Uq(n),r()[0]<0?(i=pS(i),a=pS(a),e(Bq,Fq)):e(fS,dS),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const c=f0){for(;p<=h;++p)for(x=1;xf)break;g.push(v)}}else for(;p<=h;++p)for(x=n-1;x>=1;--x)if(v=p>0?x/a(-p):x*a(p),!(vf)break;g.push(v)}g.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Au(l)).precision==null&&(l.trim=!0),l=Bx(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let c=f/a(Math.round(i(f)));return c*nr(xP(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function bP(){const e=Fx(Qp()).domain([1,10]);return e.copy=()=>pc(e,bP()).base(e.base()),rn.apply(e,arguments),e}function hS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function mS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function zx(e){var t=1,r=e(hS(t),mS(t));return r.constant=function(n){return arguments.length?e(hS(t=+n),mS(t)):t},oa(r)}function wP(){var e=zx(Qp());return e.copy=function(){return pc(e,wP()).constant(e.constant())},rn.apply(e,arguments)}function vS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Wq(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Hq(e){return e<0?-e*e:e*e}function Ux(e){var t=e(lr,lr),r=1;function n(){return r===1?e(lr,lr):r===.5?e(Wq,Hq):e(vS(r),vS(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},oa(t)}function Vx(){var e=Ux(Qp());return e.copy=function(){return pc(e,Vx()).exponent(e.exponent())},rn.apply(e,arguments),e}function Gq(){return Vx.apply(null,arguments).exponent(.5)}function yS(e){return Math.sign(e)*e*e}function Kq(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function _P(){var e=Dx(),t=[0,1],r=!1,n;function i(a){var o=Kq(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(yS(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,bd)).map(yS)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return _P(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},rn.apply(i,arguments),oa(i)}function SP(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return OP().domain([e,t]).range(i).unknown(a)},rn.apply(oa(o),arguments)}function jP(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[fc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return jP().domain(e).range(t).unknown(r)},rn.apply(i,arguments)}const Dm=new Date,Lm=new Date;function Mt(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uMt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Dm.setTime(+a),Lm.setTime(+o),e(Dm),e(Lm),Math.floor(r(Dm,Lm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Od=Mt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Od.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Mt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Od);Od.range;const qn=1e3,qr=qn*60,Xn=qr*60,si=Xn*24,Wx=si*7,gS=si*30,Bm=si*365,ja=Mt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*qn)},(e,t)=>(t-e)/qn,e=>e.getUTCSeconds());ja.range;const Hx=Mt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qn)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getMinutes());Hx.range;const Gx=Mt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getUTCMinutes());Gx.range;const Kx=Mt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qn-e.getMinutes()*qr)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getHours());Kx.range;const qx=Mt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getUTCHours());qx.range;const hc=Mt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qr)/si,e=>e.getDate()-1);hc.range;const Jp=Mt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/si,e=>e.getUTCDate()-1);Jp.range;const AP=Mt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/si,e=>Math.floor(e/si));AP.range;function Ya(e){return Mt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*qr)/Wx)}const eh=Ya(0),jd=Ya(1),qq=Ya(2),Xq=Ya(3),as=Ya(4),Yq=Ya(5),Zq=Ya(6);eh.range;jd.range;qq.range;Xq.range;as.range;Yq.range;Zq.range;function Za(e){return Mt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Wx)}const th=Za(0),Ad=Za(1),Qq=Za(2),Jq=Za(3),os=Za(4),eX=Za(5),tX=Za(6);th.range;Ad.range;Qq.range;Jq.range;os.range;eX.range;tX.range;const Xx=Mt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Xx.range;const Yx=Mt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Yx.range;const li=Mt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());li.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});li.range;const ui=Mt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ui.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ui.range;function kP(e,t,r,n,i,a){const o=[[ja,1,qn],[ja,5,5*qn],[ja,15,15*qn],[ja,30,30*qn],[a,1,qr],[a,5,5*qr],[a,15,15*qr],[a,30,30*qr],[i,1,Xn],[i,3,3*Xn],[i,6,6*Xn],[i,12,12*Xn],[n,1,si],[n,2,2*si],[r,1,Wx],[t,1,gS],[t,3,3*gS],[e,1,Bm]];function s(u,f,c){const p=fy).right(o,p);if(h===o.length)return e.every(Xy(u/Bm,f/Bm,c));if(h===0)return Od.every(Math.max(Xy(u,f,c),1));const[x,v]=o[p/o[h-1][2]53)return null;"w"in K||(K.w=1),"Z"in K?(he=zm(sl(K.y,0,1)),Me=he.getUTCDay(),he=Me>4||Me===0?Ad.ceil(he):Ad(he),he=Jp.offset(he,(K.V-1)*7),K.y=he.getUTCFullYear(),K.m=he.getUTCMonth(),K.d=he.getUTCDate()+(K.w+6)%7):(he=Fm(sl(K.y,0,1)),Me=he.getDay(),he=Me>4||Me===0?jd.ceil(he):jd(he),he=hc.offset(he,(K.V-1)*7),K.y=he.getFullYear(),K.m=he.getMonth(),K.d=he.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),Me="Z"in K?zm(sl(K.y,0,1)).getUTCDay():Fm(sl(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(Me+5)%7:K.w+K.U*7-(Me+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,zm(K)):Fm(K)}}function k(te,re,pe,K){for(var Pe=0,he=re.length,Me=pe.length,Be,ve;Pe=Me)return-1;if(Be=re.charCodeAt(Pe++),Be===37){if(Be=re.charAt(Pe++),ve=b[Be in xS?re.charAt(Pe++):Be],!ve||(K=ve(te,pe,K))<0)return-1}else if(Be!=pe.charCodeAt(K++))return-1}return K}function P(te,re,pe){var K=u.exec(re.slice(pe));return K?(te.p=f.get(K[0].toLowerCase()),pe+K[0].length):-1}function R(te,re,pe){var K=h.exec(re.slice(pe));return K?(te.w=x.get(K[0].toLowerCase()),pe+K[0].length):-1}function $(te,re,pe){var K=c.exec(re.slice(pe));return K?(te.w=p.get(K[0].toLowerCase()),pe+K[0].length):-1}function C(te,re,pe){var K=g.exec(re.slice(pe));return K?(te.m=m.get(K[0].toLowerCase()),pe+K[0].length):-1}function I(te,re,pe){var K=v.exec(re.slice(pe));return K?(te.m=y.get(K[0].toLowerCase()),pe+K[0].length):-1}function D(te,re,pe){return k(te,t,re,pe)}function L(te,re,pe){return k(te,r,re,pe)}function z(te,re,pe){return k(te,n,re,pe)}function U(te){return o[te.getDay()]}function M(te){return a[te.getDay()]}function B(te){return l[te.getMonth()]}function W(te){return s[te.getMonth()]}function J(te){return i[+(te.getHours()>=12)]}function G(te){return 1+~~(te.getMonth()/3)}function Q(te){return o[te.getUTCDay()]}function X(te){return a[te.getUTCDay()]}function de(te){return l[te.getUTCMonth()]}function ue(te){return s[te.getUTCMonth()]}function Se(te){return i[+(te.getUTCHours()>=12)]}function _e(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var re=_(te+="",w);return re.toString=function(){return te},re},parse:function(te){var re=O(te+="",!1);return re.toString=function(){return te},re},utcFormat:function(te){var re=_(te+="",S);return re.toString=function(){return te},re},utcParse:function(te){var re=O(te+="",!0);return re.toString=function(){return te},re}}}var xS={"-":"",_:" ",0:"0"},Ut=/^\s*\d+/,sX=/^%/,lX=/[\\^$*+?|[\]().{}]/g;function ze(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function cX(e,t,r){var n=Ut.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function fX(e,t,r){var n=Ut.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function dX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function pX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function hX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function bS(e,t,r){var n=Ut.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function wS(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function mX(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function vX(e,t,r){var n=Ut.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function yX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function _S(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function gX(e,t,r){var n=Ut.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function SS(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function xX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function bX(e,t,r){var n=Ut.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function wX(e,t,r){var n=Ut.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function _X(e,t,r){var n=Ut.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function SX(e,t,r){var n=sX.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function OX(e,t,r){var n=Ut.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function jX(e,t,r){var n=Ut.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function OS(e,t){return ze(e.getDate(),t,2)}function AX(e,t){return ze(e.getHours(),t,2)}function kX(e,t){return ze(e.getHours()%12||12,t,2)}function EX(e,t){return ze(1+hc.count(li(e),e),t,3)}function EP(e,t){return ze(e.getMilliseconds(),t,3)}function PX(e,t){return EP(e,t)+"000"}function CX(e,t){return ze(e.getMonth()+1,t,2)}function TX(e,t){return ze(e.getMinutes(),t,2)}function NX(e,t){return ze(e.getSeconds(),t,2)}function $X(e){var t=e.getDay();return t===0?7:t}function RX(e,t){return ze(eh.count(li(e)-1,e),t,2)}function PP(e){var t=e.getDay();return t>=4||t===0?as(e):as.ceil(e)}function IX(e,t){return e=PP(e),ze(as.count(li(e),e)+(li(e).getDay()===4),t,2)}function MX(e){return e.getDay()}function DX(e,t){return ze(jd.count(li(e)-1,e),t,2)}function LX(e,t){return ze(e.getFullYear()%100,t,2)}function BX(e,t){return e=PP(e),ze(e.getFullYear()%100,t,2)}function FX(e,t){return ze(e.getFullYear()%1e4,t,4)}function zX(e,t){var r=e.getDay();return e=r>=4||r===0?as(e):as.ceil(e),ze(e.getFullYear()%1e4,t,4)}function UX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ze(t/60|0,"0",2)+ze(t%60,"0",2)}function jS(e,t){return ze(e.getUTCDate(),t,2)}function VX(e,t){return ze(e.getUTCHours(),t,2)}function WX(e,t){return ze(e.getUTCHours()%12||12,t,2)}function HX(e,t){return ze(1+Jp.count(ui(e),e),t,3)}function CP(e,t){return ze(e.getUTCMilliseconds(),t,3)}function GX(e,t){return CP(e,t)+"000"}function KX(e,t){return ze(e.getUTCMonth()+1,t,2)}function qX(e,t){return ze(e.getUTCMinutes(),t,2)}function XX(e,t){return ze(e.getUTCSeconds(),t,2)}function YX(e){var t=e.getUTCDay();return t===0?7:t}function ZX(e,t){return ze(th.count(ui(e)-1,e),t,2)}function TP(e){var t=e.getUTCDay();return t>=4||t===0?os(e):os.ceil(e)}function QX(e,t){return e=TP(e),ze(os.count(ui(e),e)+(ui(e).getUTCDay()===4),t,2)}function JX(e){return e.getUTCDay()}function eY(e,t){return ze(Ad.count(ui(e)-1,e),t,2)}function tY(e,t){return ze(e.getUTCFullYear()%100,t,2)}function rY(e,t){return e=TP(e),ze(e.getUTCFullYear()%100,t,2)}function nY(e,t){return ze(e.getUTCFullYear()%1e4,t,4)}function iY(e,t){var r=e.getUTCDay();return e=r>=4||r===0?os(e):os.ceil(e),ze(e.getUTCFullYear()%1e4,t,4)}function aY(){return"+0000"}function AS(){return"%"}function kS(e){return+e}function ES(e){return Math.floor(+e/1e3)}var ao,NP,$P;oY({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function oY(e){return ao=oX(e),NP=ao.format,ao.parse,$P=ao.utcFormat,ao.utcParse,ao}function sY(e){return new Date(e)}function lY(e){return e instanceof Date?+e:+new Date(+e)}function Zx(e,t,r,n,i,a,o,s,l,u){var f=Dx(),c=f.invert,p=f.domain,h=u(".%L"),x=u(":%S"),v=u("%I:%M"),y=u("%I %p"),g=u("%a %d"),m=u("%b %d"),w=u("%B"),S=u("%Y");function b(_){return(l(_)<_?h:s(_)<_?x:o(_)<_?v:a(_)<_?y:n(_)<_?i(_)<_?g:m:r(_)<_?w:S)(_)}return f.invert=function(_){return new Date(c(_))},f.domain=function(_){return arguments.length?p(Array.from(_,lY)):p().map(sY)},f.ticks=function(_){var O=p();return e(O[0],O[O.length-1],_??10)},f.tickFormat=function(_,O){return O==null?b:u(O)},f.nice=function(_){var O=p();return(!_||typeof _.range!="function")&&(_=t(O[0],O[O.length-1],_??10)),_?p(xP(O,_)):f},f.copy=function(){return pc(f,Zx(e,t,r,n,i,a,o,s,l,u))},f}function uY(){return rn.apply(Zx(iX,aX,li,Xx,eh,hc,Kx,Hx,ja,NP).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function cY(){return rn.apply(Zx(rX,nX,ui,Yx,th,Jp,qx,Gx,ja,$P).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function rh(){var e=0,t=1,r,n,i,a,o=lr,s=!1,l;function u(c){return c==null||isNaN(c=+c)?l:o(i===0?.5:(c=(a(c)-r)*i,s?Math.max(0,Math.min(1,c)):c))}u.domain=function(c){return arguments.length?([e,t]=c,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(c){return arguments.length?(s=!!c,u):s},u.interpolator=function(c){return arguments.length?(o=c,u):o};function f(c){return function(p){var h,x;return arguments.length?([h,x]=p,o=c(h,x),u):[o(0),o(1)]}}return u.range=f(zs),u.rangeRound=f(Mx),u.unknown=function(c){return arguments.length?(l=c,u):l},function(c){return a=c,r=c(e),n=c(t),i=r===n?0:1/(n-r),u}}function sa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function RP(){var e=oa(rh()(lr));return e.copy=function(){return sa(e,RP())},vi.apply(e,arguments)}function IP(){var e=Fx(rh()).domain([1,10]);return e.copy=function(){return sa(e,IP()).base(e.base())},vi.apply(e,arguments)}function MP(){var e=zx(rh());return e.copy=function(){return sa(e,MP()).constant(e.constant())},vi.apply(e,arguments)}function Qx(){var e=Ux(rh());return e.copy=function(){return sa(e,Qx()).exponent(e.exponent())},vi.apply(e,arguments)}function fY(){return Qx.apply(null,arguments).exponent(.5)}function DP(){var e=[],t=lr;function r(n){if(n!=null&&!isNaN(n=+n))return t((fc(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Hi),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>ZK(e,a/n))},r.copy=function(){return DP(t).domain(e)},vi.apply(r,arguments)}function nh(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=lr,f,c=!1,p;function h(v){return isNaN(v=+v)?p:(v=.5+((v=+f(v))-a)*(n*vt}var zP=mY,vY=ih,yY=zP,gY=Bs;function xY(e){return e&&e.length?vY(e,gY,yY):void 0}var bY=xY;const ah=qe(bY);function wY(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};le.decimalPlaces=le.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*lt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};le.dividedBy=le.div=function(e){return ei(this,new this.constructor(e))};le.dividedToIntegerBy=le.idiv=function(e){var t=this,r=t.constructor;return Je(ei(t,new r(e),0,1),r.precision)};le.equals=le.eq=function(e){return!this.cmp(e)};le.exponent=function(){return kt(this)};le.greaterThan=le.gt=function(e){return this.cmp(e)>0};le.greaterThanOrEqualTo=le.gte=function(e){return this.cmp(e)>=0};le.isInteger=le.isint=function(){return this.e>this.d.length-2};le.isNegative=le.isneg=function(){return this.s<0};le.isPositive=le.ispos=function(){return this.s>0};le.isZero=function(){return this.s===0};le.lessThan=le.lt=function(e){return this.cmp(e)<0};le.lessThanOrEqualTo=le.lte=function(e){return this.cmp(e)<1};le.logarithm=le.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Cr))throw Error(Jr+"NaN");if(r.s<1)throw Error(Jr+(r.s?"NaN":"-Infinity"));return r.eq(Cr)?new n(0):(dt=!1,t=ei(ku(r,a),ku(e,a),a),dt=!0,Je(t,i))};le.minus=le.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GP(t,e):WP(t,(e.s=-e.s,e))};le.modulo=le.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Jr+"NaN");return r.s?(dt=!1,t=ei(r,e,0,1).times(e),dt=!0,r.minus(t)):Je(new n(r),i)};le.naturalExponential=le.exp=function(){return HP(this)};le.naturalLogarithm=le.ln=function(){return ku(this)};le.negated=le.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};le.plus=le.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?WP(t,e):GP(t,(e.s=-e.s,e))};le.precision=le.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Na+e);if(t=kt(i)+1,n=i.d.length-1,r=n*lt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};le.squareRoot=le.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Jr+"NaN")}for(e=kt(s),dt=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=En(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Vs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(ei(s,a,o+2)).times(.5),En(a.d).slice(0,o)===(t=En(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Je(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return dt=!0,Je(n,r)};le.times=le.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,c=f.constructor,p=f.d,h=(e=new c(e)).d;if(!f.s||!e.s)return new c(0);for(e.s*=f.s,r=f.e+e.e,l=p.length,u=h.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+h[n]*p[i-n-1]+t,a[i--]=s%Dt|0,t=s/Dt|0;a[i]=(a[i]+t)%Dt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,dt?Je(e,c.precision):e};le.toDecimalPlaces=le.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(In(e,0,Us),t===void 0?t=n.rounding:In(t,0,8),Je(r,e+kt(r)+1,t))};le.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ha(n,!0):(In(e,0,Us),t===void 0?t=i.rounding:In(t,0,8),n=Je(new i(n),e+1,t),r=Ha(n,!0,e+1)),r};le.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Ha(i):(In(e,0,Us),t===void 0?t=a.rounding:In(t,0,8),n=Je(new a(i),e+kt(i)+1,t),r=Ha(n.abs(),!1,e+kt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};le.toInteger=le.toint=function(){var e=this,t=e.constructor;return Je(new t(e),kt(e)+1,t.rounding)};le.toNumber=function(){return+this};le.toPower=le.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(Cr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Jr+"Infinity");return s}if(s.eq(Cr))return s;if(n=l.precision,e.eq(Cr))return Je(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=VP){for(i=new l(Cr),t=Math.ceil(n/lt+4),dt=!1;r%2&&(i=i.times(s),TS(i.d,t)),r=Vs(r/2),r!==0;)s=s.times(s),TS(s.d,t);return dt=!0,e.s<0?new l(Cr).div(i):Je(i,n)}}else if(a<0)throw Error(Jr+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,dt=!1,i=e.times(ku(s,n+u)),dt=!0,i=HP(i),i.s=a,i};le.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=kt(i),n=Ha(i,r<=a.toExpNeg||r>=a.toExpPos)):(In(e,1,Us),t===void 0?t=a.rounding:In(t,0,8),i=Je(new a(i),e,t),r=kt(i),n=Ha(i,e<=r||r<=a.toExpNeg,e)),n};le.toSignificantDigits=le.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(In(e,1,Us),t===void 0?t=n.rounding:In(t,0,8)),Je(new n(r),e,t)};le.toString=le.valueOf=le.val=le.toJSON=le[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kt(e),r=e.constructor;return Ha(e,t<=r.toExpNeg||t>=r.toExpPos)};function WP(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,c=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),dt?Je(t,c):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(c/lt),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/Dt|0,l[a]%=Dt;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,dt?Je(t,c):t}function In(e,t,r){if(e!==~~e||er)throw Error(Na+e)}function En(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,f,c,p,h,x,v,y,g,m,w,S,b,_,O,k,P=n.constructor,R=n.s==i.s?1:-1,$=n.d,C=i.d;if(!n.s)return new P(n);if(!i.s)throw Error(Jr+"Division by zero");for(l=n.e-i.e,O=C.length,b=$.length,h=new P(R),x=h.d=[],u=0;C[u]==($[u]||0);)++u;if(C[u]>($[u]||0)&&--l,a==null?m=a=P.precision:o?m=a+(kt(n)-kt(i))+1:m=a,m<0)return new P(0);if(m=m/lt+2|0,u=0,O==1)for(f=0,C=C[0],m++;(u1&&(C=e(C,f),$=e($,f),O=C.length,b=$.length),S=O,v=$.slice(0,O),y=v.length;y=Dt/2&&++_;do f=0,s=t(C,v,O,y),s<0?(g=v[0],O!=y&&(g=g*Dt+(v[1]||0)),f=g/_|0,f>1?(f>=Dt&&(f=Dt-1),c=e(C,f),p=c.length,y=v.length,s=t(c,v,p,y),s==1&&(f--,r(c,O16)throw Error(eb+kt(e));if(!e.s)return new f(Cr);for(dt=!1,s=c,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(ya(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(Cr),f.precision=s;;){if(i=Je(i.times(e),s),r=r.times(++l),o=a.plus(ei(i,r,s)),En(o.d).slice(0,s)===En(a.d).slice(0,s)){for(;u--;)a=Je(a.times(a),s);return f.precision=c,t==null?(dt=!0,Je(a,c)):a}a=o}}function kt(e){for(var t=e.e*lt,r=e.d[0];r>=10;r/=10)t++;return t}function Um(e,t,r){if(t>e.LN10.sd())throw dt=!0,r&&(e.precision=r),Error(Jr+"LN10 precision limit exceeded");return Je(new e(e.LN10),t)}function ki(e){for(var t="";e--;)t+="0";return t}function ku(e,t){var r,n,i,a,o,s,l,u,f,c=1,p=10,h=e,x=h.d,v=h.constructor,y=v.precision;if(h.s<1)throw Error(Jr+(h.s?"NaN":"-Infinity"));if(h.eq(Cr))return new v(0);if(t==null?(dt=!1,u=y):u=t,h.eq(10))return t==null&&(dt=!0),Um(v,u);if(u+=p,v.precision=u,r=En(x),n=r.charAt(0),a=kt(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=En(h.d),n=r.charAt(0),c++;a=kt(h),n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=Um(v,u+2,y).times(a+""),h=ku(new v(n+"."+r.slice(1)),u-p).plus(l),v.precision=y,t==null?(dt=!0,Je(h,y)):h;for(s=o=h=ei(h.minus(Cr),h.plus(Cr),u),f=Je(h.times(h),u),i=3;;){if(o=Je(o.times(f),u),l=s.plus(ei(o,new v(i),u)),En(l.d).slice(0,u)===En(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(Um(v,u+2,y).times(a+""))),s=ei(s,new v(c),u),v.precision=y,t==null?(dt=!0,Je(s,y)):s;s=l,i+=2}}function CS(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Vs(r/lt),e.d=[],n=(r+1)%lt,r<0&&(n+=lt),nkd||e.e<-kd))throw Error(eb+r)}else e.s=0,e.e=0,e.d=[0];return e}function Je(e,t,r){var n,i,a,o,s,l,u,f,c=e.d;for(o=1,a=c[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=lt,i=t,u=c[f=0];else{if(f=Math.ceil((n+1)/lt),a=c.length,f>=a)return e;for(u=a=c[f],o=1;a>=10;a/=10)o++;n%=lt,i=n-lt+o}if(r!==void 0&&(a=ya(10,o-i-1),s=u/a%10|0,l=t<0||c[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/ya(10,o-i):0:c[f-1])%10&1||r==(e.s<0?8:7))),t<1||!c[0])return l?(a=kt(e),c.length=1,t=t-a-1,c[0]=ya(10,(lt-t%lt)%lt),e.e=Vs(-t/lt)||0):(c.length=1,c[0]=e.e=e.s=0),e;if(n==0?(c.length=f,a=1,f--):(c.length=f+1,a=ya(10,lt-n),c[f]=i>0?(u/ya(10,o-i)%ya(10,i)|0)*a:0),l)for(;;)if(f==0){(c[0]+=a)==Dt&&(c[0]=1,++e.e);break}else{if(c[f]+=a,c[f]!=Dt)break;c[f--]=0,a=1}for(n=c.length;c[--n]===0;)c.pop();if(dt&&(e.e>kd||e.e<-kd))throw Error(eb+kt(e));return e}function GP(e,t){var r,n,i,a,o,s,l,u,f,c,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),dt?Je(t,h):t;if(l=e.d,c=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=c.length):(r=c,n=u,s=l.length),i=Math.max(Math.ceil(h/lt),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=c.length,f=i0;--i)l[s++]=0;for(i=c.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+ki(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ki(-i-1)+a,r&&(n=r-o)>0&&(a+=ki(n))):i>=o?(a+=ki(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+ki(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=ki(n))),e.s<0?"-"+a:a}function TS(e,t){if(e.length>t)return e.length=t,!0}function KP(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Na+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return CS(o,a.toString())}else if(typeof a!="string")throw Error(Na+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,UY.test(a))CS(o,a);else throw Error(Na+a)}if(i.prototype=le,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=KP,i.config=i.set=VY,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Na+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Na+r+": "+n);return this}var tb=KP(zY);Cr=new tb(1);const Ye=tb;function WY(e){return qY(e)||KY(e)||GY(e)||HY()}function HY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GY(e,t){if(e){if(typeof e=="string")return eg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eg(e,t)}}function KY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function qY(e){if(Array.isArray(e))return eg(e)}function eg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,NS(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function uZ(e){if(Array.isArray(e))return e}function QP(e){var t=Eu(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function JP(e,t,r){if(e.lte(0))return new Ye(0);var n=uh.getDigitCount(e.toNumber()),i=new Ye(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Ye(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Ye(Math.ceil(l))}function cZ(e,t,r){var n=1,i=new Ye(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Ye(10).pow(uh.getDigitCount(e)-1),i=new Ye(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Ye(Math.floor(e)))}else e===0?i=new Ye(Math.floor((t-1)/2)):r||(i=new Ye(Math.floor(e)));var o=Math.floor((t-1)/2),s=QY(ZY(function(l){return i.add(new Ye(l-o).mul(n)).toNumber()}),tg);return s(0,t)}function eC(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Ye(0),tickMin:new Ye(0),tickMax:new Ye(0)};var a=JP(new Ye(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Ye(0):(o=new Ye(e).add(t).div(2),o=o.sub(new Ye(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Ye(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?eC(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Ye(s).mul(a)),tickMax:o.add(new Ye(l).mul(a))})}function fZ(e){var t=Eu(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=QP([r,n]),l=Eu(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var c=f===1/0?[u].concat(ng(tg(0,i-1).map(function(){return 1/0}))):[].concat(ng(tg(0,i-1).map(function(){return-1/0})),[f]);return r>n?rg(c):c}if(u===f)return cZ(u,i,a);var p=eC(u,f,o,a),h=p.step,x=p.tickMin,v=p.tickMax,y=uh.rangeStep(x,v.add(new Ye(.1).mul(h)),h);return r>n?rg(y):y}function dZ(e,t){var r=Eu(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=QP([n,i]),s=Eu(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),c=JP(new Ye(u).sub(l).div(f-1),a,0),p=[].concat(ng(uh.rangeStep(new Ye(l),new Ye(u).sub(new Ye(.99).mul(c)),c)),[u]);return n>i?rg(p):p}var pZ=YP(fZ),hZ=YP(dZ),mZ="Invariant failed";function Ga(e,t){throw new Error(mZ)}var vZ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ss(e){"@babel/helpers - typeof";return ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ss(e)}function Ed(){return Ed=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function OZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jZ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,c=i[u].coordinate,p=u>=s-1?i[0].coordinate:i[u+1].coordinate,h=void 0;if(or(c-f)!==or(p-c)){var x=[];if(or(p-c)===or(l[1]-l[0])){h=p;var v=c+l[1]-l[0];x[0]=Math.min(v,(v+f)/2),x[1]=Math.max(v,(v+f)/2)}else{h=f;var y=p+l[1]-l[0];x[0]=Math.min(c,(y+c)/2),x[1]=Math.max(c,(y+c)/2)}var g=[Math.min(c,(h+c)/2),Math.max(c,(h+c)/2)];if(t>g[0]&&t<=g[1]||t>=x[0]&&t<=x[1]){o=i[u].index;break}}else{var m=Math.min(f,p),w=Math.max(f,p);if(t>(m+c)/2&&t<=(w+c)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},rb=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?xt(xt({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},UZ=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(g&&g.length){var m=g[0].type.defaultProps,w=m!==void 0?xt(xt({},m),g[0].props):g[0].props,S=w.barSize,b=w[y];o[b]||(o[b]=[]);var _=Ee(S)?r:S;o[b].push({item:g[0],stackList:g.slice(1),barSize:Ee(_)?void 0:sr(_,n,0)})}}return o},VZ=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=sr(r,i,0,!0),f,c=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=i/l,x=o.reduce(function(S,b){return S+b.barSize||0},0);x+=(l-1)*u,x>=i&&(x-=(l-1)*u,u=0),x>=i&&h>0&&(p=!0,h*=.9,x=l*h);var v=(i-x)/2>>0,y={offset:v-u,size:0};f=o.reduce(function(S,b){var _={item:b.item,position:{offset:y.offset+y.size+u,size:p?h:b.barSize}},O=[].concat(IS(S),[_]);return y=O[O.length-1].position,b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:y})}),O},c)}else{var g=sr(n,i,0,!0);i-2*g-(l-1)*u<=0&&(u=0);var m=(i-2*g-(l-1)*u)/l;m>1&&(m>>=0);var w=s===+s?Math.min(m,s):m;f=o.reduce(function(S,b,_){var O=[].concat(IS(S),[{item:b.item,position:{offset:g+(m+u)*_+(m-w)/2,size:w}}]);return b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:O[O.length-1].position})}),O},c)}return f},WZ=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=iC({children:a,legendWidth:l});if(u){var f=i||{},c=f.width,p=f.height,h=u.align,x=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&x==="middle")&&h!=="center"&&ne(t[h]))return xt(xt({},t),{},Bo({},h,t[h]+(c||0)));if((v==="horizontal"||v==="vertical"&&h==="center")&&x!=="middle"&&ne(t[x]))return xt(xt({},t),{},Bo({},x,t[x]+(p||0)))}return t},HZ=function(t,r,n){return Ee(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},aC=function(t,r,n,i,a){var o=r.props.children,s=Yr(o,ch).filter(function(u){return HZ(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var c=rr(f,n);if(Ee(c))return u;var p=Array.isArray(c)?[oh(c),ah(c)]:[c,c],h=l.reduce(function(x,v){var y=rr(f,v,0),g=p[0]-Math.abs(Array.isArray(y)?y[0]:y),m=p[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(g,x[0]),Math.max(m,x[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},GZ=function(t,r,n,i,a){var o=r.map(function(s){return aC(t,s,n,a,i)}).filter(function(s){return!Ee(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},oC=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&aC(t,l,u,i)||Fl(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,c=u.length;f=2?or(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(c){var p=a?a.indexOf(c):c;return{coordinate:i(p)+u,value:c,offset:u}});return f.filter(function(c){return!uc(c.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(c,p){return{coordinate:i(c)+u,value:c,index:p,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(c){return{coordinate:i(c)+u,value:c,offset:u}}):i.domain().map(function(c,p){return{coordinate:i(c)+u,value:a?a[c]:c,index:p,offset:u}})},Vm=new WeakMap,Xc=function(t,r){if(typeof r!="function")return t;Vm.has(t)||Vm.set(t,new WeakMap);var n=Vm.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},lC=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:_u(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Sd(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Bl(),realScaleType:"point"}:a==="category"?{scale:_u(),realScaleType:"band"}:{scale:Sd(),realScaleType:"linear"};if(Ua(i)){var l="scale".concat(Hp(i));return{scale:(PS[l]||Bl)(),realScaleType:PS[l]?l:"point"}}return we(i)?{scale:i}:{scale:Bl(),realScaleType:"point"}},DS=1e-4,uC=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-DS,o=Math.max(i[0],i[1])+DS,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},KZ=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},YZ=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},ZZ={sign:XZ,expand:mz,none:Jo,silhouette:vz,wiggle:yz,positive:YZ},QZ=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=ZZ[n],o=hz().keys(i).value(function(s,l){return+rr(s,l,0)}).order(Ty).offset(a);return o(t)},JZ=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(c,p){var h,x=(h=p.type)!==null&&h!==void 0&&h.defaultProps?xt(xt({},p.type.defaultProps),p.props):p.props,v=x.stackId,y=x.hide;if(y)return c;var g=x[n],m=c[g]||{hasStack:!1,stackGroups:{}};if(It(v)){var w=m.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(p),m.hasStack=!0,m.stackGroups[v]=w}else m.stackGroups[cc("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[p]};return xt(xt({},c),{},Bo({},g,m))},l),f={};return Object.keys(u).reduce(function(c,p){var h=u[p];if(h.hasStack){var x={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(v,y){var g=h.stackGroups[y];return xt(xt({},v),{},Bo({},y,{numericAxisId:n,cateAxisId:i,items:g.items,stackedData:QZ(t,g.items,a)}))},x)}return xt(xt({},c),{},Bo({},p,h))},f)},cC=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=pZ(u,a,s);return t.domain([oh(f),ah(f)]),{niceTicks:f}}if(a&&i==="number"){var c=t.domain(),p=hZ(c,a,s);return{niceTicks:p}}return null},LS=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=rr(o,r.dataKey,r.domain[s]);return Ee(l)?null:r.scale(l)-a/2+i},eQ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},tQ=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?xt(xt({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(It(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},rQ=function(t){return t.reduce(function(r,n){return[oh(n.concat([r[0]]).filter(ne)),ah(n.concat([r[1]]).filter(ne))]},[1/0,-1/0])},fC=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var c=rQ(f.slice(r,n+1));return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},BS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,FS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,sg=function(t,r,n){if(we(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(ne(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(BS.test(t[0])){var a=+BS.exec(t[0])[1];i[0]=r[0]-a}else we(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(ne(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(FS.test(t[1])){var o=+FS.exec(t[1])[1];i[1]=r[1]+o}else we(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Cd=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Cx(r,function(c){return c.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},fQ=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=sr(t.cx,o,o/2),c=sr(t.cy,s,s/2),p=hC(o,s,n),h=sr(t.innerRadius,p,0),x=sr(t.outerRadius,p,p*.8),v=Object.keys(r);return v.reduce(function(y,g){var m=r[g],w=m.domain,S=m.reversed,b;if(Ee(m.range))i==="angleAxis"?b=[l,u]:i==="radiusAxis"&&(b=[h,x]),S&&(b=[b[1],b[0]]);else{b=m.range;var _=b,O=aQ(_,2);l=O[0],u=O[1]}var k=lC(m,a),P=k.realScaleType,R=k.scale;R.domain(w).range(b),uC(R);var $=cC(R,zn(zn({},m),{},{realScaleType:P})),C=zn(zn(zn({},m),$),{},{range:b,radius:x,realScaleType:P,scale:R,cx:f,cy:c,innerRadius:h,outerRadius:x,startAngle:l,endAngle:u});return zn(zn({},y),{},pC({},g,C))},{})},dQ=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},pQ=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=dQ({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:cQ(u),angleInRadian:u}},hQ=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},mQ=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},WS=function(t,r){var n=t.x,i=t.y,a=pQ({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=hQ(r),c=f.startAngle,p=f.endAngle,h=s,x;if(c<=p){for(;h>p;)h-=360;for(;h=c&&h<=p}else{for(;h>c;)h-=360;for(;h=p&&h<=c}return x?zn(zn({},r),{},{radius:o,angle:mQ(h,r)}):null},mC=function(t){return!j.isValidElement(t)&&!we(t)&&typeof t!="boolean"?t.className:""};function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var vQ=["offset"];function yQ(e){return wQ(e)||bQ(e)||xQ(e)||gQ()}function gQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xQ(e,t){if(e){if(typeof e=="string")return lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lg(e,t)}}function bQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wQ(e){if(Array.isArray(e))return lg(e)}function lg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function HS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t=0?1:-1,w,S;i==="insideStart"?(w=h+m*o,S=v):i==="insideEnd"?(w=x-m*o,S=!v):i==="end"&&(w=x+m*o,S=v),S=g<=0?S:!S;var b=it(u,f,y,w),_=it(u,f,y,w+(S?1:-1)*359),O="M".concat(b.x,",").concat(b.y,` - A`).concat(y,",").concat(y,",0,1,").concat(S?0:1,`, - `).concat(_.x,",").concat(_.y),k=Ee(t.id)?cc("recharts-radial-line-"):t.id;return N.createElement("text",$u({},n,{dominantBaseline:"central",className:je("recharts-radial-bar-label",s)}),N.createElement("defs",null,N.createElement("path",{id:k,d:O})),N.createElement("textPath",{xlinkHref:"#".concat(k)},r))},CQ=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,f=a.startAngle,c=a.endAngle,p=(f+c)/2;if(i==="outside"){var h=it(o,s,u+n,p),x=h.x,v=h.y;return{x,y:v,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,g=it(o,s,y,p),m=g.x,w=g.y;return{x:m,y:w,textAnchor:"middle",verticalAnchor:"middle"}},TQ=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,c=f>=0?1:-1,p=c*i,h=c>0?"end":"start",x=c>0?"start":"end",v=u>=0?1:-1,y=v*i,g=v>0?"end":"start",m=v>0?"start":"end";if(a==="top"){var w={x:s+u/2,y:l-c*i,textAnchor:"middle",verticalAnchor:h};return Tt(Tt({},w),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+f+p,textAnchor:"middle",verticalAnchor:x};return Tt(Tt({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var b={x:s-y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"};return Tt(Tt({},b),n?{width:Math.max(b.x-n.x,0),height:f}:{})}if(a==="right"){var _={x:s+u+y,y:l+f/2,textAnchor:m,verticalAnchor:"middle"};return Tt(Tt({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return a==="insideLeft"?Tt({x:s+y,y:l+f/2,textAnchor:m,verticalAnchor:"middle"},O):a==="insideRight"?Tt({x:s+u-y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"},O):a==="insideTop"?Tt({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:x},O):a==="insideBottom"?Tt({x:s+u/2,y:l+f-p,textAnchor:"middle",verticalAnchor:h},O):a==="insideTopLeft"?Tt({x:s+y,y:l+p,textAnchor:m,verticalAnchor:x},O):a==="insideTopRight"?Tt({x:s+u-y,y:l+p,textAnchor:g,verticalAnchor:x},O):a==="insideBottomLeft"?Tt({x:s+y,y:l+f-p,textAnchor:m,verticalAnchor:h},O):a==="insideBottomRight"?Tt({x:s+u-y,y:l+f-p,textAnchor:g,verticalAnchor:h},O):$s(a)&&(ne(a.x)||Sa(a.x))&&(ne(a.y)||Sa(a.y))?Tt({x:s+sr(a.x,u),y:l+sr(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):Tt({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},NQ=function(t){return"cx"in t&&ne(t.cx)};function Ft(e){var t=e.offset,r=t===void 0?5:t,n=_Q(e,vQ),i=Tt({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,c=f===void 0?"":f,p=i.textBreakAll;if(!a||Ee(s)&&Ee(l)&&!j.isValidElement(u)&&!we(u))return null;if(j.isValidElement(u))return j.cloneElement(u,i);var h;if(we(u)){if(h=j.createElement(u,i),j.isValidElement(h))return h}else h=kQ(i);var x=NQ(a),v=ge(i,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return PQ(i,h,v);var y=x?CQ(i):TQ(i);return N.createElement(Wa,$u({className:je("recharts-label",c)},v,y,{breakAll:p}),h)}Ft.displayName="Label";var vC=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,c=t.x,p=t.y,h=t.top,x=t.left,v=t.width,y=t.height,g=t.clockWise,m=t.labelViewBox;if(m)return m;if(ne(v)&&ne(y)){if(ne(c)&&ne(p))return{x:c,y:p,width:v,height:y};if(ne(h)&&ne(x))return{x:h,y:x,width:v,height:y}}return ne(c)&&ne(p)?{x:c,y:p,width:0,height:0}:ne(r)&&ne(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:g}:t.viewBox?t.viewBox:{}},$Q=function(t,r){return t?t===!0?N.createElement(Ft,{key:"label-implicit",viewBox:r}):It(t)?N.createElement(Ft,{key:"label-implicit",viewBox:r,value:t}):j.isValidElement(t)?t.type===Ft?j.cloneElement(t,{key:"label-implicit",viewBox:r}):N.createElement(Ft,{key:"label-implicit",content:t,viewBox:r}):we(t)?N.createElement(Ft,{key:"label-implicit",content:t,viewBox:r}):$s(t)?N.createElement(Ft,$u({viewBox:r},t,{key:"label-implicit"})):null:null},RQ=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=vC(t),o=Yr(i,Ft).map(function(l,u){return j.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=$Q(t.label,r||a);return[s].concat(yQ(o))};Ft.parseViewBox=vC;Ft.renderCallByParent=RQ;function IQ(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var MQ=IQ;const DQ=qe(MQ);function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}var LQ=["valueAccessor"],BQ=["data","dataKey","clockWise","id","textBreakAll"];function FQ(e){return WQ(e)||VQ(e)||UQ(e)||zQ()}function zQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UQ(e,t){if(e){if(typeof e=="string")return ug(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ug(e,t)}}function VQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WQ(e){if(Array.isArray(e))return ug(e)}function ug(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var XQ=function(t){return Array.isArray(t.value)?DQ(t.value):t.value};function Gi(e){var t=e.valueAccessor,r=t===void 0?XQ:t,n=qS(e,LQ),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=qS(n,BQ);return!i||!i.length?null:N.createElement(Ge,{className:"recharts-label-list"},i.map(function(f,c){var p=Ee(a)?r(f,c):rr(f&&f.payload,a),h=Ee(s)?{}:{id:"".concat(s,"-").concat(c)};return N.createElement(Ft,Nd({},ge(f,!0),u,h,{parentViewBox:f.parentViewBox,value:p,textBreakAll:l,viewBox:Ft.parseViewBox(Ee(o)?f:KS(KS({},f),{},{clockWise:o})),key:"label-".concat(c),index:c}))}))}Gi.displayName="LabelList";function YQ(e,t){return e?e===!0?N.createElement(Gi,{key:"labelList-implicit",data:t}):N.isValidElement(e)||we(e)?N.createElement(Gi,{key:"labelList-implicit",data:t,content:e}):$s(e)?N.createElement(Gi,Nd({data:t},e,{key:"labelList-implicit"})):null:null}function ZQ(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Yr(n,Gi).map(function(o,s){return j.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=YQ(e.label,t);return[a].concat(FQ(i))}Gi.renderCallByParent=ZQ;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function cg(){return cg=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, - `).concat(c.x,",").concat(c.y,` - `);if(i>0){var h=it(r,n,i,o),x=it(r,n,i,u);p+="L ".concat(x.x,",").concat(x.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},rJ=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,c=or(f-u),p=Yc({cx:r,cy:n,radius:a,angle:u,sign:c,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,x=p.lineTangency,v=p.theta,y=Yc({cx:r,cy:n,radius:a,angle:f,sign:-c,cornerRadius:o,cornerIsExternal:l}),g=y.circleTangency,m=y.lineTangency,w=y.theta,S=l?Math.abs(u-f):Math.abs(u-f)-v-w;if(S<0)return s?"M ".concat(x.x,",").concat(x.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):yC({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var b="M ".concat(x.x,",").concat(x.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(h.x,",").concat(h.y,` - A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(c<0),",").concat(g.x,",").concat(g.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(m.x,",").concat(m.y,` - `);if(i>0){var _=Yc({cx:r,cy:n,radius:i,angle:u,sign:c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=_.circleTangency,k=_.lineTangency,P=_.theta,R=Yc({cx:r,cy:n,radius:i,angle:f,sign:-c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),$=R.circleTangency,C=R.lineTangency,I=R.theta,D=l?Math.abs(u-f):Math.abs(u-f)-P-I;if(D<0&&o===0)return"".concat(b,"L").concat(r,",").concat(n,"Z");b+="L".concat(C.x,",").concat(C.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat($.x,",").concat($.y,` - A`).concat(i,",").concat(i,",0,").concat(+(D>180),",").concat(+(c>0),",").concat(O.x,",").concat(O.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(k.x,",").concat(k.y,"Z")}else b+="L".concat(r,",").concat(n,"Z");return b},nJ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},gC=function(t){var r=YS(YS({},nJ),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,c=r.endAngle,p=r.className;if(o0&&Math.abs(f-c)<360?y=rJ({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,x/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:c}):y=yC({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:c}),N.createElement("path",cg({},ge(r,!0),{className:h,d:y,role:"img"}))};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function fg(){return fg=Object.assign?Object.assign.bind():function(e){for(var t=1;tvJ.call(e,t));function Qa(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const xJ="__v",bJ="__o",wJ="_owner",{getOwnPropertyDescriptor:tO,keys:rO}=Object;function _J(e,t){return e.byteLength===t.byteLength&&$d(new Uint8Array(e),new Uint8Array(t))}function SJ(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function OJ(e,t){return e.byteLength===t.byteLength&&$d(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function jJ(e,t){return Qa(e.getTime(),t.getTime())}function AJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function kJ(e,t){return e===t}function nO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let f=!1,c=0;for(;(s=u.next())&&!s.done;){if(i[c]){c++;continue}const p=o.value,h=s.value;if(r.equals(p[0],h[0],l,c,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){f=i[c]=!0;break}c++}if(!f)return!1;l++}return!0}const EJ=Qa;function PJ(e,t,r){const n=rO(e);let i=n.length;if(rO(t).length!==i)return!1;for(;i-- >0;)if(!_C(e,t,r,n[i]))return!1;return!0}function dl(e,t,r){const n=eO(e);let i=n.length;if(eO(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!_C(e,t,r,a)||(o=tO(e,a),s=tO(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function CJ(e,t){return Qa(e.valueOf(),t.valueOf())}function TJ(e,t){return e.source===t.source&&e.flags===t.flags}function iO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function $d(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function NJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function _C(e,t,r,n){return(n===wJ||n===bJ||n===xJ)&&(e.$$typeof||t.$$typeof)?!0:gJ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const $J="[object ArrayBuffer]",RJ="[object Arguments]",IJ="[object Boolean]",MJ="[object DataView]",DJ="[object Date]",LJ="[object Error]",BJ="[object Map]",FJ="[object Number]",zJ="[object Object]",UJ="[object RegExp]",VJ="[object Set]",WJ="[object String]",HJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},GJ="[object URL]",KJ=Object.prototype.toString;function qJ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:c,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:x}){return function(y,g,m){if(y===g)return!0;if(y==null||g==null)return!1;const w=typeof y;if(w!==typeof g)return!1;if(w!=="object")return w==="number"?s(y,g,m):w==="function"?a(y,g,m):!1;const S=y.constructor;if(S!==g.constructor)return!1;if(S===Object)return l(y,g,m);if(Array.isArray(y))return t(y,g,m);if(S===Date)return n(y,g,m);if(S===RegExp)return f(y,g,m);if(S===Map)return o(y,g,m);if(S===Set)return c(y,g,m);const b=KJ.call(y);if(b===DJ)return n(y,g,m);if(b===UJ)return f(y,g,m);if(b===BJ)return o(y,g,m);if(b===VJ)return c(y,g,m);if(b===zJ)return typeof y.then!="function"&&typeof g.then!="function"&&l(y,g,m);if(b===GJ)return h(y,g,m);if(b===LJ)return i(y,g,m);if(b===RJ)return l(y,g,m);if(HJ[b])return p(y,g,m);if(b===$J)return e(y,g,m);if(b===MJ)return r(y,g,m);if(b===IJ||b===FJ||b===WJ)return u(y,g,m);if(x){let _=x[b];if(!_){const O=yJ(y);O&&(_=x[O])}if(_)return _(y,g,m)}return!1}}function XJ({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:_J,areArraysEqual:r?dl:SJ,areDataViewsEqual:OJ,areDatesEqual:jJ,areErrorsEqual:AJ,areFunctionsEqual:kJ,areMapsEqual:r?Wm(nO,dl):nO,areNumbersEqual:EJ,areObjectsEqual:r?dl:PJ,arePrimitiveWrappersEqual:CJ,areRegExpsEqual:TJ,areSetsEqual:r?Wm(iO,dl):iO,areTypedArraysEqual:r?Wm($d,dl):$d,areUrlsEqual:NJ,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=Qc(n.areArraysEqual),a=Qc(n.areMapsEqual),o=Qc(n.areObjectsEqual),s=Qc(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function YJ(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function ZJ({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const QJ=la();la({strict:!0});la({circular:!0});la({circular:!0,strict:!0});la({createInternalComparator:()=>Qa});la({strict:!0,createInternalComparator:()=>Qa});la({circular:!0,createInternalComparator:()=>Qa});la({circular:!0,createInternalComparator:()=>Qa,strict:!0});function la(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=XJ(e),o=qJ(a),s=r?r(o):YJ(o);return ZJ({circular:t,comparator:o,createState:n,equals:s,strict:i})}function JJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function aO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):JJ(i)};requestAnimationFrame(n)}function pg(e){"@babel/helpers - typeof";return pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pg(e)}function eee(e){return iee(e)||nee(e)||ree(e)||tee()}function tee(){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 ree(e,t){if(e){if(typeof e=="string")return oO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oO(e,t)}}function oO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:g<0?0:g},v=function(g){for(var m=g>1?1:g,w=m,S=0;S<8;++S){var b=c(w)-m,_=h(w);if(Math.abs(b-m)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(f,c,p){var h=-(f-c)*n,x=p*a,v=p+(h-x)*s/1e3,y=p*s/1e3+f;return Math.abs(y-c)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Iee(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Hm(e){return Bee(e)||Lee(e)||Dee(e)||Mee()}function Mee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dee(e,t){if(e){if(typeof e=="string")return gg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gg(e,t)}}function Lee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bee(e){if(Array.isArray(e))return gg(e)}function gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Md(e){return Md=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Md(e)}var ci=function(e){Wee(r,e);var t=Hee(r);function r(n,i){var a;Fee(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,c=o.steps,p=o.children,h=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(wg(a)),a.changeStyle=a.changeStyle.bind(wg(a)),!s||h<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:f}),bg(a);if(c&&c.length)a.state={style:c[0].style};else if(u){if(typeof p=="function")return a.state={style:u},bg(a);a.state={style:l?Sl({},l,u):u}}else a.state={style:{}};return a}return Uee(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,c=a.from,p=this.state.style;if(s){if(!o){var h={style:l?Sl({},l,f):f};this.state&&p&&(l&&p[l]!==f||!l&&p!==f)&&this.setState(h);return}if(!(QJ(i.to,f)&&i.canBegin&&i.isActive)){var x=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=x||u?c:i.to;if(this.state&&p){var y={style:l?Sl({},l,v):v};(l&&p[l]!==v||!l&&p!==v)&&this.setState(y)}this.runAnimation(an(an({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,f=i.begin,c=i.onAnimationEnd,p=i.onAnimationStart,h=Nee(o,s,wee(u),l,this.changeStyle),x=function(){a.stopJSAnimation=h()};this.manager.start([p,f,x,l,c])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,c=u.duration,p=c===void 0?0:c,h=function(v,y,g){if(g===0)return v;var m=y.duration,w=y.easing,S=w===void 0?"ease":w,b=y.style,_=y.properties,O=y.onAnimationEnd,k=g>0?o[g-1]:y,P=_||Object.keys(b);if(typeof S=="function"||S==="spring")return[].concat(Hm(v),[a.runJSAnimation.bind(a,{from:k.style,to:b,duration:m,easing:S}),m]);var R=uO(P,m,S),$=an(an(an({},k.style),b),{},{transition:R});return[].concat(Hm(v),[$,m,O]).filter(uee)};return this.manager.start([l].concat(Hm(o.reduce(h,[f,Math.max(p,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=aee());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,c=i.onAnimationEnd,p=i.steps,h=i.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(i);return}if(p.length>1){this.runStepAnimation(i);return}var v=s?Sl({},s,l):l,y=uO(Object.keys(v),o,u);x.start([f,a,an(an({},v),{},{transition:y}),o,c])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Ree(i,$ee),u=j.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var c=function(h){var x=h.props,v=x.style,y=v===void 0?{}:v,g=x.className,m=j.cloneElement(h,an(an({},l),{},{style:an(an({},y),f),className:g}));return m};return u===1?c(j.Children.only(a)):N.createElement("div",null,j.Children.map(a,function(p){return c(p)}))}}]),r}(j.PureComponent);ci.displayName="Animate";ci.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ci.propTypes={from:Ve.oneOfType([Ve.object,Ve.string]),to:Ve.oneOfType([Ve.object,Ve.string]),attributeName:Ve.string,duration:Ve.number,begin:Ve.number,easing:Ve.oneOfType([Ve.string,Ve.func]),steps:Ve.arrayOf(Ve.shape({duration:Ve.number.isRequired,style:Ve.object.isRequired,easing:Ve.oneOfType([Ve.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ve.func]),properties:Ve.arrayOf("string"),onAnimationEnd:Ve.func})),children:Ve.oneOfType([Ve.node,Ve.func]),isActive:Ve.bool,canBegin:Ve.bool,onAnimationEnd:Ve.func,shouldReAnimate:Ve.bool,onAnimationStart:Ve.func,onAnimationReStart:Ve.func};function Bu(e){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function Dd(){return Dd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var c=[0,0,0,0],p=0,h=4;po?o:a[p];f="M".concat(t,",").concat(r+s*c[0]),c[0]>0&&(f+="A ".concat(c[0],",").concat(c[0],",0,0,").concat(u,",").concat(t+l*c[0],",").concat(r)),f+="L ".concat(t+n-l*c[1],",").concat(r),c[1]>0&&(f+="A ".concat(c[1],",").concat(c[1],",0,0,").concat(u,`, - `).concat(t+n,",").concat(r+s*c[1])),f+="L ".concat(t+n,",").concat(r+i-s*c[2]),c[2]>0&&(f+="A ".concat(c[2],",").concat(c[2],",0,0,").concat(u,`, - `).concat(t+n-l*c[2],",").concat(r+i)),f+="L ".concat(t+l*c[3],",").concat(r+i),c[3]>0&&(f+="A ".concat(c[3],",").concat(c[3],",0,0,").concat(u,`, - `).concat(t,",").concat(r+i-s*c[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var x=Math.min(o,a);f="M ".concat(t,",").concat(r+s*x,` - A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+l*x,",").concat(r,` - L `).concat(t+n-l*x,",").concat(r,` - A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*x,` - L `).concat(t+n,",").concat(r+i-s*x,` - A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t+n-l*x,",").concat(r+i,` - L `).concat(t+l*x,",").concat(r+i,` - A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*x," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},tte=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),c=Math.min(o,o+l),p=Math.max(o,o+l);return n>=u&&n<=f&&i>=c&&i<=p}return!1},rte={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},nb=function(t){var r=yO(yO({},rte),t),n=j.useRef(),i=j.useState(-1),a=Kee(i,2),o=a[0],s=a[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,c=r.height,p=r.radius,h=r.className,x=r.animationEasing,v=r.animationDuration,y=r.animationBegin,g=r.isAnimationActive,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||c!==+c||f===0||c===0)return null;var w=je("recharts-rectangle",h);return m?N.createElement(ci,{canBegin:o>0,from:{width:f,height:c,x:l,y:u},to:{width:f,height:c,x:l,y:u},duration:v,animationEasing:x,isActive:m},function(S){var b=S.width,_=S.height,O=S.x,k=S.y;return N.createElement(ci,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:v,isActive:g,easing:x},N.createElement("path",Dd({},ge(r,!0),{className:w,d:gO(O,k,b,_,p),ref:n})))}):N.createElement("path",Dd({},ge(r,!0),{className:w,d:gO(l,u,f,c,p)}))},nte=["points","className","baseLinePoints","connectNulls"];function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ate(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xO(e){return ute(e)||lte(e)||ste(e)||ote()}function ote(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ste(e,t){if(e){if(typeof e=="string")return _g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _g(e,t)}}function lte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ute(e){if(Array.isArray(e))return _g(e)}function _g(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){bO(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),bO(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Ul=function(t,r){var n=cte(t);r&&(n=[n.reduce(function(a,o){return[].concat(xO(a),xO(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},fte=function(t,r,n){var i=Ul(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Ul(r.reverse(),n).slice(1))},dte=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=ite(t,nte);if(!r||!r.length)return null;var s=je("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=fte(r,i,a);return N.createElement("g",{className:s},N.createElement("path",Oo({},ge(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?N.createElement("path",Oo({},ge(o,!0),{fill:"none",d:Ul(r,a)})):null,l?N.createElement("path",Oo({},ge(o,!0),{fill:"none",d:Ul(i,a)})):null)}var f=Ul(r,a);return N.createElement("path",Oo({},ge(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function Sg(){return Sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var bte=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},wte=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,c=f===void 0?0:f,p=t.height,h=p===void 0?0:p,x=t.className,v=gte(t,pte),y=hte({x:n,y:a,top:s,left:u,width:c,height:h},v);return!ne(n)||!ne(a)||!ne(c)||!ne(h)||!ne(s)||!ne(u)?null:N.createElement("path",Og({},ge(y,!0),{className:je("recharts-cross",x),d:bte(n,a,c,h,s,u)}))},_te=ih,Ste=zP,Ote=aa;function jte(e,t){return e&&e.length?_te(e,Ote(t),Ste):void 0}var Ate=jte;const kte=qe(Ate);var Ete=ih,Pte=aa,Cte=UP;function Tte(e,t){return e&&e.length?Ete(e,Pte(t),Cte):void 0}var Nte=Tte;const $te=qe(Nte);var Rte=["cx","cy","angle","ticks","axisLine"],Ite=["ticks","tick","angle","tickFormatter","stroke"];function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Dte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OO(e,t){for(var r=0;rkO?o=i==="outer"?"start":"end":a<-kO?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=da(da({},ge(this.props,!1)),{},{fill:"none"},ge(s,!1));if(l==="circle")return N.createElement(ib,ga({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,c=f.map(function(p){return it(i,a,o,p.coordinate)});return N.createElement(dte,ga({className:"recharts-polar-angle-axis-line"},u,{points:c}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=ge(this.props,!1),c=ge(o,!1),p=da(da({},f),{},{fill:"none"},ge(s,!1)),h=a.map(function(x,v){var y=n.getTickLineCoord(x),g=n.getTickTextAnchor(x),m=da(da(da({textAnchor:g},f),{},{stroke:"none",fill:u},c),{},{index:v,payload:x,x:y.x2,y:y.y2});return N.createElement(Ge,ga({className:je("recharts-polar-angle-axis-tick",mC(o)),key:"tick-".concat(x.coordinate)},Va(n.props,x,v)),s&&N.createElement("line",ga({className:"recharts-polar-angle-axis-tick-line"},p,y)),o&&t.renderTickItem(o,m,l?l(x.value,v):x.value))});return N.createElement(Ge,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:N.createElement(Ge,{className:je("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return N.isValidElement(n)?o=N.cloneElement(n,i):we(n)?o=n(i):o=N.createElement(Wa,ga({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(j.PureComponent);ph(hh,"displayName","PolarAngleAxis");ph(hh,"axisType","angleAxis");ph(hh,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Qte=B2,Jte=Qte(Object.getPrototypeOf,Object),ere=Jte,tre=hi,rre=ere,nre=mi,ire="[object Object]",are=Function.prototype,ore=Object.prototype,$C=are.toString,sre=ore.hasOwnProperty,lre=$C.call(Object);function ure(e){if(!nre(e)||tre(e)!=ire)return!1;var t=rre(e);if(t===null)return!0;var r=sre.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&$C.call(r)==lre}var cre=ure;const fre=qe(cre);var dre=hi,pre=mi,hre="[object Boolean]";function mre(e){return e===!0||e===!1||pre(e)&&dre(e)==hre}var vre=mre;const yre=qe(vre);function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function Fd(){return Fd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:f,lowerWidth:c,height:p,x:l,y:u},duration:v,animationEasing:x,isActive:g},function(w){var S=w.upperWidth,b=w.lowerWidth,_=w.height,O=w.x,k=w.y;return N.createElement(ci,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:v,easing:x},N.createElement("path",Fd({},ge(r,!0),{className:m,d:TO(O,k,S,b,_),ref:n})))}):N.createElement("g",null,N.createElement("path",Fd({},ge(r,!0),{className:m,d:TO(l,u,f,c,p)})))},Ere=["option","shapeType","propTransformer","activeClassName","isActive"];function Uu(e){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function Pre(e,t){if(e==null)return{};var r=Cre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function NO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zd(e){for(var t=1;t0?$r(w,"paddingAngle",0):0;if(b){var O=Ai(b.endAngle-b.startAngle,w.endAngle-w.startAngle),k=tt(tt({},w),{},{startAngle:m+_,endAngle:m+O(v)+_});y.push(k),m=k.endAngle}else{var P=w.endAngle,R=w.startAngle,$=Ai(0,P-R),C=$(v),I=tt(tt({},w),{},{startAngle:m+_,endAngle:m+C+_});y.push(I),m=I.endAngle}}),N.createElement(Ge,null,n.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!sh(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,f=i.cy,c=i.innerRadius,p=i.outerRadius,h=i.isAnimationActive,x=this.state.isAnimationFinished;if(a||!o||!o.length||!ne(u)||!ne(f)||!ne(c)||!ne(p))return null;var v=je("recharts-pie",s);return N.createElement(Ge,{tabIndex:this.props.rootTabIndex,className:v,ref:function(g){n.pieRef=g}},this.renderSectors(),l&&this.renderLabels(o),Ft.renderCallByParent(this.props,null,!1),(!h||x)&&Gi.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?m:m-1)*l,S=y-m*h-w,b=i.reduce(function(k,P){var R=rr(P,g,0);return k+(ne(R)?R:0)},0),_;if(b>0){var O;_=i.map(function(k,P){var R=rr(k,g,0),$=rr(k,f,P),C=(ne(R)?R:0)/b,I;P?I=O.endAngle+or(v)*l*(R!==0?1:0):I=o;var D=I+or(v)*((R!==0?h:0)+C*S),L=(I+D)/2,z=(x.innerRadius+x.outerRadius)/2,U=[{name:$,value:R,payload:k,dataKey:g,type:p}],M=it(x.cx,x.cy,z,L);return O=tt(tt(tt({percent:C,cornerRadius:a,name:$,tooltipPayload:U,midAngle:L,middleRadius:z,tooltipPosition:M},k),x),{},{value:rr(k,g),startAngle:I,endAngle:D,payload:k,paddingAngle:or(v)*l}),O})}return tt(tt({},x),{},{sectors:_,data:i})});var Zre=Math.ceil,Qre=Math.max;function Jre(e,t,r,n){for(var i=-1,a=Qre(Zre((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var ene=Jre,tne=nP,MO=1/0,rne=17976931348623157e292;function nne(e){if(!e)return e===0?e:0;if(e=tne(e),e===MO||e===-MO){var t=e<0?-1:1;return t*rne}return e===e?e:0}var ine=nne,ane=ene,one=Zp,Gm=ine;function sne(e){return function(t,r,n){return n&&typeof n!="number"&&one(t,r,n)&&(r=n=void 0),t=Gm(t),r===void 0?(r=t,t=0):r=Gm(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),Ar(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),Ar(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ar(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ar(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ar(n,"handleSlideDragStart",function(i){var a=zO(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return wne(t,e),yne(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,c=Math.min(i,a),p=Math.max(i,a),h=t.getIndexInRange(o,c),x=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:x===f?f:x-x%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=rr(a[n],s,n);return we(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,f=l.width,c=l.travellerWidth,p=l.startIndex,h=l.endIndex,x=l.onChange,v=n.pageX-a;v>0?v=Math.min(v,u+f-c-s,u+f-c-o):v<0&&(v=Math.max(v,u-o,u-s));var y=this.getIndex({startX:o+v,endX:s+v});(y.startIndex!==p||y.endIndex!==h)&&x&&x(y),this.setState({startX:o+v,endX:s+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=zO(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],f=this.props,c=f.x,p=f.width,h=f.travellerWidth,x=f.onChange,v=f.gap,y=f.data,g={startX:this.state.startX,endX:this.state.endX},m=n.pageX-a;m>0?m=Math.min(m,c+p-h-u):m<0&&(m=Math.max(m,c-u)),g[o]=u+m;var w=this.getIndex(g),S=w.startIndex,b=w.endIndex,_=function(){var k=y.length-1;return o==="startX"&&(s>l?S%v===0:b%v===0)||sl?b%v===0:S%v===0)||s>l&&b===k};this.setState(Ar(Ar({},o,u+m),"brushMoveStartX",n.pageX),function(){x&&_()&&x(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],c=s.indexOf(f);if(c!==-1){var p=c+n;if(!(p===-1||p>=s.length)){var h=s[p];i==="startX"&&h>=u||i==="endX"&&h<=l||this.setState(Ar({},i,h),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return N.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,c=j.Children.only(u);return c?N.cloneElement(c,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,c=l.height,p=l.traveller,h=l.ariaLabel,x=l.data,v=l.startIndex,y=l.endIndex,g=Math.max(n,this.props.x),m=Km(Km({},ge(this.props,!1)),{},{x:g,y:u,width:f,height:c}),w=h||"Min value: ".concat((a=x[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=x[y])===null||o===void 0?void 0:o.name);return N.createElement(Ge,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(b){["ArrowLeft","ArrowRight"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),s.handleTravellerMoveKeyboard(b.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,m))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,c=Math.max(Math.abs(i-n)-u,0);return N.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:c,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,c=f.startX,p=f.endX,h=5,x={pointerEvents:"none",fill:u};return N.createElement(Ge,{className:"recharts-brush-texts"},N.createElement(Wa,Wd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,p)-h,y:o+s/2},x),this.getTextOfTick(i)),N.createElement(Wa,Wd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,p)+l+h,y:o+s/2},x),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,c=n.alwaysShowText,p=this.state,h=p.startX,x=p.endX,v=p.isTextActive,y=p.isSlideMoving,g=p.isTravellerMoving,m=p.isTravellerFocused;if(!i||!i.length||!ne(s)||!ne(l)||!ne(u)||!ne(f)||u<=0||f<=0)return null;var w=je("recharts-brush",a),S=N.Children.count(o)===1,b=mne("userSelect","none");return N.createElement(Ge,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,x),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(x,"endX"),(v||y||g||m||c)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return N.createElement(N.Fragment,null,N.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),N.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),N.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return N.isValidElement(n)?a=N.cloneElement(n,i):we(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,c=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Km({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?Sne({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:c}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var p=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(j.PureComponent);Ar(ps,"displayName","Brush");Ar(ps,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var One=Px;function jne(e,t){var r;return One(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var Ane=jne,kne=T2,Ene=aa,Pne=Ane,Cne=_r,Tne=Zp;function Nne(e,t,r){var n=Cne(e)?kne:Pne;return r&&Tne(e,t,r)&&(t=void 0),n(e,Ene(t))}var $ne=Nne;const Rne=qe($ne);var $n=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},UO=Q2;function Ine(e,t,r){t=="__proto__"&&UO?UO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Mne=Ine,Dne=Mne,Lne=Y2,Bne=aa;function Fne(e,t){var r={};return t=Bne(t),Lne(e,function(n,i,a){Dne(r,i,t(n,i,a))}),r}var zne=Fne;const Une=qe(zne);function Vne(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lie(e,t){var r=e.x,n=e.y,i=oie(e,rie),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),c="".concat(t.width||i.width),p=parseInt(c,10);return pl(pl(pl(pl(pl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:p,name:t.name,radius:t.radius})}function WO(e){return N.createElement(RC,Pg({shapeType:"rectangle",propTransformer:lie,activeClassName:"recharts-active-bar"},e))}var uie=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=ne(n)||E6(n);return a?t(n,i):(a||Ga(),r)}},cie=["value","background"],FC;function hs(e){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(e)}function fie(e,t){if(e==null)return{};var r=die(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function die(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Gd(){return Gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(L)0&&Math.abs(D)0&&(I=Math.min((X||0)-(D[de-1]||0),I))}),Number.isFinite(I)){var L=I/C,z=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(O=L*z/2),v.padding==="no-gap"){var U=sr(t.barCategoryGap,L*z),M=L*z/2;O=M-U-(M-U)/z*U}}}i==="xAxis"?k=[n.left+(w.left||0)+(O||0),n.left+n.width-(w.right||0)-(O||0)]:i==="yAxis"?k=l==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(O||0),n.top+n.height-(w.bottom||0)-(O||0)]:k=v.range,b&&(k=[k[1],k[0]]);var B=lC(v,a,p),W=B.scale,J=B.realScaleType;W.domain(g).range(k),uC(W);var G=cC(W,un(un({},v),{},{realScaleType:J}));i==="xAxis"?($=y==="top"&&!S||y==="bottom"&&S,P=n.left,R=c[_]-$*v.height):i==="yAxis"&&($=y==="left"&&!S||y==="right"&&S,P=c[_]-$*v.width,R=n.top);var Q=un(un(un({},v),G),{},{realScaleType:J,x:P,y:R,scale:W,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return Q.bandSize=Cd(Q,G),!v.hide&&i==="xAxis"?c[_]+=($?-1:1)*Q.height:v.hide||(c[_]+=($?-1:1)*Q.width),un(un({},h),{},yh({},x,Q))},{})},WC=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},Oie=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return WC({x:r,y:n},{x:i,y:a})},HC=function(){function e(t){bie(this,e),this.scale=t}return wie(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();yh(HC,"EPS",1e-4);var ab=function(t){var r=Object.keys(t).reduce(function(n,i){return un(un({},n),{},yh({},i,HC.create(t[i])))},{});return un(un({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return Une(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return tie(i,function(a,o){return r[o].isInRange(a)})}})};function jie(e){return(e%180+180)%180}var Aie=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=jie(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&oe.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function pae(e,t){return lT(e,t+1)}function hae(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,c=function(){var x=n==null?void 0:n[l];if(x===void 0)return{v:lT(n,u)};var v=l,y,g=function(){return y===void 0&&(y=r(x,v)),y},m=x.coordinate,w=l===0||Zd(e,m,g,f,s);w||(l=0,f=o,u+=1),w&&(f=m+e*(g()/2+i),l+=u)},p;u<=a.length;)if(p=c(),p)return p.v;return[]}function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function nj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t0?h.coordinate-y*e:h.coordinate})}else a[p]=h=Jt(Jt({},h),{},{tickCoord:h.coordinate});var g=Zd(e,h.tickCoord,v,s,l);g&&(l=h.tickCoord-e*(v()/2+i),a[p]=Jt(Jt({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function xae(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],c=r(f,s-1),p=e*(f.coordinate+e*c/2-u);o[s-1]=f=Jt(Jt({},f),{},{tickCoord:p>0?f.coordinate-p*e:f.coordinate});var h=Zd(e,f.tickCoord,function(){return c},l,u);h&&(u=f.tickCoord-e*(c/2+i),o[s-1]=Jt(Jt({},f),{},{isShow:!0}))}for(var x=a?s-1:s,v=function(m){var w=o[m],S,b=function(){return S===void 0&&(S=r(w,m)),S};if(m===0){var _=e*(w.coordinate-e*b()/2-l);o[m]=w=Jt(Jt({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else o[m]=w=Jt(Jt({},w),{},{tickCoord:w.coordinate});var O=Zd(e,w.tickCoord,b,l,u);O&&(l=w.tickCoord+e*(b()/2+i),o[m]=Jt(Jt({},w),{},{isShow:!0}))},y=0;y=2?or(i[1].coordinate-i[0].coordinate):1,g=dae(a,y,h);return l==="equidistantPreserveStart"?hae(y,g,v,i,o):(l==="preserveStart"||l==="preserveStartEnd"?p=xae(y,g,v,i,o,l==="preserveStartEnd"):p=gae(y,g,v,i,o),p.filter(function(m){return m.isShow}))}var wae=["viewBox"],_ae=["viewBox"],Sae=["ticks"];function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Oae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function jae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aj(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!x||!x.length?null:N.createElement(Ge,{className:je("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),Ft.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=je(i.className,"recharts-cartesian-axis-tick-value");return N.isValidElement(n)?o=N.cloneElement(n,Ct(Ct({},i),{},{className:s})):we(n)?o=n(Ct(Ct({},i),{},{className:s})):o=N.createElement(Wa,Ao({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(j.Component);lb(_h,"displayName","CartesianAxis");lb(_h,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function Nae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $ae(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function boe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function woe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&ne(i)&&ne(a)?t.slice(i,a+1):[]};function OT(e){return e==="number"?[0,"auto"]:void 0}var Gg=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Sh(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,c=(f=u.props.data)!==null&&f!==void 0?f:r;c&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(c=c.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=c===void 0?s:c;p=by(h,o.dataKey,i)}else p=c&&c[n]||s[n];return p?[].concat(_s(l),[dC(u,p)]):l},[])},fj=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=$oe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=zZ(o,s,u,l);if(f>=0&&u){var c=u[f]&&u[f].value,p=Gg(t,r,f,c),h=Roe(n,s,f,a);return{activeTooltipIndex:f,activeLabel:c,activePayload:p,activeCoordinate:h}}return null},Ioe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,p=t.stackOffset,h=sC(f,a);return n.reduce(function(x,v){var y,g=v.type.defaultProps!==void 0?H(H({},v.type.defaultProps),v.props):v.props,m=g.type,w=g.dataKey,S=g.allowDataOverflow,b=g.allowDuplicatedCategory,_=g.scale,O=g.ticks,k=g.includeHidden,P=g[o];if(x[P])return x;var R=Sh(t.data,{graphicalItems:i.filter(function(G){var Q,X=o in G.props?G.props[o]:(Q=G.type.defaultProps)===null||Q===void 0?void 0:Q[o];return X===P}),dataStartIndex:l,dataEndIndex:u}),$=R.length,C,I,D;soe(g.domain,S,m)&&(C=sg(g.domain,null,S),h&&(m==="number"||_!=="auto")&&(D=Fl(R,w,"category")));var L=OT(m);if(!C||C.length===0){var z,U=(z=g.domain)!==null&&z!==void 0?z:L;if(w){if(C=Fl(R,w,m),m==="category"&&h){var M=C6(C);b&&M?(I=C,C=Vd(0,$)):b||(C=zS(U,C,v).reduce(function(G,Q){return G.indexOf(Q)>=0?G:[].concat(_s(G),[Q])},[]))}else if(m==="category")b?C=C.filter(function(G){return G!==""&&!Ee(G)}):C=zS(U,C,v).reduce(function(G,Q){return G.indexOf(Q)>=0||Q===""||Ee(Q)?G:[].concat(_s(G),[Q])},[]);else if(m==="number"){var B=GZ(R,i.filter(function(G){var Q,X,de=o in G.props?G.props[o]:(Q=G.type.defaultProps)===null||Q===void 0?void 0:Q[o],ue="hide"in G.props?G.props.hide:(X=G.type.defaultProps)===null||X===void 0?void 0:X.hide;return de===P&&(k||!ue)}),w,a,f);B&&(C=B)}h&&(m==="number"||_!=="auto")&&(D=Fl(R,w,"category"))}else h?C=Vd(0,$):s&&s[P]&&s[P].hasStack&&m==="number"?C=p==="expand"?[0,1]:fC(s[P].stackGroups,l,u):C=oC(R,i.filter(function(G){var Q=o in G.props?G.props[o]:G.type.defaultProps[o],X="hide"in G.props?G.props.hide:G.type.defaultProps.hide;return Q===P&&(k||!X)}),m,f,!0);if(m==="number")C=Vg(c,C,P,a,O),U&&(C=sg(U,C,S));else if(m==="category"&&U){var W=U,J=C.every(function(G){return W.indexOf(G)>=0});J&&(C=W)}}return H(H({},x),{},ye({},P,H(H({},g),{},{axisType:a,domain:C,categoricalDomain:D,duplicateDomain:I,originalDomain:(y=g.domain)!==null&&y!==void 0?y:L,isCategorical:h,layout:f})))},{})},Moe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,p=Sh(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=p.length,x=sC(f,a),v=-1;return n.reduce(function(y,g){var m=g.type.defaultProps!==void 0?H(H({},g.type.defaultProps),g.props):g.props,w=m[o],S=OT("number");if(!y[w]){v++;var b;return x?b=Vd(0,h):s&&s[w]&&s[w].hasStack?(b=fC(s[w].stackGroups,l,u),b=Vg(c,b,w,a)):(b=sg(S,oC(p,n.filter(function(_){var O,k,P=o in _.props?_.props[o]:(O=_.type.defaultProps)===null||O===void 0?void 0:O[o],R="hide"in _.props?_.props.hide:(k=_.type.defaultProps)===null||k===void 0?void 0:k.hide;return P===w&&!R}),"number",f),i.defaultProps.allowDataOverflow),b=Vg(c,b,w,a)),H(H({},y),{},ye({},w,H(H({axisType:a},i.defaultProps),{},{hide:!0,orientation:$r(Toe,"".concat(a,".").concat(v%2),null),domain:b,originalDomain:S,isCategorical:x,layout:f})))}return y},{})},Doe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,c="".concat(i,"Id"),p=Yr(f,a),h={};return p&&p.length?h=Ioe(t,{axes:p,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=Moe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Loe=function(t){var r=so(t),n=Aa(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Cx(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Cd(r,n)}},dj=function(t){var r=t.children,n=t.defaultShowTooltip,i=Er(r,ps),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Boe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Qn(r&&r.type);return n&&n.indexOf("Bar")>=0})},pj=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Foe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,c=n.children,p=n.margin||{},h=Er(c,ps),x=Er(c,Pa),v=Object.keys(l).reduce(function(b,_){var O=l[_],k=O.orientation;return!O.mirror&&!O.hide?H(H({},b),{},ye({},k,b[k]+O.width)):b},{left:p.left||0,right:p.right||0}),y=Object.keys(o).reduce(function(b,_){var O=o[_],k=O.orientation;return!O.mirror&&!O.hide?H(H({},b),{},ye({},k,$r(b,"".concat(k))+O.height)):b},{top:p.top||0,bottom:p.bottom||0}),g=H(H({},y),v),m=g.bottom;h&&(g.bottom+=h.props.height||ps.defaultProps.height),x&&r&&(g=WZ(g,i,n,r));var w=u-g.left-g.right,S=f-g.top-g.bottom;return H(H({brushBottom:m},g),{},{width:Math.max(w,0),height:Math.max(S,0)})},zoe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},jT=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,c=t.defaultProps,p=function(g,m){var w=m.graphicalItems,S=m.stackGroups,b=m.offset,_=m.updateId,O=m.dataStartIndex,k=m.dataEndIndex,P=g.barSize,R=g.layout,$=g.barGap,C=g.barCategoryGap,I=g.maxBarSize,D=pj(R),L=D.numericAxisName,z=D.cateAxisName,U=Boe(w),M=[];return w.forEach(function(B,W){var J=Sh(g.data,{graphicalItems:[B],dataStartIndex:O,dataEndIndex:k}),G=B.type.defaultProps!==void 0?H(H({},B.type.defaultProps),B.props):B.props,Q=G.dataKey,X=G.maxBarSize,de=G["".concat(L,"Id")],ue=G["".concat(z,"Id")],Se={},_e=l.reduce(function(He,Ue){var T=m["".concat(Ue.axisType,"Map")],A=G["".concat(Ue.axisType,"Id")];T&&T[A]||Ue.axisType==="zAxis"||Ga();var E=T[A];return H(H({},He),{},ye(ye({},Ue.axisType,E),"".concat(Ue.axisType,"Ticks"),Aa(E)))},Se),te=_e[z],re=_e["".concat(z,"Ticks")],pe=S&&S[de]&&S[de].hasStack&&tQ(B,S[de].stackGroups),K=Qn(B.type).indexOf("Bar")>=0,Pe=Cd(te,re),he=[],Me=U&&UZ({barSize:P,stackGroups:S,totalSize:zoe(_e,z)});if(K){var Be,ve,Ae=Ee(X)?I:X,$e=(Be=(ve=Cd(te,re,!0))!==null&&ve!==void 0?ve:Ae)!==null&&Be!==void 0?Be:0;he=VZ({barGap:$,barCategoryGap:C,bandSize:$e!==Pe?$e:Pe,sizeList:Me[ue],maxBarSize:Ae}),$e!==Pe&&(he=he.map(function(He){return H(H({},He),{},{position:H(H({},He.position),{},{offset:He.position.offset-$e/2})})}))}var Oe=B&&B.type&&B.type.getComposedData;Oe&&M.push({props:H(H({},Oe(H(H({},_e),{},{displayedData:J,props:g,dataKey:Q,item:B,bandSize:Pe,barPosition:he,offset:b,stackedData:pe,layout:R,dataStartIndex:O,dataEndIndex:k}))),{},ye(ye(ye({key:B.key||"item-".concat(W)},L,_e[L]),z,_e[z]),"animationId",_)),childIndex:U6(B,g.children),item:B})}),M},h=function(g,m){var w=g.props,S=g.dataStartIndex,b=g.dataEndIndex,_=g.updateId;if(!Iw({props:w}))return null;var O=w.children,k=w.layout,P=w.stackOffset,R=w.data,$=w.reverseStackOrder,C=pj(k),I=C.numericAxisName,D=C.cateAxisName,L=Yr(O,n),z=JZ(R,L,"".concat(I,"Id"),"".concat(D,"Id"),P,$),U=l.reduce(function(G,Q){var X="".concat(Q.axisType,"Map");return H(H({},G),{},ye({},X,Doe(w,H(H({},Q),{},{graphicalItems:L,stackGroups:Q.axisType===I&&z,dataStartIndex:S,dataEndIndex:b}))))},{}),M=Foe(H(H({},U),{},{props:w,graphicalItems:L}),m==null?void 0:m.legendBBox);Object.keys(U).forEach(function(G){U[G]=f(w,U[G],M,G.replace("Map",""),r)});var B=U["".concat(D,"Map")],W=Loe(B),J=p(w,H(H({},U),{},{dataStartIndex:S,dataEndIndex:b,updateId:_,graphicalItems:L,stackGroups:z,offset:M}));return H(H({formattedGraphicalItems:J,graphicalItems:L,offset:M,stackGroups:z},W),U)},x=function(y){function g(m){var w,S,b;return boe(this,g),b=Soe(this,g,[m]),ye(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ye(b,"accessibilityManager",new ooe),ye(b,"handleLegendBBoxUpdate",function(_){if(_){var O=b.state,k=O.dataStartIndex,P=O.dataEndIndex,R=O.updateId;b.setState(H({legendBBox:_},h({props:b.props,dataStartIndex:k,dataEndIndex:P,updateId:R},H(H({},b.state),{},{legendBBox:_}))))}}),ye(b,"handleReceiveSyncEvent",function(_,O,k){if(b.props.syncId===_){if(k===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(O)}}),ye(b,"handleBrushChange",function(_){var O=_.startIndex,k=_.endIndex;if(O!==b.state.dataStartIndex||k!==b.state.dataEndIndex){var P=b.state.updateId;b.setState(function(){return H({dataStartIndex:O,dataEndIndex:k},h({props:b.props,dataStartIndex:O,dataEndIndex:k,updateId:P},b.state))}),b.triggerSyncEvent({dataStartIndex:O,dataEndIndex:k})}}),ye(b,"handleMouseEnter",function(_){var O=b.getMouseInfo(_);if(O){var k=H(H({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var P=b.props.onMouseEnter;we(P)&&P(k,_)}}),ye(b,"triggeredAfterMouseMove",function(_){var O=b.getMouseInfo(_),k=O?H(H({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(k),b.triggerSyncEvent(k);var P=b.props.onMouseMove;we(P)&&P(k,_)}),ye(b,"handleItemMouseEnter",function(_){b.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),ye(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),ye(b,"handleMouseMove",function(_){_.persist(),b.throttleTriggeredAfterMouseMove(_)}),ye(b,"handleMouseLeave",function(_){b.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};b.setState(O),b.triggerSyncEvent(O);var k=b.props.onMouseLeave;we(k)&&k(O,_)}),ye(b,"handleOuterEvent",function(_){var O=z6(_),k=$r(b.props,"".concat(O));if(O&&we(k)){var P,R;/.*touch.*/i.test(O)?R=b.getMouseInfo(_.changedTouches[0]):R=b.getMouseInfo(_),k((P=R)!==null&&P!==void 0?P:{},_)}}),ye(b,"handleClick",function(_){var O=b.getMouseInfo(_);if(O){var k=H(H({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var P=b.props.onClick;we(P)&&P(k,_)}}),ye(b,"handleMouseDown",function(_){var O=b.props.onMouseDown;if(we(O)){var k=b.getMouseInfo(_);O(k,_)}}),ye(b,"handleMouseUp",function(_){var O=b.props.onMouseUp;if(we(O)){var k=b.getMouseInfo(_);O(k,_)}}),ye(b,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),ye(b,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseDown(_.changedTouches[0])}),ye(b,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseUp(_.changedTouches[0])}),ye(b,"handleDoubleClick",function(_){var O=b.props.onDoubleClick;if(we(O)){var k=b.getMouseInfo(_);O(k,_)}}),ye(b,"handleContextMenu",function(_){var O=b.props.onContextMenu;if(we(O)){var k=b.getMouseInfo(_);O(k,_)}}),ye(b,"triggerSyncEvent",function(_){b.props.syncId!==void 0&&Xm.emit(Ym,b.props.syncId,_,b.eventEmitterSymbol)}),ye(b,"applySyncEvent",function(_){var O=b.props,k=O.layout,P=O.syncMethod,R=b.state.updateId,$=_.dataStartIndex,C=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)b.setState(H({dataStartIndex:$,dataEndIndex:C},h({props:b.props,dataStartIndex:$,dataEndIndex:C,updateId:R},b.state)));else if(_.activeTooltipIndex!==void 0){var I=_.chartX,D=_.chartY,L=_.activeTooltipIndex,z=b.state,U=z.offset,M=z.tooltipTicks;if(!U)return;if(typeof P=="function")L=P(M,_);else if(P==="value"){L=-1;for(var B=0;B=0){var pe,K;if(I.dataKey&&!I.allowDuplicatedCategory){var Pe=typeof I.dataKey=="function"?re:"payload.".concat(I.dataKey.toString());pe=by(B,Pe,L),K=W&&J&&by(J,Pe,L)}else pe=B==null?void 0:B[D],K=W&&J&&J[D];if(ue||de){var he=_.props.activeIndex!==void 0?_.props.activeIndex:D;return[j.cloneElement(_,H(H(H({},P.props),_e),{},{activeIndex:he})),null,null]}if(!Ee(pe))return[te].concat(_s(b.renderActivePoints({item:P,activePoint:pe,basePoint:K,childIndex:D,isRange:W})))}else{var Me,Be=(Me=b.getItemByXY(b.state.activeCoordinate))!==null&&Me!==void 0?Me:{graphicalItem:te},ve=Be.graphicalItem,Ae=ve.item,$e=Ae===void 0?_:Ae,Oe=ve.childIndex,He=H(H(H({},P.props),_e),{},{activeIndex:Oe});return[j.cloneElement($e,He),null,null]}return W?[te,null,null]:[te,null]}),ye(b,"renderCustomized",function(_,O,k){return j.cloneElement(_,H(H({key:"recharts-customized-".concat(k)},b.props),b.state))}),ye(b,"renderMap",{CartesianGrid:{handler:ef,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:ef},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:ef},YAxis:{handler:ef},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((w=m.id)!==null&&w!==void 0?w:cc("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=iP(b.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),b.state={},b}return Aoe(g,y),_oe(g,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,b=w.data,_=w.height,O=w.layout,k=Er(S,Pr);if(k){var P=k.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var R=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,$=Gg(this.state,b,P,R),C=this.state.tooltipTicks[P].coordinate,I=(this.state.offset.top+_)/2,D=O==="horizontal",L=D?{x:C,y:I}:{y:C,x:I},z=this.state.formattedGraphicalItems.find(function(M){var B=M.item;return B.type.name==="Scatter"});z&&(L=H(H({},L),z.props.points[P].tooltipPosition),$=z.props.points[P].tooltipPayload);var U={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:R,activePayload:$,activeCoordinate:L};this.setState(U),this.renderCursor(k),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var b,_;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){_y([Er(w.children,Pr)],[Er(this.props.children,Pr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Er(this.props.children,Pr);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,b=S.getBoundingClientRect(),_=mK(b),O={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},k=b.width/S.offsetWidth||1,P=this.inRange(O.chartX,O.chartY,k);if(!P)return null;var R=this.state,$=R.xAxisMap,C=R.yAxisMap,I=this.getTooltipEventType(),D=fj(this.state,this.props.data,this.props.layout,P);if(I!=="axis"&&$&&C){var L=so($).scale,z=so(C).scale,U=L&&L.invert?L.invert(O.chartX):null,M=z&&z.invert?z.invert(O.chartY):null;return H(H({},O),{},{xValue:U,yValue:M},D)}return D?H(H({},O),D):null}},{key:"inRange",value:function(w,S){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,O=w/b,k=S/b;if(_==="horizontal"||_==="vertical"){var P=this.state.offset,R=O>=P.left&&O<=P.left+P.width&&k>=P.top&&k<=P.top+P.height;return R?{x:O,y:k}:null}var $=this.state,C=$.angleAxisMap,I=$.radiusAxisMap;if(C&&I){var D=so(C);return WS({x:O,y:k},D)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),b=Er(w,Pr),_={};b&&S==="axis"&&(b.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=rd(this.props,this.handleOuterEvent);return H(H({},O),_)}},{key:"addListener",value:function(){Xm.on(Ym,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Xm.removeListener(Ym,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,b){for(var _=this.state.formattedGraphicalItems,O=0,k=_.length;Oft(`/routing/list/active/${e}`)),n=t==null?void 0:t.find($=>{var C;return((C=$.algorithm_data||$.algorithm)==null?void 0:C.type)==="volume_split"}),[i,a]=j.useState([{id:hl(),name:"",split:50},{id:hl(),name:"",split:50}]),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,c]=j.useState(null),[p,h]=j.useState(null),[x,v]=j.useState(!1),[y,g]=j.useState(new Set),m=i.reduce(($,C)=>$+C.split,0);function w($,C,I){a(D=>D.map(L=>L.id===$?{...L,[C]:I}:L))}function S(){a($=>[...$,{id:hl(),name:"",split:0}])}function b($){a(C=>C.filter(I=>I.id!==$))}async function _(){if(!e)return c("Set a merchant ID first");if(!o.trim())return c("Enter a rule name");if(m!==100)return c(`Splits must sum to 100 (currently ${m})`);if(i.some($=>!$.name.trim()))return c("All gateways must have names");u(!0),c(null),h(null);try{await ft("/routing/create",{rule_id:null,name:o,description:"",created_by:e,algorithm_for:"payment",metadata:null,algorithm:{type:"volume_split",data:i.map($=>({split:$.split,output:{gateway_name:$.name.trim(),gateway_id:null}}))}}),h(`Rule "${o}" created successfully. Find it in the list below to activate.`),r(),s(""),a([{id:hl(),name:"",split:50},{id:hl(),name:"",split:50}])}catch($){c($ instanceof Error?$.message:"Failed to create rule")}finally{u(!1)}}async function O($){if(e)try{await ft("/routing/activate",{created_by:e,routing_algorithm_id:$}),r(),h("Rule activated.")}catch(C){c(C instanceof Error?C.message:"Failed to activate")}}function k($){g(C=>{const I=new Set(C);return I.has($)?I.delete($):I.add($),I})}const P=n?n.algorithm_data||n.algorithm:null,R=P&&"data"in P?P.data.map($=>{var C;return{name:((C=$.output)==null?void 0:C.gateway_name)??"?",value:$.split}}):[];return d.jsxs("div",{className:"space-y-6 max-w-4xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Volume Split Routing"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Distribute payment traffic across gateways by percentage."})]}),n&&d.jsxs(Ce,{children:[d.jsxs(et,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Volume Split"}),d.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n.name})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Qt,{variant:"green",children:"Active"}),d.jsxs(ht,{type:"button",variant:"ghost",size:"sm",onClick:()=>v(!x),children:[d.jsx(_p,{size:14,className:"mr-1"}),x?"Hide":"View"]})]})]}),x&&d.jsxs(Te,{children:[d.jsx(mf,{width:"100%",height:220,children:d.jsxs(AT,{children:[d.jsx(Dn,{data:R,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:$,value:C})=>`${$}: ${C}%`,labelLine:{stroke:"#45454f"},children:R.map(($,C)=>d.jsx(Ca,{fill:mj[C%mj.length]},C))}),d.jsx(Pr,{formatter:$=>`${$}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),d.jsx(Pa,{wrapperStyle:{color:"#8e8ea0"}})]})}),d.jsxs("div",{className:"mt-4 text-xs text-slate-600",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"Rule ID:"})," ",n.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",n.created_at?new Date(n.created_at).toLocaleString():"Unknown"]})]})]})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"Create Volume Split Rule"})}),d.jsxs(Te,{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Rule Name"}),d.jsx("input",{value:o,onChange:$=>s($.target.value),placeholder:"e.g. ab-test-split",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 text-xs font-medium text-slate-500 px-1",children:[d.jsx("span",{children:"Gateway Name"}),d.jsx("span",{children:"Split %"}),d.jsx("span",{})]}),i.map($=>d.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 items-center",children:[d.jsx("input",{value:$.name,onChange:C=>w($.id,"name",C.target.value),placeholder:"e.g. stripe",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{type:"number",min:0,max:100,value:$.split,onChange:C=>w($.id,"split",Number(C.target.value)),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>b($.id),className:"text-slate-400 hover:text-red-500",children:d.jsx(ai,{size:15})})]},$.id)),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-sm text-brand-500 hover:text-brand-600",children:[d.jsx(Xi,{size:14})," Add Gateway"]}),d.jsxs("span",{className:`text-xs font-medium ${m===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",m,"%",m!==100&&" (must be 100)"]})]})]}),d.jsx(Zn,{error:f}),p&&d.jsx("p",{className:"text-sm text-emerald-400",children:p}),d.jsx(ht,{onClick:_,disabled:l||!e,children:l?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Creating…"]}):"Create Rule"})]})]}),d.jsx(Voe,{merchantId:e,onActivate:O,expandedRuleIds:y,onToggleExpand:k})]})}function Voe({merchantId:e,onActivate:t,expandedRuleIds:r,onToggleExpand:n}){const{data:i,isLoading:a}=vn(e?["routing-list",e]:null,()=>ft(`/routing/list/${e}`)),o=(i==null?void 0:i.filter(s=>{var l;return((l=s.algorithm_data||s.algorithm)==null?void 0:l.type)==="volume_split"}))??[];return e?a?d.jsx("div",{className:"flex justify-center py-4",children:d.jsx(kn,{})}):o.length?d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"Saved Volume Split Rules"})}),d.jsx(Te,{className:"p-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 uppercase tracking-wider",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2",children:"Name"}),d.jsx("th",{className:"text-left px-4 py-2",children:"Split"}),d.jsx("th",{className:"px-4 py-2"})]})}),d.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:o.map(s=>{const l=s.algorithm_data||s.algorithm,u=(l==null?void 0:l.data)||[],f=r.has(s.id);return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[d.jsx("td",{className:"px-4 py-2 font-medium text-slate-800",children:s.name}),d.jsx("td",{className:"px-4 py-2 text-slate-600 text-xs",children:u.map(c=>{var p;return`${(p=c.output)==null?void 0:p.gateway_name}:${c.split}%`}).join(" | ")}),d.jsx("td",{className:"px-4 py-2 text-right",children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsxs(ht,{size:"sm",variant:"ghost",onClick:()=>n(s.id),children:[d.jsx(_p,{size:14,className:"mr-1"}),f?"Hide":"View"]}),d.jsx(ht,{size:"sm",variant:"secondary",onClick:()=>t(s.id),children:"Activate"})]})})]},s.id),f&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:d.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"ID:"})," ",s.id]}),d.jsxs("p",{children:[d.jsx("strong",{children:"Description:"})," ",s.description||"N/A"]}),s.created_at&&d.jsxs("p",{children:[d.jsx("strong",{children:"Created:"})," ",new Date(s.created_at).toLocaleString()]}),d.jsxs("div",{children:[d.jsx("strong",{children:"Configuration:"}),d.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(l,null,2)})]})]})})})]})})})]})})]}):null:null}function Woe(){var m;const{merchantId:e}=na(),{data:t,mutate:r,isLoading:n}=vn(e?["rule-debit",e]:null,()=>ft("/rule/get",{merchant_id:e,config:{type:"debitRouting"}})),[i,a]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,c]=j.useState(null),[p,h]=j.useState(null),x=(m=t==null?void 0:t.config)==null?void 0:m.data,v=i||(x==null?void 0:x.merchant_category_code)||"",y=o||(x==null?void 0:x.acquirer_country)||"";async function g(){if(!e)return c("Set a merchant ID first");const w={merchant_id:e,config:{type:"debitRouting",data:{merchant_category_code:v.trim(),acquirer_country:y.trim()}}};u(!0),c(null);try{await ft(t?"/rule/update":"/rule/create",w),h("Debit routing config saved."),r()}catch(S){c(S instanceof Error?S.message:"Failed to save")}finally{u(!1)}}return d.jsxs("div",{className:"space-y-6 max-w-2xl",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Network / Debit Routing"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Configure network-based routing to optimise processing fees for debit card transactions. The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR)."})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Lk,{size:16,className:"text-brand-500"}),d.jsx("h2",{className:"font-medium text-slate-800",children:"Debit Routing Configuration"})]})}),d.jsx(Te,{className:"space-y-4",children:n?d.jsx("div",{className:"flex justify-center py-6",children:d.jsx(kn,{})}):d.jsxs(d.Fragment,{children:[!e&&d.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar to load configuration."}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Merchant Category Code (MCC)"}),d.jsx("input",{value:v,onChange:w=>a(w.target.value),placeholder:"e.g. 5411",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"4-digit ISO MCC for your business type"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Acquirer Country"}),d.jsx("input",{value:y,onChange:w=>s(w.target.value),placeholder:"e.g. US",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"ISO 3166-1 alpha-2 country code"})]})]}),d.jsx(Zn,{error:f}),p&&d.jsx("p",{className:"text-sm text-emerald-400",children:p}),d.jsx(ht,{onClick:g,disabled:l||!e,children:l?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Saving…"]}):t?"Update Config":"Save Config"})]})})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:"How Network Routing Works"})}),d.jsxs(Te,{className:"text-sm text-slate-600 space-y-2",children:[d.jsx("p",{children:"For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee."}),d.jsxs("p",{children:["Supported networks: ",["VISA","MASTERCARD","ACCEL","NYCE","PULSE","STAR"].map(w=>d.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md mr-1 text-slate-700",children:w},w))]}),d.jsxs("p",{children:["Use the ",d.jsx("strong",{className:"text-slate-800",children:"Decision Explorer"})," to test network routing decisions with ",d.jsx("code",{className:"text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md text-brand-500",children:"NtwBasedRouting"})," algorithm."]})]})]})]})}const Hoe=["SR_BASED_ROUTING","PL_BASED_ROUTING","NTW_BASED_ROUTING"],Goe={SR_BASED_ROUTING:"Success Rate Based",PL_BASED_ROUTING:"Priority List Based",NTW_BASED_ROUTING:"Network Based"};function Koe(e){for(const[t,r]of Object.entries(QD))if(e.includes(t)||t.includes(e))return r;return"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8"}const dr=["#0069ED","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function yf(e=[]){return e.map(t=>t.trim()).filter(Boolean).map(t=>t.toUpperCase())}function Qm(e=[]){return Array.from(new Set(yf(e)))}function Jm(e){return e==="enum"?"enum_variant":e==="integer"?"number":e==="udf"||e==="global_ref"?"metadata_variant":"str_value"}function qoe(){const{merchantId:e}=na(),{routingKeysConfig:t,isLoading:r,error:n}=zE(),i=Object.keys(t).length>0,a=!r&&(!i||!!n),[o,s]=j.useState("single"),[l,u]=j.useState({amount:"1000",currency:"",payment_method_type:"",payment_method:"",card_brand:"",auth_type:"",eligible_gateways:"stripe, adyen",ranking_algorithm:"SR_BASED_ROUTING",elimination_enabled:!1}),[f,c]=j.useState({totalPayments:"10",successCount:"7",failureCount:"3"}),[p,h]=j.useState([{key:"payment_method_type",type:"enum_variant",value:"",metadataKey:""},{key:"currency",type:"enum_variant",value:"",metadataKey:""}]),[x,v]=j.useState([{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}]),[y,g]=j.useState("100"),[m,w]=j.useState(null),[S,b]=j.useState(null),[_,O]=j.useState([]),[k,P]=j.useState([]),[R,$]=j.useState(!1),[C,I]=j.useState(null),[D,L]=j.useState(!1),[z,U]=j.useState(!1),[M,B]=j.useState(!1),[W,J]=j.useState(!1),G=j.useMemo(()=>Object.keys(t).sort(),[t]),Q=j.useMemo(()=>{var A;return yf(((A=t.payment_method)==null?void 0:A.values)||[])},[t]),X=j.useMemo(()=>{var E;const A=l.payment_method_type.toLowerCase();return yf(((E=t[A])==null?void 0:E.values)||[])},[l.payment_method_type,t]),de=j.useMemo(()=>{var A;return Qm(((A=t.currency)==null?void 0:A.values)||[])},[t]),ue=j.useMemo(()=>{var A;return Qm(((A=t.card_network)==null?void 0:A.values)||[])},[t]),Se=j.useMemo(()=>{var A;return Qm(((A=t.authentication_type)==null?void 0:A.values)||[])},[t]);j.useEffect(()=>{a||r||(u(A=>{var V;const E={...A};de.length>0&&!de.includes(E.currency)&&(E.currency=de[0]),Q.length>0&&!Q.includes(E.payment_method_type)&&(E.payment_method_type=Q[0]);const F=yf(((V=t[E.payment_method_type.toLowerCase()])==null?void 0:V.values)||[]);return F.length>0&&!F.includes(E.payment_method)&&(E.payment_method=F[0]),Se.length>0&&!Se.includes(E.auth_type)&&(E.auth_type=Se[0]),ue.length>0&&!ue.includes(E.card_brand)&&(E.card_brand=ue[0]),E}),h(A=>A.map(E=>{if(!E.key||!t[E.key])return E;const F=t[E.key],V=Jm(F.type),q=F.values||[],Y=V==="enum_variant"?q.includes(E.value)?E.value:q[0]||"":E.value;return{...E,type:V,value:Y}})))},[a,r,t,de,Q,Se,ue]);function _e(A,E){u(F=>({...F,[A]:E}))}function te(){var q;if(G.length===0)return;const A=G[0],E=t[A],F=Jm(E==null?void 0:E.type),V=F==="enum_variant"&&((q=E==null?void 0:E.values)==null?void 0:q[0])||"";h([...p,{key:A,type:F,value:V,metadataKey:""}])}function re(A){h(p.filter((E,F)=>F!==A))}function pe(A,E,F){h(p.map((V,q)=>q===A?{...V,[E]:F}:V))}function K(A,E){h(p.map((F,V)=>V===A?{...F,metadataKey:E}:F))}function Pe(A,E){var Y;const F=t[E],V=Jm(F==null?void 0:F.type),q=V==="enum_variant"&&((Y=F==null?void 0:F.values)==null?void 0:Y[0])||"";h(p.map((ie,me)=>me===A?{...ie,key:E,type:V,value:q,metadataKey:""}:ie))}function he(){v([...x,{gateway_name:"",gateway_id:""}])}function Me(A){v(x.filter((E,F)=>F!==A))}function Be(A,E,F){v(x.map((V,q)=>q===A?{...V,[E]:F}:V))}async function ve(){if(!e)return I("Set a merchant ID in the top bar");if(a)return I("Routing key config unavailable. Fix /config/routing-keys and retry.");L(!0),I(null);const A=l.eligible_gateways.split(",").map(E=>E.trim()).filter(Boolean);try{const E=await ft("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:`explorer_${Date.now()}`,amount:parseFloat(l.amount)||1e3,currency:l.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:l.payment_method_type,paymentMethod:l.payment_method,authType:l.auth_type,cardBrand:l.card_brand},eligibleGatewayList:A,rankingAlgorithm:l.ranking_algorithm,eliminationEnabled:l.elimination_enabled});w(E)}catch(E){I(E instanceof Error?E.message:"Request failed")}finally{L(!1)}}async function Ae(){if(!e)return I("Set a merchant ID in the top bar");if(a)return I("Routing key config unavailable. Fix /config/routing-keys and retry.");const A=parseInt(f.totalPayments)||0,E=parseInt(f.successCount)||0,F=parseInt(f.failureCount)||0;if(A<=0)return I("Total Payments must be greater than 0");if(E+F!==A)return I("Success + Failure count must equal Total Payments");$(!0),I(null),P([]);const V=l.eligible_gateways.split(",").map(ie=>ie.trim()).filter(Boolean),q=[],Y=[...Array(E).fill("CHARGED"),...Array(F).fill("FAILURE")];for(let ie=Y.length-1;ie>0;ie--){const me=Math.floor(Math.random()*(ie+1));[Y[ie],Y[me]]=[Y[me],Y[ie]]}try{for(let ie=0;ie{F.key&&(F.type==="metadata_variant"?A[F.key]={type:F.type,value:{key:F.metadataKey||F.key,value:F.value}}:F.type==="number"?A[F.key]={type:F.type,value:parseFloat(F.value)||0}:A[F.key]={type:F.type,value:F.value})});const E=await ft("/routing/evaluate",{created_by:e||"test_user",fallback_output:x.filter(F=>F.gateway_name),parameters:A});if(b(E),E.output.type==="volume_split"&&E.output.splits){const F=parseInt(y)||100,V=E.output.splits.map(q=>({name:q.connector.gateway_name,count:Math.round(q.split/100*F),percentage:q.split}));O(V)}}catch(A){I(A instanceof Error?A.message:"Request failed")}finally{L(!1)}}async function Oe(){L(!0),I(null),O([]);try{const A=await ft("/routing/evaluate",{created_by:e||"test_user",fallback_output:[{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}],parameters:{}});if(b(A),A.output.type==="volume_split"&&A.output.splits){const E=parseInt(y)||100,F=A.output.splits.map(V=>({name:V.connector.gateway_name,count:Math.round(V.split/100*E),percentage:V.split}));O(F)}}catch(A){I(A instanceof Error?A.message:"Request failed")}finally{L(!1)}}const He=m!=null&&m.gateway_priority_map?Object.entries(m.gateway_priority_map).sort(([,A],[,E])=>E-A).map(([A,E])=>({name:A,score:Math.round(E*1e3)/10})):[],Ue=k.reduce((A,E)=>(A[E.decidedGateway]||(A[E.decidedGateway]={total:0,success:0,failure:0}),A[E.decidedGateway].total++,E.status==="CHARGED"?A[E.decidedGateway].success++:A[E.decidedGateway].failure++,A),{}),T=_.map(A=>({name:A.name,value:A.count}));return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Decision Explorer"}),d.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split."})]}),d.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-[#1c1c24]",children:[d.jsx("button",{onClick:()=>s("single"),className:`px-4 py-2 text-sm font-medium ${o==="single"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Single Test"}),d.jsx("button",{onClick:()=>s("batch"),className:`px-4 py-2 text-sm font-medium ${o==="batch"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Batch Simulation"}),d.jsx("button",{onClick:()=>s("rule"),className:`px-4 py-2 text-sm font-medium ${o==="rule"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Rule-Based"}),d.jsx("button",{onClick:()=>s("volume"),className:`px-4 py-2 text-sm font-medium ${o==="volume"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Volume Split"})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h2",{className:"font-medium text-slate-800",children:o==="rule"?"Rule Evaluation Parameters":o==="volume"?"Volume Split Configuration":"Payment Parameters"})}),d.jsxs(Te,{className:"space-y-3",children:[!e&&o!=="volume"&&d.jsx("p",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar first."}),o!=="volume"&&r&&d.jsx("p",{className:"text-xs text-slate-600 bg-slate-50 border border-slate-200 rounded px-3 py-2",children:"Loading routing config from backend..."}),o!=="volume"&&a&&d.jsx(Zn,{error:"Routing config unavailable from /config/routing-keys. Parameter forms are disabled."}),o==="rule"?d.jsxs(d.Fragment,{children:[r&&d.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),a&&d.jsx(Zn,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Evaluation is disabled."}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Parameters"}),d.jsx("div",{className:"space-y-2",children:p.map((A,E)=>{var F;return d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("select",{value:A.key,onChange:V=>Pe(E,V.target.value),disabled:a||r,className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:G.length===0?d.jsx("option",{value:"",children:"No keys available"}):G.map(V=>d.jsx("option",{value:V,children:V},V))}),d.jsx("input",{value:A.type,readOnly:!0,className:"w-36 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>re(E),className:"p-1.5 text-slate-400 hover:text-red-500",children:d.jsx(ai,{size:14})})]}),A.type==="metadata_variant"?d.jsxs("div",{className:"flex gap-2 items-center pl-1",children:[d.jsx("input",{placeholder:"Metadata Key",value:A.metadataKey||"",onChange:V=>K(E,V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{placeholder:"Metadata Value",value:A.value,onChange:V=>pe(E,"value",V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}):A.type==="enum_variant"?d.jsx("div",{className:"flex gap-2 items-center pl-1",children:d.jsx("select",{value:A.value,onChange:V=>pe(E,"value",V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(((F=t[A.key])==null?void 0:F.values)||[]).map(V=>d.jsx("option",{value:V,children:V},V))})}):A.type==="number"?d.jsx("div",{className:"flex gap-2 items-center pl-1",children:d.jsx("input",{type:"number",placeholder:"Value",value:A.value,onChange:V=>pe(E,"value",V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})}):d.jsx("div",{className:"flex gap-2 items-center pl-1",children:d.jsx("input",{placeholder:"Value",value:A.value,onChange:V=>pe(E,"value",V.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})})]},E)})}),d.jsxs("button",{onClick:te,disabled:a||r||G.length===0,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[d.jsx(Xi,{size:12})," Add Parameter"]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Fallback gateway_name/gateway_id"}),d.jsx("div",{className:"space-y-2",children:x.map((A,E)=>d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("input",{placeholder:"gateway_name",value:A.gateway_name,onChange:F=>Be(E,"gateway_name",F.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("input",{placeholder:"gateway_id",value:A.gateway_id||"",onChange:F=>Be(E,"gateway_id",F.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("button",{onClick:()=>Me(E),className:"p-1.5 text-slate-400 hover:text-red-500",children:d.jsx(ai,{size:14})})]},E))}),d.jsxs("button",{onClick:he,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[d.jsx(Xi,{size:12})," Add Gateway"]})]})]}):o==="volume"?d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Number of Payments"}),d.jsx("input",{type:"text",value:y,onChange:A=>g(A.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),d.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Enter the total number of payments to visualize how they would be distributed across gateways."})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Amount"}),d.jsx("input",{value:l.amount,onChange:A=>_e("amount",A.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Currency"}),d.jsx("select",{value:l.currency,onChange:A=>_e("currency",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:de.map(A=>d.jsx("option",{children:A},A))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method Type"}),d.jsx("select",{value:l.payment_method_type,onChange:A=>_e("payment_method_type",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Q.map(A=>d.jsx("option",{children:A},A))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method"}),d.jsx("select",{value:l.payment_method,onChange:A=>_e("payment_method",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:X.map(A=>d.jsx("option",{children:A},A))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Card Brand"}),d.jsx("select",{value:l.card_brand,onChange:A=>_e("card_brand",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:ue.map(A=>d.jsx("option",{children:A},A))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Auth Type"}),d.jsx("select",{value:l.auth_type,onChange:A=>_e("auth_type",A.target.value),disabled:a||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Se.map(A=>d.jsx("option",{children:A},A))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Eligible Gateways (comma-separated)"}),d.jsx("input",{value:l.eligible_gateways,onChange:A=>_e("eligible_gateways",A.target.value),placeholder:"stripe, adyen",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Algorithm"}),d.jsx("select",{value:l.ranking_algorithm,onChange:A=>_e("ranking_algorithm",A.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Hoe.map(A=>d.jsx("option",{value:A,children:Goe[A]},A))})]}),d.jsx("div",{className:"flex items-end pb-1",children:d.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:l.elimination_enabled,onChange:A=>_e("elimination_enabled",A.target.checked),className:"rounded"}),"Elimination enabled"]})})]}),o==="batch"&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-4 mt-4 space-y-3",children:[d.jsxs("h3",{className:"text-sm font-medium text-slate-800 flex items-center gap-2",children:[d.jsx(Jh,{size:14}),"Simulation Configuration"]}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Total Payments"}),d.jsx("input",{type:"text",value:f.totalPayments,onChange:A=>c(E=>({...E,totalPayments:A.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Success Count"}),d.jsx("input",{type:"text",value:f.successCount,onChange:A=>c(E=>({...E,successCount:A.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Failure Count"}),d.jsx("input",{type:"text",value:f.failureCount,onChange:A=>c(E=>({...E,failureCount:A.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),d.jsxs("p",{className:"text-xs text-slate-500",children:["Will run ",f.totalPayments||0," payments: ",f.successCount||0," SUCCESS, ",f.failureCount||0," FAILURE"]})]})]}),d.jsx(Zn,{error:C}),o==="rule"?d.jsx(ht,{onClick:$e,disabled:D||a,className:"w-full justify-center",children:D?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Evaluating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Mc,{size:14})," Evaluate Rules"]})}):o==="volume"?d.jsx(ht,{onClick:Oe,disabled:D,className:"w-full justify-center",children:D?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Calculating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Wf,{size:14})," Visualize Distribution"]})}):o==="batch"?d.jsx(ht,{onClick:Ae,disabled:R||!e||a,className:"w-full justify-center",children:R?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14}),"Simulating ",k.length,"/",f.totalPayments||0,"..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Jh,{size:14})," Run Batch Simulation"]})}):d.jsx(ht,{onClick:ve,disabled:D||!e||a,className:"w-full justify-center",children:D?d.jsxs(d.Fragment,{children:[d.jsx(kn,{size:14})," Running…"]}):d.jsxs(d.Fragment,{children:[d.jsx(Mc,{size:14})," Run Decision"]})})]})]}),d.jsx("div",{className:"space-y-4",children:o==="volume"?_.length>0?d.jsxs(d.Fragment,{children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Volume Distribution Overview"})}),d.jsxs(Te,{children:[d.jsxs("div",{className:"text-center mb-4",children:[d.jsx("p",{className:"text-3xl font-bold text-slate-900",children:y}),d.jsx("p",{className:"text-xs text-slate-500",children:"Total Payments"})]}),d.jsx("div",{className:"grid grid-cols-2 gap-4",children:_.map((A,E)=>d.jsxs("div",{className:"bg-slate-50 dark:bg-[#111114] rounded-lg p-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:dr[E%dr.length]}}),d.jsx("span",{className:"font-medium text-sm",children:A.name})]}),d.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[d.jsxs("span",{children:[A.percentage,"%"]}),d.jsxs("span",{className:"font-medium text-slate-700",children:[A.count," payments"]})]})]},E))})]})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Pie Chart"})}),d.jsx(Te,{children:d.jsx(mf,{width:"100%",height:250,children:d.jsxs(AT,{children:[d.jsx(Dn,{data:T,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:A,percent:E})=>`${A} ${(E*100).toFixed(0)}%`,labelLine:!1,children:T.map((A,E)=>d.jsx(Ca,{fill:dr[E%dr.length]},`cell-${E}`))}),d.jsx(Pr,{formatter:A=>[`${A} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}})]})})})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Bar Chart"})}),d.jsx(Te,{children:d.jsx(mf,{width:"100%",height:_.length*50+40,children:d.jsxs(hj,{data:_,layout:"vertical",margin:{left:20,right:40},children:[d.jsx(qu,{type:"number",tick:{fontSize:12,fill:"#666"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),d.jsx(Xu,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#666"},width:80,axisLine:!1,tickLine:!1}),d.jsx(Pr,{formatter:A=>[`${A} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}}),d.jsx(Ji,{dataKey:"count",radius:[0,6,6,0],children:_.map((A,E)=>d.jsx(Ca,{fill:dr[E%dr.length]},`cell-${E}`))})]})})})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Percentage Distribution"})}),d.jsxs(Te,{children:[d.jsx("div",{className:"h-4 rounded-full overflow-hidden flex",children:_.map((A,E)=>d.jsx("div",{style:{width:`${A.percentage}%`,backgroundColor:dr[E%dr.length]},className:"h-full transition-all duration-300",title:`${A.name}: ${A.percentage}%`},E))}),d.jsx("div",{className:"flex flex-wrap gap-3 mt-3",children:_.map((A,E)=>d.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[d.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:dr[E%dr.length]}}),d.jsx("span",{className:"text-slate-600",children:A.name}),d.jsxs("span",{className:"font-medium",children:[A.percentage,"%"]})]},E))})]})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Summary"})}),d.jsx(Te,{className:"p-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"}),d.jsx("th",{className:"text-right px-4 py-2",children:"Payments"}),d.jsx("th",{className:"text-right px-4 py-2",children:"Percentage"})]})}),d.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:[_.map((A,E)=>d.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[d.jsx("td",{className:"px-4 py-2",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:dr[E%dr.length]}}),d.jsx("span",{className:"font-medium",children:A.name})]})}),d.jsx("td",{className:"px-4 py-2 text-right font-medium",children:A.count}),d.jsxs("td",{className:"px-4 py-2 text-right text-slate-500",children:[A.percentage,"%"]})]},E)),d.jsxs("tr",{className:"bg-slate-50 dark:bg-[#111114] font-medium",children:[d.jsx("td",{className:"px-4 py-2",children:"Total"}),d.jsx("td",{className:"px-4 py-2 text-right",children:y}),d.jsx("td",{className:"px-4 py-2 text-right",children:"100%"})]})]})]})})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Payment Log"})}),d.jsx(Te,{className:"p-0 max-h-80 overflow-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500 sticky top-0",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-4 py-2 w-20",children:"#"}),d.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"})]})}),d.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:Array.from({length:parseInt(y)||0}).map((A,E)=>{var Y;let F=0,V=((Y=_[0])==null?void 0:Y.name)||"",q=0;for(let ie=0;ie<_.length;ie++)if(F+=_[ie].count,EJ(A=>!A),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(em,{size:14}),"API Response"]}),W?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),W&&S&&d.jsx(Te,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(S,null,2)})})]})]}):d.jsx(Ce,{children:d.jsxs(Te,{className:"py-16 text-center",children:[d.jsx(Wf,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Enter the number of payments and click "Visualize Distribution" to see how payments are split across gateways.'})]})}):o==="rule"?S?d.jsxs(d.Fragment,{children:[d.jsx(Ce,{children:d.jsxs(Te,{children:[d.jsx("div",{className:"flex items-start justify-between mb-3",children:d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Status"}),d.jsx("p",{className:"text-2xl font-bold text-slate-900",children:S.status}),d.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["output_type: ",S.output.type]})]})}),S.output.type==="single"&&S.output.connector&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Selected gateway_name"}),d.jsx("p",{className:"text-lg font-semibold",children:S.output.connector.gateway_name}),S.output.connector.gateway_id&&d.jsxs("p",{className:"text-xs text-slate-500",children:["gateway_id: ",S.output.connector.gateway_id]})]}),S.output.type==="priority"&&S.output.connectors&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Priority gateway_name list"}),d.jsx("div",{className:"space-y-1",children:S.output.connectors.map((A,E)=>d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-500 text-white text-xs flex items-center justify-center",children:E+1}),d.jsx("span",{className:"font-medium",children:A.gateway_name}),A.gateway_id&&d.jsxs("span",{className:"text-xs text-slate-500",children:["(",A.gateway_id,")"]})]},E))})]}),S.output.type==="volume_split"&&d.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Volume Split Result"}),d.jsx("p",{className:"text-sm text-slate-600",children:"See Volume Split tab for detailed visualization."})]})]})}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>B(A=>!A),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(em,{size:14}),"API Response"]}),M?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),M&&d.jsx(Te,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(S,null,2)})})]})]}):d.jsx(Ce,{children:d.jsxs(Te,{className:"py-16 text-center",children:[d.jsx(Mc,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Configure rule parameters and click "Evaluate Rules" to test routing.'})]})}):o==="batch"?k.length>0?d.jsxs(d.Fragment,{children:[d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Simulation Progress"})}),d.jsxs(Te,{children:[d.jsxs("div",{className:"mb-4",children:[d.jsxs("div",{className:"flex justify-between text-xs text-slate-600 mb-1",children:[d.jsx("span",{children:"Progress"}),d.jsxs("span",{children:[Math.round(k.length/(parseInt(f.totalPayments)||1)*100),"%"]})]}),d.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:d.jsx("div",{className:"bg-brand-500 h-2 rounded-full transition-all duration-300",style:{width:`${k.length/(parseInt(f.totalPayments)||1)*100}%`}})})]}),Object.keys(Ue).length>0&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-xs font-medium text-slate-700",children:"Gateway Selection Summary"}),Object.entries(Ue).map(([A,E])=>d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"font-medium",children:A}),d.jsxs("div",{className:"flex gap-3 text-xs",children:[d.jsxs("span",{className:"text-emerald-600",children:[E.success," ✓"]}),d.jsxs("span",{className:"text-red-500",children:[E.failure," ✗"]}),d.jsxs("span",{className:"text-slate-500",children:["(",E.total," total)"]})]})]},A))]})]})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Transaction Log"})}),d.jsx(Te,{className:"p-0 max-h-96 overflow-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 sticky top-0",children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left px-3 py-2",children:"#"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Payment ID"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Gateway"}),d.jsx("th",{className:"text-left px-3 py-2",children:"Outcome"})]})}),d.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:k.map((A,E)=>d.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16]",children:[d.jsx("td",{className:"px-3 py-2 text-slate-500",children:E+1}),d.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:A.paymentId.slice(-8)}),d.jsx("td",{className:"px-3 py-2 font-medium",children:A.decidedGateway}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(Qt,{variant:A.status==="CHARGED"?"green":"red",children:A.status})})]},A.paymentId))})]})})]})]}):d.jsx(Ce,{children:d.jsxs(Te,{className:"py-16 text-center",children:[d.jsx(Jh,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.'})]})}):m?d.jsxs(d.Fragment,{children:[d.jsx(Ce,{children:d.jsxs(Te,{children:[d.jsxs("div",{className:"flex items-start justify-between mb-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Decided Gateway"}),d.jsx("p",{className:"text-3xl font-bold text-slate-900",children:m.decided_gateway})]}),d.jsxs("div",{className:"text-right space-y-1",children:[d.jsx("div",{children:d.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Koe(m.routing_approach)}`,children:m.routing_approach})}),m.is_scheduled_outage&&d.jsx(Qt,{variant:"red",children:"Scheduled Outage"}),m.latency!=null&&d.jsxs("p",{className:"text-xs text-slate-400",children:[m.latency,"ms"]})]})]}),m.routing_dimension&&d.jsxs("div",{className:"flex gap-4 text-sm text-slate-600 border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Dimension"}),d.jsx("p",{className:"font-medium",children:m.routing_dimension})]}),m.routing_dimension_level&&d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Level"}),d.jsx("p",{className:"font-medium",children:m.routing_dimension_level})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-slate-400",children:"Reset"}),d.jsx("p",{className:"font-medium",children:m.reset_approach})]})]})]})}),He.length>0&&d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Scores"}),d.jsxs(ht,{size:"sm",variant:"ghost",onClick:ve,className:"text-xs",children:[d.jsx(AI,{size:12})," Refresh"]})]})}),d.jsx(Te,{children:d.jsx(mf,{width:"100%",height:He.length*40+20,children:d.jsxs(hj,{data:He,layout:"vertical",margin:{left:10,right:30},children:[d.jsx(qu,{type:"number",domain:[0,100],tickFormatter:A=>`${A}%`,tick:{fontSize:11,fill:"#66667a"},axisLine:{stroke:"#1c1c24"},tickLine:!1}),d.jsx(Xu,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#8e8ea0"},width:60,axisLine:!1,tickLine:!1}),d.jsx(Pr,{formatter:A=>`${A}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),d.jsx(Ji,{dataKey:"score",radius:[0,4,4,0],children:He.map((A,E)=>d.jsx(Ca,{fill:A.name===m.decided_gateway?"#0069ED":A.score<30?"#ef4444":A.score<60?"#f59e0b":"#10b981"},E))})]})})})]}),m.filter_wise_gateways&&d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>U(A=>!A),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:["Filter Chain",z?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),z&&d.jsx(Te,{className:"space-y-2",children:Object.entries(m.filter_wise_gateways).map(([A,E])=>d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("span",{className:"text-xs font-mono bg-slate-100 dark:bg-[#111118] text-slate-600 rounded-md px-2 py-0.5 mt-0.5 shrink-0 border border-slate-200 dark:border-[#1c1c24]",children:A}),d.jsx("div",{className:"flex flex-wrap gap-1",children:Array.isArray(E)?E.map(F=>d.jsx("span",{className:"text-xs bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20 rounded-md px-2 py-0.5",children:F},F)):d.jsx("span",{className:"text-xs text-slate-400",children:"—"})})]},A))})]}),d.jsxs(Ce,{children:[d.jsx(et,{children:d.jsxs("button",{onClick:()=>B(A=>!A),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(em,{size:14}),"API Response"]}),M?d.jsx(bl,{size:14}):d.jsx(xl,{size:14})]})}),M&&d.jsx(Te,{className:"p-0",children:d.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(m,null,2)})})]})]}):d.jsx(Ce,{children:d.jsxs(Te,{className:"py-16 text-center",children:[d.jsx(Mc,{size:32,className:"text-gray-300 mx-auto mb-3"}),d.jsx("p",{className:"text-slate-400 text-sm",children:'Fill in the parameters and click "Run Decision" to see the routing result.'})]})})})]})]})}function Xoe(){return d.jsx(XR,{children:d.jsxs(_n,{element:d.jsx(hM,{}),children:[d.jsx(_n,{index:!0,element:d.jsx(KM,{})}),d.jsx(_n,{path:"routing",element:d.jsx(qM,{})}),d.jsx(_n,{path:"routing/sr",element:d.jsx(nL,{})}),d.jsx(_n,{path:"routing/rules",element:d.jsx(Z4,{})}),d.jsx(_n,{path:"routing/volume",element:d.jsx(Uoe,{})}),d.jsx(_n,{path:"routing/debit",element:d.jsx(Woe,{})}),d.jsx(_n,{path:"decisions",element:d.jsx(qoe,{})}),d.jsx(_n,{path:"*",element:d.jsx(GR,{to:".",replace:!0})})]})})}class Yoe extends j.Component{constructor(){super(...arguments);ub(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(r){return{error:r,errorInfo:null}}componentDidCatch(r,n){console.log(` -`+"!".repeat(80)),console.log("[ERROR BOUNDARY] Component Error Caught"),console.log(`Timestamp: ${new Date().toISOString()}`),console.log("Error Message:",r.message),console.log("Error Stack:",r.stack),console.log("Component Stack:",n.componentStack),console.log("!".repeat(80)+` -`),this.setState({errorInfo:n})}render(){return this.state.error?d.jsxs("div",{style:{padding:32,fontFamily:"monospace",color:"red"},children:[d.jsx("h2",{children:"Dashboard Error"}),d.jsx("pre",{children:this.state.error.message}),d.jsx("pre",{children:this.state.error.stack}),this.state.errorInfo&&d.jsxs("pre",{style:{marginTop:16,color:"darkred"},children:["Component Stack:",this.state.errorInfo.componentStack]})]}):this.props.children}}console.log(` -`+"=".repeat(80));console.log("[APP STARTUP] Dashboard initializing...");console.log(`Timestamp: ${new Date().toISOString()}`);console.log("Environment: production");console.log("Base URL: /dashboard");console.log("=".repeat(80)+` -`);window.onerror=(e,t,r,n,i)=>{console.log(` -`+"!".repeat(80)),console.log("[WINDOW ERROR]"),console.log("Message:",e),console.log("Source:",t),console.log("Line:",r,"Column:",n),i&&(console.log("Error:",i.message),console.log("Stack:",i.stack)),console.log("!".repeat(80)+` -`)};window.onunhandledrejection=e=>{console.log(` -`+"!".repeat(80)),console.log("[UNHANDLED PROMISE REJECTION]"),console.log("Reason:",e.reason),e.reason instanceof Error&&console.log("Stack:",e.reason.stack),console.log("!".repeat(80)+` -`)};ev.createRoot(document.getElementById("root")).render(d.jsx(N.StrictMode,{children:d.jsx(Yoe,{children:d.jsx(nI,{basename:"/dashboard",children:d.jsx(Xoe,{})})})})); diff --git a/website/dist/assets/index-_ClGteNY.css b/website/dist/assets/index-_ClGteNY.css deleted file mode 100644 index b8be9034..00000000 --- a/website/dist/assets/index-_ClGteNY.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Menlo,Monaco,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html{color-scheme:light}html.dark{color-scheme:dark}html,body{font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark html,.dark body{color:#f1f5f9}html,body{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}html:is(.dark *),body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark p,.dark span,.dark h1,.dark h2,.dark h3,.dark h4,.dark h5,.dark h6{color:#f1f5f9}p,span,h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}p:is(.dark *),span:is(.dark *),h1:is(.dark *),h2:is(.dark *),h3:is(.dark *),h4:is(.dark *),h5:is(.dark *),h6:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark p.text-slate-500:is(.dark *),.dark span.text-slate-500:is(.dark *),.dark div.text-slate-500:is(.dark *){color:#64748b}p.text-slate-500:is(.dark *),span.text-slate-500:is(.dark *),div.text-slate-500:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}p.text-slate-600:is(.dark *),span.text-slate-600:is(.dark *),div.text-slate-600:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .text-slate-900,.dark .text-slate-800{color:#f1f5f9!important}.dark .text-slate-700{color:#e2e8f0!important}.dark .text-slate-600{color:#cbd5e1!important}.dark .text-slate-500{color:#94a3b8!important}.dark .text-slate-400{color:#64748b!important}.dark .text-blue-800,.dark .text-blue-700{color:#93c5fd!important}.dark .text-blue-600{color:#60a5fa!important}.dark .text-brand-500{color:#818cf8!important}.dark .bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .bg-slate-100{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1));-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.dark :where(input:not([type=checkbox]):not([type=radio]):not([type=range])),.dark :where(select),.dark :where(textarea){color:#f1f5f9}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){border-radius:9999px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::-moz-placeholder,:where(select)::-moz-placeholder,:where(textarea)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::placeholder,:where(select)::placeholder,:where(textarea)::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus,:where(select):focus,:where(textarea):focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(99 102 241 / .2)}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *),:where(select):is(.dark *),:where(textarea):is(.dark *){border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::-moz-placeholder,:where(select):is(.dark *)::-moz-placeholder,:where(textarea):is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::placeholder,:where(select):is(.dark *)::placeholder,:where(textarea):is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus:is(.dark *),:where(select):focus:is(.dark *),:where(textarea):focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 51 56 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){box-shadow:0 1px 2px #0000000d!important;font-family:Outfit,sans-serif}.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),.dark select,.dark textarea{box-shadow:none!important}.dark select option{color:#f1f5f9}select option{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}select option:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}input[type=range]{accent-color:#6366f1}input[type=range]:is(.dark *){accent-color:#fff}input[type=radio],input[type=checkbox]{height:1rem;width:1rem;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));accent-color:#6366f1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}input[type=radio]:is(.dark *),input[type=checkbox]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));accent-color:#fff}input[type=radio]{border-radius:50%}input[type=checkbox]{border-radius:4px}input[type=radio]:checked,input[type=checkbox]:checked{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}input[type=radio]:checked:is(.dark *),input[type=checkbox]:checked:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-20{z-index:20}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-\[76px\]{height:76px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-32{width:8rem}.w-36{width:9rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-9{width:2.25rem}.w-\[calc\(100\%-12px\)\]{width:calc(100% - 12px)}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.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-\[1fr_100px_32px\]{grid-template-columns:1fr 100px 32px}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\.5{gap:.875rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#1c1c24\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(28 28 36 / var(--tw-divide-opacity, 1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-\[14px\]{border-radius:14px}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[\#1c2d50\]{--tw-border-opacity: 1;border-color:rgb(28 45 80 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-brand-600{--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity, 1))}.border-emerald-500\/20{border-color:#10b98133}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-t-gray-500{--tw-border-opacity: 1;border-top-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.bg-\[\#07070b\]{--tw-bg-opacity: 1;background-color:rgb(7 7 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#f8fafc\]{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-brand-50\/50{background-color:#eef2ff80}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-brand-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-3{padding-bottom:.75rem}.pl-1{padding-left:.25rem}.pl-6{padding-left:1.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Menlo,Monaco,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.text-\[16px\]{font-size:16px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.accent-brand-500{accent-color:#6366f1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.ring-emerald-500\/20{--tw-ring-color: rgb(16 185 129 / .2)}.ring-orange-500\/20{--tw-ring-color: rgb(249 115 22 / .2)}.ring-purple-500\/20{--tw-ring-color: rgb(168 85 247 / .2)}.ring-red-500\/20{--tw-ring-color: rgb(239 68 68 / .2)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.glass-panel{position:relative;overflow:hidden;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.glass-panel:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 26 29 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1));--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark .glass-panel-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.glass-panel-hover:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.glass-panel-hover:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #a855f7 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient:is(.dark *){--tw-gradient-from: #9b51e0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(155 81 224 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #4f46e5 var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-gradient-to: #0ea5e9 var(--tw-gradient-to-position)}.aurora-top{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#9b51e0,#4f46e5,#0ea5e9,transparent);opacity:.8;z-index:100}.dark .hover\:text-slate-900:hover{color:#f1f5f9!important}.dark .hover\:text-slate-700:hover{color:#e2e8f0!important}.dark .hover\:text-brand-500:hover{color:#818cf8!important}.dark .hover\:bg-slate-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .hover\:bg-slate-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}.group:hover .group-hover\:text-slate-600p:is(.dark *),.group:hover .group-hover\:text-slate-600 span:is(.dark *),.group:hover .group-hover\:text-slate-600 div:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .group:hover .group-hover\:text-slate-600{color:#cbd5e1!important}.last\:border-0:last-child{border-width:0px}.hover\:bg-brand-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#28282f\]:focus{--tw-border-opacity: 1;border-color:rgb(40 40 47 / var(--tw-border-opacity, 1))}.focus\:border-slate-400:focus{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-brand-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-offset-1:focus{--tw-ring-offset-width: 1px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.dark\:divide-\[\#222226\]:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(34 34 38 / var(--tw-divide-opacity, 1))}.dark\:border-\[\#151515\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 21 21 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c1f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 31 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c24\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 36 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222222\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222226\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#27272a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:border-\[\#2a2a2e\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 46 / var(--tw-border-opacity, 1))}.dark\:border-\[\#5c1c1c\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(92 28 28 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#000000\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0a0a0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c0e\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f11\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f16\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 22 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111114\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111118\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121214\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151515\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151518\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#2a0505\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(42 5 5 / var(--tw-bg-opacity, 1))}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:text-\[\#55555e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(85 85 94 / var(--tw-text-opacity, 1))}.dark\:text-\[\#66666e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(102 102 110 / var(--tw-text-opacity, 1))}.dark\:text-\[\#888891\]:is(.dark *){--tw-text-opacity: 1;color:rgb(136 136 145 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a1a1aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:hover\:bg-\[\#0c0c0e\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#121214\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#18181b\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#222222\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#380808\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(56 8 8 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-slate-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:border-\[\#444444\]:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(68 68 68 / var(--tw-border-opacity, 1))}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 768px){.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/website/dist/index.html b/website/dist/index.html index 09ad7193..0d09a49d 100644 --- a/website/dist/index.html +++ b/website/dist/index.html @@ -5,8 +5,8 @@ Decision Engine Dashboard - - + +
diff --git a/website/src/App.tsx b/website/src/App.tsx index 9161b15b..34fc43df 100644 --- a/website/src/App.tsx +++ b/website/src/App.tsx @@ -7,6 +7,8 @@ import { EuclidRulesPage } from './components/pages/EuclidRulesPage' import { VolumeSplitPage } from './components/pages/VolumeSplitPage' import { DebitRoutingPage } from './components/pages/DebitRoutingPage' import { DecisionExplorerPage } from './components/pages/DecisionExplorerPage' +import { AnalyticsPage } from './components/pages/AnalyticsPage' +import { PaymentAuditPage } from './components/pages/PaymentAuditPage' export default function App() { return ( @@ -19,6 +21,8 @@ export default function App() { } /> } /> } /> + } /> + } /> } /> diff --git a/website/src/components/layout/Sidebar.tsx b/website/src/components/layout/Sidebar.tsx index 862d6e00..569b50ab 100644 --- a/website/src/components/layout/Sidebar.tsx +++ b/website/src/components/layout/Sidebar.tsx @@ -8,6 +8,8 @@ import { BookOpen, PieChart, Network, + BarChart3, + Activity, } from 'lucide-react' export function Sidebar() { @@ -32,6 +34,8 @@ export function Sidebar() { diff --git a/website/src/components/pages/AnalyticsPage.tsx b/website/src/components/pages/AnalyticsPage.tsx index f960963d..b7353494 100644 --- a/website/src/components/pages/AnalyticsPage.tsx +++ b/website/src/components/pages/AnalyticsPage.tsx @@ -1,11 +1,8 @@ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' import useSWR from 'swr' -import { useNavigate } from 'react-router-dom' import { Area, AreaChart, - Bar, - BarChart, CartesianGrid, Legend, Line, @@ -18,14 +15,10 @@ import { import { useMerchantStore } from '../../store/merchantStore' import { fetcher } from '../../lib/api' import { - AnalyticsDecisionResponse, - AnalyticsGatewayScoresResponse, - AnalyticsLogSummariesResponse, AnalyticsOverviewResponse, AnalyticsRange, + AnalyticsRangeValue, AnalyticsRoutingStatsResponse, - AnalyticsScope, - GatewayScoreSeriesPoint, RoutingFilterOptions, } from '../../types/api' import { Button } from '../ui/Button' @@ -34,12 +27,16 @@ import { Badge } from '../ui/Badge' import { Spinner } from '../ui/Spinner' import { ErrorMessage } from '../ui/ErrorMessage' -type Section = 'overview' | 'scores' | 'decisions' | 'routing' | 'logs' +type TimeWindow = { + start_ms: number + end_ms: number +} + type RoutingFilters = { - paymentMethodType: string - paymentMethod: string + dimensions: Record gateways: string[] } + type InfoContent = { title: string purpose: string @@ -47,19 +44,18 @@ type InfoContent = { source: string } -const SECTION_LABELS: Record = { - overview: 'Overview', - scores: 'Gateway Scoring', - decisions: 'Decisions', - routing: 'Routing Stats', - logs: 'Logs / Summaries', -} +const PRESET_OPTIONS: { value: AnalyticsRangeValue; label: string }[] = [ + { value: '15m', label: 'Last 15 mins' }, + { value: '1h', label: 'Last 1 hour' }, + { value: '24h', label: 'Last 1 day' }, + { value: 'custom', label: 'Custom window' }, +] -const RANGE_OPTIONS: AnalyticsRange[] = ['15m', '1h', '24h'] +const CHART_COLORS = ['#0069ED', '#14b8a6', '#f97316', '#e11d48', '#8b5cf6', '#22c55e'] const CHART_TOOLTIP_STYLE = { backgroundColor: '#0d0d12', border: '1px solid #1c1c24', - borderRadius: '12px', + borderRadius: '14px', color: '#e8e8f4', boxShadow: '0 16px 40px rgba(0, 0, 0, 0.35)', } @@ -77,111 +73,35 @@ const CHART_TOOLTIP_WRAPPER_STYLE = { } const EMPTY_ROUTING_FILTERS: RoutingFilters = { - paymentMethodType: '', - paymentMethod: '', + dimensions: {}, gateways: [], } - -const CARD_INFO: Record = { - topScores: { - title: 'Top score snapshots', - purpose: 'Use this to answer which connector currently looks strongest for a merchant and payment slice without going to Redis or raw tables.', - calculation: 'Each row is the latest recorded `score_snapshot` for a unique merchant, payment method type, payment method, and connector combination. The sparkline is the stored time-ordered score history for that same slice.', - source: 'Rendered from persisted `analytics_event` score snapshots in Postgres. Those snapshots are produced from the Redis-backed gateway scoring flow, but this window itself reads the stored analytics history.', - }, - recentErrors: { - title: 'Recent errors', - purpose: 'Use this to see whether routing, score updates, or audit capture are failing in a repeatable pattern.', - calculation: 'Rows are grouped by route, error code, and error message. Count is the number of matching structured error events in the selected window, and last seen is the newest timestamp among them.', - source: 'Reads grouped `error` events from the `analytics_event` history in Postgres.', +const MAX_VISIBLE_DIMENSIONS = 3 + +const CARD_INFO: Record<'hits' | 'share' | 'sr', InfoContent> = { + hits: { + title: 'API call counts', + purpose: 'Use these cards to see how much traffic each major decision-engine API handled in the selected window.', + calculation: 'Each request records one lightweight API-call event. The cards count those recorded calls for `/decide_gateway`, `/update_gateway`, and `/rule_evaluate`.', + source: 'Counts come from analytics rows persisted in `analytics_event` in Postgres.', }, - gatewayScoring: { - title: 'Gateway scoring', - purpose: 'Use this when you need the exact score inputs that explain why one connector beat another at decision time.', - calculation: 'The table shows the latest `score_snapshot` per merchant, payment method type, payment method, and connector. Score, sigma, average latency, TP99 latency, and transaction count are taken directly from the captured snapshot payload.', - source: 'Reads persisted `score_snapshot` rows from `analytics_event` in Postgres. Those rows are emitted from the gateway scoring service, which itself uses Redis-backed scoring state.', - }, - decisionThroughput: { - title: 'Decision throughput by routing approach', - purpose: 'Use this to see how much routing traffic is being served and which approach is taking that traffic right now.', - calculation: 'Each chart point is the number of `decision` events in a time bucket grouped by `routing_approach`. The tiles above it are computed from the same event set: total decisions and failures divided by total decisions for error rate.', - source: 'Reads persisted `decision` events from `analytics_event` in Postgres. The page complements, but does not directly read, the in-process Prometheus counters.', - }, - gatewayShare: { + share: { title: 'Gateway share over time', - purpose: 'Use this to see whether traffic shifted sharply toward one connector or away from another.', - calculation: 'Each stacked bar counts `decision` events per time bucket grouped by chosen connector. Taller share for a connector means more payments were routed there in that period.', - source: 'Reads persisted `decision` events from `analytics_event` in Postgres.', + purpose: 'Use this to see when traffic shifted from one connector to another for the selected merchant.', + calculation: 'Decision events are bucketed by time and grouped by chosen connector. The chart shows how many decisions each gateway captured in each bucket.', + source: 'Reads persisted `decision` rows from `analytics_event` in Postgres.', }, - topRules: { - title: 'Top priority logic hits', - purpose: 'Use this to see which rules are actively steering routing so rule-driven behaviour is obvious without querying storage directly.', - calculation: 'Every `rule_hit` event increments the count for its rule name. The list is then sorted by descending hit count for the selected window.', - source: 'Reads persisted `rule_hit` events from `analytics_event` in Postgres.', - }, - connectorTrend: { + sr: { title: 'Connector success rate over time', - purpose: 'Use this to explain why a connector won routing at a given time, for example why Stripe was picked because its recorded score or SR trend was higher then.', - calculation: 'Built from stored `score_snapshot` history. Snapshot points are bucketed by time and connector, and multiple points in the same bucket are averaged. Merchant scope applies payment method filters before bucketing. Global mode intentionally collapses to connector-only trends.', - source: 'Reads persisted `score_snapshot` events from `analytics_event` in Postgres. Live scoring still comes from Redis-backed scoring flows; this window shows the stored historical trail.', - }, - errorSummaries: { - title: 'Error summaries', - purpose: 'Use this to prioritise the noisiest operational failures first instead of reading raw logs line by line.', - calculation: 'Structured `error` events are grouped by route, code, and message. Count shows recurrence and the rows are ordered by frequency in the selected window.', - source: 'Reads grouped `error` events from `analytics_event` in Postgres.', - }, - recentSamples: { - title: 'Recent samples', - purpose: 'Use this as the fastest jump point into audit for a real payment, request, or failure sample.', - calculation: 'Rows are recent structured analytics events ordered by timestamp. Each card shows the route, latest status or error, and any captured request or payment identifiers that can deep-link into the audit page.', - source: 'Reads recent events across `decision`, `score_snapshot`, `rule_hit`, and `error` from `analytics_event` in Postgres.', + purpose: 'Use this to explain why a connector won routing at a given time, based on the recorded historical score trail.', + calculation: 'Stored `score_snapshot` events are bucketed over the selected window and averaged per connector. The line values are displayed as percentages.', + source: 'Reads persisted `score_snapshot` rows from `analytics_event` in Postgres. The current score state originates from Redis-backed scoring flows.', }, } -const KPI_INFO: InfoContent[] = [ - { - title: 'Decisions', - purpose: 'Use this to understand real routed volume in the selected merchant or window.', - calculation: 'Every persisted `decision` event counts once. Labels such as Decisions / 1h or Decisions / 24h reflect the active time window only.', - source: 'Computed from `decision` rows in `analytics_event` in Postgres.', - }, - { - title: 'Score snapshots', - purpose: 'Use this to understand how much score history exists for explaining connector movement.', - calculation: 'Every persisted `score_snapshot` event counts once.', - source: 'Computed from `score_snapshot` rows in `analytics_event` in Postgres.', - }, - { - title: 'Rule hits', - purpose: 'Use this to gauge how much explicit routing logic is influencing traffic.', - calculation: 'Every persisted `rule_hit` event counts once.', - source: 'Computed from `rule_hit` rows in `analytics_event` in Postgres.', - }, - { - title: 'Errors', - purpose: 'Use this to see how many structured failures were captured in the selected window.', - calculation: 'Every persisted `error` event counts once.', - source: 'Computed from `error` rows in `analytics_event` in Postgres.', - }, - { - title: 'Error rate', - purpose: 'Use this to understand what percentage of recorded routing decisions failed, not just the raw number of failures.', - calculation: 'Computed as failed `decision` events divided by all `decision` events in the selected window, then converted to a percentage.', - source: 'Computed from `decision` rows and their `status` values in `analytics_event` in Postgres.', - }, -] - -function queryString(params: Record) { +function queryString(params: Record) { const search = new URLSearchParams() Object.entries(params).forEach(([key, value]) => { - if (Array.isArray(value)) { - if (value.length) { - search.set(key, value.join(',')) - } - return - } - if (value !== undefined && value !== '') { search.set(key, String(value)) } @@ -191,44 +111,37 @@ function queryString(params: Record = {}, + range: AnalyticsRangeValue, + merchantId: string, + customWindow?: TimeWindow, + routingFilters?: RoutingFilters, ) { - const params: Record = { - scope, - range, - page, - page_size: pageSize, - ...extraParams, - } - if (scope === 'current' && merchantId) { - params.merchant_id = merchantId + const params: Record = { + scope: 'current', + range: range === 'custom' ? '1h' : range, + start_ms: customWindow?.start_ms, + end_ms: customWindow?.end_ms, + merchant_id: merchantId, + gateway: routingFilters?.gateways.length ? routingFilters.gateways.join(',') : undefined, } - const qs = queryString(params) - return qs ? `${path}?${qs}` : path -} -function selectClassName(disabled = false) { - return `h-10 rounded-2xl border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb] ${disabled ? 'cursor-not-allowed opacity-50' : ''}` -} + Object.entries(routingFilters?.dimensions || {}).forEach(([key, value]) => { + if (value) { + params[key] = value + } + }) -function filterBadgeClass(active: boolean) { - return active - ? 'border-brand-500/40 bg-brand-500/10 text-brand-700 dark:text-brand-200' - : 'border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#a1a1aa] dark:hover:border-[#3a3a44] dark:hover:text-white' + const qs = queryString(params) + return qs ? `${path}?${qs}` : path } function formatNumber(value: number | string | undefined, digits = 2) { if (value === undefined || value === null || Number.isNaN(Number(value))) { return '0' } - const numberValue = Number(value) - if (Number.isInteger(numberValue)) return numberValue.toString() - return numberValue.toFixed(digits) + const numericValue = Number(value) + if (Number.isInteger(numericValue)) return numericValue.toString() + return numericValue.toFixed(digits) } function toPercent(value: number) { @@ -243,13 +156,6 @@ function formatPercent(value: number | string | undefined, digits = 1) { return `${formatNumber(toPercent(Number(value)), digits)}%` } -function formatDateTime(ms: number) { - return new Intl.DateTimeFormat(undefined, { - dateStyle: 'short', - timeStyle: 'short', - }).format(new Date(ms)) -} - function formatBucket(ms: number) { return new Intl.DateTimeFormat(undefined, { hour: '2-digit', @@ -257,59 +163,52 @@ function formatBucket(ms: number) { }).format(new Date(ms)) } -function humanizeAuditRoute(route?: string | null) { - if (!route) return 'Unknown route' - if (route === 'decision_gateway' || route === 'decide_gateway') return 'Decide Gateway' - return route - .replace(/[_-]+/g, ' ') - .replace(/\s+/g, ' ') - .trim() - .toLowerCase() - .replace(/\b\w/g, (char) => char.toUpperCase()) +function formatDateTime(ms: number) { + return new Intl.DateTimeFormat(undefined, { + dateStyle: 'medium', + timeStyle: 'short', + }).format(new Date(ms)) } -function makeScoreKey(point: Pick) { - return [point.merchant_id, point.payment_method_type, point.payment_method, point.gateway].join('|') +function presetWindow(range: AnalyticsRange) { + const now = Date.now() + const duration = + range === '15m' + ? 15 * 60 * 1000 + : range === '1h' + ? 60 * 60 * 1000 + : 24 * 60 * 60 * 1000 + + return { + start_ms: now - duration, + end_ms: now, + } } -function sectionButtonClass(active: boolean) { - return active ? 'bg-brand-600 text-white' : 'bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]' +function toDateTimeInputValue(timestampMs: number) { + const date = new Date(timestampMs) + const pad = (value: number) => value.toString().padStart(2, '0') + return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad( + date.getHours(), + )}:${pad(date.getMinutes())}` } -function infoMatchForMetric(label: string): InfoContent | null { - const normalized = label.toLowerCase() - if (normalized.startsWith('decisions /')) return KPI_INFO[0] - if (normalized === 'decisions') return KPI_INFO[0] - if (normalized === 'score snapshots') return KPI_INFO[1] - if (normalized === 'rule hits') return KPI_INFO[2] - if (normalized === 'errors') return KPI_INFO[3] - if (normalized === 'error rate') return KPI_INFO[4] - return null +function fromDateTimeInputValue(value: string) { + const timestamp = new Date(value).getTime() + return Number.isFinite(timestamp) ? timestamp : null } function EmptyState({ title, body }: { title: string; body: string }) { return ( -
+

{title}

{body}

) } -function MetricCard({ label, value, subtitle }: { label: string; value: string; subtitle?: string | null }) { - const info = infoMatchForMetric(label) - return ( - - -
-

{label}

- {info ? : null} -
-

{value}

- {subtitle &&

{subtitle}

} -
-
- ) +function controlClassName() { + return 'h-11 w-full rounded-2xl border border-slate-200 bg-white px-4 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]' } function InfoButton({ content }: { content: InfoContent }) { @@ -351,7 +250,6 @@ function InfoButton({ content }: { content: InfoContent }) { Math.max(rect.right - width, VIEWPORT_GUTTER), window.innerWidth - width - VIEWPORT_GUTTER, ) - const showAbove = rect.bottom + GAP + POPOVER_HEIGHT > window.innerHeight - VIEWPORT_GUTTER const top = showAbove ? Math.max(rect.top - POPOVER_HEIGHT - GAP, VIEWPORT_GUTTER) @@ -415,112 +313,150 @@ function InfoButton({ content }: { content: InfoContent }) { ) } -function Sparkline({ points }: { points: { bucket_ms: number; value: number }[] }) { - if (points.length === 0) { - return No history - } - +function HitsCard({ + label, + value, + subtitle, +}: { + label: string + value: number + subtitle: string +}) { return ( - - - - formatNumber(value as number, 3)} - labelFormatter={(label: unknown) => formatBucket(Number(label))} - contentStyle={CHART_TOOLTIP_STYLE} - labelStyle={CHART_TOOLTIP_LABEL_STYLE} - itemStyle={CHART_TOOLTIP_ITEM_STYLE} - wrapperStyle={CHART_TOOLTIP_WRAPPER_STYLE} - /> - - + + +
+

+ Endpoint hits +

+

{label}

+
+
+

+ {formatNumber(value, 0)} +

+ {subtitle} +
+
+
) } +function analyticsRouteLabel(route: string) { + if (route === '/decide_gateway') return 'Decide Gateway' + if (route === '/update_gateway') return 'Update Gateway' + if (route === '/rule_evaluate') return 'Rule Evaluate' + return route +} + export function AnalyticsPage() { const { merchantId } = useMerchantStore() - const navigate = useNavigate() - const [scope, setScope] = useState('current') - const [range, setRange] = useState('1h') - const [section, setSection] = useState
('overview') - const [page, setPage] = useState(1) + const [range, setRange] = useState('1h') const [routingFilters, setRoutingFilters] = useState(EMPTY_ROUTING_FILTERS) - const pageSize = 10 - const globalConnectorOnly = scope === 'all' - - const canQueryCurrent = scope === 'all' || Boolean(merchantId) - const effectiveMerchantId = scope === 'current' ? merchantId || undefined : undefined - - const overviewUrl = canQueryCurrent && !globalConnectorOnly - ? buildAnalyticsUrl('/analytics/overview', scope, range, effectiveMerchantId) - : null - const scoresUrl = canQueryCurrent && !globalConnectorOnly - ? buildAnalyticsUrl('/analytics/gateway-scores', scope, range, effectiveMerchantId) - : null - const decisionsUrl = canQueryCurrent && !globalConnectorOnly - ? buildAnalyticsUrl('/analytics/decisions', scope, range, effectiveMerchantId) - : null - const routingUrl = canQueryCurrent - ? buildAnalyticsUrl('/analytics/routing-stats', scope, range, effectiveMerchantId, 1, 10, { - payment_method_type: scope === 'current' ? routingFilters.paymentMethodType || undefined : undefined, - payment_method: scope === 'current' ? routingFilters.paymentMethod || undefined : undefined, - gateway: routingFilters.gateways, - }) - : null - const logsUrl = canQueryCurrent && !globalConnectorOnly - ? buildAnalyticsUrl('/analytics/log-summaries', scope, range, effectiveMerchantId, page, pageSize) - : null + const [showAllFilters, setShowAllFilters] = useState(false) + const [customStart, setCustomStart] = useState(() => + toDateTimeInputValue(Date.now() - 2 * 60 * 60 * 1000), + ) + const [customEnd, setCustomEnd] = useState(() => toDateTimeInputValue(Date.now())) - const overview = useSWR(overviewUrl, fetcher, { - refreshInterval: 8000, - revalidateOnFocus: true, - }) - const scores = useSWR(scoresUrl, fetcher, { - refreshInterval: 8000, - revalidateOnFocus: true, - }) - const decisions = useSWR(decisionsUrl, fetcher, { - refreshInterval: 8000, - revalidateOnFocus: true, - }) - const routing = useSWR(routingUrl, fetcher, { - refreshInterval: 12000, + const canQueryCurrent = Boolean(merchantId) + + const customWindow = useMemo(() => { + if (range !== 'custom') return undefined + const start_ms = fromDateTimeInputValue(customStart) + const end_ms = fromDateTimeInputValue(customEnd) + if (start_ms === null || end_ms === null || end_ms <= start_ms) { + return undefined + } + return { start_ms, end_ms } + }, [customEnd, customStart, range]) + + const overviewUrl = + canQueryCurrent && merchantId && (range !== 'custom' || customWindow) + ? buildAnalyticsUrl('/analytics/overview', range, merchantId, customWindow) + : null + const routingUrl = + canQueryCurrent && merchantId && (range !== 'custom' || customWindow) + ? buildAnalyticsUrl('/analytics/routing-stats', range, merchantId, customWindow) + : null + const filteredRoutingUrl = + canQueryCurrent && merchantId && (range !== 'custom' || customWindow) + ? buildAnalyticsUrl('/analytics/routing-stats', range, merchantId, customWindow, routingFilters) + : null + + const overviewSwrOptions = { + refreshInterval: 10000, revalidateOnFocus: true, - }) - const logs = useSWR(logsUrl, fetcher, { + revalidateIfStale: false, + } as const + const routingSwrOptions = { refreshInterval: 12000, revalidateOnFocus: true, - }) + revalidateIfStale: false, + } as const + const filteredRoutingSwrOptions = { + ...routingSwrOptions, + keepPreviousData: true, + } as const + + const overview = useSWR(overviewUrl, fetcher, overviewSwrOptions) + const routing = useSWR(routingUrl, fetcher, routingSwrOptions) + const filteredRouting = useSWR( + filteredRoutingUrl, + fetcher, + filteredRoutingSwrOptions, + ) - useEffect(() => { - if (scope === 'all') { - setSection('routing') - setRoutingFilters((current) => ({ - ...current, - paymentMethodType: '', - paymentMethod: '', - })) - } - }, [scope]) + const loading = + (!overview.data && overview.isLoading) || + (!routing.data && routing.isLoading) || + (!filteredRouting.data && filteredRouting.isLoading) + const error = + overview.error?.message || + routing.error?.message || + filteredRouting.error?.message || + null + + const availableFilters: RoutingFilterOptions = { + dimensions: + routing.data?.available_filters?.dimensions || + filteredRouting.data?.available_filters?.dimensions || + [], + missing_dimensions: + routing.data?.available_filters?.missing_dimensions || + filteredRouting.data?.available_filters?.missing_dimensions || + [], + gateways: + routing.data?.available_filters?.gateways || + filteredRouting.data?.available_filters?.gateways || + [], + } + const availableFilterMap = useMemo( + () => + new Map( + availableFilters.dimensions.map((dimension) => [dimension.key, dimension] as const), + ), + [availableFilters.dimensions], + ) useEffect(() => { - const options: RoutingFilterOptions | undefined = routing.data?.available_filters - if (!options) return - setRoutingFilters((current) => { - const nextPaymentMethodType = scope === 'current' && (current.paymentMethodType ? options.payment_method_types.includes(current.paymentMethodType) : true) - ? current.paymentMethodType - : '' - - const nextPaymentMethod = scope === 'current' && (current.paymentMethod ? options.payment_methods.includes(current.paymentMethod) : true) - ? current.paymentMethod - : '' - - const nextGateways = current.gateways.filter((gateway) => options.gateways.includes(gateway)) + const nextDimensions = Object.fromEntries( + Object.entries(current.dimensions).filter(([key, value]) => { + if (!value) return false + const dimension = availableFilterMap.get(key) + return dimension ? dimension.values.includes(value) : false + }), + ) + const nextGateways = current.gateways.filter((gateway) => + availableFilters.gateways.includes(gateway), + ) if ( - nextPaymentMethodType === current.paymentMethodType && - nextPaymentMethod === current.paymentMethod && + Object.keys(nextDimensions).length === Object.keys(current.dimensions).length && + Object.entries(nextDimensions).every( + ([key, value]) => current.dimensions[key] === value, + ) && nextGateways.length === current.gateways.length && nextGateways.every((gateway, index) => gateway === current.gateways[index]) ) { @@ -528,105 +464,151 @@ export function AnalyticsPage() { } return { - paymentMethodType: nextPaymentMethodType, - paymentMethod: nextPaymentMethod, + dimensions: nextDimensions, gateways: nextGateways, } }) - }, [routing.data?.available_filters, scope]) - - const loading = [overview, scores, decisions, routing, logs].some((item) => item.isLoading) - const error = overview.error?.message || scores.error?.message || decisions.error?.message || routing.error?.message || logs.error?.message || null - - const scoreSeriesByKey = useMemo(() => { - const grouped = new Map() - for (const point of scores.data?.series || []) { - const key = makeScoreKey(point) - const entry = grouped.get(key) || [] - entry.push({ bucket_ms: point.bucket_ms, value: point.score_value }) - grouped.set(key, entry) - } - return grouped - }, [scores.data]) + }, [availableFilterMap, availableFilters.gateways]) - const decisionChartRows = useMemo(() => { - const buckets = new Map>() - for (const point of decisions.data?.series || []) { - const row = buckets.get(point.bucket_ms) || { bucket_ms: point.bucket_ms } - row[point.routing_approach] = point.count - buckets.set(point.bucket_ms, row) + useEffect(() => { + if (availableFilters.dimensions.length <= MAX_VISIBLE_DIMENSIONS && showAllFilters) { + setShowAllFilters(false) } - return Array.from(buckets.values()).sort((left, right) => left.bucket_ms - right.bucket_ms) - }, [decisions.data]) + }, [availableFilters.dimensions.length, showAllFilters]) - const routingChartRows = useMemo(() => { + const activeWindowLabel = useMemo(() => { + if (range !== 'custom') { + return PRESET_OPTIONS.find((option) => option.value === range)?.label || 'Selected window' + } + if (!customWindow) return 'Custom window' + return `${formatDateTime(customWindow.start_ms)} to ${formatDateTime(customWindow.end_ms)}` + }, [customWindow, range]) + + const routeHits = useMemo(() => { + const fallback = [ + { route: '/decide_gateway', count: 0 }, + { route: '/update_gateway', count: 0 }, + { route: '/rule_evaluate', count: 0 }, + ] + if (!overview.data?.route_hits?.length) return fallback + return fallback.map((item) => ({ + ...item, + count: overview.data?.route_hits.find((row) => row.route === item.route)?.count || 0, + })) + }, [overview.data]) + + const gatewayShareData = useMemo(() => { + const gateways = Array.from(new Set((routing.data?.gateway_share || []).map((point) => point.gateway))).slice(0, 6) const buckets = new Map>() + for (const point of routing.data?.gateway_share || []) { + if (!gateways.includes(point.gateway)) continue const row = buckets.get(point.bucket_ms) || { bucket_ms: point.bucket_ms } row[point.gateway] = point.count buckets.set(point.bucket_ms, row) } - return Array.from(buckets.values()).sort((left, right) => left.bucket_ms - right.bucket_ms) + + return { + gateways, + rows: Array.from(buckets.values()).sort((left, right) => left.bucket_ms - right.bucket_ms), + } }, [routing.data]) - const srTrendRows = useMemo(() => { - const gateways = Array.from(new Set((routing.data?.sr_trend || []).map((point) => point.gateway))).slice(0, 5) + const connectorTrendData = useMemo(() => { + const gateways = Array.from(new Set((filteredRouting.data?.sr_trend || []).map((point) => point.gateway))).slice(0, 6) const buckets = new Map>() - for (const point of routing.data?.sr_trend || []) { + + for (const point of filteredRouting.data?.sr_trend || []) { if (!gateways.includes(point.gateway)) continue const row = buckets.get(point.bucket_ms) || { bucket_ms: point.bucket_ms } row[point.gateway] = toPercent(point.score_value) buckets.set(point.bucket_ms, row) } + return { gateways, rows: Array.from(buckets.values()).sort((left, right) => left.bucket_ms - right.bucket_ms), } - }, [routing.data]) + }, [filteredRouting.data]) - const connectorTrendSummary = useMemo(() => { - if (!srTrendRows.rows.length) return [] - const latestRow = srTrendRows.rows[srTrendRows.rows.length - 1] - return srTrendRows.gateways + const latestConnectorSummary = useMemo(() => { + if (!connectorTrendData.rows.length) return [] + const latestRow = connectorTrendData.rows[connectorTrendData.rows.length - 1] + return connectorTrendData.gateways .map((gateway) => ({ gateway, value: typeof latestRow[gateway] === 'number' ? latestRow[gateway] : null, })) .filter((item): item is { gateway: string; value: number } => item.value !== null) - }, [srTrendRows]) + }, [connectorTrendData]) - const availableRoutingFilters = routing.data?.available_filters || { - payment_method_types: [], - payment_methods: [], - gateways: [], - } + const connectorTrendDomain = useMemo(() => { + const values = connectorTrendData.rows.flatMap((row) => + connectorTrendData.gateways + .map((gateway) => row[gateway]) + .filter((value): value is number => typeof value === 'number'), + ) - const activeRoutingFilterBadges = useMemo(() => { - const badges: string[] = [] - if (scope === 'current' && routingFilters.paymentMethodType) { - badges.push(routingFilters.paymentMethodType) - } - if (scope === 'current' && routingFilters.paymentMethod) { - badges.push(routingFilters.paymentMethod) - } - if (routingFilters.gateways.length) { - badges.push(...routingFilters.gateways) - } - return badges - }, [routingFilters, scope]) + if (!values.length) return [0, 100] as const + + const min = Math.min(...values) + const max = Math.max(...values) + const padding = min === max ? 5 : Math.max(2, (max - min) * 0.35) - const routingSubtitle = useMemo(() => { - if (scope === 'all') { - return 'Global success rate trend by connector across all merchants.' + return [ + Math.max(0, Math.floor(min - padding)), + Math.min(100, Math.ceil(max + padding)), + ] as const + }, [connectorTrendData]) + + const activeFilterSummary = useMemo(() => { + const parts = availableFilters.dimensions.flatMap((dimension) => { + const value = routingFilters.dimensions[dimension.key] + return value ? [`${dimension.label}: ${value}`] : [] + }) + if (routingFilters.gateways.length) parts.push(routingFilters.gateways.join(', ')) + return parts.length ? parts.join(' / ') : 'All routing dimensions' + }, [availableFilters.dimensions, routingFilters]) + + const visibleDimensions = useMemo(() => { + if (showAllFilters || availableFilters.dimensions.length <= MAX_VISIBLE_DIMENSIONS) { + return availableFilters.dimensions } - if (!activeRoutingFilterBadges.length) { - return 'Success rate trend by connector for the selected merchant.' + return availableFilters.dimensions.slice(0, MAX_VISIBLE_DIMENSIONS) + }, [availableFilters.dimensions, showAllFilters]) + + const hasExtraDimensions = availableFilters.dimensions.length > MAX_VISIBLE_DIMENSIONS + const hiddenDimensionCount = hasExtraDimensions + ? availableFilters.dimensions.length - MAX_VISIBLE_DIMENSIONS + : 0 + + const activeFilterChips = useMemo(() => { + const dimensionChips = availableFilters.dimensions.flatMap((dimension) => { + const value = routingFilters.dimensions[dimension.key] + return value + ? [{ key: `dimension:${dimension.key}`, label: `${dimension.label}: ${value}` }] + : [] + }) + const gatewayChips = routingFilters.gateways.map((gateway) => ({ + key: `gateway:${gateway}`, + label: `Connector: ${gateway}`, + })) + return [...dimensionChips, ...gatewayChips] + }, [availableFilters.dimensions, routingFilters]) + + function handleRangeChange(value: AnalyticsRangeValue) { + setRange(value) + if (value !== 'custom') { + const preset = presetWindow(value) + setCustomStart(toDateTimeInputValue(preset.start_ms)) + setCustomEnd(toDateTimeInputValue(preset.end_ms)) } - return `Success rate trend by connector filtered by ${activeRoutingFilterBadges.join(' / ')}.` - }, [activeRoutingFilterBadges, scope]) + } - function updateRoutingFilter(key: K, value: RoutingFilters[K]) { - setRoutingFilters((current) => ({ ...current, [key]: value })) + function refreshAll() { + overview.mutate() + routing.mutate() + filteredRouting.mutate() } function toggleGatewayFilter(gateway: string) { @@ -645,22 +627,30 @@ export function AnalyticsPage() { setRoutingFilters(EMPTY_ROUTING_FILTERS) } - function refreshAll() { - overview.mutate() - scores.mutate() - decisions.mutate() - routing.mutate() - logs.mutate() + function removeRoutingFilterChip(chipKey: string) { + if (chipKey.startsWith('dimension:')) { + updateDimensionFilter(chipKey.replace('dimension:', ''), '') + return + } + if (chipKey.startsWith('gateway:')) { + toggleGatewayFilter(chipKey.replace('gateway:', '')) + } } - function openAudit(extraParams: Record) { - const search = queryString({ - scope, - range, - merchant_id: scope === 'current' ? effectiveMerchantId : undefined, - ...extraParams, + function updateDimensionFilter(dimensionKey: string, value: string) { + setRoutingFilters((current) => { + const nextDimensions = { ...current.dimensions } + if (value) { + nextDimensions[dimensionKey] = value + } else { + delete nextDimensions[dimensionKey] + } + + return { + ...current, + dimensions: nextDimensions, + } }) - navigate(search ? `/audit?${search}` : '/audit') } if (!canQueryCurrent) { @@ -669,12 +659,12 @@ export function AnalyticsPage() {

Analytics

- Set a Merchant ID in the top bar, or switch to the all-merchants view. + Set a merchant in the top bar to load merchant-scoped analytics.

) @@ -683,584 +673,372 @@ export function AnalyticsPage() { return (
-
-

Analytics

-

- Live routing metrics, score snapshots, rule hits, and operational summaries. +

+
+

Analytics

+ {merchantId || 'Current merchant'} +
+

+ One working surface for route volume, connector share, and historical connector success rate.

- -
-
- {(globalConnectorOnly ? (['routing'] as Section[]) : (Object.keys(SECTION_LABELS) as Section[])).map((value) => ( - - ))} -
+ + + + + {range === 'custom' ? ( + <> + + + + + ) : null} -
- {RANGE_OPTIONS.map((value) => ( - - ))} - - {scope === 'all' ? 'All merchants' : merchantId || 'Current merchant'} - -
+
+

+ Active window +

+

{activeWindowLabel}

+ {range === 'custom' && !customWindow ? ( +

Choose an end time after the start time.

+ ) : null} +
+
+
- {loading && ( + {loading ? (
Loading analytics…
- )} - - {!globalConnectorOnly ? ( -
- {(overview.data?.kpis || [ - { label: 'Decisions', value: '0', subtitle: 'Waiting for data' }, - { label: 'Score snapshots', value: '0', subtitle: 'Waiting for data' }, - { label: 'Rule hits', value: '0', subtitle: 'Waiting for data' }, - { label: 'Errors', value: '0', subtitle: 'Waiting for data' }, - ]).map((kpi) => ( - - ))} -
- ) : ( - - + ) : null} + +
+
-

Global connector performance

-

- All-merchants mode is restricted to connector-level success-rate summaries only. +

API calls

+

+ Counts for the three routing surfaces most operators watch first.

-
- Connector-only global view - + +
+ +
+ {routeHits.map((item) => ( + + ))} +
+
+ + + +
+
+

Gateway share over time

+

+ How decision volume moved across connectors inside the selected merchant window. +

+
+
+
+ + {gatewayShareData.rows.length ? ( +
+ + + + + + formatDateTime(Number(label))} + contentStyle={CHART_TOOLTIP_STYLE} + labelStyle={CHART_TOOLTIP_LABEL_STYLE} + itemStyle={CHART_TOOLTIP_ITEM_STYLE} + wrapperStyle={CHART_TOOLTIP_WRAPPER_STYLE} + /> + + {gatewayShareData.gateways.map((gateway, index) => ( + + ))} + + +
+ ) : ( + + )}
- )} - - {section === 'overview' && ( -
- - -
-

Top score snapshots

- -
-
- - {overview.data?.top_scores?.length ? overview.data.top_scores.slice(0, 5).map((snapshot) => { - const key = [snapshot.merchant_id, snapshot.payment_method_type, snapshot.payment_method, snapshot.gateway].join('|') - const spark = scoreSeriesByKey.get(key) || [] - return ( -
-
-
-

{snapshot.gateway}

-

- {snapshot.merchant_id} · {snapshot.payment_method_type} · {snapshot.payment_method} -

-
- {formatNumber(snapshot.score_value, 3)} -
-
- sigma {formatNumber(snapshot.sigma_factor, 3)} - avg {formatNumber(snapshot.average_latency, 2)} - tp99 {formatNumber(snapshot.tp99_latency, 2)} - count {formatNumber(snapshot.transaction_count, 0)} -
-
- -
-
- ) - }) : ( - - )} -
-
- - - -
-

Recent errors

- -
-
- - {overview.data?.top_errors?.length ? overview.data.top_errors.slice(0, 5).map((errorRow) => ( - - )) : ( - - )} - -
-
- )} - - {section === 'scores' && ( - - -
-

Gateway scoring

- + + + +
+
+

+ Connector success rate over time +

+

+ Historical connector score trend for the selected merchant window. +

+

+ Active filters: {activeFilterSummary} +

- - - {scores.data?.snapshots?.length ? ( -
-
- - - - - - - - - - - - - - - {scores.data.snapshots.map((snapshot) => { - const key = [snapshot.merchant_id, snapshot.payment_method_type, snapshot.payment_method, snapshot.gateway].join('|') - const spark = scoreSeriesByKey.get(key) || [] - return ( - - - - - - - - - - - ) - })} - -
MerchantPMTGatewayScoreSigmaAvg latencyTP99Updated
{snapshot.merchant_id}{snapshot.payment_method_type}{snapshot.gateway}{formatNumber(snapshot.score_value, 3)}{formatNumber(snapshot.sigma_factor, 3)}{formatNumber(snapshot.average_latency, 2)}{formatNumber(snapshot.tp99_latency, 2)} -
- -
-
{formatDateTime(snapshot.last_updated_ms)}
-
-
-
- ) : ( - - )} -
- - )} - - {section === 'decisions' && ( -
-
- {decisions.data?.tiles?.map((tile) => ( - - )) || null} +
- - - -
-

Decision throughput by routing approach

- -
-
- - {decisionChartRows.length ? ( -
- - - - - - formatDateTime(Number(label))} - contentStyle={CHART_TOOLTIP_STYLE} - labelStyle={CHART_TOOLTIP_LABEL_STYLE} - itemStyle={CHART_TOOLTIP_ITEM_STYLE} - wrapperStyle={CHART_TOOLTIP_WRAPPER_STYLE} - /> - - {(decisions.data?.approaches || []).slice(0, 5).map((approach, index) => ( - - ))} - - -
- ) : ( - - )} -
-
-
- )} - - {section === 'routing' && ( -
- {!globalConnectorOnly ? ( - <> - - -
-

Gateway share over time

- -
-
- - {routingChartRows.length ? ( -
- - - - - - formatDateTime(Number(label))} - contentStyle={CHART_TOOLTIP_STYLE} - labelStyle={CHART_TOOLTIP_LABEL_STYLE} - itemStyle={CHART_TOOLTIP_ITEM_STYLE} - wrapperStyle={CHART_TOOLTIP_WRAPPER_STYLE} - /> - - {(routing.data?.gateway_share || []).reduce((acc, point) => { - if (!acc.includes(point.gateway)) acc.push(point.gateway) - return acc - }, []).slice(0, 5).map((gateway, index) => ( - - ))} - - -
- ) : ( - - )} -
-
- - - -
-

Top priority logic hits

- + + +
+
+
+

+ Connector filters +

+

+ Narrow the success-rate line chart by the routing dimensions present for this merchant. +

- - - {routing.data?.top_rules?.length ? routing.data.top_rules.map((rule) => ( -
- {rule.rule_name} - {rule.count} -
- )) : ( - - )} -
- - - ) : null} - - - -
-
-

- {globalConnectorOnly ? 'Global connector success rate' : 'Connector success rate over time'} -

-

- {routingSubtitle} -

-
- -
-
- -
-
-
- + +
-
- - {srTrendRows.rows.length ? ( -
- {connectorTrendSummary.length ? ( -
- {connectorTrendSummary.map((item) => ( - - {item.gateway}: {formatPercent(item.value)} - - ))} -
- ) : null} - -
- - - - - `${formatNumber(Number(value), 0)}%`} /> - formatDateTime(Number(label))} - formatter={(value: unknown, name: string | number) => [formatPercent(value as number), String(name)]} - contentStyle={CHART_TOOLTIP_STYLE} - labelStyle={CHART_TOOLTIP_LABEL_STYLE} - itemStyle={CHART_TOOLTIP_ITEM_STYLE} - wrapperStyle={CHART_TOOLTIP_WRAPPER_STYLE} - /> - - {srTrendRows.gateways.map((gateway, index) => ( - - ))} - - -
-
- ) : ( - - )} - - -
- )} - - {section === 'logs' && ( -
- - -
-

Error summaries

- + ) : availableFilters.missing_dimensions.length ? ( + + ) : null} + + {availableFilters.missing_dimensions.length ? ( +
+

+ No values in this window yet +

+

+ {availableFilters.missing_dimensions.map((dimension) => dimension.label).join(', ')} +

- - - {logs.data?.errors?.length ? logs.data.errors.map((item) => ( - - )) : ( - - )} - - - - - -
-
-

Recent samples

- -
-
- - + ) : null} + + {activeFilterChips.length ? ( +
+

+ Active filters +

+
+ {activeFilterChips.map((chip) => ( + + ))}
- - - {logs.data?.samples?.length ? logs.data.samples.map((sample) => ( - + ) + }) + ) : ( +

+ No connector history yet for the selected window.

- - )) : ( - - )} -
- -
- )} + )} +
+
+
+ + {latestConnectorSummary.length ? ( +
+ {latestConnectorSummary.map((item) => ( + + {item.gateway}: {formatPercent(item.value)} + + ))} +
+ ) : null} + + {connectorTrendData.rows.length ? ( +
+ + + + + `${formatNumber(Number(value), 0)}%`} + /> + formatDateTime(Number(label))} + formatter={(value: unknown, name: string | number) => [formatPercent(value as number), String(name)]} + contentStyle={CHART_TOOLTIP_STYLE} + labelStyle={CHART_TOOLTIP_LABEL_STYLE} + itemStyle={CHART_TOOLTIP_ITEM_STYLE} + wrapperStyle={CHART_TOOLTIP_WRAPPER_STYLE} + /> + + {connectorTrendData.gateways.map((gateway, index) => ( + + ))} + + +
+ ) : ( + + )} +
+
) } diff --git a/website/src/components/pages/DecisionExplorerPage.tsx b/website/src/components/pages/DecisionExplorerPage.tsx index 2e6dc363..c48cbf85 100644 --- a/website/src/components/pages/DecisionExplorerPage.tsx +++ b/website/src/components/pages/DecisionExplorerPage.tsx @@ -1,4 +1,5 @@ import { useEffect, useMemo, useState } from 'react' +import useSWR from 'swr' import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, Cell, PieChart, Pie } from 'recharts' import { Card, CardBody, CardHeader } from '../ui/Card' import { Button } from '../ui/Button' @@ -6,11 +7,11 @@ import { Badge } from '../ui/Badge' import { ErrorMessage } from '../ui/ErrorMessage' import { Spinner } from '../ui/Spinner' import { useMerchantStore } from '../../store/merchantStore' -import { apiPost } from '../../lib/api' -import { DecideGatewayResponse, GatewayConnector } from '../../types/api' +import { apiPost, fetcher } from '../../lib/api' +import { DecideGatewayResponse, GatewayConnector, PaymentAuditEvent, PaymentAuditResponse } from '../../types/api' import { ROUTING_APPROACH_COLORS } from '../../lib/constants' import { useDynamicRoutingConfig } from '../../hooks/useDynamicRoutingConfig' -import { Play, RefreshCw, ChevronDown, ChevronUp, Activity, Code, Plus, Trash2, PieChart as PieChartIcon } from 'lucide-react' +import { Play, RefreshCw, ChevronDown, ChevronUp, Activity, Code, Plus, Trash2, PieChart as PieChartIcon, X } from 'lucide-react' const ALGORITHMS = ['SR_BASED_ROUTING', 'PL_BASED_ROUTING', 'NTW_BASED_ROUTING'] @@ -47,6 +48,8 @@ interface SimulationResult { timestamp: string } +type AuditInspectorTab = 'summary' | 'input' | 'response' | 'raw' + interface RuleEvaluateParams { key: string type: 'enum_variant' | 'str_value' | 'number' | 'metadata_variant' @@ -76,6 +79,11 @@ function approachColor(approach: string): string { const COLORS = ['#0069ED', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6', '#ec4899', '#06b6d4', '#84cc16'] +type VolumePaymentEntry = { + connector: string + colorIdx: number +} + function toUpperOptions(values: string[] = []): string[] { return values.map(v => v.trim()).filter(Boolean).map(v => v.toUpperCase()) } @@ -84,6 +92,58 @@ function uniqueUpperOptions(values: string[] = []): string[] { return Array.from(new Set(toUpperOptions(values))) } +function mulberry32(seed: number) { + return function random() { + let t = seed += 0x6D2B79F5 + t = Math.imul(t ^ (t >>> 15), t | 1) + t ^= t + Math.imul(t ^ (t >>> 7), t | 61) + return ((t ^ (t >>> 14)) >>> 0) / 4294967296 + } +} + +function buildVolumePaymentLog( + distribution: Array<{ name: string; count: number; percentage: number }>, + totalPayments: number, +): VolumePaymentEntry[] { + const total = Math.max(0, totalPayments) + if (!distribution.length || total === 0) return [] + + const payments: VolumePaymentEntry[] = [] + + distribution.forEach((item, idx) => { + for (let count = 0; count < item.count; count += 1) { + payments.push({ connector: item.name, colorIdx: idx }) + } + }) + + const rankedConnectors = distribution + .map((item, idx) => ({ connector: item.name, colorIdx: idx, percentage: item.percentage })) + .sort((a, b) => b.percentage - a.percentage) + + while (payments.length < total) { + const filler = rankedConnectors[payments.length % rankedConnectors.length] + payments.push({ connector: filler.connector, colorIdx: filler.colorIdx }) + } + + if (payments.length > total) { + payments.length = total + } + + const seed = distribution.reduce((acc, item, idx) => { + const connectorScore = Array.from(item.name).reduce((sum, char) => sum + char.charCodeAt(0), 0) + return acc + connectorScore + idx * 31 + item.count * 17 + Math.round(item.percentage * 10) + }, total * 13) + + const random = mulberry32(seed) + const shuffled = [...payments] + for (let idx = shuffled.length - 1; idx > 0; idx -= 1) { + const swapIndex = Math.floor(random() * (idx + 1)) + ;[shuffled[idx], shuffled[swapIndex]] = [shuffled[swapIndex], shuffled[idx]] + } + + return shuffled +} + function mapRoutingTypeToRuleParamType( keyType?: 'enum' | 'integer' | 'udf' | 'str_value' | 'global_ref' ): RuleEvaluateParams['type'] { @@ -93,6 +153,284 @@ function mapRoutingTypeToRuleParamType( return 'str_value' } +function queryString(params: Record) { + const search = new URLSearchParams() + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== '') { + search.set(key, String(value)) + } + }) + return search.toString() +} + +function formatDateTime(ms: number) { + return new Intl.DateTimeFormat(undefined, { + dateStyle: 'medium', + timeStyle: 'short', + }).format(new Date(ms)) +} + +function humanizeAuditValue(value?: string | null) { + if (!value) return '' + const normalized = value + .replace(/[_-]+/g, ' ') + .replace(/\s+/g, ' ') + .trim() + .toLowerCase() + + return normalized.replace(/\b\w/g, (char) => char.toUpperCase()) +} + +function routeLabel(route?: string | null) { + if (!route) return 'Unknown route' + if (route === 'decision_gateway' || route === 'decide_gateway') return 'Decide Gateway' + if (route === 'update_gateway_score') return 'Update Gateway' + if (route === 'routing_evaluate') return 'Rule Evaluate' + return humanizeAuditValue(route) +} + +function eventTypeLabel(eventType?: string | null) { + if (!eventType) return 'Unknown event' + if (eventType === 'decision') return 'Decide Gateway' + if (eventType === 'gateway_update') return 'Update Gateway' + if (eventType === 'rule_hit') return 'Rule Evaluate' + if (eventType === 'error') return 'Errors' + return humanizeAuditValue(eventType) +} + +function stageLabel(event: PaymentAuditEvent) { + if (event.event_stage === 'gateway_decided') return 'Decide Gateway' + if (event.event_stage === 'score_updated') return 'Update Gateway' + if (event.event_stage === 'rule_applied') return 'Rule Evaluate' + if (event.event_type === 'error') return 'Errors' + return humanizeAuditValue(event.event_stage || event.event_type) +} + +function eventPhase(event: PaymentAuditEvent) { + if (event.event_type === 'decision' || event.event_stage === 'gateway_decided') return 'Decide Gateway' + if (event.event_type === 'rule_hit' || event.event_stage === 'rule_applied') return 'Rule Evaluate' + if (event.event_type === 'gateway_update' || event.event_stage === 'score_updated') return 'Update Gateway' + return 'Errors' +} + +function badgeVariantForEvent(event: PaymentAuditEvent): 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' { + const normalizedStatus = (event.status || '').toUpperCase() + if ( + event.event_type === 'error' || + normalizedStatus === 'FAILURE' || + normalizedStatus.includes('FAILED') || + normalizedStatus.includes('DECLINED') + ) return 'red' + if (event.event_type === 'rule_hit') return 'purple' + if ( + normalizedStatus === 'CHARGED' || + normalizedStatus === 'AUTHORIZED' || + normalizedStatus === 'SUCCESS' + ) return 'green' + if (event.event_type === 'gateway_update') return 'green' + if (event.event_type === 'decision') return 'blue' + return 'orange' +} + +function summaryBadgeVariant(status?: string | null): 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' { + const normalizedStatus = (status || '').toUpperCase() + if ( + normalizedStatus === 'FAILURE' || + normalizedStatus.includes('FAILED') || + normalizedStatus.includes('DECLINED') + ) return 'red' + if ( + normalizedStatus === 'SUCCESS' || + normalizedStatus === 'CHARGED' || + normalizedStatus === 'AUTHORIZED' + ) return 'green' + return 'gray' +} + +function phaseBadgeVariant(phase: string): 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' { + if (phase === 'Decide Gateway') return 'blue' + if (phase === 'Rule Evaluate') return 'purple' + if (phase === 'Update Gateway') return 'green' + if (phase === 'Errors') return 'red' + return 'gray' +} + +function isRecord(value: unknown): value is Record { + return Boolean(value) && typeof value === 'object' && !Array.isArray(value) +} + +function cleanRecord(record: Record) { + return Object.fromEntries( + Object.entries(record).filter(([, value]) => value !== undefined && value !== null && value !== ''), + ) +} + +function stringifyValue(value: unknown) { + if (typeof value === 'string') return value + return JSON.stringify(value, null, 2) +} + +function buildAuditUrl(merchantId: string, paymentId: string) { + const qs = queryString({ + scope: 'current', + range: '24h', + page: 1, + page_size: 25, + merchant_id: merchantId, + payment_id: paymentId, + }) + return `/analytics/payment-audit?${qs}` +} + +function buildInspectorModel(event: PaymentAuditEvent | null) { + if (!event) return null + + const details = isRecord(event.details_json) ? event.details_json : {} + const explicitResponse = + details.response ?? + details.response_payload ?? + details.result ?? + details.output ?? + null + const requestPayload = + details.request ?? + details.request_payload ?? + details.input ?? + details.payload ?? + cleanRecord({ + payment_id: event.payment_id, + request_id: event.request_id, + payment_method_type: event.payment_method_type, + payment_method: event.payment_method, + gateway: event.gateway, + }) + const responsePayload = + explicitResponse ?? + cleanRecord({ + event_type: event.event_type, + status: event.status, + error_code: event.error_code, + error_message: event.error_message, + score_value: event.score_value, + sigma_factor: event.sigma_factor, + average_latency: event.average_latency, + tp99_latency: event.tp99_latency, + transaction_count: event.transaction_count, + rule_name: event.rule_name, + routing_approach: event.routing_approach, + }) + const responseRecord = isRecord(explicitResponse) ? explicitResponse : null + const decidedGatewayRecord = isRecord(responseRecord?.['decided_gateway']) ? responseRecord['decided_gateway'] : null + const scoreContext = + details.score_context ?? + (decidedGatewayRecord ? decidedGatewayRecord['gateway_priority_map'] : null) ?? + (responseRecord ? responseRecord['gateway_priority_map'] : null) ?? + null + const selectionReason = details.selection_reason ?? null + + const summaryRows = [ + { label: 'Phase', value: eventPhase(event) }, + { label: 'Stage', value: stageLabel(event) }, + { label: 'Route', value: routeLabel(event.route) }, + { label: 'Timestamp', value: formatDateTime(event.created_at_ms) }, + ...(event.merchant_id ? [{ label: 'Merchant', value: event.merchant_id }] : []), + ...(event.payment_id ? [{ label: 'Payment ID', value: event.payment_id }] : []), + ...(event.request_id ? [{ label: 'Request ID', value: event.request_id }] : []), + ...(event.gateway ? [{ label: 'Gateway', value: event.gateway }] : []), + ...(event.status ? [{ label: 'Status', value: humanizeAuditValue(event.status) }] : []), + ] + + const signalRecord = cleanRecord( + Object.fromEntries( + Object.entries(details).filter(([key]) => ![ + 'request', + 'request_payload', + 'input', + 'payload', + 'response', + 'response_payload', + 'result', + 'output', + 'score_context', + 'selection_reason', + ].includes(key)), + ), + ) + + return { + summaryRows, + requestPayload: isRecord(requestPayload) && !Object.keys(requestPayload).length ? null : requestPayload, + responsePayload: isRecord(responsePayload) && !Object.keys(responsePayload).length ? null : responsePayload, + scoreContext, + selectionReason, + signalRecord: Object.keys(signalRecord).length ? signalRecord : null, + rawEvent: { + ...event, + details_json: event.details_json, + }, + } +} + +function sectionButtonClass(active: boolean) { + return active + ? 'bg-brand-600 text-white' + : 'bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]' +} + +function EmptyAuditState({ title, body }: { title: string; body: string }) { + return ( +
+

{title}

+

{body}

+
+ ) +} + +function InspectorKeyValueGrid({ rows }: { rows: Array<{ label: string; value: string }> }) { + if (!rows.length) return null + + return ( +
+ {rows.map((row) => ( +
+

+ {row.label} +

+

{row.value}

+
+ ))} +
+ ) +} + +function InspectorJsonPanel({ + title, + value, + emptyMessage, +}: { + title: string + value: unknown + emptyMessage: string +}) { + return ( +
+
+

{title}

+
+ {value ? ( +
+          {stringifyValue(value)}
+        
+ ) : ( + + )} +
+ ) +} + export function DecisionExplorerPage() { const { merchantId } = useMerchantStore() const { routingKeysConfig, isLoading: routingKeysLoading, error: routingKeysError } = useDynamicRoutingConfig() @@ -140,6 +478,9 @@ export function DecisionExplorerPage() { const [filterOpen, setFilterOpen] = useState(false) const [responseOpen, setResponseOpen] = useState(false) const [volumeResponseOpen, setVolumeResponseOpen] = useState(false) + const [selectedAuditPaymentId, setSelectedAuditPaymentId] = useState(null) + const [selectedAuditEventId, setSelectedAuditEventId] = useState(null) + const [auditInspectorTab, setAuditInspectorTab] = useState('summary') const routingKeyNames = useMemo( () => Object.keys(routingKeysConfig).sort(), @@ -171,6 +512,15 @@ export function DecisionExplorerPage() { [routingKeysConfig] ) + const auditUrl = merchantId && selectedAuditPaymentId + ? buildAuditUrl(merchantId, selectedAuditPaymentId) + : null + + const auditDetail = useSWR(auditUrl, fetcher, { + refreshInterval: selectedAuditPaymentId ? 12000 : 0, + revalidateOnFocus: true, + }) + useEffect(() => { if (routingConfigUnavailable || routingKeysLoading) return @@ -225,6 +575,27 @@ export function DecisionExplorerPage() { cardBrandOptions, ]) + useEffect(() => { + if (!selectedAuditPaymentId) return + + const previousOverflow = document.body.style.overflow + const onKeyDown = (event: KeyboardEvent) => { + if (event.key === 'Escape') { + setSelectedAuditPaymentId(null) + setSelectedAuditEventId(null) + setAuditInspectorTab('summary') + } + } + + document.body.style.overflow = 'hidden' + window.addEventListener('keydown', onKeyDown) + + return () => { + document.body.style.overflow = previousOverflow + window.removeEventListener('keydown', onKeyDown) + } + }, [selectedAuditPaymentId]) + function set(field: keyof FormState, value: string | boolean) { setForm(f => ({ ...f, [field]: value })) } @@ -478,6 +849,59 @@ export function DecisionExplorerPage() { }, {} as Record) const pieData = volumeDistribution.map(d => ({ name: d.name, value: d.count })) + const simulatedVolumePayments = useMemo( + () => buildVolumePaymentLog(volumeDistribution, parseInt(volumePayments) || 0), + [volumeDistribution, volumePayments], + ) + + const auditSummary = useMemo(() => { + const results = auditDetail.data?.results || [] + return results.find((row) => row.payment_id === selectedAuditPaymentId) || results[0] || null + }, [auditDetail.data?.results, selectedAuditPaymentId]) + + const selectedAuditEvent = useMemo(() => { + const timeline = auditDetail.data?.timeline || [] + return timeline.find((event) => event.id === selectedAuditEventId) || timeline[0] || null + }, [auditDetail.data?.timeline, selectedAuditEventId]) + + useEffect(() => { + if (selectedAuditEvent?.id) { + setSelectedAuditEventId(selectedAuditEvent.id) + return + } + const first = auditDetail.data?.timeline?.[0] + if (first?.id) { + setSelectedAuditEventId(first.id) + } + }, [auditDetail.data?.timeline, selectedAuditEvent?.id]) + + const groupedAuditTimeline = useMemo(() => { + const groups: Array<{ phase: string; events: PaymentAuditEvent[] }> = [] + for (const event of auditDetail.data?.timeline || []) { + const phase = eventPhase(event) + const current = groups[groups.length - 1] + if (!current || current.phase !== phase) { + groups.push({ phase, events: [event] }) + } else { + current.events.push(event) + } + } + return groups + }, [auditDetail.data?.timeline]) + + const auditInspectorModel = useMemo(() => buildInspectorModel(selectedAuditEvent), [selectedAuditEvent]) + + function openAuditModal(paymentId: string) { + setSelectedAuditPaymentId(paymentId) + setSelectedAuditEventId(null) + setAuditInspectorTab('summary') + } + + function closeAuditModal() { + setSelectedAuditPaymentId(null) + setSelectedAuditEventId(null) + setAuditInspectorTab('summary') + } return (
@@ -993,7 +1417,12 @@ export function DecisionExplorerPage() { -

Payment Log

+
+

Payment Log

+

+ Simulated sequence based on the configured split, shown in shuffled order instead of connector blocks. +

+
@@ -1004,35 +1433,20 @@ export function DecisionExplorerPage() { - {Array.from({ length: parseInt(volumePayments) || 0 }).map((_, idx) => { - let cumulative = 0 - let connector = volumeDistribution[0]?.name || '' - let colorIdx = 0 - - for (let i = 0; i < volumeDistribution.length; i++) { - cumulative += volumeDistribution[i].count - if (idx < cumulative) { - connector = volumeDistribution[i].name - colorIdx = i - break - } - } - - return ( - - - - - ) - })} + {simulatedVolumePayments.map((entry, idx) => ( + + + + + ))}
{idx + 1} -
-
- {connector} -
-
{idx + 1} +
+
+ {entry.connector} +
+
@@ -1202,7 +1616,26 @@ export function DecisionExplorerPage() { {simulationResults.map((res, idx) => ( {idx + 1} - {res.paymentId.slice(-8)} + + + {res.decidedGateway} @@ -1367,6 +1800,234 @@ export function DecisionExplorerPage() { )}
+ + {selectedAuditPaymentId && ( +
+ + +
+
+ +
+
+
+

Audit Timeline

+

+ Choose a step to inspect its request, response, and scoring context. +

+
+
+ {auditDetail.isLoading && !auditDetail.data ? ( +
+ + Loading payment audit… +
+ ) : auditDetail.error ? ( + + ) : groupedAuditTimeline.length ? ( +
+ {groupedAuditTimeline.map((group) => ( +
+
+ {group.phase} +
+
+ {group.events.map((event) => ( + + ))} +
+
+ ))} +
+ ) : ( + + )} +
+
+ +
+
+
+
+

+ {selectedAuditEvent ? stageLabel(selectedAuditEvent) : 'Audit Inspector'} +

+

+ {selectedAuditEvent + ? `${routeLabel(selectedAuditEvent.route)} · ${formatDateTime(selectedAuditEvent.created_at_ms)}` + : 'Select an event from the left to inspect payloads.'} +

+
+
+ {selectedAuditEvent?.gateway ? {selectedAuditEvent.gateway} : null} + {selectedAuditEvent?.status ? ( + + {humanizeAuditValue(selectedAuditEvent.status)} + + ) : null} +
+
+
+ {(['summary', 'input', 'response', 'raw'] as AuditInspectorTab[]).map((tab) => ( + + ))} +
+
+ +
+ {auditDetail.isLoading && !auditDetail.data ? ( +
+ + Loading inspector… +
+ ) : auditInspectorModel ? ( +
+ {auditInspectorTab === 'summary' ? ( + <> + + {auditInspectorModel.selectionReason ? ( +
+

+ Selection Reason +

+

+ {stringifyValue(auditInspectorModel.selectionReason)} +

+
+ ) : null} + + {auditInspectorModel.signalRecord ? ( + + ) : null} + + ) : null} + + {auditInspectorTab === 'input' ? ( + + ) : null} + + {auditInspectorTab === 'response' ? ( + + ) : null} + + {auditInspectorTab === 'raw' ? ( + + ) : null} +
+ ) : ( + + )} +
+
+
+
+
+ )}
) } diff --git a/website/src/components/pages/EuclidRulesPage.tsx b/website/src/components/pages/EuclidRulesPage.tsx index d9fd5d03..4667e373 100644 --- a/website/src/components/pages/EuclidRulesPage.tsx +++ b/website/src/components/pages/EuclidRulesPage.tsx @@ -633,7 +633,7 @@ export function EuclidRulesPage() {

Rule-Based Routing

-

Create Euclid DSL declarative routing rules

+

Create declarative routing rules

@@ -651,73 +651,67 @@ export function EuclidRulesPage() { ) : allAlgorithms.length === 0 ? (

No rules yet.

) : ( - - - {allAlgorithms.map((algo) => { - const isActive = activeIds.has(algo.id) - const isExpanded = expandedRuleIds.has(algo.id) - // Backend returns algorithm_data, map it to algorithm for display - const algorithm = algo.algorithm_data || algo.algorithm - return ( - <> - - - - - - {isExpanded && ( - - - - )} - - ) - })} - -
-

{algo.name}

-

{algorithm?.type}

-
- - {isActive ? 'Active' : 'Inactive'} - - -
- - {!isActive && ( - - )} +
+ {allAlgorithms.map((algo) => { + const isActive = activeIds.has(algo.id) + const isExpanded = expandedRuleIds.has(algo.id) + const algorithm = algo.algorithm_data || algo.algorithm + + return ( +
+
+
+

{algo.name}

+

{algorithm?.type}

+
+ +
+ + {isActive ? 'Active' : 'Inactive'} + + + {!isActive && ( + + )} +
+
+ + {isExpanded && ( +
+
+

ID: {algo.id}

+

Description: {algo.description || 'N/A'}

+

Algorithm For: {algo.algorithm_for}

+ {algo.created_at && ( +

Created: {new Date(algo.created_at).toLocaleString()}

+ )} +
+ Configuration: +
+                                  {JSON.stringify(algorithm, null, 2)}
+                                
-
-
-

ID: {algo.id}

-

Description: {algo.description || 'N/A'}

-

Algorithm For: {algo.algorithm_for}

- {algo.created_at && ( -

Created: {new Date(algo.created_at).toLocaleString()}

- )} -
- Configuration: -
-                                      {JSON.stringify(algorithm, null, 2)}
-                                    
-
-
-
+
+
+ )} +
+ ) + })} +
)} diff --git a/website/src/components/pages/PaymentAuditPage.tsx b/website/src/components/pages/PaymentAuditPage.tsx index 7b6f90cd..b775fd0a 100644 --- a/website/src/components/pages/PaymentAuditPage.tsx +++ b/website/src/components/pages/PaymentAuditPage.tsx @@ -5,7 +5,6 @@ import { useMerchantStore } from '../../store/merchantStore' import { fetcher } from '../../lib/api' import { AnalyticsRange, - AnalyticsScope, PaymentAuditEvent, PaymentAuditResponse, } from '../../types/api' @@ -16,8 +15,17 @@ import { Spinner } from '../ui/Spinner' import { ErrorMessage } from '../ui/ErrorMessage' const RANGE_OPTIONS: AnalyticsRange[] = ['15m', '1h', '24h'] -const STATUS_OPTIONS = ['', 'success', 'failure', 'snapshot', 'hit'] -const EVENT_TYPE_OPTIONS = ['', 'decision', 'score_snapshot', 'rule_hit', 'error'] +const STATUS_OPTIONS = [ + { value: '', label: 'Any status' }, + { value: 'success', label: 'Success' }, + { value: 'failure', label: 'Failure' }, +] +const ROUTE_OPTIONS = [ + { value: '', label: 'Any route' }, + { value: 'decide_gateway', label: 'Decide Gateway' }, + { value: 'update_gateway_score', label: 'Update Gateway' }, + { value: 'routing_evaluate', label: 'Rule Evaluate' }, +] const INSPECTOR_TABS = ['summary', 'input', 'response', 'raw'] as const type AuditFilters = { @@ -42,6 +50,20 @@ const EMPTY_FILTERS: AuditFilters = { errorCode: '', } +function normalizeAuditFilters(filters: AuditFilters): AuditFilters { + const paymentId = filters.paymentId.trim() + const requestId = paymentId ? '' : filters.requestId.trim() + return { + paymentId, + requestId, + gateway: filters.gateway.trim(), + route: filters.route, + status: filters.status, + eventType: filters.eventType, + errorCode: filters.errorCode.trim(), + } +} + function queryString(params: Record) { const search = new URLSearchParams() Object.entries(params).forEach(([key, value]) => { @@ -53,44 +75,38 @@ function queryString(params: Record) { } function buildAuditUrl( - scope: AnalyticsScope, range: AnalyticsRange, - merchantId: string | undefined, + merchantId: string, page: number, pageSize: number, filters: AuditFilters, ) { + const normalizedFilters = normalizeAuditFilters(filters) const params: Record = { - scope, + scope: 'current', range, page, page_size: pageSize, - payment_id: filters.paymentId || undefined, - request_id: filters.requestId || undefined, - gateway: filters.gateway || undefined, - route: filters.route || undefined, - status: filters.status || undefined, - event_type: filters.eventType || undefined, - error_code: filters.errorCode || undefined, - } - if (scope === 'current' && merchantId) { - params.merchant_id = merchantId + merchant_id: merchantId, + payment_id: normalizedFilters.paymentId || undefined, + request_id: normalizedFilters.requestId || undefined, + gateway: normalizedFilters.gateway || undefined, + route: normalizedFilters.route || undefined, + status: normalizedFilters.status || undefined, + event_type: normalizedFilters.eventType || undefined, + error_code: normalizedFilters.errorCode || undefined, } const qs = queryString(params) return qs ? `/analytics/payment-audit?${qs}` : '/analytics/payment-audit' } -function parseScope(_value: string | null): AnalyticsScope { - return 'current' -} - function parseRange(value: string | null): AnalyticsRange { if (value === '15m' || value === '24h') return value return '24h' } function parseFilters(searchParams: URLSearchParams): AuditFilters { - return { + return normalizeAuditFilters({ paymentId: searchParams.get('payment_id') || '', requestId: searchParams.get('request_id') || '', gateway: searchParams.get('gateway') || '', @@ -98,7 +114,7 @@ function parseFilters(searchParams: URLSearchParams): AuditFilters { status: searchParams.get('status') || '', eventType: searchParams.get('event_type') || '', errorCode: searchParams.get('error_code') || '', - } + }) } function formatDateTime(ms: number) { @@ -132,41 +148,75 @@ function humanizeAuditValue(value?: string | null) { function routeLabel(route?: string | null) { if (!route) return 'Unknown route' if (route === 'decision_gateway' || route === 'decide_gateway') return 'Decide Gateway' + if (route === 'update_gateway_score') return 'Update Gateway' + if (route === 'routing_evaluate') return 'Rule Evaluate' return humanizeAuditValue(route) } +function eventTypeLabel(eventType?: string | null) { + if (!eventType) return 'Unknown event' + if (eventType === 'decision') return 'Decide Gateway' + if (eventType === 'gateway_update') return 'Update Gateway' + if (eventType === 'rule_hit') return 'Rule Evaluate' + if (eventType === 'error') return 'Errors' + return humanizeAuditValue(eventType) +} + function stageLabel(event: PaymentAuditEvent) { if (event.event_stage === 'gateway_decided') return 'Decide Gateway' + if (event.event_stage === 'score_updated') return 'Update Gateway' + if (event.event_stage === 'rule_applied') return 'Rule Evaluate' + if (event.event_type === 'error') return 'Errors' return humanizeAuditValue(event.event_stage || event.event_type) } function eventPhase(event: PaymentAuditEvent) { if (event.event_type === 'decision' || event.event_stage === 'gateway_decided') return 'Decide Gateway' - if (event.event_type === 'rule_hit' || event.event_stage === 'rule_applied') return 'Rule Applied' - if (event.event_type === 'score_snapshot' || event.event_stage === 'score_updated') return 'Update Gateway Score' - return 'Final Outcome' + if (event.event_type === 'rule_hit' || event.event_stage === 'rule_applied') return 'Rule Evaluate' + if (event.event_type === 'gateway_update' || event.event_stage === 'score_updated') return 'Update Gateway' + return 'Errors' } function badgeVariantForEvent(event: PaymentAuditEvent): 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' { - if (event.event_type === 'error' || event.status === 'failure') return 'red' + const normalizedStatus = (event.status || '').toUpperCase() + if ( + event.event_type === 'error' || + normalizedStatus === 'FAILURE' || + normalizedStatus.includes('FAILED') || + normalizedStatus.includes('DECLINED') + ) return 'red' if (event.event_type === 'rule_hit') return 'purple' - if (event.event_type === 'score_snapshot') return 'green' + if ( + normalizedStatus === 'CHARGED' || + normalizedStatus === 'AUTHORIZED' || + normalizedStatus === 'SUCCESS' + ) return 'green' + if (event.event_type === 'gateway_update') return 'green' if (event.event_type === 'decision') return 'blue' return 'orange' } function summaryBadgeVariant(status?: string | null): 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' { - if (status === 'failure') return 'red' - if (status === 'success') return 'green' - if (status === 'snapshot') return 'blue' - if (status === 'hit') return 'purple' + const normalizedStatus = (status || '').toUpperCase() + if ( + normalizedStatus === 'FAILURE' || + normalizedStatus.includes('FAILED') || + normalizedStatus.includes('DECLINED') + ) return 'red' + if ( + normalizedStatus === 'SUCCESS' || + normalizedStatus === 'CHARGED' || + normalizedStatus === 'AUTHORIZED' + ) return 'green' + if (normalizedStatus === 'HIT') return 'purple' return 'gray' } function phaseBadgeVariant(phase: string): 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' { if (phase === 'Decide Gateway') return 'blue' - if (phase === 'Rule Applied') return 'purple' - if (phase === 'Update Gateway Score') return 'green' + if (phase === 'Rule Evaluate') return 'purple' + if (phase === 'Update Gateway') return 'green' + if (phase === 'Errors') return 'red' return 'orange' } @@ -322,7 +372,7 @@ function buildInspectorModel(event: PaymentAuditEvent | null) { ) return { - summaryRows, + summaryRows, requestPayload: isRecord(requestPayload) && !Object.keys(requestPayload).length ? null : requestPayload, responsePayload: isRecord(responsePayload) && !Object.keys(responsePayload).length ? null : responsePayload, scoreContext, @@ -339,13 +389,11 @@ export function PaymentAuditPage() { const { merchantId } = useMerchantStore() const [searchParams, setSearchParams] = useSearchParams() - const initialScope = parseScope(searchParams.get('scope')) const initialRange = parseRange(searchParams.get('range')) const initialFilters = parseFilters(searchParams) const initialPage = Math.max(1, Number(searchParams.get('page') || '1')) const initialSelectedKey = searchParams.get('selected') || '' - const [scope, setScope] = useState(initialScope) const [range, setRange] = useState(initialRange) const [filters, setFilters] = useState(initialFilters) const [appliedFilters, setAppliedFilters] = useState(initialFilters) @@ -355,11 +403,10 @@ export function PaymentAuditPage() { const [inspectorTab, setInspectorTab] = useState('summary') const pageSize = 12 - const canQueryCurrent = scope === 'all' || Boolean(merchantId) - const effectiveMerchantId = scope === 'current' ? merchantId || undefined : undefined + const canQueryCurrent = Boolean(merchantId) - const searchUrl = canQueryCurrent - ? buildAuditUrl(scope, range, effectiveMerchantId, page, pageSize, appliedFilters) + const searchUrl = canQueryCurrent && merchantId + ? buildAuditUrl(range, merchantId, page, pageSize, appliedFilters) : null const auditSearch = useSWR(searchUrl, fetcher, { @@ -385,9 +432,10 @@ export function PaymentAuditPage() { const detailFilters = useMemo(() => { if (!selectedSummary) return null + const paymentId = selectedSummary.payment_id || '' return { - paymentId: selectedSummary.payment_id || '', - requestId: selectedSummary.request_id || '', + paymentId, + requestId: paymentId ? '' : (selectedSummary.request_id || ''), gateway: '', route: '', status: '', @@ -396,8 +444,8 @@ export function PaymentAuditPage() { } }, [selectedSummary]) - const detailUrl = canQueryCurrent && detailFilters - ? buildAuditUrl(scope, range, effectiveMerchantId, 1, 50, detailFilters) + const detailUrl = canQueryCurrent && merchantId && detailFilters + ? buildAuditUrl(range, merchantId, 1, 50, detailFilters) : null const auditDetail = useSWR(detailUrl, fetcher, { @@ -443,33 +491,34 @@ export function PaymentAuditPage() { const activeGateways = selectedSummary?.gateways?.length || 0 const latestSeen = selectedSummary ? formatRelative(selectedSummary.last_seen_ms) : 'No activity' - function syncSearch(nextScope: AnalyticsScope, nextRange: AnalyticsRange, nextPage: number, nextFilters: AuditFilters, nextSelectedKey?: string) { + function syncSearch(nextRange: AnalyticsRange, nextPage: number, nextFilters: AuditFilters, nextSelectedKey?: string) { + const normalizedFilters = normalizeAuditFilters(nextFilters) const nextQuery = queryString({ - scope: nextScope, range: nextRange, - merchant_id: nextScope === 'current' ? effectiveMerchantId : undefined, page: nextPage > 1 ? nextPage : undefined, - payment_id: nextFilters.paymentId || undefined, - request_id: nextFilters.requestId || undefined, - gateway: nextFilters.gateway || undefined, - route: nextFilters.route || undefined, - status: nextFilters.status || undefined, - event_type: nextFilters.eventType || undefined, - error_code: nextFilters.errorCode || undefined, + payment_id: normalizedFilters.paymentId || undefined, + request_id: normalizedFilters.requestId || undefined, + gateway: normalizedFilters.gateway || undefined, + route: normalizedFilters.route || undefined, + status: normalizedFilters.status || undefined, + event_type: normalizedFilters.eventType || undefined, + error_code: normalizedFilters.errorCode || undefined, selected: nextSelectedKey || undefined, }) setSearchParams(nextQuery) } function updateFilter(field: keyof AuditFilters, value: string) { - setFilters((current) => ({ ...current, [field]: value })) + setFilters((current) => normalizeAuditFilters({ ...current, [field]: value })) } function applyFilters() { const nextPage = 1 + const normalizedFilters = normalizeAuditFilters(filters) setPage(nextPage) - setAppliedFilters(filters) - syncSearch(scope, range, nextPage, filters) + setFilters(normalizedFilters) + setAppliedFilters(normalizedFilters) + syncSearch(range, nextPage, normalizedFilters) } function clearFilters() { @@ -477,7 +526,7 @@ export function PaymentAuditPage() { setPage(nextPage) setFilters(EMPTY_FILTERS) setAppliedFilters(EMPTY_FILTERS) - syncSearch(scope, range, nextPage, EMPTY_FILTERS) + syncSearch(range, nextPage, EMPTY_FILTERS) } function refreshAll() { @@ -485,24 +534,16 @@ export function PaymentAuditPage() { auditDetail.mutate() } - function updateScope(nextScope: AnalyticsScope) { - if (nextScope === 'all') return - const nextPage = 1 - setScope(nextScope) - setPage(nextPage) - syncSearch(nextScope, range, nextPage, appliedFilters, selectedKey) - } - function updateRange(nextRange: AnalyticsRange) { const nextPage = 1 setRange(nextRange) setPage(nextPage) - syncSearch(scope, nextRange, nextPage, appliedFilters, selectedKey) + syncSearch(nextRange, nextPage, appliedFilters, selectedKey) } function selectSummary(lookupKey: string) { setSelectedKey(lookupKey) - syncSearch(scope, range, page, appliedFilters, lookupKey) + syncSearch(range, page, appliedFilters, lookupKey) } async function copyValue(value: string | null | undefined) { @@ -516,9 +557,10 @@ export function PaymentAuditPage() { function openRelatedEvents() { if (!selectedEvent) return + const paymentId = selectedEvent.payment_id || '' const nextFilters: AuditFilters = { - paymentId: selectedEvent.payment_id || '', - requestId: selectedEvent.request_id || '', + paymentId, + requestId: paymentId ? '' : (selectedEvent.request_id || ''), gateway: selectedEvent.gateway || '', route: '', status: '', @@ -528,21 +570,21 @@ export function PaymentAuditPage() { setFilters(nextFilters) setAppliedFilters(nextFilters) setPage(1) - syncSearch(scope, range, 1, nextFilters, selectedKey) + syncSearch(range, 1, nextFilters, selectedKey) } if (!canQueryCurrent) { return (
-

Payment Audit

+

Decision Audit

- Search a payment and inspect every routing step, score update, rule hit, and failure in one timeline. + Search a payment and inspect gateway decisions, gateway updates, rule evaluations, and errors in one transaction trail.

) @@ -552,15 +594,12 @@ export function PaymentAuditPage() {
-

Payment Audit

+

Decision Audit

- Search by payment or request, then inspect the full sequence of gateway decision, rule application, score updates, and failures with the exact event payload captured at each step. + Search by payment or request, then inspect the full sequence of gateway decisions, gateway updates, rule evaluations, and errors with the exact payload captured at each step.

- @@ -578,17 +617,15 @@ export function PaymentAuditPage() { {value} ))} - - {scope === 'all' ? 'All merchants' : merchantId || 'Current merchant'} - + {merchantId || 'Current merchant'}
-

Search Audit Trail

+

Search Decision Trail

- Use payment or request IDs when you have them. Error code, gateway, route, status, and event type narrow operational noise quickly. + Use payment or request IDs when you have them. Error code, gateway, route, and status narrow operational noise quickly.

@@ -597,19 +634,18 @@ export function PaymentAuditPage() { updateFilter('paymentId', event.target.value)} placeholder="Payment ID" /> updateFilter('requestId', event.target.value)} placeholder="Request ID" /> updateFilter('gateway', event.target.value)} placeholder="Gateway" /> - updateFilter('route', event.target.value)} placeholder="Route" /> - updateFilter('errorCode', event.target.value)} placeholder="Error code" /> - updateFilter('route', event.target.value)}> + {ROUTE_OPTIONS.map((option) => ( + ))} - updateFilter('errorCode', event.target.value)} placeholder="Error code" /> + @@ -626,7 +662,7 @@ export function PaymentAuditPage() { {loading && (
- Loading payment audit data… + Loading decision audit data…
)} @@ -646,7 +682,7 @@ export function PaymentAuditPage() { @@ -657,7 +693,7 @@ export function PaymentAuditPage() { onClick={() => { const nextPage = page + 1 setPage(nextPage) - syncSearch(scope, range, nextPage, appliedFilters, selectedKey) + syncSearch(range, nextPage, appliedFilters, selectedKey) }} > Next @@ -685,7 +721,9 @@ export function PaymentAuditPage() { {row.merchant_id || 'unknown merchant'} · {formatDateTime(row.last_seen_ms)}

- {row.latest_status || 'unknown'} + + {humanizeAuditValue(row.latest_status) || 'Unknown'} +
{row.latest_stage ? {row.latest_stage} : null} @@ -720,7 +758,11 @@ export function PaymentAuditPage() {
{selectedSummary?.latest_gateway ? {selectedSummary.latest_gateway} : null} {selectedSummary?.latest_stage ? {selectedSummary.latest_stage} : null} - {selectedSummary?.latest_status ? {selectedSummary.latest_status} : null} + {selectedSummary?.latest_status ? ( + + {humanizeAuditValue(selectedSummary.latest_status)} + + ) : null}
@@ -768,8 +810,12 @@ export function PaymentAuditPage() {

- {event.event_type} - {event.status ? {event.status} : null} + {eventTypeLabel(event.event_type)} + {event.status ? ( + + {humanizeAuditValue(event.status)} + + ) : null} {event.gateway ? {event.gateway} : null}
@@ -797,8 +843,8 @@ export function PaymentAuditPage() {
) : ( )} @@ -898,7 +944,7 @@ export function PaymentAuditPage() { ) : ( )} diff --git a/website/src/components/pages/RoutingHubPage.tsx b/website/src/components/pages/RoutingHubPage.tsx index 78c85bc7..e88f60a1 100644 --- a/website/src/components/pages/RoutingHubPage.tsx +++ b/website/src/components/pages/RoutingHubPage.tsx @@ -44,7 +44,7 @@ export function RoutingHubPage() { { id: 'rules', title: 'Rule-Based Routing', - description: 'Declarative Euclid DSL rules to route payments based on conditions and attributes.', + description: 'Declarative routing rules to route payments based on conditions and attributes.', icon: Layers, route: '/routing/rules', algorithmType: 'advanced', @@ -118,4 +118,4 @@ export function RoutingHubPage() {
) -} \ No newline at end of file +} diff --git a/website/src/components/pages/SRRoutingPage.tsx b/website/src/components/pages/SRRoutingPage.tsx index 96ee2b18..4482c372 100644 --- a/website/src/components/pages/SRRoutingPage.tsx +++ b/website/src/components/pages/SRRoutingPage.tsx @@ -243,136 +243,157 @@ export function SRRoutingPage() {
-

Success Rate Config

+
+

Default Success Rate Config

+

+ Base settings used when there is no payment-method-specific override. +

+
- - - - - - - - - - - - - - {/* Default row */} - - - - - - - - + + - {fields.map((field, idx) => { - const methodType = watchedRows?.[idx]?.paymentMethodType || '' - const methodOptions = PAYMENT_METHODS[methodType] || [] - return ( - - - - - - - - - ) - })} - -
Payment Method TypePayment MethodBucket SizeSuccess RateHedging %Latency Threshold (ms) -
Default - - {errors.defaultBucketSize && ( -

{errors.defaultBucketSize.message}

- )} -
- - - - - - -
- - - - - - - - - - - -
-
- + + + + + + + + + + +
+

Sub-Level Overrides

+

+ Optional overrides for specific payment method type and method combinations. +

+ +
+ + {fields.length ? ( + + + + + + + + + + + + {fields.map((field, idx) => { + const methodType = watchedRows?.[idx]?.paymentMethodType || '' + const methodOptions = PAYMENT_METHODS[methodType] || [] + return ( + + + + + + + + + ) + })} + +
Payment Method TypePayment MethodBucket SizeHedging %Latency Threshold (ms) +
+ + + + + + + + + + + +
+ ) : ( +
+ No sub-level overrides configured. The default row above is the only active configuration. +
+ )}
diff --git a/website/src/types/api.ts b/website/src/types/api.ts index 3c4c33ba..c4e85991 100644 --- a/website/src/types/api.ts +++ b/website/src/types/api.ts @@ -146,15 +146,23 @@ export interface SRDimensionRequest { export type AnalyticsScope = 'current' | 'all' export type AnalyticsRange = '15m' | '1h' | '24h' +export type AnalyticsRangeValue = AnalyticsRange | 'custom' export interface AnalyticsQuery { merchant_id?: string scope?: AnalyticsScope range?: AnalyticsRange + start_ms?: number + end_ms?: number page?: number page_size?: number payment_method_type?: string payment_method?: string + card_network?: string + card_is_in?: string + currency?: string + country?: string + auth_type?: string gateway?: string } @@ -191,16 +199,22 @@ export interface AnalyticsOverviewResponse { scope: AnalyticsScope merchant_id?: string | null kpis: AnalyticsKpi[] + route_hits: AnalyticsRouteHit[] top_scores: GatewayScoreSnapshot[] top_errors: AnalyticsErrorSummary[] top_rules: AnalyticsRuleHit[] } +export interface AnalyticsRouteHit { + route: string + count: number +} + export interface AnalyticsGatewayScoresResponse { generated_at_ms: number scope: AnalyticsScope merchant_id?: string | null - range: AnalyticsRange + range: AnalyticsRangeValue snapshots: GatewayScoreSnapshot[] series: GatewayScoreSeriesPoint[] } @@ -215,7 +229,7 @@ export interface AnalyticsDecisionResponse { generated_at_ms: number scope: AnalyticsScope merchant_id?: string | null - range: AnalyticsRange + range: AnalyticsRangeValue tiles: AnalyticsKpi[] series: AnalyticsDecisionPoint[] approaches: AnalyticsRuleHit[] @@ -231,7 +245,7 @@ export interface AnalyticsRoutingStatsResponse { generated_at_ms: number scope: AnalyticsScope merchant_id?: string | null - range: AnalyticsRange + range: AnalyticsRangeValue gateway_share: AnalyticsGatewaySharePoint[] top_rules: AnalyticsRuleHit[] sr_trend: GatewayScoreSeriesPoint[] @@ -239,11 +253,22 @@ export interface AnalyticsRoutingStatsResponse { } export interface RoutingFilterOptions { - payment_method_types: string[] - payment_methods: string[] + dimensions: RoutingFilterDimension[] + missing_dimensions: RoutingFilterDimensionHint[] gateways: string[] } +export interface RoutingFilterDimension { + key: string + label: string + values: string[] +} + +export interface RoutingFilterDimensionHint { + key: string + label: string +} + export interface AnalyticsErrorSummary { route: string error_code: string From 81c4281d2aa9bec93fb2442e7c8f55f17fec40e8 Mon Sep 17 00:00:00 2001 From: Prajjwal kumar Date: Fri, 17 Apr 2026 13:40:58 +0530 Subject: [PATCH 92/95] feat: ui re-designed with required fields --- .mintlify-dev.log | 6 +- src/analytics/service.rs | 197 ++++++++- src/euclid/handlers/routing_rules.rs | 183 +++++--- src/routes/analytics.rs | 25 +- website/dist/assets/index-1vrpPGUz.js | 334 --------------- website/dist/assets/index-Bf1zG_Ya.js | 334 +++++++++++++++ website/dist/assets/index-XOTDNfmE.css | 1 + website/dist/assets/index-_A3lu81S.css | 1 - website/dist/index.html | 4 +- .../components/pages/DecisionExplorerPage.tsx | 401 +++++++++++++++++- 10 files changed, 1073 insertions(+), 413 deletions(-) delete mode 100644 website/dist/assets/index-1vrpPGUz.js create mode 100644 website/dist/assets/index-Bf1zG_Ya.js create mode 100644 website/dist/assets/index-XOTDNfmE.css delete mode 100644 website/dist/assets/index-_A3lu81S.css diff --git a/.mintlify-dev.log b/.mintlify-dev.log index c9a5fa61..8f8cc9f1 100644 --- a/.mintlify-dev.log +++ b/.mintlify-dev.log @@ -1,12 +1,10 @@ ⠋ preparing local preview... ⠙ preparing local preview... +warning - Error validating OpenAPI file /mint.json: Error: Failed to validate OpenAPI schema:Unknown path: Can’t find supported Swagger/OpenAPI version in specification, version must be a string. +⠙ preparing local preview... ⠹ preparing local preview... ⠸ preparing local preview... -warning - Error validating OpenAPI file /mint.json: Error: Failed to validate OpenAPI schema:Unknown path: Can’t find supported Swagger/OpenAPI version in specification, version must be a string. -⠸ preparing local preview... ⠼ preparing local preview... -⠴ preparing local preview... -⠦ preparing local preview... update available - run `mint update` to get the latest version ✓ preview ready diff --git a/src/analytics/service.rs b/src/analytics/service.rs index c055a396..02588ab6 100644 --- a/src/analytics/service.rs +++ b/src/analytics/service.rs @@ -93,6 +93,7 @@ fn event_type_label(kind: &str) -> &'static str { "gateway_update" => "gateway_update", "score_snapshot" => "score_snapshot", "rule_hit" => "rule_hit", + "rule_evaluation_preview" => "rule_evaluation_preview", "error" => "error", "request_hit" => "request_hit", _ => "other", @@ -295,6 +296,44 @@ pub fn record_rule_hit_event( }); } +pub fn record_rule_evaluation_preview_event( + merchant_id: Option, + payment_id: Option, + gateway: Option, + rule_name: Option, + status: Option, + details: Option, +) { + spawn_persist(NewAnalyticsEvent { + event_type: "rule_evaluation_preview".to_string(), + merchant_id, + payment_id, + request_id: None, + payment_method_type: None, + payment_method: None, + card_network: None, + card_is_in: None, + currency: None, + country: None, + auth_type: None, + gateway, + event_stage: Some("preview_evaluated".to_string()), + routing_approach: Some("RULE_EVALUATE_PREVIEW".to_string()), + rule_name, + status, + error_code: None, + error_message: None, + score_value: None, + sigma_factor: None, + average_latency: None, + tp99_latency: None, + transaction_count: None, + route: Some("routing_evaluate".to_string()), + details, + created_at_ms: now_ms(), + }); +} + pub fn record_error_event( route: &str, merchant_id: Option, @@ -538,6 +577,94 @@ async fn load_payment_audit_events( .or_else(|_| Ok(Vec::new())) } +async fn load_preview_trace_events( + state: &crate::app::TenantAppState, + query: &PaymentAuditQuery, +) -> Result, error::ApiError> { + let conn = &state + .db + .get_conn() + .await + .map_err(|_| error::ApiError::DatabaseError)?; + + let mut builder = analytics_dsl::analytics_event + .select(AnalyticsEvent::as_select()) + .into_boxed(); + let cutoff_ms = now_ms().saturating_sub(query.range.window_ms()); + builder = builder.filter(analytics_dsl::created_at_ms.ge(cutoff_ms)); + builder = builder.filter(analytics_dsl::route.eq("routing_evaluate".to_string())); + builder = builder.filter(analytics_dsl::event_type.eq_any(vec![ + "rule_evaluation_preview".to_string(), + "error".to_string(), + ])); + + if query.scope == AnalyticsScope::Current { + if let Some(merchant_id) = &query.merchant_id { + builder = builder.filter(analytics_dsl::merchant_id.eq(merchant_id.clone())); + } + } + + if let Some(payment_id) = &query.payment_id { + builder = builder.filter(analytics_dsl::payment_id.eq(payment_id.clone())); + } + + if query.payment_id.is_none() { + if let Some(request_id) = &query.request_id { + builder = builder.filter(analytics_dsl::request_id.eq(request_id.clone())); + } + } + + if let Some(gateway) = &query.gateway { + builder = builder.filter(analytics_dsl::gateway.eq(gateway.clone())); + } + + if let Some(status) = &query.status { + if status.eq_ignore_ascii_case("success") { + builder = builder.filter( + analytics_dsl::status + .eq("success".to_string()) + .or(analytics_dsl::status.eq("default_selection".to_string())), + ); + } else if status.eq_ignore_ascii_case("failure") || status.eq_ignore_ascii_case("FAILURE") { + builder = builder.filter( + analytics_dsl::status + .eq("FAILURE".to_string()) + .or(analytics_dsl::status + .like("%FAILED%") + .or(analytics_dsl::status.like("%DECLINED%"))), + ); + } else { + builder = builder.filter(analytics_dsl::status.eq(status.clone())); + } + } + + if let Some(event_type) = &query.event_type { + builder = builder.filter(analytics_dsl::event_type.eq(event_type.clone())); + } + + if let Some(error_code) = &query.error_code { + builder = builder.filter(analytics_dsl::error_code.eq(error_code.clone())); + } + + builder + .order(( + analytics_dsl::created_at_ms.desc(), + analytics_dsl::id.desc(), + )) + .load_async::(&**conn) + .await + .map_err(|err| { + crate::logger::error!( + error = ?err, + merchant_id = ?query.merchant_id, + payment_id = ?query.payment_id, + "Preview trace read failed; returning empty preview state" + ); + err + }) + .or_else(|_| Ok(Vec::new())) +} + fn parse_details_json(details: &Option) -> Option { details .as_ref() @@ -633,6 +760,7 @@ fn payment_audit_stage_label(event: &AnalyticsEvent) -> &'static str { "decision" => "Decide Gateway", "gateway_update" => "Update Gateway", "rule_hit" => "Rule Evaluate", + "rule_evaluation_preview" => "Preview Result", "error" => "Errors", _ => "Errors", } @@ -1367,7 +1495,9 @@ fn summarise_payment_audit_results(events: &[AnalyticsEvent]) -> Vec Some("FAILURE".to_string()), - "decision" | "gateway_update" => event.status.clone(), + "decision" | "gateway_update" | "rule_evaluation_preview" => { + event.status.clone() + } _ => None, }) }), @@ -1662,6 +1792,71 @@ pub async fn payment_audit( }) } +pub async fn preview_trace( + state: &crate::app::TenantAppState, + query: &PaymentAuditQuery, +) -> Result { + if query.scope == AnalyticsScope::All { + return Ok(empty_payment_audit_response(query)); + } + + let preview_events = load_preview_trace_events(state, query).await?; + let results = summarise_payment_audit_results(&preview_events); + + let page_size = query.page_size.clamp(1, 50); + let page = query.page.max(1); + let start = (page - 1) * page_size; + let paged_results: Vec = results + .iter() + .skip(start) + .take(page_size) + .cloned() + .collect(); + + let selected_payment_id = query.payment_id.as_deref().or_else(|| { + paged_results + .first() + .and_then(|row| row.payment_id.as_deref()) + }); + let selected_request_id = query.request_id.as_deref().or_else(|| { + paged_results + .first() + .and_then(|row| row.request_id.as_deref()) + }); + let selected_lookup_key = paged_results.first().map(|row| row.lookup_key.as_str()); + let timeline = build_payment_timeline( + &preview_events, + selected_payment_id, + selected_request_id, + selected_lookup_key, + ); + + Ok(PaymentAuditResponse { + generated_at_ms: now_ms(), + scope: query.scope.as_str().to_string(), + merchant_id: query.merchant_id.clone(), + range: format_payment_audit_range(query), + payment_id: query + .payment_id + .clone() + .or_else(|| paged_results.first().and_then(|row| row.payment_id.clone())), + request_id: query + .request_id + .clone() + .or_else(|| paged_results.first().and_then(|row| row.request_id.clone())), + gateway: query.gateway.clone(), + route: Some("routing_evaluate".to_string()), + status: query.status.clone(), + event_type: query.event_type.clone(), + error_code: query.error_code.clone(), + page, + page_size, + total_results: results.len(), + results: paged_results, + timeline, + }) +} + pub fn parse_query( merchant_id: Option, scope: Option, diff --git a/src/euclid/handlers/routing_rules.rs b/src/euclid/handlers/routing_rules.rs index 6226f0c3..9f368c5b 100644 --- a/src/euclid/handlers/routing_rules.rs +++ b/src/euclid/handlers/routing_rules.rs @@ -24,7 +24,7 @@ use crate::euclid::{ types::{RoutingAlgorithmMapper, RoutingAlgorithmMapperUpdate}, }; use crate::{euclid::types::RoutingAlgorithm, logger, metrics}; -use axum::{extract::Path, Json}; +use axum::{extract::Path, response::IntoResponse, Json}; use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; use error_stack::ResultExt; @@ -252,9 +252,11 @@ pub async fn routing_create( pub async fn routing_evaluate( Json(payload): Json, ) -> Result, ContainerError> { - let timer = metrics::API_LATENCY_HISTOGRAM + let mut timer = Some( + metrics::API_LATENCY_HISTOGRAM .with_label_values(&["routing_evaluate"]) - .start_timer(); + .start_timer(), + ); API_REQUEST_TOTAL_COUNTER .with_label_values(&["routing_evaluate"]) @@ -278,6 +280,14 @@ pub async fn routing_evaluate( .with_label_values(&["routing_evaluate", "failure"]) .inc(); }; + let mut fail_preview = |err: ContainerError, stage: &'static str| { + record_routing_evaluate_preview_error(&payload, &err, stage); + update_failure_metrics(); + if let Some(timer) = timer.take() { + timer.observe_duration(); + } + Err(err) + }; // Check for the fallback_output in evaluate request: let default_output_present = payload @@ -299,11 +309,7 @@ pub async fn routing_evaluate( payload.created_by.clone(), )) { Ok(mapper) => mapper.routing_algorithm_id, - Err(e) => { - update_failure_metrics(); - timer.observe_duration(); - return Err(e.into()); - } + Err(e) => return fail_preview(e.into(), "active_routing_lookup_failed"), }; let parameters = payload.parameters.clone(); @@ -315,42 +321,41 @@ pub async fn routing_evaluate( .ok_or(EuclidErrors::GlobalRoutingConfigsUnavailable) { Ok(config) => config, - Err(e) => { - update_failure_metrics(); - timer.observe_duration(); - return Err(e.into()); - } + Err(e) => return fail_preview(e.into(), "routing_config_unavailable"), }; for (key, value) in ¶meters { if !routing_config.keys.keys.contains_key(key) && value.as_ref().is_some_and(|val| !val.is_metadata()) { - update_failure_metrics(); - timer.observe_duration(); - return Err(EuclidErrors::InvalidRequestParameter(key.clone()).into()); + return fail_preview( + EuclidErrors::InvalidRequestParameter(key.clone()).into(), + "parameter_validation_failed", + ); } if let Some(key_config) = routing_config.keys.keys.get(key) { if key_config.data_type == KeyDataType::Enum { if let Some(Some(ValueType::EnumVariant(value))) = parameters.get(key) { if !is_valid_enum_value(routing_config, key, value) { - update_failure_metrics(); - timer.observe_duration(); - return Err(EuclidErrors::InvalidRequest(format!( - "Invalid enum value '{}' for key '{}'", - value, key - )) - .into()); + return fail_preview( + EuclidErrors::InvalidRequest(format!( + "Invalid enum value '{}' for key '{}'", + value, key + )) + .into(), + "parameter_validation_failed", + ); } } else { - update_failure_metrics(); - timer.observe_duration(); - return Err(EuclidErrors::InvalidRequest(format!( - "Expected enum value for key '{}'", - key - )) - .into()); + return fail_preview( + EuclidErrors::InvalidRequest(format!( + "Expected enum value for key '{}'", + key + )) + .into(), + "parameter_validation_failed", + ); } } } @@ -372,11 +377,7 @@ pub async fn routing_evaluate( .change_context(EuclidErrors::StorageError) { Ok(algo) => algo, - Err(e) => { - update_failure_metrics(); - timer.observe_duration(); - return Err(e.into()); - } + Err(e) => return fail_preview(e.into(), "routing_algorithm_fetch_failed"), }; logger::debug!("Fetched routing algorithm: {:?}", algorithm); @@ -390,11 +391,7 @@ pub async fn routing_evaluate( EuclidErrors::InvalidRequest(format!("Invalid algorithm data format: {}", e)) }) { Ok(data) => data, - Err(e) => { - update_failure_metrics(); - timer.observe_duration(); - return Err(e.into()); - } + Err(e) => return fail_preview(e.into(), "routing_algorithm_parse_failed"), }; let (output, evaluated_output, rule_name): (Output, Vec, Option) = @@ -408,11 +405,7 @@ pub async fn routing_evaluate( )) }) { Ok((_, eval)) => (out_enum, eval, Some("straight_through_rule".into())), - Err(e) => { - update_failure_metrics(); - timer.observe_duration(); - return Err(e.into()); - } + Err(e) => return fail_preview(e.into(), "preview_output_evaluation_failed"), } } @@ -425,11 +418,7 @@ pub async fn routing_evaluate( )) }) { Ok((_, eval)) => (out_enum, eval, Some("priority_rule".into())), - Err(e) => { - update_failure_metrics(); - timer.observe_duration(); - return Err(e.into()); - } + Err(e) => return fail_preview(e.into(), "preview_output_evaluation_failed"), } } @@ -442,11 +431,7 @@ pub async fn routing_evaluate( )) }) { Ok((_, eval)) => (out_enum, eval, Some("volume_split_rule".into())), - Err(e) => { - update_failure_metrics(); - timer.observe_duration(); - return Err(e.into()); - } + Err(e) => return fail_preview(e.into(), "preview_output_evaluation_failed"), } } @@ -474,11 +459,7 @@ pub async fn routing_evaluate( } (ir.output, ir.evaluated_output, ir.rule_name) } - Err(e) => { - update_failure_metrics(); - timer.observe_duration(); - return Err(e.into()); - } + Err(e) => return fail_preview(e.into(), "preview_interpreter_failed"), } } }; @@ -509,14 +490,81 @@ pub async fn routing_evaluate( }; logger::debug!("Response: {response:?}"); + crate::analytics::record_rule_evaluation_preview_event( + Some(payload.created_by.clone()), + payload.payment_id.clone(), + preview_gateway(&response), + rule_name.clone(), + Some(response.status.clone()), + serde_json::to_string(&json!({ + "request": &payload, + "response": &response, + "rule_name": rule_name.clone(), + "preview_kind": "routing_evaluate", + })) + .ok(), + ); API_REQUEST_COUNTER .with_label_values(&["routing_evaluate", "success"]) .inc(); - timer.observe_duration(); + if let Some(timer) = timer.take() { + timer.observe_duration(); + } Ok(Json(response)) } +fn record_routing_evaluate_preview_error( + payload: &RoutingRequest, + error: &ContainerError, + event_stage: &str, +) { + let response_payload = error + .downcast_ref::() + .and_then(|payload| serde_json::to_value(payload).ok()); + let status = error + .get_inner() + .clone() + .into_response() + .status() + .as_u16() + .to_string(); + let error_code = response_payload + .as_ref() + .and_then(|value| value.get("code")) + .and_then(|value| value.as_str()) + .unwrap_or("ROUTING_EVALUATE_FAILED") + .to_string(); + let error_message = response_payload + .as_ref() + .and_then(|value| value.get("message")) + .and_then(|value| value.as_str()) + .map(str::to_string) + .unwrap_or_else(|| error.get_inner().to_string()); + + crate::analytics::record_error_event( + "routing_evaluate", + Some(payload.created_by.clone()), + payload.payment_id.clone(), + None, + None, + Some("RULE_EVALUATE_PREVIEW".to_string()), + error_code, + error_message.clone(), + serde_json::to_string(&json!({ + "request": payload, + "response": { + "status": status, + "error_message": error_message, + "api_error": response_payload, + }, + "preview_kind": "routing_evaluate", + })) + .ok(), + Some(event_stage.to_string()), + ); +} + #[cfg(feature = "mysql")] use crate::storage::schema::routing_algorithm_mapper::dsl as mapper_dsl; #[cfg(feature = "postgres")] @@ -805,6 +853,19 @@ fn format_output(output: &Output) -> Value { } } +fn preview_gateway(response: &RoutingEvaluateResponse) -> Option { + response + .evaluated_output + .first() + .map(|connector| connector.gateway_name.clone()) + .or_else(|| { + response + .eligible_connectors + .first() + .map(|connector| connector.gateway_name.clone()) + }) +} + pub(crate) fn eligibility_for_output( pm_filter_bundle: Option<&pm_filter_graph::PmFilterGraphBundle>, parameters: &std::collections::HashMap>, diff --git a/src/routes/analytics.rs b/src/routes/analytics.rs index 860474b1..3cfb6463 100644 --- a/src/routes/analytics.rs +++ b/src/routes/analytics.rs @@ -1,7 +1,8 @@ use crate::analytics::{ decisions as fetch_decisions, gateway_scores as fetch_gateway_scores, log_summaries as fetch_log_summaries, overview as fetch_overview, parse_payment_audit_query, - parse_query, payment_audit as fetch_payment_audit, routing_stats as fetch_routing_stats, + parse_query, payment_audit as fetch_payment_audit, preview_trace as fetch_preview_trace, + routing_stats as fetch_routing_stats, }; use crate::custom_extractors::TenantStateResolver; use crate::error; @@ -44,6 +45,7 @@ pub fn serve() -> axum::Router> { .route("/routing-stats", axum::routing::get(routing_stats)) .route("/log-summaries", axum::routing::get(log_summaries)) .route("/payment-audit", axum::routing::get(payment_audit)) + .route("/preview-trace", axum::routing::get(preview_trace)) } pub async fn overview( @@ -198,3 +200,24 @@ pub async fn payment_audit( ); Ok(Json(fetch_payment_audit(&state, &query).await?)) } + +pub async fn preview_trace( + TenantStateResolver(state): TenantStateResolver, + Query(params): Query, +) -> Result, error::ContainerError> { + let query = parse_payment_audit_query( + params.merchant_id, + params.scope, + params.range, + params.page, + params.page_size, + params.payment_id, + params.request_id, + params.gateway, + params.route, + params.status, + params.event_type, + params.error_code, + ); + Ok(Json(fetch_preview_trace(&state, &query).await?)) +} diff --git a/website/dist/assets/index-1vrpPGUz.js b/website/dist/assets/index-1vrpPGUz.js deleted file mode 100644 index 4888ab64..00000000 --- a/website/dist/assets/index-1vrpPGUz.js +++ /dev/null @@ -1,334 +0,0 @@ -var y$=Object.defineProperty;var v$=(e,t,r)=>t in e?y$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xw=(e,t,r)=>v$(e,typeof t!="symbol"?t+"":t,r);function g$(e,t){for(var r=0;rn[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"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var rf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gk={exports:{}},Zp={},Kk={exports:{}},We={};/** - * @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 Mc=Symbol.for("react.element"),x$=Symbol.for("react.portal"),b$=Symbol.for("react.fragment"),w$=Symbol.for("react.strict_mode"),_$=Symbol.for("react.profiler"),S$=Symbol.for("react.provider"),j$=Symbol.for("react.context"),O$=Symbol.for("react.forward_ref"),k$=Symbol.for("react.suspense"),A$=Symbol.for("react.memo"),E$=Symbol.for("react.lazy"),bw=Symbol.iterator;function P$(e){return e===null||typeof e!="object"?null:(e=bw&&e[bw]||e["@@iterator"],typeof e=="function"?e:null)}var qk={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xk=Object.assign,Yk={};function nl(e,t,r){this.props=e,this.context=t,this.refs=Yk,this.updater=r||qk}nl.prototype.isReactComponent={};nl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};nl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zk(){}Zk.prototype=nl.prototype;function Q0(e,t,r){this.props=e,this.context=t,this.refs=Yk,this.updater=r||qk}var J0=Q0.prototype=new Zk;J0.constructor=Q0;Xk(J0,nl.prototype);J0.isPureReactComponent=!0;var ww=Array.isArray,Qk=Object.prototype.hasOwnProperty,ex={current:null},Jk={key:!0,ref:!0,__self:!0,__source:!0};function eA(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Qk.call(t,n)&&!Jk.hasOwnProperty(n)&&(a[n]=t[n]);var s=arguments.length-2;if(s===1)a.children=r;else if(1>>1,G=L[Q];if(0>>1;Qa(pe,K))cea(Ee,pe)?(L[Q]=Ee,L[ce]=K,Q=ce):(L[Q]=pe,L[Z]=K,Q=Z);else if(cea(Ee,K))L[Q]=Ee,L[ce]=K,Q=ce;else break e}}return U}function a(L,U){var K=L.sortIndex-U.sortIndex;return K!==0?K:L.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],d=1,f=null,p=3,h=!1,g=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(L){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=L)n(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=r(u)}}function _(L){if(y=!1,w(L),!g)if(r(l)!==null)g=!0,V(b);else{var U=r(u);U!==null&&H(_,U.startTime-L)}}function b(L,U){g=!1,y&&(y=!1,x(k),k=-1),h=!0;var K=p;try{for(w(U),f=r(l);f!==null&&(!(f.expirationTime>U)||L&&!T());){var Q=f.callback;if(typeof Q=="function"){f.callback=null,p=f.priorityLevel;var G=Q(f.expirationTime<=U);U=e.unstable_now(),typeof G=="function"?f.callback=G:f===r(l)&&n(l),w(U)}else n(l);f=r(l)}if(f!==null)var re=!0;else{var Z=r(u);Z!==null&&H(_,Z.startTime-U),re=!1}return re}finally{f=null,p=K,h=!1}}var S=!1,j=null,k=-1,A=5,R=-1;function T(){return!(e.unstable_now()-RL||125Q?(L.sortIndex=K,t(u,L),r(l)===null&&L===r(u)&&(y?(x(k),k=-1):y=!0,H(_,K-Q))):(L.sortIndex=G,t(l,L),g||h||(g=!0,V(b))),L},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(L){var U=p;return function(){var K=p;p=U;try{return L.apply(this,arguments)}finally{p=K}}}})(iA);aA.exports=iA;var B$=aA.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 U$=O,Gr=B$;function ae(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zy=Object.prototype.hasOwnProperty,V$=/^[: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]*$/,Sw={},jw={};function W$(e){return Zy.call(jw,e)?!0:Zy.call(Sw,e)?!1:V$.test(e)?jw[e]=!0:(Sw[e]=!0,!1)}function H$(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function G$(e,t,r,n){if(t===null||typeof t>"u"||H$(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Sr(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var or={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){or[e]=new Sr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];or[t]=new Sr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){or[e]=new Sr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){or[e]=new Sr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){or[e]=new Sr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){or[e]=new Sr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){or[e]=new Sr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){or[e]=new Sr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){or[e]=new Sr(e,5,!1,e.toLowerCase(),null,!1,!1)});var rx=/[\-:]([a-z])/g;function nx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(rx,nx);or[t]=new Sr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(rx,nx);or[t]=new Sr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(rx,nx);or[t]=new Sr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){or[e]=new Sr(e,1,!1,e.toLowerCase(),null,!1,!1)});or.xlinkHref=new Sr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){or[e]=new Sr(e,1,!1,e.toLowerCase(),null,!0,!0)});function ax(e,t,r,n){var a=or.hasOwnProperty(t)?or[t]:null;(a!==null?a.type!==0:n||!(2s||a[o]!==i[s]){var l=` -`+a[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{gm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ql(e):""}function K$(e){switch(e.tag){case 5:return Ql(e.type);case 16:return Ql("Lazy");case 13:return Ql("Suspense");case 19:return Ql("SuspenseList");case 0:case 2:case 15:return e=xm(e.type,!1),e;case 11:return e=xm(e.type.render,!1),e;case 1:return e=xm(e.type,!0),e;default:return""}}function tv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case zo:return"Fragment";case Fo:return"Portal";case Qy:return"Profiler";case ix:return"StrictMode";case Jy:return"Suspense";case ev:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case lA:return(e.displayName||"Context")+".Consumer";case sA:return(e._context.displayName||"Context")+".Provider";case ox:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sx:return t=e.displayName||null,t!==null?t:tv(e.type)||"Memo";case za:t=e._payload,e=e._init;try{return tv(e(t))}catch{}}return null}function q$(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return tv(t);case 8:return t===ix?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function di(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function X$(e){var t=cA(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function of(e){e._valueTracker||(e._valueTracker=X$(e))}function fA(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=cA(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ud(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function rv(e,t){var r=t.checked;return At({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function kw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=di(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function dA(e,t){t=t.checked,t!=null&&ax(e,"checked",t,!1)}function nv(e,t){dA(e,t);var r=di(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?av(e,t.type,r):t.hasOwnProperty("defaultValue")&&av(e,t.type,di(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Aw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function av(e,t,r){(t!=="number"||ud(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Jl=Array.isArray;function as(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=sf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Cu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var lu={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},Y$=["Webkit","ms","Moz","O"];Object.keys(lu).forEach(function(e){Y$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),lu[t]=lu[e]})});function yA(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||lu.hasOwnProperty(e)&&lu[e]?(""+t).trim():t+"px"}function vA(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=yA(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var Z$=At({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 sv(e,t){if(t){if(Z$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ae(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ae(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ae(62))}}function lv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uv=null;function lx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cv=null,is=null,os=null;function Nw(e){if(e=Fc(e)){if(typeof cv!="function")throw Error(ae(280));var t=e.stateNode;t&&(t=rh(t),cv(e.stateNode,e.type,t))}}function gA(e){is?os?os.push(e):os=[e]:is=e}function xA(){if(is){var e=is,t=os;if(os=is=null,Nw(e),t)for(e=0;e>>=0,e===0?32:31-(lI(e)/uI|0)|0}var lf=64,uf=4194304;function eu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~a;s!==0?n=eu(s):(i&=o,i!==0&&(n=eu(i)))}else o=r&~a,o!==0?n=eu(o):i!==0&&(n=eu(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Dc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-An(t),e[t]=r}function pI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=cu),Fw=" ",zw=!1;function FA(e,t){switch(e){case"keyup":return BI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bo=!1;function VI(e,t){switch(e){case"compositionend":return zA(t);case"keypress":return t.which!==32?null:(zw=!0,Fw);case"textInput":return e=t.data,e===Fw&&zw?null:e;default:return null}}function WI(e,t){if(Bo)return e==="compositionend"||!yx&&FA(e,t)?(e=DA(),qf=px=Xa=null,Bo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ww(r)}}function WA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?WA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function HA(){for(var e=window,t=ud();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ud(e.document)}return t}function vx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function JI(e){var t=HA(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&WA(r.ownerDocument.documentElement,r)){if(n!==null&&vx(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=Hw(r,i);var o=Hw(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Uo=null,yv=null,du=null,vv=!1;function Gw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;vv||Uo==null||Uo!==ud(n)||(n=Uo,"selectionStart"in n&&vx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),du&&Du(du,n)||(du=n,n=yd(yv,"onSelect"),0Ho||(e.current=Sv[Ho],Sv[Ho]=null,Ho--)}function pt(e,t){Ho++,Sv[Ho]=e.current,e.current=t}var pi={},hr=bi(pi),Cr=bi(!1),no=pi;function xs(e,t){var r=e.type.contextTypes;if(!r)return pi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Tr(e){return e=e.childContextTypes,e!=null}function gd(){bt(Cr),bt(hr)}function Jw(e,t,r){if(hr.current!==pi)throw Error(ae(168));pt(hr,t),pt(Cr,r)}function e2(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(ae(108,q$(e)||"Unknown",a));return At({},r,n)}function xd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pi,no=hr.current,pt(hr,e),pt(Cr,Cr.current),!0}function e1(e,t,r){var n=e.stateNode;if(!n)throw Error(ae(169));r?(e=e2(e,t,no),n.__reactInternalMemoizedMergedChildContext=e,bt(Cr),bt(hr),pt(hr,e)):bt(Cr),pt(Cr,r)}var aa=null,nh=!1,$m=!1;function t2(e){aa===null?aa=[e]:aa.push(e)}function fR(e){nh=!0,t2(e)}function wi(){if(!$m&&aa!==null){$m=!0;var e=0,t=at;try{var r=aa;for(at=1;e>=o,a-=o,oa=1<<32-An(t)+a|r<k?(A=j,j=null):A=j.sibling;var R=p(x,j,w[k],_);if(R===null){j===null&&(j=A);break}e&&j&&R.alternate===null&&t(x,j),m=i(R,m,k),S===null?b=R:S.sibling=R,S=R,j=A}if(k===w.length)return r(x,j),wt&&Ri(x,k),b;if(j===null){for(;kk?(A=j,j=null):A=j.sibling;var T=p(x,j,R.value,_);if(T===null){j===null&&(j=A);break}e&&j&&T.alternate===null&&t(x,j),m=i(T,m,k),S===null?b=T:S.sibling=T,S=T,j=A}if(R.done)return r(x,j),wt&&Ri(x,k),b;if(j===null){for(;!R.done;k++,R=w.next())R=f(x,R.value,_),R!==null&&(m=i(R,m,k),S===null?b=R:S.sibling=R,S=R);return wt&&Ri(x,k),b}for(j=n(x,j);!R.done;k++,R=w.next())R=h(j,x,k,R.value,_),R!==null&&(e&&R.alternate!==null&&j.delete(R.key===null?k:R.key),m=i(R,m,k),S===null?b=R:S.sibling=R,S=R);return e&&j.forEach(function(N){return t(x,N)}),wt&&Ri(x,k),b}function v(x,m,w,_){if(typeof w=="object"&&w!==null&&w.type===zo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case af:e:{for(var b=w.key,S=m;S!==null;){if(S.key===b){if(b=w.type,b===zo){if(S.tag===7){r(x,S.sibling),m=a(S,w.props.children),m.return=x,x=m;break e}}else if(S.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===za&&n1(b)===S.type){r(x,S.sibling),m=a(S,w.props),m.ref=Tl(x,S,w),m.return=x,x=m;break e}r(x,S);break}else t(x,S);S=S.sibling}w.type===zo?(m=Zi(w.props.children,x.mode,_,w.key),m.return=x,x=m):(_=rd(w.type,w.key,w.props,null,x.mode,_),_.ref=Tl(x,m,w),_.return=x,x=_)}return o(x);case Fo:e:{for(S=w.key;m!==null;){if(m.key===S)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){r(x,m.sibling),m=a(m,w.children||[]),m.return=x,x=m;break e}else{r(x,m);break}else t(x,m);m=m.sibling}m=Bm(w,x.mode,_),m.return=x,x=m}return o(x);case za:return S=w._init,v(x,m,S(w._payload),_)}if(Jl(w))return g(x,m,w,_);if(Al(w))return y(x,m,w,_);yf(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(r(x,m.sibling),m=a(m,w),m.return=x,x=m):(r(x,m),m=zm(w,x.mode,_),m.return=x,x=m),o(x)):r(x,m)}return v}var ws=i2(!0),o2=i2(!1),_d=bi(null),Sd=null,qo=null,wx=null;function _x(){wx=qo=Sd=null}function Sx(e){var t=_d.current;bt(_d),e._currentValue=t}function kv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ls(e,t){Sd=e,wx=qo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Er=!0),e.firstContext=null)}function fn(e){var t=e._currentValue;if(wx!==e)if(e={context:e,memoizedValue:t,next:null},qo===null){if(Sd===null)throw Error(ae(308));qo=e,Sd.dependencies={lanes:0,firstContext:e}}else qo=qo.next=e;return t}var Ui=null;function jx(e){Ui===null?Ui=[e]:Ui.push(e)}function s2(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,jx(t)):(r.next=a.next,a.next=r),t.interleaved=r,xa(e,n)}function xa(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ba=!1;function Ox(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function l2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function pa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ii(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Xe&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,xa(e,r)}return a=n.interleaved,a===null?(t.next=t,jx(n)):(t.next=a.next,a.next=t),n.interleaved=t,xa(e,r)}function Yf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,cx(e,r)}}function a1(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function jd(e,t,r,n){var a=e.updateQueue;Ba=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,s=a.shared.pending;if(s!==null){a.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==o&&(s===null?d.firstBaseUpdate=u:s.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=a.baseState;o=0,d=u=l=null,s=i;do{var p=s.lane,h=s.eventTime;if((n&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,y=s;switch(p=t,h=r,y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(h,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,p=typeof g=="function"?g.call(h,f,p):g,p==null)break e;f=At({},f,p);break e;case 2:Ba=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(u=d=h,l=f):d=d.next=h,o|=p;if(s=s.next,s===null){if(s=a.shared.pending,s===null)break;p=s,s=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(d===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);oo|=o,e.lanes=o,e.memoizedState=f}}function i1(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Rm.transition;Rm.transition={};try{e(!1),t()}finally{at=r,Rm.transition=n}}function O2(){return dn().memoizedState}function mR(e,t,r){var n=si(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},k2(e))A2(t,r);else if(r=s2(e,t,r,n),r!==null){var a=wr();En(r,e,n,a),E2(r,t,n)}}function yR(e,t,r){var n=si(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(k2(e))A2(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,r);if(a.hasEagerState=!0,a.eagerState=s,Nn(s,o)){var l=t.interleaved;l===null?(a.next=a,jx(t)):(a.next=l.next,l.next=a),t.interleaved=a;return}}catch{}finally{}r=s2(e,t,a,n),r!==null&&(a=wr(),En(r,e,n,a),E2(r,t,n))}}function k2(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function A2(e,t){pu=kd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function E2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,cx(e,r)}}var Ad={readContext:fn,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},vR={readContext:fn,useCallback:function(e,t){return Rn().memoizedState=[e,t===void 0?null:t],e},useContext:fn,useEffect:s1,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Qf(4194308,4,b2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Qf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qf(4,2,e,t)},useMemo:function(e,t){var r=Rn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Rn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=mR.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=Rn();return e={current:e},t.memoizedState=e},useState:o1,useDebugValue:$x,useDeferredValue:function(e){return Rn().memoizedState=e},useTransition:function(){var e=o1(!1),t=e[0];return e=hR.bind(null,e[1]),Rn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,a=Rn();if(wt){if(r===void 0)throw Error(ae(407));r=r()}else{if(r=t(),Jt===null)throw Error(ae(349));io&30||d2(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,s1(h2.bind(null,n,i,e),[e]),n.flags|=2048,Hu(9,p2.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Rn(),t=Jt.identifierPrefix;if(wt){var r=sa,n=oa;r=(n&~(1<<32-An(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Vu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Dn]=t,e[zu]=n,L2(e,t,!1,!1),t.stateNode=e;e:{switch(o=lv(r,n),r){case"dialog":yt("cancel",e),yt("close",e),a=n;break;case"iframe":case"object":case"embed":yt("load",e),a=n;break;case"video":case"audio":for(a=0;ajs&&(t.flags|=128,n=!0,$l(i,!1),t.lanes=4194304)}else{if(!n)if(e=Od(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),$l(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!wt)return lr(t),null}else 2*$t()-i.renderingStartTime>js&&r!==1073741824&&(t.flags|=128,n=!0,$l(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$t(),t.sibling=null,r=jt.current,pt(jt,n?r&1|2:r&1),t):(lr(t),null);case 22:case 23:return Fx(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Fr&1073741824&&(lr(t),t.subtreeFlags&6&&(t.flags|=8192)):lr(t),null;case 24:return null;case 25:return null}throw Error(ae(156,t.tag))}function OR(e,t){switch(xx(t),t.tag){case 1:return Tr(t.type)&&gd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _s(),bt(Cr),bt(hr),Ex(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ax(t),null;case 13:if(bt(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ae(340));bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return bt(jt),null;case 4:return _s(),null;case 10:return Sx(t.type._context),null;case 22:case 23:return Fx(),null;case 24:return null;default:return null}}var gf=!1,fr=!1,kR=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Xo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Nt(e,t,n)}else r.current=null}function Rv(e,t,r){try{r()}catch(n){Nt(e,t,n)}}var g1=!1;function AR(e,t){if(gv=hd,e=HA(),vx(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==r||a!==0&&f.nodeType!==3||(s=o+a),f!==i||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===r&&++u===a&&(s=o),p===i&&++d===n&&(l=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(xv={focusedElem:e,selectionRange:r},hd=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,v=g.memoizedState,x=t.stateNode,m=x.getSnapshotBeforeUpdate(t.elementType===t.type?y:bn(t.type,y),v);x.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ae(163))}}catch(_){Nt(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return g=g1,g1=!1,g}function hu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Rv(t,r,i)}a=a.next}while(a!==n)}}function oh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Mv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function B2(e){var t=e.alternate;t!==null&&(e.alternate=null,B2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dn],delete t[zu],delete t[_v],delete t[uR],delete t[cR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function U2(e){return e.tag===5||e.tag===3||e.tag===4}function x1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||U2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Dv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=vd));else if(n!==4&&(e=e.child,e!==null))for(Dv(e,t,r),e=e.sibling;e!==null;)Dv(e,t,r),e=e.sibling}function Lv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Lv(e,t,r),e=e.sibling;e!==null;)Lv(e,t,r),e=e.sibling}var nr=null,wn=!1;function Ma(e,t,r){for(r=r.child;r!==null;)V2(e,t,r),r=r.sibling}function V2(e,t,r){if(Bn&&typeof Bn.onCommitFiberUnmount=="function")try{Bn.onCommitFiberUnmount(Qp,r)}catch{}switch(r.tag){case 5:fr||Xo(r,t);case 6:var n=nr,a=wn;nr=null,Ma(e,t,r),nr=n,wn=a,nr!==null&&(wn?(e=nr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):nr.removeChild(r.stateNode));break;case 18:nr!==null&&(wn?(e=nr,r=r.stateNode,e.nodeType===8?Tm(e.parentNode,r):e.nodeType===1&&Tm(e,r),Ru(e)):Tm(nr,r.stateNode));break;case 4:n=nr,a=wn,nr=r.stateNode.containerInfo,wn=!0,Ma(e,t,r),nr=n,wn=a;break;case 0:case 11:case 14:case 15:if(!fr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Rv(r,t,o),a=a.next}while(a!==n)}Ma(e,t,r);break;case 1:if(!fr&&(Xo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Nt(r,t,s)}Ma(e,t,r);break;case 21:Ma(e,t,r);break;case 22:r.mode&1?(fr=(n=fr)||r.memoizedState!==null,Ma(e,t,r),fr=n):Ma(e,t,r);break;default:Ma(e,t,r)}}function b1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new kR),t.forEach(function(n){var a=MR.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function vn(e,t){var r=t.deletions;if(r!==null)for(var n=0;na&&(a=o),n&=~i}if(n=a,n=$t()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*PR(n/1960))-n,10e?16:e,Ya===null)var n=!1;else{if(e=Ya,Ya=null,Nd=0,Xe&6)throw Error(ae(331));var a=Xe;for(Xe|=4,fe=e.current;fe!==null;){var i=fe,o=i.child;if(fe.flags&16){var s=i.deletions;if(s!==null){for(var l=0;l$t()-Dx?Yi(e,0):Mx|=r),$r(e,t)}function Z2(e,t){t===0&&(e.mode&1?(t=uf,uf<<=1,!(uf&130023424)&&(uf=4194304)):t=1);var r=wr();e=xa(e,t),e!==null&&(Dc(e,t,r),$r(e,r))}function RR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Z2(e,r)}function MR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ae(314))}n!==null&&n.delete(t),Z2(e,r)}var Q2;Q2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Cr.current)Er=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Er=!1,SR(e,t,r);Er=!!(e.flags&131072)}else Er=!1,wt&&t.flags&1048576&&r2(t,wd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Jf(e,t),e=t.pendingProps;var a=xs(t,hr.current);ls(t,r),a=Nx(null,t,n,e,a,r);var i=Cx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tr(n)?(i=!0,xd(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ox(t),a.updater=ih,t.stateNode=a,a._reactInternals=t,Ev(t,n,e,r),t=Cv(null,t,n,!0,i,r)):(t.tag=0,wt&&i&&gx(t),mr(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Jf(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=LR(n),e=bn(n,e),a){case 0:t=Nv(null,t,n,e,r);break e;case 1:t=m1(null,t,n,e,r);break e;case 11:t=p1(null,t,n,e,r);break e;case 14:t=h1(null,t,n,bn(n.type,e),r);break e}throw Error(ae(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:bn(n,a),Nv(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:bn(n,a),m1(e,t,n,a,r);case 3:e:{if(R2(t),e===null)throw Error(ae(387));n=t.pendingProps,i=t.memoizedState,a=i.element,l2(e,t),jd(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Ss(Error(ae(423)),t),t=y1(e,t,n,r,a);break e}else if(n!==a){a=Ss(Error(ae(424)),t),t=y1(e,t,n,r,a);break e}else for(Ur=ai(t.stateNode.containerInfo.firstChild),Vr=t,wt=!0,jn=null,r=o2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(bs(),n===a){t=ba(e,t,r);break e}mr(e,t,n,r)}t=t.child}return t;case 5:return u2(t),e===null&&Ov(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,bv(n,a)?o=null:i!==null&&bv(n,i)&&(t.flags|=32),I2(e,t),mr(e,t,o,r),t.child;case 6:return e===null&&Ov(t),null;case 13:return M2(e,t,r);case 4:return kx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ws(t,null,n,r):mr(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:bn(n,a),p1(e,t,n,a,r);case 7:return mr(e,t,t.pendingProps,r),t.child;case 8:return mr(e,t,t.pendingProps.children,r),t.child;case 12:return mr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,pt(_d,n._currentValue),n._currentValue=o,i!==null)if(Nn(i.value,o)){if(i.children===a.children&&!Cr.current){t=ba(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=pa(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),kv(i.return,r,t),s.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ae(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),kv(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}mr(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,ls(t,r),a=fn(a),n=n(a),t.flags|=1,mr(e,t,n,r),t.child;case 14:return n=t.type,a=bn(n,t.pendingProps),a=bn(n.type,a),h1(e,t,n,a,r);case 15:return T2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:bn(n,a),Jf(e,t),t.tag=1,Tr(n)?(e=!0,xd(t)):e=!1,ls(t,r),P2(t,n,a),Ev(t,n,a,r),Cv(null,t,n,!0,e,r);case 19:return D2(e,t,r);case 22:return $2(e,t,r)}throw Error(ae(156,t.tag))};function J2(e,t){return kA(e,t)}function DR(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(e,t,r,n){return new DR(e,t,r,n)}function Bx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function LR(e){if(typeof e=="function")return Bx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ox)return 11;if(e===sx)return 14}return 2}function li(e,t){var r=e.alternate;return r===null?(r=sn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function rd(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")Bx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case zo:return Zi(r.children,a,i,t);case ix:o=8,a|=8;break;case Qy:return e=sn(12,r,t,a|2),e.elementType=Qy,e.lanes=i,e;case Jy:return e=sn(13,r,t,a),e.elementType=Jy,e.lanes=i,e;case ev:return e=sn(19,r,t,a),e.elementType=ev,e.lanes=i,e;case uA:return lh(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case sA:o=10;break e;case lA:o=9;break e;case ox:o=11;break e;case sx:o=14;break e;case za:o=16,n=null;break e}throw Error(ae(130,e==null?e:typeof e,""))}return t=sn(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function Zi(e,t,r,n){return e=sn(7,e,n,t),e.lanes=r,e}function lh(e,t,r,n){return e=sn(22,e,n,t),e.elementType=uA,e.lanes=r,e.stateNode={isHidden:!1},e}function zm(e,t,r){return e=sn(6,e,null,t),e.lanes=r,e}function Bm(e,t,r){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function FR(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wm(0),this.expirationTimes=wm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wm(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Ux(e,t,r,n,a,i,o,s,l){return e=new FR(e,t,r,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=sn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ox(i),e}function zR(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nE)}catch(e){console.error(e)}}nE(),nA.exports=qr;var Zo=nA.exports,E1=Zo;Yy.createRoot=E1.createRoot,Yy.hydrateRoot=E1.hydrateRoot;/** - * @remix-run/router v1.23.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Ku(){return Ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Gx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function GR(){return Math.random().toString(36).substr(2,8)}function N1(e,t){return{usr:e.state,key:e.key,idx:t}}function Vv(e,t,r,n){return r===void 0&&(r=null),Ku({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ol(t):t,{state:r,key:t&&t.key||n||GR()})}function $d(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ol(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function KR(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,s=Za.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(Ku({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){s=Za.Pop;let v=d(),x=v==null?null:v-u;u=v,l&&l({action:s,location:y.location,delta:x})}function p(v,x){s=Za.Push;let m=Vv(y.location,v,x);u=d()+1;let w=N1(m,u),_=y.createHref(m);try{o.pushState(w,"",_)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;a.location.assign(_)}i&&l&&l({action:s,location:y.location,delta:1})}function h(v,x){s=Za.Replace;let m=Vv(y.location,v,x);u=d();let w=N1(m,u),_=y.createHref(m);o.replaceState(w,"",_),i&&l&&l({action:s,location:y.location,delta:0})}function g(v){let x=a.location.origin!=="null"?a.location.origin:a.location.href,m=typeof v=="string"?v:$d(v);return m=m.replace(/ $/,"%20"),kt(x,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,x)}let y={get action(){return s},get location(){return e(a,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(P1,f),l=v,()=>{a.removeEventListener(P1,f),l=null}},createHref(v){return t(a,v)},createURL:g,encodeLocation(v){let x=g(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:h,go(v){return o.go(v)}};return y}var C1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(C1||(C1={}));function qR(e,t,r){return r===void 0&&(r="/"),XR(e,t,r)}function XR(e,t,r,n){let a=typeof t=="string"?ol(t):t,i=Os(a.pathname||"/",r);if(i==null)return null;let o=aE(e);YR(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(kt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=ui([n,l.relativePath]),d=r.concat(l);i.children&&i.children.length>0&&(kt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),aE(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:nM(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))a(i,o);else for(let l of iE(i.path))a(i,o,l)}),t}function iE(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=iE(n.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function YR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:aM(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const ZR=/^:[\w-]+$/,QR=3,JR=2,eM=1,tM=10,rM=-2,T1=e=>e==="*";function nM(e,t){let r=e.split("/"),n=r.length;return r.some(T1)&&(n+=rM),t&&(n+=JR),r.filter(a=>!T1(a)).reduce((a,i)=>a+(ZR.test(i)?QR:i===""?eM:tM),n)}function aM(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function iM(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=d;if(p==="*"){let y=s[f]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=s[f];return h&&!g?u[p]=void 0:u[p]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function oM(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Gx(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function sM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gx(!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 Os(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const lM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uM=e=>lM.test(e);function cM(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ol(e):e,i;if(r)if(uM(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),Gx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=$1(r.substring(1),"/"):i=$1(r,t)}else i=t;return{pathname:i,search:pM(n),hash:hM(a)}}function $1(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Um(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function fM(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Kx(e,t){let r=fM(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function qx(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ol(e):(a=Ku({},e),kt(!a.pathname||!a.pathname.includes("?"),Um("?","pathname","search",a)),kt(!a.pathname||!a.pathname.includes("#"),Um("#","pathname","hash",a)),kt(!a.search||!a.search.includes("#"),Um("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;a.pathname=p.join("/")}s=f>=0?t[f]:"/"}let l=cM(a,s),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const ui=e=>e.join("/").replace(/\/\/+/g,"/"),dM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),pM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function mM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const oE=["post","put","patch","delete"];new Set(oE);const yM=["get",...oE];new Set(yM);/** - * React Router v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function qu(){return qu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),O.useCallback(function(u,d){if(d===void 0&&(d={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let f=qx(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ui([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,o,i,e])}const xM=O.createContext(null);function bM(e){let t=O.useContext(Na).outlet;return t&&O.createElement(xM.Provider,{value:e},t)}function mh(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=O.useContext(Pa),{matches:a}=O.useContext(Na),{pathname:i}=_o(),o=JSON.stringify(Kx(a,n.v7_relativeSplatPath));return O.useMemo(()=>qx(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function wM(e,t){return _M(e,t)}function _M(e,t,r,n){sl()||kt(!1);let{navigator:a}=O.useContext(Pa),{matches:i}=O.useContext(Na),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=_o(),d;if(t){var f;let v=typeof t=="string"?ol(t):t;l==="/"||(f=v.pathname)!=null&&f.startsWith(l)||kt(!1),d=v}else d=u;let p=d.pathname||"/",h=p;if(l!=="/"){let v=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=qR(e,{pathname:h}),y=AM(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},s,v.params),pathname:ui([l,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:ui([l,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,r,n);return t&&y?O.createElement(hh.Provider,{value:{location:qu({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Za.Pop}},y):y}function SM(){let e=CM(),t=mM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},t),r?O.createElement("pre",{style:a},r):null,null)}const jM=O.createElement(SM,null);class OM extends O.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?O.createElement(Na.Provider,{value:this.props.routeContext},O.createElement(lE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function kM(e){let{routeContext:t,match:r,children:n}=e,a=O.useContext(ph);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),O.createElement(Na.Provider,{value:t},n)}function AM(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(a=r)==null?void 0:a.errors;if(s!=null){let d=o.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);d>=0||kt(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,p)=>{let h,g=!1,y=null,v=null;r&&(h=s&&f.route.id?s[f.route.id]:void 0,y=f.route.errorElement||jM,l&&(u<0&&p===0?($M("route-fallback"),g=!0,v=null):u===p&&(g=!0,v=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=y:g?w=v:f.route.Component?w=O.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,O.createElement(kM,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:r!=null},children:w})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?O.createElement(OM,{location:r.location,revalidation:r.revalidation,component:y,error:h,children:m(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):m()},null)}var cE=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(cE||{}),fE=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}(fE||{});function EM(e){let t=O.useContext(ph);return t||kt(!1),t}function PM(e){let t=O.useContext(sE);return t||kt(!1),t}function NM(e){let t=O.useContext(Na);return t||kt(!1),t}function dE(e){let t=NM(),r=t.matches[t.matches.length-1];return r.route.id||kt(!1),r.route.id}function CM(){var e;let t=O.useContext(lE),r=PM(),n=dE();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function TM(){let{router:e}=EM(cE.UseNavigateStable),t=dE(fE.UseNavigateStable),r=O.useRef(!1);return uE(()=>{r.current=!0}),O.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,qu({fromRouteId:t},i)))},[e,t])}const I1={};function $M(e,t,r){I1[e]||(I1[e]=!0)}function IM(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function RM(e){let{to:t,replace:r,state:n,relative:a}=e;sl()||kt(!1);let{future:i,static:o}=O.useContext(Pa),{matches:s}=O.useContext(Na),{pathname:l}=_o(),u=Bc(),d=qx(t,Kx(s,i.v7_relativeSplatPath),l,a==="path"),f=JSON.stringify(d);return O.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:a}),[u,f,a,r,n]),null}function MM(e){return bM(e.context)}function en(e){kt(!1)}function DM(e){let{basename:t="/",children:r=null,location:n,navigationType:a=Za.Pop,navigator:i,static:o=!1,future:s}=e;sl()&&kt(!1);let l=t.replace(/^\/*/,"/"),u=O.useMemo(()=>({basename:l,navigator:i,static:o,future:qu({v7_relativeSplatPath:!1},s)}),[l,s,i,o]);typeof n=="string"&&(n=ol(n));let{pathname:d="/",search:f="",hash:p="",state:h=null,key:g="default"}=n,y=O.useMemo(()=>{let v=Os(d,l);return v==null?null:{location:{pathname:v,search:f,hash:p,state:h,key:g},navigationType:a}},[l,d,f,p,h,g,a]);return y==null?null:O.createElement(Pa.Provider,{value:u},O.createElement(hh.Provider,{children:r,value:y}))}function LM(e){let{children:t,location:r}=e;return wM(Hv(t),r)}new Promise(()=>{});function Hv(e,t){t===void 0&&(t=[]);let r=[];return O.Children.forEach(e,(n,a)=>{if(!O.isValidElement(n))return;let i=[...t,a];if(n.type===O.Fragment){r.push.apply(r,Hv(n.props.children,i));return}n.type!==en&&kt(!1),!n.props.index||!n.props.children||kt(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Hv(n.props.children,i)),r.push(o)}),r}/** - * React Router DOM v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[a]=e[a]);return r}function FM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zM(e,t){return e.button===0&&(!t||t==="_self")&&!FM(e)}function Gv(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function BM(e,t){let r=Gv(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const UM=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],VM=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],WM="6";try{window.__reactRouterVersion=WM}catch{}const HM=O.createContext({isTransitioning:!1}),GM="startTransition",R1=I$[GM];function KM(e){let{basename:t,children:r,future:n,window:a}=e,i=O.useRef();i.current==null&&(i.current=HR({window:a,v5Compat:!0}));let o=i.current,[s,l]=O.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=O.useCallback(f=>{u&&R1?R1(()=>l(f)):l(f)},[l,u]);return O.useLayoutEffect(()=>o.listen(d),[o,d]),O.useEffect(()=>IM(n),[n]),O.createElement(DM,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const qM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",XM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,YM=O.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:s,target:l,to:u,preventScrollReset:d,viewTransition:f}=t,p=pE(t,UM),{basename:h}=O.useContext(Pa),g,y=!1;if(typeof u=="string"&&XM.test(u)&&(g=u,qM))try{let w=new URL(window.location.href),_=u.startsWith("//")?new URL(w.protocol+u):new URL(u),b=Os(_.pathname,h);_.origin===w.origin&&b!=null?u=b+_.search+_.hash:y=!0}catch{}let v=vM(u,{relative:a}),x=JM(u,{replace:o,state:s,target:l,preventScrollReset:d,relative:a,viewTransition:f});function m(w){n&&n(w),w.defaultPrevented||x(w)}return O.createElement("a",Id({},p,{href:g||v,onClick:y||i?n:m,ref:r,target:l}))}),ZM=O.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:o=!1,style:s,to:l,viewTransition:u,children:d}=t,f=pE(t,VM),p=mh(l,{relative:f.relative}),h=_o(),g=O.useContext(sE),{navigator:y,basename:v}=O.useContext(Pa),x=g!=null&&tD(p)&&u===!0,m=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,w=h.pathname,_=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(w=w.toLowerCase(),_=_?_.toLowerCase():null,m=m.toLowerCase()),_&&v&&(_=Os(_,v)||_);const b=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let S=w===m||!o&&w.startsWith(m)&&w.charAt(b)==="/",j=_!=null&&(_===m||!o&&_.startsWith(m)&&_.charAt(m.length)==="/"),k={isActive:S,isPending:j,isTransitioning:x},A=S?n:void 0,R;typeof i=="function"?R=i(k):R=[i,S?"active":null,j?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(k):s;return O.createElement(YM,Id({},f,{"aria-current":A,className:R,ref:r,style:T,to:l,viewTransition:u}),typeof d=="function"?d(k):d)});var Kv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Kv||(Kv={}));var M1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(M1||(M1={}));function QM(e){let t=O.useContext(ph);return t||kt(!1),t}function JM(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:s}=t===void 0?{}:t,l=Bc(),u=_o(),d=mh(e,{relative:o});return O.useCallback(f=>{if(zM(f,r)){f.preventDefault();let p=n!==void 0?n:$d(u)===$d(d);l(e,{replace:p,state:a,preventScrollReset:i,relative:o,viewTransition:s})}},[u,l,d,n,a,r,e,i,o,s])}function eD(e){let t=O.useRef(Gv(e)),r=O.useRef(!1),n=_o(),a=O.useMemo(()=>BM(n.search,r.current?null:t.current),[n.search]),i=Bc(),o=O.useCallback((s,l)=>{const u=Gv(typeof s=="function"?s(a):s);r.current=!0,i("?"+u,l)},[i,a]);return[a,o]}function tD(e,t){t===void 0&&(t={});let r=O.useContext(HM);r==null&&kt(!1);let{basename:n}=QM(Kv.useViewTransitionState),a=mh(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Os(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Os(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Wv(a.pathname,o)!=null||Wv(a.pathname,i)!=null}/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var rD={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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const it=(e,t)=>{const r=O.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:s="",children:l,...u},d)=>O.createElement("svg",{ref:d,...rD,width:a,height:a,stroke:n,strokeWidth:o?Number(i)*24/Number(a):i,className:["lucide",`lucide-${nD(e)}`,s].join(" "),...u},[...t.map(([f,p])=>O.createElement(f,p)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nd=it("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aD=it("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iD=it("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oD=it("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sD=it("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ru=it("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nu=it("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lD=it("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uD=it("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cD=it("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.363.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=it("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fD=it("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** - * @license lucide-react v0.363.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=it("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dD=it("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pD=it("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hD=it("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mD=it("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yD=it("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vD=it("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hE=it("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rd=it("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wf=it("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hi=it("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const D1=it("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gD=it("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xD=it("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wa=it("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.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mE=it("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** - * @license lucide-react v0.363.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bD=it("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function wD(){return c.jsxs("aside",{className:"w-64 shrink-0 flex flex-col h-screen bg-white dark:bg-black border-r border-slate-200 dark:border-[#151515] relative z-20 transition-colors duration-300",children:[c.jsx("div",{className:"min-h-20 px-6 py-5 flex flex-col justify-center gap-2 border-b border-slate-200 dark:border-[#151515] transition-colors duration-300",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx("img",{src:"/dashboard/logo/decision-engine-light.svg",alt:"Juspay Decision Engine",className:"h-11 w-auto dark:hidden"}),c.jsx("img",{src:"/dashboard/logo/decision-engine-dark.svg",alt:"Juspay Decision Engine",className:"hidden h-11 w-auto dark:block"})]})}),c.jsxs("nav",{className:"flex-1 px-4 py-8 space-y-1 overflow-y-auto",children:[c.jsx(ea,{to:"/",icon:mD,end:!0,children:"Overview"}),c.jsx(ea,{to:"/decisions",icon:gD,children:"Decision Explorer"}),c.jsx(ea,{to:"/analytics",icon:iD,children:"Analytics"}),c.jsx(ea,{to:"/audit",icon:nd,children:"Decision Audit"}),c.jsx("div",{className:"pt-8 pb-3 px-3 flex items-center gap-2",children:c.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-slate-400 dark:text-[#66666e]",children:"Routing"})}),c.jsx(ea,{to:"/routing",icon:dD,end:!0,children:"Routing Hub"}),c.jsx(ea,{to:"/routing/sr",icon:mE,indent:!0,children:"Auth-Rate Based"}),c.jsx(ea,{to:"/routing/rules",icon:oD,indent:!0,children:"Rule-Based"}),c.jsx(ea,{to:"/routing/volume",icon:Rd,indent:!0,children:"Volume Split"}),c.jsx(ea,{to:"/routing/debit",icon:hE,indent:!0,children:"Debit Routing"})]}),c.jsx("div",{className:"px-6 py-5 border-t border-slate-200 dark:border-[#151515] bg-slate-50 dark:bg-black transition-colors duration-300",children:c.jsx("span",{className:"text-[11px] text-slate-500 dark:text-[#66666e] font-medium tracking-wide",children:"v1.4"})})]})}function ea({to:e,icon:t,children:r,end:n,indent:a}){return c.jsx(ZM,{to:e,end:n,className:({isActive:i})=>`group relative flex items-center gap-3 px-4 py-3 rounded-[14px] text-[14px] font-medium transition-all duration-200 ${a?"ml-3 w-[calc(100%-12px)]":""} ${i?"bg-slate-100 text-brand-600 dark:bg-[#151518] dark:text-white shadow-sm":"text-slate-500 hover:text-slate-900 hover:bg-slate-50 dark:text-[#888891] dark:hover:text-white dark:hover:bg-[#0c0c0e]"}`,children:({isActive:i})=>c.jsxs(c.Fragment,{children:[c.jsx(t,{size:18,className:`transition-colors duration-200 ${i?"text-brand-600 dark:text-white":"text-slate-400 dark:text-[#55555e] group-hover:text-slate-600 dark:group-hover:text-white"}`,strokeWidth:i?2.5:2}),c.jsx("span",{className:"flex-1",children:r})]})})}const _D={},L1=e=>{let t;const r=new Set,n=(d,f)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const h=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(g=>g(t,h))}},a=()=>t,l={setState:n,getState:a,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(_D?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,a,l);return l},SD=e=>e?L1(e):L1;var yE={exports:{}},vE={},gE={exports:{}},xE={};/** - * @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 ks=O;function jD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var OD=typeof Object.is=="function"?Object.is:jD,kD=ks.useState,AD=ks.useEffect,ED=ks.useLayoutEffect,PD=ks.useDebugValue;function ND(e,t){var r=t(),n=kD({inst:{value:r,getSnapshot:t}}),a=n[0].inst,i=n[1];return ED(function(){a.value=r,a.getSnapshot=t,Wm(a)&&i({inst:a})},[e,r,t]),AD(function(){return Wm(a)&&i({inst:a}),e(function(){Wm(a)&&i({inst:a})})},[e]),PD(r),r}function Wm(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!OD(e,r)}catch{return!0}}function CD(e,t){return t()}var TD=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?CD:ND;xE.useSyncExternalStore=ks.useSyncExternalStore!==void 0?ks.useSyncExternalStore:TD;gE.exports=xE;var qv=gE.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.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 vh=O,$D=qv;function ID(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var RD=typeof Object.is=="function"?Object.is:ID,MD=$D.useSyncExternalStore,DD=vh.useRef,LD=vh.useEffect,FD=vh.useMemo,zD=vh.useDebugValue;vE.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=DD(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=FD(function(){function l(h){if(!u){if(u=!0,d=h,h=n(h),a!==void 0&&o.hasValue){var g=o.value;if(a(g,h))return f=g}return f=h}if(g=f,RD(d,h))return g;var y=n(h);return a!==void 0&&a(g,y)?(d=h,g):(d=h,f=y)}var u=!1,d,f,p=r===void 0?null:r;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,r,n,a]);var s=MD(e,i[0],i[1]);return LD(function(){o.hasValue=!0,o.value=s},[s]),zD(s),s};yE.exports=vE;var BD=yE.exports;const UD=nt(BD),bE={},{useDebugValue:VD}=C,{useSyncExternalStoreWithSelector:WD}=UD;let F1=!1;const HD=e=>e;function GD(e,t=HD,r){(bE?"production":void 0)!=="production"&&r&&!F1&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),F1=!0);const n=WD(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return VD(n),n}const KD=e=>{(bE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?SD(e):e,r=(n,a)=>GD(t,n,a);return Object.assign(r,t),r},qD=e=>KD,XD={};function YD(e,t){let r;try{r=e()}catch{return}return{getItem:a=>{var i;const o=l=>l===null?null:JSON.parse(l,void 0),s=(i=r.getItem(a))!=null?i:null;return s instanceof Promise?s.then(o):o(s)},setItem:(a,i)=>r.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>r.removeItem(a)}}const Xu=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Xu(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Xu(n)(r)}}}},ZD=(e,t)=>(r,n,a)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,x)=>({...x,...v}),...t},o=!1;const s=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...v)},n,a);const d=Xu(i.serialize),f=()=>{const v=i.partialize({...n()});let x;const m=d({state:v,version:i.version}).then(w=>u.setItem(i.name,w)).catch(w=>{x=w});if(x)throw x;return m},p=a.setState;a.setState=(v,x)=>{p(v,x),f()};const h=e((...v)=>{r(...v),f()},n,a);let g;const y=()=>{var v;if(!u)return;o=!1,s.forEach(m=>m(n()));const x=((v=i.onRehydrateStorage)==null?void 0:v.call(i,n()))||void 0;return Xu(u.getItem.bind(u))(i.name).then(m=>{if(m)return i.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var w;return g=i.merge(m,(w=n())!=null?w:h),r(g,!0),f()}).then(()=>{x==null||x(g,void 0),o=!0,l.forEach(m=>m(g))}).catch(m=>{x==null||x(void 0,m)})};return a.persist={setOptions:v=>{i={...i,...v},v.getStorage&&(u=v.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},y(),g||h},QD=(e,t)=>(r,n,a)=>{let i={storage:YD(()=>localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},o=!1;const s=new Set,l=new Set;let u=i.storage;if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...y)},n,a);const d=()=>{const y=i.partialize({...n()});return u.setItem(i.name,{state:y,version:i.version})},f=a.setState;a.setState=(y,v)=>{f(y,v),d()};const p=e((...y)=>{r(...y),d()},n,a);a.getInitialState=()=>p;let h;const g=()=>{var y,v;if(!u)return;o=!1,s.forEach(m=>{var w;return m((w=n())!=null?w:p)});const x=((v=i.onRehydrateStorage)==null?void 0:v.call(i,(y=n())!=null?y:p))||void 0;return Xu(u.getItem.bind(u))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return[!0,i.migrate(m.state,m.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var w;const[_,b]=m;if(h=i.merge(b,(w=n())!=null?w:p),r(h,!0),_)return d()}).then(()=>{x==null||x(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{x==null||x(void 0,m)})};return a.persist={setOptions:y=>{i={...i,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},i.skipHydration||g(),h||p},JD=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((XD?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),ZD(e,t)):QD(e,t),eL=JD,Xn=qD()(eL(e=>({merchantId:"",setMerchantId:t=>{console.log(` -[STORE] Merchant ID changed: "${t}"`),e({merchantId:t})}}),{name:"merchant-store"})),tL="public";function rL(e,t,r){console.log(` -`+"=".repeat(80)),console.log(`[API REQUEST] ${new Date().toISOString()}`),console.log(`Method: ${e}`),console.log(`Path: ${t}`),r!==void 0&&console.log("Body:",JSON.stringify(r,null,2)),console.log("=".repeat(80))}function nL(e,t,r,n){console.log(` -`+"-".repeat(80)),console.log(`[API RESPONSE] ${new Date().toISOString()}`),console.log(`Path: ${e}`),console.log(`Status: ${t} ${r}`),console.log("Response Body:",n),console.log("-".repeat(80)+` -`)}function z1(e,t){console.log(` -`+"!".repeat(80)),console.log(`[API ERROR] ${new Date().toISOString()}`),console.log(`Path: ${e}`),t instanceof Error?(console.log("Error:",t.message),console.log("Stack:",t.stack)):console.log("Error:",t),console.log("!".repeat(80)+` -`)}async function wE(e,t){const r=(t==null?void 0:t.method)||"GET",n=t!=null&&t.body?JSON.parse(t.body):void 0;rL(r,e,n);try{const a=await fetch(e,{headers:{"Content-Type":"application/json","x-tenant-id":tL,...t==null?void 0:t.headers},...t}),i=await a.text();let o;try{const s=JSON.parse(i);o=JSON.stringify(s,null,2)}catch{o=i}if(nL(e,a.status,a.statusText,o),!a.ok){const s=new Error(`API error ${a.status}: ${i}`);throw z1(e,s),s}return i.trim()?JSON.parse(i):void 0}catch(a){throw z1(e,a),a}}async function _t(e,t){return wE(e,{method:"POST",body:t!==void 0?JSON.stringify(t):void 0})}async function Qi(e){return wE(e)}function aL(){const{merchantId:e,setMerchantId:t}=Xn(),[r,n]=O.useState(e),[a,i]=O.useState(!1),[o,s]=O.useState(()=>localStorage.getItem("theme")==="dark");O.useEffect(()=>{const u=window.document.documentElement;o?(u.classList.add("dark"),localStorage.setItem("theme","dark")):(u.classList.remove("dark"),localStorage.setItem("theme","light"))},[o]);async function l(){const u=r.trim();if(u){t(u),i(!0);try{await _t("/merchant-account/create",{merchant_id:u,gateway_success_rate_based_decider_input:null})}catch{}finally{i(!1)}}}return c.jsxs("header",{className:"h-[76px] bg-white dark:bg-black border-b border-slate-200 dark:border-[#151515] flex items-center justify-between px-8 shrink-0 relative z-10 transition-colors duration-300",children:[c.jsx("div",{}),c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsxs("div",{className:"relative",children:[c.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&l(),placeholder:"Set Merchant ID",className:"w-72 bg-slate-50 dark:bg-[#0f0f11] border border-slate-200 dark:border-[#222222] rounded-full px-4 py-2 text-sm text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-[#66666e] focus:outline-none focus:border-slate-400 dark:focus:border-[#444444] transition-colors"}),c.jsx("button",{onClick:l,disabled:a,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-slate-400 hover:text-brand-500 dark:text-[#66666e] dark:hover:text-white transition-colors",children:a?c.jsx(yD,{size:16,className:"animate-spin"}):c.jsx(aD,{size:16})})]}),e&&c.jsxs("div",{className:"flex items-center gap-2 pl-6 ml-2 border-l border-slate-200 dark:border-[#222222] transition-colors duration-300",children:[c.jsx(sD,{size:16,className:"text-brand-500 dark:text-[#66666e]"}),c.jsx("span",{className:"text-sm text-slate-800 dark:text-white font-medium",children:e})]}),c.jsx("button",{onClick:()=>s(!o),className:"p-2.5 rounded-full bg-slate-100 text-slate-600 hover:bg-slate-200 dark:bg-[#151515] dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#222222] transition-colors duration-200","aria-label":"Toggle theme",children:o?c.jsx(xD,{size:18}):c.jsx(vD,{size:18})})]})]})}function iL(){return c.jsxs("div",{className:"flex h-screen overflow-hidden bg-[#f8fafc] text-slate-900 dark:bg-[#000000] dark:text-white relative transition-colors duration-300",children:[c.jsx("div",{className:"aurora-top"}),c.jsx(wD,{}),c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[c.jsx(aL,{}),c.jsx("main",{className:"flex-1 overflow-y-auto p-8 relative",children:c.jsx(MM,{})})]})]})}const _E=0,SE=1,jE=2,B1=3;var U1=Object.prototype.hasOwnProperty;function Xv(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&Xv(e[n],t[n]););return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(U1.call(e,r)&&++n&&!U1.call(t,r)||!(r in t)||!Xv(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const ia=new WeakMap,la=()=>{},dr=la(),Yv=Object,Ge=e=>e===dr,Ln=e=>typeof e=="function",mi=(e,t)=>({...e,...t}),OE=e=>Ln(e.then),Hm={},_f={},Xx="undefined",Uc=typeof window!=Xx,Zv=typeof document!=Xx,oL=Uc&&"Deno"in window,sL=()=>Uc&&typeof window.requestAnimationFrame!=Xx,kE=(e,t)=>{const r=ia.get(e);return[()=>!Ge(t)&&e.get(t)||Hm,n=>{if(!Ge(t)){const a=e.get(t);t in _f||(_f[t]=a),r[5](t,mi(a,n),a||Hm)}},r[6],()=>!Ge(t)&&t in _f?_f[t]:!Ge(t)&&e.get(t)||Hm]};let Qv=!0;const lL=()=>Qv,[Jv,eg]=Uc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[la,la],uL=()=>{const e=Zv&&document.visibilityState;return Ge(e)||e!=="hidden"},cL=e=>(Zv&&document.addEventListener("visibilitychange",e),Jv("focus",e),()=>{Zv&&document.removeEventListener("visibilitychange",e),eg("focus",e)}),fL=e=>{const t=()=>{Qv=!0,e()},r=()=>{Qv=!1};return Jv("online",t),Jv("offline",r),()=>{eg("online",t),eg("offline",r)}},dL={isOnline:lL,isVisible:uL},pL={initFocus:cL,initReconnect:fL},V1=!C.useId,cs=!Uc||oL,hL=e=>sL()?window.requestAnimationFrame(e):setTimeout(e,1),Gm=cs?O.useEffect:O.useLayoutEffect,Km=typeof navigator<"u"&&navigator.connection,W1=!cs&&Km&&(["slow-2g","2g"].includes(Km.effectiveType)||Km.saveData),Sf=new WeakMap,mL=e=>Yv.prototype.toString.call(e),qm=(e,t)=>e===`[object ${t}]`;let yL=0;const tg=e=>{const t=typeof e,r=mL(e),n=qm(r,"Date"),a=qm(r,"RegExp"),i=qm(r,"Object");let o,s;if(Yv(e)===e&&!n&&!a){if(o=Sf.get(e),o)return o;if(o=++yL+"~",Sf.set(e,o),Array.isArray(e)){for(o="@",s=0;s{if(Ln(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?tg(e):"",[e,t]};let vL=0;const rg=()=>++vL;async function AE(...e){const[t,r,n,a]=e,i=mi({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const u=p=>typeof s=="function"?s(p):s!==!1,d=i.throwOnError;if(Ln(r)){const p=r,h=[],g=t.keys();for(const y of g)!/^\$(inf|sub)\$/.test(y)&&p(t.get(y)._k)&&h.push(y);return Promise.all(h.map(f))}return f(r);async function f(p){const[h]=Yx(p);if(!h)return;const[g,y]=kE(t,h),[v,x,m,w]=ia.get(t),_=()=>{const D=v[h];return(Ln(i.revalidate)?i.revalidate(g().data,p):i.revalidate!==!1)&&(delete m[h],delete w[h],D&&D[0])?D[0](jE).then(()=>g().data):g().data};if(e.length<3)return _();let b=n,S,j=!1;const k=rg();x[h]=[k,0];const A=!Ge(l),R=g(),T=R.data,N=R._c,$=Ge(N)?T:N;if(A&&(l=Ln(l)?l($,T):l,y({data:l,_c:$})),Ln(b))try{b=b($)}catch(D){S=D,j=!0}if(b&&OE(b))if(b=await b.catch(D=>{S=D,j=!0}),k!==x[h][0]){if(j)throw S;return b}else j&&A&&u(S)&&(o=!0,y({data:$,_c:dr}));if(o&&!j)if(Ln(o)){const D=o(b,$);y({data:D,error:dr,_c:dr})}else y({data:b,error:dr,_c:dr});if(x[h][1]=rg(),Promise.resolve(_()).then(()=>{y({_c:dr})}),j){if(d)throw S;return}return b}}const H1=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},gL=(e,t)=>{if(!ia.has(e)){const r=mi(pL,t),n=Object.create(null),a=AE.bind(dr,e);let i=la;const o=Object.create(null),s=(d,f)=>{const p=o[d]||[];return o[d]=p,p.push(f),()=>p.splice(p.indexOf(f),1)},l=(d,f,p)=>{e.set(d,f);const h=o[d];if(h)for(const g of h)g(f,p)},u=()=>{if(!ia.has(e)&&(ia.set(e,[n,Object.create(null),Object.create(null),Object.create(null),a,l,s]),!cs)){const d=r.initFocus(setTimeout.bind(dr,H1.bind(dr,n,_E))),f=r.initReconnect(setTimeout.bind(dr,H1.bind(dr,n,SE)));i=()=>{d&&d(),f&&f(),ia.delete(e)}}};return u(),[e,a,u,i]}return[e,ia.get(e)[4]]},xL=(e,t,r,n,a)=>{const i=r.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!Ge(i)&&o>i||setTimeout(n,s,a)},bL=Xv,[EE,wL]=gL(new Map),_L=mi({onLoadingSlow:la,onSuccess:la,onError:la,onErrorRetry:xL,onDiscarded:la,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:W1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:W1?5e3:3e3,compare:bL,isPaused:()=>!1,cache:EE,mutate:wL,fallback:{}},dL),SL=(e,t)=>{const r=mi(e,t);if(t){const{use:n,fallback:a}=e,{use:i,fallback:o}=t;n&&i&&(r.use=n.concat(i)),a&&o&&(r.fallback=mi(a,o))}return r},jL=O.createContext({}),OL="$inf$",PE=Uc&&window.__SWR_DEVTOOLS_USE__,kL=PE?window.__SWR_DEVTOOLS_USE__:[],AL=()=>{PE&&(window.__SWR_DEVTOOLS_REACT__=C)},EL=e=>Ln(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],PL=()=>{const e=O.useContext(jL);return O.useMemo(()=>mi(_L,e),[e])},NL=e=>(t,r,n)=>e(t,r&&((...i)=>{const[o]=Yx(t),[,,,s]=ia.get(EE);if(o.startsWith(OL))return r(...i);const l=s[o];return Ge(l)?r(...i):(delete s[o],l)}),n),CL=kL.concat(NL),TL=e=>function(...r){const n=PL(),[a,i,o]=EL(r),s=SL(n,o);let l=e;const{use:u}=s,d=(u||[]).concat(CL);for(let f=d.length;f--;)l=d[f](l);return l(a,i||s.fetcher||null,s)},$L=(e,t,r)=>{const n=t[e]||(t[e]=[]);return n.push(r),()=>{const a=n.indexOf(r);a>=0&&(n[a]=n[n.length-1],n.pop())}};AL();const Xm=C.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ym={dedupe:!0},G1=Promise.resolve(dr),IL=()=>la,RL=(e,t,r)=>{const{cache:n,compare:a,suspense:i,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:f,keepPreviousData:p,strictServerPrefetchWarning:h}=r,[g,y,v,x]=ia.get(n),[m,w]=Yx(e),_=O.useRef(!1),b=O.useRef(!1),S=O.useRef(m),j=O.useRef(t),k=O.useRef(r),A=()=>k.current,R=()=>A().isVisible()&&A().isOnline(),[T,N,$,D]=kE(n,m),F=O.useRef({}).current,V=Ge(o)?Ge(r.fallback)?dr:r.fallback[m]:o,H=(we,Re)=>{for(const Te in F){const $e=Te;if($e==="data"){if(!a(we[$e],Re[$e])&&(!Ge(we[$e])||!a(ce,Re[$e])))return!1}else if(Re[$e]!==we[$e])return!1}return!0},L=!_.current,U=O.useMemo(()=>{const we=T(),Re=D(),Te=E=>{const M=mi(E);return delete M._k,(()=>{if(!m||!t||A().isPaused())return!1;if(L&&!Ge(s))return s;const z=Ge(V)?M.data:V;return Ge(z)||l})()?{isValidating:!0,isLoading:!0,...M}:M},$e=Te(we),Ze=we===Re?$e:Te(Re);let W=$e;return[()=>{const E=Te(T());return H(E,W)?(W.data=E.data,W.isLoading=E.isLoading,W.isValidating=E.isValidating,W.error=E.error,W):(W=E,E)},()=>Ze]},[n,m]),K=qv.useSyncExternalStore(O.useCallback(we=>$(m,(Re,Te)=>{H(Te,Re)||we()}),[n,m]),U[0],U[1]),Q=g[m]&&g[m].length>0,G=K.data,re=Ge(G)?V&&OE(V)?Xm(V):V:G,Z=K.error,pe=O.useRef(re),ce=p?Ge(G)?Ge(pe.current)?re:pe.current:G:re,Ee=m&&Ge(re),Ie=O.useRef(null);!cs&&qv.useSyncExternalStore(IL,()=>(Ie.current=!1,Ie),()=>(Ie.current=!0,Ie));const te=Ie.current;h&&te&&!i&&Ee&&console.warn(`Missing pre-initiated data for serialized key "${m}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const oe=!m||!t||A().isPaused()||Q&&!Ge(Z)?!1:L&&!Ge(s)?s:i?Ge(re)?!1:l:Ge(re)||l,he=L&&oe,X=Ge(K.isValidating)?he:K.isValidating,Oe=Ge(K.isLoading)?he:K.isLoading,ge=O.useCallback(async we=>{const Re=j.current;if(!m||!Re||b.current||A().isPaused())return!1;let Te,$e,Ze=!0;const W=we||{},E=!v[m]||!W.dedupe,M=()=>V1?!b.current&&m===S.current&&_.current:m===S.current,P={isValidating:!1,isLoading:!1},z=()=>{N(P)},q=()=>{const ee=v[m];ee&&ee[1]===$e&&delete v[m]},J={isValidating:!0};Ge(T().data)&&(J.isLoading=!0);try{if(E&&(N(J),r.loadingTimeout&&Ge(T().data)&&setTimeout(()=>{Ze&&M()&&A().onLoadingSlow(m,r)},r.loadingTimeout),v[m]=[Re(w),rg()]),[Te,$e]=v[m],Te=await Te,E&&setTimeout(q,r.dedupingInterval),!v[m]||v[m][1]!==$e)return E&&M()&&A().onDiscarded(m),!1;P.error=dr;const ee=y[m];if(!Ge(ee)&&($e<=ee[0]||$e<=ee[1]||ee[1]===0))return z(),E&&M()&&A().onDiscarded(m),!1;const be=T().data;P.data=a(be,Te)?be:Te,E&&M()&&A().onSuccess(Te,m,r)}catch(ee){q();const be=A(),{shouldRetryOnError:Pe}=be;be.isPaused()||(P.error=ee,E&&M()&&(be.onError(ee,m,be),(Pe===!0||Ln(Pe)&&Pe(ee))&&(!A().revalidateOnFocus||!A().revalidateOnReconnect||R())&&be.onErrorRetry(ee,m,be,Et=>{const et=g[m];et&&et[0]&&et[0](B1,Et)},{retryCount:(W.retryCount||0)+1,dedupe:!0})))}return Ze=!1,z(),!0},[m,n]),_e=O.useCallback((...we)=>AE(n,S.current,...we),[]);if(Gm(()=>{j.current=t,k.current=r,Ge(G)||(pe.current=G)}),Gm(()=>{if(!m)return;const we=ge.bind(dr,Ym);let Re=0;A().revalidateOnFocus&&(Re=Date.now()+A().focusThrottleInterval);const $e=$L(m,g,(Ze,W={})=>{if(Ze==_E){const E=Date.now();A().revalidateOnFocus&&E>Re&&R()&&(Re=E+A().focusThrottleInterval,we())}else if(Ze==SE)A().revalidateOnReconnect&&R()&&we();else{if(Ze==jE)return ge();if(Ze==B1)return ge(W)}});return b.current=!1,S.current=m,_.current=!0,N({_k:w}),oe&&(v[m]||(Ge(re)||cs?we():hL(we))),()=>{b.current=!0,$e()}},[m]),Gm(()=>{let we;function Re(){const $e=Ln(u)?u(T().data):u;$e&&we!==-1&&(we=setTimeout(Te,$e))}function Te(){!T().error&&(d||A().isVisible())&&(f||A().isOnline())?ge(Ym).then(Re):Re()}return Re(),()=>{we&&(clearTimeout(we),we=-1)}},[u,d,f,m]),O.useDebugValue(ce),i){if(!V1&&cs&&Ee)throw new Error("Fallback data is required when using Suspense in SSR.");Ee&&(j.current=t,k.current=r,b.current=!1);const we=x[m],Re=!Ge(we)&&Ee?_e(we):G1;if(Xm(Re),!Ge(Z)&&Ee)throw Z;const Te=Ee?ge(Ym):G1;!Ge(ce)&&Ee&&(Te.status="fulfilled",Te.value=!0),Xm(Te)}return{mutate:_e,get data(){return F.data=!0,ce},get error(){return F.error=!0,Z},get isValidating(){return F.isValidating=!0,X},get isLoading(){return F.isLoading=!0,Oe}}},ir=TL(RL);function ke({children:e,className:t="",onClick:r}){return c.jsx("div",{className:`glass-panel rounded-[20px] ${r?"glass-panel-hover cursor-pointer":""} ${t}`,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:e})}function qe({children:e,className:t=""}){return c.jsx("div",{className:`px-6 py-5 border-b border-slate-200 dark:border-[#1c1c1f] bg-slate-50 dark:bg-[#0c0c0e] rounded-t-[20px] ${t}`,children:e})}function Ae({children:e,className:t=""}){return c.jsx("div",{className:`px-6 py-5 ${t}`,children:e})}const ML={green:"bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20",gray:"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8",blue:"bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20",red:"bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20",orange:"bg-orange-500/10 text-orange-400 ring-1 ring-inset ring-orange-500/20",purple:"bg-purple-500/10 text-purple-400 ring-1 ring-inset ring-purple-500/20"};function ze({variant:e="gray",children:t}){return c.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${ML[e]}`,children:t})}function DL(){const[e,t]=O.useState("loading");return O.useEffect(()=>{console.log(` -[HEALTH CHECK] ${new Date().toISOString()}`),console.log("Fetching: GET /health"),fetch("/health").then(r=>{console.log(`[HEALTH CHECK] Response: ${r.status} ${r.statusText}`),t(r.ok?"up":"down")}).catch(r=>{console.log(`[HEALTH CHECK ERROR] ${r.message}`),t("down")})},[]),e}function LL(){var l,u;const e=Bc(),{merchantId:t}=Xn(),r=DL(),{data:n}=ir(t?`/routing/list/active/${t}`:null,()=>_t(`/routing/list/active/${t}`),{shouldRetryOnError:!1}),{data:a,error:i}=ir(t?["/rule/get","successRate",t]:null,()=>_t("/rule/get",{merchant_id:t,algorithm:"successRate"})),o=n&&n.length>0?n[0]:null,s=(n||[]).some(d=>{var f;return((f=d.algorithm_data||d.algorithm)==null?void 0:f.type)==="advanced"});return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Overview"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Decision Engine routing health and status"})]}),!t&&c.jsxs("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 flex items-center gap-2 text-sm text-yellow-800",children:[c.jsx(lD,{size:16}),"Set your Merchant ID in the top bar to load configuration."]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[c.jsx(ke,{children:c.jsxs(Ae,{className:"flex items-center gap-3",children:[r==="up"?c.jsx(uD,{className:"text-green-500",size:24}):r==="down"?c.jsx(cD,{className:"text-red-500",size:24}):c.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-gray-200 border-t-gray-500 animate-spin"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500",children:"API Health"}),c.jsx("p",{className:"text-sm font-medium",children:r==="up"?"Healthy":r==="down"?"Down":"Checking..."})]})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Active Routing Rule"}),t?o?c.jsxs("div",{children:[c.jsx(ze,{variant:"green",children:"Active"}),c.jsx("p",{className:"text-sm font-medium mt-1 truncate",children:o.name}),c.jsx("p",{className:"text-xs text-slate-400",children:(l=o.algorithm_data||o.algorithm)==null?void 0:l.type})]}):c.jsx(ze,{variant:"gray",children:"Not Configured"}):c.jsx(ze,{variant:"gray",children:"Not set"})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/sr"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Auth-Rate Config"}),t?i?c.jsx(ze,{variant:"gray",children:"Not Configured"}):a!=null&&a.data?c.jsx(ze,{variant:"green",children:"Configured"}):c.jsx(ze,{variant:"gray",children:"Not Configured"}):c.jsx(ze,{variant:"gray",children:"Not set"})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/rules"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Rule-Based Routing"}),t?s?c.jsx(ze,{variant:"green",children:"Configured"}):c.jsx(ze,{variant:"gray",children:"Not Configured"}):c.jsx(ze,{variant:"gray",children:"Not set"})]})})]}),o&&c.jsxs(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:[c.jsx(qe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Routing Configuration"})}),c.jsx(Ae,{children:c.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Name"}),c.jsx("dd",{className:"font-medium",children:o.name})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Type"}),c.jsx("dd",{className:"font-medium capitalize",children:(u=o.algorithm_data||o.algorithm)==null?void 0:u.type})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Algorithm For"}),c.jsx("dd",{className:"font-medium capitalize",children:o.algorithm_for})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"ID"}),c.jsx("dd",{className:"font-mono text-xs text-slate-600",children:o.id})]})]})})]})]})}function FL(){const e=Bc(),{merchantId:t}=Xn(),{data:r}=ir(t?`/routing/list/active/${t}`:null,()=>_t(`/routing/list/active/${t}`)),{data:n}=ir(t?["/rule/get","successRate",t]:null,()=>_t("/rule/get",{merchant_id:t,algorithm:"successRate"})),a=[{id:"sr",title:"Auth-Rate Based Routing",description:"Dynamically route to the best-performing gateway based on real-time authorization rates.",icon:mE,route:"/routing/sr",algorithmType:"successRate",checkConfigured:()=>{var i;return!!((i=n==null?void 0:n.config)!=null&&i.data)}},{id:"rules",title:"Rule-Based Routing",description:"Declarative routing rules to route payments based on conditions and attributes.",icon:hD,route:"/routing/rules",algorithmType:"advanced",checkConfigured:()=>(r||[]).some(i=>{var o;return((o=i.algorithm_data||i.algorithm)==null?void 0:o.type)==="advanced"})},{id:"volume",title:"Volume Split",description:"Distribute payment traffic across gateways by configurable percentage splits.",icon:Rd,route:"/routing/volume",algorithmType:"volume_split",checkConfigured:()=>(r||[]).some(i=>{var o;return((o=i.algorithm_data||i.algorithm)==null?void 0:o.type)==="volume_split"})},{id:"debit",title:"Network Routing",description:"Optimise debit network fees with acquirer-aware network-based routing.",icon:fD,route:"/routing/debit",algorithmType:"debitRouting",checkConfigured:()=>!1}];return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Routing Hub"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Click on any routing strategy to configure"})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(i=>{const o=i.icon,s=i.checkConfigured();return c.jsx(ke,{className:"flex flex-col hover:border-brand-300 cursor-pointer transition-all hover:shadow-md",onClick:()=>e(i.route),children:c.jsxs(Ae,{className:"flex-1 flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsx("div",{className:"p-2 bg-brand-50 rounded-lg border border-[#1c2d50]",children:c.jsx(o,{size:20,className:"text-brand-500"})}),c.jsx(ze,{variant:s?"green":"gray",children:s?"Configured":"Not Configured"})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-slate-900",children:i.title}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:i.description})]}),c.jsx("div",{className:"mt-auto pt-2",children:c.jsx("span",{className:"text-sm text-brand-600 font-medium",children:s?"Manage →":"Setup →"})})]})},i.id)})})]})}var Vc=e=>e.type==="checkbox",Wi=e=>e instanceof Date,Or=e=>e==null;const NE=e=>typeof e=="object";var Rt=e=>!Or(e)&&!Array.isArray(e)&&NE(e)&&!Wi(e),zL=e=>Rt(e)&&e.target?Vc(e.target)?e.target.checked:e.target.value:e,BL=(e,t)=>t.split(".").some((r,n,a)=>!isNaN(Number(r))&&e.has(a.slice(0,n).join("."))),UL=e=>{const t=e.constructor&&e.constructor.prototype;return Rt(t)&&t.hasOwnProperty("isPrototypeOf")},Zx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function vt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Zx&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Rt(e)&&UL(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=vt(e[a]));return n}var gh=e=>/^\w*$/.test(e),lt=e=>e===void 0,xh=e=>Array.isArray(e)?e.filter(Boolean):[],Qx=e=>xh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),le=(e,t,r)=>{if(!t||!Rt(e))return r;const n=(gh(t)?[t]:Qx(t)).reduce((a,i)=>Or(a)?a:a[i],e);return lt(n)||n===e?lt(e[t])?r:e[t]:n},Mn=e=>typeof e=="boolean",On=e=>typeof e=="function",rt=(e,t,r)=>{let n=-1;const a=gh(t)?[t]:Qx(t),i=a.length,o=i-1;for(;++nC.useContext(TE);var WL=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const o=i;return t._proxyFormState[o]!==an.all&&(t._proxyFormState[o]=!n||an.all),e[o]}});return a};const $E=typeof window<"u"?C.useLayoutEffect:C.useEffect;var vr=e=>typeof e=="string",HL=(e,t,r,n,a)=>vr(e)?(n&&t.watch.add(e),le(r,e,a)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),le(r,i))):(n&&(t.watchAll=!0),r),ng=e=>Or(e)||!NE(e);function Ka(e,t,r=new WeakSet){if(ng(e)||ng(t))return Object.is(e,t);if(Wi(e)&&Wi(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const o=e[i];if(!a.includes(i))return!1;if(i!=="ref"){const s=t[i];if(Wi(o)&&Wi(s)||(Rt(o)||Array.isArray(o))&&(Rt(s)||Array.isArray(s))?!Ka(o,s,r):!Object.is(o,s))return!1}}return!0}const GL=C.createContext(null);GL.displayName="HookFormContext";var IE=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Pr=e=>Array.isArray(e)?e:[e],K1=()=>{let e=[];return{get observers(){return e},next:a=>{for(const i of e)i.next&&i.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(i=>i!==a)}}),unsubscribe:()=>{e=[]}}};function RE(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],i=t[n];if(a&&Rt(a)&&i){const o=RE(a,i);Rt(o)&&(r[n]=o)}else e[n]&&(r[n]=i)}return r}var ur=e=>Rt(e)&&!Object.keys(e).length,Jx=e=>e.type==="file",Md=e=>{if(!Zx)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ME=e=>e.type==="select-multiple",eb=e=>e.type==="radio",KL=e=>eb(e)||Vc(e),Qm=e=>Md(e)&&e.isConnected;function qL(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(On(e[t]))return!0;return!1};function DE(e){return Array.isArray(e)||Rt(e)&&!YL(e)}function ag(e,t={}){for(const r in e){const n=e[r];DE(n)?(t[r]=Array.isArray(n)?[]:{},ag(n,t[r])):lt(n)||(t[r]=!0)}return t}function au(e,t,r){r||(r=ag(t));for(const n in e){const a=e[n];if(DE(a))lt(t)||ng(r[n])?r[n]=ag(a,Array.isArray(a)?[]:{}):au(a,Or(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!Ka(a,i)}}return r}const q1={value:!1,isValid:!1},X1={value:!0,isValid:!0};var LE=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!lt(e[0].attributes.value)?lt(e[0].value)||e[0].value===""?X1:{value:e[0].value,isValid:!0}:X1:q1}return q1},FE=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>lt(e)?e:t?e===""?NaN:e&&+e:r&&vr(e)?new Date(e):n?n(e):e;const Y1={isValid:!1,value:null};var zE=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Y1):Y1;function Z1(e){const t=e.ref;return Jx(t)?t.files:eb(t)?zE(e.refs).value:ME(t)?[...t.selectedOptions].map(({value:r})=>r):Vc(t)?LE(e.refs).value:FE(lt(t.value)?e.ref.value:t.value,e)}var ZL=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,QL=(e,t,r,n)=>{const a={};for(const i of e){const o=le(t,i);o&&rt(a,i,o._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},Dd=e=>e instanceof RegExp,Rl=e=>lt(e)?e:Dd(e)?e.source:Rt(e)?Dd(e.value)?e.value.source:e.value:e,Qo=e=>({isOnSubmit:!e||e===an.onSubmit,isOnBlur:e===an.onBlur,isOnChange:e===an.onChange,isOnAll:e===an.all,isOnTouch:e===an.onTouched});const Q1="AsyncFunction";var JL=e=>!!e&&!!e.validate&&!!(On(e.validate)&&e.validate.constructor.name===Q1||Rt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Q1)),e3=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ig=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const fs=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const i=le(e,a);if(i){const{_f:o,...s}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],a)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(fs(s,t))break}else if(Rt(s)&&fs(s,t))break}}};function J1(e,t,r){const n=le(e,r);if(n||gh(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),o=le(t,i),s=le(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(s&&s.type)return{name:i,error:s};if(s&&s.root&&s.root.type)return{name:`${i}.root`,error:s.root};a.pop()}return{name:r}}var t3=(e,t,r,n)=>{r(e);const{name:a,...i}=e;return ur(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||an.all))},r3=(e,t,r)=>!e||!t||e===t||Pr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),n3=(e,t,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:(r?n.isOnChange:a.isOnChange)?e:!0,a3=(e,t)=>!xh(le(e,t)).length&&Tt(e,t),BE=(e,t,r)=>{const n=Pr(le(e,r));return rt(n,CE,t[r]),rt(e,r,n),e};function e_(e,t,r="validate"){if(vr(e)||Array.isArray(e)&&e.every(vr)||Mn(e)&&!e)return{type:r,message:vr(e)?e:"",ref:t}}var Co=e=>Rt(e)&&!Dd(e)?e:{value:e,message:""},og=async(e,t,r,n,a,i)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:d,min:f,max:p,pattern:h,validate:g,name:y,valueAsNumber:v,mount:x}=e._f,m=le(r,y);if(!x||t.has(y))return{};const w=s?s[0]:o,_=N=>{a&&w.reportValidity&&(w.setCustomValidity(Mn(N)?"":N||""),w.reportValidity())},b={},S=eb(o),j=Vc(o),k=S||j,A=(v||Jx(o))&<(o.value)&<(m)||Md(o)&&o.value===""||m===""||Array.isArray(m)&&!m.length,R=IE.bind(null,y,n,b),T=(N,$,D,F=xn.maxLength,V=xn.minLength)=>{const H=N?$:D;b[y]={type:N?F:V,message:H,ref:o,...R(N?F:V,H)}};if(i?!Array.isArray(m)||!m.length:l&&(!k&&(A||Or(m))||Mn(m)&&!m||j&&!LE(s).isValid||S&&!zE(s).isValid)){const{value:N,message:$}=vr(l)?{value:!!l,message:l}:Co(l);if(N&&(b[y]={type:xn.required,message:$,ref:w,...R(xn.required,$)},!n))return _($),b}if(!A&&(!Or(f)||!Or(p))){let N,$;const D=Co(p),F=Co(f);if(!Or(m)&&!isNaN(m)){const V=o.valueAsNumber||m&&+m;Or(D.value)||(N=V>D.value),Or(F.value)||($=Vnew Date(new Date().toDateString()+" "+K),L=o.type=="time",U=o.type=="week";vr(D.value)&&m&&(N=L?H(m)>H(D.value):U?m>D.value:V>new Date(D.value)),vr(F.value)&&m&&($=L?H(m)+N.value,F=!Or($.value)&&m.length<+$.value;if((D||F)&&(T(D,N.message,$.message),!n))return _(b[y].message),b}if(h&&!A&&vr(m)){const{value:N,message:$}=Co(h);if(Dd(N)&&!m.match(N)&&(b[y]={type:xn.pattern,message:$,ref:o,...R(xn.pattern,$)},!n))return _($),b}if(g){if(On(g)){const N=await g(m,r),$=e_(N,w);if($&&(b[y]={...$,...R(xn.validate,$.message)},!n))return _($.message),b}else if(Rt(g)){let N={};for(const $ in g){if(!ur(N)&&!n)break;const D=e_(await g[$](m,r),w,$);D&&(N={...D,...R($,D.message)},_(D.message),n&&(b[y]=N))}if(!ur(N)&&(b[y]={ref:w,...N},!n))return b}}return _(!0),b};const i3={mode:an.onSubmit,reValidateMode:an.onChange,shouldFocusError:!0};function o3(e={}){let t={...i3,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:On(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},a=Rt(t.defaultValues)||Rt(t.values)?vt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:vt(a),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...d};let p={...f};const h={array:K1(),state:K1()},g=t.criteriaMode===an.all,y=E=>M=>{clearTimeout(u),u=setTimeout(E,M)},v=async E=>{if(!o.keepIsValid&&!t.disabled&&(f.isValid||p.isValid||E)){let M;t.resolver?(M=ur((await A()).errors),x()):M=await N({fields:n,onlyCheckValid:!0,eventType:No.VALID}),M!==r.isValid&&h.state.next({isValid:M})}},x=(E,M)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((E||Array.from(s.mount)).forEach(P=>{P&&(M?rt(r.validatingFields,P,M):Tt(r.validatingFields,P))}),h.state.next({validatingFields:r.validatingFields,isValidating:!ur(r.validatingFields)}))},m=E=>{const M=au(a,i),P=ZL(E);rt(r.dirtyFields,P,le(M,P))},w=(E,M=[],P,z,q=!0,J=!0)=>{if(z&&P&&!t.disabled){if(o.action=!0,J&&Array.isArray(le(n,E))){const ee=P(le(n,E),z.argA,z.argB);q&&rt(n,E,ee)}if(J&&Array.isArray(le(r.errors,E))){const ee=P(le(r.errors,E),z.argA,z.argB);q&&rt(r.errors,E,ee),a3(r.errors,E)}if((f.touchedFields||p.touchedFields)&&J&&Array.isArray(le(r.touchedFields,E))){const ee=P(le(r.touchedFields,E),z.argA,z.argB);q&&rt(r.touchedFields,E,ee)}(f.dirtyFields||p.dirtyFields)&&m(E),h.state.next({name:E,isDirty:D(E,M),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else rt(i,E,M)},_=(E,M)=>{rt(r.errors,E,M),h.state.next({errors:r.errors})},b=E=>{r.errors=E,h.state.next({errors:r.errors,isValid:!1})},S=(E,M,P,z)=>{const q=le(n,E);if(q){const J=le(i,E,lt(P)?le(a,E):P);lt(J)||z&&z.defaultChecked||M?rt(i,E,M?J:Z1(q._f)):H(E,J),o.mount&&!o.action&&v()}},j=(E,M,P,z,q)=>{let J=!1,ee=!1;const be={name:E};if(!t.disabled){if(!P||z){(f.isDirty||p.isDirty)&&(ee=r.isDirty,r.isDirty=be.isDirty=D(),J=ee!==be.isDirty);const Pe=Ka(le(a,E),M);ee=!!le(r.dirtyFields,E),Pe?Tt(r.dirtyFields,E):rt(r.dirtyFields,E,!0),be.dirtyFields=r.dirtyFields,J=J||(f.dirtyFields||p.dirtyFields)&&ee!==!Pe}if(P){const Pe=le(r.touchedFields,E);Pe||(rt(r.touchedFields,E,P),be.touchedFields=r.touchedFields,J=J||(f.touchedFields||p.touchedFields)&&Pe!==P)}J&&q&&h.state.next(be)}return J?be:{}},k=(E,M,P,z)=>{const q=le(r.errors,E),J=(f.isValid||p.isValid)&&Mn(M)&&r.isValid!==M;if(t.delayError&&P?(l=y(()=>_(E,P)),l(t.delayError)):(clearTimeout(u),l=null,P?rt(r.errors,E,P):Tt(r.errors,E)),(P?!Ka(q,P):q)||!ur(z)||J){const ee={...z,...J&&Mn(M)?{isValid:M}:{},errors:r.errors,name:E};r={...r,...ee},h.state.next(ee)}},A=async E=>(x(E,!0),await t.resolver(i,t.context,QL(E||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),R=async E=>{const{errors:M}=await A(E);if(x(E),E)for(const P of E){const z=le(M,P);z?rt(r.errors,P,z):Tt(r.errors,P)}else r.errors=M;return M},T=async({name:E,eventType:M})=>{if(e.validate){const P=await e.validate({formValues:i,formState:r,name:E,eventType:M});if(Rt(P))for(const z in P)P[z]&&ce(`${Zm}.${z}`,{message:vr(P.message)?P.message:"",type:xn.validate});else vr(P)||!P?ce(Zm,{message:P||"",type:xn.validate}):pe(Zm);return P}return!0},N=async({fields:E,onlyCheckValid:M,name:P,eventType:z,context:q={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(q.runRootValidation=!0,!await T({name:P,eventType:z})&&(q.valid=!1,M)))return q.valid;for(const J in E){const ee=E[J];if(ee){const{_f:be,...Pe}=ee;if(be){const Et=s.array.has(be.name),et=ee._f&&JL(ee._f);et&&f.validatingFields&&x([be.name],!0);const Le=await og(ee,s.disabled,i,g,t.shouldUseNativeValidation&&!M,Et);if(et&&f.validatingFields&&x([be.name]),Le[be.name]&&(q.valid=!1,M)||(!M&&(le(Le,be.name)?Et?BE(r.errors,Le,be.name):rt(r.errors,be.name,Le[be.name]):Tt(r.errors,be.name)),e.shouldUseNativeValidation&&Le[be.name]))break}!ur(Pe)&&await N({context:q,onlyCheckValid:M,fields:Pe,name:J,eventType:z})}}return q.valid},$=()=>{for(const E of s.unMount){const M=le(n,E);M&&(M._f.refs?M._f.refs.every(P=>!Qm(P)):!Qm(M._f.ref))&&oe(E)}s.unMount=new Set},D=(E,M)=>!t.disabled&&(E&&M&&rt(i,E,M),!Ka(re(),a)),F=(E,M,P)=>HL(E,s,{...o.mount?i:lt(M)?a:vr(E)?{[E]:M}:M},P,M),V=E=>xh(le(o.mount?i:a,E,t.shouldUnregister?le(a,E,[]):[])),H=(E,M,P={})=>{const z=le(n,E);let q=M;if(z){const J=z._f;J&&(!J.disabled&&rt(i,E,FE(M,J)),q=Md(J.ref)&&Or(M)?"":M,ME(J.ref)?[...J.ref.options].forEach(ee=>ee.selected=q.includes(ee.value)):J.refs?Vc(J.ref)?J.refs.forEach(ee=>{(!ee.defaultChecked||!ee.disabled)&&(Array.isArray(q)?ee.checked=!!q.find(be=>be===ee.value):ee.checked=q===ee.value||!!q)}):J.refs.forEach(ee=>ee.checked=ee.value===q):Jx(J.ref)?J.ref.value="":(J.ref.value=q,J.ref.type||h.state.next({name:E,values:vt(i)})))}(P.shouldDirty||P.shouldTouch)&&j(E,q,P.shouldTouch,P.shouldDirty,!0),P.shouldValidate&&G(E)},L=(E,M,P)=>{for(const z in M){if(!M.hasOwnProperty(z))return;const q=M[z],J=E+"."+z,ee=le(n,J);(s.array.has(E)||Rt(q)||ee&&!ee._f)&&!Wi(q)?L(J,q,P):H(J,q,P)}},U=(E,M,P={})=>{const z=le(n,E),q=s.array.has(E),J=vt(M);rt(i,E,J),q?(h.array.next({name:E,values:vt(i)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&P.shouldDirty&&(m(E),h.state.next({name:E,dirtyFields:r.dirtyFields,isDirty:D(E,J)}))):z&&!z._f&&!Or(J)?L(E,J,P):H(E,J,P),ig(E,s)?h.state.next({...r,name:E,values:vt(i)}):h.state.next({name:o.mount?E:void 0,values:vt(i)})},K=async E=>{o.mount=!0;const M=E.target;let P=M.name,z=!0;const q=le(n,P),J=Pe=>{z=Number.isNaN(Pe)||Wi(Pe)&&isNaN(Pe.getTime())||Ka(Pe,le(i,P,Pe))},ee=Qo(t.mode),be=Qo(t.reValidateMode);if(q){let Pe,Et;const et=M.type?Z1(q._f):zL(E),Le=E.type===No.BLUR||E.type===No.FOCUS_OUT,Ia=!e3(q._f)&&!e.validate&&!t.resolver&&!le(r.errors,P)&&!q._f.deps||n3(Le,le(r.touchedFields,P),r.isSubmitted,be,ee),tr=ig(P,s,Le);rt(i,P,et),Le?(!M||!M.readOnly)&&(q._f.onBlur&&q._f.onBlur(E),l&&l(0)):q._f.onChange&&q._f.onChange(E);const Ei=j(P,et,Le),Pi=!ur(Ei)||tr;if(!Le&&h.state.next({name:P,type:E.type,values:vt(i)}),Ia)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?Le&&v():Le||v()),Pi&&h.state.next({name:P,...tr?{}:Ei});if(!t.resolver&&e.validate&&await T({name:P,eventType:E.type}),!Le&&tr&&h.state.next({...r}),t.resolver){const{errors:Ni}=await A([P]);if(x([P]),J(et),z){const Eo=J1(r.errors,n,P),Ci=J1(Ni,n,Eo.name||P);Pe=Ci.error,P=Ci.name,Et=ur(Ni)}}else x([P],!0),Pe=(await og(q,s.disabled,i,g,t.shouldUseNativeValidation))[P],x([P]),J(et),z&&(Pe?Et=!1:(f.isValid||p.isValid)&&(Et=await N({fields:n,onlyCheckValid:!0,name:P,eventType:E.type})));z&&(q._f.deps&&(!Array.isArray(q._f.deps)||q._f.deps.length>0)&&G(q._f.deps),k(P,Et,Pe,Ei))}},Q=(E,M)=>{if(le(r.errors,M)&&E.focus)return E.focus(),1},G=async(E,M={})=>{let P,z;const q=Pr(E);if(t.resolver){const J=await R(lt(E)?E:q);P=ur(J),z=E?!q.some(ee=>le(J,ee)):P}else E?(z=(await Promise.all(q.map(async J=>{const ee=le(n,J);return await N({fields:ee&&ee._f?{[J]:ee}:ee,eventType:No.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&v()):z=P=await N({fields:n,name:E,eventType:No.TRIGGER});return h.state.next({...!vr(E)||(f.isValid||p.isValid)&&P!==r.isValid?{}:{name:E},...t.resolver||!E?{isValid:P}:{},errors:r.errors}),M.shouldFocus&&!z&&fs(n,Q,E?q:s.mount),z},re=(E,M)=>{let P={...o.mount?i:a};return M&&(P=RE(M.dirtyFields?r.dirtyFields:r.touchedFields,P)),lt(E)?P:vr(E)?le(P,E):E.map(z=>le(P,z))},Z=(E,M)=>({invalid:!!le((M||r).errors,E),isDirty:!!le((M||r).dirtyFields,E),error:le((M||r).errors,E),isValidating:!!le(r.validatingFields,E),isTouched:!!le((M||r).touchedFields,E)}),pe=E=>{const M=E?Pr(E):void 0;M==null||M.forEach(P=>Tt(r.errors,P)),M?M.forEach(P=>{h.state.next({name:P,errors:r.errors})}):h.state.next({errors:{}})},ce=(E,M,P)=>{const z=(le(n,E,{_f:{}})._f||{}).ref,q=le(r.errors,E)||{},{ref:J,message:ee,type:be,...Pe}=q;rt(r.errors,E,{...Pe,...M,ref:z}),h.state.next({name:E,errors:r.errors,isValid:!1}),P&&P.shouldFocus&&z&&z.focus&&z.focus()},Ee=(E,M)=>On(E)?h.state.subscribe({next:P=>"values"in P&&E(F(void 0,M),P)}):F(E,M,!0),Ie=E=>h.state.subscribe({next:M=>{r3(E.name,M.name,E.exact)&&t3(M,E.formState||f,$e,E.reRenderRoot)&&E.callback({values:{...i},...r,...M,defaultValues:a})}}).unsubscribe,te=E=>(o.mount=!0,p={...p,...E.formState},Ie({...E,formState:{...d,...E.formState}})),oe=(E,M={})=>{for(const P of E?Pr(E):s.mount)s.mount.delete(P),s.array.delete(P),M.keepValue||(Tt(n,P),Tt(i,P)),!M.keepError&&Tt(r.errors,P),!M.keepDirty&&Tt(r.dirtyFields,P),!M.keepTouched&&Tt(r.touchedFields,P),!M.keepIsValidating&&Tt(r.validatingFields,P),!t.shouldUnregister&&!M.keepDefaultValue&&Tt(a,P);h.state.next({values:vt(i)}),h.state.next({...r,...M.keepDirty?{isDirty:D()}:{}}),!M.keepIsValid&&v()},he=({disabled:E,name:M})=>{if(Mn(E)&&o.mount||E||s.disabled.has(M)){const q=s.disabled.has(M)!==!!E;E?s.disabled.add(M):s.disabled.delete(M),q&&o.mount&&!o.action&&v()}},X=(E,M={})=>{let P=le(n,E);const z=Mn(M.disabled)||Mn(t.disabled),q=!s.registerName.has(E)&&P&&!P._f.mount;return rt(n,E,{...P||{},_f:{...P&&P._f?P._f:{ref:{name:E}},name:E,mount:!0,...M}}),s.mount.add(E),P&&!q?he({disabled:Mn(M.disabled)?M.disabled:t.disabled,name:E}):S(E,!0,M.value),{...z?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:Rl(M.min),max:Rl(M.max),minLength:Rl(M.minLength),maxLength:Rl(M.maxLength),pattern:Rl(M.pattern)}:{},name:E,onChange:K,onBlur:K,ref:J=>{if(J){s.registerName.add(E),X(E,M),s.registerName.delete(E),P=le(n,E);const ee=lt(J.value)&&J.querySelectorAll&&J.querySelectorAll("input,select,textarea")[0]||J,be=KL(ee),Pe=P._f.refs||[];if(be?Pe.find(Et=>Et===ee):ee===P._f.ref)return;rt(n,E,{_f:{...P._f,...be?{refs:[...Pe.filter(Qm),ee,...Array.isArray(le(a,E))?[{}]:[]],ref:{type:ee.type,name:E}}:{ref:ee}}}),S(E,!1,void 0,ee)}else P=le(n,E,{}),P._f&&(P._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(BL(s.array,E)&&o.action)&&s.unMount.add(E)}}},Oe=()=>t.shouldFocusError&&fs(n,Q,s.mount),ge=E=>{Mn(E)&&(h.state.next({disabled:E}),fs(n,(M,P)=>{const z=le(n,P);z&&(M.disabled=z._f.disabled||E,Array.isArray(z._f.refs)&&z._f.refs.forEach(q=>{q.disabled=z._f.disabled||E}))},0,!1))},_e=(E,M)=>async P=>{let z;P&&(P.preventDefault&&P.preventDefault(),P.persist&&P.persist());let q=vt(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:J,values:ee}=await A();x(),r.errors=J,q=vt(ee)}else await N({fields:n,eventType:No.SUBMIT});if(s.disabled.size)for(const J of s.disabled)Tt(q,J);if(Tt(r.errors,CE),ur(r.errors)){h.state.next({errors:{}});try{await E(q,P)}catch(J){z=J}}else M&&await M({...r.errors},P),Oe(),setTimeout(Oe);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ur(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},Ce=(E,M={})=>{le(n,E)&&(lt(M.defaultValue)?U(E,vt(le(a,E))):(U(E,M.defaultValue),rt(a,E,vt(M.defaultValue))),M.keepTouched||Tt(r.touchedFields,E),M.keepDirty||(Tt(r.dirtyFields,E),r.isDirty=M.defaultValue?D(E,vt(le(a,E))):D()),M.keepError||(Tt(r.errors,E),f.isValid&&v()),h.state.next({...r}))},we=(E,M={})=>{const P=E?vt(E):a,z=vt(P),q=ur(E),J=q?a:z;if(M.keepDefaultValues||(a=P),!M.keepValues){if(M.keepDirtyValues){const ee=new Set([...s.mount,...Object.keys(au(a,i))]);for(const be of Array.from(ee)){const Pe=le(r.dirtyFields,be),Et=le(i,be),et=le(J,be);Pe&&!lt(Et)?rt(J,be,Et):!Pe&&!lt(et)&&U(be,et)}}else{if(Zx&<(E))for(const ee of s.mount){const be=le(n,ee);if(be&&be._f){const Pe=Array.isArray(be._f.refs)?be._f.refs[0]:be._f.ref;if(Md(Pe)){const Et=Pe.closest("form");if(Et){Et.reset();break}}}}if(M.keepFieldsRef)for(const ee of s.mount)U(ee,le(J,ee));else n={}}i=t.shouldUnregister?M.keepDefaultValues?vt(a):{}:vt(J),h.array.next({values:{...J}}),h.state.next({values:{...J}})}s={mount:M.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!ur(J),o.watch=!!t.shouldUnregister,o.keepIsValid=!!M.keepIsValid,o.action=!1,M.keepErrors||(r.errors={}),h.state.next({submitCount:M.keepSubmitCount?r.submitCount:0,isDirty:q?!1:M.keepDirty?r.isDirty:!!(M.keepDefaultValues&&!Ka(E,a)),isSubmitted:M.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:q?{}:M.keepDirtyValues?M.keepDefaultValues&&i?au(a,i):r.dirtyFields:M.keepDefaultValues&&E?au(a,E):M.keepDirty?r.dirtyFields:{},touchedFields:M.keepTouched?r.touchedFields:{},errors:M.keepErrors?r.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},Re=(E,M)=>we(On(E)?E(i):E,{...t.resetOptions,...M}),Te=(E,M={})=>{const P=le(n,E),z=P&&P._f;if(z){const q=z.refs?z.refs[0]:z.ref;q.focus&&setTimeout(()=>{q.focus(),M.shouldSelect&&On(q.select)&&q.select()})}},$e=E=>{r={...r,...E}},W={control:{register:X,unregister:oe,getFieldState:Z,handleSubmit:_e,setError:ce,_subscribe:Ie,_runSchema:A,_updateIsValidating:x,_focusError:Oe,_getWatch:F,_getDirty:D,_setValid:v,_setFieldArray:w,_setDisabledField:he,_setErrors:b,_getFieldArray:V,_reset:we,_resetDefaultValues:()=>On(t.defaultValues)&&t.defaultValues().then(E=>{Re(E,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:ge,_subjects:h,_proxyFormState:f,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(E){o=E},get _defaultValues(){return a},get _names(){return s},set _names(E){s=E},get _formState(){return r},get _options(){return t},set _options(E){t={...t,...E}}},subscribe:te,trigger:G,register:X,handleSubmit:_e,watch:Ee,setValue:U,getValues:re,reset:Re,resetField:Ce,clearErrors:pe,unregister:oe,setError:ce,setFocus:Te,getFieldState:Z};return{...W,formControl:W}}var Da=()=>{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 r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},Jm=(e,t,r={})=>r.shouldFocus||lt(r.shouldFocus)?r.focusName||`${e}.${lt(r.focusIndex)?t:r.focusIndex}.`:"",ey=(e,t)=>[...e,...Pr(t)],ty=e=>Array.isArray(e)?e.map(()=>{}):void 0;function ry(e,t,r){return[...e.slice(0,t),...Pr(r),...e.slice(t)]}var ny=(e,t,r)=>Array.isArray(e)?(lt(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],ay=(e,t)=>[...Pr(t),...Pr(e)];function s3(e,t){let r=0;const n=[...e];for(const a of t)n.splice(a-r,1),r++;return xh(n).length?n:[]}var iy=(e,t)=>lt(t)?[]:s3(e,Pr(t).sort((r,n)=>r-n)),oy=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},t_=(e,t,r)=>(e[t]=r,e);function l3(e){const t=VL(),{control:r=t,name:n,keyName:a="id",shouldUnregister:i,rules:o}=e,[s,l]=C.useState(r._getFieldArray(n)),u=C.useRef(r._getFieldArray(n).map(Da)),d=C.useRef(!1);r._names.array.add(n),C.useMemo(()=>o&&s.length>=0&&r.register(n,o),[r,n,s.length,o]),$E(()=>r._subjects.array.subscribe({next:({values:_,name:b})=>{if(b===n||!b){const S=le(_,n);Array.isArray(S)&&(l(S),u.current=S.map(Da))}}}).unsubscribe,[r,n]);const f=C.useCallback(_=>{d.current=!0,r._setFieldArray(n,_)},[r,n]),p=(_,b)=>{const S=Pr(vt(_)),j=ey(r._getFieldArray(n),S);r._names.focus=Jm(n,j.length-1,b),u.current=ey(u.current,S.map(Da)),f(j),l(j),r._setFieldArray(n,j,ey,{argA:ty(_)})},h=(_,b)=>{const S=Pr(vt(_)),j=ay(r._getFieldArray(n),S);r._names.focus=Jm(n,0,b),u.current=ay(u.current,S.map(Da)),f(j),l(j),r._setFieldArray(n,j,ay,{argA:ty(_)})},g=_=>{const b=iy(r._getFieldArray(n),_);u.current=iy(u.current,_),f(b),l(b),!Array.isArray(le(r._fields,n))&&rt(r._fields,n,void 0),r._setFieldArray(n,b,iy,{argA:_})},y=(_,b,S)=>{const j=Pr(vt(b)),k=ry(r._getFieldArray(n),_,j);r._names.focus=Jm(n,_,S),u.current=ry(u.current,_,j.map(Da)),f(k),l(k),r._setFieldArray(n,k,ry,{argA:_,argB:ty(b)})},v=(_,b)=>{const S=r._getFieldArray(n);oy(S,_,b),oy(u.current,_,b),f(S),l(S),r._setFieldArray(n,S,oy,{argA:_,argB:b},!1)},x=(_,b)=>{const S=r._getFieldArray(n);ny(S,_,b),ny(u.current,_,b),f(S),l(S),r._setFieldArray(n,S,ny,{argA:_,argB:b},!1)},m=(_,b)=>{const S=vt(b),j=t_(r._getFieldArray(n),_,S);u.current=[...j].map((k,A)=>!k||A===_?Da():u.current[A]),f(j),l([...j]),r._setFieldArray(n,j,t_,{argA:_,argB:S},!0,!1)},w=_=>{const b=Pr(vt(_));u.current=b.map(Da),f([...b]),l([...b]),r._setFieldArray(n,[...b],S=>S,{},!0,!1)};return C.useEffect(()=>{if(r._state.action=!1,ig(n,r._names)&&r._subjects.state.next({...r._formState}),d.current&&(!Qo(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!Qo(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(_=>{r._updateIsValidating([n]);const b=le(_.errors,n),S=le(r._formState.errors,n);(S?!b&&S.type||b&&(S.type!==b.type||S.message!==b.message):b&&b.type)&&(b?rt(r._formState.errors,n,b):Tt(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const _=le(r._fields,n);_&&_._f&&!(Qo(r._options.reValidateMode).isOnSubmit&&Qo(r._options.mode).isOnSubmit)&&og(_,r._names.disabled,r._formValues,r._options.criteriaMode===an.all,r._options.shouldUseNativeValidation,!0).then(b=>!ur(b)&&r._subjects.state.next({errors:BE(r._formState.errors,b,n)}))}r._subjects.state.next({name:n,values:vt(r._formValues)}),r._names.focus&&fs(r._fields,(_,b)=>{if(r._names.focus&&b.startsWith(r._names.focus)&&_.focus)return _.focus(),1}),r._names.focus="",r._setValid(),d.current=!1},[s,n,r]),C.useEffect(()=>(!le(r._formValues,n)&&r._setFieldArray(n),()=>{const _=(b,S)=>{const j=le(r._fields,b);j&&j._f&&(j._f.mount=S)};r._options.shouldUnregister||i?r.unregister(n):_(n,!1)}),[n,r,a,i]),{swap:C.useCallback(v,[f,n,r]),move:C.useCallback(x,[f,n,r]),prepend:C.useCallback(h,[f,n,r]),append:C.useCallback(p,[f,n,r]),remove:C.useCallback(g,[f,n,r]),insert:C.useCallback(y,[f,n,r]),update:C.useCallback(m,[f,n,r]),replace:C.useCallback(w,[f,n,r]),fields:C.useMemo(()=>s.map((_,b)=>({..._,[a]:u.current[b]||Da()})),[s,a])}}function u3(e={}){const t=C.useRef(void 0),r=C.useRef(void 0),[n,a]=C.useState({isDirty:!1,isValidating:!1,isLoading:On(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:On(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!On(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=o3(e);t.current={...s,formState:n}}const i=t.current.control;return i._options=e,$E(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(s=>({...s,isReady:!0})),i._formState.isReady=!0,o},[i]),C.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),C.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),C.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),C.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),C.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),C.useEffect(()=>{var o;e.values&&!Ka(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((o=i._options.resetOptions)===null||o===void 0)&&o.keepIsValid||i._setValid(),r.current=e.values,a(s=>({...s}))):i._resetDefaultValues()},[i,e.values]),C.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=C.useMemo(()=>WL(n,i),[i,n]),t.current}const r_=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},UE=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?r_(n.ref,r,e):n.refs&&n.refs.forEach(a=>r_(a,r,e))}},c3=(e,t)=>{t.shouldUseNativeValidation&&UE(e,t);const r={};for(const n in e){const a=le(t.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(f3(t.names||Object.keys(e),n)){const o=Object.assign({},le(r,n));rt(o,"root",i),rt(r,n,o)}else rt(r,n,i)}return r},f3=(e,t)=>e.some(r=>r.startsWith(t+"."));var d3=function(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=IE(o,t,r,a,u?[].concat(u,n.message):n.message)}e.shift()}return r},p3=function(e,t,r){return r===void 0&&(r={}),function(n,a,i){try{return Promise.resolve(function(o,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&UE({},i),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:c3(d3(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},Qe;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Qe||(Qe={}));var n_;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(n_||(n_={}));const ye=Qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ua=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}},ie=Qe.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 _a extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}_a.create=e=>new _a(e);const sg=(e,t)=>{let r;switch(e.code){case ie.invalid_type:e.received===ye.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Qe.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Qe.joinValues(e.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Qe.joinValues(e.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Qe.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Qe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ie.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ie.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,Qe.assertNever(e)}return{message:r}};let h3=sg;function m3(){return h3}const y3=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}};function ue(e,t){const r=m3(),n=y3({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===sg?void 0:sg].filter(a=>!!a)});e.common.issues.push(n)}class Kr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return Me;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return Kr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Me;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const Me=Object.freeze({status:"aborted"}),iu=e=>({status:"dirty",value:e}),hn=e=>({status:"valid",value:e}),a_=e=>e.status==="aborted",i_=e=>e.status==="dirty",As=e=>e.status==="valid",Ld=e=>typeof Promise<"u"&&e instanceof Promise;var ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ve||(ve={}));class yi{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,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 o_=(e,t)=>{if(As(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 r=new _a(e.common.issues);return this._error=r,this._error}}};function Ue(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))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:(o,s)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:a}}class Ye{get description(){return this._def.description}_getType(t){return Ua(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ua(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Kr,ctx:{common:t.parent.common,data:t.data,parsedType:Ua(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Ld(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ua(t)},a=this._parseSync({data:t,path:n.path,parent:n});return o_(n,a)}"~validate"(t){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ua(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return As(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>As(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ua(t)},a=this._parse({data:t,path:n.path,parent:n}),i=await(Ld(a)?a:Promise.resolve(a));return o_(n,i)}refine(t,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=t(a),s=()=>i.addIssue({code:ie.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new fo({schema:this,typeName:De.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:r=>this["~validate"](r)}}optional(){return ci.create(this,this._def)}nullable(){return Ns.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vn.create(this)}promise(){return Ud.create(this,this._def)}or(t){return zd.create([this,t],this._def)}and(t){return Bd.create(this,t,this._def)}transform(t){return new fo({...Ue(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ug({...Ue(this._def),innerType:this,defaultValue:r,typeName:De.ZodDefault})}brand(){return new F3({typeName:De.ZodBranded,type:this,...Ue(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new cg({...Ue(this._def),innerType:this,catchValue:r,typeName:De.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return tb.create(this,t)}readonly(){return fg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const v3=/^c[^\s-]{8,}$/i,g3=/^[0-9a-z]+$/,x3=/^[0-9A-HJKMNP-TV-Z]{26}$/i,b3=/^[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,w3=/^[a-z0-9_-]{21}$/i,_3=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,S3=/^[-+]?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)?)??$/,j3=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,O3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let sy;const k3=/^(?:(?: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])$/,A3=/^(?:(?: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])$/,E3=/^(([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]))$/,P3=/^(([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])$/,N3=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,C3=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,VE="((\\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])))",T3=new RegExp(`^${VE}$`);function WE(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function $3(e){return new RegExp(`^${WE(e)}$`)}function I3(e){let t=`${VE}T${WE(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function R3(e,t){return!!((t==="v4"||!t)&&k3.test(e)||(t==="v6"||!t)&&E3.test(e))}function M3(e,t){if(!_3.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function D3(e,t){return!!((t==="v4"||!t)&&A3.test(e)||(t==="v6"||!t)&&P3.test(e))}class ua extends Ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const i=this._getOrReturnCtx(t);return ue(i,{code:ie.invalid_type,expected:ye.string,received:i.parsedType}),Me}const n=new Kr;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(a=this._getOrReturnCtx(t,a),ue(a,{code:ie.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,s=t.data.lengtht.test(a),{validation:r,code:ie.invalid_string,...ve.errToObj(n)})}_addCheck(t){return new ua({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ve.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ve.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ve.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ve.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ve.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ve.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==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ve.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ve.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ve.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ve.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...ve.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ve.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ve.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ve.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ve.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ve.errToObj(r)})}nonempty(t){return this.min(1,ve.errToObj(t))}trim(){return new ua({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ua({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ua({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew ua({checks:[],typeName:De.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ue(e)});function L3(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return i%o/10**a}class lo extends Ye{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 i=this._getOrReturnCtx(t);return ue(i,{code:ie.invalid_type,expected:ye.number,received:i.parsedType}),Me}let n;const a=new Kr;for(const i of this._def.checks)i.kind==="int"?Qe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ue(n,{code:ie.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ue(n,{code:ie.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?L3(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ue(n,{code:ie.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ue(n,{code:ie.not_finite,message:i.message}),a.dirty()):Qe.assertNever(i);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ve.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ve.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ve.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ve.toString(r))}setLimit(t,r,n,a){return new lo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ve.toString(a)}]})}_addCheck(t){return new lo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ve.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ve.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Qe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew lo({checks:[],typeName:De.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ue(e)});class uo extends Ye{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 n;const a=new Kr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ue(n,{code:ie.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ue(n,{code:ie.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Qe.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:ye.bigint,received:r.parsedType}),Me}gte(t,r){return this.setLimit("min",t,!0,ve.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ve.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ve.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ve.toString(r))}setLimit(t,r,n,a){return new uo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ve.toString(a)}]})}_addCheck(t){return new uo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew uo({checks:[],typeName:De.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ue(e)});class Fd extends Ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:ye.boolean,received:n.parsedType}),Me}return hn(t.data)}}Fd.create=e=>new Fd({typeName:De.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ue(e)});class Es extends Ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const i=this._getOrReturnCtx(t);return ue(i,{code:ie.invalid_type,expected:ye.date,received:i.parsedType}),Me}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ue(i,{code:ie.invalid_date}),Me}const n=new Kr;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(a=this._getOrReturnCtx(t,a),ue(a,{code:ie.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Qe.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Es({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ve.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ve.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Es({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:De.ZodDate,...Ue(e)});class s_ extends Ye{_parse(t){if(this._getType(t)!==ye.symbol){const n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:ye.symbol,received:n.parsedType}),Me}return hn(t.data)}}s_.create=e=>new s_({typeName:De.ZodSymbol,...Ue(e)});class l_ extends Ye{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:ye.undefined,received:n.parsedType}),Me}return hn(t.data)}}l_.create=e=>new l_({typeName:De.ZodUndefined,...Ue(e)});class u_ extends Ye{_parse(t){if(this._getType(t)!==ye.null){const n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:ye.null,received:n.parsedType}),Me}return hn(t.data)}}u_.create=e=>new u_({typeName:De.ZodNull,...Ue(e)});class c_ extends Ye{constructor(){super(...arguments),this._any=!0}_parse(t){return hn(t.data)}}c_.create=e=>new c_({typeName:De.ZodAny,...Ue(e)});class f_ extends Ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return hn(t.data)}}f_.create=e=>new f_({typeName:De.ZodUnknown,...Ue(e)});class vi extends Ye{_parse(t){const r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:ye.never,received:r.parsedType}),Me}}vi.create=e=>new vi({typeName:De.ZodNever,...Ue(e)});class d_ extends Ye{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:ye.void,received:n.parsedType}),Me}return hn(t.data)}}d_.create=e=>new d_({typeName:De.ZodVoid,...Ue(e)});class Vn extends Ye{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==ye.array)return ue(r,{code:ie.invalid_type,expected:ye.array,received:r.parsedType}),Me;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,s=r.data.lengtha.maxLength.value&&(ue(r,{code:ie.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new yi(r,o,r.path,s)))).then(o=>Kr.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new yi(r,o,r.path,s)));return Kr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Vn({...this._def,minLength:{value:t,message:ve.toString(r)}})}max(t,r){return new Vn({...this._def,maxLength:{value:t,message:ve.toString(r)}})}length(t,r){return new Vn({...this._def,exactLength:{value:t,message:ve.toString(r)}})}nonempty(t){return this.min(1,t)}}Vn.create=(e,t)=>new Vn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...Ue(t)});function Lo(e){if(e instanceof Dt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ci.create(Lo(n))}return new Dt({...e._def,shape:()=>t})}else return e instanceof Vn?new Vn({...e._def,type:Lo(e.element)}):e instanceof ci?ci.create(Lo(e.unwrap())):e instanceof Ns?Ns.create(Lo(e.unwrap())):e instanceof co?co.create(e.items.map(t=>Lo(t))):e}class Dt extends Ye{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(),r=Qe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ye.object){const u=this._getOrReturnCtx(t);return ue(u,{code:ie.invalid_type,expected:ye.object,received:u.parsedType}),Me}const{status:n,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof vi&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const d=i[u],f=a.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new yi(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof vi){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of s)l.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});else if(u==="strict")s.length>0&&(ue(a,{code:ie.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of s){const f=a.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new yi(a,f,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,p=await d.value;u.push({key:f,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>Kr.mergeObjectSync(n,u)):Kr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return ve.errToObj,new Dt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:ve.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Dt({...this._def,unknownKeys:"strip"})}passthrough(){return new Dt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Dt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Dt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:De.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Dt({...this._def,catchall:t})}pick(t){const r={};for(const n of Qe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Dt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Qe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Dt({...this._def,shape:()=>r})}deepPartial(){return Lo(this)}partial(t){const r={};for(const n of Qe.objectKeys(this.shape)){const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new Dt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Qe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ci;)i=i._def.innerType;r[n]=i}return new Dt({...this._def,shape:()=>r})}keyof(){return HE(Qe.objectKeys(this.shape))}}Dt.create=(e,t)=>new Dt({shape:()=>e,unknownKeys:"strip",catchall:vi.create(),typeName:De.ZodObject,...Ue(t)});Dt.strictCreate=(e,t)=>new Dt({shape:()=>e,unknownKeys:"strict",catchall:vi.create(),typeName:De.ZodObject,...Ue(t)});Dt.lazycreate=(e,t)=>new Dt({shape:e,unknownKeys:"strip",catchall:vi.create(),typeName:De.ZodObject,...Ue(t)});class zd extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new _a(s.ctx.common.issues));return ue(r,{code:ie.invalid_union,unionErrors:o}),Me}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(l=>new _a(l));return ue(r,{code:ie.invalid_union,unionErrors:s}),Me}}get options(){return this._def.options}}zd.create=(e,t)=>new zd({options:e,typeName:De.ZodUnion,...Ue(t)});function lg(e,t){const r=Ua(e),n=Ua(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){const a=Qe.objectKeys(t),i=Qe.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(const s of i){const l=lg(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i{if(a_(i)||a_(o))return Me;const s=lg(i.value,o.value);return s.valid?((i_(i)||i_(o))&&r.dirty(),{status:r.value,value:s.data}):(ue(n,{code:ie.invalid_intersection_types}),Me)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Bd.create=(e,t,r)=>new Bd({left:e,right:t,typeName:De.ZodIntersection,...Ue(r)});class co extends Ye{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return ue(n,{code:ie.invalid_type,expected:ye.array,received:n.parsedType}),Me;if(n.data.lengththis._def.items.length&&(ue(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new yi(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>Kr.mergeArray(r,o)):Kr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new co({...this._def,rest:t})}}co.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new co({items:e,typeName:De.ZodTuple,rest:null,...Ue(t)})};class p_ extends Ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.map)return ue(n,{code:ie.invalid_type,expected:ye.map,received:n.parsedType}),Me;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:a._parse(new yi(n,s,n.path,[u,"key"])),value:i._parse(new yi(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Me;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(u.value,d.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Me;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(u.value,d.value)}return{status:r.value,value:s}}}}p_.create=(e,t,r)=>new p_({valueType:t,keyType:e,typeName:De.ZodMap,...Ue(r)});class Yu extends Ye{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return ue(n,{code:ie.invalid_type,expected:ye.set,received:n.parsedType}),Me;const a=this._def;a.minSize!==null&&n.data.sizea.maxSize.value&&(ue(n,{code:ie.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return Me;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>i._parse(new yi(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new Yu({...this._def,minSize:{value:t,message:ve.toString(r)}})}max(t,r){return new Yu({...this._def,maxSize:{value:t,message:ve.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Yu.create=(e,t)=>new Yu({valueType:e,minSize:null,maxSize:null,typeName:De.ZodSet,...Ue(t)});class h_ extends Ye{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}h_.create=(e,t)=>new h_({getter:e,typeName:De.ZodLazy,...Ue(t)});class m_ extends Ye{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ue(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Me}return{status:"valid",value:t.data}}get value(){return this._def.value}}m_.create=(e,t)=>new m_({value:e,typeName:De.ZodLiteral,...Ue(t)});function HE(e,t){return new Ps({values:e,typeName:De.ZodEnum,...Ue(t)})}class Ps extends Ye{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ue(r,{expected:Qe.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Me}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ue(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Me}return hn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Ps.create(t,{...this._def,...r})}exclude(t,r=this._def){return Ps.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Ps.create=HE;class y_ extends Ye{_parse(t){const r=Qe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){const a=Qe.objectValues(r);return ue(n,{expected:Qe.joinValues(a),received:n.parsedType,code:ie.invalid_type}),Me}if(this._cache||(this._cache=new Set(Qe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Qe.objectValues(r);return ue(n,{received:n.data,code:ie.invalid_enum_value,options:a}),Me}return hn(t.data)}get enum(){return this._def.values}}y_.create=(e,t)=>new y_({values:e,typeName:De.ZodNativeEnum,...Ue(t)});class Ud extends Ye{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return ue(r,{code:ie.invalid_type,expected:ye.promise,received:r.parsedType}),Me;const n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return hn(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Ud.create=(e,t)=>new Ud({type:e,typeName:De.ZodPromise,...Ue(t)});class fo extends Ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{ue(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return Me;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?Me:l.status==="dirty"||r.value==="dirty"?iu(l.value):l});{if(r.value==="aborted")return Me;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?Me:s.status==="dirty"||r.value==="dirty"?iu(s.value):s}}if(a.type==="refinement"){const o=s=>{const l=a.refinement(s,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Me:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?Me:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!As(o))return Me;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>As(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):Me);Qe.assertNever(a)}}fo.create=(e,t,r)=>new fo({schema:e,typeName:De.ZodEffects,effect:t,...Ue(r)});fo.createWithPreprocess=(e,t,r)=>new fo({schema:t,effect:{type:"preprocess",transform:e},typeName:De.ZodEffects,...Ue(r)});class ci extends Ye{_parse(t){return this._getType(t)===ye.undefined?hn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ci.create=(e,t)=>new ci({innerType:e,typeName:De.ZodOptional,...Ue(t)});class Ns extends Ye{_parse(t){return this._getType(t)===ye.null?hn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ns.create=(e,t)=>new Ns({innerType:e,typeName:De.ZodNullable,...Ue(t)});class ug extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ug.create=(e,t)=>new ug({innerType:e,typeName:De.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ue(t)});class cg extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ld(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new _a(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new _a(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}cg.create=(e,t)=>new cg({innerType:e,typeName:De.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ue(t)});class v_ extends Ye{_parse(t){if(this._getType(t)!==ye.nan){const n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:ye.nan,received:n.parsedType}),Me}return{status:"valid",value:t.data}}}v_.create=e=>new v_({typeName:De.ZodNaN,...Ue(e)});class F3 extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class tb extends Ye{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Me:i.status==="dirty"?(r.dirty(),iu(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Me:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new tb({in:t,out:r,typeName:De.ZodPipeline})}}class fg extends Ye{_parse(t){const r=this._def.innerType._parse(t),n=a=>(As(a)&&(a.value=Object.freeze(a.value)),a);return Ld(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}fg.create=(e,t)=>new fg({innerType:e,typeName:De.ZodReadonly,...Ue(t)});var De;(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"})(De||(De={}));const g_=ua.create,vu=lo.create;uo.create;Fd.create;Es.create;vi.create;const z3=Vn.create,GE=Dt.create;zd.create;Bd.create;co.create;Ps.create;Ud.create;ci.create;Ns.create;const gu=fo.createWithPreprocess,KE={string:e=>ua.create({...e,coerce:!0}),number:e=>lo.create({...e,coerce:!0}),boolean:e=>Fd.create({...e,coerce:!0}),bigint:e=>uo.create({...e,coerce:!0}),date:e=>Es.create({...e,coerce:!0})},B3={primary:"bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white",ghost:"text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]",danger:"bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]"},U3={sm:"px-4 py-1.5 text-xs font-semibold",md:"px-5 py-2.5 text-sm font-semibold"};function Be({variant:e="primary",size:t="md",className:r="",...n}){return c.jsx("button",{className:`relative inline-flex items-center justify-center gap-2 rounded-full transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/50 focus:ring-offset-1 focus:ring-offset-transparent focus:border-transparent ${B3[e]} ${U3[t]} ${r}`,...n,children:n.children})}function ln({error:e}){return e?c.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/8 px-4 py-3 text-sm text-red-400 font-mono",children:e}):null}function Ar({size:e=20}){return c.jsxs("svg",{className:"animate-spin text-brand-500",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}const V3={SR_SELECTION_V3_ROUTING:"bg-blue-100 text-blue-800",PRIORITY_LOGIC:"bg-purple-100 text-purple-800",NTW_BASED_ROUTING:"bg-green-100 text-green-800",SR_SELECTION_V3_ROUTING_WITH_HEDGING:"bg-orange-100 text-orange-800",HEDGING:"bg-orange-100 text-orange-800"},W3=["card","card_redirect","pay_later","wallet","bank_redirect","bank_transfer","crypto","bank_debit","reward","real_time_payment","upi","voucher","gift_card","open_banking","mobile_payment"],H3={card:["credit","debit"],bank_debit:["ach","sepa","bacs","becs"],bank_transfer:["ach","sepa","sepa_bank_transfer","bacs","multibanco","pix","pse","permata_bank_transfer","bca_bank_transfer","bni_va","bri_va","cimb_va","danamon_va","mandiri_va","local_bank_transfer","instant_bank_transfer"],wallet:["amazon_pay","apple_pay","google_pay","paypal","ali_pay","ali_pay_hk","dana","mb_way","mobile_pay","samsung_pay","twint","vipps","touch_n_go","swish","we_chat_pay","go_pay","gcash","momo","kakao_pay","cashapp","mifinity","paze"],pay_later:["affirm","alma","afterpay_clearpay","klarna","pay_bright","atome","walley"],upi:["upi_collect","upi_intent"],voucher:["boleto","efecty","pago_efectivo","red_compra","red_pagos","indomaret","alfamart","oxxo","seven_eleven","lawson","mini_stop","family_mart","seicomart","pay_easy"],bank_redirect:["giropay","ideal","sofort","eft","eps","bancontact_card","blik","local_bank_redirect","online_banking_thailand","online_banking_czech_republic","online_banking_finland","online_banking_fpx","online_banking_poland","online_banking_slovakia","przelewy24","trustly","bizum","interac","open_banking_uk","open_banking_pis"],gift_card:["givex","pay_safe_card"],card_redirect:["knet","benefit","momo_atm","card_redirect"],real_time_payment:["fps","duit_now","prompt_pay","viet_qr"],crypto:["crypto_currency"],reward:["evoucher","classic_reward"],open_banking:["open_banking_pis"],mobile_payment:["direct_carrier_billing"]},G3=GE({paymentMethodType:g_().min(1),paymentMethod:g_().min(1),bucketSize:KE.number().int().positive(),hedgingPercent:gu(e=>e===""||e===null?null:Number(e),vu().nullable()),latencyThreshold:gu(e=>e===""||e===null?null:Number(e),vu().nullable())}),K3=GE({defaultBucketSize:KE.number().int().positive(),defaultSuccessRate:gu(e=>e===""||e===null?null:Number(e),vu().min(0).max(1).nullable()),defaultLatencyThreshold:gu(e=>e===""||e===null?null:Number(e),vu().nullable()),defaultHedgingPercent:gu(e=>e===""||e===null?null:Number(e),vu().nullable()),subLevelInputConfig:z3(G3)});function q3(){var $,D,F,V,H;const{merchantId:e}=Xn(),[t,r]=O.useState(!1),[n,a]=O.useState(null),[i,o]=O.useState(!1),[s,l]=O.useState(!1),[u,d]=O.useState(!1),[f,p]=O.useState(null),{data:h,isLoading:g,mutate:y}=ir(e?["rule-sr",e]:null,()=>_t("/rule/get",{merchant_id:e,algorithm:"successRate"}),{shouldRetryOnError:!1}),{register:v,control:x,handleSubmit:m,reset:w,watch:_,formState:{errors:b}}=u3({resolver:p3(K3),defaultValues:{defaultBucketSize:200,defaultSuccessRate:.5,defaultLatencyThreshold:null,defaultHedgingPercent:null,subLevelInputConfig:[]}});O.useEffect(()=>{var L;if((L=h==null?void 0:h.config)!=null&&L.data){const U=h.config.data;w({defaultBucketSize:U.defaultBucketSize??200,defaultSuccessRate:U.defaultSuccessRate??.5,defaultLatencyThreshold:U.defaultLatencyThreshold??null,defaultHedgingPercent:U.defaultHedgingPercent??null,subLevelInputConfig:U.subLevelInputConfig??[]})}},[h,w]);const{fields:S,append:j,remove:k}=l3({control:x,name:"subLevelInputConfig"}),A=_("subLevelInputConfig");async function R(){try{await _t("/merchant-account/create",{merchant_id:e,gateway_success_rate_based_decider_input:null})}catch{}}async function T(L){if(!e){a("Set a Merchant ID first.");return}r(!0),a(null),o(!1);try{await R(),await _t(h?"/rule/update":"/rule/create",{merchant_id:e,config:{type:"successRate",data:{defaultBucketSize:L.defaultBucketSize,defaultSuccessRate:L.defaultSuccessRate,defaultLatencyThreshold:L.defaultLatencyThreshold,defaultHedgingPercent:L.defaultHedgingPercent,subLevelInputConfig:L.subLevelInputConfig.length>0?L.subLevelInputConfig:null}}}),o(!0),y()}catch(U){a(U instanceof Error?U.message:String(U))}finally{r(!1)}}async function N(){if(e){d(!0),p(null);try{await _t("/rule/delete",{merchant_id:e,algorithm:"successRate"}),y(void 0,{revalidate:!1})}catch(L){p(L instanceof Error?L.message:String(L))}finally{d(!1)}}}return c.jsxs("div",{className:"space-y-6 max-w-5xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Auth-Rate Based Routing"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure success-rate based gateway routing"})]}),!e&&c.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-800",children:"Set a Merchant ID in the top bar to load and save configuration."}),e&&!g&&c.jsxs(ke,{children:[c.jsxs(qe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Configuration Status"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:($=h==null?void 0:h.config)!=null&&$.data?"Success Rate routing is configured and active":"No Success Rate configuration found"})]}),c.jsx(ze,{variant:(D=h==null?void 0:h.config)!=null&&D.data?"green":"gray",children:(F=h==null?void 0:h.config)!=null&&F.data?"Active":"Not Configured"})]}),((V=h==null?void 0:h.config)==null?void 0:V.data)&&c.jsxs(Ae,{className:"border-t border-slate-100 dark:border-[#222226]",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Last Modified:"}),c.jsx("span",{className:"ml-1 font-medium",children:h.modified_at?new Date(h.modified_at).toLocaleString():"Unknown"})]}),c.jsxs(Be,{type:"button",variant:"secondary",size:"sm",onClick:()=>{confirm("Are you sure you want to clear the Success Rate configuration? This will disable SR-based routing.")&&N()},disabled:u,children:[c.jsx(wa,{size:14,className:"mr-1"}),u?"Clearing...":"Clear Configuration"]})]}),f&&c.jsx("p",{className:"text-xs text-red-500 mt-2",children:f})]})]}),g?c.jsx("div",{className:"flex justify-center py-12",children:c.jsx(Ar,{})}):c.jsxs("form",{onSubmit:m(T),className:"space-y-6",children:[c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Default Success Rate Config"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Base settings used when there is no payment-method-specific override."})]})}),c.jsxs(Ae,{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Bucket Size"}),c.jsx("input",{type:"number",...v("defaultBucketSize"),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"}),b.defaultBucketSize&&c.jsx("p",{className:"text-xs text-red-500",children:b.defaultBucketSize.message})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Success Rate"}),c.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",...v("defaultSuccessRate"),placeholder:"0.5",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Hedging %"}),c.jsx("input",{type:"number",step:"0.1",...v("defaultHedgingPercent"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Latency Threshold (ms)"}),c.jsx("input",{type:"number",...v("defaultLatencyThreshold"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]})]}),c.jsxs(ke,{children:[c.jsxs(qe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Sub-Level Overrides"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Optional overrides for specific payment method type and method combinations."})]}),c.jsxs(Be,{type:"button",variant:"secondary",size:"sm",onClick:()=>j({paymentMethodType:"card",paymentMethod:"credit",bucketSize:20,hedgingPercent:null,latencyThreshold:null}),children:[c.jsx(hi,{size:14})," Add Level"]})]}),c.jsx(Ae,{className:"overflow-x-auto p-0",children:S.length?c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-200 dark:border-[#1c1c24] bg-slate-50 dark:bg-[#0a0a0f]",children:[c.jsx("th",{className:"px-4 py-2",children:"Payment Method Type"}),c.jsx("th",{className:"px-4 py-2",children:"Payment Method"}),c.jsx("th",{className:"px-4 py-2",children:"Bucket Size"}),c.jsx("th",{className:"px-4 py-2",children:"Hedging %"}),c.jsx("th",{className:"px-4 py-2",children:"Latency Threshold (ms)"}),c.jsx("th",{className:"px-4 py-2"})]})}),c.jsx("tbody",{children:S.map((L,U)=>{var G;const K=((G=A==null?void 0:A[U])==null?void 0:G.paymentMethodType)||"",Q=H3[K]||[];return c.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsx("select",{...v(`subLevelInputConfig.${U}.paymentMethodType`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:W3.map(re=>c.jsx("option",{value:re,children:re},re))})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("select",{...v(`subLevelInputConfig.${U}.paymentMethod`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(Q.length?Q:["credit","debit"]).map(re=>c.jsx("option",{value:re,children:re},re))})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",...v(`subLevelInputConfig.${U}.bucketSize`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",step:"0.1",...v(`subLevelInputConfig.${U}.hedgingPercent`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",...v(`subLevelInputConfig.${U}.latencyThreshold`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("button",{type:"button",onClick:()=>k(U),className:"text-slate-400 hover:text-red-500",children:c.jsx(wa,{size:14})})})]},L.id)})})]}):c.jsx("div",{className:"px-4 py-8 text-sm text-slate-500",children:"No sub-level overrides configured. The default row above is the only active configuration."})})]}),c.jsx(ln,{error:n}),i&&c.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-4 py-3 text-sm text-emerald-400",children:"Configuration saved successfully."}),((H=h==null?void 0:h.config)==null?void 0:H.data)&&c.jsxs(ke,{children:[c.jsxs(qe,{className:"flex flex-row items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Current Active Configuration"}),c.jsxs(Be,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!s),children:[c.jsx(yh,{size:14,className:"mr-1"}),s?"Hide":"View"]})]}),s&&c.jsx(Ae,{children:c.jsxs("div",{className:"text-xs text-slate-600 space-y-4",children:[c.jsxs("div",{className:"border-b border-slate-200 dark:border-[#222226] pb-3",children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Default Settings"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultBucketSize})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Success Rate:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultSuccessRate??"Not set"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultHedgingPercent??"Not set"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),c.jsxs("p",{className:"font-medium",children:[h.config.data.defaultLatencyThreshold??"Not set"," ms"]})]})]})]}),h.config.data.subLevelInputConfig&&h.config.data.subLevelInputConfig.length>0&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Sub-Level Configurations"}),c.jsx("div",{className:"space-y-2",children:h.config.data.subLevelInputConfig.map((L,U)=>c.jsx("div",{className:"bg-slate-50 dark:bg-[#151518] rounded-lg p-3",children:c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Payment Type:"}),c.jsx("p",{className:"font-medium capitalize",children:L.paymentMethodType})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Payment Method:"}),c.jsx("p",{className:"font-medium",children:L.paymentMethod})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),c.jsx("p",{className:"font-medium",children:L.bucketSize})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),c.jsx("p",{className:"font-medium",children:L.hedgingPercent??"Default"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),c.jsxs("p",{className:"font-medium",children:[L.latencyThreshold??"Default"," ms"]})]})]})},U))})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-3",children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Raw Configuration (JSON)"}),c.jsx("pre",{className:"bg-slate-900 dark:bg-[#0f0f11] text-slate-100 border border-transparent dark:border-[#222226] rounded-lg p-3 text-xs overflow-auto max-h-64",children:JSON.stringify(h.config,null,2)})]})]})})]}),c.jsx(Be,{type:"submit",disabled:t||!e,children:t?c.jsxs(c.Fragment,{children:[c.jsx(Ar,{size:14})," Saving…"]}):"Save Configuration"})]})]})}function X3(){for(var e=arguments.length,t=new Array(e),r=0;rn=>{t.forEach(a=>a(n))},t)}const bh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ll(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function rb(e){return"nodeType"in e}function Ir(e){var t,r;return e?ll(e)?e:rb(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function nb(e){const{Document:t}=Ir(e);return e instanceof t}function Wc(e){return ll(e)?!1:e instanceof Ir(e).HTMLElement}function qE(e){return e instanceof Ir(e).SVGElement}function ul(e){return e?ll(e)?e.document:rb(e)?nb(e)?e:Wc(e)||qE(e)?e.ownerDocument:document:document:document}const Kn=bh?O.useLayoutEffect:O.useEffect;function ab(e){const t=O.useRef(e);return Kn(()=>{t.current=e}),O.useCallback(function(){for(var r=arguments.length,n=new Array(r),a=0;a{e.current=setInterval(n,a)},[]),r=O.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Zu(e,t){t===void 0&&(t=[e]);const r=O.useRef(e);return Kn(()=>{r.current!==e&&(r.current=e)},t),r}function Hc(e,t){const r=O.useRef();return O.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Vd(e){const t=ab(e),r=O.useRef(null),n=O.useCallback(a=>{a!==r.current&&(t==null||t(a,r.current)),r.current=a},[]);return[r,n]}function dg(e){const t=O.useRef();return O.useEffect(()=>{t.current=e},[e]),t.current}let ly={};function Gc(e,t){return O.useMemo(()=>{if(t)return t;const r=ly[e]==null?0:ly[e]+1;return ly[e]=r,e+"-"+r},[e,t])}function XE(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a{const s=Object.entries(o);for(const[l,u]of s){const d=i[l];d!=null&&(i[l]=d+e*u)}return i},{...t})}}const ds=XE(1),Qu=XE(-1);function Z3(e){return"clientX"in e&&"clientY"in e}function ib(e){if(!e)return!1;const{KeyboardEvent:t}=Ir(e.target);return t&&e instanceof t}function Q3(e){if(!e)return!1;const{TouchEvent:t}=Ir(e.target);return t&&e instanceof t}function pg(e){if(Q3(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Z3(e)?{x:e.clientX,y:e.clientY}:null}const Ju=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Ju.Translate.toString(e),Ju.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),x_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function J3(e){return e.matches(x_)?e:e.querySelector(x_)}const e4={display:"none"};function t4(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:e4},r)}function r4(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:a,role:"status","aria-live":n,"aria-atomic":!0},r)}function n4(){const[e,t]=O.useState("");return{announce:O.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const YE=O.createContext(null);function a4(e){const t=O.useContext(YE);O.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function i4(){const[e]=O.useState(()=>new Set),t=O.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[O.useCallback(n=>{let{type:a,event:i}=n;e.forEach(o=>{var s;return(s=o[a])==null?void 0:s.call(o,i)})},[e]),t]}const o4={draggable:` - To pick up a draggable item, press the space bar. - While dragging, use the arrow keys to move the item. - Press space again to drop the item in its new position, or press escape to cancel. - `},s4={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function l4(e){let{announcements:t=s4,container:r,hiddenTextDescribedById:n,screenReaderInstructions:a=o4}=e;const{announce:i,announcement:o}=n4(),s=Gc("DndLiveRegion"),[l,u]=O.useState(!1);if(O.useEffect(()=>{u(!0)},[]),a4(O.useMemo(()=>({onDragStart(f){let{active:p}=f;i(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:h}=f;t.onDragMove&&i(t.onDragMove({active:p,over:h}))},onDragOver(f){let{active:p,over:h}=f;i(t.onDragOver({active:p,over:h}))},onDragEnd(f){let{active:p,over:h}=f;i(t.onDragEnd({active:p,over:h}))},onDragCancel(f){let{active:p,over:h}=f;i(t.onDragCancel({active:p,over:h}))}}),[i,t])),!l)return null;const d=C.createElement(C.Fragment,null,C.createElement(t4,{id:n,value:a.draggable}),C.createElement(r4,{id:s,announcement:o}));return r?Zo.createPortal(d,r):d}var Wt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Wt||(Wt={}));function Wd(){}function b_(e,t){return O.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function u4(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const Cn=Object.freeze({x:0,y:0});function ZE(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function QE(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function c4(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function w_(e){let{left:t,top:r,height:n,width:a}=e;return[{x:t,y:r},{x:t+a,y:r},{x:t,y:r+n},{x:t+a,y:r+n}]}function JE(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function __(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const f4=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=__(t,t.left,t.top),i=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=ZE(__(l),a);i.push({id:s,data:{droppableContainer:o,value:u}})}}return i.sort(QE)},d4=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=w_(t),i=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=w_(l),d=a.reduce((p,h,g)=>p+ZE(u[g],h),0),f=Number((d/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:f}})}}return i.sort(QE)};function p4(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=a-n,s=i-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=[];for(const i of n){const{id:o}=i,s=r.get(o);if(s){const l=p4(s,t);l>0&&a.push({id:o,data:{droppableContainer:i,value:l}})}}return a.sort(c4)};function m4(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function eP(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Cn}function y4(e){return function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i({...o,top:o.top+e*s.y,bottom:o.bottom+e*s.y,left:o.left+e*s.x,right:o.right+e*s.x}),{...r})}}const v4=y4(1);function g4(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function x4(e,t,r){const n=g4(t);if(!n)return e;const{scaleX:a,scaleY:i,x:o,y:s}=n,l=e.left-o-(1-a)*parseFloat(r),u=e.top-s-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=a?e.width/a:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const b4={ignoreTransform:!1};function cl(e,t){t===void 0&&(t=b4);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Ir(e).getComputedStyle(e);u&&(r=x4(r,u,d))}const{top:n,left:a,width:i,height:o,bottom:s,right:l}=r;return{top:n,left:a,width:i,height:o,bottom:s,right:l}}function S_(e){return cl(e,{ignoreTransform:!0})}function w4(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function _4(e,t){return t===void 0&&(t=Ir(e).getComputedStyle(e)),t.position==="fixed"}function S4(e,t){t===void 0&&(t=Ir(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const i=t[a];return typeof i=="string"?r.test(i):!1})}function wh(e,t){const r=[];function n(a){if(t!=null&&r.length>=t||!a)return r;if(nb(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!Wc(a)||qE(a)||r.includes(a))return r;const i=Ir(e).getComputedStyle(a);return a!==e&&S4(a,i)&&r.push(a),_4(a,i)?r:n(a.parentNode)}return e?n(e):r}function tP(e){const[t]=wh(e,1);return t??null}function uy(e){return!bh||!e?null:ll(e)?e:rb(e)?nb(e)||e===ul(e).scrollingElement?window:Wc(e)?e:null:null}function rP(e){return ll(e)?e.scrollX:e.scrollLeft}function nP(e){return ll(e)?e.scrollY:e.scrollTop}function hg(e){return{x:rP(e),y:nP(e)}}var Zt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Zt||(Zt={}));function aP(e){return!bh||!e?!1:e===document.scrollingElement}function iP(e){const t={x:0,y:0},r=aP(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},a=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:a,isLeft:i,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const j4={x:.2,y:.2};function O4(e,t,r,n,a){let{top:i,left:o,right:s,bottom:l}=r;n===void 0&&(n=10),a===void 0&&(a=j4);const{isTop:u,isBottom:d,isLeft:f,isRight:p}=iP(e),h={x:0,y:0},g={x:0,y:0},y={height:t.height*a.y,width:t.width*a.x};return!u&&i<=t.top+y.height?(h.y=Zt.Backward,g.y=n*Math.abs((t.top+y.height-i)/y.height)):!d&&l>=t.bottom-y.height&&(h.y=Zt.Forward,g.y=n*Math.abs((t.bottom-y.height-l)/y.height)),!p&&s>=t.right-y.width?(h.x=Zt.Forward,g.x=n*Math.abs((t.right-y.width-s)/y.width)):!f&&o<=t.left+y.width&&(h.x=Zt.Backward,g.x=n*Math.abs((t.left+y.width-o)/y.width)),{direction:h,speed:g}}function k4(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:r,right:n,bottom:a}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:a,width:e.clientWidth,height:e.clientHeight}}function oP(e){return e.reduce((t,r)=>ds(t,hg(r)),Cn)}function A4(e){return e.reduce((t,r)=>t+rP(r),0)}function E4(e){return e.reduce((t,r)=>t+nP(r),0)}function P4(e,t){if(t===void 0&&(t=cl),!e)return;const{top:r,left:n,bottom:a,right:i}=t(e);tP(e)&&(a<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const N4=[["x",["left","right"],A4],["y",["top","bottom"],E4]];class ob{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=wh(r),a=oP(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,s]of N4)for(const l of o)Object.defineProperty(this,l,{get:()=>{const u=s(n),d=a[i]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var a;(a=this.target)==null||a.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function C4(e){const{EventTarget:t}=Ir(e);return e instanceof t?e:ul(e)}function cy(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var tn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(tn||(tn={}));function j_(e){e.preventDefault()}function T4(e){e.stopPropagation()}var Ke;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ke||(Ke={}));const sP={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},$4=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ke.Right:return{...r,x:r.x+25};case Ke.Left:return{...r,x:r.x-25};case Ke.Down:return{...r,y:r.y+25};case Ke.Up:return{...r,y:r.y-25}}};class sb{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new xu(ul(r)),this.windowListeners=new xu(Ir(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(tn.Resize,this.handleCancel),this.windowListeners.add(tn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(tn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&P4(n),r(Cn)}handleKeyDown(t){if(ib(t)){const{active:r,context:n,options:a}=this.props,{keyboardCodes:i=sP,coordinateGetter:o=$4,scrollBehavior:s="smooth"}=a,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:Cn;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(t,{active:r,context:n.current,currentCoordinates:d});if(f){const p=Qu(f,d),h={x:0,y:0},{scrollableAncestors:g}=n.current;for(const y of g){const v=t.code,{isTop:x,isRight:m,isLeft:w,isBottom:_,maxScroll:b,minScroll:S}=iP(y),j=k4(y),k={x:Math.min(v===Ke.Right?j.right-j.width/2:j.right,Math.max(v===Ke.Right?j.left:j.left+j.width/2,f.x)),y:Math.min(v===Ke.Down?j.bottom-j.height/2:j.bottom,Math.max(v===Ke.Down?j.top:j.top+j.height/2,f.y))},A=v===Ke.Right&&!m||v===Ke.Left&&!w,R=v===Ke.Down&&!_||v===Ke.Up&&!x;if(A&&k.x!==f.x){const T=y.scrollLeft+p.x,N=v===Ke.Right&&T<=b.x||v===Ke.Left&&T>=S.x;if(N&&!p.y){y.scrollTo({left:T,behavior:s});return}N?h.x=y.scrollLeft-T:h.x=v===Ke.Right?y.scrollLeft-b.x:y.scrollLeft-S.x,h.x&&y.scrollBy({left:-h.x,behavior:s});break}else if(R&&k.y!==f.y){const T=y.scrollTop+p.y,N=v===Ke.Down&&T<=b.y||v===Ke.Up&&T>=S.y;if(N&&!p.x){y.scrollTo({top:T,behavior:s});return}N?h.y=y.scrollTop-T:h.y=v===Ke.Down?y.scrollTop-b.y:y.scrollTop-S.y,h.y&&y.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,ds(Qu(f,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}sb.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=sP,onActivation:a}=t,{active:i}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const s=i.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function O_(e){return!!(e&&"distance"in e)}function k_(e){return!!(e&&"delay"in e)}class lb{constructor(t,r,n){var a;n===void 0&&(n=C4(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:o}=i;this.props=t,this.events=r,this.document=ul(o),this.documentListeners=new xu(this.document),this.listeners=new xu(n),this.windowListeners=new xu(Ir(o)),this.initialCoordinates=(a=pg(i))!=null?a:Cn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(tn.Resize,this.handleCancel),this.windowListeners.add(tn.DragStart,j_),this.windowListeners.add(tn.VisibilityChange,this.handleCancel),this.windowListeners.add(tn.ContextMenu,j_),this.documentListeners.add(tn.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(k_(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(O_(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:a}=this.props;a(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(tn.Click,T4,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(tn.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:a,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!a)return;const l=(r=pg(t))!=null?r:Cn,u=Qu(a,l);if(!n&&s){if(O_(s)){if(s.tolerance!=null&&cy(u,s.tolerance))return this.handleCancel();if(cy(u,s.distance))return this.handleStart()}if(k_(s)&&cy(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const I4={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ub extends lb{constructor(t){const{event:r}=t,n=ul(r.target);super(t,I4,n)}}ub.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const R4={move:{name:"mousemove"},end:{name:"mouseup"}};var mg;(function(e){e[e.RightClick=2]="RightClick"})(mg||(mg={}));class M4 extends lb{constructor(t){super(t,R4,ul(t.event.target))}}M4.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===mg.RightClick?!1:(n==null||n({event:r}),!0)}}];const fy={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class D4 extends lb{constructor(t){super(t,fy)}static setup(){return window.addEventListener(fy.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(fy.move.name,t)};function t(){}}}D4.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:a}=r;return a.length>1?!1:(n==null||n({event:r}),!0)}}];var bu;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(bu||(bu={}));var Hd;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Hd||(Hd={}));function L4(e){let{acceleration:t,activator:r=bu.Pointer,canScroll:n,draggingRect:a,enabled:i,interval:o=5,order:s=Hd.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e;const h=z4({delta:f,disabled:!i}),[g,y]=Y3(),v=O.useRef({x:0,y:0}),x=O.useRef({x:0,y:0}),m=O.useMemo(()=>{switch(r){case bu.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case bu.DraggableRect:return a}},[r,a,l]),w=O.useRef(null),_=O.useCallback(()=>{const S=w.current;if(!S)return;const j=v.current.x*x.current.x,k=v.current.y*x.current.y;S.scrollBy(j,k)},[]),b=O.useMemo(()=>s===Hd.TreeOrder?[...u].reverse():u,[s,u]);O.useEffect(()=>{if(!i||!u.length||!m){y();return}for(const S of b){if((n==null?void 0:n(S))===!1)continue;const j=u.indexOf(S),k=d[j];if(!k)continue;const{direction:A,speed:R}=O4(S,k,m,t,p);for(const T of["x","y"])h[T][A[T]]||(R[T]=0,A[T]=0);if(R.x>0||R.y>0){y(),w.current=S,g(_,o),v.current=R,x.current=A;return}}v.current={x:0,y:0},x.current={x:0,y:0},y()},[t,_,n,y,i,o,JSON.stringify(m),JSON.stringify(h),g,u,b,d,JSON.stringify(p)])}const F4={x:{[Zt.Backward]:!1,[Zt.Forward]:!1},y:{[Zt.Backward]:!1,[Zt.Forward]:!1}};function z4(e){let{delta:t,disabled:r}=e;const n=dg(t);return Hc(a=>{if(r||!n||!a)return F4;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Zt.Backward]:a.x[Zt.Backward]||i.x===-1,[Zt.Forward]:a.x[Zt.Forward]||i.x===1},y:{[Zt.Backward]:a.y[Zt.Backward]||i.y===-1,[Zt.Forward]:a.y[Zt.Forward]||i.y===1}}},[r,t,n])}function B4(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Hc(a=>{var i;return t==null?null:(i=n??a)!=null?i:null},[n,t])}function U4(e,t){return O.useMemo(()=>e.reduce((r,n)=>{const{sensor:a}=n,i=a.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...i]},[]),[e,t])}var ec;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ec||(ec={}));var yg;(function(e){e.Optimized="optimized"})(yg||(yg={}));const A_=new Map;function V4(e,t){let{dragging:r,dependencies:n,config:a}=t;const[i,o]=O.useState(null),{frequency:s,measure:l,strategy:u}=a,d=O.useRef(e),f=v(),p=Zu(f),h=O.useCallback(function(x){x===void 0&&(x=[]),!p.current&&o(m=>m===null?x:m.concat(x.filter(w=>!m.includes(w))))},[p]),g=O.useRef(null),y=Hc(x=>{if(f&&!r)return A_;if(!x||x===A_||d.current!==e||i!=null){const m=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){m.set(w.id,w.rect.current);continue}const _=w.node.current,b=_?new ob(l(_),_):null;w.rect.current=b,b&&m.set(w.id,b)}return m}return x},[e,i,r,f,l]);return O.useEffect(()=>{d.current=e},[e]),O.useEffect(()=>{f||h()},[r,f]),O.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),O.useEffect(()=>{f||typeof s!="number"||g.current!==null||(g.current=setTimeout(()=>{h(),g.current=null},s))},[s,f,h,...n]),{droppableRects:y,measureDroppableContainers:h,measuringScheduled:i!=null};function v(){switch(u){case ec.Always:return!1;case ec.BeforeDragging:return r;default:return!r}}}function lP(e,t){return Hc(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function W4(e,t){return lP(e,t)}function H4(e){let{callback:t,disabled:r}=e;const n=ab(t),a=O.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return O.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function _h(e){let{callback:t,disabled:r}=e;const n=ab(t),a=O.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return O.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function G4(e){return new ob(cl(e),e)}function E_(e,t,r){t===void 0&&(t=G4);const[n,a]=O.useState(null);function i(){a(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const o=H4({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),s=_h({callback:i});return Kn(()=>{i(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),n}function K4(e){const t=lP(e);return eP(e,t)}const P_=[];function q4(e){const t=O.useRef(e),r=Hc(n=>e?n&&n!==P_&&e&&t.current&&e.parentNode===t.current.parentNode?n:wh(e):P_,[e]);return O.useEffect(()=>{t.current=e},[e]),r}function X4(e){const[t,r]=O.useState(null),n=O.useRef(e),a=O.useCallback(i=>{const o=uy(i.target);o&&r(s=>s?(s.set(o,hg(o)),new Map(s)):null)},[]);return O.useEffect(()=>{const i=n.current;if(e!==i){o(i);const s=e.map(l=>{const u=uy(l);return u?(u.addEventListener("scroll",a,{passive:!0}),[u,hg(u)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{o(e),o(i)};function o(s){s.forEach(l=>{const u=uy(l);u==null||u.removeEventListener("scroll",a)})}},[a,e]),O.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>ds(i,o),Cn):oP(e):Cn,[e,t])}function N_(e,t){t===void 0&&(t=[]);const r=O.useRef(null);return O.useEffect(()=>{r.current=null},t),O.useEffect(()=>{const n=e!==Cn;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Qu(e,r.current):Cn}function Y4(e){O.useEffect(()=>{if(!bh)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Z4(e,t){return O.useMemo(()=>e.reduce((r,n)=>{let{eventName:a,handler:i}=n;return r[a]=o=>{i(o,t)},r},{}),[e,t])}function uP(e){return O.useMemo(()=>e?w4(e):null,[e])}const C_=[];function Q4(e,t){t===void 0&&(t=cl);const[r]=e,n=uP(r?Ir(r):null),[a,i]=O.useState(C_);function o(){i(()=>e.length?e.map(l=>aP(l)?n:new ob(t(l),l)):C_)}const s=_h({callback:o});return Kn(()=>{s==null||s.disconnect(),o(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),a}function J4(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Wc(t)?t:e}function e5(e){let{measure:t}=e;const[r,n]=O.useState(null),a=O.useCallback(u=>{for(const{target:d}of u)if(Wc(d)){n(f=>{const p=t(d);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),i=_h({callback:a}),o=O.useCallback(u=>{const d=J4(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[s,l]=Vd(o);return O.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const t5=[{sensor:ub,options:{}},{sensor:sb,options:{}}],r5={current:{}},ad={draggable:{measure:S_},droppable:{measure:S_,strategy:ec.WhileDragging,frequency:yg.Optimized},dragOverlay:{measure:cl}};class wu extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const n5={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Wd},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ad,measureDroppableContainers:Wd,windowRect:null,measuringScheduled:!1},a5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Wd,draggableNodes:new Map,over:null,measureDroppableContainers:Wd},Sh=O.createContext(a5),cP=O.createContext(n5);function i5(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wu}}}function o5(e,t){switch(t.type){case Wt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Wt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Wt.DragEnd:case Wt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wt.RegisterDroppable:{const{element:r}=t,{id:n}=r,a=new wu(e.droppable.containers);return a.set(n,r),{...e,droppable:{...e.droppable,containers:a}}}case Wt.SetDroppableDisabled:{const{id:r,key:n,disabled:a}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new wu(e.droppable.containers);return o.set(r,{...i,disabled:a}),{...e,droppable:{...e.droppable,containers:o}}}case Wt.UnregisterDroppable:{const{id:r,key:n}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new wu(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function s5(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:a}=O.useContext(Sh),i=dg(n),o=dg(r==null?void 0:r.id);return O.useEffect(()=>{if(!t&&!n&&i&&o!=null){if(!ib(i)||document.activeElement===i.target)return;const s=a.get(o);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=J3(d);if(f){f.focus();break}}})}},[n,t,a,o,i]),null}function l5(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((a,i)=>i({transform:a,...n}),r):r}function u5(e){return O.useMemo(()=>({draggable:{...ad.draggable,...e==null?void 0:e.draggable},droppable:{...ad.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ad.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function c5(e){let{activeNode:t,measure:r,initialRect:n,config:a=!0}=e;const i=O.useRef(!1),{x:o,y:s}=typeof a=="boolean"?{x:a,y:a}:a;Kn(()=>{if(!o&&!s||!t){i.current=!1;return}if(i.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=eP(d,n);if(o||(f.x=0),s||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=tP(u);p&&p.scrollBy({top:f.y,left:f.x})}},[t,o,s,n,r])}const fP=O.createContext({...Cn,scaleX:1,scaleY:1});var Va;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Va||(Va={}));const f5=O.memo(function(t){var r,n,a,i;let{id:o,accessibility:s,autoScroll:l=!0,children:u,sensors:d=t5,collisionDetection:f=h4,measuring:p,modifiers:h,...g}=t;const y=O.useReducer(o5,void 0,i5),[v,x]=y,[m,w]=i4(),[_,b]=O.useState(Va.Uninitialized),S=_===Va.Initialized,{draggable:{active:j,nodes:k,translate:A},droppable:{containers:R}}=v,T=j!=null?k.get(j):null,N=O.useRef({initial:null,translated:null}),$=O.useMemo(()=>{var zt;return j!=null?{id:j,data:(zt=T==null?void 0:T.data)!=null?zt:r5,rect:N}:null},[j,T]),D=O.useRef(null),[F,V]=O.useState(null),[H,L]=O.useState(null),U=Zu(g,Object.values(g)),K=Gc("DndDescribedBy",o),Q=O.useMemo(()=>R.getEnabled(),[R]),G=u5(p),{droppableRects:re,measureDroppableContainers:Z,measuringScheduled:pe}=V4(Q,{dragging:S,dependencies:[A.x,A.y],config:G.droppable}),ce=B4(k,j),Ee=O.useMemo(()=>H?pg(H):null,[H]),Ie=Ci(),te=W4(ce,G.draggable.measure);c5({activeNode:j!=null?k.get(j):null,config:Ie.layoutShiftCompensation,initialRect:te,measure:G.draggable.measure});const oe=E_(ce,G.draggable.measure,te),he=E_(ce?ce.parentElement:null),X=O.useRef({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=R.getNodeFor((r=X.current.over)==null?void 0:r.id),ge=e5({measure:G.dragOverlay.measure}),_e=(n=ge.nodeRef.current)!=null?n:ce,Ce=S?(a=ge.rect)!=null?a:oe:null,we=!!(ge.nodeRef.current&&ge.rect),Re=K4(we?null:oe),Te=uP(_e?Ir(_e):null),$e=q4(S?Oe??ce:null),Ze=Q4($e),W=l5(h,{transform:{x:A.x-Re.x,y:A.y-Re.y,scaleX:1,scaleY:1},activatorEvent:H,active:$,activeNodeRect:oe,containerNodeRect:he,draggingNodeRect:Ce,over:X.current.over,overlayNodeRect:ge.rect,scrollableAncestors:$e,scrollableAncestorRects:Ze,windowRect:Te}),E=Ee?ds(Ee,A):null,M=X4($e),P=N_(M),z=N_(M,[oe]),q=ds(W,P),J=Ce?v4(Ce,W):null,ee=$&&J?f({active:$,collisionRect:J,droppableRects:re,droppableContainers:Q,pointerCoordinates:E}):null,be=JE(ee,"id"),[Pe,Et]=O.useState(null),et=we?W:ds(W,z),Le=m4(et,(i=Pe==null?void 0:Pe.rect)!=null?i:null,oe),Ia=O.useRef(null),tr=O.useCallback((zt,I)=>{let{sensor:B,options:se}=I;if(D.current==null)return;const me=k.get(D.current);if(!me)return;const He=zt.nativeEvent,Pt=new B({active:D.current,activeNode:me,event:He,options:se,context:X,onAbort(ct){if(!k.get(ct))return;const{onDragAbort:Mr}=U.current,Yr={id:ct};Mr==null||Mr(Yr),m({type:"onDragAbort",event:Yr})},onPending(ct,Jn,Mr,Yr){if(!k.get(ct))return;const{onDragPending:Ol}=U.current,Ra={id:ct,constraint:Jn,initialCoordinates:Mr,offset:Yr};Ol==null||Ol(Ra),m({type:"onDragPending",event:Ra})},onStart(ct){const Jn=D.current;if(Jn==null)return;const Mr=k.get(Jn);if(!Mr)return;const{onDragStart:Yr}=U.current,jl={activatorEvent:He,active:{id:Jn,data:Mr.data,rect:N}};Zo.unstable_batchedUpdates(()=>{Yr==null||Yr(jl),b(Va.Initializing),x({type:Wt.DragStart,initialCoordinates:ct,active:Jn}),m({type:"onDragStart",event:jl}),V(Ia.current),L(He)})},onMove(ct){x({type:Wt.DragMove,coordinates:ct})},onEnd:mt(Wt.DragEnd),onCancel:mt(Wt.DragCancel)});Ia.current=Pt;function mt(ct){return async function(){const{active:Mr,collisions:Yr,over:jl,scrollAdjustedTranslate:Ol}=X.current;let Ra=null;if(Mr&&Ol){const{cancelDrop:kl}=U.current;Ra={activatorEvent:He,active:Mr,collisions:Yr,delta:Ol,over:jl},ct===Wt.DragEnd&&typeof kl=="function"&&await Promise.resolve(kl(Ra))&&(ct=Wt.DragCancel)}D.current=null,Zo.unstable_batchedUpdates(()=>{x({type:ct}),b(Va.Uninitialized),Et(null),V(null),L(null),Ia.current=null;const kl=ct===Wt.DragEnd?"onDragEnd":"onDragCancel";if(Ra){const mm=U.current[kl];mm==null||mm(Ra),m({type:kl,event:Ra})}})}}},[k]),Ei=O.useCallback((zt,I)=>(B,se)=>{const me=B.nativeEvent,He=k.get(se);if(D.current!==null||!He||me.dndKit||me.defaultPrevented)return;const Pt={active:He};zt(B,I.options,Pt)===!0&&(me.dndKit={capturedBy:I.sensor},D.current=se,tr(B,I))},[k,tr]),Pi=U4(d,Ei);Y4(d),Kn(()=>{oe&&_===Va.Initializing&&b(Va.Initialized)},[oe,_]),O.useEffect(()=>{const{onDragMove:zt}=U.current,{active:I,activatorEvent:B,collisions:se,over:me}=X.current;if(!I||!B)return;const He={active:I,activatorEvent:B,collisions:se,delta:{x:q.x,y:q.y},over:me};Zo.unstable_batchedUpdates(()=>{zt==null||zt(He),m({type:"onDragMove",event:He})})},[q.x,q.y]),O.useEffect(()=>{const{active:zt,activatorEvent:I,collisions:B,droppableContainers:se,scrollAdjustedTranslate:me}=X.current;if(!zt||D.current==null||!I||!me)return;const{onDragOver:He}=U.current,Pt=se.get(be),mt=Pt&&Pt.rect.current?{id:Pt.id,rect:Pt.rect.current,data:Pt.data,disabled:Pt.disabled}:null,ct={active:zt,activatorEvent:I,collisions:B,delta:{x:me.x,y:me.y},over:mt};Zo.unstable_batchedUpdates(()=>{Et(mt),He==null||He(ct),m({type:"onDragOver",event:ct})})},[be]),Kn(()=>{X.current={activatorEvent:H,active:$,activeNode:ce,collisionRect:J,collisions:ee,droppableRects:re,draggableNodes:k,draggingNode:_e,draggingNodeRect:Ce,droppableContainers:R,over:Pe,scrollableAncestors:$e,scrollAdjustedTranslate:q},N.current={initial:Ce,translated:J}},[$,ce,ee,J,k,_e,Ce,re,R,Pe,$e,q]),L4({...Ie,delta:A,draggingRect:J,pointerCoordinates:E,scrollableAncestors:$e,scrollableAncestorRects:Ze});const Ni=O.useMemo(()=>({active:$,activeNode:ce,activeNodeRect:oe,activatorEvent:H,collisions:ee,containerNodeRect:he,dragOverlay:ge,draggableNodes:k,droppableContainers:R,droppableRects:re,over:Pe,measureDroppableContainers:Z,scrollableAncestors:$e,scrollableAncestorRects:Ze,measuringConfiguration:G,measuringScheduled:pe,windowRect:Te}),[$,ce,oe,H,ee,he,ge,k,R,re,Pe,Z,$e,Ze,G,pe,Te]),Eo=O.useMemo(()=>({activatorEvent:H,activators:Pi,active:$,activeNodeRect:oe,ariaDescribedById:{draggable:K},dispatch:x,draggableNodes:k,over:Pe,measureDroppableContainers:Z}),[H,Pi,$,oe,x,K,k,Pe,Z]);return C.createElement(YE.Provider,{value:w},C.createElement(Sh.Provider,{value:Eo},C.createElement(cP.Provider,{value:Ni},C.createElement(fP.Provider,{value:Le},u)),C.createElement(s5,{disabled:(s==null?void 0:s.restoreFocus)===!1})),C.createElement(l4,{...s,hiddenTextDescribedById:K}));function Ci(){const zt=(F==null?void 0:F.autoScrollEnabled)===!1,I=typeof l=="object"?l.enabled===!1:l===!1,B=S&&!zt&&!I;return typeof l=="object"?{...l,enabled:B}:{enabled:B}}}),d5=O.createContext(null),T_="button",p5="Draggable";function h5(e){let{id:t,data:r,disabled:n=!1,attributes:a}=e;const i=Gc(p5),{activators:o,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=O.useContext(Sh),{role:h=T_,roleDescription:g="draggable",tabIndex:y=0}=a??{},v=(l==null?void 0:l.id)===t,x=O.useContext(v?fP:d5),[m,w]=Vd(),[_,b]=Vd(),S=Z4(o,t),j=Zu(r);Kn(()=>(f.set(t,{id:t,key:i,node:m,activatorNode:_,data:j}),()=>{const A=f.get(t);A&&A.key===i&&f.delete(t)}),[f,t]);const k=O.useMemo(()=>({role:h,tabIndex:y,"aria-disabled":n,"aria-pressed":v&&h===T_?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[n,h,y,v,g,d.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:k,isDragging:v,listeners:n?void 0:S,node:m,over:p,setNodeRef:w,setActivatorNodeRef:b,transform:x}}function m5(){return O.useContext(cP)}const y5="Droppable",v5={timeout:25};function g5(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:a}=e;const i=Gc(y5),{active:o,dispatch:s,over:l,measureDroppableContainers:u}=O.useContext(Sh),d=O.useRef({disabled:r}),f=O.useRef(!1),p=O.useRef(null),h=O.useRef(null),{disabled:g,updateMeasurementsFor:y,timeout:v}={...v5,...a},x=Zu(y??n),m=O.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(x.current)?x.current:[x.current]),h.current=null},v)},[v]),w=_h({callback:m,disabled:g||!o}),_=O.useCallback((k,A)=>{w&&(A&&(w.unobserve(A),f.current=!1),k&&w.observe(k))},[w]),[b,S]=Vd(_),j=Zu(t);return O.useEffect(()=>{!w||!b.current||(w.disconnect(),f.current=!1,w.observe(b.current))},[b,w]),O.useEffect(()=>(s({type:Wt.RegisterDroppable,element:{id:n,key:i,disabled:r,node:b,rect:p,data:j}}),()=>s({type:Wt.UnregisterDroppable,key:i,id:n})),[n]),O.useEffect(()=>{r!==d.current.disabled&&(s({type:Wt.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,s]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===n,node:b,over:l,setNodeRef:S}}function cb(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function x5(e,t){return e.reduce((r,n,a)=>{const i=t.get(n);return i&&(r[a]=i),r},Array(e.length))}function jf(e){return e!==null&&e>=0}function b5(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:a}=e;const i=cb(t,n,r),o=t[a],s=i[a];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Of={scaleX:1,scaleY:1},_5=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:a,rects:i,overIndex:o}=e;const s=(t=i[r])!=null?t:n;if(!s)return null;if(a===r){const u=i[o];return u?{x:0,y:rr&&a<=o?{x:0,y:-s.height-l,...Of}:a=o?{x:0,y:s.height+l,...Of}:{x:0,y:0,...Of}};function S5(e,t,r){const n=e[t],a=e[t-1],i=e[t+1];return n?rn.map(S=>typeof S=="object"&&"id"in S?S.id:S),[n]),g=o!=null,y=o?h.indexOf(o.id):-1,v=u?h.indexOf(u.id):-1,x=O.useRef(h),m=!b5(h,x.current),w=v!==-1&&y===-1||m,_=w5(i);Kn(()=>{m&&g&&d(h)},[m,h,g,d]),O.useEffect(()=>{x.current=h},[h]);const b=O.useMemo(()=>({activeIndex:y,containerId:f,disabled:_,disableTransforms:w,items:h,overIndex:v,useDragOverlay:p,sortedRects:x5(h,l),strategy:a}),[y,f,_.draggable,_.droppable,w,h,v,l,p,a]);return C.createElement(hP.Provider,{value:b},t)}const O5=e=>{let{id:t,items:r,activeIndex:n,overIndex:a}=e;return cb(r,n,a).indexOf(t)},k5=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:a,items:i,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!n||s!==i&&a===o?!1:r?!0:o!==a&&t===l},A5={duration:200,easing:"ease"},mP="transform",E5=Ju.Transition.toString({property:mP,duration:0,easing:"linear"}),P5={roleDescription:"sortable"};function N5(e){let{disabled:t,index:r,node:n,rect:a}=e;const[i,o]=O.useState(null),s=O.useRef(r);return Kn(()=>{if(!t&&r!==s.current&&n.current){const l=a.current;if(l){const u=cl(n.current,{ignoreTransform:!0}),d={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(d.x||d.y)&&o(d)}}r!==s.current&&(s.current=r)},[t,r,n,a]),O.useEffect(()=>{i&&o(null)},[i]),i}function C5(e){let{animateLayoutChanges:t=k5,attributes:r,disabled:n,data:a,getNewIndex:i=O5,id:o,strategy:s,resizeObserverConfig:l,transition:u=A5}=e;const{items:d,containerId:f,activeIndex:p,disabled:h,disableTransforms:g,sortedRects:y,overIndex:v,useDragOverlay:x,strategy:m}=O.useContext(hP),w=T5(n,h),_=d.indexOf(o),b=O.useMemo(()=>({sortable:{containerId:f,index:_,items:d},...a}),[f,a,_,d]),S=O.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:j,node:k,isOver:A,setNodeRef:R}=g5({id:o,data:b,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...l}}),{active:T,activatorEvent:N,activeNodeRect:$,attributes:D,setNodeRef:F,listeners:V,isDragging:H,over:L,setActivatorNodeRef:U,transform:K}=h5({id:o,data:b,attributes:{...P5,...r},disabled:w.draggable}),Q=X3(R,F),G=!!T,re=G&&!g&&jf(p)&&jf(v),Z=!x&&H,pe=Z&&re?K:null,Ee=re?pe??(s??m)({rects:y,activeNodeRect:$,activeIndex:p,overIndex:v,index:_}):null,Ie=jf(p)&&jf(v)?i({id:o,items:d,activeIndex:p,overIndex:v}):_,te=T==null?void 0:T.id,oe=O.useRef({activeId:te,items:d,newIndex:Ie,containerId:f}),he=d!==oe.current.items,X=t({active:T,containerId:f,isDragging:H,isSorting:G,id:o,index:_,items:d,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:u,wasDragging:oe.current.activeId!=null}),Oe=N5({disabled:!X,index:_,node:k,rect:j});return O.useEffect(()=>{G&&oe.current.newIndex!==Ie&&(oe.current.newIndex=Ie),f!==oe.current.containerId&&(oe.current.containerId=f),d!==oe.current.items&&(oe.current.items=d)},[G,Ie,f,d]),O.useEffect(()=>{if(te===oe.current.activeId)return;if(te&&!oe.current.activeId){oe.current.activeId=te;return}const _e=setTimeout(()=>{oe.current.activeId=te},50);return()=>clearTimeout(_e)},[te]),{active:T,activeIndex:p,attributes:D,data:b,rect:j,index:_,newIndex:Ie,items:d,isOver:A,isSorting:G,isDragging:H,listeners:V,node:k,overIndex:v,over:L,setNodeRef:Q,setActivatorNodeRef:U,setDroppableNodeRef:R,setDraggableNodeRef:F,transform:Oe??Ee,transition:ge()};function ge(){if(Oe||he&&oe.current.newIndex===_)return E5;if(!(Z&&!ib(N)||!u)&&(G||X))return Ju.Transition.toString({...u,property:mP})}}function T5(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function Gd(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const $5=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],I5=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:a,droppableContainers:i,over:o,scrollableAncestors:s}}=t;if($5.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=a.get(f.id);if(p)switch(e.code){case Ke.Down:n.topp.top&&l.push(f);break;case Ke.Left:n.left>p.left&&l.push(f);break;case Ke.Right:n.left1&&(d=u[1].id),d!=null){const f=i.get(r.id),p=i.get(d),h=p?a.get(p.id):null,g=p==null?void 0:p.node.current;if(g&&h&&f&&p){const v=wh(g).some((S,j)=>s[j]!==S),x=yP(f,p),m=R5(f,p),w=v||!x?{x:0,y:0}:{x:m?n.width-h.width:0,y:m?n.height-h.height:0},_={x:h.left,y:h.top};return w.x&&w.y?_:Qu(_,w)}}}};function yP(e,t){return!Gd(e)||!Gd(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function R5(e,t){return!Gd(e)||!Gd(t)||!yP(e,t)?!1:e.data.current.sortable.index{if(!a||typeof a!="object")return{};const i=a.keys;return i&&typeof i=="object"?i:a},r={...t(e.keys),...t((n=e.routing_config)==null?void 0:n.keys)};return Object.keys(r).length===0?[]:Object.entries(r).map(([a,i])=>{const o=(i.type||i.data_type||"str_value").toString().toLowerCase(),s={key:a,type:o};return i.values&&(s.values=Array.isArray(i.values)?i.values.map(l=>l.trim()):i.values.split(",").map(l=>l.trim())),i.min_value!==void 0&&(s.min_value=i.min_value),i.max_value!==void 0&&(s.max_value=i.max_value),i.min_length!==void 0&&(s.min_length=i.min_length),i.max_length!==void 0&&(s.max_length=i.max_length),i.exact_length!==void 0&&(s.exact_length=i.exact_length),i.regex&&(s.regex=i.regex),s})}function vP(){const{data:e,error:t,isLoading:r}=ir("/config/routing-keys",Qi,{refreshInterval:0,revalidateOnFocus:!1}),n=M5(e||null),a=n.reduce((o,s)=>(o[s.key]=s,o),{}),i={};return n.forEach(o=>{i[o.key]={type:o.type,values:o.values||[]}}),{config:e,keys:n,keysByName:a,routingKeysConfig:i,isLoading:r,error:t,getKeyValues:o=>{var s;return((s=a[o])==null?void 0:s.values)||[]},isIntegerKey:o=>{var s;return((s=a[o])==null?void 0:s.type)==="integer"},isEnumKey:o=>{var s;return((s=a[o])==null?void 0:s.type)==="enum"}}}const D5={"==":"equal","!=":"not_equal",">":"greater_than","<":"less_than",">=":"greater_than_equal","<=":"less_than_equal"};function L5({id:e,name:t,onRemove:r}){const{attributes:n,listeners:a,setNodeRef:i,transform:o,transition:s}=C5({id:e}),l={transform:Ju.Transform.toString(o),transition:s};return c.jsxs("div",{ref:i,style:l,className:"flex items-center gap-2 bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] rounded-lg px-2 py-1.5",children:[c.jsx("span",{...n,...a,className:"cursor-grab text-slate-400",children:c.jsx(pD,{size:14})}),c.jsx("span",{className:"text-sm flex-1 font-mono",children:t}),c.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:c.jsx(wa,{size:12})})]})}function gP({gateways:e,onChange:t}){const[r,n]=O.useState(""),[a,i]=O.useState(""),o=u4(b_(ub),b_(sb,{coordinateGetter:I5}));function s(u){const{active:d,over:f}=u;if(f&&d.id!==f.id){const p=e.findIndex(g=>g.id===d.id),h=e.findIndex(g=>g.id===f.id);t(cb(e,p,h))}}function l(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:a.trim()}]),n(""),i(""))}return c.jsxs("div",{className:"space-y-2",children:[c.jsx(f5,{sensors:o,collisionDetection:f4,onDragEnd:s,children:c.jsx(j5,{items:e.map(u=>u.id),strategy:_5,children:e.map((u,d)=>c.jsx(L5,{id:u.id,name:`${d+1}. ${u.gatewayName}${u.gatewayId?` (${u.gatewayId})`:""}`,onRemove:()=>t(e.filter(f=>f.id!==u.id))},u.id))})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{value:a,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsxs(Be,{type:"button",size:"sm",variant:"secondary",onClick:l,children:[c.jsx(hi,{size:13})," Add"]})]})]})}function xP({gateways:e,onChange:t}){const[r,n]=O.useState(""),[a,i]=O.useState(""),o=e.reduce((l,u)=>l+u.split,0);function s(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:a.trim(),split:0}]),n(""),i(""))}return c.jsxs("div",{className:"space-y-2",children:[e.map(l=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:l.gatewayName,onChange:u=>t(e.map(d=>d.id===l.id?{...d,gatewayName:u.target.value}:d)),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-32 focus:outline-none"}),c.jsx("input",{value:l.gatewayId,onChange:u=>t(e.map(d=>d.id===l.id?{...d,gatewayId:u.target.value}:d)),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-28 focus:outline-none"}),c.jsx("input",{type:"range",min:0,max:100,value:l.split,onChange:u=>t(e.map(d=>d.id===l.id?{...d,split:Number(u.target.value)}:d)),className:"flex-1 accent-brand-500"}),c.jsxs("span",{className:"text-sm w-10 text-right",children:[l.split,"%"]}),c.jsx("button",{type:"button",onClick:()=>t(e.filter(u=>u.id!==l.id)),className:"text-red-400 hover:text-red-600",children:c.jsx(wa,{size:12})})]},l.id)),c.jsxs("div",{className:`text-xs font-medium ${o===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",o,"% ",o!==100&&"(must equal 100)"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{value:r,onChange:l=>n(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{value:a,onChange:l=>i(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsxs(Be,{type:"button",size:"sm",variant:"secondary",onClick:s,children:[c.jsx(hi,{size:13})," Add"]})]})]})}function F5({row:e,onChange:t,onRemove:r,routingKeys:n}){var l;const a=n[e.lhs],i=(a==null?void 0:a.type)==="enum",s=(a==null?void 0:a.type)==="integer"?[">","<",">=","<=","==","!="]:["==","!="];return c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("select",{value:e.lhs,onChange:u=>t({...e,lhs:u.target.value,value:"",operator:"=="}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:Object.keys(n).map(u=>c.jsx("option",{value:u,children:u},u))}),c.jsx("select",{value:e.operator,onChange:u=>t({...e,operator:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:s.map(u=>c.jsx("option",{value:u,children:u},u))}),i?c.jsxs("select",{value:e.value,onChange:u=>t({...e,value:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:[c.jsx("option",{value:"",children:"select..."}),(((l=n[e.lhs])==null?void 0:l.values)||[]).map(u=>c.jsx("option",{value:u,children:u},u))]}):c.jsx("input",{type:"number",value:e.value,onChange:u=>t({...e,value:u.target.value}),placeholder:"value",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none"}),c.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:c.jsx(wa,{size:12})})]})}function z5({block:e,onChange:t,onRemove:r,routingKeys:n}){var d;const[a,i]=O.useState(!1),o=Object.keys(n)[0]||"payment_method",l=(((d=n[o])==null?void 0:d.values)||[])[0]||"";function u(){t({...e,conditions:[...e.conditions,{id:crypto.randomUUID(),lhs:o,operator:"==",value:l}]})}return c.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#0d0d12] rounded-t-xl cursor-pointer",onClick:()=>i(!a),children:[c.jsx("input",{value:e.name,onChange:f=>{f.stopPropagation(),t({...e,name:f.target.value})},onClick:f=>f.stopPropagation(),placeholder:"Rule name",className:"bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),r()},className:"text-red-400 hover:text-red-600",children:c.jsx(wa,{size:14})}),a?c.jsx(ru,{size:14}):c.jsx(nu,{size:14})]})]}),!a&&c.jsxs("div",{className:"px-4 py-3 space-y-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"CONDITIONS"}),c.jsxs("div",{className:"space-y-2",children:[e.conditions.map(f=>c.jsx(F5,{row:f,routingKeys:n,onChange:p=>t({...e,conditions:e.conditions.map(h=>h.id===f.id?p:h)}),onRemove:()=>t({...e,conditions:e.conditions.filter(p=>p.id!==f.id)})},f.id)),c.jsxs(Be,{type:"button",variant:"ghost",size:"sm",onClick:u,children:[c.jsx(hi,{size:12})," Add Condition"]})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"OUTPUT"}),c.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(f=>c.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[c.jsx("input",{type:"radio",checked:e.outputType===f,onChange:()=>t({...e,outputType:f}),className:"accent-brand-500"}),f==="priority"?"Priority":"Volume Split"]},f))}),e.outputType==="priority"?c.jsx(gP,{gateways:e.priorityGateways,onChange:f=>t({...e,priorityGateways:f})}):c.jsx(xP,{gateways:e.volumeGateways,onChange:f=>t({...e,volumeGateways:f})})]})]})]})}function B5(e,t,r){function n(i,o,s){return i==="priority"?{priority:o.map(l=>({gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}))}:{volume_split:s.map(l=>({split:l.split,output:{gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}}))}}function a(i){return i==="priority"?"priority":"volume_split"}return{globals:{},default_selection:n(t.type,t.priorityGateways,t.volumeGateways),rules:e.map(i=>({name:i.name,routing_type:a(i.outputType),output:n(i.outputType,i.priorityGateways,i.volumeGateways),statements:[{condition:i.conditions.map(o=>{var s,l;return{lhs:o.lhs,comparison:D5[o.operator]||o.operator,value:{type:((s=r[o.lhs])==null?void 0:s.type)==="integer"?"number":"enum_variant",value:((l=r[o.lhs])==null?void 0:l.type)==="integer"?Number(o.value):o.value},metadata:{}}})}]}))}}function U5(){const{merchantId:e}=Xn(),{routingKeysConfig:t,isLoading:r,error:n}=vP(),a=t,i=Object.keys(a).length>0,o=!r&&(!i||!!n),[s,l]=O.useState(""),[u,d]=O.useState(""),[f,p]=O.useState([]),[h,g]=O.useState({type:"priority",priorityGateways:[],volumeGateways:[]}),[y,v]=O.useState(!1),[x,m]=O.useState(!1),[w,_]=O.useState(null),[b,S]=O.useState(null),[j,k]=O.useState(!1),[A,R]=O.useState(null),[T,N]=O.useState(!1),[$,D]=O.useState(new Set),{data:F,mutate:V}=ir(e?`/routing/list/${e}`:null,()=>_t(`/routing/list/${e}`)),{data:H}=ir(e?`/routing/list/active/${e}`:null,()=>_t(`/routing/list/active/${e}`)),L=new Set((H||[]).map(Z=>Z.id)),U=B5(f,h,a);async function K(Z){if(Z.preventDefault(),!e){_("Set a Merchant ID first.");return}if(o){_("Routing key config is unavailable. Ensure backend /config/routing-keys is reachable and valid.");return}if(!s.trim()){_("Rule name is required.");return}m(!0),_(null),S(null);try{const pe=await _t("/routing/create",{name:s.trim(),description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:U}});S(pe.id),V()}catch(pe){_(String(pe))}finally{m(!1)}}async function Q(Z){if(e){k(!0),R(null),N(!1);try{await _t("/routing/activate",{created_by:e,routing_algorithm_id:Z}),N(!0),V()}catch(pe){R(String(pe))}finally{k(!1)}}}function G(Z){D(pe=>{const ce=new Set(pe);return ce.has(Z)?ce.delete(Z):ce.add(Z),ce})}function re(){p(Z=>[...Z,{id:crypto.randomUUID(),name:`Rule ${Z.length+1}`,conditions:[],outputType:"priority",priorityGateways:[],volumeGateways:[]}])}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Rule-Based Routing"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Create declarative routing rules"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsxs("div",{className:"lg:col-span-1 space-y-3",children:[c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Existing Rules"})}),c.jsx(Ae,{className:"p-0",children:e?F?F.length===0?c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"No rules yet."}):c.jsx("div",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:F.map(Z=>{const pe=L.has(Z.id),ce=$.has(Z.id),Ee=Z.algorithm_data||Z.algorithm;return c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate font-medium",children:Z.name}),c.jsx("p",{className:"text-xs text-slate-400 capitalize",children:Ee==null?void 0:Ee.type})]}),c.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 sm:justify-end",children:[c.jsx(ze,{variant:pe?"green":"gray",children:pe?"Active":"Inactive"}),c.jsxs(Be,{size:"sm",variant:"ghost",onClick:()=>G(Z.id),children:[c.jsx(yh,{size:14,className:"mr-1"}),ce?"Hide":"View"]}),!pe&&c.jsx(Be,{size:"sm",variant:"ghost",onClick:()=>Q(Z.id),disabled:j,children:"Activate"})]})]}),ce&&c.jsx("div",{className:"bg-slate-50 px-4 py-3 dark:bg-[#151518]",children:c.jsxs("div",{className:"space-y-2 text-xs text-slate-600",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"ID:"})," ",Z.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Description:"})," ",Z.description||"N/A"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Algorithm For:"})," ",Z.algorithm_for]}),Z.created_at&&c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",new Date(Z.created_at).toLocaleString()]}),c.jsxs("div",{children:[c.jsx("strong",{children:"Configuration:"}),c.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-transparent bg-slate-100 p-2 text-xs dark:border-[#222226] dark:bg-[#0f0f11]",children:JSON.stringify(Ee,null,2)})]})]})})]},Z.id)})}):c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Loading..."}):c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Set merchant ID to load rules."})})]}),A&&c.jsx(ln,{error:A}),T&&c.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400",children:"Rule activated successfully."})]}),c.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[c.jsx("form",{onSubmit:K,className:"space-y-4",children:c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Rule Builder"})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rule Name *"}),c.jsx("input",{value:s,onChange:Z=>l(Z.target.value),placeholder:"my-rule",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),c.jsx("input",{value:u,onChange:Z=>d(Z.target.value),placeholder:"Optional description",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Rules"}),r&&c.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),o&&c.jsx(ln,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Builder is disabled until this is fixed."}),f.map(Z=>c.jsx(z5,{block:Z,routingKeys:a,onChange:pe=>p(ce=>ce.map(Ee=>Ee.id===Z.id?pe:Ee)),onRemove:()=>p(pe=>pe.filter(ce=>ce.id!==Z.id))},Z.id)),c.jsxs(Be,{type:"button",variant:"secondary",size:"sm",onClick:re,disabled:o,children:[c.jsx(hi,{size:14})," Add Rule Block"]})]}),c.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl px-4 py-3",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"DEFAULT SELECTION (Fallback)"}),c.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(Z=>c.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[c.jsx("input",{type:"radio",checked:h.type===Z,onChange:()=>g({...h,type:Z}),className:"accent-brand-500"}),Z==="priority"?"Priority":"Volume Split"]},Z))}),h.type==="priority"?c.jsx(gP,{gateways:h.priorityGateways,onChange:Z=>g({...h,priorityGateways:Z})}):c.jsx(xP,{gateways:h.volumeGateways,onChange:Z=>g({...h,volumeGateways:Z})})]}),c.jsx(ln,{error:w}),b&&c.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400 flex items-center justify-between",children:[c.jsxs("span",{children:["Rule created (ID: ",b,")"]}),c.jsx(Be,{type:"button",size:"sm",onClick:()=>Q(b),disabled:j,children:"Activate Now"})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx(Be,{type:"submit",disabled:x||o,children:x?"Creating...":"Create Rule"}),c.jsx(Be,{type:"button",variant:"secondary",size:"sm",onClick:()=>v(!y),children:y?"Hide JSON":"Preview JSON"})]})]})]})}),y&&c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"JSON Preview"})}),c.jsx(Ae,{children:c.jsx("pre",{className:"text-xs text-slate-600 overflow-auto max-h-64 bg-[#07070b] rounded-lg p-4 font-mono border border-slate-200 dark:border-[#1c1c24]",children:JSON.stringify({name:s,description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:U}},null,2)})})]})]})]})]})}function bP(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t-1}var Bz=zz,Uz=Oh;function Vz(e,t){var r=this.__data__,n=Uz(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Wz=Vz,Hz=Az,Gz=Rz,Kz=Lz,qz=Bz,Xz=Wz;function hl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Hi=function(t){return po(t)&&t.indexOf("%")===t.length-1},ne=function(t){return m6(t)&&!yl(t)},x6=function(t){return Ne(t)},Kt=function(t){return ne(t)||po(t)},b6=0,jo=function(t){var r=++b6;return"".concat(t||"").concat(r)},xr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ne(t)&&!po(t))return n;var i;if(Hi(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return yl(i)&&(i=n),a&&i>r&&(i=r),i},qa=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},w6=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function E6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gg(e){"@babel/helpers - typeof";return gg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gg(e)}var W_={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ha=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},H_=null,hy=null,_b=function e(t){if(t===H_&&Array.isArray(hy))return hy;var r=[];return O.Children.forEach(t,function(n){Ne(n)||(c6.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),hy=r,H_=t,r};function Hr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return ha(a)}):n=[ha(t)],_b(e).forEach(function(a){var i=Wr(a,"type.displayName")||Wr(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function zr(e,t){var r=Hr(e,t);return r&&r[0]}var G_=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!ne(n)||n<=0||!ne(a)||a<=0)},P6=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],N6=function(t){return t&&t.type&&po(t.type)&&P6.indexOf(t.type)>=0},$P=function(t){return t&&gg(t)==="object"&&"clipDot"in t},C6=function(t,r,n,a){var i,o=(i=py==null?void 0:py[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!je(t)&&(a&&o.includes(r)||j6.includes(r))||n&&wb.includes(r)},xe=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(O.isValidElement(t)&&(a=t.props),!dl(a))return null;var i={};return Object.keys(a).forEach(function(o){var s;C6((s=a)===null||s===void 0?void 0:s[o],o,r,n)&&(i[o]=a[o])}),i},xg=function e(t,r){if(t===r)return!0;var n=O.Children.count(t);if(n!==O.Children.count(r))return!1;if(n===0)return!0;if(n===1)return K_(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function M6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wg(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,s=e.title,l=e.desc,u=R6(e,I6),d=a||{width:r,height:n,x:0,y:0},f=Fe("recharts-surface",i);return C.createElement("svg",bg({},xe(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),C.createElement("title",null,s),C.createElement("desc",null,l),t)}var D6=["children","className"];function _g(){return _g=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function F6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Ve=C.forwardRef(function(e,t){var r=e.children,n=e.className,a=L6(e,D6),i=Fe("recharts-layer",n);return C.createElement("g",_g({className:i},xe(a,!0),{ref:t}),r)}),Pn=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;ia?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n=n?e:U6(e,t,r)}var W6=V6,H6="\\ud800-\\udfff",G6="\\u0300-\\u036f",K6="\\ufe20-\\ufe2f",q6="\\u20d0-\\u20ff",X6=G6+K6+q6,Y6="\\ufe0e\\ufe0f",Z6="\\u200d",Q6=RegExp("["+Z6+H6+X6+Y6+"]");function J6(e){return Q6.test(e)}var IP=J6;function e8(e){return e.split("")}var t8=e8,RP="\\ud800-\\udfff",r8="\\u0300-\\u036f",n8="\\ufe20-\\ufe2f",a8="\\u20d0-\\u20ff",i8=r8+n8+a8,o8="\\ufe0e\\ufe0f",s8="["+RP+"]",Sg="["+i8+"]",jg="\\ud83c[\\udffb-\\udfff]",l8="(?:"+Sg+"|"+jg+")",MP="[^"+RP+"]",DP="(?:\\ud83c[\\udde6-\\uddff]){2}",LP="[\\ud800-\\udbff][\\udc00-\\udfff]",u8="\\u200d",FP=l8+"?",zP="["+o8+"]?",c8="(?:"+u8+"(?:"+[MP,DP,LP].join("|")+")"+zP+FP+")*",f8=zP+FP+c8,d8="(?:"+[MP+Sg+"?",Sg,DP,LP,s8].join("|")+")",p8=RegExp(jg+"(?="+jg+")|"+d8+f8,"g");function h8(e){return e.match(p8)||[]}var m8=h8,y8=t8,v8=IP,g8=m8;function x8(e){return v8(e)?g8(e):y8(e)}var b8=x8,w8=W6,_8=IP,S8=b8,j8=AP;function O8(e){return function(t){t=j8(t);var r=_8(t)?S8(t):void 0,n=r?r[0]:t.charAt(0),a=r?w8(r,1).join(""):t.slice(1);return n[e]()+a}}var k8=O8,A8=k8,E8=A8("toUpperCase"),P8=E8;const Fh=nt(P8);function dt(e){return function(){return e}}const BP=Math.cos,Xd=Math.sin,$n=Math.sqrt,Yd=Math.PI,zh=2*Yd,Og=Math.PI,kg=2*Og,Di=1e-6,N8=kg-Di;function UP(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return UP;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;aDi)if(!(Math.abs(f*l-u*d)>Di)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,g=a-s,y=l*l+u*u,v=h*h+g*g,x=Math.sqrt(y),m=Math.sqrt(p),w=i*Math.tan((Og-Math.acos((y+p-v)/(2*x*m)))/2),_=w/m,b=w/x;Math.abs(_-1)>Di&&this._append`L${t+_*d},${r+_*f}`,this._append`A${i},${i},0,0,${+(f*h>d*g)},${this._x1=t+b*l},${this._y1=r+b*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(a),l=n*Math.sin(a),u=t+s,d=r+l,f=1^o,p=o?a-i:i-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Di||Math.abs(this._y1-d)>Di)&&this._append`L${u},${d}`,n&&(p<0&&(p=p%kg+kg),p>N8?this._append`A${n},${n},0,1,${f},${t-s},${r-l}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:p>Di&&this._append`A${n},${n},0,${+(p>=Og)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function Sb(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new T8(t)}function jb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function VP(e){this._context=e}VP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Bh(e){return new VP(e)}function WP(e){return e[0]}function HP(e){return e[1]}function GP(e,t){var r=dt(!0),n=null,a=Bh,i=null,o=Sb(s);e=typeof e=="function"?e:e===void 0?WP:dt(e),t=typeof t=="function"?t:t===void 0?HP:dt(t);function s(l){var u,d=(l=jb(l)).length,f,p=!1,h;for(n==null&&(i=a(h=o())),u=0;u<=d;++u)!(u=h;--g)s.point(w[g],_[g]);s.lineEnd(),s.areaEnd()}x&&(w[p]=+e(v,p,f),_[p]=+t(v,p,f),s.point(n?+n(v,p,f):w[p],r?+r(v,p,f):_[p]))}if(m)return s=null,m+""||null}function d(){return GP().defined(a).curve(o).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:dt(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:dt(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:dt(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:dt(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:dt(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:dt(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:dt(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,i!=null&&(s=o(i)),u):o},u.context=function(f){return arguments.length?(f==null?i=s=null:s=o(i=f),u):i},u}class KP{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function $8(e){return new KP(e,!0)}function I8(e){return new KP(e,!1)}const Ob={draw(e,t){const r=$n(t/Yd);e.moveTo(r,0),e.arc(0,0,r,0,zh)}},R8={draw(e,t){const r=$n(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},qP=$n(1/3),M8=qP*2,D8={draw(e,t){const r=$n(t/M8),n=r*qP;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},L8={draw(e,t){const r=$n(t),n=-r/2;e.rect(n,n,r,r)}},F8=.8908130915292852,XP=Xd(Yd/10)/Xd(7*Yd/10),z8=Xd(zh/10)*XP,B8=-BP(zh/10)*XP,U8={draw(e,t){const r=$n(t*F8),n=z8*r,a=B8*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=zh*i/5,s=BP(o),l=Xd(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*a,l*n+s*a)}e.closePath()}},my=$n(3),V8={draw(e,t){const r=-$n(t/(my*3));e.moveTo(0,r*2),e.lineTo(-my*r,-r),e.lineTo(my*r,-r),e.closePath()}},Zr=-.5,Qr=$n(3)/2,Ag=1/$n(12),W8=(Ag/2+1)*3,H8={draw(e,t){const r=$n(t/W8),n=r/2,a=r*Ag,i=n,o=r*Ag+r,s=-i,l=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(s,l),e.lineTo(Zr*n-Qr*a,Qr*n+Zr*a),e.lineTo(Zr*i-Qr*o,Qr*i+Zr*o),e.lineTo(Zr*s-Qr*l,Qr*s+Zr*l),e.lineTo(Zr*n+Qr*a,Zr*a-Qr*n),e.lineTo(Zr*i+Qr*o,Zr*o-Qr*i),e.lineTo(Zr*s+Qr*l,Zr*l-Qr*s),e.closePath()}};function G8(e,t){let r=null,n=Sb(a);e=typeof e=="function"?e:dt(e||Ob),t=typeof t=="function"?t:dt(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:dt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:dt(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function Zd(){}function Qd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function YP(e){this._context=e}YP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Qd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function K8(e){return new YP(e)}function ZP(e){this._context=e}ZP.prototype={areaStart:Zd,areaEnd:Zd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function q8(e){return new ZP(e)}function QP(e){this._context=e}QP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function X8(e){return new QP(e)}function JP(e){this._context=e}JP.prototype={areaStart:Zd,areaEnd:Zd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Y8(e){return new JP(e)}function X_(e){return e<0?-1:1}function Y_(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(X_(i)+X_(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function Z_(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function yy(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,a+s*t,i-s,o-s*r,i,o)}function Jd(e){this._context=e}Jd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:yy(this,this._t0,Z_(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,yy(this,Z_(this,r=Y_(this,e,t)),r);break;default:yy(this,this._t0,r=Y_(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function eN(e){this._context=new tN(e)}(eN.prototype=Object.create(Jd.prototype)).point=function(e,t){Jd.prototype.point.call(this,t,e)};function tN(e){this._context=e}tN.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function Z8(e){return new Jd(e)}function Q8(e){return new eN(e)}function rN(e){this._context=e}rN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Q_(e),a=Q_(t),i=0,o=1;o=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function eU(e){return new Uh(e,.5)}function tU(e){return new Uh(e,0)}function rU(e){return new Uh(e,1)}function Cs(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,s=i.length;r=0;)r[t]=t;return r}function nU(e,t){return e[t]}function aU(e){const t=[];return t.key=e,t}function iU(){var e=dt([]),t=Eg,r=Cs,n=nU;function a(i){var o=Array.from(e.apply(this,arguments),aU),s,l=o.length,u=-1,d;for(const f of i)for(s=0,++u;s0){for(var r,n,a=0,i=e[0].length,o;a0){for(var r=0,n=e[t[0]],a,i=n.length;r0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var nN={symbolCircle:Ob,symbolCross:R8,symbolDiamond:D8,symbolSquare:L8,symbolStar:U8,symbolTriangle:V8,symbolWye:H8},mU=Math.PI/180,yU=function(t){var r="symbol".concat(Fh(t));return nN[r]||Ob},vU=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*mU;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},gU=function(t,r){nN["symbol".concat(Fh(t))]=r},kb=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,s=o===void 0?"area":o,l=pU(t,uU),u=eS(eS({},l),{},{type:n,size:i,sizeType:s}),d=function(){var v=yU(n),x=G8().type(v).size(vU(i,s,n));return x()},f=u.className,p=u.cx,h=u.cy,g=xe(u,!0);return p===+p&&h===+h&&i===+i?C.createElement("path",Pg({},g,{className:Fe("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(h,")"),d:d()})):null};kb.registerSymbol=gU;function Ts(e){"@babel/helpers - typeof";return Ts=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ts(e)}function Ng(){return Ng=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var m=h.inactive?u:h.color;return C.createElement("li",Ng({className:v,style:f,key:"legend-item-".concat(g)},ho(n.props,h,g)),C.createElement(wg,{width:o,height:o,viewBox:d,style:p},n.renderIcon(h)),C.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},y?y(x,h,g):x))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var s={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return C.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(O.PureComponent);rc(Ab,"displayName","Legend");rc(Ab,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var EU=kh;function PU(){this.__data__=new EU,this.size=0}var NU=PU;function CU(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var TU=CU;function $U(e){return this.__data__.get(e)}var IU=$U;function RU(e){return this.__data__.has(e)}var MU=RU,DU=kh,LU=hb,FU=mb,zU=200;function BU(e,t){var r=this.__data__;if(r instanceof DU){var n=r.__data__;if(!LU||n.lengths))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,h=r&u9?new i9:void 0;for(i.set(e,t),i.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=pV}var Cb=hV,mV=Ca,yV=Cb,vV=Ta,gV="[object Arguments]",xV="[object Array]",bV="[object Boolean]",wV="[object Date]",_V="[object Error]",SV="[object Function]",jV="[object Map]",OV="[object Number]",kV="[object Object]",AV="[object RegExp]",EV="[object Set]",PV="[object String]",NV="[object WeakMap]",CV="[object ArrayBuffer]",TV="[object DataView]",$V="[object Float32Array]",IV="[object Float64Array]",RV="[object Int8Array]",MV="[object Int16Array]",DV="[object Int32Array]",LV="[object Uint8Array]",FV="[object Uint8ClampedArray]",zV="[object Uint16Array]",BV="[object Uint32Array]",gt={};gt[$V]=gt[IV]=gt[RV]=gt[MV]=gt[DV]=gt[LV]=gt[FV]=gt[zV]=gt[BV]=!0;gt[gV]=gt[xV]=gt[CV]=gt[bV]=gt[TV]=gt[wV]=gt[_V]=gt[SV]=gt[jV]=gt[OV]=gt[kV]=gt[AV]=gt[EV]=gt[PV]=gt[NV]=!1;function UV(e){return vV(e)&&yV(e.length)&&!!gt[mV(e)]}var VV=UV;function WV(e){return function(t){return e(t)}}var hN=WV,np={exports:{}};np.exports;(function(e,t){var r=wP,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,s=function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(np,np.exports);var HV=np.exports,GV=VV,KV=hN,sS=HV,lS=sS&&sS.isTypedArray,qV=lS?KV(lS):GV,mN=qV,XV=Q9,YV=Pb,ZV=Rr,QV=pN,JV=Nb,eW=mN,tW=Object.prototype,rW=tW.hasOwnProperty;function nW(e,t){var r=ZV(e),n=!r&&YV(e),a=!r&&!n&&QV(e),i=!r&&!n&&!a&&eW(e),o=r||n||a||i,s=o?XV(e.length,String):[],l=s.length;for(var u in e)(t||rW.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||JV(u,l)))&&s.push(u);return s}var aW=nW,iW=Object.prototype;function oW(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||iW;return e===r}var sW=oW;function lW(e,t){return function(r){return e(t(r))}}var yN=lW,uW=yN,cW=uW(Object.keys,Object),fW=cW,dW=sW,pW=fW,hW=Object.prototype,mW=hW.hasOwnProperty;function yW(e){if(!dW(e))return pW(e);var t=[];for(var r in Object(e))mW.call(e,r)&&r!="constructor"&&t.push(r);return t}var vW=yW,gW=db,xW=Cb;function bW(e){return e!=null&&xW(e.length)&&!gW(e)}var qc=bW,wW=aW,_W=vW,SW=qc;function jW(e){return SW(e)?wW(e):_W(e)}var Vh=jW,OW=z9,kW=Y9,AW=Vh;function EW(e){return OW(e,AW,kW)}var PW=EW,uS=PW,NW=1,CW=Object.prototype,TW=CW.hasOwnProperty;function $W(e,t,r,n,a,i){var o=r&NW,s=uS(e),l=s.length,u=uS(t),d=u.length;if(l!=d&&!o)return!1;for(var f=l;f--;){var p=s[f];if(!(o?p in t:TW.call(t,p)))return!1}var h=i.get(e),g=i.get(t);if(h&&g)return h==t&&g==e;var y=!0;i.set(e,t),i.set(t,e);for(var v=o;++f-1}var C7=N7;function T7(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=K7){var u=t?null:H7(e);if(u)return G7(u);o=!1,a=W7,l=new B7}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uG(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cG(e){return e.value}function fG(e,t){if(C.isValidElement(e))return C.cloneElement(e,t);if(typeof e=="function")return C.createElement(e,t);t.ref;var r=lG(t,eG);return C.createElement(Ab,r)}var OS=1,ma=function(e){function t(){var r;tG(this,t);for(var n=arguments.length,a=new Array(n),i=0;iOS||Math.abs(a.height-this.lastBoundingBox.height)>OS)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ta({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,s=a.verticalAlign,l=a.margin,u=a.chartWidth,d=a.chartHeight,f,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var h=this.getBBoxSnapshot();f={left:((u||0)-h.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var g=this.getBBoxSnapshot();p={top:((d||0)-g.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return ta(ta({},f),p)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,s=a.height,l=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=ta(ta({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return C.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){n.wrapperNode=h}},fG(i,ta(ta({},this.props),{},{payload:SN(d,u,cG)})))}}],[{key:"getWithHeight",value:function(n,a){var i=ta(ta({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&ne(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(O.PureComponent);Wh(ma,"displayName","Legend");Wh(ma,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var kS=Kc,dG=Pb,pG=Rr,AS=kS?kS.isConcatSpreadable:void 0;function hG(e){return pG(e)||dG(e)||!!(AS&&e&&e[AS])}var mG=hG,yG=fN,vG=mG;function kN(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=vG),a||(a=[]);++i0&&r(s)?t>1?kN(s,t-1,r,n,a):yG(a,s):n||(a[a.length]=s)}return a}var AN=kN;function gG(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++a];if(r(i[l],l,i)===!1)break}return t}}var xG=gG,bG=xG,wG=bG(),_G=wG,SG=_G,jG=Vh;function OG(e,t){return e&&SG(e,t,jG)}var EN=OG,kG=qc;function AG(e,t){return function(r,n){if(r==null)return r;if(!kG(r))return e(r,n);for(var a=r.length,i=t?a:-1,o=Object(r);(t?i--:++it||i&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!a)return 1;if(!n&&!i&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var BG=zG,by=vb,UG=gb,VG=Zn,WG=PN,HG=MG,GG=hN,KG=BG,qG=xl,XG=Rr;function YG(e,t,r){t.length?t=by(t,function(i){return XG(i)?function(o){return UG(o,i.length===1?i[0]:i)}:i}):t=[qG];var n=-1;t=by(t,GG(VG));var a=WG(e,function(i,o,s){var l=by(t,function(u){return u(i)});return{criteria:l,index:++n,value:i}});return HG(a,function(i,o){return KG(i,o,r)})}var ZG=YG;function QG(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var JG=QG,eK=JG,PS=Math.max;function tK(e,t,r){return t=PS(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=PS(n.length-t,0),o=Array(i);++a0){if(++t>=fK)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var mK=hK,yK=cK,vK=mK,gK=vK(yK),xK=gK,bK=xl,wK=rK,_K=xK;function SK(e,t){return _K(wK(e,t,bK),e+"")}var jK=SK,OK=pb,kK=qc,AK=Nb,EK=_i;function PK(e,t,r){if(!EK(r))return!1;var n=typeof t;return(n=="number"?kK(r)&&AK(t,r.length):n=="string"&&t in r)?OK(r[t],e):!1}var Hh=PK,NK=AN,CK=ZG,TK=jK,CS=Hh,$K=TK(function(e,t){if(e==null)return[];var r=t.length;return r>1&&CS(e,t[0],t[1])?t=[]:r>2&&CS(t[0],t[1],t[2])&&(t=[t[0]]),CK(e,NK(t,1),[])}),IK=$K;const Ib=nt(IK);function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}function Lg(){return Lg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Dl,"-left"),ne(r)&&t&&ne(t.x)&&r=t.y),"".concat(Dl,"-top"),ne(n)&&t&&ne(t.y)&&ny?Math.max(d,l[n]):Math.max(f,l[n])}function XK(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function YK(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,d,f;return o.height>0&&o.width>0&&r?(d=IS({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=IS({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=XK({translateX:d,translateY:f,useTranslate3d:s})):u=KK,{cssProperties:u,cssClasses:qK({translateX:d,translateY:f,coordinate:r})}}function Is(e){"@babel/helpers - typeof";return Is=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Is(e)}function RS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function MS(e){for(var t=1;tDS||Math.abs(n.height-this.state.lastBoundingBox.height)>DS)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,s=a.animationDuration,l=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,p=a.isAnimationActive,h=a.offset,g=a.position,y=a.reverseDirection,v=a.useTranslate3d,x=a.viewBox,m=a.wrapperStyle,w=YK({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:h,position:g,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:x}),_=w.cssClasses,b=w.cssProperties,S=MS(MS({transition:p&&i?"transform ".concat(s,"ms ").concat(l):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},m);return C.createElement("div",{tabIndex:-1,className:_,style:S,ref:function(k){n.wrapperNode=k}},u)}}])}(O.PureComponent),oq=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Si={isSsr:oq()};function Rs(e){"@babel/helpers - typeof";return Rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rs(e)}function LS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function FS(e){for(var t=1;t0;return C.createElement(iq,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:i,coordinate:d,hasPayload:S,offset:h,position:v,reverseDirection:x,useTranslate3d:m,viewBox:w,wrapperStyle:_},yq(u,FS(FS({},this.props),{},{payload:b})))}}])}(O.PureComponent);Rb(yr,"displayName","Tooltip");Rb(yr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Si.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var vq=Yn,gq=function(){return vq.Date.now()},xq=gq,bq=/\s/;function wq(e){for(var t=e.length;t--&&bq.test(e.charAt(t)););return t}var _q=wq,Sq=_q,jq=/^\s+/;function Oq(e){return e&&e.slice(0,Sq(e)+1).replace(jq,"")}var kq=Oq,Aq=kq,zS=_i,Eq=fl,BS=NaN,Pq=/^[-+]0x[0-9a-f]+$/i,Nq=/^0b[01]+$/i,Cq=/^0o[0-7]+$/i,Tq=parseInt;function $q(e){if(typeof e=="number")return e;if(Eq(e))return BS;if(zS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=zS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Aq(e);var r=Nq.test(e);return r||Cq.test(e)?Tq(e.slice(2),r?2:8):Pq.test(e)?BS:+e}var RN=$q,Iq=_i,_y=xq,US=RN,Rq="Expected a function",Mq=Math.max,Dq=Math.min;function Lq(e,t,r){var n,a,i,o,s,l,u=0,d=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(Rq);t=US(t)||0,Iq(r)&&(d=!!r.leading,f="maxWait"in r,i=f?Mq(US(r.maxWait)||0,t):i,p="trailing"in r?!!r.trailing:p);function h(S){var j=n,k=a;return n=a=void 0,u=S,o=e.apply(k,j),o}function g(S){return u=S,s=setTimeout(x,t),d?h(S):o}function y(S){var j=S-l,k=S-u,A=t-j;return f?Dq(A,i-k):A}function v(S){var j=S-l,k=S-u;return l===void 0||j>=t||j<0||f&&k>=i}function x(){var S=_y();if(v(S))return m(S);s=setTimeout(x,y(S))}function m(S){return s=void 0,p&&n?h(S):(n=a=void 0,o)}function w(){s!==void 0&&clearTimeout(s),u=0,n=l=a=s=void 0}function _(){return s===void 0?o:m(_y())}function b(){var S=_y(),j=v(S);if(n=arguments,a=this,l=S,j){if(s===void 0)return g(l);if(f)return clearTimeout(s),s=setTimeout(x,t),h(l)}return s===void 0&&(s=setTimeout(x,t)),o}return b.cancel=w,b.flush=_,b}var Fq=Lq,zq=Fq,Bq=_i,Uq="Expected a function";function Vq(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(Uq);return Bq(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),zq(e,t,{leading:n,maxWait:t,trailing:a})}var Wq=Vq;const MN=nt(Wq);function ic(e){"@babel/helpers - typeof";return ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ic(e)}function VS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Pf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&($=MN($,y,{trailing:!0,leading:!1}));var D=new ResizeObserver($),F=b.current.getBoundingClientRect(),V=F.width,H=F.height;return T(V,H),D.observe(b.current),function(){D.disconnect()}},[T,y]);var N=O.useMemo(function(){var $=A.containerWidth,D=A.containerHeight;if($<0||D<0)return null;Pn(Hi(o)||Hi(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,l),Pn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var F=Hi(o)?$:o,V=Hi(l)?D:l;r&&r>0&&(F?V=F/r:V&&(F=V*r),p&&V>p&&(V=p)),Pn(F>0||V>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,F,V,o,l,d,f,r);var H=!Array.isArray(h)&&ha(h.type).endsWith("Chart");return C.Children.map(h,function(L){return C.isValidElement(L)?O.cloneElement(L,Pf({width:F,height:V},H?{style:Pf({height:"100%",width:"100%",maxHeight:V,maxWidth:F},L.props.style)}:{})):L})},[r,h,l,p,f,d,A,o]);return C.createElement("div",{id:v?"".concat(v):void 0,className:Fe("recharts-responsive-container",x),style:Pf(Pf({},_),{},{width:o,height:l,minWidth:d,minHeight:f,maxHeight:p}),ref:b},N)}),Ji=function(t){return null};Ji.displayName="Cell";function oc(e){"@babel/helpers - typeof";return oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(e)}function HS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ug(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Si.isSsr)return{width:0,height:0};var n=aX(r),a=JSON.stringify({text:t,copyStyle:n});if(To.widthCache[a])return To.widthCache[a];try{var i=document.getElementById(GS);i||(i=document.createElement("span"),i.setAttribute("id",GS),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=Ug(Ug({},nX),n);Object.assign(i.style,o),i.textContent="".concat(t);var s=i.getBoundingClientRect(),l={width:s.width,height:s.height};return To.widthCache[a]=l,++To.cacheCount>rX&&(To.cacheCount=0,To.widthCache={}),l}catch{return{width:0,height:0}}},iX=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function sc(e){"@babel/helpers - typeof";return sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}function sp(e,t){return uX(e)||lX(e,t)||sX(e,t)||oX()}function oX(){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 sX(e,t){if(e){if(typeof e=="string")return KS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return KS(e,t)}}function KS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function JS(e,t){return AX(e)||kX(e,t)||OX(e,t)||jX()}function jX(){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 OX(e,t){if(e){if(typeof e=="string")return ej(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ej(e,t)}}function ej(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(V,H){var L=H.word,U=H.width,K=V[V.length-1];if(K&&(a==null||i||K.width+U+nH.width?V:H})};if(!d)return h;for(var y="…",v=function(F){var V=f.slice(0,F),H=zN({breakAll:u,style:l,children:V+y}).wordsWithComputedWidth,L=p(H),U=L.length>o||g(L).width>Number(a);return[U,L]},x=0,m=f.length-1,w=0,_;x<=m&&w<=f.length-1;){var b=Math.floor((x+m)/2),S=b-1,j=v(S),k=JS(j,2),A=k[0],R=k[1],T=v(b),N=JS(T,1),$=N[0];if(!A&&!$&&(x=b+1),A&&$&&(m=b-1),!A&&$){_=R;break}w++}return _||h},tj=function(t){var r=Ne(t)?[]:t.toString().split(FN);return[{words:r}]},PX=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Si.isSsr){var l,u,d=zN({breakAll:o,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,p=d.spaceWidth;l=f,u=p}else return tj(a);return EX({breakAll:o,children:a,maxLines:s,style:i},l,u,r,n)}return tj(a)},rj="#808080",mo=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,d=t.scaleToFit,f=d===void 0?!1:d,p=t.textAnchor,h=p===void 0?"start":p,g=t.verticalAnchor,y=g===void 0?"end":g,v=t.fill,x=v===void 0?rj:v,m=QS(t,wX),w=O.useMemo(function(){return PX({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:f,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,f,m.style,m.width]),_=m.dx,b=m.dy,S=m.angle,j=m.className,k=m.breakAll,A=QS(m,_X);if(!Kt(n)||!Kt(i))return null;var R=n+(ne(_)?_:0),T=i+(ne(b)?b:0),N;switch(y){case"start":N=Sy("calc(".concat(u,")"));break;case"middle":N=Sy("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:N=Sy("calc(".concat(w.length-1," * -").concat(s,")"));break}var $=[];if(f){var D=w[0].width,F=m.width;$.push("scale(".concat((ne(F)?F/D:1)/D,")"))}return S&&$.push("rotate(".concat(S,", ").concat(R,", ").concat(T,")")),$.length&&(A.transform=$.join(" ")),C.createElement("text",Vg({},xe(A,!0),{x:R,y:T,className:Fe("recharts-text",j),textAnchor:h,fill:x.includes("url")?rj:x}),w.map(function(V,H){var L=V.words.join(k?"":" ");return C.createElement("tspan",{x:R,dy:H===0?N:s,key:"".concat(L,"-").concat(H)},L)}))};function fi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function NX(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Mb(e){let t,r,n;e.length!==2?(t=fi,r=(s,l)=>fi(e(s),l),n=(s,l)=>e(s)-l):(t=e===fi||e===NX?e:CX,r=e,n=e);function a(s,l,u=0,d=s.length){if(u>>1;r(s[f],l)<0?u=f+1:d=f}while(u>>1;r(s[f],l)<=0?u=f+1:d=f}while(uu&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:a,center:o,right:i}}function CX(){return 0}function BN(e){return e===null?NaN:+e}function*TX(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const $X=Mb(fi),Xc=$X.right;Mb(BN).center;class nj extends Map{constructor(t,r=MX){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(aj(this,t))}has(t){return super.has(aj(this,t))}set(t,r){return super.set(IX(this,t),r)}delete(t){return super.delete(RX(this,t))}}function aj({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function IX({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function RX({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function MX(e){return e!==null&&typeof e=="object"?e.valueOf():e}function DX(e=fi){if(e===fi)return UN;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function UN(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const LX=Math.sqrt(50),FX=Math.sqrt(10),zX=Math.sqrt(2);function lp(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=LX?10:i>=FX?5:i>=zX?2:1;let s,l,u;return a<0?(u=Math.pow(10,-a)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,a)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=a))return[];const s=i-a+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function oj(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function VN(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?UN:DX(a);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,d=Math.log(l),f=.5*Math.exp(2*d/3),p=.5*Math.sqrt(d*f*(l-f)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*f/l+p)),g=Math.min(n,Math.floor(t+(l-u)*f/l+p));VN(e,t,h,g,a)}const i=e[t];let o=r,s=n;for(Ll(e,r,t),a(e[n],i)>0&&Ll(e,r,n);o0;)--s}a(e[r],i)===0?Ll(e,r,s):(++s,Ll(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Ll(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function BX(e,t,r){if(e=Float64Array.from(TX(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return oj(e);if(t>=1)return ij(e);var n,a=(n-1)*t,i=Math.floor(a),o=ij(VN(e,i).subarray(0,i+1)),s=oj(e.subarray(i+1));return o+(s-o)*(a-i)}}function UX(e,t,r=BN){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),s=+r(e[i+1],i+1,e);return o+(s-o)*(a-i)}}function VX(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Cf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Cf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=HX.exec(e))?new Nr(t[1],t[2],t[3],1):(t=GX.exec(e))?new Nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=KX.exec(e))?Cf(t[1],t[2],t[3],t[4]):(t=qX.exec(e))?Cf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XX.exec(e))?pj(t[1],t[2]/100,t[3]/100,1):(t=YX.exec(e))?pj(t[1],t[2]/100,t[3]/100,t[4]):sj.hasOwnProperty(e)?cj(sj[e]):e==="transparent"?new Nr(NaN,NaN,NaN,0):null}function cj(e){return new Nr(e>>16&255,e>>8&255,e&255,1)}function Cf(e,t,r,n){return n<=0&&(e=t=r=NaN),new Nr(e,t,r,n)}function JX(e){return e instanceof Yc||(e=fc(e)),e?(e=e.rgb(),new Nr(e.r,e.g,e.b,e.opacity)):new Nr}function qg(e,t,r,n){return arguments.length===1?JX(e):new Nr(e,t,r,n??1)}function Nr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Lb(Nr,qg,HN(Yc,{brighter(e){return e=e==null?up:Math.pow(up,e),new Nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?uc:Math.pow(uc,e),new Nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nr(eo(this.r),eo(this.g),eo(this.b),cp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fj,formatHex:fj,formatHex8:eY,formatRgb:dj,toString:dj}));function fj(){return`#${Gi(this.r)}${Gi(this.g)}${Gi(this.b)}`}function eY(){return`#${Gi(this.r)}${Gi(this.g)}${Gi(this.b)}${Gi((isNaN(this.opacity)?1:this.opacity)*255)}`}function dj(){const e=cp(this.opacity);return`${e===1?"rgb(":"rgba("}${eo(this.r)}, ${eo(this.g)}, ${eo(this.b)}${e===1?")":`, ${e})`}`}function cp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gi(e){return e=eo(e),(e<16?"0":"")+e.toString(16)}function pj(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new kn(e,t,r,n)}function GN(e){if(e instanceof kn)return new kn(e.h,e.s,e.l,e.opacity);if(e instanceof Yc||(e=fc(e)),!e)return new kn;if(e instanceof kn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,s=i-a,l=(i+a)/2;return s?(t===i?o=(r-n)/s+(r0&&l<1?0:o,new kn(o,s,l,e.opacity)}function tY(e,t,r,n){return arguments.length===1?GN(e):new kn(e,t,r,n??1)}function kn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Lb(kn,tY,HN(Yc,{brighter(e){return e=e==null?up:Math.pow(up,e),new kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?uc:Math.pow(uc,e),new kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Nr(jy(e>=240?e-240:e+120,a,n),jy(e,a,n),jy(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new kn(hj(this.h),Tf(this.s),Tf(this.l),cp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=cp(this.opacity);return`${e===1?"hsl(":"hsla("}${hj(this.h)}, ${Tf(this.s)*100}%, ${Tf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function hj(e){return e=(e||0)%360,e<0?e+360:e}function Tf(e){return Math.max(0,Math.min(1,e||0))}function jy(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Fb=e=>()=>e;function rY(e,t){return function(r){return e+r*t}}function nY(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function aY(e){return(e=+e)==1?KN:function(t,r){return r-t?nY(t,r,e):Fb(isNaN(t)?r:t)}}function KN(e,t){var r=t-e;return r?rY(e,r):Fb(isNaN(e)?t:e)}const mj=function e(t){var r=aY(t);function n(a,i){var o=r((a=qg(a)).r,(i=qg(i)).r),s=r(a.g,i.g),l=r(a.b,i.b),u=KN(a.opacity,i.opacity);return function(d){return a.r=o(d),a.g=s(d),a.b=l(d),a.opacity=u(d),a+""}}return n.gamma=e,n}(1);function iY(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;ar&&(i=t.slice(r,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,l.push({i:o,x:fp(n,a)})),r=Oy.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function yY(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a2?vY:yY,l=u=null,f}function f(p){return p==null||isNaN(p=+p)?i:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return f.invert=function(p){return o(a((u||(u=s(t,e.map(n),fp)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,dp),d()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),r=zb,d()},f.clamp=function(p){return arguments.length?(o=p?!0:br,d()):o!==br},f.interpolate=function(p){return arguments.length?(r=p,d()):r},f.unknown=function(p){return arguments.length?(i=p,f):i},function(p,h){return n=p,a=h,d()}}function Bb(){return Gh()(br,br)}function gY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function pp(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ms(e){return e=pp(Math.abs(e)),e?e[1]:NaN}function xY(e,t){return function(r,n){for(var a=r.length,i=[],o=0,s=e[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),i.push(r.substring(a-=s,a+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function bY(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var wY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dc(e){if(!(t=wY.exec(e)))throw new Error("invalid format: "+e);var t;return new Ub({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}dc.prototype=Ub.prototype;function Ub(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ub.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _Y(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var hp;function SY(e,t){var r=pp(e,t);if(!r)return hp=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(hp=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+pp(e,Math.max(0,t+i-1))[0]}function vj(e,t){var r=pp(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const gj={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:gY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vj(e*100,t),r:vj,s:SY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function xj(e){return e}var bj=Array.prototype.map,wj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function jY(e){var t=e.grouping===void 0||e.thousands===void 0?xj:xY(bj.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?xj:bY(bj.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,p){f=dc(f);var h=f.fill,g=f.align,y=f.sign,v=f.symbol,x=f.zero,m=f.width,w=f.comma,_=f.precision,b=f.trim,S=f.type;S==="n"?(w=!0,S="g"):gj[S]||(_===void 0&&(_=12),b=!0,S="g"),(x||h==="0"&&g==="=")&&(x=!0,h="0",g="=");var j=(p&&p.prefix!==void 0?p.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),k=(v==="$"?n:/[%p]/.test(S)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),A=gj[S],R=/[defgprs%]/.test(S);_=_===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function T(N){var $=j,D=k,F,V,H;if(S==="c")D=A(N)+D,N="";else{N=+N;var L=N<0||1/N<0;if(N=isNaN(N)?l:A(Math.abs(N),_),b&&(N=_Y(N)),L&&+N==0&&y!=="+"&&(L=!1),$=(L?y==="("?y:s:y==="-"||y==="("?"":y)+$,D=(S==="s"&&!isNaN(N)&&hp!==void 0?wj[8+hp/3]:"")+D+(L&&y==="("?")":""),R){for(F=-1,V=N.length;++FH||H>57){D=(H===46?a+N.slice(F+1):N.slice(F))+D,N=N.slice(0,F);break}}}w&&!x&&(N=t(N,1/0));var U=$.length+N.length+D.length,K=U>1)+$+N+D+K.slice(U);break;default:N=K+$+N+D;break}return i(N)}return T.toString=function(){return f+""},T}function d(f,p){var h=Math.max(-8,Math.min(8,Math.floor(Ms(p)/3)))*3,g=Math.pow(10,-h),y=u((f=dc(f),f.type="f",f),{suffix:wj[8+h/3]});return function(v){return y(g*v)}}return{format:u,formatPrefix:d}}var $f,Vb,qN;OY({thousands:",",grouping:[3],currency:["$",""]});function OY(e){return $f=jY(e),Vb=$f.format,qN=$f.formatPrefix,$f}function kY(e){return Math.max(0,-Ms(Math.abs(e)))}function AY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ms(t)/3)))*3-Ms(Math.abs(e)))}function EY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ms(t)-Ms(e))+1}function XN(e,t,r,n){var a=Gg(e,t,r),i;switch(n=dc(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=AY(a,o))&&(n.precision=i),qN(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=EY(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=kY(a))&&(n.precision=i-(n.type==="%")*2);break}}return Vb(n)}function ji(e){var t=e.domain;return e.ticks=function(r){var n=t();return Wg(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return XN(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],s=n[i],l,u,d=10;for(s0;){if(u=Hg(o,s,r),u===l)return n[a]=o,n[i]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function mp(){var e=Bb();return e.copy=function(){return Zc(e,mp())},yn.apply(e,arguments),ji(e)}function YN(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,dp),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return YN(e).unknown(t)},e=arguments.length?Array.from(e,dp):[0,1],ji(r)}function ZN(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return iMath.pow(e,t)}function $Y(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function jj(e){return(t,r)=>-e(-t,r)}function Wb(e){const t=e(_j,Sj),r=t.domain;let n=10,a,i;function o(){return a=$Y(n),i=TY(n),r()[0]<0?(a=jj(a),i=jj(i),e(PY,NY)):e(_j,Sj),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],d=l[l.length-1];const f=d0){for(;p<=h;++p)for(g=1;gd)break;x.push(y)}}else for(;p<=h;++p)for(g=n-1;g>=1;--g)if(y=p>0?g/i(-p):g*i(p),!(yd)break;x.push(y)}x.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=dc(l)).precision==null&&(l.trim=!0),l=Vb(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*nr(ZN(r(),{floor:s=>i(Math.floor(a(s))),ceil:s=>i(Math.ceil(a(s)))})),t}function QN(){const e=Wb(Gh()).domain([1,10]);return e.copy=()=>Zc(e,QN()).base(e.base()),yn.apply(e,arguments),e}function Oj(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function kj(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Hb(e){var t=1,r=e(Oj(t),kj(t));return r.constant=function(n){return arguments.length?e(Oj(t=+n),kj(t)):t},ji(r)}function JN(){var e=Hb(Gh());return e.copy=function(){return Zc(e,JN()).constant(e.constant())},yn.apply(e,arguments)}function Aj(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function IY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function RY(e){return e<0?-e*e:e*e}function Gb(e){var t=e(br,br),r=1;function n(){return r===1?e(br,br):r===.5?e(IY,RY):e(Aj(r),Aj(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},ji(t)}function Kb(){var e=Gb(Gh());return e.copy=function(){return Zc(e,Kb()).exponent(e.exponent())},yn.apply(e,arguments),e}function MY(){return Kb.apply(null,arguments).exponent(.5)}function Ej(e){return Math.sign(e)*e*e}function DY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function eC(){var e=Bb(),t=[0,1],r=!1,n;function a(i){var o=DY(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(Ej(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,dp)).map(Ej)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return eC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},yn.apply(a,arguments),ji(a)}function tC(){var e=[],t=[],r=[],n;function a(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(i=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return rC().domain([e,t]).range(a).unknown(i)},yn.apply(ji(o),arguments)}function nC(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[Xc(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return nC().domain(e).range(t).unknown(r)},yn.apply(a,arguments)}const ky=new Date,Ay=new Date;function qt(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),s=a.ceil(i);return i-o(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,s)=>{const l=[];if(i=a.ceil(i),s=s==null?1:Math.floor(s),!(i0))return l;let u;do l.push(u=new Date(+i)),t(i,s),e(i);while(uqt(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!i(o););else for(;--s>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(ky.setTime(+i),Ay.setTime(+o),e(ky),e(Ay),Math.floor(r(ky,Ay))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const yp=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);yp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):yp);yp.range;const ca=1e3,un=ca*60,fa=un*60,Sa=fa*24,qb=Sa*7,Pj=Sa*30,Ey=Sa*365,Ki=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ca)},(e,t)=>(t-e)/ca,e=>e.getUTCSeconds());Ki.range;const Xb=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ca)},(e,t)=>{e.setTime(+e+t*un)},(e,t)=>(t-e)/un,e=>e.getMinutes());Xb.range;const Yb=qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*un)},(e,t)=>(t-e)/un,e=>e.getUTCMinutes());Yb.range;const Zb=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ca-e.getMinutes()*un)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getHours());Zb.range;const Qb=qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getUTCHours());Qb.range;const Qc=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*un)/Sa,e=>e.getDate()-1);Qc.range;const Kh=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Sa,e=>e.getUTCDate()-1);Kh.range;const aC=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Sa,e=>Math.floor(e/Sa));aC.range;function Oo(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*un)/qb)}const qh=Oo(0),vp=Oo(1),LY=Oo(2),FY=Oo(3),Ds=Oo(4),zY=Oo(5),BY=Oo(6);qh.range;vp.range;LY.range;FY.range;Ds.range;zY.range;BY.range;function ko(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/qb)}const Xh=ko(0),gp=ko(1),UY=ko(2),VY=ko(3),Ls=ko(4),WY=ko(5),HY=ko(6);Xh.range;gp.range;UY.range;VY.range;Ls.range;WY.range;HY.range;const Jb=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Jb.range;const ew=qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ew.range;const ja=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ja.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});ja.range;const Oa=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Oa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Oa.range;function iC(e,t,r,n,a,i){const o=[[Ki,1,ca],[Ki,5,5*ca],[Ki,15,15*ca],[Ki,30,30*ca],[i,1,un],[i,5,5*un],[i,15,15*un],[i,30,30*un],[a,1,fa],[a,3,3*fa],[a,6,6*fa],[a,12,12*fa],[n,1,Sa],[n,2,2*Sa],[r,1,qb],[t,1,Pj],[t,3,3*Pj],[e,1,Ey]];function s(u,d,f){const p=dv).right(o,p);if(h===o.length)return e.every(Gg(u/Ey,d/Ey,f));if(h===0)return yp.every(Math.max(Gg(u,d,f),1));const[g,y]=o[p/o[h-1][2]53)return null;"w"in X||(X.w=1),"Z"in X?(ge=Ny(Fl(X.y,0,1)),_e=ge.getUTCDay(),ge=_e>4||_e===0?gp.ceil(ge):gp(ge),ge=Kh.offset(ge,(X.V-1)*7),X.y=ge.getUTCFullYear(),X.m=ge.getUTCMonth(),X.d=ge.getUTCDate()+(X.w+6)%7):(ge=Py(Fl(X.y,0,1)),_e=ge.getDay(),ge=_e>4||_e===0?vp.ceil(ge):vp(ge),ge=Qc.offset(ge,(X.V-1)*7),X.y=ge.getFullYear(),X.m=ge.getMonth(),X.d=ge.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),_e="Z"in X?Ny(Fl(X.y,0,1)).getUTCDay():Py(Fl(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(_e+5)%7:X.w+X.U*7-(_e+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,Ny(X)):Py(X)}}function k(te,oe,he,X){for(var Oe=0,ge=oe.length,_e=he.length,Ce,we;Oe=_e)return-1;if(Ce=oe.charCodeAt(Oe++),Ce===37){if(Ce=oe.charAt(Oe++),we=b[Ce in Nj?oe.charAt(Oe++):Ce],!we||(X=we(te,he,X))<0)return-1}else if(Ce!=he.charCodeAt(X++))return-1}return X}function A(te,oe,he){var X=u.exec(oe.slice(he));return X?(te.p=d.get(X[0].toLowerCase()),he+X[0].length):-1}function R(te,oe,he){var X=h.exec(oe.slice(he));return X?(te.w=g.get(X[0].toLowerCase()),he+X[0].length):-1}function T(te,oe,he){var X=f.exec(oe.slice(he));return X?(te.w=p.get(X[0].toLowerCase()),he+X[0].length):-1}function N(te,oe,he){var X=x.exec(oe.slice(he));return X?(te.m=m.get(X[0].toLowerCase()),he+X[0].length):-1}function $(te,oe,he){var X=y.exec(oe.slice(he));return X?(te.m=v.get(X[0].toLowerCase()),he+X[0].length):-1}function D(te,oe,he){return k(te,t,oe,he)}function F(te,oe,he){return k(te,r,oe,he)}function V(te,oe,he){return k(te,n,oe,he)}function H(te){return o[te.getDay()]}function L(te){return i[te.getDay()]}function U(te){return l[te.getMonth()]}function K(te){return s[te.getMonth()]}function Q(te){return a[+(te.getHours()>=12)]}function G(te){return 1+~~(te.getMonth()/3)}function re(te){return o[te.getUTCDay()]}function Z(te){return i[te.getUTCDay()]}function pe(te){return l[te.getUTCMonth()]}function ce(te){return s[te.getUTCMonth()]}function Ee(te){return a[+(te.getUTCHours()>=12)]}function Ie(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var oe=S(te+="",w);return oe.toString=function(){return te},oe},parse:function(te){var oe=j(te+="",!1);return oe.toString=function(){return te},oe},utcFormat:function(te){var oe=S(te+="",_);return oe.toString=function(){return te},oe},utcParse:function(te){var oe=j(te+="",!0);return oe.toString=function(){return te},oe}}}var Nj={"-":"",_:" ",0:"0"},er=/^\s*\d+/,ZY=/^%/,QY=/[\\^$*+?|[\]().{}]/g;function Je(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i[t.toLowerCase(),r]))}function eZ(e,t,r){var n=er.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function tZ(e,t,r){var n=er.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function rZ(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function nZ(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function aZ(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Cj(e,t,r){var n=er.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Tj(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function iZ(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function oZ(e,t,r){var n=er.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function sZ(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function $j(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function lZ(e,t,r){var n=er.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Ij(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function uZ(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function cZ(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function fZ(e,t,r){var n=er.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function dZ(e,t,r){var n=er.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function pZ(e,t,r){var n=ZY.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function hZ(e,t,r){var n=er.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function mZ(e,t,r){var n=er.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Rj(e,t){return Je(e.getDate(),t,2)}function yZ(e,t){return Je(e.getHours(),t,2)}function vZ(e,t){return Je(e.getHours()%12||12,t,2)}function gZ(e,t){return Je(1+Qc.count(ja(e),e),t,3)}function oC(e,t){return Je(e.getMilliseconds(),t,3)}function xZ(e,t){return oC(e,t)+"000"}function bZ(e,t){return Je(e.getMonth()+1,t,2)}function wZ(e,t){return Je(e.getMinutes(),t,2)}function _Z(e,t){return Je(e.getSeconds(),t,2)}function SZ(e){var t=e.getDay();return t===0?7:t}function jZ(e,t){return Je(qh.count(ja(e)-1,e),t,2)}function sC(e){var t=e.getDay();return t>=4||t===0?Ds(e):Ds.ceil(e)}function OZ(e,t){return e=sC(e),Je(Ds.count(ja(e),e)+(ja(e).getDay()===4),t,2)}function kZ(e){return e.getDay()}function AZ(e,t){return Je(vp.count(ja(e)-1,e),t,2)}function EZ(e,t){return Je(e.getFullYear()%100,t,2)}function PZ(e,t){return e=sC(e),Je(e.getFullYear()%100,t,2)}function NZ(e,t){return Je(e.getFullYear()%1e4,t,4)}function CZ(e,t){var r=e.getDay();return e=r>=4||r===0?Ds(e):Ds.ceil(e),Je(e.getFullYear()%1e4,t,4)}function TZ(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Je(t/60|0,"0",2)+Je(t%60,"0",2)}function Mj(e,t){return Je(e.getUTCDate(),t,2)}function $Z(e,t){return Je(e.getUTCHours(),t,2)}function IZ(e,t){return Je(e.getUTCHours()%12||12,t,2)}function RZ(e,t){return Je(1+Kh.count(Oa(e),e),t,3)}function lC(e,t){return Je(e.getUTCMilliseconds(),t,3)}function MZ(e,t){return lC(e,t)+"000"}function DZ(e,t){return Je(e.getUTCMonth()+1,t,2)}function LZ(e,t){return Je(e.getUTCMinutes(),t,2)}function FZ(e,t){return Je(e.getUTCSeconds(),t,2)}function zZ(e){var t=e.getUTCDay();return t===0?7:t}function BZ(e,t){return Je(Xh.count(Oa(e)-1,e),t,2)}function uC(e){var t=e.getUTCDay();return t>=4||t===0?Ls(e):Ls.ceil(e)}function UZ(e,t){return e=uC(e),Je(Ls.count(Oa(e),e)+(Oa(e).getUTCDay()===4),t,2)}function VZ(e){return e.getUTCDay()}function WZ(e,t){return Je(gp.count(Oa(e)-1,e),t,2)}function HZ(e,t){return Je(e.getUTCFullYear()%100,t,2)}function GZ(e,t){return e=uC(e),Je(e.getUTCFullYear()%100,t,2)}function KZ(e,t){return Je(e.getUTCFullYear()%1e4,t,4)}function qZ(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ls(e):Ls.ceil(e),Je(e.getUTCFullYear()%1e4,t,4)}function XZ(){return"+0000"}function Dj(){return"%"}function Lj(e){return+e}function Fj(e){return Math.floor(+e/1e3)}var $o,cC,fC;YZ({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function YZ(e){return $o=YY(e),cC=$o.format,$o.parse,fC=$o.utcFormat,$o.utcParse,$o}function ZZ(e){return new Date(e)}function QZ(e){return e instanceof Date?+e:+new Date(+e)}function tw(e,t,r,n,a,i,o,s,l,u){var d=Bb(),f=d.invert,p=d.domain,h=u(".%L"),g=u(":%S"),y=u("%I:%M"),v=u("%I %p"),x=u("%a %d"),m=u("%b %d"),w=u("%B"),_=u("%Y");function b(S){return(l(S)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>BX(e,i/n))},r.copy=function(){return mC(t).domain(e)},$a.apply(r,arguments)}function Zh(){var e=0,t=.5,r=1,n=1,a,i,o,s,l,u=br,d,f=!1,p;function h(y){return isNaN(y=+y)?p:(y=.5+((y=+d(y))-i)*(n*yt}var xC=iQ,oQ=Qh,sQ=xC,lQ=xl;function uQ(e){return e&&e.length?oQ(e,lQ,sQ):void 0}var cQ=uQ;const Qa=nt(cQ);function fQ(e,t){return ee.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};de.decimalPlaces=de.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};de.dividedBy=de.div=function(e){return ya(this,new this.constructor(e))};de.dividedToIntegerBy=de.idiv=function(e){var t=this,r=t.constructor;return ut(ya(t,new r(e),0,1),r.precision)};de.equals=de.eq=function(e){return!this.cmp(e)};de.exponent=function(){return Ft(this)};de.greaterThan=de.gt=function(e){return this.cmp(e)>0};de.greaterThanOrEqualTo=de.gte=function(e){return this.cmp(e)>=0};de.isInteger=de.isint=function(){return this.e>this.d.length-2};de.isNegative=de.isneg=function(){return this.s<0};de.isPositive=de.ispos=function(){return this.s>0};de.isZero=function(){return this.s===0};de.lessThan=de.lt=function(e){return this.cmp(e)<0};de.lessThanOrEqualTo=de.lte=function(e){return this.cmp(e)<1};de.logarithm=de.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Br))throw Error(pn+"NaN");if(r.s<1)throw Error(pn+(r.s?"NaN":"-Infinity"));return r.eq(Br)?new n(0):(St=!1,t=ya(pc(r,i),pc(e,i),i),St=!0,ut(t,a))};de.minus=de.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?jC(t,e):_C(t,(e.s=-e.s,e))};de.modulo=de.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(pn+"NaN");return r.s?(St=!1,t=ya(r,e,0,1).times(e),St=!0,r.minus(t)):ut(new n(r),a)};de.naturalExponential=de.exp=function(){return SC(this)};de.naturalLogarithm=de.ln=function(){return pc(this)};de.negated=de.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};de.plus=de.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_C(t,e):jC(t,(e.s=-e.s,e))};de.precision=de.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(to+e);if(t=Ft(a)+1,n=a.d.length-1,r=n*xt+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};de.squareRoot=de.sqrt=function(){var e,t,r,n,a,i,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(pn+"NaN")}for(e=Ft(s),St=!1,a=Math.sqrt(+s),a==0||a==1/0?(t=Fn(s.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=_l((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(a.toString()),r=l.precision,a=o=r+3;;)if(i=n,n=i.plus(ya(s,i,o+2)).times(.5),Fn(i.d).slice(0,o)===(t=Fn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(ut(i,r+1,0),i.times(i).eq(s)){n=i;break}}else if(t!="9999")break;o+=4}return St=!0,ut(n,r)};de.times=de.mul=function(e){var t,r,n,a,i,o,s,l,u,d=this,f=d.constructor,p=d.d,h=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,l=p.length,u=h.length,l=0;){for(t=0,a=l+n;a>n;)s=i[a]+h[n]*p[a-n-1]+t,i[a--]=s%Xt|0,t=s/Xt|0;i[a]=(i[a]+t)%Xt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,St?ut(e,f.precision):e};de.toDecimalPlaces=de.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(qn(e,0,wl),t===void 0?t=n.rounding:qn(t,0,8),ut(r,e+Ft(r)+1,t))};de.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=vo(n,!0):(qn(e,0,wl),t===void 0?t=a.rounding:qn(t,0,8),n=ut(new a(n),e+1,t),r=vo(n,!0,e+1)),r};de.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?vo(a):(qn(e,0,wl),t===void 0?t=i.rounding:qn(t,0,8),n=ut(new i(a),e+Ft(a)+1,t),r=vo(n.abs(),!1,e+Ft(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};de.toInteger=de.toint=function(){var e=this,t=e.constructor;return ut(new t(e),Ft(e)+1,t.rounding)};de.toNumber=function(){return+this};de.toPower=de.pow=function(e){var t,r,n,a,i,o,s=this,l=s.constructor,u=12,d=+(e=new l(e));if(!e.s)return new l(Br);if(s=new l(s),!s.s){if(e.s<1)throw Error(pn+"Infinity");return s}if(s.eq(Br))return s;if(n=l.precision,e.eq(Br))return ut(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=s.s,o){if((r=d<0?-d:d)<=wC){for(a=new l(Br),t=Math.ceil(n/xt+4),St=!1;r%2&&(a=a.times(s),Uj(a.d,t)),r=_l(r/2),r!==0;)s=s.times(s),Uj(s.d,t);return St=!0,e.s<0?new l(Br).div(a):ut(a,n)}}else if(i<0)throw Error(pn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,St=!1,a=e.times(pc(s,n+u)),St=!0,a=SC(a),a.s=i,a};de.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=Ft(a),n=vo(a,r<=i.toExpNeg||r>=i.toExpPos)):(qn(e,1,wl),t===void 0?t=i.rounding:qn(t,0,8),a=ut(new i(a),e,t),r=Ft(a),n=vo(a,e<=r||r<=i.toExpNeg,e)),n};de.toSignificantDigits=de.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(qn(e,1,wl),t===void 0?t=n.rounding:qn(t,0,8)),ut(new n(r),e,t)};de.toString=de.valueOf=de.val=de.toJSON=de[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ft(e),r=e.constructor;return vo(e,t<=r.toExpNeg||t>=r.toExpPos)};function _C(e,t){var r,n,a,i,o,s,l,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),St?ut(t,f):t;if(l=e.d,u=t.d,o=e.e,a=t.e,l=l.slice(),i=o-a,i){for(i<0?(n=l,i=-i,s=u.length):(n=u,a=o,s=l.length),o=Math.ceil(f/xt),s=o>s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,n=u,u=l,l=n),r=0;i;)r=(l[--i]=l[i]+u[i]+r)/Xt|0,l[i]%=Xt;for(r&&(l.unshift(r),++a),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=a,St?ut(t,f):t}function qn(e,t,r){if(e!==~~e||er)throw Error(to+e)}function Fn(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;to?1:-1;else for(s=l=0;sa[s]?1:-1;break}return l}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]1;)n.shift()}return function(n,a,i,o){var s,l,u,d,f,p,h,g,y,v,x,m,w,_,b,S,j,k,A=n.constructor,R=n.s==a.s?1:-1,T=n.d,N=a.d;if(!n.s)return new A(n);if(!a.s)throw Error(pn+"Division by zero");for(l=n.e-a.e,j=N.length,b=T.length,h=new A(R),g=h.d=[],u=0;N[u]==(T[u]||0);)++u;if(N[u]>(T[u]||0)&&--l,i==null?m=i=A.precision:o?m=i+(Ft(n)-Ft(a))+1:m=i,m<0)return new A(0);if(m=m/xt+2|0,u=0,j==1)for(d=0,N=N[0],m++;(u1&&(N=e(N,d),T=e(T,d),j=N.length,b=T.length),_=j,y=T.slice(0,j),v=y.length;v=Xt/2&&++S;do d=0,s=t(N,y,j,v),s<0?(x=y[0],j!=v&&(x=x*Xt+(y[1]||0)),d=x/S|0,d>1?(d>=Xt&&(d=Xt-1),f=e(N,d),p=f.length,v=y.length,s=t(f,y,p,v),s==1&&(d--,r(f,j16)throw Error(aw+Ft(e));if(!e.s)return new d(Br);for(St=!1,s=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Fi(2,u))/Math.LN10*2+5|0,s+=n,r=a=i=new d(Br),d.precision=s;;){if(a=ut(a.times(e),s),r=r.times(++l),o=i.plus(ya(a,r,s)),Fn(o.d).slice(0,s)===Fn(i.d).slice(0,s)){for(;u--;)i=ut(i.times(i),s);return d.precision=f,t==null?(St=!0,ut(i,f)):i}i=o}}function Ft(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function Cy(e,t,r){if(t>e.LN10.sd())throw St=!0,r&&(e.precision=r),Error(pn+"LN10 precision limit exceeded");return ut(new e(e.LN10),t)}function Wa(e){for(var t="";e--;)t+="0";return t}function pc(e,t){var r,n,a,i,o,s,l,u,d,f=1,p=10,h=e,g=h.d,y=h.constructor,v=y.precision;if(h.s<1)throw Error(pn+(h.s?"NaN":"-Infinity"));if(h.eq(Br))return new y(0);if(t==null?(St=!1,u=v):u=t,h.eq(10))return t==null&&(St=!0),Cy(y,u);if(u+=p,y.precision=u,r=Fn(g),n=r.charAt(0),i=Ft(h),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Fn(h.d),n=r.charAt(0),f++;i=Ft(h),n>1?(h=new y("0."+r),i++):h=new y(n+"."+r.slice(1))}else return l=Cy(y,u+2,v).times(i+""),h=pc(new y(n+"."+r.slice(1)),u-p).plus(l),y.precision=v,t==null?(St=!0,ut(h,v)):h;for(s=o=h=ya(h.minus(Br),h.plus(Br),u),d=ut(h.times(h),u),a=3;;){if(o=ut(o.times(d),u),l=s.plus(ya(o,new y(a),u)),Fn(l.d).slice(0,u)===Fn(s.d).slice(0,u))return s=s.times(2),i!==0&&(s=s.plus(Cy(y,u+2,v).times(i+""))),s=ya(s,new y(f),u),y.precision=v,t==null?(St=!0,ut(s,v)):s;s=l,a+=2}}function Bj(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=_l(r/xt),e.d=[],n=(r+1)%xt,r<0&&(n+=xt),nxp||e.e<-xp))throw Error(aw+r)}else e.s=0,e.e=0,e.d=[0];return e}function ut(e,t,r){var n,a,i,o,s,l,u,d,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=xt,a=t,u=f[d=0];else{if(d=Math.ceil((n+1)/xt),i=f.length,d>=i)return e;for(u=i=f[d],o=1;i>=10;i/=10)o++;n%=xt,a=n-xt+o}if(r!==void 0&&(i=Fi(10,o-a-1),s=u/i%10|0,l=t<0||f[d+1]!==void 0||u%i,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?a>0?u/Fi(10,o-a):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(i=Ft(e),f.length=1,t=t-i-1,f[0]=Fi(10,(xt-t%xt)%xt),e.e=_l(-t/xt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,i=1,d--):(f.length=d+1,i=Fi(10,xt-n),f[d]=a>0?(u/Fi(10,o-a)%Fi(10,a)|0)*i:0),l)for(;;)if(d==0){(f[0]+=i)==Xt&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=Xt)break;f[d--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(St&&(e.e>xp||e.e<-xp))throw Error(aw+Ft(e));return e}function jC(e,t){var r,n,a,i,o,s,l,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),St?ut(t,h):t;if(l=e.d,f=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(d=o<0,d?(r=l,o=-o,s=f.length):(r=f,n=u,s=l.length),a=Math.max(Math.ceil(h/xt),s)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=l.length,s=f.length,d=a0;--a)l[s++]=0;for(a=f.length;a>o;){if(l[--a]0?i=i.charAt(0)+"."+i.slice(1)+Wa(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Wa(-a-1)+i,r&&(n=r-o)>0&&(i+=Wa(n))):a>=o?(i+=Wa(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+Wa(n))):((n=a+1)0&&(a+1===o&&(i+="."),i+=Wa(n))),e.s<0?"-"+i:i}function Uj(e,t){if(e.length>t)return e.length=t,!0}function OC(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(to+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return Bj(o,i.toString())}else if(typeof i!="string")throw Error(to+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,TQ.test(i))Bj(o,i);else throw Error(to+i)}if(a.prototype=de,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=OC,a.config=a.set=$Q,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(to+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(to+r+": "+n);return this}var iw=OC(CQ);Br=new iw(1);const st=iw;function IQ(e){return LQ(e)||DQ(e)||MQ(e)||RQ()}function RQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MQ(e,t){if(e){if(typeof e=="string")return Zg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zg(e,t)}}function DQ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function LQ(e){if(Array.isArray(e))return Zg(e)}function Zg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-o,Vj(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){a=!0,i=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function JQ(e){if(Array.isArray(e))return e}function NC(e){var t=hc(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function CC(e,t,r){if(e.lte(0))return new st(0);var n=tm.getDigitCount(e.toNumber()),a=new st(10).pow(n),i=e.div(a),o=n!==1?.05:.1,s=new st(Math.ceil(i.div(o).toNumber())).add(r).mul(o),l=s.mul(a);return t?l:new st(Math.ceil(l))}function eJ(e,t,r){var n=1,a=new st(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new st(10).pow(tm.getDigitCount(e)-1),a=new st(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new st(Math.floor(e)))}else e===0?a=new st(Math.floor((t-1)/2)):r||(a=new st(Math.floor(e)));var o=Math.floor((t-1)/2),s=UQ(BQ(function(l){return a.add(new st(l-o).mul(n)).toNumber()}),Qg);return s(0,t)}function TC(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new st(0),tickMin:new st(0),tickMax:new st(0)};var i=CC(new st(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new st(0):(o=new st(e).add(t).div(2),o=o.sub(new st(o).mod(i)));var s=Math.ceil(o.sub(e).div(i).toNumber()),l=Math.ceil(new st(t).sub(o).div(i).toNumber()),u=s+l+1;return u>r?TC(e,t,r,n,a+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:i,tickMin:o.sub(new st(s).mul(i)),tickMax:o.add(new st(l).mul(i))})}function tJ(e){var t=hc(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),s=NC([r,n]),l=hc(s,2),u=l[0],d=l[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(e0(Qg(0,a-1).map(function(){return 1/0}))):[].concat(e0(Qg(0,a-1).map(function(){return-1/0})),[d]);return r>n?Jg(f):f}if(u===d)return eJ(u,a,i);var p=TC(u,d,o,i),h=p.step,g=p.tickMin,y=p.tickMax,v=tm.rangeStep(g,y.add(new st(.1).mul(h)),h);return r>n?Jg(v):v}function rJ(e,t){var r=hc(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=NC([n,a]),s=hc(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,a];if(l===u)return[l];var d=Math.max(t,2),f=CC(new st(u).sub(l).div(d-1),i,0),p=[].concat(e0(tm.rangeStep(new st(l),new st(u).sub(new st(.99).mul(f)),f)),[u]);return n>a?Jg(p):p}var nJ=EC(tJ),aJ=EC(rJ),iJ="Invariant failed";function go(e,t){throw new Error(iJ)}var oJ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Fs(e){"@babel/helpers - typeof";return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fs(e)}function bp(){return bp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mJ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var l=i.range,u=0;u0?a[u-1].coordinate:a[s-1].coordinate,f=a[u].coordinate,p=u>=s-1?a[0].coordinate:a[u+1].coordinate,h=void 0;if(gr(f-d)!==gr(p-f)){var g=[];if(gr(p-f)===gr(l[1]-l[0])){h=p;var y=f+l[1]-l[0];g[0]=Math.min(y,(y+d)/2),g[1]=Math.max(y,(y+d)/2)}else{h=d;var v=p+l[1]-l[0];g[0]=Math.min(f,(v+f)/2),g[1]=Math.max(f,(v+f)/2)}var x=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(t>x[0]&&t<=x[1]||t>=g[0]&&t<=g[1]){o=a[u].index;break}}else{var m=Math.min(d,p),w=Math.max(d,p);if(t>(m+f)/2&&t<=(w+f)/2){o=a[u].index;break}}}else for(var _=0;_0&&_(n[_].coordinate+n[_-1].coordinate)/2&&t<=(n[_].coordinate+n[_+1].coordinate)/2||_===s-1&&t>(n[_].coordinate+n[_-1].coordinate)/2){o=n[_].index;break}return o},ow=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,o=i.stroke,s=i.fill,l;switch(a){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},TJ=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},s=Object.keys(i),l=0,u=s.length;l=0});if(x&&x.length){var m=x[0].type.defaultProps,w=m!==void 0?Ct(Ct({},m),x[0].props):x[0].props,_=w.barSize,b=w[v];o[b]||(o[b]=[]);var S=Ne(_)?r:_;o[b].push({item:x[0],stackList:x.slice(1),barSize:Ne(S)?void 0:xr(S,n,0)})}}return o},$J=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=xr(r,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=a/l,g=o.reduce(function(_,b){return _+b.barSize||0},0);g+=(l-1)*u,g>=a&&(g-=(l-1)*u,u=0),g>=a&&h>0&&(p=!0,h*=.9,g=l*h);var y=(a-g)/2>>0,v={offset:y-u,size:0};d=o.reduce(function(_,b){var S={item:b.item,position:{offset:v.offset+v.size+u,size:p?h:b.barSize}},j=[].concat(Gj(_),[S]);return v=j[j.length-1].position,b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){j.push({item:k,position:v})}),j},f)}else{var x=xr(n,a,0,!0);a-2*x-(l-1)*u<=0&&(u=0);var m=(a-2*x-(l-1)*u)/l;m>1&&(m>>=0);var w=s===+s?Math.min(m,s):m;d=o.reduce(function(_,b,S){var j=[].concat(Gj(_),[{item:b.item,position:{offset:x+(m+u)*S+(m-w)/2,size:w}}]);return b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){j.push({item:k,position:j[j.length-1].position})}),j},f)}return d},IJ=function(t,r,n,a){var i=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=MC({children:i,legendWidth:l});if(u){var d=a||{},f=d.width,p=d.height,h=u.align,g=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&g==="middle")&&h!=="center"&&ne(t[h]))return Ct(Ct({},t),{},ys({},h,t[h]+(f||0)));if((y==="horizontal"||y==="vertical"&&h==="center")&&g!=="middle"&&ne(t[g]))return Ct(Ct({},t),{},ys({},g,t[g]+(p||0)))}return t},RJ=function(t,r,n){return Ne(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},DC=function(t,r,n,a,i){var o=r.props.children,s=Hr(o,Jc).filter(function(u){return RJ(a,i,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=It(d,n);if(Ne(f))return u;var p=Array.isArray(f)?[Jh(f),Qa(f)]:[f,f],h=l.reduce(function(g,y){var v=It(d,y,0),x=p[0]-Math.abs(Array.isArray(v)?v[0]:v),m=p[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,g[0]),Math.max(m,g[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},MJ=function(t,r,n,a,i){var o=r.map(function(s){return DC(t,s,n,i,a)}).filter(function(s){return!Ne(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},LC=function(t,r,n,a,i){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&DC(t,l,u,a)||ju(t,u,n,i)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var d=0,f=u.length;d=2?gr(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var p=i?i.indexOf(f):f;return{coordinate:a(p)+u,value:f,offset:u}});return d.filter(function(f){return!yl(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,p){return{coordinate:a(f)+u,value:f,index:p,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,p){return{coordinate:a(f)+u,value:i?i[f]:f,index:p,offset:u}})},Ty=new WeakMap,If=function(t,r){if(typeof r!="function")return t;Ty.has(t)||Ty.set(t,new WeakMap);var n=Ty.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},BC=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,s=t.axisType;if(a==="auto")return o==="radial"&&s==="radiusAxis"?{scale:lc(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:mp(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Su(),realScaleType:"point"}:i==="category"?{scale:lc(),realScaleType:"band"}:{scale:mp(),realScaleType:"linear"};if(po(a)){var l="scale".concat(Fh(a));return{scale:(zj[l]||Su)(),realScaleType:zj[l]?l:"point"}}return je(a)?{scale:a}:{scale:Su(),realScaleType:"point"}},qj=1e-4,UC=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-qj,o=Math.max(a[0],a[1])+qj,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},DJ=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},zJ=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[o][n][0]=i,t[o][n][1]=i+s,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},BJ={sign:FJ,expand:oU,none:Cs,silhouette:sU,wiggle:lU,positive:zJ},UJ=function(t,r,n){var a=r.map(function(s){return s.props.dataKey}),i=BJ[n],o=iU().keys(a).value(function(s,l){return+It(s,l,0)}).order(Eg).offset(i);return o(t)},VJ=function(t,r,n,a,i,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(f,p){var h,g=(h=p.type)!==null&&h!==void 0&&h.defaultProps?Ct(Ct({},p.type.defaultProps),p.props):p.props,y=g.stackId,v=g.hide;if(v)return f;var x=g[n],m=f[x]||{hasStack:!1,stackGroups:{}};if(Kt(y)){var w=m.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};w.items.push(p),m.hasStack=!0,m.stackGroups[y]=w}else m.stackGroups[jo("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[p]};return Ct(Ct({},f),{},ys({},x,m))},l),d={};return Object.keys(u).reduce(function(f,p){var h=u[p];if(h.hasStack){var g={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(y,v){var x=h.stackGroups[v];return Ct(Ct({},y),{},ys({},v,{numericAxisId:n,cateAxisId:a,items:x.items,stackedData:UJ(t,x.items,i)}))},g)}return Ct(Ct({},f),{},ys({},p,h))},d)},VC=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=nJ(u,i,s);return t.domain([Jh(d),Qa(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),p=aJ(f,i,s);return{niceTicks:p}}return null};function _p(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ne(a[t.dataKey])){var s=Kd(r,"value",a[t.dataKey]);if(s)return s.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var l=It(a,Ne(o)?t.dataKey:o);return Ne(l)?null:t.scale(l)}var Xj=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+a:null;var l=It(o,r.dataKey,r.domain[s]);return Ne(l)?null:r.scale(l)-i/2+a},WJ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},HJ=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Kt(i)){var o=r[i];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},GJ=function(t){return t.reduce(function(r,n){return[Jh(n.concat([r[0]]).filter(ne)),Qa(n.concat([r[1]]).filter(ne))]},[1/0,-1/0])},WC=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],s=o.stackedData,l=s.reduce(function(u,d){var f=GJ(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],a[0]),Math.max(l[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},Yj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Zj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,a0=function(t,r,n){if(je(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(ne(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(Yj.test(t[0])){var i=+Yj.exec(t[0])[1];a[0]=r[0]-i}else je(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(ne(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(Zj.test(t[1])){var o=+Zj.exec(t[1])[1];a[1]=r[1]+o}else je(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Sp=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=Ib(r,function(f){return f.coordinate}),o=1/0,s=1,l=i.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},tee=function(t,r,n,a,i){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,d=xr(t.cx,o,o/2),f=xr(t.cy,s,s/2),p=KC(o,s,n),h=xr(t.innerRadius,p,0),g=xr(t.outerRadius,p,p*.8),y=Object.keys(r);return y.reduce(function(v,x){var m=r[x],w=m.domain,_=m.reversed,b;if(Ne(m.range))a==="angleAxis"?b=[l,u]:a==="radiusAxis"&&(b=[h,g]),_&&(b=[b[1],b[0]]);else{b=m.range;var S=b,j=XJ(S,2);l=j[0],u=j[1]}var k=BC(m,i),A=k.realScaleType,R=k.scale;R.domain(w).range(b),UC(R);var T=VC(R,na(na({},m),{},{realScaleType:A})),N=na(na(na({},m),T),{},{range:b,radius:g,realScaleType:A,scale:R,cx:d,cy:f,innerRadius:h,outerRadius:g,startAngle:l,endAngle:u});return na(na({},v),{},GC({},x,N))},{})},ree=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},nee=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,s=ree({x:n,y:a},{x:i,y:o});if(s<=0)return{radius:s};var l=(n-i)/s,u=Math.acos(l);return a>o&&(u=2*Math.PI-u),{radius:s,angle:eee(u),angleInRadian:u}},aee=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},iee=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),s=Math.min(i,o);return t+s*360},tO=function(t,r){var n=t.x,a=t.y,i=nee({x:n,y:a},r),o=i.radius,s=i.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var d=aee(r),f=d.startAngle,p=d.endAngle,h=s,g;if(f<=p){for(;h>p;)h-=360;for(;h=f&&h<=p}else{for(;h>f;)h-=360;for(;h=p&&h<=f}return g?na(na({},r),{},{radius:o,angle:iee(h,r)}):null},qC=function(t){return!O.isValidElement(t)&&!je(t)&&typeof t!="boolean"?t.className:""};function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}var oee=["offset"];function see(e){return fee(e)||cee(e)||uee(e)||lee()}function lee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uee(e,t){if(e){if(typeof e=="string")return i0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i0(e,t)}}function cee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fee(e){if(Array.isArray(e))return i0(e)}function i0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function rO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ut(e){for(var t=1;t=0?1:-1,w,_;a==="insideStart"?(w=h+m*o,_=y):a==="insideEnd"?(w=g-m*o,_=!y):a==="end"&&(w=g+m*o,_=y),_=x<=0?_:!_;var b=ht(u,d,v,w),S=ht(u,d,v,w+(_?1:-1)*359),j="M".concat(b.x,",").concat(b.y,` - A`).concat(v,",").concat(v,",0,1,").concat(_?0:1,`, - `).concat(S.x,",").concat(S.y),k=Ne(t.id)?jo("recharts-radial-line-"):t.id;return C.createElement("text",xc({},n,{dominantBaseline:"central",className:Fe("recharts-radial-bar-label",s)}),C.createElement("defs",null,C.createElement("path",{id:k,d:j})),C.createElement("textPath",{xlinkHref:"#".concat(k)},r))},bee=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,s=i.cy,l=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,p=(d+f)/2;if(a==="outside"){var h=ht(o,s,u+n,p),g=h.x,y=h.y;return{x:g,y,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var v=(l+u)/2,x=ht(o,s,v,p),m=x.x,w=x.y;return{x:m,y:w,textAnchor:"middle",verticalAnchor:"middle"}},wee=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,s=o.x,l=o.y,u=o.width,d=o.height,f=d>=0?1:-1,p=f*a,h=f>0?"end":"start",g=f>0?"start":"end",y=u>=0?1:-1,v=y*a,x=y>0?"end":"start",m=y>0?"start":"end";if(i==="top"){var w={x:s+u/2,y:l-f*a,textAnchor:"middle",verticalAnchor:h};return Ut(Ut({},w),n?{height:Math.max(l-n.y,0),width:u}:{})}if(i==="bottom"){var _={x:s+u/2,y:l+d+p,textAnchor:"middle",verticalAnchor:g};return Ut(Ut({},_),n?{height:Math.max(n.y+n.height-(l+d),0),width:u}:{})}if(i==="left"){var b={x:s-v,y:l+d/2,textAnchor:x,verticalAnchor:"middle"};return Ut(Ut({},b),n?{width:Math.max(b.x-n.x,0),height:d}:{})}if(i==="right"){var S={x:s+u+v,y:l+d/2,textAnchor:m,verticalAnchor:"middle"};return Ut(Ut({},S),n?{width:Math.max(n.x+n.width-S.x,0),height:d}:{})}var j=n?{width:u,height:d}:{};return i==="insideLeft"?Ut({x:s+v,y:l+d/2,textAnchor:m,verticalAnchor:"middle"},j):i==="insideRight"?Ut({x:s+u-v,y:l+d/2,textAnchor:x,verticalAnchor:"middle"},j):i==="insideTop"?Ut({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:g},j):i==="insideBottom"?Ut({x:s+u/2,y:l+d-p,textAnchor:"middle",verticalAnchor:h},j):i==="insideTopLeft"?Ut({x:s+v,y:l+p,textAnchor:m,verticalAnchor:g},j):i==="insideTopRight"?Ut({x:s+u-v,y:l+p,textAnchor:x,verticalAnchor:g},j):i==="insideBottomLeft"?Ut({x:s+v,y:l+d-p,textAnchor:m,verticalAnchor:h},j):i==="insideBottomRight"?Ut({x:s+u-v,y:l+d-p,textAnchor:x,verticalAnchor:h},j):dl(i)&&(ne(i.x)||Hi(i.x))&&(ne(i.y)||Hi(i.y))?Ut({x:s+xr(i.x,u),y:l+xr(i.y,d),textAnchor:"end",verticalAnchor:"end"},j):Ut({x:s+u/2,y:l+d/2,textAnchor:"middle",verticalAnchor:"middle"},j)},_ee=function(t){return"cx"in t&&ne(t.cx)};function Qt(e){var t=e.offset,r=t===void 0?5:t,n=dee(e,oee),a=Ut({offset:r},n),i=a.viewBox,o=a.position,s=a.value,l=a.children,u=a.content,d=a.className,f=d===void 0?"":d,p=a.textBreakAll;if(!i||Ne(s)&&Ne(l)&&!O.isValidElement(u)&&!je(u))return null;if(O.isValidElement(u))return O.cloneElement(u,a);var h;if(je(u)){if(h=O.createElement(u,a),O.isValidElement(h))return h}else h=vee(a);var g=_ee(i),y=xe(a,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return xee(a,h,y);var v=g?bee(a):wee(a);return C.createElement(mo,xc({className:Fe("recharts-label",f)},y,v,{breakAll:p}),h)}Qt.displayName="Label";var XC=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,p=t.y,h=t.top,g=t.left,y=t.width,v=t.height,x=t.clockWise,m=t.labelViewBox;if(m)return m;if(ne(y)&&ne(v)){if(ne(f)&&ne(p))return{x:f,y:p,width:y,height:v};if(ne(h)&&ne(g))return{x:h,y:g,width:y,height:v}}return ne(f)&&ne(p)?{x:f,y:p,width:0,height:0}:ne(r)&&ne(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||l||s||0,clockWise:x}:t.viewBox?t.viewBox:{}},See=function(t,r){return t?t===!0?C.createElement(Qt,{key:"label-implicit",viewBox:r}):Kt(t)?C.createElement(Qt,{key:"label-implicit",viewBox:r,value:t}):O.isValidElement(t)?t.type===Qt?O.cloneElement(t,{key:"label-implicit",viewBox:r}):C.createElement(Qt,{key:"label-implicit",content:t,viewBox:r}):je(t)?C.createElement(Qt,{key:"label-implicit",content:t,viewBox:r}):dl(t)?C.createElement(Qt,xc({viewBox:r},t,{key:"label-implicit"})):null:null},jee=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=XC(t),o=Hr(a,Qt).map(function(l,u){return O.cloneElement(l,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var s=See(t.label,r||i);return[s].concat(see(o))};Qt.parseViewBox=XC;Qt.renderCallByParent=jee;function Oee(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var kee=Oee;const Aee=nt(kee);function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}var Eee=["valueAccessor"],Pee=["data","dataKey","clockWise","id","textBreakAll"];function Nee(e){return Iee(e)||$ee(e)||Tee(e)||Cee()}function Cee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tee(e,t){if(e){if(typeof e=="string")return o0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o0(e,t)}}function $ee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Iee(e){if(Array.isArray(e))return o0(e)}function o0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Fee=function(t){return Array.isArray(t.value)?Aee(t.value):t.value};function Hn(e){var t=e.valueAccessor,r=t===void 0?Fee:t,n=iO(e,Eee),a=n.data,i=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=iO(n,Pee);return!a||!a.length?null:C.createElement(Ve,{className:"recharts-label-list"},a.map(function(d,f){var p=Ne(i)?r(d,f):It(d&&d.payload,i),h=Ne(s)?{}:{id:"".concat(s,"-").concat(f)};return C.createElement(Qt,Op({},xe(d,!0),u,h,{parentViewBox:d.parentViewBox,value:p,textBreakAll:l,viewBox:Qt.parseViewBox(Ne(o)?d:aO(aO({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Hn.displayName="LabelList";function zee(e,t){return e?e===!0?C.createElement(Hn,{key:"labelList-implicit",data:t}):C.isValidElement(e)||je(e)?C.createElement(Hn,{key:"labelList-implicit",data:t,content:e}):dl(e)?C.createElement(Hn,Op({data:t},e,{key:"labelList-implicit"})):null:null}function Bee(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=Hr(n,Hn).map(function(o,s){return O.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return a;var i=zee(e.label,t);return[i].concat(Nee(a))}Hn.renderCallByParent=Bee;function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}function s0(){return s0=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, - `).concat(f.x,",").concat(f.y,` - `);if(a>0){var h=ht(r,n,a,o),g=ht(r,n,a,u);p+="L ".concat(g.x,",").concat(g.y,` - A `).concat(a,",").concat(a,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},Gee=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=gr(d-u),p=Rf({cx:r,cy:n,radius:i,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,g=p.lineTangency,y=p.theta,v=Rf({cx:r,cy:n,radius:i,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:l}),x=v.circleTangency,m=v.lineTangency,w=v.theta,_=l?Math.abs(u-d):Math.abs(u-d)-y-w;if(_<0)return s?"M ".concat(g.x,",").concat(g.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):YC({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:d});var b="M ".concat(g.x,",").concat(g.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,` - A`).concat(i,",").concat(i,",0,").concat(+(_>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,` - `);if(a>0){var S=Rf({cx:r,cy:n,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),j=S.circleTangency,k=S.lineTangency,A=S.theta,R=Rf({cx:r,cy:n,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),T=R.circleTangency,N=R.lineTangency,$=R.theta,D=l?Math.abs(u-d):Math.abs(u-d)-A-$;if(D<0&&o===0)return"".concat(b,"L").concat(r,",").concat(n,"Z");b+="L".concat(N.x,",").concat(N.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(T.x,",").concat(T.y,` - A`).concat(a,",").concat(a,",0,").concat(+(D>180),",").concat(+(f>0),",").concat(j.x,",").concat(j.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(k.x,",").concat(k.y,"Z")}else b+="L".concat(r,",").concat(n,"Z");return b},Kee={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ZC=function(t){var r=sO(sO({},Kee),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,p=r.className;if(o0&&Math.abs(d-f)<360?v=Gee({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,g/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:f}):v=YC({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:d,endAngle:f}),C.createElement("path",s0({},xe(r,!0),{className:h,d:v,role:"img"}))};function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(e)}function l0(){return l0=Object.assign?Object.assign.bind():function(e){for(var t=1;tote.call(e,t));function Ao(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ute="__v",cte="__o",fte="_owner",{getOwnPropertyDescriptor:dO,keys:pO}=Object;function dte(e,t){return e.byteLength===t.byteLength&&kp(new Uint8Array(e),new Uint8Array(t))}function pte(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function hte(e,t){return e.byteLength===t.byteLength&&kp(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function mte(e,t){return Ao(e.getTime(),t.getTime())}function yte(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function vte(e,t){return e===t}function hO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let o,s,l=0;for(;(o=i.next())&&!o.done;){const u=t.entries();let d=!1,f=0;for(;(s=u.next())&&!s.done;){if(a[f]){f++;continue}const p=o.value,h=s.value;if(r.equals(p[0],h[0],l,f,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){d=a[f]=!0;break}f++}if(!d)return!1;l++}return!0}const gte=Ao;function xte(e,t,r){const n=pO(e);let a=n.length;if(pO(t).length!==a)return!1;for(;a-- >0;)if(!tT(e,t,r,n[a]))return!1;return!0}function Wl(e,t,r){const n=fO(e);let a=n.length;if(fO(t).length!==a)return!1;let i,o,s;for(;a-- >0;)if(i=n[a],!tT(e,t,r,i)||(o=dO(e,i),s=dO(t,i),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function bte(e,t){return Ao(e.valueOf(),t.valueOf())}function wte(e,t){return e.source===t.source&&e.flags===t.flags}function mO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let o,s;for(;(o=i.next())&&!o.done;){const l=t.values();let u=!1,d=0;for(;(s=l.next())&&!s.done;){if(!a[d]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function kp(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function _te(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function tT(e,t,r,n){return(n===fte||n===cte||n===ute)&&(e.$$typeof||t.$$typeof)?!0:lte(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const Ste="[object ArrayBuffer]",jte="[object Arguments]",Ote="[object Boolean]",kte="[object DataView]",Ate="[object Date]",Ete="[object Error]",Pte="[object Map]",Nte="[object Number]",Cte="[object Object]",Tte="[object RegExp]",$te="[object Set]",Ite="[object String]",Rte={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Mte="[object URL]",Dte=Object.prototype.toString;function Lte({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:g}){return function(v,x,m){if(v===x)return!0;if(v==null||x==null)return!1;const w=typeof v;if(w!==typeof x)return!1;if(w!=="object")return w==="number"?s(v,x,m):w==="function"?i(v,x,m):!1;const _=v.constructor;if(_!==x.constructor)return!1;if(_===Object)return l(v,x,m);if(Array.isArray(v))return t(v,x,m);if(_===Date)return n(v,x,m);if(_===RegExp)return d(v,x,m);if(_===Map)return o(v,x,m);if(_===Set)return f(v,x,m);const b=Dte.call(v);if(b===Ate)return n(v,x,m);if(b===Tte)return d(v,x,m);if(b===Pte)return o(v,x,m);if(b===$te)return f(v,x,m);if(b===Cte)return typeof v.then!="function"&&typeof x.then!="function"&&l(v,x,m);if(b===Mte)return h(v,x,m);if(b===Ete)return a(v,x,m);if(b===jte)return l(v,x,m);if(Rte[b])return p(v,x,m);if(b===Ste)return e(v,x,m);if(b===kte)return r(v,x,m);if(b===Ote||b===Nte||b===Ite)return u(v,x,m);if(g){let S=g[b];if(!S){const j=ste(v);j&&(S=g[j])}if(S)return S(v,x,m)}return!1}}function Fte({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:dte,areArraysEqual:r?Wl:pte,areDataViewsEqual:hte,areDatesEqual:mte,areErrorsEqual:yte,areFunctionsEqual:vte,areMapsEqual:r?$y(hO,Wl):hO,areNumbersEqual:gte,areObjectsEqual:r?Wl:xte,arePrimitiveWrappersEqual:bte,areRegExpsEqual:wte,areSetsEqual:r?$y(mO,Wl):mO,areTypedArraysEqual:r?$y(kp,Wl):kp,areUrlsEqual:_te,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=Df(n.areArraysEqual),i=Df(n.areMapsEqual),o=Df(n.areObjectsEqual),s=Df(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:s})}return n}function zte(e){return function(t,r,n,a,i,o,s){return e(t,r,s)}}function Bte({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:d}=r();return t(s,l,{cache:u,equals:n,meta:d,strict:a})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(s,l){return t(s,l,i)}}const Ute=ki();ki({strict:!0});ki({circular:!0});ki({circular:!0,strict:!0});ki({createInternalComparator:()=>Ao});ki({strict:!0,createInternalComparator:()=>Ao});ki({circular:!0,createInternalComparator:()=>Ao});ki({circular:!0,createInternalComparator:()=>Ao,strict:!0});function ki(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=Fte(e),o=Lte(i),s=r?r(o):zte(o);return Bte({circular:t,comparator:o,createState:n,equals:s,strict:a})}function Vte(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function yO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):Vte(a)};requestAnimationFrame(n)}function u0(e){"@babel/helpers - typeof";return u0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u0(e)}function Wte(e){return qte(e)||Kte(e)||Gte(e)||Hte()}function Hte(){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 Gte(e,t){if(e){if(typeof e=="string")return vO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vO(e,t)}}function vO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:x<0?0:x},y=function(x){for(var m=x>1?1:x,w=m,_=0;_<8;++_){var b=f(w)-m,S=h(w);if(Math.abs(b-m)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,s=o===void 0?17:o,l=function(d,f,p){var h=-(d-f)*n,g=p*i,y=p+(h-g)*s/1e3,v=p*s/1e3+d;return Math.abs(v-f)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ore(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function Iy(e){return Pre(e)||Ere(e)||Are(e)||kre()}function kre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Are(e,t){if(e){if(typeof e=="string")return h0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h0(e,t)}}function Ere(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pre(e){if(Array.isArray(e))return h0(e)}function h0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Pp(e){return Pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Pp(e)}var Tn=function(e){Ire(r,e);var t=Rre(r);function r(n,a){var i;Nre(this,r),i=t.call(this,n,a);var o=i.props,s=o.isActive,l=o.attributeName,u=o.from,d=o.to,f=o.steps,p=o.children,h=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(v0(i)),i.changeStyle=i.changeStyle.bind(v0(i)),!s||h<=0)return i.state={style:{}},typeof p=="function"&&(i.state={style:d}),y0(i);if(f&&f.length)i.state={style:f[0].style};else if(u){if(typeof p=="function")return i.state={style:u},y0(i);i.state={style:l?ou({},l,u):u}}else i.state={style:{}};return i}return Tre(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,s=i.canBegin,l=i.attributeName,u=i.shouldReAnimate,d=i.to,f=i.from,p=this.state.style;if(s){if(!o){var h={style:l?ou({},l,d):d};this.state&&p&&(l&&p[l]!==d||!l&&p!==d)&&this.setState(h);return}if(!(Ute(a.to,d)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=g||u?f:a.to;if(this.state&&p){var v={style:l?ou({},l,y):y};(l&&p[l]!==y||!l&&p!==y)&&this.setState(v)}this.runAnimation(gn(gn({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,s=a.to,l=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,p=a.onAnimationStart,h=_re(o,s,fre(u),l,this.changeStyle),g=function(){i.stopJSAnimation=h()};this.manager.start([p,d,g,l,f])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,s=a.begin,l=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,p=f===void 0?0:f,h=function(y,v,x){if(x===0)return y;var m=v.duration,w=v.easing,_=w===void 0?"ease":w,b=v.style,S=v.properties,j=v.onAnimationEnd,k=x>0?o[x-1]:v,A=S||Object.keys(b);if(typeof _=="function"||_==="spring")return[].concat(Iy(y),[i.runJSAnimation.bind(i,{from:k.style,to:b,duration:m,easing:_}),m]);var R=bO(A,m,_),T=gn(gn(gn({},k.style),b),{},{transition:R});return[].concat(Iy(y),[T,m,j]).filter(Jte)};return this.manager.start([l].concat(Iy(o.reduce(h,[d,Math.max(p,s)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Xte());var i=a.begin,o=a.duration,s=a.attributeName,l=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,p=a.steps,h=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(a);return}if(p.length>1){this.runStepAnimation(a);return}var y=s?ou({},s,l):l,v=bO(Object.keys(y),o,u);g.start([d,i,gn(gn({},y),{},{transition:v}),o,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var s=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var l=jre(a,Sre),u=O.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!s||u===0||o<=0)return i;var f=function(h){var g=h.props,y=g.style,v=y===void 0?{}:y,x=g.className,m=O.cloneElement(h,gn(gn({},l),{},{style:gn(gn({},v),d),className:x}));return m};return u===1?f(O.Children.only(i)):C.createElement("div",null,O.Children.map(i,function(p){return f(p)}))}}]),r}(O.PureComponent);Tn.displayName="Animate";Tn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Tn.propTypes={from:tt.oneOfType([tt.object,tt.string]),to:tt.oneOfType([tt.object,tt.string]),attributeName:tt.string,duration:tt.number,begin:tt.number,easing:tt.oneOfType([tt.string,tt.func]),steps:tt.arrayOf(tt.shape({duration:tt.number.isRequired,style:tt.object.isRequired,easing:tt.oneOfType([tt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),tt.func]),properties:tt.arrayOf("string"),onAnimationEnd:tt.func})),children:tt.oneOfType([tt.node,tt.func]),isActive:tt.bool,canBegin:tt.bool,onAnimationEnd:tt.func,shouldReAnimate:tt.bool,onAnimationStart:tt.func,onAnimationReStart:tt.func};function Oc(e){"@babel/helpers - typeof";return Oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oc(e)}function Np(){return Np=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,d;if(o>0&&i instanceof Array){for(var f=[0,0,0,0],p=0,h=4;po?o:i[p];d="M".concat(t,",").concat(r+s*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+l*f[0],",").concat(r)),d+="L ".concat(t+n-l*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, - `).concat(t+n,",").concat(r+s*f[1])),d+="L ".concat(t+n,",").concat(r+a-s*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, - `).concat(t+n-l*f[2],",").concat(r+a)),d+="L ".concat(t+l*f[3],",").concat(r+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, - `).concat(t,",").concat(r+a-s*f[3])),d+="Z"}else if(o>0&&i===+i&&i>0){var g=Math.min(o,i);d="M ".concat(t,",").concat(r+s*g,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+l*g,",").concat(r,` - L `).concat(t+n-l*g,",").concat(r,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*g,` - L `).concat(t+n,",").concat(r+a-s*g,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n-l*g,",").concat(r+a,` - L `).concat(t+l*g,",").concat(r+a,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(r+a-s*g," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return d},Hre=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(i,i+s),d=Math.max(i,i+s),f=Math.min(o,o+l),p=Math.max(o,o+l);return n>=u&&n<=d&&a>=f&&a<=p}return!1},Gre={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},sw=function(t){var r=EO(EO({},Gre),t),n=O.useRef(),a=O.useState(-1),i=Dre(a,2),o=i[0],s=i[1];O.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var _=n.current.getTotalLength();_&&s(_)}catch{}},[]);var l=r.x,u=r.y,d=r.width,f=r.height,p=r.radius,h=r.className,g=r.animationEasing,y=r.animationDuration,v=r.animationBegin,x=r.isAnimationActive,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=Fe("recharts-rectangle",h);return m?C.createElement(Tn,{canBegin:o>0,from:{width:d,height:f,x:l,y:u},to:{width:d,height:f,x:l,y:u},duration:y,animationEasing:g,isActive:m},function(_){var b=_.width,S=_.height,j=_.x,k=_.y;return C.createElement(Tn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,isActive:x,easing:g},C.createElement("path",Np({},xe(r,!0),{className:w,d:PO(j,k,b,S,p),ref:n})))}):C.createElement("path",Np({},xe(r,!0),{className:w,d:PO(l,u,d,f,p)}))},Kre=["points","className","baseLinePoints","connectNulls"];function es(){return es=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function NO(e){return Jre(e)||Qre(e)||Zre(e)||Yre()}function Yre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zre(e,t){if(e){if(typeof e=="string")return g0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g0(e,t)}}function Qre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jre(e){if(Array.isArray(e))return g0(e)}function g0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){CO(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),CO(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},ku=function(t,r){var n=ene(t);r&&(n=[n.reduce(function(i,o){return[].concat(NO(i),NO(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},tne=function(t,r,n){var a=ku(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(ku(r.reverse(),n).slice(1))},rne=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=qre(t,Kre);if(!r||!r.length)return null;var s=Fe("recharts-polygon",n);if(a&&a.length){var l=o.stroke&&o.stroke!=="none",u=tne(r,a,i);return C.createElement("g",{className:s},C.createElement("path",es({},xe(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?C.createElement("path",es({},xe(o,!0),{fill:"none",d:ku(r,i)})):null,l?C.createElement("path",es({},xe(o,!0),{fill:"none",d:ku(a,i)})):null)}var d=ku(r,i);return C.createElement("path",es({},xe(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:s,d}))};function x0(){return x0=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function une(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var cne=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},fne=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,d=t.width,f=d===void 0?0:d,p=t.height,h=p===void 0?0:p,g=t.className,y=lne(t,nne),v=ane({x:n,y:i,top:s,left:u,width:f,height:h},y);return!ne(n)||!ne(i)||!ne(f)||!ne(h)||!ne(s)||!ne(u)?null:C.createElement("path",b0({},xe(v,!0),{className:Fe("recharts-cross",g),d:cne(n,i,f,h,s,u)}))},dne=Qh,pne=xC,hne=Zn;function mne(e,t){return e&&e.length?dne(e,hne(t),pne):void 0}var yne=mne;const vne=nt(yne);var gne=Qh,xne=Zn,bne=bC;function wne(e,t){return e&&e.length?gne(e,xne(t),bne):void 0}var _ne=wne;const Sne=nt(_ne);var jne=["cx","cy","angle","ticks","axisLine"],One=["ticks","tick","angle","tickFormatter","stroke"];function Bs(e){"@babel/helpers - typeof";return Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs(e)}function Au(){return Au=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ane(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RO(e,t){for(var r=0;rLO?o=a==="outer"?"start":"end":i<-LO?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=Ii(Ii({},xe(this.props,!1)),{},{fill:"none"},xe(s,!1));if(l==="circle")return C.createElement(ef,zi({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var d=this.props.ticks,f=d.map(function(p){return ht(a,i,o,p.coordinate)});return C.createElement(rne,zi({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,s=a.tickLine,l=a.tickFormatter,u=a.stroke,d=xe(this.props,!1),f=xe(o,!1),p=Ii(Ii({},d),{},{fill:"none"},xe(s,!1)),h=i.map(function(g,y){var v=n.getTickLineCoord(g),x=n.getTickTextAnchor(g),m=Ii(Ii(Ii({textAnchor:x},d),{},{stroke:"none",fill:u},f),{},{index:y,payload:g,x:v.x2,y:v.y2});return C.createElement(Ve,zi({className:Fe("recharts-polar-angle-axis-tick",qC(o)),key:"tick-".concat(g.coordinate)},ho(n.props,g,y)),s&&C.createElement("line",zi({className:"recharts-polar-angle-axis-tick-line"},p,v)),o&&t.renderTickItem(o,m,l?l(g.value,y):g.value))});return C.createElement(Ve,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:C.createElement(Ve,{className:Fe("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return C.isValidElement(n)?o=C.cloneElement(n,a):je(n)?o=n(a):o=C.createElement(mo,zi({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(O.PureComponent);am(im,"displayName","PolarAngleAxis");am(im,"axisType","angleAxis");am(im,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Une=yN,Vne=Une(Object.getPrototypeOf,Object),Wne=Vne,Hne=Ca,Gne=Wne,Kne=Ta,qne="[object Object]",Xne=Function.prototype,Yne=Object.prototype,dT=Xne.toString,Zne=Yne.hasOwnProperty,Qne=dT.call(Object);function Jne(e){if(!Kne(e)||Hne(e)!=qne)return!1;var t=Gne(e);if(t===null)return!0;var r=Zne.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&dT.call(r)==Qne}var eae=Jne;const tae=nt(eae);var rae=Ca,nae=Ta,aae="[object Boolean]";function iae(e){return e===!0||e===!1||nae(e)&&rae(e)==aae}var oae=iae;const sae=nt(oae);function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:d,lowerWidth:f,height:p,x:l,y:u},duration:y,animationEasing:g,isActive:x},function(w){var _=w.upperWidth,b=w.lowerWidth,S=w.height,j=w.x,k=w.y;return C.createElement(Tn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,easing:g},C.createElement("path",$p({},xe(r,!0),{className:m,d:UO(j,k,_,b,S),ref:n})))}):C.createElement("g",null,C.createElement("path",$p({},xe(r,!0),{className:m,d:UO(l,u,d,f,p)})))},gae=["option","shapeType","propTransformer","activeClassName","isActive"];function Ec(e){"@babel/helpers - typeof";return Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ec(e)}function xae(e,t){if(e==null)return{};var r=bae(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function VO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ip(e){for(var t=1;t0?Wr(w,"paddingAngle",0):0;if(b){var j=Ht(b.endAngle-b.startAngle,w.endAngle-w.startAngle),k=ft(ft({},w),{},{startAngle:m+S,endAngle:m+j(y)+S});v.push(k),m=k.endAngle}else{var A=w.endAngle,R=w.startAngle,T=Ht(0,A-R),N=T(y),$=ft(ft({},w),{},{startAngle:m+S,endAngle:m+N+S});v.push($),m=$.endAngle}}),C.createElement(Ve,null,n.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!yo(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,s=a.className,l=a.label,u=a.cx,d=a.cy,f=a.innerRadius,p=a.outerRadius,h=a.isAnimationActive,g=this.state.isAnimationFinished;if(i||!o||!o.length||!ne(u)||!ne(d)||!ne(f)||!ne(p))return null;var y=Fe("recharts-pie",s);return C.createElement(Ve,{tabIndex:this.props.rootTabIndex,className:y,ref:function(x){n.pieRef=x}},this.renderSectors(),l&&this.renderLabels(o),Qt.renderCallByParent(this.props,null,!1),(!h||g)&&Hn.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n=360?m:m-1)*l,_=v-m*h-w,b=a.reduce(function(k,A){var R=It(A,x,0);return k+(ne(R)?R:0)},0),S;if(b>0){var j;S=a.map(function(k,A){var R=It(k,x,0),T=It(k,d,A),N=(ne(R)?R:0)/b,$;A?$=j.endAngle+gr(y)*l*(R!==0?1:0):$=o;var D=$+gr(y)*((R!==0?h:0)+N*_),F=($+D)/2,V=(g.innerRadius+g.outerRadius)/2,H=[{name:T,value:R,payload:k,dataKey:x,type:p}],L=ht(g.cx,g.cy,V,F);return j=ft(ft(ft({percent:N,cornerRadius:i,name:T,tooltipPayload:H,midAngle:F,middleRadius:V,tooltipPosition:L},k),g),{},{value:It(k,x),startAngle:$,endAngle:D,payload:k,paddingAngle:gr(y)*l}),j})}return ft(ft({},g),{},{sectors:S,data:a})});var Bae=Math.ceil,Uae=Math.max;function Vae(e,t,r,n){for(var a=-1,i=Uae(Bae((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=e,e+=r;return o}var Wae=Vae,Hae=RN,KO=1/0,Gae=17976931348623157e292;function Kae(e){if(!e)return e===0?e:0;if(e=Hae(e),e===KO||e===-KO){var t=e<0?-1:1;return t*Gae}return e===e?e:0}var yT=Kae,qae=Wae,Xae=Hh,Ry=yT;function Yae(e){return function(t,r,n){return n&&typeof n!="number"&&Xae(t,r,n)&&(r=n=void 0),t=Ry(t),r===void 0?(r=t,t=0):r=Ry(r),n=n===void 0?t0&&n.handleDrag(a.changedTouches[0])}),Lr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,s=a.startIndex;o==null||o({endIndex:i,startIndex:s})}),n.detachDragEndListener()}),Lr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Lr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Lr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Lr(n,"handleSlideDragStart",function(a){var i=QO(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return cie(t,e),oie(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,d=u.length-1,f=Math.min(a,i),p=Math.max(a,i),h=t.getIndexInRange(o,f),g=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:g===d?d:g-g%l}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,s=a.dataKey,l=It(i[n],s,n);return je(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,s=a.endX,l=this.props,u=l.x,d=l.width,f=l.travellerWidth,p=l.startIndex,h=l.endIndex,g=l.onChange,y=n.pageX-i;y>0?y=Math.min(y,u+d-f-s,u+d-f-o):y<0&&(y=Math.max(y,u-o,u-s));var v=this.getIndex({startX:o+y,endX:s+y});(v.startIndex!==p||v.endIndex!==h)&&g&&g(v),this.setState({startX:o+y,endX:s+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=QO(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,s=a.endX,l=a.startX,u=this.state[o],d=this.props,f=d.x,p=d.width,h=d.travellerWidth,g=d.onChange,y=d.gap,v=d.data,x={startX:this.state.startX,endX:this.state.endX},m=n.pageX-i;m>0?m=Math.min(m,f+p-h-u):m<0&&(m=Math.max(m,f-u)),x[o]=u+m;var w=this.getIndex(x),_=w.startIndex,b=w.endIndex,S=function(){var k=v.length-1;return o==="startX"&&(s>l?_%y===0:b%y===0)||sl?b%y===0:_%y===0)||s>l&&b===k};this.setState(Lr(Lr({},o,u+m),"brushMoveStartX",n.pageX),function(){g&&S()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,d=this.state[a],f=s.indexOf(d);if(f!==-1){var p=f+n;if(!(p===-1||p>=s.length)){var h=s[p];a==="startX"&&h>=u||a==="endX"&&h<=l||this.setState(Lr({},a,h),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return C.createElement("rect",{stroke:u,fill:l,x:a,y:i,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.data,u=n.children,d=n.padding,f=O.Children.only(u);return f?C.cloneElement(f,{x:a,y:i,width:o,height:s,margin:d,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,s=this,l=this.props,u=l.y,d=l.travellerWidth,f=l.height,p=l.traveller,h=l.ariaLabel,g=l.data,y=l.startIndex,v=l.endIndex,x=Math.max(n,this.props.x),m=My(My({},xe(this.props,!1)),{},{x,y:u,width:d,height:f}),w=h||"Min value: ".concat((i=g[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return C.createElement(Ve,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(b){["ArrowLeft","ArrowRight"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),s.handleTravellerMoveKeyboard(b.key==="ArrowRight"?1:-1,a))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,m))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,s=i.height,l=i.stroke,u=i.travellerWidth,d=Math.min(n,a)+u,f=Math.max(Math.abs(a-n)-u,0);return C.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:d,y:o,width:f,height:s})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,p=d.endX,h=5,g={pointerEvents:"none",fill:u};return C.createElement(Ve,{className:"recharts-brush-texts"},C.createElement(mo,Dp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,p)-h,y:o+s/2},g),this.getTextOfTick(a)),C.createElement(mo,Dp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,p)+l+h,y:o+s/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,s=n.x,l=n.y,u=n.width,d=n.height,f=n.alwaysShowText,p=this.state,h=p.startX,g=p.endX,y=p.isTextActive,v=p.isSlideMoving,x=p.isTravellerMoving,m=p.isTravellerFocused;if(!a||!a.length||!ne(s)||!ne(l)||!ne(u)||!ne(d)||u<=0||d<=0)return null;var w=Fe("recharts-brush",i),_=C.Children.count(o)===1,b=aie("userSelect","none");return C.createElement(Ve,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),_&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(g,"endX"),(y||v||x||m||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(i+s/2)-1;return C.createElement(C.Fragment,null,C.createElement("rect",{x:a,y:i,width:o,height:s,fill:l,stroke:"none"}),C.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),C.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return C.isValidElement(n)?i=C.cloneElement(n,a):je(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return My({prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},i&&i.length?die({data:i,width:o,x:s,travellerWidth:l,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||s!==a.prevX||l!==a.prevTravellerWidth)){a.scale.range([s,s+o-l]);var p=a.scale.domain().map(function(h){return a.scale(h)});return{prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,s=i-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>a?s=l:o=l}return a>=n[s]?s:o}}])}(O.PureComponent);Lr(Hs,"displayName","Brush");Lr(Hs,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var pie=$b;function hie(e,t){var r;return pie(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var mie=hie,yie=lN,vie=Zn,gie=mie,xie=Rr,bie=Hh;function wie(e,t,r){var n=xie(e)?yie:gie;return r&&bie(e,t,r)&&(t=void 0),n(e,vie(t))}var _ie=wie;const Sie=nt(_ie);var Gn=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},JO=NN;function jie(e,t,r){t=="__proto__"&&JO?JO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Oie=jie,kie=Oie,Aie=EN,Eie=Zn;function Pie(e,t){var r={};return t=Eie(t),Aie(e,function(n,a,i){kie(r,a,t(n,a,i))}),r}var Nie=Pie;const Cie=nt(Nie);function Tie(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Yie(e,t){var r=e.x,n=e.y,a=qie(e,Wie),i="".concat(r),o=parseInt(i,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),p=parseInt(f,10);return Hl(Hl(Hl(Hl(Hl({},t),a),o?{x:o}:{}),l?{y:l}:{}),{},{height:d,width:p,name:t.name,radius:t.radius})}function tk(e){return C.createElement(pT,O0({shapeType:"rectangle",propTransformer:Yie,activeClassName:"recharts-active-bar"},e))}var Zie=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=ne(n)||x6(n);return i?t(n,a):(i||go(),r)}},Qie=["value","background"],wT;function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function Jie(e,t){if(e==null)return{};var r=eoe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Fp(){return Fp=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(F)0&&Math.abs(D)0&&($=Math.min((Z||0)-(D[pe-1]||0),$))}),Number.isFinite($)){var F=$/N,V=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(j=F*V/2),y.padding==="no-gap"){var H=xr(t.barCategoryGap,F*V),L=F*V/2;j=L-H-(L-H)/V*H}}}a==="xAxis"?k=[n.left+(w.left||0)+(j||0),n.left+n.width-(w.right||0)-(j||0)]:a==="yAxis"?k=l==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(j||0),n.top+n.height-(w.bottom||0)-(j||0)]:k=y.range,b&&(k=[k[1],k[0]]);var U=BC(y,i,p),K=U.scale,Q=U.realScaleType;K.domain(x).range(k),UC(K);var G=VC(K,_n(_n({},y),{},{realScaleType:Q}));a==="xAxis"?(T=v==="top"&&!_||v==="bottom"&&_,A=n.left,R=f[S]-T*y.height):a==="yAxis"&&(T=v==="left"&&!_||v==="right"&&_,A=f[S]-T*y.width,R=n.top);var re=_n(_n(_n({},y),G),{},{realScaleType:Q,x:A,y:R,scale:K,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return re.bandSize=Sp(re,G),!y.hide&&a==="xAxis"?f[S]+=(T?-1:1)*re.height:y.hide||(f[S]+=(T?-1:1)*re.width),_n(_n({},h),{},lm({},g,re))},{})},OT=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},foe=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return OT({x:r,y:n},{x:a,y:i})},kT=function(){function e(t){loe(this,e),this.scale=t}return uoe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(a){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();lm(kT,"EPS",1e-4);var uw=function(t){var r=Object.keys(t).reduce(function(n,a){return _n(_n({},n),{},lm({},a,kT.create(t[a])))},{});return _n(_n({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,s=i.position;return Cie(a,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(a){return bT(a,function(i,o){return r[o].isInRange(i)})}})};function doe(e){return(e%180+180)%180}var poe=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=doe(a),o=i*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?a[i?t[o]:o]:void 0}}var goe=voe,xoe=yT;function boe(e){var t=xoe(e),r=t%1;return t===t?r?t-r:t:0}var woe=boe,_oe=_N,Soe=Zn,joe=woe,Ooe=Math.max;function koe(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:joe(r);return a<0&&(a=Ooe(n+a,0)),_oe(e,Soe(t),a)}var Aoe=koe,Eoe=goe,Poe=Aoe,Noe=Eoe(Poe),Coe=Noe;const Toe=nt(Coe);var $oe=OB(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),cw=O.createContext(void 0),fw=O.createContext(void 0),AT=O.createContext(void 0),ET=O.createContext({}),PT=O.createContext(void 0),NT=O.createContext(0),CT=O.createContext(0),ok=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,d=$oe(i);return C.createElement(cw.Provider,{value:n},C.createElement(fw.Provider,{value:a},C.createElement(ET.Provider,{value:i},C.createElement(AT.Provider,{value:d},C.createElement(PT.Provider,{value:o},C.createElement(NT.Provider,{value:u},C.createElement(CT.Provider,{value:l},s)))))))},Ioe=function(){return O.useContext(PT)},TT=function(t){var r=O.useContext(cw);r==null&&go();var n=r[t];return n==null&&go(),n},Roe=function(){var t=O.useContext(cw);return qa(t)},Moe=function(){var t=O.useContext(fw),r=Toe(t,function(n){return bT(n.domain,Number.isFinite)});return r||qa(t)},$T=function(t){var r=O.useContext(fw);r==null&&go();var n=r[t];return n==null&&go(),n},Doe=function(){var t=O.useContext(AT);return t},Loe=function(){return O.useContext(ET)},dw=function(){return O.useContext(CT)},pw=function(){return O.useContext(NT)};function Ks(e){"@babel/helpers - typeof";return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ks(e)}function Foe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zoe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function wse(e,t){return zT(e,t+1)}function _se(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,d=o,f=function(){var g=n==null?void 0:n[l];if(g===void 0)return{v:zT(n,u)};var y=l,v,x=function(){return v===void 0&&(v=r(g,y)),v},m=g.coordinate,w=l===0||Wp(e,m,x,d,s);w||(l=0,d=o,u+=1),w&&(d=m+e*(x()/2+a),l+=u)},p;u<=i.length;)if(p=f(),p)return p.v;return[]}function $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}function hk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t0?h.coordinate-v*e:h.coordinate})}else i[p]=h=cr(cr({},h),{},{tickCoord:h.coordinate});var x=Wp(e,h.tickCoord,y,s,l);x&&(l=h.tickCoord-e*(y()/2+a),i[p]=cr(cr({},h),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return i}function Ase(e,t,r,n,a,i){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(i){var d=n[s-1],f=r(d,s-1),p=e*(d.coordinate+e*f/2-u);o[s-1]=d=cr(cr({},d),{},{tickCoord:p>0?d.coordinate-p*e:d.coordinate});var h=Wp(e,d.tickCoord,function(){return f},l,u);h&&(u=d.tickCoord-e*(f/2+a),o[s-1]=cr(cr({},d),{},{isShow:!0}))}for(var g=i?s-1:s,y=function(m){var w=o[m],_,b=function(){return _===void 0&&(_=r(w,m)),_};if(m===0){var S=e*(w.coordinate-e*b()/2-l);o[m]=w=cr(cr({},w),{},{tickCoord:S<0?w.coordinate-S*e:w.coordinate})}else o[m]=w=cr(cr({},w),{},{tickCoord:w.coordinate});var j=Wp(e,w.tickCoord,b,l,u);j&&(l=w.tickCoord+e*(b()/2+a),o[m]=cr(cr({},w),{},{isShow:!0}))},v=0;v=2?gr(a[1].coordinate-a[0].coordinate):1,x=bse(i,v,h);return l==="equidistantPreserveStart"?_se(v,x,y,a,o):(l==="preserveStart"||l==="preserveStartEnd"?p=Ase(v,x,y,a,o,l==="preserveStartEnd"):p=kse(v,x,y,a,o),p.filter(function(m){return m.isShow}))}var Ese=["viewBox"],Pse=["viewBox"],Nse=["ticks"];function Ys(e){"@babel/helpers - typeof";return Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ys(e)}function rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cse(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yk(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!g||!g.length?null:C.createElement(Ve,{className:Fe("recharts-cartesian-axis",u),ref:function(v){n.layerReference=v}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Qt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,s=Fe(a.className,"recharts-cartesian-axis-tick-value");return C.isValidElement(n)?o=C.cloneElement(n,Bt(Bt({},a),{},{className:s})):je(n)?o=n(Bt(Bt({},a),{},{className:s})):o=C.createElement(mo,rs({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(O.Component);vw(Sl,"displayName","CartesianAxis");vw(Sl,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Fse=["x1","y1","x2","y2","key"],zse=["offset"];function xo(e){"@babel/helpers - typeof";return xo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xo(e)}function vk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function pr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Wse(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Hse=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,s=t.height,l=t.ry;return C.createElement("rect",{x:a,y:i,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function VT(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(je(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,s=t.key,l=gk(t,Fse),u=xe(l,!1);u.offset;var d=gk(u,zse);r=C.createElement("line",qi({},d,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:s}))}return r}function Gse(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=pr(pr({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return VT(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Kse(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=pr(pr({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return VT(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function qse(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var d=s.map(function(p){return Math.round(p+a-a)}).sort(function(p,h){return p-h});a!==d[0]&&d.unshift(0);var f=d.map(function(p,h){var g=!d[h+1],y=g?a+o-p:d[h+1]-p;if(y<=0)return null;var v=h%t.length;return C.createElement("rect",{key:"react-".concat(h),y:p,x:n,height:y,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Xse(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(p){return Math.round(p+i-i)}).sort(function(p,h){return p-h});i!==d[0]&&d.unshift(0);var f=d.map(function(p,h){var g=!d[h+1],y=g?i+s-p:d[h+1]-p;if(y<=0)return null;var v=h%n.length;return C.createElement("rect",{key:"react-".concat(h),x:p,y:o,width:y,height:l,stroke:"none",fill:n[v],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Yse=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return zC(yw(pr(pr(pr({},Sl.defaultProps),n),{},{ticks:da(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},Zse=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return zC(yw(pr(pr(pr({},Sl.defaultProps),n),{},{ticks:da(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Io={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function I0(e){var t,r,n,a,i,o,s=dw(),l=pw(),u=Loe(),d=pr(pr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Io.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Io.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Io.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Io.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Io.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Io.verticalFill,x:ne(e.x)?e.x:u.left,y:ne(e.y)?e.y:u.top,width:ne(e.width)?e.width:u.width,height:ne(e.height)?e.height:u.height}),f=d.x,p=d.y,h=d.width,g=d.height,y=d.syncWithTicks,v=d.horizontalValues,x=d.verticalValues,m=Roe(),w=Moe();if(!ne(h)||h<=0||!ne(g)||g<=0||!ne(f)||f!==+f||!ne(p)||p!==+p)return null;var _=d.verticalCoordinatesGenerator||Yse,b=d.horizontalCoordinatesGenerator||Zse,S=d.horizontalPoints,j=d.verticalPoints;if((!S||!S.length)&&je(b)){var k=v&&v.length,A=b({yAxis:w?pr(pr({},w),{},{ticks:k?v:w.ticks}):void 0,width:s,height:l,offset:u},k?!0:y);Pn(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(xo(A),"]")),Array.isArray(A)&&(S=A)}if((!j||!j.length)&&je(_)){var R=x&&x.length,T=_({xAxis:m?pr(pr({},m),{},{ticks:R?x:m.ticks}):void 0,width:s,height:l,offset:u},R?!0:y);Pn(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(xo(T),"]")),Array.isArray(T)&&(j=T)}return C.createElement("g",{className:"recharts-cartesian-grid"},C.createElement(Hse,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),C.createElement(Gse,qi({},d,{offset:u,horizontalPoints:S,xAxis:m,yAxis:w})),C.createElement(Kse,qi({},d,{offset:u,verticalPoints:j,xAxis:m,yAxis:w})),C.createElement(qse,qi({},d,{horizontalPoints:S})),C.createElement(Xse,qi({},d,{verticalPoints:j})))}I0.displayName="CartesianGrid";var Qse=["type","layout","connectNulls","ref"],Jse=["key"];function Zs(e){"@babel/helpers - typeof";return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs(e)}function xk(e,t){if(e==null)return{};var r=ele(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ele(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Eu(){return Eu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rf){h=[].concat(Ro(l.slice(0,g)),[f-y]);break}var v=h.length%2===0?[0,p]:[p];return[].concat(Ro(t.repeat(l,d)),Ro(h),v).map(function(x){return"".concat(x,"px")}).join(", ")}),Sn(r,"id",jo("recharts-line-")),Sn(r,"pathRef",function(o){r.mainCurve=o}),Sn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Sn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return cle(t,e),ole(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,s=i.xAxis,l=i.yAxis,u=i.layout,d=i.children,f=Hr(d,Jc);if(!f)return null;var p=function(y,v){return{x:y.x,y:y.y,value:y.value,errorVal:It(y.payload,v)}},h={clipPath:n?"url(#clipPath-".concat(a,")"):null};return C.createElement(Ve,h,f.map(function(g){return C.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:p})}))}},{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,d=s.dataKey,f=xe(this.props,!1),p=xe(l,!0),h=u.map(function(y,v){var x=Dr(Dr(Dr({key:"dot-".concat(v),r:3},f),p),{},{index:v,cx:y.x,cy:y.y,value:y.value,dataKey:d,payload:y.payload,points:u});return t.renderDotItem(l,x)}),g={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return C.createElement(Ve,Eu({className:"recharts-line-dots",key:"dots"},g),h)}},{key:"renderCurveStatically",value:function(n,a,i,o){var s=this.props,l=s.type,u=s.layout,d=s.connectNulls;s.ref;var f=xk(s,Qse),p=Dr(Dr(Dr({},xe(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:d});return C.createElement(ro,Eu({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,p=o.animationEasing,h=o.animationId,g=o.animateNewValues,y=o.width,v=o.height,x=this.state,m=x.prevPoints,w=x.totalLength;return C.createElement(Tn,{begin:d,duration:f,isActive:u,easing:p,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(_){var b=_.t;if(m){var S=m.length/s.length,j=s.map(function(N,$){var D=Math.floor($*S);if(m[D]){var F=m[D],V=Ht(F.x,N.x),H=Ht(F.y,N.y);return Dr(Dr({},N),{},{x:V(b),y:H(b)})}if(g){var L=Ht(y*2,N.x),U=Ht(v/2,N.y);return Dr(Dr({},N),{},{x:L(b),y:U(b)})}return Dr(Dr({},N),{},{x:N.x,y:N.y})});return i.renderCurveStatically(j,n,a)}var k=Ht(0,w),A=k(b),R;if(l){var T="".concat(l).split(/[,\s]+/gim).map(function(N){return parseFloat(N)});R=i.getStrokeDasharray(A,w,T)}else R=i.generateSimpleStrokeDasharray(w,A);return i.renderCurveStatically(s,n,a,{strokeDasharray:R})})}},{key:"renderCurve",value:function(n,a){var i=this.props,o=i.points,s=i.isAnimationActive,l=this.state,u=l.prevPoints,d=l.totalLength;return s&&o&&o.length&&(!u&&d>0||!yo(u,o))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(o,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.xAxis,d=a.yAxis,f=a.top,p=a.left,h=a.width,g=a.height,y=a.isAnimationActive,v=a.id;if(i||!s||!s.length)return null;var x=this.state.isAnimationFinished,m=s.length===1,w=Fe("recharts-line",l),_=u&&u.allowDataOverflow,b=d&&d.allowDataOverflow,S=_||b,j=Ne(v)?this.id:v,k=(n=xe(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=k.r,R=A===void 0?3:A,T=k.strokeWidth,N=T===void 0?2:T,$=$P(o)?o:{},D=$.clipDot,F=D===void 0?!0:D,V=R*2+N;return C.createElement(Ve,{className:w},_||b?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(j)},C.createElement("rect",{x:_?p:p-h/2,y:b?f:f-g/2,width:_?h:h*2,height:b?g:g*2})),!F&&C.createElement("clipPath",{id:"clipPath-dots-".concat(j)},C.createElement("rect",{x:p-V/2,y:f-V/2,width:h+V,height:g+V}))):null,!m&&this.renderCurve(S,j),this.renderErrorBar(S,j),(m||o)&&this.renderDots(S,F,j),(!y||x)&&Hn.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(Ro(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Xi(){return Xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!yo(d,o)||!yo(f,s))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(o,s,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.top,d=a.left,f=a.xAxis,p=a.yAxis,h=a.width,g=a.height,y=a.isAnimationActive,v=a.id;if(i||!s||!s.length)return null;var x=this.state.isAnimationFinished,m=s.length===1,w=Fe("recharts-area",l),_=f&&f.allowDataOverflow,b=p&&p.allowDataOverflow,S=_||b,j=Ne(v)?this.id:v,k=(n=xe(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=k.r,R=A===void 0?3:A,T=k.strokeWidth,N=T===void 0?2:T,$=$P(o)?o:{},D=$.clipDot,F=D===void 0?!0:D,V=R*2+N;return C.createElement(Ve,{className:w},_||b?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(j)},C.createElement("rect",{x:_?d:d-h/2,y:b?u:u-g/2,width:_?h:h*2,height:b?g:g*2})),!F&&C.createElement("clipPath",{id:"clipPath-dots-".concat(j)},C.createElement("rect",{x:d-V/2,y:u-V/2,width:h+V,height:g+V}))):null,m?null:this.renderArea(S,j),(o||m)&&this.renderDots(S,F,j),(!y||x)&&Hn.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(O.PureComponent);GT=Ai;zn(Ai,"displayName","Area");zn(Ai,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Si.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});zn(Ai,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,o=t.props.baseValue,s=o??i;if(ne(s)&&typeof s=="number")return s;var l=a==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return s==="dataMin"?f:s==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});zn(Ai,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,p=e.offset,h=t.layout,g=u&&u.length,y=GT.getBaseValue(t,r,n,a),v=h==="horizontal",x=!1,m=f.map(function(_,b){var S;g?S=u[d+b]:(S=It(_,l),Array.isArray(S)?x=!0:S=[y,S]);var j=S[1]==null||g&&It(_,l)==null;return v?{x:_p({axis:n,ticks:i,bandSize:s,entry:_,index:b}),y:j?null:a.scale(S[1]),value:S,payload:_}:{x:j?null:n.scale(S[1]),y:_p({axis:a,ticks:o,bandSize:s,entry:_,index:b}),value:S,payload:_}}),w;return g||x?w=m.map(function(_){var b=Array.isArray(_.value)?_.value[0]:null;return v?{x:_.x,y:b!=null&&_.y!=null?a.scale(b):null}:{x:b!=null?n.scale(b):null,y:_.y}}):w=v?a.scale(y):n.scale(y),Fa({points:m,baseLine:w,layout:h,isRange:x},p)});zn(Ai,"renderDotItem",function(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(je(e))r=e(t);else{var n=Fe("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=KT(t,ple);r=C.createElement(ef,Xi({},i,{key:a,className:n}))}return r});function Js(e){"@babel/helpers - typeof";return Js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Js(e)}function _le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sle(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uue(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fue(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&ne(a)&&ne(i)?t.slice(a,i+1):[]};function u$(e){return e==="number"?[0,"auto"]:void 0}var G0=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,s=pm(r,t);return n<0||!i||!i.length||n>=s.length?null:i.reduce(function(l,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=f===void 0?s:f;p=Kd(h,o.dataKey,a)}else p=f&&f[n]||s[n];return p?[].concat(rl(l),[HC(u,p)]):l},[])},Pk=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=Sue(i,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,d=CJ(o,s,u,l);if(d>=0&&u){var f=u[d]&&u[d].value,p=G0(t,r,d,f),h=jue(n,s,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:p,activeCoordinate:h}}return null},Oue=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,p=t.stackOffset,h=FC(d,i);return n.reduce(function(g,y){var v,x=y.type.defaultProps!==void 0?Y(Y({},y.type.defaultProps),y.props):y.props,m=x.type,w=x.dataKey,_=x.allowDataOverflow,b=x.allowDuplicatedCategory,S=x.scale,j=x.ticks,k=x.includeHidden,A=x[o];if(g[A])return g;var R=pm(t.data,{graphicalItems:a.filter(function(G){var re,Z=o in G.props?G.props[o]:(re=G.type.defaultProps)===null||re===void 0?void 0:re[o];return Z===A}),dataStartIndex:l,dataEndIndex:u}),T=R.length,N,$,D;Zle(x.domain,_,m)&&(N=a0(x.domain,null,_),h&&(m==="number"||S!=="auto")&&(D=ju(R,w,"category")));var F=u$(m);if(!N||N.length===0){var V,H=(V=x.domain)!==null&&V!==void 0?V:F;if(w){if(N=ju(R,w,m),m==="category"&&h){var L=w6(N);b&&L?($=N,N=Mp(0,T)):b||(N=Qj(H,N,y).reduce(function(G,re){return G.indexOf(re)>=0?G:[].concat(rl(G),[re])},[]))}else if(m==="category")b?N=N.filter(function(G){return G!==""&&!Ne(G)}):N=Qj(H,N,y).reduce(function(G,re){return G.indexOf(re)>=0||re===""||Ne(re)?G:[].concat(rl(G),[re])},[]);else if(m==="number"){var U=MJ(R,a.filter(function(G){var re,Z,pe=o in G.props?G.props[o]:(re=G.type.defaultProps)===null||re===void 0?void 0:re[o],ce="hide"in G.props?G.props.hide:(Z=G.type.defaultProps)===null||Z===void 0?void 0:Z.hide;return pe===A&&(k||!ce)}),w,i,d);U&&(N=U)}h&&(m==="number"||S!=="auto")&&(D=ju(R,w,"category"))}else h?N=Mp(0,T):s&&s[A]&&s[A].hasStack&&m==="number"?N=p==="expand"?[0,1]:WC(s[A].stackGroups,l,u):N=LC(R,a.filter(function(G){var re=o in G.props?G.props[o]:G.type.defaultProps[o],Z="hide"in G.props?G.props.hide:G.type.defaultProps.hide;return re===A&&(k||!Z)}),m,d,!0);if(m==="number")N=V0(f,N,A,i,j),H&&(N=a0(H,N,_));else if(m==="category"&&H){var K=H,Q=N.every(function(G){return K.indexOf(G)>=0});Q&&(N=K)}}return Y(Y({},g),{},Se({},A,Y(Y({},x),{},{axisType:i,domain:N,categoricalDomain:D,duplicateDomain:$,originalDomain:(v=x.domain)!==null&&v!==void 0?v:F,isCategorical:h,layout:d})))},{})},kue=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,p=pm(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=p.length,g=FC(d,i),y=-1;return n.reduce(function(v,x){var m=x.type.defaultProps!==void 0?Y(Y({},x.type.defaultProps),x.props):x.props,w=m[o],_=u$("number");if(!v[w]){y++;var b;return g?b=Mp(0,h):s&&s[w]&&s[w].hasStack?(b=WC(s[w].stackGroups,l,u),b=V0(f,b,w,i)):(b=a0(_,LC(p,n.filter(function(S){var j,k,A=o in S.props?S.props[o]:(j=S.type.defaultProps)===null||j===void 0?void 0:j[o],R="hide"in S.props?S.props.hide:(k=S.type.defaultProps)===null||k===void 0?void 0:k.hide;return A===w&&!R}),"number",d),a.defaultProps.allowDataOverflow),b=V0(f,b,w,i)),Y(Y({},v),{},Se({},w,Y(Y({axisType:i},a.defaultProps),{},{hide:!0,orientation:Wr(wue,"".concat(i,".").concat(y%2),null),domain:b,originalDomain:_,isCategorical:g,layout:d})))}return v},{})},Aue=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(a,"Id"),p=Hr(d,i),h={};return p&&p.length?h=Oue(t,{axes:p,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=kue(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Eue=function(t){var r=qa(t),n=da(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Ib(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Sp(r,n)}},Nk=function(t){var r=t.children,n=t.defaultShowTooltip,a=zr(r,Hs),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Pue=function(t){return!t||!t.length?!1:t.some(function(r){var n=ha(r&&r.type);return n&&n.indexOf("Bar")>=0})},Ck=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Nue=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,d=n.height,f=n.children,p=n.margin||{},h=zr(f,Hs),g=zr(f,ma),y=Object.keys(l).reduce(function(b,S){var j=l[S],k=j.orientation;return!j.mirror&&!j.hide?Y(Y({},b),{},Se({},k,b[k]+j.width)):b},{left:p.left||0,right:p.right||0}),v=Object.keys(o).reduce(function(b,S){var j=o[S],k=j.orientation;return!j.mirror&&!j.hide?Y(Y({},b),{},Se({},k,Wr(b,"".concat(k))+j.height)):b},{top:p.top||0,bottom:p.bottom||0}),x=Y(Y({},v),y),m=x.bottom;h&&(x.bottom+=h.props.height||Hs.defaultProps.height),g&&r&&(x=IJ(x,a,n,r));var w=u-x.left-x.right,_=d-x.top-x.bottom;return Y(Y({brushBottom:m},x),{},{width:Math.max(w,0),height:Math.max(_,0)})},Cue=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},hm=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,p=function(x,m){var w=m.graphicalItems,_=m.stackGroups,b=m.offset,S=m.updateId,j=m.dataStartIndex,k=m.dataEndIndex,A=x.barSize,R=x.layout,T=x.barGap,N=x.barCategoryGap,$=x.maxBarSize,D=Ck(R),F=D.numericAxisName,V=D.cateAxisName,H=Pue(w),L=[];return w.forEach(function(U,K){var Q=pm(x.data,{graphicalItems:[U],dataStartIndex:j,dataEndIndex:k}),G=U.type.defaultProps!==void 0?Y(Y({},U.type.defaultProps),U.props):U.props,re=G.dataKey,Z=G.maxBarSize,pe=G["".concat(F,"Id")],ce=G["".concat(V,"Id")],Ee={},Ie=l.reduce(function(Ze,W){var E=m["".concat(W.axisType,"Map")],M=G["".concat(W.axisType,"Id")];E&&E[M]||W.axisType==="zAxis"||go();var P=E[M];return Y(Y({},Ze),{},Se(Se({},W.axisType,P),"".concat(W.axisType,"Ticks"),da(P)))},Ee),te=Ie[V],oe=Ie["".concat(V,"Ticks")],he=_&&_[pe]&&_[pe].hasStack&&HJ(U,_[pe].stackGroups),X=ha(U.type).indexOf("Bar")>=0,Oe=Sp(te,oe),ge=[],_e=H&&TJ({barSize:A,stackGroups:_,totalSize:Cue(Ie,V)});if(X){var Ce,we,Re=Ne(Z)?$:Z,Te=(Ce=(we=Sp(te,oe,!0))!==null&&we!==void 0?we:Re)!==null&&Ce!==void 0?Ce:0;ge=$J({barGap:T,barCategoryGap:N,bandSize:Te!==Oe?Te:Oe,sizeList:_e[ce],maxBarSize:Re}),Te!==Oe&&(ge=ge.map(function(Ze){return Y(Y({},Ze),{},{position:Y(Y({},Ze.position),{},{offset:Ze.position.offset-Te/2})})}))}var $e=U&&U.type&&U.type.getComposedData;$e&&L.push({props:Y(Y({},$e(Y(Y({},Ie),{},{displayedData:Q,props:x,dataKey:re,item:U,bandSize:Oe,barPosition:ge,offset:b,stackedData:he,layout:R,dataStartIndex:j,dataEndIndex:k}))),{},Se(Se(Se({key:U.key||"item-".concat(K)},F,Ie[F]),V,Ie[V]),"animationId",S)),childIndex:$6(U,x.children),item:U})}),L},h=function(x,m){var w=x.props,_=x.dataStartIndex,b=x.dataEndIndex,S=x.updateId;if(!G_({props:w}))return null;var j=w.children,k=w.layout,A=w.stackOffset,R=w.data,T=w.reverseStackOrder,N=Ck(k),$=N.numericAxisName,D=N.cateAxisName,F=Hr(j,n),V=VJ(R,F,"".concat($,"Id"),"".concat(D,"Id"),A,T),H=l.reduce(function(G,re){var Z="".concat(re.axisType,"Map");return Y(Y({},G),{},Se({},Z,Aue(w,Y(Y({},re),{},{graphicalItems:F,stackGroups:re.axisType===$&&V,dataStartIndex:_,dataEndIndex:b}))))},{}),L=Nue(Y(Y({},H),{},{props:w,graphicalItems:F}),m==null?void 0:m.legendBBox);Object.keys(H).forEach(function(G){H[G]=d(w,H[G],L,G.replace("Map",""),r)});var U=H["".concat(D,"Map")],K=Eue(U),Q=p(w,Y(Y({},H),{},{dataStartIndex:_,dataEndIndex:b,updateId:S,graphicalItems:F,stackGroups:V,offset:L}));return Y(Y({formattedGraphicalItems:Q,graphicalItems:F,offset:L,stackGroups:V},K),H)},g=function(v){function x(m){var w,_,b;return cue(this,x),b=pue(this,x,[m]),Se(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Se(b,"accessibilityManager",new Yle),Se(b,"handleLegendBBoxUpdate",function(S){if(S){var j=b.state,k=j.dataStartIndex,A=j.dataEndIndex,R=j.updateId;b.setState(Y({legendBBox:S},h({props:b.props,dataStartIndex:k,dataEndIndex:A,updateId:R},Y(Y({},b.state),{},{legendBBox:S}))))}}),Se(b,"handleReceiveSyncEvent",function(S,j,k){if(b.props.syncId===S){if(k===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(j)}}),Se(b,"handleBrushChange",function(S){var j=S.startIndex,k=S.endIndex;if(j!==b.state.dataStartIndex||k!==b.state.dataEndIndex){var A=b.state.updateId;b.setState(function(){return Y({dataStartIndex:j,dataEndIndex:k},h({props:b.props,dataStartIndex:j,dataEndIndex:k,updateId:A},b.state))}),b.triggerSyncEvent({dataStartIndex:j,dataEndIndex:k})}}),Se(b,"handleMouseEnter",function(S){var j=b.getMouseInfo(S);if(j){var k=Y(Y({},j),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseEnter;je(A)&&A(k,S)}}),Se(b,"triggeredAfterMouseMove",function(S){var j=b.getMouseInfo(S),k=j?Y(Y({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseMove;je(A)&&A(k,S)}),Se(b,"handleItemMouseEnter",function(S){b.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),Se(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Se(b,"handleMouseMove",function(S){S.persist(),b.throttleTriggeredAfterMouseMove(S)}),Se(b,"handleMouseLeave",function(S){b.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};b.setState(j),b.triggerSyncEvent(j);var k=b.props.onMouseLeave;je(k)&&k(j,S)}),Se(b,"handleOuterEvent",function(S){var j=T6(S),k=Wr(b.props,"".concat(j));if(j&&je(k)){var A,R;/.*touch.*/i.test(j)?R=b.getMouseInfo(S.changedTouches[0]):R=b.getMouseInfo(S),k((A=R)!==null&&A!==void 0?A:{},S)}}),Se(b,"handleClick",function(S){var j=b.getMouseInfo(S);if(j){var k=Y(Y({},j),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var A=b.props.onClick;je(A)&&A(k,S)}}),Se(b,"handleMouseDown",function(S){var j=b.props.onMouseDown;if(je(j)){var k=b.getMouseInfo(S);j(k,S)}}),Se(b,"handleMouseUp",function(S){var j=b.props.onMouseUp;if(je(j)){var k=b.getMouseInfo(S);j(k,S)}}),Se(b,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),Se(b,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&b.handleMouseDown(S.changedTouches[0])}),Se(b,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&b.handleMouseUp(S.changedTouches[0])}),Se(b,"handleDoubleClick",function(S){var j=b.props.onDoubleClick;if(je(j)){var k=b.getMouseInfo(S);j(k,S)}}),Se(b,"handleContextMenu",function(S){var j=b.props.onContextMenu;if(je(j)){var k=b.getMouseInfo(S);j(k,S)}}),Se(b,"triggerSyncEvent",function(S){b.props.syncId!==void 0&&Ly.emit(Fy,b.props.syncId,S,b.eventEmitterSymbol)}),Se(b,"applySyncEvent",function(S){var j=b.props,k=j.layout,A=j.syncMethod,R=b.state.updateId,T=S.dataStartIndex,N=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)b.setState(Y({dataStartIndex:T,dataEndIndex:N},h({props:b.props,dataStartIndex:T,dataEndIndex:N,updateId:R},b.state)));else if(S.activeTooltipIndex!==void 0){var $=S.chartX,D=S.chartY,F=S.activeTooltipIndex,V=b.state,H=V.offset,L=V.tooltipTicks;if(!H)return;if(typeof A=="function")F=A(L,S);else if(A==="value"){F=-1;for(var U=0;U=0){var he,X;if($.dataKey&&!$.allowDuplicatedCategory){var Oe=typeof $.dataKey=="function"?oe:"payload.".concat($.dataKey.toString());he=Kd(U,Oe,F),X=K&&Q&&Kd(Q,Oe,F)}else he=U==null?void 0:U[D],X=K&&Q&&Q[D];if(ce||pe){var ge=S.props.activeIndex!==void 0?S.props.activeIndex:D;return[O.cloneElement(S,Y(Y(Y({},A.props),Ie),{},{activeIndex:ge})),null,null]}if(!Ne(he))return[te].concat(rl(b.renderActivePoints({item:A,activePoint:he,basePoint:X,childIndex:D,isRange:K})))}else{var _e,Ce=(_e=b.getItemByXY(b.state.activeCoordinate))!==null&&_e!==void 0?_e:{graphicalItem:te},we=Ce.graphicalItem,Re=we.item,Te=Re===void 0?S:Re,$e=we.childIndex,Ze=Y(Y(Y({},A.props),Ie),{},{activeIndex:$e});return[O.cloneElement(Te,Ze),null,null]}return K?[te,null,null]:[te,null]}),Se(b,"renderCustomized",function(S,j,k){return O.cloneElement(S,Y(Y({key:"recharts-customized-".concat(k)},b.props),b.state))}),Se(b,"renderMap",{CartesianGrid:{handler:Ff,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:Ff},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:Ff},YAxis:{handler:Ff},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((w=m.id)!==null&&w!==void 0?w:jo("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=MN(b.triggeredAfterMouseMove,(_=m.throttleDelay)!==null&&_!==void 0?_:1e3/60),b.state={},b}return yue(x,v),due(x,[{key:"componentDidMount",value:function(){var w,_;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,_=w.children,b=w.data,S=w.height,j=w.layout,k=zr(_,yr);if(k){var A=k.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var R=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,T=G0(this.state,b,A,R),N=this.state.tooltipTicks[A].coordinate,$=(this.state.offset.top+S)/2,D=j==="horizontal",F=D?{x:N,y:$}:{y:N,x:$},V=this.state.formattedGraphicalItems.find(function(L){var U=L.item;return U.type.name==="Scatter"});V&&(F=Y(Y({},F),V.props.points[A].tooltipPosition),T=V.props.points[A].tooltipPayload);var H={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:R,activePayload:T,activeCoordinate:F};this.setState(H),this.renderCursor(k),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,_){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==_.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var b,S;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(w){xg([zr(w.children,yr)],[zr(this.props.children,yr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=zr(this.props.children,yr);if(w&&typeof w.props.shared=="boolean"){var _=w.props.shared?"axis":"item";return s.indexOf(_)>=0?_:i}return i}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var _=this.container,b=_.getBoundingClientRect(),S=iX(b),j={chartX:Math.round(w.pageX-S.left),chartY:Math.round(w.pageY-S.top)},k=b.width/_.offsetWidth||1,A=this.inRange(j.chartX,j.chartY,k);if(!A)return null;var R=this.state,T=R.xAxisMap,N=R.yAxisMap,$=this.getTooltipEventType(),D=Pk(this.state,this.props.data,this.props.layout,A);if($!=="axis"&&T&&N){var F=qa(T).scale,V=qa(N).scale,H=F&&F.invert?F.invert(j.chartX):null,L=V&&V.invert?V.invert(j.chartY):null;return Y(Y({},j),{},{xValue:H,yValue:L},D)}return D?Y(Y({},j),D):null}},{key:"inRange",value:function(w,_){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,j=w/b,k=_/b;if(S==="horizontal"||S==="vertical"){var A=this.state.offset,R=j>=A.left&&j<=A.left+A.width&&k>=A.top&&k<=A.top+A.height;return R?{x:j,y:k}:null}var T=this.state,N=T.angleAxisMap,$=T.radiusAxisMap;if(N&&$){var D=qa(N);return tO({x:j,y:k},D)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,_=this.getTooltipEventType(),b=zr(w,yr),S={};b&&_==="axis"&&(b.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=qd(this.props,this.handleOuterEvent);return Y(Y({},j),S)}},{key:"addListener",value:function(){Ly.on(Fy,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Ly.removeListener(Fy,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,_,b){for(var S=this.state.formattedGraphicalItems,j=0,k=S.length;j_t(`/routing/list/active/${e}`)),n=t==null?void 0:t.find(T=>{var N;return((N=T.algorithm_data||T.algorithm)==null?void 0:N.type)==="volume_split"}),[a,i]=O.useState([{id:Gl(),name:"",split:50},{id:Gl(),name:"",split:50}]),[o,s]=O.useState(""),[l,u]=O.useState(!1),[d,f]=O.useState(null),[p,h]=O.useState(null),[g,y]=O.useState(!1),[v,x]=O.useState(new Set),m=a.reduce((T,N)=>T+N.split,0);function w(T,N,$){i(D=>D.map(F=>F.id===T?{...F,[N]:$}:F))}function _(){i(T=>[...T,{id:Gl(),name:"",split:0}])}function b(T){i(N=>N.filter($=>$.id!==T))}async function S(){if(!e)return f("Set a merchant ID first");if(!o.trim())return f("Enter a rule name");if(m!==100)return f(`Splits must sum to 100 (currently ${m})`);if(a.some(T=>!T.name.trim()))return f("All gateways must have names");u(!0),f(null),h(null);try{await _t("/routing/create",{rule_id:null,name:o,description:"",created_by:e,algorithm_for:"payment",metadata:null,algorithm:{type:"volume_split",data:a.map(T=>({split:T.split,output:{gateway_name:T.name.trim(),gateway_id:null}}))}}),h(`Rule "${o}" created successfully. Find it in the list below to activate.`),r(),s(""),i([{id:Gl(),name:"",split:50},{id:Gl(),name:"",split:50}])}catch(T){f(T instanceof Error?T.message:"Failed to create rule")}finally{u(!1)}}async function j(T){if(e)try{await _t("/routing/activate",{created_by:e,routing_algorithm_id:T}),r(),h("Rule activated.")}catch(N){f(N instanceof Error?N.message:"Failed to activate")}}function k(T){x(N=>{const $=new Set(N);return $.has(T)?$.delete(T):$.add(T),$})}const A=n?n.algorithm_data||n.algorithm:null,R=A&&"data"in A?A.data.map(T=>{var N;return{name:((N=T.output)==null?void 0:N.gateway_name)??"?",value:T.split}}):[];return c.jsxs("div",{className:"space-y-6 max-w-4xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Volume Split Routing"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Distribute payment traffic across gateways by percentage."})]}),n&&c.jsxs(ke,{children:[c.jsxs(qe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Volume Split"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n.name})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ze,{variant:"green",children:"Active"}),c.jsxs(Be,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(!g),children:[c.jsx(yh,{size:14,className:"mr-1"}),g?"Hide":"View"]})]})]}),g&&c.jsxs(Ae,{children:[c.jsx(hs,{width:"100%",height:220,children:c.jsxs(c$,{children:[c.jsx(Qn,{data:R,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:T,value:N})=>`${T}: ${N}%`,labelLine:{stroke:"#45454f"},children:R.map((T,N)=>c.jsx(Ji,{fill:$k[N%$k.length]},N))}),c.jsx(yr,{formatter:T=>`${T}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),c.jsx(ma,{wrapperStyle:{color:"#8e8ea0"}})]})}),c.jsxs("div",{className:"mt-4 text-xs text-slate-600",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Rule ID:"})," ",n.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",n.created_at?new Date(n.created_at).toLocaleString():"Unknown"]})]})]})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"Create Volume Split Rule"})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Rule Name"}),c.jsx("input",{value:o,onChange:T=>s(T.target.value),placeholder:"e.g. ab-test-split",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 text-xs font-medium text-slate-500 px-1",children:[c.jsx("span",{children:"Gateway Name"}),c.jsx("span",{children:"Split %"}),c.jsx("span",{})]}),a.map(T=>c.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 items-center",children:[c.jsx("input",{value:T.name,onChange:N=>w(T.id,"name",N.target.value),placeholder:"e.g. stripe",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{type:"number",min:0,max:100,value:T.split,onChange:N=>w(T.id,"split",Number(N.target.value)),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>b(T.id),className:"text-slate-400 hover:text-red-500",children:c.jsx(wa,{size:15})})]},T.id)),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{onClick:_,className:"flex items-center gap-1 text-sm text-brand-500 hover:text-brand-600",children:[c.jsx(hi,{size:14})," Add Gateway"]}),c.jsxs("span",{className:`text-xs font-medium ${m===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",m,"%",m!==100&&" (must be 100)"]})]})]}),c.jsx(ln,{error:d}),p&&c.jsx("p",{className:"text-sm text-emerald-400",children:p}),c.jsx(Be,{onClick:S,disabled:l||!e,children:l?c.jsxs(c.Fragment,{children:[c.jsx(Ar,{size:14})," Creating…"]}):"Create Rule"})]})]}),c.jsx(Rue,{merchantId:e,onActivate:j,expandedRuleIds:v,onToggleExpand:k})]})}function Rue({merchantId:e,onActivate:t,expandedRuleIds:r,onToggleExpand:n}){const{data:a,isLoading:i}=ir(e?["routing-list",e]:null,()=>_t(`/routing/list/${e}`)),o=(a==null?void 0:a.filter(s=>{var l;return((l=s.algorithm_data||s.algorithm)==null?void 0:l.type)==="volume_split"}))??[];return e?i?c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(Ar,{})}):o.length?c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"Saved Volume Split Rules"})}),c.jsx(Ae,{className:"p-0",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 uppercase tracking-wider",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2",children:"Name"}),c.jsx("th",{className:"text-left px-4 py-2",children:"Split"}),c.jsx("th",{className:"px-4 py-2"})]})}),c.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:o.map(s=>{const l=s.algorithm_data||s.algorithm,u=(l==null?void 0:l.data)||[],d=r.has(s.id);return c.jsxs(c.Fragment,{children:[c.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[c.jsx("td",{className:"px-4 py-2 font-medium text-slate-800",children:s.name}),c.jsx("td",{className:"px-4 py-2 text-slate-600 text-xs",children:u.map(f=>{var p;return`${(p=f.output)==null?void 0:p.gateway_name}:${f.split}%`}).join(" | ")}),c.jsx("td",{className:"px-4 py-2 text-right",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsxs(Be,{size:"sm",variant:"ghost",onClick:()=>n(s.id),children:[c.jsx(yh,{size:14,className:"mr-1"}),d?"Hide":"View"]}),c.jsx(Be,{size:"sm",variant:"secondary",onClick:()=>t(s.id),children:"Activate"})]})})]},s.id),d&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:c.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"ID:"})," ",s.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Description:"})," ",s.description||"N/A"]}),s.created_at&&c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",new Date(s.created_at).toLocaleString()]}),c.jsxs("div",{children:[c.jsx("strong",{children:"Configuration:"}),c.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(l,null,2)})]})]})})})]})})})]})})]}):null:null}function Mue(){var m;const{merchantId:e}=Xn(),{data:t,mutate:r,isLoading:n}=ir(e?["rule-debit",e]:null,()=>_t("/rule/get",{merchant_id:e,config:{type:"debitRouting"}})),[a,i]=O.useState(""),[o,s]=O.useState(""),[l,u]=O.useState(!1),[d,f]=O.useState(null),[p,h]=O.useState(null),g=(m=t==null?void 0:t.config)==null?void 0:m.data,y=a||(g==null?void 0:g.merchant_category_code)||"",v=o||(g==null?void 0:g.acquirer_country)||"";async function x(){if(!e)return f("Set a merchant ID first");const w={merchant_id:e,config:{type:"debitRouting",data:{merchant_category_code:y.trim(),acquirer_country:v.trim()}}};u(!0),f(null);try{await _t(t?"/rule/update":"/rule/create",w),h("Debit routing config saved."),r()}catch(_){f(_ instanceof Error?_.message:"Failed to save")}finally{u(!1)}}return c.jsxs("div",{className:"space-y-6 max-w-2xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Network / Debit Routing"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Configure network-based routing to optimise processing fees for debit card transactions. The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR)."})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(hE,{size:16,className:"text-brand-500"}),c.jsx("h2",{className:"font-medium text-slate-800",children:"Debit Routing Configuration"})]})}),c.jsx(Ae,{className:"space-y-4",children:n?c.jsx("div",{className:"flex justify-center py-6",children:c.jsx(Ar,{})}):c.jsxs(c.Fragment,{children:[!e&&c.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar to load configuration."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Merchant Category Code (MCC)"}),c.jsx("input",{value:y,onChange:w=>i(w.target.value),placeholder:"e.g. 5411",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"4-digit ISO MCC for your business type"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Acquirer Country"}),c.jsx("input",{value:v,onChange:w=>s(w.target.value),placeholder:"e.g. US",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"ISO 3166-1 alpha-2 country code"})]})]}),c.jsx(ln,{error:d}),p&&c.jsx("p",{className:"text-sm text-emerald-400",children:p}),c.jsx(Be,{onClick:x,disabled:l||!e,children:l?c.jsxs(c.Fragment,{children:[c.jsx(Ar,{size:14})," Saving…"]}):t?"Update Config":"Save Config"})]})})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"How Network Routing Works"})}),c.jsxs(Ae,{className:"text-sm text-slate-600 space-y-2",children:[c.jsx("p",{children:"For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee."}),c.jsxs("p",{children:["Supported networks: ",["VISA","MASTERCARD","ACCEL","NYCE","PULSE","STAR"].map(w=>c.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md mr-1 text-slate-700",children:w},w))]}),c.jsxs("p",{children:["Use the ",c.jsx("strong",{className:"text-slate-800",children:"Decision Explorer"})," to test network routing decisions with ",c.jsx("code",{className:"text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md text-brand-500",children:"NtwBasedRouting"})," algorithm."]})]})]})]})}const Due=["SR_BASED_ROUTING","PL_BASED_ROUTING","NTW_BASED_ROUTING"],Lue={SR_BASED_ROUTING:"Success Rate Based",PL_BASED_ROUTING:"Priority List Based",NTW_BASED_ROUTING:"Network Based"};function Fue(e){for(const[t,r]of Object.entries(V3))if(e.includes(t)||t.includes(e))return r;return"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8"}const jr=["#0069ED","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function od(e=[]){return e.map(t=>t.trim()).filter(Boolean).map(t=>t.toUpperCase())}function By(e=[]){return Array.from(new Set(od(e)))}function zue(e){return function(){let r=e+=1831565813;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function Bue(e,t){const r=Math.max(0,t);if(!e.length||r===0)return[];const n=[];e.forEach((l,u)=>{for(let d=0;d({connector:l.name,colorIdx:u,percentage:l.percentage})).sort((l,u)=>u.percentage-l.percentage);for(;n.lengthr&&(n.length=r);const i=e.reduce((l,u,d)=>{const f=Array.from(u.name).reduce((p,h)=>p+h.charCodeAt(0),0);return l+f+d*31+u.count*17+Math.round(u.percentage*10)},r*13),o=zue(i),s=[...n];for(let l=s.length-1;l>0;l-=1){const u=Math.floor(o()*(l+1));[s[l],s[u]]=[s[u],s[l]]}return s}function Uy(e){return e==="enum"?"enum_variant":e==="integer"?"number":e==="udf"||e==="global_ref"?"metadata_variant":"str_value"}function Uue(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function K0(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function ei(e){return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase()):""}function q0(e){return e?e==="decision_gateway"||e==="decide_gateway"?"Decide Gateway":e==="update_gateway_score"?"Update Gateway":e==="routing_evaluate"?"Rule Evaluate":ei(e):"Unknown route"}function Vue(e){return e?e==="decision"?"Decide Gateway":e==="gateway_update"?"Update Gateway":e==="rule_hit"?"Rule Evaluate":e==="error"?"Errors":ei(e):"Unknown event"}function X0(e){return e.event_stage==="gateway_decided"?"Decide Gateway":e.event_stage==="score_updated"?"Update Gateway":e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="error"?"Errors":ei(e.event_stage||e.event_type)}function f$(e){return e.event_type==="decision"||e.event_stage==="gateway_decided"?"Decide Gateway":e.event_type==="rule_hit"||e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="gateway_update"||e.event_stage==="score_updated"?"Update Gateway":"Errors"}function Ik(e){const t=(e.status||"").toUpperCase();return e.event_type==="error"||t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":e.event_type==="rule_hit"?"purple":t==="CHARGED"||t==="AUTHORIZED"||t==="SUCCESS"||e.event_type==="gateway_update"?"green":e.event_type==="decision"?"blue":"orange"}function Wue(e){const t=(e||"").toUpperCase();return t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":t==="SUCCESS"||t==="CHARGED"||t==="AUTHORIZED"?"green":"gray"}function Hue(e){return e==="Decide Gateway"?"blue":e==="Rule Evaluate"?"purple":e==="Update Gateway"?"green":e==="Errors"?"red":"gray"}function Kl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Vy(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}function d$(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function Gue(e,t){return`/analytics/payment-audit?${Uue({scope:"current",range:"24h",page:1,page_size:25,merchant_id:e,payment_id:t})}`}function Kue(e){if(!e)return null;const t=Kl(e.details_json)?e.details_json:{},r=t.response??t.response_payload??t.result??t.output??null,n=t.request??t.request_payload??t.input??t.payload??Vy({payment_id:e.payment_id,request_id:e.request_id,payment_method_type:e.payment_method_type,payment_method:e.payment_method,gateway:e.gateway}),a=r??Vy({event_type:e.event_type,status:e.status,error_code:e.error_code,error_message:e.error_message,score_value:e.score_value,sigma_factor:e.sigma_factor,average_latency:e.average_latency,tp99_latency:e.tp99_latency,transaction_count:e.transaction_count,rule_name:e.rule_name,routing_approach:e.routing_approach}),i=Kl(r)?r:null,o=Kl(i==null?void 0:i.decided_gateway)?i.decided_gateway:null,s=t.score_context??(o?o.gateway_priority_map:null)??(i?i.gateway_priority_map:null)??null,l=t.selection_reason??null,u=[{label:"Phase",value:f$(e)},{label:"Stage",value:X0(e)},{label:"Route",value:q0(e.route)},{label:"Timestamp",value:K0(e.created_at_ms)},...e.merchant_id?[{label:"Merchant",value:e.merchant_id}]:[],...e.payment_id?[{label:"Payment ID",value:e.payment_id}]:[],...e.request_id?[{label:"Request ID",value:e.request_id}]:[],...e.gateway?[{label:"Gateway",value:e.gateway}]:[],...e.status?[{label:"Status",value:ei(e.status)}]:[]],d=Vy(Object.fromEntries(Object.entries(t).filter(([f])=>!["request","request_payload","input","payload","response","response_payload","result","output","score_context","selection_reason"].includes(f))));return{summaryRows:u,requestPayload:Kl(n)&&!Object.keys(n).length?null:n,responsePayload:Kl(a)&&!Object.keys(a).length?null:a,scoreContext:s,selectionReason:l,signalRecord:Object.keys(d).length?d:null,rawEvent:{...e,details_json:e.details_json}}}function que(e){return e?"bg-brand-600 text-white":"bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]"}function Y0({title:e,body:t}){return c.jsxs("div",{className:"rounded-[22px] border border-dashed border-slate-200 bg-slate-50/80 px-6 py-12 text-center dark:border-[#1f1f26] dark:bg-[#0b0b0f]",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function Xue({rows:e}){return e.length?c.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(t=>c.jsxs("div",{className:"rounded-[20px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:t.label}),c.jsx("p",{className:"mt-2 break-words text-sm text-slate-900 dark:text-white",children:t.value})]},`${t.label}-${t.value}`))}):null}function ql({title:e,value:t,emptyMessage:r}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{children:c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e})}),t?c.jsx("pre",{className:"overflow-x-auto rounded-[22px] bg-slate-950 px-4 py-4 text-xs leading-6 text-slate-200",children:d$(t)}):c.jsx(Y0,{title:`No ${e.toLowerCase()} captured`,body:r})]})}function Yue(){var Ni,Eo,Ci,zt;const{merchantId:e}=Xn(),{routingKeysConfig:t,isLoading:r,error:n}=vP(),a=Object.keys(t).length>0,i=!r&&(!a||!!n),[o,s]=O.useState("single"),[l,u]=O.useState({amount:"1000",currency:"",payment_method_type:"",payment_method:"",card_brand:"",auth_type:"",eligible_gateways:"stripe, adyen",ranking_algorithm:"SR_BASED_ROUTING",elimination_enabled:!1}),[d,f]=O.useState({totalPayments:"10",successCount:"7",failureCount:"3"}),[p,h]=O.useState([{key:"payment_method_type",type:"enum_variant",value:"",metadataKey:""},{key:"currency",type:"enum_variant",value:"",metadataKey:""}]),[g,y]=O.useState([{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}]),[v,x]=O.useState("100"),[m,w]=O.useState(null),[_,b]=O.useState(null),[S,j]=O.useState([]),[k,A]=O.useState([]),[R,T]=O.useState(!1),[N,$]=O.useState(null),[D,F]=O.useState(!1),[V,H]=O.useState(!1),[L,U]=O.useState(!1),[K,Q]=O.useState(!1),[G,re]=O.useState(null),[Z,pe]=O.useState(null),[ce,Ee]=O.useState("summary"),Ie=O.useMemo(()=>Object.keys(t).sort(),[t]),te=O.useMemo(()=>{var I;return od(((I=t.payment_method)==null?void 0:I.values)||[])},[t]),oe=O.useMemo(()=>{var B;const I=l.payment_method_type.toLowerCase();return od(((B=t[I])==null?void 0:B.values)||[])},[l.payment_method_type,t]),he=O.useMemo(()=>{var I;return By(((I=t.currency)==null?void 0:I.values)||[])},[t]),X=O.useMemo(()=>{var I;return By(((I=t.card_network)==null?void 0:I.values)||[])},[t]),Oe=O.useMemo(()=>{var I;return By(((I=t.authentication_type)==null?void 0:I.values)||[])},[t]),ge=e&&G?Gue(e,G):null,_e=ir(ge,Qi,{refreshInterval:G?12e3:0,revalidateOnFocus:!0});O.useEffect(()=>{i||r||(u(I=>{var me;const B={...I};he.length>0&&!he.includes(B.currency)&&(B.currency=he[0]),te.length>0&&!te.includes(B.payment_method_type)&&(B.payment_method_type=te[0]);const se=od(((me=t[B.payment_method_type.toLowerCase()])==null?void 0:me.values)||[]);return se.length>0&&!se.includes(B.payment_method)&&(B.payment_method=se[0]),Oe.length>0&&!Oe.includes(B.auth_type)&&(B.auth_type=Oe[0]),X.length>0&&!X.includes(B.card_brand)&&(B.card_brand=X[0]),B}),h(I=>I.map(B=>{if(!B.key||!t[B.key])return B;const se=t[B.key],me=Uy(se.type),He=se.values||[],Pt=me==="enum_variant"?He.includes(B.value)?B.value:He[0]||"":B.value;return{...B,type:me,value:Pt}})))},[i,r,t,he,te,Oe,X]),O.useEffect(()=>{if(!G)return;const I=document.body.style.overflow,B=se=>{se.key==="Escape"&&(re(null),pe(null),Ee("summary"))};return document.body.style.overflow="hidden",window.addEventListener("keydown",B),()=>{document.body.style.overflow=I,window.removeEventListener("keydown",B)}},[G]);function Ce(I,B){u(se=>({...se,[I]:B}))}function we(){var He;if(Ie.length===0)return;const I=Ie[0],B=t[I],se=Uy(B==null?void 0:B.type),me=se==="enum_variant"&&((He=B==null?void 0:B.values)==null?void 0:He[0])||"";h([...p,{key:I,type:se,value:me,metadataKey:""}])}function Re(I){h(p.filter((B,se)=>se!==I))}function Te(I,B,se){h(p.map((me,He)=>He===I?{...me,[B]:se}:me))}function $e(I,B){h(p.map((se,me)=>me===I?{...se,metadataKey:B}:se))}function Ze(I,B){var Pt;const se=t[B],me=Uy(se==null?void 0:se.type),He=me==="enum_variant"&&((Pt=se==null?void 0:se.values)==null?void 0:Pt[0])||"";h(p.map((mt,ct)=>ct===I?{...mt,key:B,type:me,value:He,metadataKey:""}:mt))}function W(){y([...g,{gateway_name:"",gateway_id:""}])}function E(I){y(g.filter((B,se)=>se!==I))}function M(I,B,se){y(g.map((me,He)=>He===I?{...me,[B]:se}:me))}async function P(){if(!e)return $("Set a merchant ID in the top bar");if(i)return $("Routing key config unavailable. Fix /config/routing-keys and retry.");F(!0),$(null);const I=l.eligible_gateways.split(",").map(B=>B.trim()).filter(Boolean);try{const B=await _t("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:`explorer_${Date.now()}`,amount:parseFloat(l.amount)||1e3,currency:l.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:l.payment_method_type,paymentMethod:l.payment_method,authType:l.auth_type,cardBrand:l.card_brand},eligibleGatewayList:I,rankingAlgorithm:l.ranking_algorithm,eliminationEnabled:l.elimination_enabled});w(B)}catch(B){$(B instanceof Error?B.message:"Request failed")}finally{F(!1)}}async function z(){if(!e)return $("Set a merchant ID in the top bar");if(i)return $("Routing key config unavailable. Fix /config/routing-keys and retry.");const I=parseInt(d.totalPayments)||0,B=parseInt(d.successCount)||0,se=parseInt(d.failureCount)||0;if(I<=0)return $("Total Payments must be greater than 0");if(B+se!==I)return $("Success + Failure count must equal Total Payments");T(!0),$(null),A([]);const me=l.eligible_gateways.split(",").map(mt=>mt.trim()).filter(Boolean),He=[],Pt=[...Array(B).fill("CHARGED"),...Array(se).fill("FAILURE")];for(let mt=Pt.length-1;mt>0;mt--){const ct=Math.floor(Math.random()*(mt+1));[Pt[mt],Pt[ct]]=[Pt[ct],Pt[mt]]}try{for(let mt=0;mt{se.key&&(se.type==="metadata_variant"?I[se.key]={type:se.type,value:{key:se.metadataKey||se.key,value:se.value}}:se.type==="number"?I[se.key]={type:se.type,value:parseFloat(se.value)||0}:I[se.key]={type:se.type,value:se.value})});const B=await _t("/routing/evaluate",{created_by:e||"test_user",fallback_output:g.filter(se=>se.gateway_name),parameters:I});if(b(B),B.output.type==="volume_split"&&B.output.splits){const se=parseInt(v)||100,me=B.output.splits.map(He=>({name:He.connector.gateway_name,count:Math.round(He.split/100*se),percentage:He.split}));j(me)}}catch(I){$(I instanceof Error?I.message:"Request failed")}finally{F(!1)}}async function J(){F(!0),$(null),j([]);try{const I=await _t("/routing/evaluate",{created_by:e||"test_user",fallback_output:[{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}],parameters:{}});if(b(I),I.output.type==="volume_split"&&I.output.splits){const B=parseInt(v)||100,se=I.output.splits.map(me=>({name:me.connector.gateway_name,count:Math.round(me.split/100*B),percentage:me.split}));j(se)}}catch(I){$(I instanceof Error?I.message:"Request failed")}finally{F(!1)}}const ee=m!=null&&m.gateway_priority_map?Object.entries(m.gateway_priority_map).sort(([,I],[,B])=>B-I).map(([I,B])=>({name:I,score:Math.round(B*1e3)/10})):[],be=k.reduce((I,B)=>(I[B.decidedGateway]||(I[B.decidedGateway]={total:0,success:0,failure:0}),I[B.decidedGateway].total++,B.status==="CHARGED"?I[B.decidedGateway].success++:I[B.decidedGateway].failure++,I),{}),Pe=S.map(I=>({name:I.name,value:I.count})),Et=O.useMemo(()=>Bue(S,parseInt(v)||0),[S,v]),et=O.useMemo(()=>{var B;const I=((B=_e.data)==null?void 0:B.results)||[];return I.find(se=>se.payment_id===G)||I[0]||null},[(Ni=_e.data)==null?void 0:Ni.results,G]),Le=O.useMemo(()=>{var B;const I=((B=_e.data)==null?void 0:B.timeline)||[];return I.find(se=>se.id===Z)||I[0]||null},[(Eo=_e.data)==null?void 0:Eo.timeline,Z]);O.useEffect(()=>{var B,se;if(Le!=null&&Le.id){pe(Le.id);return}const I=(se=(B=_e.data)==null?void 0:B.timeline)==null?void 0:se[0];I!=null&&I.id&&pe(I.id)},[(Ci=_e.data)==null?void 0:Ci.timeline,Le==null?void 0:Le.id]);const Ia=O.useMemo(()=>{var B;const I=[];for(const se of((B=_e.data)==null?void 0:B.timeline)||[]){const me=f$(se),He=I[I.length-1];!He||He.phase!==me?I.push({phase:me,events:[se]}):He.events.push(se)}return I},[(zt=_e.data)==null?void 0:zt.timeline]),tr=O.useMemo(()=>Kue(Le),[Le]);function Ei(I){re(I),pe(null),Ee("summary")}function Pi(){re(null),pe(null),Ee("summary")}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Decision Explorer"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split."})]}),c.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-[#1c1c24]",children:[c.jsx("button",{onClick:()=>s("single"),className:`px-4 py-2 text-sm font-medium ${o==="single"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Single Test"}),c.jsx("button",{onClick:()=>s("batch"),className:`px-4 py-2 text-sm font-medium ${o==="batch"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Batch Simulation"}),c.jsx("button",{onClick:()=>s("rule"),className:`px-4 py-2 text-sm font-medium ${o==="rule"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Rule-Based"}),c.jsx("button",{onClick:()=>s("volume"),className:`px-4 py-2 text-sm font-medium ${o==="volume"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Volume Split"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:o==="rule"?"Rule Evaluation Parameters":o==="volume"?"Volume Split Configuration":"Payment Parameters"})}),c.jsxs(Ae,{className:"space-y-3",children:[!e&&o!=="volume"&&c.jsx("p",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar first."}),o!=="volume"&&r&&c.jsx("p",{className:"text-xs text-slate-600 bg-slate-50 border border-slate-200 rounded px-3 py-2",children:"Loading routing config from backend..."}),o!=="volume"&&i&&c.jsx(ln,{error:"Routing config unavailable from /config/routing-keys. Parameter forms are disabled."}),o==="rule"?c.jsxs(c.Fragment,{children:[r&&c.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),i&&c.jsx(ln,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Evaluation is disabled."}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Parameters"}),c.jsx("div",{className:"space-y-2",children:p.map((I,B)=>{var se;return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx("select",{value:I.key,onChange:me=>Ze(B,me.target.value),disabled:i||r,className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Ie.length===0?c.jsx("option",{value:"",children:"No keys available"}):Ie.map(me=>c.jsx("option",{value:me,children:me},me))}),c.jsx("input",{value:I.type,readOnly:!0,className:"w-36 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>Re(B),className:"p-1.5 text-slate-400 hover:text-red-500",children:c.jsx(wa,{size:14})})]}),I.type==="metadata_variant"?c.jsxs("div",{className:"flex gap-2 items-center pl-1",children:[c.jsx("input",{placeholder:"Metadata Key",value:I.metadataKey||"",onChange:me=>$e(B,me.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{placeholder:"Metadata Value",value:I.value,onChange:me=>Te(B,"value",me.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}):I.type==="enum_variant"?c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("select",{value:I.value,onChange:me=>Te(B,"value",me.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(((se=t[I.key])==null?void 0:se.values)||[]).map(me=>c.jsx("option",{value:me,children:me},me))})}):I.type==="number"?c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("input",{type:"number",placeholder:"Value",value:I.value,onChange:me=>Te(B,"value",me.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})}):c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("input",{placeholder:"Value",value:I.value,onChange:me=>Te(B,"value",me.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})})]},B)})}),c.jsxs("button",{onClick:we,disabled:i||r||Ie.length===0,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[c.jsx(hi,{size:12})," Add Parameter"]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Fallback gateway_name/gateway_id"}),c.jsx("div",{className:"space-y-2",children:g.map((I,B)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx("input",{placeholder:"gateway_name",value:I.gateway_name,onChange:se=>M(B,"gateway_name",se.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{placeholder:"gateway_id",value:I.gateway_id||"",onChange:se=>M(B,"gateway_id",se.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>E(B),className:"p-1.5 text-slate-400 hover:text-red-500",children:c.jsx(wa,{size:14})})]},B))}),c.jsxs("button",{onClick:W,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[c.jsx(hi,{size:12})," Add Gateway"]})]})]}):o==="volume"?c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Number of Payments"}),c.jsx("input",{type:"text",value:v,onChange:I=>x(I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Enter the total number of payments to visualize how they would be distributed across gateways."})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Amount"}),c.jsx("input",{value:l.amount,onChange:I=>Ce("amount",I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Currency"}),c.jsx("select",{value:l.currency,onChange:I=>Ce("currency",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:he.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method Type"}),c.jsx("select",{value:l.payment_method_type,onChange:I=>Ce("payment_method_type",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:te.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method"}),c.jsx("select",{value:l.payment_method,onChange:I=>Ce("payment_method",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:oe.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Card Brand"}),c.jsx("select",{value:l.card_brand,onChange:I=>Ce("card_brand",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:X.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Auth Type"}),c.jsx("select",{value:l.auth_type,onChange:I=>Ce("auth_type",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Oe.map(I=>c.jsx("option",{children:I},I))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Eligible Gateways (comma-separated)"}),c.jsx("input",{value:l.eligible_gateways,onChange:I=>Ce("eligible_gateways",I.target.value),placeholder:"stripe, adyen",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Algorithm"}),c.jsx("select",{value:l.ranking_algorithm,onChange:I=>Ce("ranking_algorithm",I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Due.map(I=>c.jsx("option",{value:I,children:Lue[I]},I))})]}),c.jsx("div",{className:"flex items-end pb-1",children:c.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:l.elimination_enabled,onChange:I=>Ce("elimination_enabled",I.target.checked),className:"rounded"}),"Elimination enabled"]})})]}),o==="batch"&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-4 mt-4 space-y-3",children:[c.jsxs("h3",{className:"text-sm font-medium text-slate-800 flex items-center gap-2",children:[c.jsx(nd,{size:14}),"Simulation Configuration"]}),c.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Total Payments"}),c.jsx("input",{type:"text",value:d.totalPayments,onChange:I=>f(B=>({...B,totalPayments:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Success Count"}),c.jsx("input",{type:"text",value:d.successCount,onChange:I=>f(B=>({...B,successCount:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Failure Count"}),c.jsx("input",{type:"text",value:d.failureCount,onChange:I=>f(B=>({...B,failureCount:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),c.jsxs("p",{className:"text-xs text-slate-500",children:["Will run ",d.totalPayments||0," payments: ",d.successCount||0," SUCCESS, ",d.failureCount||0," FAILURE"]})]})]}),c.jsx(ln,{error:N}),o==="rule"?c.jsx(Be,{onClick:q,disabled:D||i,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(Ar,{size:14})," Evaluating…"]}):c.jsxs(c.Fragment,{children:[c.jsx(wf,{size:14})," Evaluate Rules"]})}):o==="volume"?c.jsx(Be,{onClick:J,disabled:D,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(Ar,{size:14})," Calculating…"]}):c.jsxs(c.Fragment,{children:[c.jsx(Rd,{size:14})," Visualize Distribution"]})}):o==="batch"?c.jsx(Be,{onClick:z,disabled:R||!e||i,className:"w-full justify-center",children:R?c.jsxs(c.Fragment,{children:[c.jsx(Ar,{size:14}),"Simulating ",k.length,"/",d.totalPayments||0,"..."]}):c.jsxs(c.Fragment,{children:[c.jsx(nd,{size:14})," Run Batch Simulation"]})}):c.jsx(Be,{onClick:P,disabled:D||!e||i,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(Ar,{size:14})," Running…"]}):c.jsxs(c.Fragment,{children:[c.jsx(wf,{size:14})," Run Decision"]})})]})]}),c.jsx("div",{className:"space-y-4",children:o==="volume"?S.length>0?c.jsxs(c.Fragment,{children:[c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Volume Distribution Overview"})}),c.jsxs(Ae,{children:[c.jsxs("div",{className:"text-center mb-4",children:[c.jsx("p",{className:"text-3xl font-bold text-slate-900",children:v}),c.jsx("p",{className:"text-xs text-slate-500",children:"Total Payments"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4",children:S.map((I,B)=>c.jsxs("div",{className:"bg-slate-50 dark:bg-[#111114] rounded-lg p-3",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:jr[B%jr.length]}}),c.jsx("span",{className:"font-medium text-sm",children:I.name})]}),c.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[c.jsxs("span",{children:[I.percentage,"%"]}),c.jsxs("span",{className:"font-medium text-slate-700",children:[I.count," payments"]})]})]},B))})]})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Pie Chart"})}),c.jsx(Ae,{children:c.jsx(hs,{width:"100%",height:250,children:c.jsxs(c$,{children:[c.jsx(Qn,{data:Pe,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:I,percent:B})=>`${I} ${(B*100).toFixed(0)}%`,labelLine:!1,children:Pe.map((I,B)=>c.jsx(Ji,{fill:jr[B%jr.length]},`cell-${B}`))}),c.jsx(yr,{formatter:I=>[`${I} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}})]})})})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Bar Chart"})}),c.jsx(Ae,{children:c.jsx(hs,{width:"100%",height:S.length*50+40,children:c.jsxs(Tk,{data:S,layout:"vertical",margin:{left:20,right:40},children:[c.jsx(ka,{type:"number",tick:{fontSize:12,fill:"#666"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),c.jsx(Aa,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#666"},width:80,axisLine:!1,tickLine:!1}),c.jsx(yr,{formatter:I=>[`${I} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}}),c.jsx(gi,{dataKey:"count",radius:[0,6,6,0],children:S.map((I,B)=>c.jsx(Ji,{fill:jr[B%jr.length]},`cell-${B}`))})]})})})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Percentage Distribution"})}),c.jsxs(Ae,{children:[c.jsx("div",{className:"h-4 rounded-full overflow-hidden flex",children:S.map((I,B)=>c.jsx("div",{style:{width:`${I.percentage}%`,backgroundColor:jr[B%jr.length]},className:"h-full transition-all duration-300",title:`${I.name}: ${I.percentage}%`},B))}),c.jsx("div",{className:"flex flex-wrap gap-3 mt-3",children:S.map((I,B)=>c.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:jr[B%jr.length]}}),c.jsx("span",{className:"text-slate-600",children:I.name}),c.jsxs("span",{className:"font-medium",children:[I.percentage,"%"]})]},B))})]})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Summary"})}),c.jsx(Ae,{className:"p-0",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"}),c.jsx("th",{className:"text-right px-4 py-2",children:"Payments"}),c.jsx("th",{className:"text-right px-4 py-2",children:"Percentage"})]})}),c.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:[S.map((I,B)=>c.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:jr[B%jr.length]}}),c.jsx("span",{className:"font-medium",children:I.name})]})}),c.jsx("td",{className:"px-4 py-2 text-right font-medium",children:I.count}),c.jsxs("td",{className:"px-4 py-2 text-right text-slate-500",children:[I.percentage,"%"]})]},B)),c.jsxs("tr",{className:"bg-slate-50 dark:bg-[#111114] font-medium",children:[c.jsx("td",{className:"px-4 py-2",children:"Total"}),c.jsx("td",{className:"px-4 py-2 text-right",children:v}),c.jsx("td",{className:"px-4 py-2 text-right",children:"100%"})]})]})]})})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Payment Log"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Simulated sequence based on the configured split, shown in shuffled order instead of connector blocks."})]})}),c.jsx(Ae,{className:"p-0 max-h-80 overflow-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500 sticky top-0",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2 w-20",children:"#"}),c.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:Et.map((I,B)=>c.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[c.jsx("td",{className:"px-4 py-1.5 text-slate-500 font-mono text-xs",children:B+1}),c.jsx("td",{className:"px-4 py-1.5",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2 h-2 rounded",style:{backgroundColor:jr[I.colorIdx%jr.length]}}),c.jsx("span",{className:"font-medium",children:I.connector})]})})]},`${I.connector}-${B}`))})]})})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("button",{onClick:()=>Q(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(Vm,{size:14}),"API Response"]}),K?c.jsx(nu,{size:14}):c.jsx(ru,{size:14})]})}),K&&_&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(_,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx(Rd,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Enter the number of payments and click "Visualize Distribution" to see how payments are split across gateways.'})]})}):o==="rule"?_?c.jsxs(c.Fragment,{children:[c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsx("div",{className:"flex items-start justify-between mb-3",children:c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Status"}),c.jsx("p",{className:"text-2xl font-bold text-slate-900",children:_.status}),c.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["output_type: ",_.output.type]})]})}),_.output.type==="single"&&_.output.connector&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Selected gateway_name"}),c.jsx("p",{className:"text-lg font-semibold",children:_.output.connector.gateway_name}),_.output.connector.gateway_id&&c.jsxs("p",{className:"text-xs text-slate-500",children:["gateway_id: ",_.output.connector.gateway_id]})]}),_.output.type==="priority"&&_.output.connectors&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Priority gateway_name list"}),c.jsx("div",{className:"space-y-1",children:_.output.connectors.map((I,B)=>c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-500 text-white text-xs flex items-center justify-center",children:B+1}),c.jsx("span",{className:"font-medium",children:I.gateway_name}),I.gateway_id&&c.jsxs("span",{className:"text-xs text-slate-500",children:["(",I.gateway_id,")"]})]},B))})]}),_.output.type==="volume_split"&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Volume Split Result"}),c.jsx("p",{className:"text-sm text-slate-600",children:"See Volume Split tab for detailed visualization."})]})]})}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("button",{onClick:()=>U(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(Vm,{size:14}),"API Response"]}),L?c.jsx(nu,{size:14}):c.jsx(ru,{size:14})]})}),L&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(_,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx(wf,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Configure rule parameters and click "Evaluate Rules" to test routing.'})]})}):o==="batch"?k.length>0?c.jsxs(c.Fragment,{children:[c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Simulation Progress"})}),c.jsxs(Ae,{children:[c.jsxs("div",{className:"mb-4",children:[c.jsxs("div",{className:"flex justify-between text-xs text-slate-600 mb-1",children:[c.jsx("span",{children:"Progress"}),c.jsxs("span",{children:[Math.round(k.length/(parseInt(d.totalPayments)||1)*100),"%"]})]}),c.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:c.jsx("div",{className:"bg-brand-500 h-2 rounded-full transition-all duration-300",style:{width:`${k.length/(parseInt(d.totalPayments)||1)*100}%`}})})]}),Object.keys(be).length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-xs font-medium text-slate-700",children:"Gateway Selection Summary"}),Object.entries(be).map(([I,B])=>c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"font-medium",children:I}),c.jsxs("div",{className:"flex gap-3 text-xs",children:[c.jsxs("span",{className:"text-emerald-600",children:[B.success," ✓"]}),c.jsxs("span",{className:"text-red-500",children:[B.failure," ✗"]}),c.jsxs("span",{className:"text-slate-500",children:["(",B.total," total)"]})]})]},I))]})]})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Transaction Log"})}),c.jsx(Ae,{className:"p-0 max-h-96 overflow-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 sticky top-0",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-3 py-2",children:"#"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Payment ID"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Gateway"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Outcome"})]})}),c.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:k.map((I,B)=>c.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16]",children:[c.jsx("td",{className:"px-3 py-2 text-slate-500",children:B+1}),c.jsx("td",{className:"px-3 py-2",children:c.jsxs("button",{type:"button",title:I.paymentId,onClick:()=>Ei(I.paymentId),className:"group flex items-start gap-3 text-left",children:[c.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-brand-500/10 text-[11px] font-semibold uppercase tracking-[0.16em] text-brand-600 dark:text-brand-300",children:B+1}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block truncate font-mono text-xs font-semibold text-slate-900 transition group-hover:text-brand-600 dark:text-white",children:I.paymentId}),c.jsx("span",{className:"mt-1 block text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-400 transition group-hover:text-brand-500",children:"View audit"})]})]})}),c.jsx("td",{className:"px-3 py-2 font-medium",children:I.decidedGateway}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(ze,{variant:I.status==="CHARGED"?"green":"red",children:I.status})})]},I.paymentId))})]})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx(nd,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.'})]})}):m?c.jsxs(c.Fragment,{children:[c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Decided Gateway"}),c.jsx("p",{className:"text-3xl font-bold text-slate-900",children:m.decided_gateway})]}),c.jsxs("div",{className:"text-right space-y-1",children:[c.jsx("div",{children:c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Fue(m.routing_approach)}`,children:m.routing_approach})}),m.is_scheduled_outage&&c.jsx(ze,{variant:"red",children:"Scheduled Outage"}),m.latency!=null&&c.jsxs("p",{className:"text-xs text-slate-400",children:[m.latency,"ms"]})]})]}),m.routing_dimension&&c.jsxs("div",{className:"flex gap-4 text-sm text-slate-600 border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Dimension"}),c.jsx("p",{className:"font-medium",children:m.routing_dimension})]}),m.routing_dimension_level&&c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Level"}),c.jsx("p",{className:"font-medium",children:m.routing_dimension_level})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Reset"}),c.jsx("p",{className:"font-medium",children:m.reset_approach})]})]})]})}),ee.length>0&&c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Scores"}),c.jsxs(Be,{size:"sm",variant:"ghost",onClick:P,className:"text-xs",children:[c.jsx(D1,{size:12})," Refresh"]})]})}),c.jsx(Ae,{children:c.jsx(hs,{width:"100%",height:ee.length*40+20,children:c.jsxs(Tk,{data:ee,layout:"vertical",margin:{left:10,right:30},children:[c.jsx(ka,{type:"number",domain:[0,100],tickFormatter:I=>`${I}%`,tick:{fontSize:11,fill:"#66667a"},axisLine:{stroke:"#1c1c24"},tickLine:!1}),c.jsx(Aa,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#8e8ea0"},width:60,axisLine:!1,tickLine:!1}),c.jsx(yr,{formatter:I=>`${I}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),c.jsx(gi,{dataKey:"score",radius:[0,4,4,0],children:ee.map((I,B)=>c.jsx(Ji,{fill:I.name===m.decided_gateway?"#0069ED":I.score<30?"#ef4444":I.score<60?"#f59e0b":"#10b981"},B))})]})})})]}),m.filter_wise_gateways&&c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("button",{onClick:()=>H(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:["Filter Chain",V?c.jsx(nu,{size:14}):c.jsx(ru,{size:14})]})}),V&&c.jsx(Ae,{className:"space-y-2",children:Object.entries(m.filter_wise_gateways).map(([I,B])=>c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:"text-xs font-mono bg-slate-100 dark:bg-[#111118] text-slate-600 rounded-md px-2 py-0.5 mt-0.5 shrink-0 border border-slate-200 dark:border-[#1c1c24]",children:I}),c.jsx("div",{className:"flex flex-wrap gap-1",children:Array.isArray(B)?B.map(se=>c.jsx("span",{className:"text-xs bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20 rounded-md px-2 py-0.5",children:se},se)):c.jsx("span",{className:"text-xs text-slate-400",children:"—"})})]},I))})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("button",{onClick:()=>U(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(Vm,{size:14}),"API Response"]}),L?c.jsx(nu,{size:14}):c.jsx(ru,{size:14})]})}),L&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(m,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx(wf,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Fill in the parameters and click "Run Decision" to see the routing result.'})]})})})]}),G&&c.jsxs("div",{className:"fixed bottom-0 left-64 right-0 top-[76px] z-[130] p-8",children:[c.jsx("button",{type:"button","aria-label":"Close payment audit",className:"absolute inset-0 bg-slate-950/70 backdrop-blur-sm",onClick:Pi}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"decision-explorer-audit-title",className:"relative mx-auto flex h-full w-full max-w-7xl flex-col overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-2xl dark:border-[#1c1c23] dark:bg-[#09090d]",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-slate-200 bg-slate-50/90 px-6 py-5 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-[#8a8a93]",children:"Batch Simulation Audit"}),c.jsx("h2",{id:"decision-explorer-audit-title",className:"mt-2 truncate text-2xl font-semibold text-slate-900 dark:text-white",children:G}),c.jsx("p",{className:"mt-2 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:"Inspect the exact decision trail for this simulated payment, including request payloads, API responses, score context, and the final transaction outcome."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[et!=null&&et.latest_gateway?c.jsx(ze,{variant:"green",children:et.latest_gateway}):null,et!=null&&et.latest_status?c.jsx(ze,{variant:Wue(et.latest_status),children:ei(et.latest_status)}):null,et!=null&&et.event_count?c.jsxs(ze,{variant:"gray",children:[et.event_count," events"]}):null,c.jsxs(Be,{size:"sm",variant:"secondary",onClick:()=>_e.mutate(),children:[c.jsx(D1,{size:12}),"Refresh"]}),c.jsxs(Be,{size:"sm",variant:"ghost",onClick:Pi,children:[c.jsx(bD,{size:14}),"Close"]})]})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 gap-0 xl:grid-cols-[340px_minmax(0,1fr)]",children:[c.jsxs("div",{className:"flex min-h-0 flex-col border-b border-slate-200 bg-slate-50/70 xl:border-b-0 xl:border-r dark:border-[#1c1c23] dark:bg-[#08080b]",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"Audit Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Choose a step to inspect its request, response, and scoring context."})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:_e.isLoading&&!_e.data?c.jsxs("div",{className:"flex items-center gap-2 px-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(Ar,{size:16}),"Loading payment audit…"]}):_e.error?c.jsx(ln,{error:_e.error.message}):Ia.length?c.jsx("div",{className:"space-y-4",children:Ia.map(I=>c.jsxs("section",{className:"space-y-2",children:[c.jsx("div",{className:"px-2",children:c.jsx(ze,{variant:Hue(I.phase),children:I.phase})}),c.jsx("div",{className:"space-y-2",children:I.events.map(B=>c.jsxs("button",{type:"button",onClick:()=>{pe(B.id),Ee("summary")},className:`w-full rounded-[22px] border px-4 py-3 text-left transition ${(Le==null?void 0:Le.id)===B.id?"border-brand-500/50 bg-brand-500/8":"border-slate-200 bg-white hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#0c0c10] dark:hover:border-[#2a2a31]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:X0(B)}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:K0(B.created_at_ms)})]}),c.jsx(ze,{variant:Ik(B),children:ei(B.status)||Vue(B.event_type)})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(ze,{variant:"gray",children:q0(B.route)}),B.gateway?c.jsx(ze,{variant:"green",children:B.gateway}):null,B.request_id?c.jsx(ze,{variant:"blue",children:"Request"}):null]})]},B.id))})]},I.phase))}):c.jsx(Y0,{title:"No audit trail captured yet",body:"Run a simulated payment and gateway update first, then reopen the row once the audit payload is available."})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:Le?X0(Le):"Audit Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:Le?`${q0(Le.route)} · ${K0(Le.created_at_ms)}`:"Select an event from the left to inspect payloads."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[Le!=null&&Le.gateway?c.jsx(ze,{variant:"green",children:Le.gateway}):null,Le!=null&&Le.status?c.jsx(ze,{variant:Ik(Le),children:ei(Le.status)}):null]})]}),c.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["summary","input","response","raw"].map(I=>c.jsx("button",{type:"button",onClick:()=>Ee(I),className:`rounded-full px-4 py-2 text-xs font-semibold uppercase tracking-[0.16em] transition ${que(ce===I)}`,children:I==="raw"?"Raw JSON":ei(I)},I))})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:_e.isLoading&&!_e.data?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(Ar,{size:16}),"Loading inspector…"]}):tr?c.jsxs("div",{className:"space-y-5",children:[ce==="summary"?c.jsxs(c.Fragment,{children:[c.jsx(Xue,{rows:tr.summaryRows}),tr.selectionReason?c.jsxs("div",{className:"rounded-[22px] border border-slate-200 bg-slate-50/80 px-5 py-4 dark:border-[#1d1d23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Selection Reason"}),c.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-700 dark:text-slate-200",children:d$(tr.selectionReason)})]}):null,c.jsx(ql,{title:"Score Context",value:tr.scoreContext,emptyMessage:"No scoring context was captured for this event."}),tr.signalRecord?c.jsx(ql,{title:"Additional Signals",value:tr.signalRecord,emptyMessage:"No additional signals were captured for this event."}):null]}):null,ce==="input"?c.jsx(ql,{title:"Request Payload",value:tr.requestPayload,emptyMessage:"This step did not persist a request payload."}):null,ce==="response"?c.jsx(ql,{title:"Response Payload",value:tr.responsePayload,emptyMessage:"This step did not persist a response payload."}):null,ce==="raw"?c.jsx(ql,{title:"Raw Event JSON",value:tr.rawEvent,emptyMessage:"No raw event payload is available."}):null]}):c.jsx(Y0,{title:"Select a timeline step",body:"Choose one of the audit events on the left to inspect its request, response, and score context."})})]})]})]})]})]})}const Rk=[{value:"15m",label:"Last 15 mins"},{value:"1h",label:"Last 1 hour"},{value:"24h",label:"Last 1 day"},{value:"custom",label:"Custom window"}],La=["#0069ED","#14b8a6","#f97316","#e11d48","#8b5cf6","#22c55e"],Mk={backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"14px",color:"#e8e8f4",boxShadow:"0 16px 40px rgba(0, 0, 0, 0.35)"},Dk={color:"#f8fafc",fontWeight:600,marginBottom:8},Lk={color:"#e2e8f0"},Fk={zIndex:30,outline:"none"},zk={dimensions:{},gateways:[]},Xl=3,Wy={hits:{title:"API call counts",purpose:"Use these cards to see how much traffic each major decision-engine API handled in the selected window.",calculation:"Each request records one lightweight API-call event. The cards count those recorded calls for `/decide_gateway`, `/update_gateway`, and `/rule_evaluate`.",source:"Counts come from analytics rows persisted in `analytics_event` in Postgres."},share:{title:"Gateway share over time",purpose:"Use this to see when traffic shifted from one connector to another for the selected merchant.",calculation:"Decision events are bucketed by time and grouped by chosen connector. The chart shows how many decisions each gateway captured in each bucket.",source:"Reads persisted `decision` rows from `analytics_event` in Postgres."},sr:{title:"Connector success rate over time",purpose:"Use this to explain why a connector won routing at a given time, based on the recorded historical score trail.",calculation:"Stored `score_snapshot` events are bucketed over the selected window and averaged per connector. The line values are displayed as percentages.",source:"Reads persisted `score_snapshot` rows from `analytics_event` in Postgres. The current score state originates from Redis-backed scoring flows."}};function Zue(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function Hy(e,t,r,n,a){const i={scope:"current",range:t==="custom"?"1h":t,start_ms:n==null?void 0:n.start_ms,end_ms:n==null?void 0:n.end_ms,merchant_id:r,gateway:a!=null&&a.gateways.length?a.gateways.join(","):void 0};Object.entries((a==null?void 0:a.dimensions)||{}).forEach(([s,l])=>{l&&(i[s]=l)});const o=Zue(i);return o?`${e}?${o}`:e}function gw(e,t=2){if(e==null||Number.isNaN(Number(e)))return"0";const r=Number(e);return Number.isInteger(r)?r.toString():r.toFixed(t)}function p$(e){return Number.isFinite(e)?e<=1?e*100:e:0}function Bk(e,t=1){return e==null||Number.isNaN(Number(e))?"0%":`${gw(p$(Number(e)),t)}%`}function Uk(e){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function zf(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function Que(e){const t=Date.now(),r=e==="15m"?15*60*1e3:e==="1h"?60*60*1e3:24*60*60*1e3;return{start_ms:t-r,end_ms:t}}function Bf(e){const t=new Date(e),r=n=>n.toString().padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}T${r(t.getHours())}:${r(t.getMinutes())}`}function Vk(e){const t=new Date(e).getTime();return Number.isFinite(t)?t:null}function Uf({title:e,body:t}){return c.jsxs("div",{className:"rounded-[24px] border border-dashed border-slate-200 bg-white/60 px-6 py-12 text-center dark:border-[#222227] dark:bg-[#0b0b0d]",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function Vf(){return"h-11 w-full rounded-2xl border border-slate-200 bg-white px-4 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]"}function Gy({content:e}){const[t,r]=O.useState(!1),n=O.useRef(null),[a,i]=O.useState({top:0,left:0,width:320});return O.useEffect(()=>{if(!t)return;function o(s){var l;(l=n.current)!=null&&l.contains(s.target)||r(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[t]),O.useLayoutEffect(()=>{if(!t||!n.current)return;const o=320,s=280,l=16,u=12;function d(){if(!n.current)return;const f=n.current.getBoundingClientRect(),p=Math.min(o,window.innerWidth-l*2),h=Math.min(Math.max(f.right-p,l),window.innerWidth-p-l),y=f.bottom+u+s>window.innerHeight-l?Math.max(f.top-s-u,l):f.bottom+u;i({top:y,left:h,width:p})}return d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}},[t]),c.jsxs("div",{ref:n,className:"relative shrink-0",children:[c.jsx("button",{type:"button","aria-label":`About ${e.title}`,onClick:()=>r(o=>!o),className:`flex h-7 w-7 items-center justify-center rounded-full border text-xs font-semibold transition ${t?"border-brand-500/50 bg-brand-500/10 text-brand-700 dark:text-brand-200":"border-slate-200 bg-white text-slate-500 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#8a8a93] dark:hover:text-white"}`,children:"i"}),t?c.jsxs("div",{style:{position:"fixed",top:a.top,left:a.left,width:a.width},className:"z-[120] rounded-[24px] border border-slate-200 bg-white/95 p-4 shadow-2xl backdrop-blur dark:border-[#1d1d23] dark:bg-[#09090d]/95",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e.title}),c.jsxs("div",{className:"mt-3 space-y-3 text-xs leading-6 text-slate-600 dark:text-[#b3b3bd]",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Why it matters"}),c.jsx("p",{className:"mt-1",children:e.purpose})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"How it is calculated"}),c.jsx("p",{className:"mt-1",children:e.calculation})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Data source"}),c.jsx("p",{className:"mt-1",children:e.source})]})]})]}):null]})}function Jue({label:e,value:t,subtitle:r}){return c.jsx(ke,{className:"h-full overflow-hidden",children:c.jsxs(Ae,{className:"flex h-full min-h-[150px] flex-col justify-between",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Endpoint hits"}),c.jsx("p",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:e})]}),c.jsxs("div",{className:"flex items-end justify-between gap-4",children:[c.jsx("p",{className:"text-5xl font-semibold tracking-tight text-slate-950 dark:text-white",children:gw(t,0)}),c.jsx(ze,{variant:"blue",children:r})]})]})})}function ece(e){return e==="/decide_gateway"?"Decide Gateway":e==="/update_gateway"?"Update Gateway":e==="/rule_evaluate"?"Rule Evaluate":e}function tce(){var Ee,Ie,te,oe,he,X,Oe,ge,_e,Ce,we,Re,Te,$e,Ze;const{merchantId:e}=Xn(),[t,r]=O.useState("1h"),[n,a]=O.useState(zk),[i,o]=O.useState(!1),[s,l]=O.useState(()=>Bf(Date.now()-2*60*60*1e3)),[u,d]=O.useState(()=>Bf(Date.now())),f=!!e,p=O.useMemo(()=>{if(t!=="custom")return;const W=Vk(s),E=Vk(u);if(!(W===null||E===null||E<=W))return{start_ms:W,end_ms:E}},[u,s,t]),h=f&&e&&(t!=="custom"||p)?Hy("/analytics/overview",t,e,p):null,g=f&&e&&(t!=="custom"||p)?Hy("/analytics/routing-stats",t,e,p):null,y=f&&e&&(t!=="custom"||p)?Hy("/analytics/routing-stats",t,e,p,n):null,v={refreshInterval:1e4,revalidateOnFocus:!0,revalidateIfStale:!1},x={refreshInterval:12e3,revalidateOnFocus:!0,revalidateIfStale:!1},m={...x,keepPreviousData:!0},w=ir(h,Qi,v),_=ir(g,Qi,x),b=ir(y,Qi,m),S=!w.data&&w.isLoading||!_.data&&_.isLoading||!b.data&&b.isLoading,j=((Ee=w.error)==null?void 0:Ee.message)||((Ie=_.error)==null?void 0:Ie.message)||((te=b.error)==null?void 0:te.message)||null,k={dimensions:((he=(oe=_.data)==null?void 0:oe.available_filters)==null?void 0:he.dimensions)||((Oe=(X=b.data)==null?void 0:X.available_filters)==null?void 0:Oe.dimensions)||[],missing_dimensions:((_e=(ge=_.data)==null?void 0:ge.available_filters)==null?void 0:_e.missing_dimensions)||((we=(Ce=b.data)==null?void 0:Ce.available_filters)==null?void 0:we.missing_dimensions)||[],gateways:((Te=(Re=_.data)==null?void 0:Re.available_filters)==null?void 0:Te.gateways)||((Ze=($e=b.data)==null?void 0:$e.available_filters)==null?void 0:Ze.gateways)||[]},A=O.useMemo(()=>new Map(k.dimensions.map(W=>[W.key,W])),[k.dimensions]);O.useEffect(()=>{a(W=>{const E=Object.fromEntries(Object.entries(W.dimensions).filter(([P,z])=>{if(!z)return!1;const q=A.get(P);return q?q.values.includes(z):!1})),M=W.gateways.filter(P=>k.gateways.includes(P));return Object.keys(E).length===Object.keys(W.dimensions).length&&Object.entries(E).every(([P,z])=>W.dimensions[P]===z)&&M.length===W.gateways.length&&M.every((P,z)=>P===W.gateways[z])?W:{dimensions:E,gateways:M}})},[A,k.gateways]),O.useEffect(()=>{k.dimensions.length<=Xl&&i&&o(!1)},[k.dimensions.length,i]);const R=O.useMemo(()=>{var W;return t!=="custom"?((W=Rk.find(E=>E.value===t))==null?void 0:W.label)||"Selected window":p?`${zf(p.start_ms)} to ${zf(p.end_ms)}`:"Custom window"},[p,t]),T=O.useMemo(()=>{var E,M;const W=[{route:"/decide_gateway",count:0},{route:"/update_gateway",count:0},{route:"/rule_evaluate",count:0}];return(M=(E=w.data)==null?void 0:E.route_hits)!=null&&M.length?W.map(P=>{var z,q;return{...P,count:((q=(z=w.data)==null?void 0:z.route_hits.find(J=>J.route===P.route))==null?void 0:q.count)||0}}):W},[w.data]),N=O.useMemo(()=>{var M,P;const W=Array.from(new Set((((M=_.data)==null?void 0:M.gateway_share)||[]).map(z=>z.gateway))).slice(0,6),E=new Map;for(const z of((P=_.data)==null?void 0:P.gateway_share)||[]){if(!W.includes(z.gateway))continue;const q=E.get(z.bucket_ms)||{bucket_ms:z.bucket_ms};q[z.gateway]=z.count,E.set(z.bucket_ms,q)}return{gateways:W,rows:Array.from(E.values()).sort((z,q)=>z.bucket_ms-q.bucket_ms)}},[_.data]),$=O.useMemo(()=>{var M,P;const W=Array.from(new Set((((M=b.data)==null?void 0:M.sr_trend)||[]).map(z=>z.gateway))).slice(0,6),E=new Map;for(const z of((P=b.data)==null?void 0:P.sr_trend)||[]){if(!W.includes(z.gateway))continue;const q=E.get(z.bucket_ms)||{bucket_ms:z.bucket_ms};q[z.gateway]=p$(z.score_value),E.set(z.bucket_ms,q)}return{gateways:W,rows:Array.from(E.values()).sort((z,q)=>z.bucket_ms-q.bucket_ms)}},[b.data]),D=O.useMemo(()=>{if(!$.rows.length)return[];const W=$.rows[$.rows.length-1];return $.gateways.map(E=>({gateway:E,value:typeof W[E]=="number"?W[E]:null})).filter(E=>E.value!==null)},[$]),F=O.useMemo(()=>{const W=$.rows.flatMap(z=>$.gateways.map(q=>z[q]).filter(q=>typeof q=="number"));if(!W.length)return[0,100];const E=Math.min(...W),M=Math.max(...W),P=E===M?5:Math.max(2,(M-E)*.35);return[Math.max(0,Math.floor(E-P)),Math.min(100,Math.ceil(M+P))]},[$]),V=O.useMemo(()=>{const W=k.dimensions.flatMap(E=>{const M=n.dimensions[E.key];return M?[`${E.label}: ${M}`]:[]});return n.gateways.length&&W.push(n.gateways.join(", ")),W.length?W.join(" / "):"All routing dimensions"},[k.dimensions,n]),H=O.useMemo(()=>i||k.dimensions.length<=Xl?k.dimensions:k.dimensions.slice(0,Xl),[k.dimensions,i]),L=k.dimensions.length>Xl,U=L?k.dimensions.length-Xl:0,K=O.useMemo(()=>{const W=k.dimensions.flatMap(M=>{const P=n.dimensions[M.key];return P?[{key:`dimension:${M.key}`,label:`${M.label}: ${P}`}]:[]}),E=n.gateways.map(M=>({key:`gateway:${M}`,label:`Connector: ${M}`}));return[...W,...E]},[k.dimensions,n]);function Q(W){if(r(W),W!=="custom"){const E=Que(W);l(Bf(E.start_ms)),d(Bf(E.end_ms))}}function G(){w.mutate(),_.mutate(),b.mutate()}function re(W){a(E=>{const M=E.gateways.includes(W);return{...E,gateways:M?E.gateways.filter(P=>P!==W):[...E.gateways,W]}})}function Z(){a(zk)}function pe(W){if(W.startsWith("dimension:")){ce(W.replace("dimension:",""),"");return}W.startsWith("gateway:")&&re(W.replace("gateway:",""))}function ce(W,E){a(M=>{const P={...M.dimensions};return E?P[W]=E:delete P[W],{...M,dimensions:P}})}return f?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Analytics"}),c.jsx(ze,{variant:"green",children:e||"Current merchant"})]}),c.jsx("p",{className:"text-sm text-slate-500 dark:text-[#8a8a93]",children:"One working surface for route volume, connector share, and historical connector success rate."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(Be,{size:"sm",variant:"ghost",onClick:G,children:"Refresh"})})]}),c.jsx(ke,{className:"overflow-visible",children:c.jsxs(Ae,{className:"flex flex-wrap items-end gap-4",children:[c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Time window"}),c.jsx("select",{value:t,onChange:W=>Q(W.target.value),className:Vf(),children:Rk.map(W=>c.jsx("option",{value:W.value,children:W.label},W.value))})]}),t==="custom"?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Start time"}),c.jsx("input",{type:"datetime-local",value:s,onChange:W=>l(W.target.value),className:Vf()})]}),c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"End time"}),c.jsx("input",{type:"datetime-local",value:u,onChange:W=>d(W.target.value),className:Vf()})]})]}):null,c.jsxs("div",{className:"min-w-[220px] flex-1 rounded-[24px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#0c0c0e]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Active window"}),c.jsx("p",{className:"mt-1 text-sm font-medium text-slate-900 dark:text-white",children:R}),t==="custom"&&!p?c.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Choose an end time after the start time."}):null]})]})}),c.jsx(ln,{error:j}),S?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(Ar,{size:16}),"Loading analytics…"]}):null,c.jsxs("section",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"API calls"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Counts for the three routing surfaces most operators watch first."})]}),c.jsx(Gy,{content:Wy.hits})]}),c.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:T.map(W=>c.jsx(Jue,{label:ece(W.route),value:W.count,subtitle:t==="custom"?"Custom window":R},W.route))})]}),c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(qe,{children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Gateway share over time"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"How decision volume moved across connectors inside the selected merchant window."})]}),c.jsx(Gy,{content:Wy.share})]})}),c.jsx(Ae,{children:N.rows.length?c.jsx("div",{className:"h-80",children:c.jsx(hs,{width:"100%",height:"100%",children:c.jsxs($ue,{data:N.rows,children:[c.jsx(I0,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),c.jsx(ka,{dataKey:"bucket_ms",tickFormatter:Uk,tick:{fontSize:11}}),c.jsx(Aa,{tick:{fontSize:11}}),c.jsx(yr,{labelFormatter:W=>zf(Number(W)),contentStyle:Mk,labelStyle:Dk,itemStyle:Lk,wrapperStyle:Fk}),c.jsx(ma,{}),N.gateways.map((W,E)=>c.jsx(Ai,{type:"monotone",dataKey:W,stackId:"1",stroke:La[E%La.length],fill:La[E%La.length],fillOpacity:.24,name:W},W))]})})}):c.jsx(Uf,{title:"No gateway share history yet",body:"Send real decide-gateway traffic in the selected window to populate connector share."})})]}),c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(qe,{children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Connector success rate over time"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Historical connector score trend for the selected merchant window."}),c.jsxs("p",{className:"mt-2 text-xs font-medium text-slate-600 dark:text-[#b3b3bd]",children:["Active filters: ",V]})]}),c.jsx(Gy,{content:Wy.sr})]})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-[24px] border border-slate-200 bg-slate-50/80 p-4 dark:border-[#1d1d23] dark:bg-[#0c0c0e]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Connector filters"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Narrow the success-rate line chart by the routing dimensions present for this merchant."})]}),c.jsx(Be,{size:"sm",variant:"secondary",onClick:Z,disabled:!Object.values(n.dimensions).some(Boolean)&&!n.gateways.length,children:"Clear filters"})]}),k.dimensions.length?c.jsxs("div",{className:"mt-4 space-y-3",children:[c.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:H.map(W=>c.jsxs("label",{className:"space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:W.label}),c.jsxs("select",{value:n.dimensions[W.key]||"",onChange:E=>ce(W.key,E.target.value),className:Vf(),disabled:!W.values.length,children:[c.jsxs("option",{value:"",children:["All ",W.label.toLowerCase()]}),W.values.map(E=>c.jsx("option",{value:E,children:E},E))]})]},W.key))}),L?c.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:i?"Showing all routing dimensions available for this merchant.":`${U} more routing dimension${U===1?"":"s"} available for this merchant.`}),c.jsx(Be,{size:"sm",variant:"secondary",onClick:()=>o(W=>!W),children:i?"Show fewer filters":"More filters"})]}):null]}):k.missing_dimensions.length?c.jsx(Uf,{title:"No populated routing dimensions in this window",body:"The merchant has score history, but none of the dynamic routing dimensions have values recorded in the selected time window yet."}):null,k.missing_dimensions.length?c.jsxs("div",{className:"mt-4 rounded-2xl border border-dashed border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"No values in this window yet"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:k.missing_dimensions.map(W=>W.label).join(", ")})]}):null,K.length?c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Active filters"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:K.map(W=>c.jsxs("button",{type:"button",onClick:()=>pe(W.key),className:"inline-flex items-center gap-2 rounded-full border border-brand-500/30 bg-brand-500/10 px-3 py-1.5 text-xs font-semibold text-brand-700 transition hover:bg-brand-500/15 dark:text-brand-200",children:[c.jsx("span",{children:W.label}),c.jsx("span",{"aria-hidden":"true",children:"×"})]},W.key))})]}):null,c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Connectors"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:k.gateways.length?k.gateways.map(W=>{const E=n.gateways.includes(W);return c.jsx("button",{type:"button",onClick:()=>re(W),className:`rounded-full border px-3 py-1.5 text-xs font-semibold transition ${E?"border-brand-500/50 bg-brand-500/10 text-brand-700 dark:text-brand-200":"border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#a1a1aa] dark:hover:text-white"}`,children:W},W)}):c.jsx("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:"No connector history yet for the selected window."})})]})]}),D.length?c.jsx("div",{className:"flex flex-wrap gap-2",children:D.map(W=>c.jsxs(ze,{variant:"blue",children:[W.gateway,": ",Bk(W.value)]},W.gateway))}):null,$.rows.length?c.jsx("div",{className:"h-80",children:c.jsx(hs,{width:"100%",height:"100%",children:c.jsxs(Tue,{data:$.rows,children:[c.jsx(I0,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),c.jsx(ka,{dataKey:"bucket_ms",tickFormatter:Uk,tick:{fontSize:11}}),c.jsx(Aa,{domain:F,tick:{fontSize:11},tickFormatter:W=>`${gw(Number(W),0)}%`}),c.jsx(yr,{labelFormatter:W=>zf(Number(W)),formatter:(W,E)=>[Bk(W),String(E)],contentStyle:Mk,labelStyle:Dk,itemStyle:Lk,wrapperStyle:Fk}),c.jsx(ma,{}),$.gateways.map((W,E)=>c.jsx(tf,{type:"monotone",dataKey:W,stroke:La[E%La.length],strokeWidth:3,dot:{r:3,strokeWidth:1,fill:La[E%La.length]},activeDot:{r:5},name:W},W))]})})}):c.jsx(Uf,{title:"No connector score history yet",body:"Send decide-gateway and update-gateway-score traffic in the selected window to populate connector history."})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Analytics"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Set a merchant in the top bar to load merchant-scoped analytics."})]}),c.jsx(Uf,{title:"Select a merchant first",body:"The analytics surface is merchant-scoped. Use the merchant selector in the top bar to load data."})]})}const rce=["15m","1h","24h"],nce=[{value:"",label:"Any status"},{value:"success",label:"Success"},{value:"failure",label:"Failure"}],ace=[{value:"",label:"Any route"},{value:"decide_gateway",label:"Decide Gateway"},{value:"update_gateway_score",label:"Update Gateway"},{value:"routing_evaluate",label:"Rule Evaluate"}],ice=["summary","input","response","raw"],Ky={paymentId:"",requestId:"",gateway:"",route:"",status:"",eventType:"",errorCode:""};function Pu(e){const t=e.paymentId.trim(),r=t?"":e.requestId.trim();return{paymentId:t,requestId:r,gateway:e.gateway.trim(),route:e.route,status:e.status,eventType:e.eventType,errorCode:e.errorCode.trim()}}function h$(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function Wk(e,t,r,n,a){const i=Pu(a),o={scope:"current",range:e,page:r,page_size:n,merchant_id:t,payment_id:i.paymentId||void 0,request_id:i.requestId||void 0,gateway:i.gateway||void 0,route:i.route||void 0,status:i.status||void 0,event_type:i.eventType||void 0,error_code:i.errorCode||void 0},s=h$(o);return s?`/analytics/payment-audit?${s}`:"/analytics/payment-audit"}function oce(e){return e==="15m"||e==="24h"?e:"24h"}function sce(e){return Pu({paymentId:e.get("payment_id")||"",requestId:e.get("request_id")||"",gateway:e.get("gateway")||"",route:e.get("route")||"",status:e.get("status")||"",eventType:e.get("event_type")||"",errorCode:e.get("error_code")||""})}function sd(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function lce(e){const t=Math.max(0,Math.round((Date.now()-e)/6e4));if(t<1)return"just now";if(t<60)return`${t}m ago`;const r=Math.round(t/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function vs(e){return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase()):""}function m$(e){return e?e==="decision_gateway"||e==="decide_gateway"?"Decide Gateway":e==="update_gateway_score"?"Update Gateway":e==="routing_evaluate"?"Rule Evaluate":vs(e):"Unknown route"}function uce(e){return e?e==="decision"?"Decide Gateway":e==="gateway_update"?"Update Gateway":e==="rule_hit"?"Rule Evaluate":e==="error"?"Errors":vs(e):"Unknown event"}function Z0(e){return e.event_stage==="gateway_decided"?"Decide Gateway":e.event_stage==="score_updated"?"Update Gateway":e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="error"?"Errors":vs(e.event_stage||e.event_type)}function ld(e){return e.event_type==="decision"||e.event_stage==="gateway_decided"?"Decide Gateway":e.event_type==="rule_hit"||e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="gateway_update"||e.event_stage==="score_updated"?"Update Gateway":"Errors"}function Yl(e){const t=(e.status||"").toUpperCase();return e.event_type==="error"||t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":e.event_type==="rule_hit"?"purple":t==="CHARGED"||t==="AUTHORIZED"||t==="SUCCESS"||e.event_type==="gateway_update"?"green":e.event_type==="decision"?"blue":"orange"}function qy(e){const t=(e||"").toUpperCase();return t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":t==="SUCCESS"||t==="CHARGED"||t==="AUTHORIZED"?"green":t==="HIT"?"purple":"gray"}function Hk(e){return e==="Decide Gateway"?"blue":e==="Rule Evaluate"?"purple":e==="Update Gateway"?"green":e==="Errors"?"red":"orange"}function Zl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Xy(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}function cce(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function fce(e){return e?"bg-brand-600 text-white":"bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]"}function Mo(){return"h-10 rounded-2xl border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]"}function Wf({label:e,value:t,helper:r}){return c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs uppercase tracking-[0.16em] text-slate-500",children:e}),c.jsx("p",{className:"mt-2 text-3xl font-semibold text-slate-900 dark:text-white",children:t}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:r})]})})}function su({title:e,body:t}){return c.jsxs("div",{className:"rounded-2xl border border-dashed border-slate-200 dark:border-[#222227] bg-white/60 dark:bg-[#0b0b0d] px-6 py-12 text-center",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function dce({rows:e}){return e.length?c.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(t=>c.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:t.label}),c.jsx("p",{className:"mt-2 text-sm text-slate-900 dark:text-white break-words",children:t.value})]},`${t.label}-${t.value}`))}):null}function Do({title:e,value:t,emptyMessage:r}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{children:c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e})}),t?c.jsx("pre",{className:"overflow-x-auto rounded-2xl bg-slate-950/90 px-4 py-4 text-xs leading-6 text-slate-200",children:cce(t)}):c.jsx(su,{title:`No ${e.toLowerCase()} captured`,body:r})]})}function pce(e){if(!e)return null;const t=Zl(e.details_json)?e.details_json:{},r=t.response??t.response_payload??t.result??t.output??null,n=t.request??t.request_payload??t.input??t.payload??Xy({payment_id:e.payment_id,request_id:e.request_id,payment_method_type:e.payment_method_type,payment_method:e.payment_method,gateway:e.gateway}),a=r??Xy({event_type:e.event_type,status:e.status,error_code:e.error_code,error_message:e.error_message,score_value:e.score_value,sigma_factor:e.sigma_factor,average_latency:e.average_latency,tp99_latency:e.tp99_latency,transaction_count:e.transaction_count,rule_name:e.rule_name,routing_approach:e.routing_approach}),i=Zl(r)?r:null,o=Zl(i==null?void 0:i.decided_gateway)?i.decided_gateway:null,s=t.score_context??(o?o.gateway_priority_map:null)??(i?i.gateway_priority_map:null)??null,l=t.selection_reason??null,u=[{label:"Phase",value:ld(e)},{label:"Stage",value:Z0(e)},{label:"Route",value:m$(e.route)},{label:"Timestamp",value:sd(e.created_at_ms)},{label:"Merchant",value:e.merchant_id||"unknown merchant"},...e.payment_id?[{label:"Payment ID",value:e.payment_id}]:[],...e.request_id?[{label:"Request ID",value:e.request_id}]:[],...e.gateway?[{label:"Gateway",value:e.gateway}]:[],...e.status?[{label:"Status",value:e.status}]:[]],d=Xy(Object.fromEntries(Object.entries(t).filter(([f])=>!["request","request_payload","input","payload","response","response_payload","result","output","score_context","selection_reason"].includes(f))));return{summaryRows:u,requestPayload:Zl(n)&&!Object.keys(n).length?null:n,responsePayload:Zl(a)&&!Object.keys(a).length?null:a,scoreContext:s,selectionReason:l,signalRecord:Object.keys(d).length?d:null,rawEvent:{...e,details_json:e.details_json}}}function hce(){var oe,he,X,Oe,ge,_e,Ce,we,Re,Te,$e,Ze,W,E,M;const{merchantId:e}=Xn(),[t,r]=eD(),n=oce(t.get("range")),a=sce(t),i=Math.max(1,Number(t.get("page")||"1")),o=t.get("selected")||"",[s,l]=O.useState(n),[u,d]=O.useState(a),[f,p]=O.useState(a),[h,g]=O.useState(i),[y,v]=O.useState(o),[x,m]=O.useState(null),[w,_]=O.useState("summary"),b=12,S=!!e,j=S&&e?Wk(s,e,h,b,f):null,k=ir(j,Qi,{refreshInterval:12e3,revalidateOnFocus:!0}),A=O.useMemo(()=>{var z;const P=((z=k.data)==null?void 0:z.results)||[];return P.find(q=>q.lookup_key===y)||P[0]||null},[(oe=k.data)==null?void 0:oe.results,y]);O.useEffect(()=>{var z,q;if(A!=null&&A.lookup_key){v(A.lookup_key);return}const P=(q=(z=k.data)==null?void 0:z.results)==null?void 0:q[0];P!=null&&P.lookup_key&&v(P.lookup_key)},[(he=k.data)==null?void 0:he.results,A==null?void 0:A.lookup_key]);const R=O.useMemo(()=>{if(!A)return null;const P=A.payment_id||"";return{paymentId:P,requestId:P?"":A.request_id||"",gateway:"",route:"",status:"",eventType:"",errorCode:""}},[A]),T=S&&e&&R?Wk(s,e,1,50,R):null,N=ir(T,Qi,{refreshInterval:12e3,revalidateOnFocus:!0}),$=O.useMemo(()=>{var z;const P=((z=N.data)==null?void 0:z.timeline)||[];return P.find(q=>q.id===x)||P[0]||null},[(X=N.data)==null?void 0:X.timeline,x]);O.useEffect(()=>{var z,q;if($!=null&&$.id){m($.id);return}const P=(q=(z=N.data)==null?void 0:z.timeline)==null?void 0:q[0];P!=null&&P.id&&m(P.id)},[(Oe=N.data)==null?void 0:Oe.timeline,$==null?void 0:$.id]);const D=O.useMemo(()=>{var z;const P=[];for(const q of((z=N.data)==null?void 0:z.timeline)||[]){const J=ld(q),ee=P[P.length-1];!ee||ee.phase!==J?P.push({phase:J,events:[q]}):ee.events.push(q)}return P},[(ge=N.data)==null?void 0:ge.timeline]),F=O.useMemo(()=>pce($),[$]),V=((_e=k.error)==null?void 0:_e.message)||((Ce=N.error)==null?void 0:Ce.message)||null,H=k.isLoading||N.isLoading,L=((Re=(we=N.data)==null?void 0:we.timeline)==null?void 0:Re.length)||0,U=((Te=A==null?void 0:A.gateways)==null?void 0:Te.length)||0,K=A?lce(A.last_seen_ms):"No activity";function Q(P,z,q,J){const ee=Pu(q),be=h$({range:P,page:z>1?z:void 0,payment_id:ee.paymentId||void 0,request_id:ee.requestId||void 0,gateway:ee.gateway||void 0,route:ee.route||void 0,status:ee.status||void 0,event_type:ee.eventType||void 0,error_code:ee.errorCode||void 0,selected:J||void 0});r(be)}function G(P,z){d(q=>Pu({...q,[P]:z}))}function re(){const z=Pu(u);g(1),d(z),p(z),Q(s,1,z)}function Z(){g(1),d(Ky),p(Ky),Q(s,1,Ky)}function pe(){k.mutate(),N.mutate()}function ce(P){l(P),g(1),Q(P,1,f,y)}function Ee(P){v(P),Q(s,h,f,P)}async function Ie(P){if(P)try{await navigator.clipboard.writeText(P)}catch{}}function te(){if(!$)return;const P=$.payment_id||"",z={paymentId:P,requestId:P?"":$.request_id||"",gateway:$.gateway||"",route:"",status:"",eventType:"",errorCode:""};d(z),p(z),g(1),Q(s,1,z,y)}return S?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Decision Audit"}),c.jsx("p",{className:"mt-1 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:"Search by payment or request, then inspect the full sequence of gateway decisions, gateway updates, rule evaluations, and errors with the exact payload captured at each step."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(Be,{size:"sm",variant:"ghost",onClick:pe,children:"Refresh"})})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[rce.map(P=>c.jsx(Be,{size:"sm",variant:s===P?"primary":"secondary",onClick:()=>ce(P),children:P},P)),c.jsx(ze,{variant:"green",children:e||"Current merchant"})]}),c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Search Decision Trail"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Use payment or request IDs when you have them. Error code, gateway, route, and status narrow operational noise quickly."})]})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[c.jsx("input",{className:Mo(),value:u.paymentId,onChange:P=>G("paymentId",P.target.value),placeholder:"Payment ID"}),c.jsx("input",{className:Mo(),value:u.requestId,onChange:P=>G("requestId",P.target.value),placeholder:"Request ID"}),c.jsx("input",{className:Mo(),value:u.gateway,onChange:P=>G("gateway",P.target.value),placeholder:"Gateway"}),c.jsx("select",{className:Mo(),value:u.route,onChange:P=>G("route",P.target.value),children:ace.map(P=>c.jsx("option",{value:P.value,children:P.label},P.value||"all"))}),c.jsx("input",{className:Mo(),value:u.errorCode,onChange:P=>G("errorCode",P.target.value),placeholder:"Error code"}),c.jsx("select",{className:Mo(),value:u.status,onChange:P=>G("status",P.target.value),children:nce.map(P=>c.jsx("option",{value:P.value,children:P.label},P.value||"all"))})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Be,{size:"sm",onClick:re,children:"Search"}),c.jsx(Be,{size:"sm",variant:"secondary",onClick:Z,children:"Clear"})]})]})]}),c.jsx(ln,{error:V}),H&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(Ar,{size:16}),"Loading decision audit data…"]}),c.jsxs("section",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsx(Wf,{label:"Matching payments",value:String((($e=k.data)==null?void 0:$e.total_results)||0),helper:"Results within the selected time window"}),c.jsx(Wf,{label:"Timeline events",value:String(L),helper:"Captured for the selected payment"}),c.jsx(Wf,{label:"Active gateways",value:String(U),helper:"Distinct gateways seen on the selected payment"}),c.jsx(Wf,{label:"Latest activity",value:K,helper:"Most recent event on the selected payment"})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[360px_minmax(0,1fr)]",children:[c.jsxs(ke,{children:[c.jsx(qe,{children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Matching Payments"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Be,{size:"sm",variant:"secondary",disabled:h<=1,onClick:()=>{const P=Math.max(1,h-1);g(P),Q(s,P,f,y)},children:"Prev"}),c.jsx(Be,{size:"sm",variant:"secondary",disabled:(((W=(Ze=k.data)==null?void 0:Ze.results)==null?void 0:W.length)||0){const P=h+1;g(P),Q(s,P,f,y)},children:"Next"})]})]})}),c.jsx(Ae,{className:"space-y-3",children:(M=(E=k.data)==null?void 0:E.results)!=null&&M.length?k.data.results.map(P=>c.jsxs("button",{type:"button",onClick:()=>Ee(P.lookup_key),className:`w-full rounded-2xl border p-4 text-left transition-all ${(A==null?void 0:A.lookup_key)===P.lookup_key?"border-brand-500/50 bg-brand-500/5":"border-slate-200 hover:border-slate-300 dark:border-[#1d1d23] dark:hover:border-[#2a2a33]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:P.payment_id||P.request_id||P.lookup_key}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:[P.merchant_id||"unknown merchant"," · ",sd(P.last_seen_ms)]})]}),c.jsx(ze,{variant:qy(P.latest_status),children:vs(P.latest_status)||"Unknown"})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[P.latest_stage?c.jsx(ze,{variant:"blue",children:P.latest_stage}):null,P.latest_gateway?c.jsx(ze,{variant:"green",children:P.latest_gateway}):null,c.jsxs(ze,{variant:"gray",children:[P.event_count," events"]})]}),P.request_id?c.jsxs("p",{className:"mt-3 truncate text-[11px] text-slate-500 dark:text-[#8a8a93]",children:["request ",P.request_id]}):null]},P.lookup_key)):c.jsx(su,{title:"No matching payments found",body:"Try widening the time range or searching by a single payment ID, request ID, or error code."})})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_380px]",children:[c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(qe,{children:c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Selected Payment Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:(A==null?void 0:A.payment_id)||(A==null?void 0:A.request_id)||"Choose a payment from the result list to inspect the timeline."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[A!=null&&A.latest_gateway?c.jsx(ze,{variant:"green",children:A.latest_gateway}):null,A!=null&&A.latest_stage?c.jsx(ze,{variant:"blue",children:A.latest_stage}):null,A!=null&&A.latest_status?c.jsx(ze,{variant:qy(A.latest_status),children:vs(A.latest_status)}):null]})]})}),c.jsx(Ae,{children:D.length?c.jsx("div",{className:"space-y-6",children:D.map(P=>c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(ze,{variant:Hk(P.phase),children:P.phase}),c.jsxs("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:[P.events.length," event",P.events.length===1?"":"s"]})]}),c.jsx("div",{className:"relative space-y-3 pl-6 before:absolute before:left-2 before:top-2 before:bottom-2 before:w-px before:bg-slate-200 dark:before:bg-[#23232a]",children:P.events.map(z=>{const q=($==null?void 0:$.id)===z.id;return c.jsxs("button",{type:"button",onClick:()=>{m(z.id),_("summary")},className:`relative w-full rounded-[24px] border p-5 text-left shadow-sm transition ${q?"border-brand-500/50 bg-brand-500/5":"border-slate-200 bg-white/70 hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#09090b] dark:hover:border-[#2a2a33]"}`,children:[c.jsx("span",{className:`absolute -left-[25px] top-6 h-3 w-3 rounded-full ${Yl(z)==="red"?"bg-red-400":Yl(z)==="green"?"bg-emerald-400":Yl(z)==="purple"?"bg-purple-400":Yl(z)==="orange"?"bg-orange-400":"bg-blue-400"}`}),c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:Z0(z)}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:[m$(z.route)," · ",sd(z.created_at_ms)]})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(ze,{variant:Yl(z),children:uce(z.event_type)}),z.status?c.jsx(ze,{variant:qy(z.status),children:vs(z.status)}):null,z.gateway?c.jsx(ze,{variant:"green",children:z.gateway}):null]})]}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-slate-500 dark:text-[#8a8a93]",children:[z.request_id?c.jsxs("span",{children:["request ",z.request_id]}):null,z.routing_approach?c.jsxs("span",{children:["approach ",z.routing_approach]}):null,z.rule_name?c.jsxs("span",{children:["rule ",z.rule_name]}):null,z.payment_method_type?c.jsxs("span",{children:["PMT ",z.payment_method_type]}):null,z.payment_method?c.jsxs("span",{children:["method ",z.payment_method]}):null,z.error_code?c.jsxs("span",{children:["error ",z.error_code]}):null]}),z.error_message?c.jsx("p",{className:"mt-4 rounded-2xl border border-red-500/20 bg-red-500/5 px-4 py-3 text-sm text-red-300",children:z.error_message}):null]},z.id)})})]},P.phase))}):c.jsx(su,{title:"No timeline selected yet",body:"Pick a payment from the left column to see the full transaction trail."})})]}),c.jsxs(ke,{className:"overflow-visible xl:sticky xl:top-6 xl:self-start",children:[c.jsx(qe,{children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Event Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:$?`${Z0($)} · ${sd($.created_at_ms)}`:"Select a timeline event to inspect the captured payload."})]}),$?c.jsx(ze,{variant:Hk(ld($)),children:ld($)}):null]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:ice.map(P=>c.jsx(Be,{size:"sm",variant:"secondary",className:fce(w===P),onClick:()=>_(P),children:P==="summary"?"Summary":P==="input"?"Input":P==="response"?"Response":"Raw JSON"},P))})]})}),c.jsx(Ae,{className:"space-y-4",children:$&&F?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Be,{size:"sm",variant:"secondary",onClick:()=>_("raw"),children:"View payload"}),c.jsx(Be,{size:"sm",variant:"secondary",disabled:!$.request_id,onClick:()=>Ie($.request_id),children:"Copy request ID"}),c.jsx(Be,{size:"sm",variant:"secondary",disabled:!$.payment_id,onClick:()=>Ie($.payment_id),children:"Copy payment ID"}),c.jsx(Be,{size:"sm",variant:"secondary",onClick:te,children:"Open related events"})]}),w==="summary"?c.jsxs("div",{className:"space-y-4",children:[c.jsx(dce,{rows:F.summaryRows}),c.jsx(Do,{title:"Connector score context",value:F.scoreContext,emptyMessage:"No connector score map was captured for this event."}),c.jsx(Do,{title:"Selection reason",value:F.selectionReason,emptyMessage:"No explicit selection reason was captured for this event."}),c.jsx(Do,{title:"Score / rule details",value:F.signalRecord,emptyMessage:"This event did not capture additional scoring or rule metadata."})]}):null,w==="input"?c.jsx(Do,{title:"Input",value:F.requestPayload,emptyMessage:"No dedicated request payload was captured for this event."}):null,w==="response"?c.jsx(Do,{title:"Response",value:F.responsePayload,emptyMessage:"No dedicated response payload was captured for this event."}):null,w==="raw"?c.jsx(Do,{title:"Raw JSON",value:F.rawEvent,emptyMessage:"No raw payload is available for this event."}):null]}):c.jsx(su,{title:"No event selected",body:"Pick a timeline step to see the request, response, transaction context, and raw payload."})})]})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Decision Audit"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Search a payment and inspect gateway decisions, gateway updates, rule evaluations, and errors in one transaction trail."})]}),c.jsx(su,{title:"Select a merchant to start auditing payments",body:"Use the merchant selector in the top bar to load the decision trail for a merchant."})]})}function mce(){return c.jsx(LM,{children:c.jsxs(en,{element:c.jsx(iL,{}),children:[c.jsx(en,{index:!0,element:c.jsx(LL,{})}),c.jsx(en,{path:"routing",element:c.jsx(FL,{})}),c.jsx(en,{path:"routing/sr",element:c.jsx(q3,{})}),c.jsx(en,{path:"routing/rules",element:c.jsx(U5,{})}),c.jsx(en,{path:"routing/volume",element:c.jsx(Iue,{})}),c.jsx(en,{path:"routing/debit",element:c.jsx(Mue,{})}),c.jsx(en,{path:"decisions",element:c.jsx(Yue,{})}),c.jsx(en,{path:"analytics",element:c.jsx(tce,{})}),c.jsx(en,{path:"audit",element:c.jsx(hce,{})}),c.jsx(en,{path:"*",element:c.jsx(RM,{to:".",replace:!0})})]})})}class yce extends O.Component{constructor(){super(...arguments);xw(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(r){return{error:r,errorInfo:null}}componentDidCatch(r,n){console.log(` -`+"!".repeat(80)),console.log("[ERROR BOUNDARY] Component Error Caught"),console.log(`Timestamp: ${new Date().toISOString()}`),console.log("Error Message:",r.message),console.log("Error Stack:",r.stack),console.log("Component Stack:",n.componentStack),console.log("!".repeat(80)+` -`),this.setState({errorInfo:n})}render(){return this.state.error?c.jsxs("div",{style:{padding:32,fontFamily:"monospace",color:"red"},children:[c.jsx("h2",{children:"Dashboard Error"}),c.jsx("pre",{children:this.state.error.message}),c.jsx("pre",{children:this.state.error.stack}),this.state.errorInfo&&c.jsxs("pre",{style:{marginTop:16,color:"darkred"},children:["Component Stack:",this.state.errorInfo.componentStack]})]}):this.props.children}}console.log(` -`+"=".repeat(80));console.log("[APP STARTUP] Dashboard initializing...");console.log(`Timestamp: ${new Date().toISOString()}`);console.log("Environment: production");console.log("Base URL: /dashboard");console.log("=".repeat(80)+` -`);window.onerror=(e,t,r,n,a)=>{console.log(` -`+"!".repeat(80)),console.log("[WINDOW ERROR]"),console.log("Message:",e),console.log("Source:",t),console.log("Line:",r,"Column:",n),a&&(console.log("Error:",a.message),console.log("Stack:",a.stack)),console.log("!".repeat(80)+` -`)};window.onunhandledrejection=e=>{console.log(` -`+"!".repeat(80)),console.log("[UNHANDLED PROMISE REJECTION]"),console.log("Reason:",e.reason),e.reason instanceof Error&&console.log("Stack:",e.reason.stack),console.log("!".repeat(80)+` -`)};Yy.createRoot(document.getElementById("root")).render(c.jsx(C.StrictMode,{children:c.jsx(yce,{children:c.jsx(KM,{basename:"/dashboard",children:c.jsx(mce,{})})})})); diff --git a/website/dist/assets/index-Bf1zG_Ya.js b/website/dist/assets/index-Bf1zG_Ya.js new file mode 100644 index 00000000..8dba3f61 --- /dev/null +++ b/website/dist/assets/index-Bf1zG_Ya.js @@ -0,0 +1,334 @@ +var U$=Object.defineProperty;var V$=(e,t,r)=>t in e?U$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var zw=(e,t,r)=>V$(e,typeof t!="symbol"?t+"":t,r);function W$(e,t){for(var r=0;rn[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"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var md=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gA={exports:{}},dh={},xA={exports:{}},He={};/** + * @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 Xc=Symbol.for("react.element"),H$=Symbol.for("react.portal"),G$=Symbol.for("react.fragment"),q$=Symbol.for("react.strict_mode"),K$=Symbol.for("react.profiler"),X$=Symbol.for("react.provider"),Y$=Symbol.for("react.context"),Z$=Symbol.for("react.forward_ref"),Q$=Symbol.for("react.suspense"),J$=Symbol.for("react.memo"),eI=Symbol.for("react.lazy"),Bw=Symbol.iterator;function tI(e){return e===null||typeof e!="object"?null:(e=Bw&&e[Bw]||e["@@iterator"],typeof e=="function"?e:null)}var bA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wA=Object.assign,_A={};function ml(e,t,r){this.props=e,this.context=t,this.refs=_A,this.updater=r||bA}ml.prototype.isReactComponent={};ml.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ml.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SA(){}SA.prototype=ml.prototype;function ux(e,t,r){this.props=e,this.context=t,this.refs=_A,this.updater=r||bA}var cx=ux.prototype=new SA;cx.constructor=ux;wA(cx,ml.prototype);cx.isPureReactComponent=!0;var Uw=Array.isArray,jA=Object.prototype.hasOwnProperty,dx={current:null},OA={key:!0,ref:!0,__self:!0,__source:!0};function kA(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)jA.call(t,n)&&!OA.hasOwnProperty(n)&&(a[n]=t[n]);var s=arguments.length-2;if(s===1)a.children=r;else if(1>>1,K=D[J];if(0>>1;Ja(be,q))uea(Ce,be)?(D[J]=Ce,D[ue]=q,J=ue):(D[J]=be,D[Q]=q,J=Q);else if(uea(Ce,q))D[J]=Ce,D[ue]=q,J=ue;else break e}}return U}function a(D,U){var q=D.sortIndex-U.sortIndex;return q!==0?q:D.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,d=null,p=3,h=!1,g=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(D){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=D)n(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=r(u)}}function S(D){if(y=!1,w(D),!g)if(r(l)!==null)g=!0,W(b);else{var U=r(u);U!==null&&V(S,U.startTime-D)}}function b(D,U){g=!1,y&&(y=!1,x(k),k=-1),h=!0;var q=p;try{for(w(U),d=r(l);d!==null&&(!(d.expirationTime>U)||D&&!T());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var K=J(d.expirationTime<=U);U=e.unstable_now(),typeof K=="function"?d.callback=K:d===r(l)&&n(l),w(U)}else n(l);d=r(l)}if(d!==null)var ae=!0;else{var Q=r(u);Q!==null&&V(S,Q.startTime-U),ae=!1}return ae}finally{d=null,p=q,h=!1}}var _=!1,O=null,k=-1,A=5,$=-1;function T(){return!(e.unstable_now()-$D||125J?(D.sortIndex=q,t(u,D),r(l)===null&&D===r(u)&&(y?(x(k),k=-1):y=!0,V(S,q-J))):(D.sortIndex=K,t(l,D),g||h||(g=!0,W(b))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var U=p;return function(){var q=p;p=U;try{return D.apply(this,arguments)}finally{p=q}}}})(CA);NA.exports=CA;var pI=NA.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 hI=j,Qr=pI;function ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dv=Object.prototype.hasOwnProperty,mI=/^[: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]*$/,Ww={},Hw={};function yI(e){return dv.call(Hw,e)?!0:dv.call(Ww,e)?!1:mI.test(e)?Hw[e]=!0:(Ww[e]=!0,!1)}function vI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function gI(e,t,r,n){if(t===null||typeof t>"u"||vI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pr(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ur={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ur[e]=new Pr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ur[t]=new Pr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ur[e]=new Pr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ur[e]=new Pr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ur[e]=new Pr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ur[e]=new Pr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ur[e]=new Pr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ur[e]=new Pr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ur[e]=new Pr(e,5,!1,e.toLowerCase(),null,!1,!1)});var px=/[\-:]([a-z])/g;function hx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(px,hx);ur[t]=new Pr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(px,hx);ur[t]=new Pr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(px,hx);ur[t]=new Pr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ur[e]=new Pr(e,1,!1,e.toLowerCase(),null,!1,!1)});ur.xlinkHref=new Pr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ur[e]=new Pr(e,1,!1,e.toLowerCase(),null,!0,!0)});function mx(e,t,r,n){var a=ur.hasOwnProperty(t)?ur[t]:null;(a!==null?a.type!==0:n||!(2s||a[o]!==i[s]){var l=` +`+a[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Cm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?su(e):""}function xI(e){switch(e.tag){case 5:return su(e.type);case 16:return su("Lazy");case 13:return su("Suspense");case 19:return su("SuspenseList");case 0:case 2:case 15:return e=Tm(e.type,!1),e;case 11:return e=Tm(e.type.render,!1),e;case 1:return e=Tm(e.type,!0),e;default:return""}}function mv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qo:return"Fragment";case Zo:return"Portal";case fv:return"Profiler";case yx:return"StrictMode";case pv:return"Suspense";case hv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case IA:return(e.displayName||"Context")+".Consumer";case $A:return(e._context.displayName||"Context")+".Provider";case vx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gx:return t=e.displayName||null,t!==null?t:mv(e.type)||"Memo";case Qa:t=e._payload,e=e._init;try{return mv(e(t))}catch{}}return null}function bI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mv(t);case 8:return t===yx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ji(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function MA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wI(e){var t=MA(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gd(e){e._valueTracker||(e._valueTracker=wI(e))}function DA(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=MA(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Sf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yv(e,t){var r=t.checked;return At({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function qw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ji(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function LA(e,t){t=t.checked,t!=null&&mx(e,"checked",t,!1)}function vv(e,t){LA(e,t);var r=ji(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gv(e,t.type,r):t.hasOwnProperty("defaultValue")&&gv(e,t.type,ji(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function gv(e,t,r){(t!=="number"||Sf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var lu=Array.isArray;function ys(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=xd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var wu={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},_I=["Webkit","ms","Moz","O"];Object.keys(wu).forEach(function(e){_I.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wu[t]=wu[e]})});function UA(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||wu.hasOwnProperty(e)&&wu[e]?(""+t).trim():t+"px"}function VA(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=UA(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var SI=At({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 wv(e,t){if(t){if(SI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function _v(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sv=null;function xx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jv=null,vs=null,gs=null;function Zw(e){if(e=Qc(e)){if(typeof jv!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=yh(t),jv(e.stateNode,e.type,t))}}function WA(e){vs?gs?gs.push(e):gs=[e]:vs=e}function HA(){if(vs){var e=vs,t=gs;if(gs=vs=null,Zw(e),t)for(e=0;e>>=0,e===0?32:31-(II(e)/RI|0)|0}var bd=64,wd=4194304;function uu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Af(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~a;s!==0?n=uu(s):(i&=o,i!==0&&(n=uu(i)))}else o=r&~a,o!==0?n=uu(o):i!==0&&(n=uu(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Yc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mn(t),e[t]=r}function FI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Su),o1=" ",s1=!1;function d2(e,t){switch(e){case"keyup":return pR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function f2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jo=!1;function mR(e,t){switch(e){case"compositionend":return f2(t);case"keypress":return t.which!==32?null:(s1=!0,o1);case"textInput":return e=t.data,e===o1&&s1?null:e;default:return null}}function yR(e,t){if(Jo)return e==="compositionend"||!Ax&&d2(e,t)?(e=u2(),lf=jx=si=null,Jo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=d1(r)}}function y2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function v2(){for(var e=window,t=Sf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Sf(e.document)}return t}function Ex(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function OR(e){var t=v2(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&y2(r.ownerDocument.documentElement,r)){if(n!==null&&Ex(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=f1(r,i);var o=f1(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,es=null,Nv=null,Ou=null,Cv=!1;function p1(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cv||es==null||es!==Sf(n)||(n=es,"selectionStart"in n&&Ex(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ou&&Yu(Ou,n)||(Ou=n,n=Nf(Nv,"onSelect"),0ns||(e.current=Dv[ns],Dv[ns]=null,ns--)}function ht(e,t){ns++,Dv[ns]=e.current,e.current=t}var Oi={},xr=Ti(Oi),Dr=Ti(!1),mo=Oi;function Cs(e,t){var r=e.type.contextTypes;if(!r)return Oi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Lr(e){return e=e.childContextTypes,e!=null}function Tf(){wt(Dr),wt(xr)}function b1(e,t,r){if(xr.current!==Oi)throw Error(ne(168));ht(xr,t),ht(Dr,r)}function k2(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(ne(108,bI(e)||"Unknown",a));return At({},r,n)}function $f(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oi,mo=xr.current,ht(xr,e),ht(Dr,Dr.current),!0}function w1(e,t,r){var n=e.stateNode;if(!n)throw Error(ne(169));r?(e=k2(e,t,mo),n.__reactInternalMemoizedMergedChildContext=e,wt(Dr),wt(xr),ht(xr,e)):wt(Dr),ht(Dr,r)}var ha=null,vh=!1,Gm=!1;function A2(e){ha===null?ha=[e]:ha.push(e)}function DR(e){vh=!0,A2(e)}function $i(){if(!Gm&&ha!==null){Gm=!0;var e=0,t=nt;try{var r=ha;for(nt=1;e>=o,a-=o,ya=1<<32-Mn(t)+a|r<k?(A=O,O=null):A=O.sibling;var $=p(x,O,w[k],S);if($===null){O===null&&(O=A);break}e&&O&&$.alternate===null&&t(x,O),m=i($,m,k),_===null?b=$:_.sibling=$,_=$,O=A}if(k===w.length)return r(x,O),_t&&qi(x,k),b;if(O===null){for(;kk?(A=O,O=null):A=O.sibling;var T=p(x,O,$.value,S);if(T===null){O===null&&(O=A);break}e&&O&&T.alternate===null&&t(x,O),m=i(T,m,k),_===null?b=T:_.sibling=T,_=T,O=A}if($.done)return r(x,O),_t&&qi(x,k),b;if(O===null){for(;!$.done;k++,$=w.next())$=d(x,$.value,S),$!==null&&(m=i($,m,k),_===null?b=$:_.sibling=$,_=$);return _t&&qi(x,k),b}for(O=n(x,O);!$.done;k++,$=w.next())$=h(O,x,k,$.value,S),$!==null&&(e&&$.alternate!==null&&O.delete($.key===null?k:$.key),m=i($,m,k),_===null?b=$:_.sibling=$,_=$);return e&&O.forEach(function(P){return t(x,P)}),_t&&qi(x,k),b}function v(x,m,w,S){if(typeof w=="object"&&w!==null&&w.type===Qo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case vd:e:{for(var b=w.key,_=m;_!==null;){if(_.key===b){if(b=w.type,b===Qo){if(_.tag===7){r(x,_.sibling),m=a(_,w.props.children),m.return=x,x=m;break e}}else if(_.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Qa&&j1(b)===_.type){r(x,_.sibling),m=a(_,w.props),m.ref=Ul(x,_,w),m.return=x,x=m;break e}r(x,_);break}else t(x,_);_=_.sibling}w.type===Qo?(m=uo(w.props.children,x.mode,S,w.key),m.return=x,x=m):(S=yf(w.type,w.key,w.props,null,x.mode,S),S.ref=Ul(x,m,w),S.return=x,x=S)}return o(x);case Zo:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){r(x,m.sibling),m=a(m,w.children||[]),m.return=x,x=m;break e}else{r(x,m);break}else t(x,m);m=m.sibling}m=ey(w,x.mode,S),m.return=x,x=m}return o(x);case Qa:return _=w._init,v(x,m,_(w._payload),S)}if(lu(w))return g(x,m,w,S);if(Dl(w))return y(x,m,w,S);Ed(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(r(x,m.sibling),m=a(m,w),m.return=x,x=m):(r(x,m),m=Jm(w,x.mode,S),m.return=x,x=m),o(x)):r(x,m)}return v}var $s=C2(!0),T2=C2(!1),Mf=Ti(null),Df=null,os=null,Tx=null;function $x(){Tx=os=Df=null}function Ix(e){var t=Mf.current;wt(Mf),e._currentValue=t}function zv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function bs(e,t){Df=e,Tx=os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ir=!0),e.firstContext=null)}function gn(e){var t=e._currentValue;if(Tx!==e)if(e={context:e,memoizedValue:t,next:null},os===null){if(Df===null)throw Error(ne(308));os=e,Df.dependencies={lanes:0,firstContext:e}}else os=os.next=e;return t}var eo=null;function Rx(e){eo===null?eo=[e]:eo.push(e)}function $2(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,Rx(t)):(r.next=a.next,a.next=r),t.interleaved=r,Pa(e,n)}function Pa(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ja=!1;function Mx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function I2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Sa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ye&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Pa(e,r)}return a=n.interleaved,a===null?(t.next=t,Rx(n)):(t.next=a.next,a.next=t),n.interleaved=t,Pa(e,r)}function cf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,wx(e,r)}}function O1(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Lf(e,t,r,n){var a=e.updateQueue;Ja=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,s=a.shared.pending;if(s!==null){a.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(i!==null){var d=a.baseState;o=0,f=u=l=null,s=i;do{var p=s.lane,h=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,y=s;switch(p=t,h=r,y.tag){case 1:if(g=y.payload,typeof g=="function"){d=g.call(h,d,p);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,p=typeof g=="function"?g.call(h,d,p):g,p==null)break e;d=At({},d,p);break e;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,l=d):f=f.next=h,o|=p;if(s=s.next,s===null){if(s=a.shared.pending,s===null)break;p=s,s=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(f===null&&(l=d),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=f,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);go|=o,e.lanes=o,e.memoizedState=d}}function k1(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Km.transition;Km.transition={};try{e(!1),t()}finally{nt=r,Km.transition=n}}function Z2(){return xn().memoizedState}function BR(e,t,r){var n=gi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Q2(e))J2(t,r);else if(r=$2(e,t,r,n),r!==null){var a=Ar();Dn(r,e,n,a),eE(r,t,n)}}function UR(e,t,r){var n=gi(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Q2(e))J2(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,r);if(a.hasEagerState=!0,a.eagerState=s,Fn(s,o)){var l=t.interleaved;l===null?(a.next=a,Rx(t)):(a.next=l.next,l.next=a),t.interleaved=a;return}}catch{}finally{}r=$2(e,t,a,n),r!==null&&(a=Ar(),Dn(r,e,n,a),eE(r,t,n))}}function Q2(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function J2(e,t){ku=zf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function eE(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,wx(e,r)}}var Bf={readContext:gn,useCallback:dr,useContext:dr,useEffect:dr,useImperativeHandle:dr,useInsertionEffect:dr,useLayoutEffect:dr,useMemo:dr,useReducer:dr,useRef:dr,useState:dr,useDebugValue:dr,useDeferredValue:dr,useTransition:dr,useMutableSource:dr,useSyncExternalStore:dr,useId:dr,unstable_isNewReconciler:!1},VR={readContext:gn,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:E1,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ff(4194308,4,G2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ff(4194308,4,e,t)},useInsertionEffect:function(e,t){return ff(4,2,e,t)},useMemo:function(e,t){var r=Wn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Wn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=BR.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:A1,useDebugValue:Wx,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=A1(!1),t=e[0];return e=zR.bind(null,e[1]),Wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,a=Wn();if(_t){if(r===void 0)throw Error(ne(407));r=r()}else{if(r=t(),nr===null)throw Error(ne(349));vo&30||L2(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,E1(z2.bind(null,n,i,e),[e]),n.flags|=2048,ac(9,F2.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Wn(),t=nr.identifierPrefix;if(_t){var r=va,n=ya;r=(n&~(1<<32-Mn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=rc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Gn]=t,e[Ju]=n,cE(e,t,!1,!1),t.stateNode=e;e:{switch(o=_v(r,n),r){case"dialog":yt("cancel",e),yt("close",e),a=n;break;case"iframe":case"object":case"embed":yt("load",e),a=n;break;case"video":case"audio":for(a=0;aMs&&(t.flags|=128,n=!0,Vl(i,!1),t.lanes=4194304)}else{if(!n)if(e=Ff(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Vl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!_t)return fr(t),null}else 2*It()-i.renderingStartTime>Ms&&r!==1073741824&&(t.flags|=128,n=!0,Vl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=It(),t.sibling=null,r=jt.current,ht(jt,n?r&1|2:r&1),t):(fr(t),null);case 22:case 23:return Yx(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Wr&1073741824&&(fr(t),t.subtreeFlags&6&&(t.flags|=8192)):fr(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function ZR(e,t){switch(Nx(t),t.tag){case 1:return Lr(t.type)&&Tf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Is(),wt(Dr),wt(xr),Fx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lx(t),null;case 13:if(wt(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));Ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return wt(jt),null;case 4:return Is(),null;case 10:return Ix(t.type._context),null;case 22:case 23:return Yx(),null;case 24:return null;default:return null}}var Nd=!1,yr=!1,QR=typeof WeakSet=="function"?WeakSet:Set,fe=null;function ss(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Nt(e,t,n)}else r.current=null}function Xv(e,t,r){try{r()}catch(n){Nt(e,t,n)}}var F1=!1;function JR(e,t){if(Tv=Ef,e=v2(),Ex(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,d=e,p=null;t:for(;;){for(var h;d!==r||a!==0&&d.nodeType!==3||(s=o+a),d!==i||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===r&&++u===a&&(s=o),p===i&&++f===n&&(l=o),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for($v={focusedElem:e,selectionRange:r},Ef=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,v=g.memoizedState,x=t.stateNode,m=x.getSnapshotBeforeUpdate(t.elementType===t.type?y:Pn(t.type,y),v);x.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(S){Nt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return g=F1,F1=!1,g}function Au(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Xv(t,r,i)}a=a.next}while(a!==n)}}function bh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Yv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function pE(e){var t=e.alternate;t!==null&&(e.alternate=null,pE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gn],delete t[Ju],delete t[Mv],delete t[RR],delete t[MR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hE(e){return e.tag===5||e.tag===3||e.tag===4}function z1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Cf));else if(n!==4&&(e=e.child,e!==null))for(Zv(e,t,r),e=e.sibling;e!==null;)Zv(e,t,r),e=e.sibling}function Qv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Qv(e,t,r),e=e.sibling;e!==null;)Qv(e,t,r),e=e.sibling}var sr=null,Nn=!1;function Ka(e,t,r){for(r=r.child;r!==null;)mE(e,t,r),r=r.sibling}function mE(e,t,r){if(Yn&&typeof Yn.onCommitFiberUnmount=="function")try{Yn.onCommitFiberUnmount(fh,r)}catch{}switch(r.tag){case 5:yr||ss(r,t);case 6:var n=sr,a=Nn;sr=null,Ka(e,t,r),sr=n,Nn=a,sr!==null&&(Nn?(e=sr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):sr.removeChild(r.stateNode));break;case 18:sr!==null&&(Nn?(e=sr,r=r.stateNode,e.nodeType===8?Hm(e.parentNode,r):e.nodeType===1&&Hm(e,r),Ku(e)):Hm(sr,r.stateNode));break;case 4:n=sr,a=Nn,sr=r.stateNode.containerInfo,Nn=!0,Ka(e,t,r),sr=n,Nn=a;break;case 0:case 11:case 14:case 15:if(!yr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Xv(r,t,o),a=a.next}while(a!==n)}Ka(e,t,r);break;case 1:if(!yr&&(ss(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Nt(r,t,s)}Ka(e,t,r);break;case 21:Ka(e,t,r);break;case 22:r.mode&1?(yr=(n=yr)||r.memoizedState!==null,Ka(e,t,r),yr=n):Ka(e,t,r);break;default:Ka(e,t,r)}}function B1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new QR),t.forEach(function(n){var a=lM.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function kn(e,t){var r=t.deletions;if(r!==null)for(var n=0;na&&(a=o),n&=~i}if(n=a,n=It()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*tM(n/1960))-n,10e?16:e,li===null)var n=!1;else{if(e=li,li=null,Wf=0,Ye&6)throw Error(ne(331));var a=Ye;for(Ye|=4,fe=e.current;fe!==null;){var i=fe,o=i.child;if(fe.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lIt()-Kx?lo(e,0):qx|=r),Fr(e,t)}function SE(e,t){t===0&&(e.mode&1?(t=wd,wd<<=1,!(wd&130023424)&&(wd=4194304)):t=1);var r=Ar();e=Pa(e,t),e!==null&&(Yc(e,t,r),Fr(e,r))}function sM(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),SE(e,r)}function lM(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ne(314))}n!==null&&n.delete(t),SE(e,r)}var jE;jE=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)Ir=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ir=!1,XR(e,t,r);Ir=!!(e.flags&131072)}else Ir=!1,_t&&t.flags&1048576&&E2(t,Rf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;pf(e,t),e=t.pendingProps;var a=Cs(t,xr.current);bs(t,r),a=Bx(null,t,n,e,a,r);var i=Ux();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Lr(n)?(i=!0,$f(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Mx(t),a.updater=xh,t.stateNode=a,a._reactInternals=t,Uv(t,n,e,r),t=Hv(null,t,n,!0,i,r)):(t.tag=0,_t&&i&&Px(t),wr(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(pf(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=cM(n),e=Pn(n,e),a){case 0:t=Wv(null,t,n,e,r);break e;case 1:t=M1(null,t,n,e,r);break e;case 11:t=I1(null,t,n,e,r);break e;case 14:t=R1(null,t,n,Pn(n.type,e),r);break e}throw Error(ne(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),Wv(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),M1(e,t,n,a,r);case 3:e:{if(sE(t),e===null)throw Error(ne(387));n=t.pendingProps,i=t.memoizedState,a=i.element,I2(e,t),Lf(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Rs(Error(ne(423)),t),t=D1(e,t,n,r,a);break e}else if(n!==a){a=Rs(Error(ne(424)),t),t=D1(e,t,n,r,a);break e}else for(Kr=mi(t.stateNode.containerInfo.firstChild),Xr=t,_t=!0,$n=null,r=T2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ts(),n===a){t=Na(e,t,r);break e}wr(e,t,n,r)}t=t.child}return t;case 5:return R2(t),e===null&&Fv(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Iv(n,a)?o=null:i!==null&&Iv(n,i)&&(t.flags|=32),oE(e,t),wr(e,t,o,r),t.child;case 6:return e===null&&Fv(t),null;case 13:return lE(e,t,r);case 4:return Dx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=$s(t,null,n,r):wr(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),I1(e,t,n,a,r);case 7:return wr(e,t,t.pendingProps,r),t.child;case 8:return wr(e,t,t.pendingProps.children,r),t.child;case 12:return wr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,ht(Mf,n._currentValue),n._currentValue=o,i!==null)if(Fn(i.value,o)){if(i.children===a.children&&!Dr.current){t=Na(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=Sa(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),zv(i.return,r,t),s.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ne(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),zv(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}wr(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,bs(t,r),a=gn(a),n=n(a),t.flags|=1,wr(e,t,n,r),t.child;case 14:return n=t.type,a=Pn(n,t.pendingProps),a=Pn(n.type,a),R1(e,t,n,a,r);case 15:return aE(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Pn(n,a),pf(e,t),t.tag=1,Lr(n)?(e=!0,$f(t)):e=!1,bs(t,r),tE(t,n,a),Uv(t,n,a,r),Hv(null,t,n,!0,e,r);case 19:return uE(e,t,r);case 22:return iE(e,t,r)}throw Error(ne(156,t.tag))};function OE(e,t){return QA(e,t)}function uM(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,r,n){return new uM(e,t,r,n)}function Qx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cM(e){if(typeof e=="function")return Qx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vx)return 11;if(e===gx)return 14}return 2}function xi(e,t){var r=e.alternate;return r===null?(r=mn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function yf(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")Qx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Qo:return uo(r.children,a,i,t);case yx:o=8,a|=8;break;case fv:return e=mn(12,r,t,a|2),e.elementType=fv,e.lanes=i,e;case pv:return e=mn(13,r,t,a),e.elementType=pv,e.lanes=i,e;case hv:return e=mn(19,r,t,a),e.elementType=hv,e.lanes=i,e;case RA:return _h(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $A:o=10;break e;case IA:o=9;break e;case vx:o=11;break e;case gx:o=14;break e;case Qa:o=16,n=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=mn(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function uo(e,t,r,n){return e=mn(7,e,n,t),e.lanes=r,e}function _h(e,t,r,n){return e=mn(22,e,n,t),e.elementType=RA,e.lanes=r,e.stateNode={isHidden:!1},e}function Jm(e,t,r){return e=mn(6,e,null,t),e.lanes=r,e}function ey(e,t,r){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dM(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Im(0),this.expirationTimes=Im(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Im(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Jx(e,t,r,n,a,i,o,s,l){return e=new dM(e,t,r,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=mn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mx(i),e}function fM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PE)}catch(e){console.error(e)}}PE(),PA.exports=en;var us=PA.exports,X1=us;cv.createRoot=X1.createRoot,cv.hydrateRoot=X1.hydrateRoot;/** + * @remix-run/router v1.23.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function oc(){return oc=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function nb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function gM(){return Math.random().toString(36).substr(2,8)}function Z1(e,t){return{usr:e.state,key:e.key,idx:t}}function ng(e,t,r,n){return r===void 0&&(r=null),oc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gl(t):t,{state:r,key:t&&t.key||n||gM()})}function qf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function gl(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function xM(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,s=ui.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(oc({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){s=ui.Pop;let v=f(),x=v==null?null:v-u;u=v,l&&l({action:s,location:y.location,delta:x})}function p(v,x){s=ui.Push;let m=ng(y.location,v,x);u=f()+1;let w=Z1(m,u),S=y.createHref(m);try{o.pushState(w,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;a.location.assign(S)}i&&l&&l({action:s,location:y.location,delta:1})}function h(v,x){s=ui.Replace;let m=ng(y.location,v,x);u=f();let w=Z1(m,u),S=y.createHref(m);o.replaceState(w,"",S),i&&l&&l({action:s,location:y.location,delta:0})}function g(v){let x=a.location.origin!=="null"?a.location.origin:a.location.href,m=typeof v=="string"?v:qf(v);return m=m.replace(/ $/,"%20"),kt(x,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,x)}let y={get action(){return s},get location(){return e(a,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(Y1,d),l=v,()=>{a.removeEventListener(Y1,d),l=null}},createHref(v){return t(a,v)},createURL:g,encodeLocation(v){let x=g(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:h,go(v){return o.go(v)}};return y}var Q1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Q1||(Q1={}));function bM(e,t,r){return r===void 0&&(r="/"),wM(e,t,r)}function wM(e,t,r,n){let a=typeof t=="string"?gl(t):t,i=Ds(a.pathname||"/",r);if(i==null)return null;let o=NE(e);_M(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(kt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=bi([n,l.relativePath]),f=r.concat(l);i.children&&i.children.length>0&&(kt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),NE(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:PM(u,i.index),routesMeta:f})};return e.forEach((i,o)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))a(i,o);else for(let l of CE(i.path))a(i,o,l)}),t}function CE(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=CE(n.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function _M(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:NM(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const SM=/^:[\w-]+$/,jM=3,OM=2,kM=1,AM=10,EM=-2,J1=e=>e==="*";function PM(e,t){let r=e.split("/"),n=r.length;return r.some(J1)&&(n+=EM),t&&(n+=OM),r.filter(a=>!J1(a)).reduce((a,i)=>a+(SM.test(i)?jM:i===""?kM:AM),n)}function NM(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function CM(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=f;if(p==="*"){let y=s[d]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=s[d];return h&&!g?u[p]=void 0:u[p]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function TM(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),nb(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function $M(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nb(!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 Ds(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const IM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RM=e=>IM.test(e);function MM(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?gl(e):e,i;if(r)if(RM(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),nb(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=e_(r.substring(1),"/"):i=e_(r,t)}else i=t;return{pathname:i,search:FM(n),hash:zM(a)}}function e_(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function ty(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function DM(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ab(e,t){let r=DM(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ib(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=gl(e):(a=oc({},e),kt(!a.pathname||!a.pathname.includes("?"),ty("?","pathname","search",a)),kt(!a.pathname||!a.pathname.includes("#"),ty("#","pathname","hash",a)),kt(!a.search||!a.search.includes("#"),ty("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;a.pathname=p.join("/")}s=d>=0?t[d]:"/"}let l=MM(a,s),u=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const bi=e=>e.join("/").replace(/\/\/+/g,"/"),LM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function BM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const TE=["post","put","patch","delete"];new Set(TE);const UM=["get",...TE];new Set(UM);/** + * React Router v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function sc(){return sc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),j.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let d=ib(u,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:bi([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,o,i,e])}const HM=j.createContext(null);function GM(e){let t=j.useContext(za).outlet;return t&&j.createElement(HM.Provider,{value:e},t)}function Ph(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=j.useContext(Fa),{matches:a}=j.useContext(za),{pathname:i}=$o(),o=JSON.stringify(ab(a,n.v7_relativeSplatPath));return j.useMemo(()=>ib(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function qM(e,t){return KM(e,t)}function KM(e,t,r,n){xl()||kt(!1);let{navigator:a}=j.useContext(Fa),{matches:i}=j.useContext(za),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=$o(),f;if(t){var d;let v=typeof t=="string"?gl(t):t;l==="/"||(d=v.pathname)!=null&&d.startsWith(l)||kt(!1),f=v}else f=u;let p=f.pathname||"/",h=p;if(l!=="/"){let v=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=bM(e,{pathname:h}),y=JM(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},s,v.params),pathname:bi([l,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:bi([l,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,r,n);return t&&y?j.createElement(Eh.Provider,{value:{location:sc({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:ui.Pop}},y):y}function XM(){let e=nD(),t=BM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:a},r):null,null)}const YM=j.createElement(XM,null);class ZM extends j.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?j.createElement(za.Provider,{value:this.props.routeContext},j.createElement(IE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function QM(e){let{routeContext:t,match:r,children:n}=e,a=j.useContext(Ah);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(za.Provider,{value:t},n)}function JM(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(a=r)==null?void 0:a.errors;if(s!=null){let f=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||kt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,p)=>{let h,g=!1,y=null,v=null;r&&(h=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||YM,l&&(u<0&&p===0?(iD("route-fallback"),g=!0,v=null):u===p&&(g=!0,v=d.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=y:g?w=v:d.route.Component?w=j.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=f,j.createElement(QM,{match:d,routeContext:{outlet:f,matches:x,isDataRoute:r!=null},children:w})};return r&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?j.createElement(ZM,{location:r.location,revalidation:r.revalidation,component:y,error:h,children:m(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):m()},null)}var ME=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ME||{}),DE=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}(DE||{});function eD(e){let t=j.useContext(Ah);return t||kt(!1),t}function tD(e){let t=j.useContext($E);return t||kt(!1),t}function rD(e){let t=j.useContext(za);return t||kt(!1),t}function LE(e){let t=rD(),r=t.matches[t.matches.length-1];return r.route.id||kt(!1),r.route.id}function nD(){var e;let t=j.useContext(IE),r=tD(),n=LE();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function aD(){let{router:e}=eD(ME.UseNavigateStable),t=LE(DE.UseNavigateStable),r=j.useRef(!1);return RE(()=>{r.current=!0}),j.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,sc({fromRouteId:t},i)))},[e,t])}const t_={};function iD(e,t,r){t_[e]||(t_[e]=!0)}function oD(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function sD(e){let{to:t,replace:r,state:n,relative:a}=e;xl()||kt(!1);let{future:i,static:o}=j.useContext(Fa),{matches:s}=j.useContext(za),{pathname:l}=$o(),u=ed(),f=ib(t,ab(s,i.v7_relativeSplatPath),l,a==="path"),d=JSON.stringify(f);return j.useEffect(()=>u(JSON.parse(d),{replace:r,state:n,relative:a}),[u,d,a,r,n]),null}function lD(e){return GM(e.context)}function ln(e){kt(!1)}function uD(e){let{basename:t="/",children:r=null,location:n,navigationType:a=ui.Pop,navigator:i,static:o=!1,future:s}=e;xl()&&kt(!1);let l=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:l,navigator:i,static:o,future:sc({v7_relativeSplatPath:!1},s)}),[l,s,i,o]);typeof n=="string"&&(n=gl(n));let{pathname:f="/",search:d="",hash:p="",state:h=null,key:g="default"}=n,y=j.useMemo(()=>{let v=Ds(f,l);return v==null?null:{location:{pathname:v,search:d,hash:p,state:h,key:g},navigationType:a}},[l,f,d,p,h,g,a]);return y==null?null:j.createElement(Fa.Provider,{value:u},j.createElement(Eh.Provider,{children:r,value:y}))}function cD(e){let{children:t,location:r}=e;return qM(ig(t),r)}new Promise(()=>{});function ig(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,a)=>{if(!j.isValidElement(n))return;let i=[...t,a];if(n.type===j.Fragment){r.push.apply(r,ig(n.props.children,i));return}n.type!==ln&&kt(!1),!n.props.index||!n.props.children||kt(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=ig(n.props.children,i)),r.push(o)}),r}/** + * React Router DOM v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Kf(){return Kf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[a]=e[a]);return r}function dD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fD(e,t){return e.button===0&&(!t||t==="_self")&&!dD(e)}function og(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function pD(e,t){let r=og(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const hD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],mD=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],yD="6";try{window.__reactRouterVersion=yD}catch{}const vD=j.createContext({isTransitioning:!1}),gD="startTransition",r_=oI[gD];function xD(e){let{basename:t,children:r,future:n,window:a}=e,i=j.useRef();i.current==null&&(i.current=vM({window:a,v5Compat:!0}));let o=i.current,[s,l]=j.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=j.useCallback(d=>{u&&r_?r_(()=>l(d)):l(d)},[l,u]);return j.useLayoutEffect(()=>o.listen(f),[o,f]),j.useEffect(()=>oD(n),[n]),j.createElement(uD,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const bD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_D=j.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:d}=t,p=FE(t,hD),{basename:h}=j.useContext(Fa),g,y=!1;if(typeof u=="string"&&wD.test(u)&&(g=u,bD))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),b=Ds(S.pathname,h);S.origin===w.origin&&b!=null?u=b+S.search+S.hash:y=!0}catch{}let v=VM(u,{relative:a}),x=OD(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:a,viewTransition:d});function m(w){n&&n(w),w.defaultPrevented||x(w)}return j.createElement("a",Kf({},p,{href:g||v,onClick:y||i?n:m,ref:r,target:l}))}),SD=j.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:o=!1,style:s,to:l,viewTransition:u,children:f}=t,d=FE(t,mD),p=Ph(l,{relative:d.relative}),h=$o(),g=j.useContext($E),{navigator:y,basename:v}=j.useContext(Fa),x=g!=null&&AD(p)&&u===!0,m=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&v&&(S=Ds(S,v)||S);const b=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!o&&w.startsWith(m)&&w.charAt(b)==="/",O=S!=null&&(S===m||!o&&S.startsWith(m)&&S.charAt(m.length)==="/"),k={isActive:_,isPending:O,isTransitioning:x},A=_?n:void 0,$;typeof i=="function"?$=i(k):$=[i,_?"active":null,O?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(k):s;return j.createElement(_D,Kf({},d,{"aria-current":A,className:$,ref:r,style:T,to:l,viewTransition:u}),typeof f=="function"?f(k):f)});var sg;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(sg||(sg={}));var n_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(n_||(n_={}));function jD(e){let t=j.useContext(Ah);return t||kt(!1),t}function OD(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:s}=t===void 0?{}:t,l=ed(),u=$o(),f=Ph(e,{relative:o});return j.useCallback(d=>{if(fD(d,r)){d.preventDefault();let p=n!==void 0?n:qf(u)===qf(f);l(e,{replace:p,state:a,preventScrollReset:i,relative:o,viewTransition:s})}},[u,l,f,n,a,r,e,i,o,s])}function kD(e){let t=j.useRef(og(e)),r=j.useRef(!1),n=$o(),a=j.useMemo(()=>pD(n.search,r.current?null:t.current),[n.search]),i=ed(),o=j.useCallback((s,l)=>{const u=og(typeof s=="function"?s(a):s);r.current=!0,i("?"+u,l)},[i,a]);return[a,o]}function AD(e,t){t===void 0&&(t={});let r=j.useContext(vD);r==null&&kt(!1);let{basename:n}=jD(sg.useViewTransitionState),a=Ph(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Ds(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Ds(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ag(a.pathname,o)!=null||ag(a.pathname,i)!=null}/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var ED={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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const at=(e,t)=>{const r=j.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>j.createElement("svg",{ref:f,...ED,width:a,height:a,stroke:n,strokeWidth:o?Number(i)*24/Number(a):i,className:["lucide",`lucide-${PD(e)}`,s].join(" "),...u},[...t.map(([d,p])=>j.createElement(d,p)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vf=at("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ND=at("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CD=at("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TD=at("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $D=at("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const du=at("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fu=at("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ID=at("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RD=at("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MD=at("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ry=at("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DD=at("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nh=at("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LD=at("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FD=at("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zD=at("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const BD=at("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UD=at("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VD=at("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zE=at("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xf=at("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $d=at("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ki=at("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ny=at("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WD=at("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HD=at("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.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ca=at("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.363.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=at("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @license lucide-react v0.363.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a_=at("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function GD(){return c.jsxs("aside",{className:"w-64 shrink-0 flex flex-col h-screen bg-white dark:bg-black border-r border-slate-200 dark:border-[#151515] relative z-20 transition-colors duration-300",children:[c.jsx("div",{className:"min-h-20 px-6 py-5 flex flex-col justify-center gap-2 border-b border-slate-200 dark:border-[#151515] transition-colors duration-300",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx("img",{src:"/dashboard/logo/decision-engine-light.svg",alt:"Juspay Decision Engine",className:"h-11 w-auto dark:hidden"}),c.jsx("img",{src:"/dashboard/logo/decision-engine-dark.svg",alt:"Juspay Decision Engine",className:"hidden h-11 w-auto dark:block"})]})}),c.jsxs("nav",{className:"flex-1 px-4 py-8 space-y-1 overflow-y-auto",children:[c.jsx(ua,{to:"/",icon:BD,end:!0,children:"Overview"}),c.jsx(ua,{to:"/decisions",icon:WD,children:"Decision Explorer"}),c.jsx(ua,{to:"/analytics",icon:CD,children:"Analytics"}),c.jsx(ua,{to:"/audit",icon:vf,children:"Decision Audit"}),c.jsx("div",{className:"pt-8 pb-3 px-3 flex items-center gap-2",children:c.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-slate-400 dark:text-[#66666e]",children:"Routing"})}),c.jsx(ua,{to:"/routing",icon:LD,end:!0,children:"Routing Hub"}),c.jsx(ua,{to:"/routing/sr",icon:BE,indent:!0,children:"Auth-Rate Based"}),c.jsx(ua,{to:"/routing/rules",icon:TD,indent:!0,children:"Rule-Based"}),c.jsx(ua,{to:"/routing/volume",icon:Xf,indent:!0,children:"Volume Split"}),c.jsx(ua,{to:"/routing/debit",icon:zE,indent:!0,children:"Debit Routing"})]}),c.jsx("div",{className:"px-6 py-5 border-t border-slate-200 dark:border-[#151515] bg-slate-50 dark:bg-black transition-colors duration-300",children:c.jsx("span",{className:"text-[11px] text-slate-500 dark:text-[#66666e] font-medium tracking-wide",children:"v1.4"})})]})}function ua({to:e,icon:t,children:r,end:n,indent:a}){return c.jsx(SD,{to:e,end:n,className:({isActive:i})=>`group relative flex items-center gap-3 px-4 py-3 rounded-[14px] text-[14px] font-medium transition-all duration-200 ${a?"ml-3 w-[calc(100%-12px)]":""} ${i?"bg-slate-100 text-brand-600 dark:bg-[#151518] dark:text-white shadow-sm":"text-slate-500 hover:text-slate-900 hover:bg-slate-50 dark:text-[#888891] dark:hover:text-white dark:hover:bg-[#0c0c0e]"}`,children:({isActive:i})=>c.jsxs(c.Fragment,{children:[c.jsx(t,{size:18,className:`transition-colors duration-200 ${i?"text-brand-600 dark:text-white":"text-slate-400 dark:text-[#55555e] group-hover:text-slate-600 dark:group-hover:text-white"}`,strokeWidth:i?2.5:2}),c.jsx("span",{className:"flex-1",children:r})]})})}const qD={},i_=e=>{let t;const r=new Set,n=(f,d)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(g=>g(t,h))}},a=()=>t,l={setState:n,getState:a,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(qD?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,a,l);return l},KD=e=>e?i_(e):i_;var UE={exports:{}},VE={},WE={exports:{}},HE={};/** + * @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 Ls=j;function XD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var YD=typeof Object.is=="function"?Object.is:XD,ZD=Ls.useState,QD=Ls.useEffect,JD=Ls.useLayoutEffect,eL=Ls.useDebugValue;function tL(e,t){var r=t(),n=ZD({inst:{value:r,getSnapshot:t}}),a=n[0].inst,i=n[1];return JD(function(){a.value=r,a.getSnapshot=t,ay(a)&&i({inst:a})},[e,r,t]),QD(function(){return ay(a)&&i({inst:a}),e(function(){ay(a)&&i({inst:a})})},[e]),eL(r),r}function ay(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!YD(e,r)}catch{return!0}}function rL(e,t){return t()}var nL=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?rL:tL;HE.useSyncExternalStore=Ls.useSyncExternalStore!==void 0?Ls.useSyncExternalStore:nL;WE.exports=HE;var lg=WE.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.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 Ch=j,aL=lg;function iL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oL=typeof Object.is=="function"?Object.is:iL,sL=aL.useSyncExternalStore,lL=Ch.useRef,uL=Ch.useEffect,cL=Ch.useMemo,dL=Ch.useDebugValue;VE.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=lL(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=cL(function(){function l(h){if(!u){if(u=!0,f=h,h=n(h),a!==void 0&&o.hasValue){var g=o.value;if(a(g,h))return d=g}return d=h}if(g=d,oL(f,h))return g;var y=n(h);return a!==void 0&&a(g,y)?(f=h,g):(f=h,d=y)}var u=!1,f,d,p=r===void 0?null:r;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,r,n,a]);var s=sL(e,i[0],i[1]);return uL(function(){o.hasValue=!0,o.value=s},[s]),dL(s),s};UE.exports=VE;var fL=UE.exports;const pL=rt(fL),GE={},{useDebugValue:hL}=C,{useSyncExternalStoreWithSelector:mL}=pL;let o_=!1;const yL=e=>e;function vL(e,t=yL,r){(GE?"production":void 0)!=="production"&&r&&!o_&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),o_=!0);const n=mL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return hL(n),n}const gL=e=>{(GE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?KD(e):e,r=(n,a)=>vL(t,n,a);return Object.assign(r,t),r},xL=e=>gL,bL={};function wL(e,t){let r;try{r=e()}catch{return}return{getItem:a=>{var i;const o=l=>l===null?null:JSON.parse(l,void 0),s=(i=r.getItem(a))!=null?i:null;return s instanceof Promise?s.then(o):o(s)},setItem:(a,i)=>r.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>r.removeItem(a)}}const lc=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return lc(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return lc(n)(r)}}}},_L=(e,t)=>(r,n,a)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,x)=>({...x,...v}),...t},o=!1;const s=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...v)},n,a);const f=lc(i.serialize),d=()=>{const v=i.partialize({...n()});let x;const m=f({state:v,version:i.version}).then(w=>u.setItem(i.name,w)).catch(w=>{x=w});if(x)throw x;return m},p=a.setState;a.setState=(v,x)=>{p(v,x),d()};const h=e((...v)=>{r(...v),d()},n,a);let g;const y=()=>{var v;if(!u)return;o=!1,s.forEach(m=>m(n()));const x=((v=i.onRehydrateStorage)==null?void 0:v.call(i,n()))||void 0;return lc(u.getItem.bind(u))(i.name).then(m=>{if(m)return i.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var w;return g=i.merge(m,(w=n())!=null?w:h),r(g,!0),d()}).then(()=>{x==null||x(g,void 0),o=!0,l.forEach(m=>m(g))}).catch(m=>{x==null||x(void 0,m)})};return a.persist={setOptions:v=>{i={...i,...v},v.getStorage&&(u=v.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},y(),g||h},SL=(e,t)=>(r,n,a)=>{let i={storage:wL(()=>localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},o=!1;const s=new Set,l=new Set;let u=i.storage;if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...y)},n,a);const f=()=>{const y=i.partialize({...n()});return u.setItem(i.name,{state:y,version:i.version})},d=a.setState;a.setState=(y,v)=>{d(y,v),f()};const p=e((...y)=>{r(...y),f()},n,a);a.getInitialState=()=>p;let h;const g=()=>{var y,v;if(!u)return;o=!1,s.forEach(m=>{var w;return m((w=n())!=null?w:p)});const x=((v=i.onRehydrateStorage)==null?void 0:v.call(i,(y=n())!=null?y:p))||void 0;return lc(u.getItem.bind(u))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return[!0,i.migrate(m.state,m.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var w;const[S,b]=m;if(h=i.merge(b,(w=n())!=null?w:p),r(h,!0),S)return f()}).then(()=>{x==null||x(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{x==null||x(void 0,m)})};return a.persist={setOptions:y=>{i={...i,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},i.skipHydration||g(),h||p},jL=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((bL?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),_L(e,t)):SL(e,t),OL=jL,aa=xL()(OL(e=>({merchantId:"",setMerchantId:t=>{console.log(` +[STORE] Merchant ID changed: "${t}"`),e({merchantId:t})}}),{name:"merchant-store"})),kL="public";function AL(e,t,r){console.log(` +`+"=".repeat(80)),console.log(`[API REQUEST] ${new Date().toISOString()}`),console.log(`Method: ${e}`),console.log(`Path: ${t}`),r!==void 0&&console.log("Body:",JSON.stringify(r,null,2)),console.log("=".repeat(80))}function EL(e,t,r,n){console.log(` +`+"-".repeat(80)),console.log(`[API RESPONSE] ${new Date().toISOString()}`),console.log(`Path: ${e}`),console.log(`Status: ${t} ${r}`),console.log("Response Body:",n),console.log("-".repeat(80)+` +`)}function s_(e,t){console.log(` +`+"!".repeat(80)),console.log(`[API ERROR] ${new Date().toISOString()}`),console.log(`Path: ${e}`),t instanceof Error?(console.log("Error:",t.message),console.log("Stack:",t.stack)):console.log("Error:",t),console.log("!".repeat(80)+` +`)}async function qE(e,t){const r=(t==null?void 0:t.method)||"GET",n=t!=null&&t.body?JSON.parse(t.body):void 0;AL(r,e,n);try{const a=await fetch(e,{headers:{"Content-Type":"application/json","x-tenant-id":kL,...t==null?void 0:t.headers},...t}),i=await a.text();let o;try{const s=JSON.parse(i);o=JSON.stringify(s,null,2)}catch{o=i}if(EL(e,a.status,a.statusText,o),!a.ok){const s=new Error(`API error ${a.status}: ${i}`);throw s_(e,s),s}return i.trim()?JSON.parse(i):void 0}catch(a){throw s_(e,a),a}}async function bt(e,t){return qE(e,{method:"POST",body:t!==void 0?JSON.stringify(t):void 0})}async function wi(e){return qE(e)}function PL(){const{merchantId:e,setMerchantId:t}=aa(),[r,n]=j.useState(e),[a,i]=j.useState(!1),[o,s]=j.useState(()=>localStorage.getItem("theme")==="dark");j.useEffect(()=>{const u=window.document.documentElement;o?(u.classList.add("dark"),localStorage.setItem("theme","dark")):(u.classList.remove("dark"),localStorage.setItem("theme","light"))},[o]);async function l(){const u=r.trim();if(u){t(u),i(!0);try{await bt("/merchant-account/create",{merchant_id:u,gateway_success_rate_based_decider_input:null})}catch{}finally{i(!1)}}}return c.jsxs("header",{className:"h-[76px] bg-white dark:bg-black border-b border-slate-200 dark:border-[#151515] flex items-center justify-between px-8 shrink-0 relative z-10 transition-colors duration-300",children:[c.jsx("div",{}),c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsxs("div",{className:"relative",children:[c.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&l(),placeholder:"Set Merchant ID",className:"w-72 bg-slate-50 dark:bg-[#0f0f11] border border-slate-200 dark:border-[#222222] rounded-full px-4 py-2 text-sm text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-[#66666e] focus:outline-none focus:border-slate-400 dark:focus:border-[#444444] transition-colors"}),c.jsx("button",{onClick:l,disabled:a,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-slate-400 hover:text-brand-500 dark:text-[#66666e] dark:hover:text-white transition-colors",children:a?c.jsx(UD,{size:16,className:"animate-spin"}):c.jsx(ND,{size:16})})]}),e&&c.jsxs("div",{className:"flex items-center gap-2 pl-6 ml-2 border-l border-slate-200 dark:border-[#222222] transition-colors duration-300",children:[c.jsx($D,{size:16,className:"text-brand-500 dark:text-[#66666e]"}),c.jsx("span",{className:"text-sm text-slate-800 dark:text-white font-medium",children:e})]}),c.jsx("button",{onClick:()=>s(!o),className:"p-2.5 rounded-full bg-slate-100 text-slate-600 hover:bg-slate-200 dark:bg-[#151515] dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#222222] transition-colors duration-200","aria-label":"Toggle theme",children:o?c.jsx(HD,{size:18}):c.jsx(VD,{size:18})})]})]})}function NL(){return c.jsxs("div",{className:"flex h-screen overflow-hidden bg-[#f8fafc] text-slate-900 dark:bg-[#000000] dark:text-white relative transition-colors duration-300",children:[c.jsx("div",{className:"aurora-top"}),c.jsx(GD,{}),c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[c.jsx(PL,{}),c.jsx("main",{className:"flex-1 overflow-y-auto p-8 relative",children:c.jsx(lD,{})})]})]})}const KE=0,XE=1,YE=2,l_=3;var u_=Object.prototype.hasOwnProperty;function ug(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&ug(e[n],t[n]););return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(u_.call(e,r)&&++n&&!u_.call(t,r)||!(r in t)||!ug(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const ma=new WeakMap,ga=()=>{},vr=ga(),cg=Object,qe=e=>e===vr,qn=e=>typeof e=="function",Ai=(e,t)=>({...e,...t}),ZE=e=>qn(e.then),iy={},Id={},ob="undefined",td=typeof window!=ob,dg=typeof document!=ob,CL=td&&"Deno"in window,TL=()=>td&&typeof window.requestAnimationFrame!=ob,QE=(e,t)=>{const r=ma.get(e);return[()=>!qe(t)&&e.get(t)||iy,n=>{if(!qe(t)){const a=e.get(t);t in Id||(Id[t]=a),r[5](t,Ai(a,n),a||iy)}},r[6],()=>!qe(t)&&t in Id?Id[t]:!qe(t)&&e.get(t)||iy]};let fg=!0;const $L=()=>fg,[pg,hg]=td&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ga,ga],IL=()=>{const e=dg&&document.visibilityState;return qe(e)||e!=="hidden"},RL=e=>(dg&&document.addEventListener("visibilitychange",e),pg("focus",e),()=>{dg&&document.removeEventListener("visibilitychange",e),hg("focus",e)}),ML=e=>{const t=()=>{fg=!0,e()},r=()=>{fg=!1};return pg("online",t),pg("offline",r),()=>{hg("online",t),hg("offline",r)}},DL={isOnline:$L,isVisible:IL},LL={initFocus:RL,initReconnect:ML},c_=!C.useId,_s=!td||CL,FL=e=>TL()?window.requestAnimationFrame(e):setTimeout(e,1),oy=_s?j.useEffect:j.useLayoutEffect,sy=typeof navigator<"u"&&navigator.connection,d_=!_s&&sy&&(["slow-2g","2g"].includes(sy.effectiveType)||sy.saveData),Rd=new WeakMap,zL=e=>cg.prototype.toString.call(e),ly=(e,t)=>e===`[object ${t}]`;let BL=0;const mg=e=>{const t=typeof e,r=zL(e),n=ly(r,"Date"),a=ly(r,"RegExp"),i=ly(r,"Object");let o,s;if(cg(e)===e&&!n&&!a){if(o=Rd.get(e),o)return o;if(o=++BL+"~",Rd.set(e,o),Array.isArray(e)){for(o="@",s=0;s{if(qn(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?mg(e):"",[e,t]};let UL=0;const yg=()=>++UL;async function JE(...e){const[t,r,n,a]=e,i=Ai({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const u=p=>typeof s=="function"?s(p):s!==!1,f=i.throwOnError;if(qn(r)){const p=r,h=[],g=t.keys();for(const y of g)!/^\$(inf|sub)\$/.test(y)&&p(t.get(y)._k)&&h.push(y);return Promise.all(h.map(d))}return d(r);async function d(p){const[h]=sb(p);if(!h)return;const[g,y]=QE(t,h),[v,x,m,w]=ma.get(t),S=()=>{const L=v[h];return(qn(i.revalidate)?i.revalidate(g().data,p):i.revalidate!==!1)&&(delete m[h],delete w[h],L&&L[0])?L[0](YE).then(()=>g().data):g().data};if(e.length<3)return S();let b=n,_,O=!1;const k=yg();x[h]=[k,0];const A=!qe(l),$=g(),T=$.data,P=$._c,R=qe(P)?T:P;if(A&&(l=qn(l)?l(R,T):l,y({data:l,_c:R})),qn(b))try{b=b(R)}catch(L){_=L,O=!0}if(b&&ZE(b))if(b=await b.catch(L=>{_=L,O=!0}),k!==x[h][0]){if(O)throw _;return b}else O&&A&&u(_)&&(o=!0,y({data:R,_c:vr}));if(o&&!O)if(qn(o)){const L=o(b,R);y({data:L,error:vr,_c:vr})}else y({data:b,error:vr,_c:vr});if(x[h][1]=yg(),Promise.resolve(S()).then(()=>{y({_c:vr})}),O){if(f)throw _;return}return b}}const f_=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},VL=(e,t)=>{if(!ma.has(e)){const r=Ai(LL,t),n=Object.create(null),a=JE.bind(vr,e);let i=ga;const o=Object.create(null),s=(f,d)=>{const p=o[f]||[];return o[f]=p,p.push(d),()=>p.splice(p.indexOf(d),1)},l=(f,d,p)=>{e.set(f,d);const h=o[f];if(h)for(const g of h)g(d,p)},u=()=>{if(!ma.has(e)&&(ma.set(e,[n,Object.create(null),Object.create(null),Object.create(null),a,l,s]),!_s)){const f=r.initFocus(setTimeout.bind(vr,f_.bind(vr,n,KE))),d=r.initReconnect(setTimeout.bind(vr,f_.bind(vr,n,XE)));i=()=>{f&&f(),d&&d(),ma.delete(e)}}};return u(),[e,a,u,i]}return[e,ma.get(e)[4]]},WL=(e,t,r,n,a)=>{const i=r.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!qe(i)&&o>i||setTimeout(n,s,a)},HL=ug,[eP,GL]=VL(new Map),qL=Ai({onLoadingSlow:ga,onSuccess:ga,onError:ga,onErrorRetry:WL,onDiscarded:ga,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:d_?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:d_?5e3:3e3,compare:HL,isPaused:()=>!1,cache:eP,mutate:GL,fallback:{}},DL),KL=(e,t)=>{const r=Ai(e,t);if(t){const{use:n,fallback:a}=e,{use:i,fallback:o}=t;n&&i&&(r.use=n.concat(i)),a&&o&&(r.fallback=Ai(a,o))}return r},XL=j.createContext({}),YL="$inf$",tP=td&&window.__SWR_DEVTOOLS_USE__,ZL=tP?window.__SWR_DEVTOOLS_USE__:[],QL=()=>{tP&&(window.__SWR_DEVTOOLS_REACT__=C)},JL=e=>qn(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],e3=()=>{const e=j.useContext(XL);return j.useMemo(()=>Ai(qL,e),[e])},t3=e=>(t,r,n)=>e(t,r&&((...i)=>{const[o]=sb(t),[,,,s]=ma.get(eP);if(o.startsWith(YL))return r(...i);const l=s[o];return qe(l)?r(...i):(delete s[o],l)}),n),r3=ZL.concat(t3),n3=e=>function(...r){const n=e3(),[a,i,o]=JL(r),s=KL(n,o);let l=e;const{use:u}=s,f=(u||[]).concat(r3);for(let d=f.length;d--;)l=f[d](l);return l(a,i||s.fetcher||null,s)},a3=(e,t,r)=>{const n=t[e]||(t[e]=[]);return n.push(r),()=>{const a=n.indexOf(r);a>=0&&(n[a]=n[n.length-1],n.pop())}};QL();const uy=C.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),cy={dedupe:!0},p_=Promise.resolve(vr),i3=()=>ga,o3=(e,t,r)=>{const{cache:n,compare:a,suspense:i,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:d,keepPreviousData:p,strictServerPrefetchWarning:h}=r,[g,y,v,x]=ma.get(n),[m,w]=sb(e),S=j.useRef(!1),b=j.useRef(!1),_=j.useRef(m),O=j.useRef(t),k=j.useRef(r),A=()=>k.current,$=()=>A().isVisible()&&A().isOnline(),[T,P,R,L]=QE(n,m),z=j.useRef({}).current,W=qe(o)?qe(r.fallback)?vr:r.fallback[m]:o,V=(ge,$e)=>{for(const Le in z){const Oe=Le;if(Oe==="data"){if(!a(ge[Oe],$e[Oe])&&(!qe(ge[Oe])||!a(ue,$e[Oe])))return!1}else if($e[Oe]!==ge[Oe])return!1}return!0},D=!S.current,U=j.useMemo(()=>{const ge=T(),$e=L(),Le=E=>{const M=Ai(E);return delete M._k,(()=>{if(!m||!t||A().isPaused())return!1;if(D&&!qe(s))return s;const B=qe(W)?M.data:W;return qe(B)||l})()?{isValidating:!0,isLoading:!0,...M}:M},Oe=Le(ge),Ge=ge===$e?Oe:Le($e);let H=Oe;return[()=>{const E=Le(T());return V(E,H)?(H.data=E.data,H.isLoading=E.isLoading,H.isValidating=E.isValidating,H.error=E.error,H):(H=E,E)},()=>Ge]},[n,m]),q=lg.useSyncExternalStore(j.useCallback(ge=>R(m,($e,Le)=>{V(Le,$e)||ge()}),[n,m]),U[0],U[1]),J=g[m]&&g[m].length>0,K=q.data,ae=qe(K)?W&&ZE(W)?uy(W):W:K,Q=q.error,be=j.useRef(ae),ue=p?qe(K)?qe(be.current)?ae:be.current:K:ae,Ce=m&&qe(ae),Fe=j.useRef(null);!_s&&lg.useSyncExternalStore(i3,()=>(Fe.current=!1,Fe),()=>(Fe.current=!0,Fe));const te=Fe.current;h&&te&&!i&&Ce&&console.warn(`Missing pre-initiated data for serialized key "${m}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const ie=!m||!t||A().isPaused()||J&&!qe(Q)?!1:D&&!qe(s)?s:i?qe(ae)?!1:l:qe(ae)||l,he=D&&ie,X=qe(q.isValidating)?he:q.isValidating,Ee=qe(q.isLoading)?he:q.isLoading,ve=j.useCallback(async ge=>{const $e=O.current;if(!m||!$e||b.current||A().isPaused())return!1;let Le,Oe,Ge=!0;const H=ge||{},E=!v[m]||!H.dedupe,M=()=>c_?!b.current&&m===_.current&&S.current:m===_.current,N={isValidating:!1,isLoading:!1},B=()=>{P(N)},G=()=>{const Z=v[m];Z&&Z[1]===Oe&&delete v[m]},ee={isValidating:!0};qe(T().data)&&(ee.isLoading=!0);try{if(E&&(P(ee),r.loadingTimeout&&qe(T().data)&&setTimeout(()=>{Ge&&M()&&A().onLoadingSlow(m,r)},r.loadingTimeout),v[m]=[$e(w),yg()]),[Le,Oe]=v[m],Le=await Le,E&&setTimeout(G,r.dedupingInterval),!v[m]||v[m][1]!==Oe)return E&&M()&&A().onDiscarded(m),!1;N.error=vr;const Z=y[m];if(!qe(Z)&&(Oe<=Z[0]||Oe<=Z[1]||Z[1]===0))return B(),E&&M()&&A().onDiscarded(m),!1;const me=T().data;N.data=a(me,Le)?me:Le,E&&M()&&A().onSuccess(Le,m,r)}catch(Z){G();const me=A(),{shouldRetryOnError:Te}=me;me.isPaused()||(N.error=Z,E&&M()&&(me.onError(Z,m,me),(Te===!0||qn(Te)&&Te(Z))&&(!A().revalidateOnFocus||!A().revalidateOnReconnect||$())&&me.onErrorRetry(Z,m,me,Et=>{const Tt=g[m];Tt&&Tt[0]&&Tt[0](l_,Et)},{retryCount:(H.retryCount||0)+1,dedupe:!0})))}return Ge=!1,B(),!0},[m,n]),Pe=j.useCallback((...ge)=>JE(n,_.current,...ge),[]);if(oy(()=>{O.current=t,k.current=r,qe(K)||(be.current=K)}),oy(()=>{if(!m)return;const ge=ve.bind(vr,cy);let $e=0;A().revalidateOnFocus&&($e=Date.now()+A().focusThrottleInterval);const Oe=a3(m,g,(Ge,H={})=>{if(Ge==KE){const E=Date.now();A().revalidateOnFocus&&E>$e&&$()&&($e=E+A().focusThrottleInterval,ge())}else if(Ge==XE)A().revalidateOnReconnect&&$()&&ge();else{if(Ge==YE)return ve();if(Ge==l_)return ve(H)}});return b.current=!1,_.current=m,S.current=!0,P({_k:w}),ie&&(v[m]||(qe(ae)||_s?ge():FL(ge))),()=>{b.current=!0,Oe()}},[m]),oy(()=>{let ge;function $e(){const Oe=qn(u)?u(T().data):u;Oe&&ge!==-1&&(ge=setTimeout(Le,Oe))}function Le(){!T().error&&(f||A().isVisible())&&(d||A().isOnline())?ve(cy).then($e):$e()}return $e(),()=>{ge&&(clearTimeout(ge),ge=-1)}},[u,f,d,m]),j.useDebugValue(ue),i){if(!c_&&_s&&Ce)throw new Error("Fallback data is required when using Suspense in SSR.");Ce&&(O.current=t,k.current=r,b.current=!1);const ge=x[m],$e=!qe(ge)&&Ce?Pe(ge):p_;if(uy($e),!qe(Q)&&Ce)throw Q;const Le=Ce?ve(cy):p_;!qe(ue)&&Ce&&(Le.status="fulfilled",Le.value=!0),uy(Le)}return{mutate:Pe,get data(){return z.data=!0,ue},get error(){return z.error=!0,Q},get isValidating(){return z.isValidating=!0,X},get isLoading(){return z.isLoading=!0,Ee}}},ar=n3(o3);function ke({children:e,className:t="",onClick:r}){return c.jsx("div",{className:`glass-panel rounded-[20px] ${r?"glass-panel-hover cursor-pointer":""} ${t}`,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:e})}function Xe({children:e,className:t=""}){return c.jsx("div",{className:`px-6 py-5 border-b border-slate-200 dark:border-[#1c1c1f] bg-slate-50 dark:bg-[#0c0c0e] rounded-t-[20px] ${t}`,children:e})}function Ae({children:e,className:t=""}){return c.jsx("div",{className:`px-6 py-5 ${t}`,children:e})}const s3={green:"bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20",gray:"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8",blue:"bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20",red:"bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20",orange:"bg-orange-500/10 text-orange-400 ring-1 ring-inset ring-orange-500/20",purple:"bg-purple-500/10 text-purple-400 ring-1 ring-inset ring-purple-500/20"};function _e({variant:e="gray",children:t}){return c.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${s3[e]}`,children:t})}function l3(){const[e,t]=j.useState("loading");return j.useEffect(()=>{console.log(` +[HEALTH CHECK] ${new Date().toISOString()}`),console.log("Fetching: GET /health"),fetch("/health").then(r=>{console.log(`[HEALTH CHECK] Response: ${r.status} ${r.statusText}`),t(r.ok?"up":"down")}).catch(r=>{console.log(`[HEALTH CHECK ERROR] ${r.message}`),t("down")})},[]),e}function u3(){var l,u;const e=ed(),{merchantId:t}=aa(),r=l3(),{data:n}=ar(t?`/routing/list/active/${t}`:null,()=>bt(`/routing/list/active/${t}`),{shouldRetryOnError:!1}),{data:a,error:i}=ar(t?["/rule/get","successRate",t]:null,()=>bt("/rule/get",{merchant_id:t,algorithm:"successRate"})),o=n&&n.length>0?n[0]:null,s=(n||[]).some(f=>{var d;return((d=f.algorithm_data||f.algorithm)==null?void 0:d.type)==="advanced"});return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Overview"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Decision Engine routing health and status"})]}),!t&&c.jsxs("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 flex items-center gap-2 text-sm text-yellow-800",children:[c.jsx(ID,{size:16}),"Set your Merchant ID in the top bar to load configuration."]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[c.jsx(ke,{children:c.jsxs(Ae,{className:"flex items-center gap-3",children:[r==="up"?c.jsx(RD,{className:"text-green-500",size:24}):r==="down"?c.jsx(MD,{className:"text-red-500",size:24}):c.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-gray-200 border-t-gray-500 animate-spin"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500",children:"API Health"}),c.jsx("p",{className:"text-sm font-medium",children:r==="up"?"Healthy":r==="down"?"Down":"Checking..."})]})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Active Routing Rule"}),t?o?c.jsxs("div",{children:[c.jsx(_e,{variant:"green",children:"Active"}),c.jsx("p",{className:"text-sm font-medium mt-1 truncate",children:o.name}),c.jsx("p",{className:"text-xs text-slate-400",children:(l=o.algorithm_data||o.algorithm)==null?void 0:l.type})]}):c.jsx(_e,{variant:"gray",children:"Not Configured"}):c.jsx(_e,{variant:"gray",children:"Not set"})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/sr"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Auth-Rate Config"}),t?i?c.jsx(_e,{variant:"gray",children:"Not Configured"}):a!=null&&a.data?c.jsx(_e,{variant:"green",children:"Configured"}):c.jsx(_e,{variant:"gray",children:"Not Configured"}):c.jsx(_e,{variant:"gray",children:"Not set"})]})}),c.jsx(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing/rules"),children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Rule-Based Routing"}),t?s?c.jsx(_e,{variant:"green",children:"Configured"}):c.jsx(_e,{variant:"gray",children:"Not Configured"}):c.jsx(_e,{variant:"gray",children:"Not set"})]})})]}),o&&c.jsxs(ke,{className:"cursor-pointer hover:border-brand-300 transition-all",onClick:()=>e("/routing"),children:[c.jsx(Xe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Routing Configuration"})}),c.jsx(Ae,{children:c.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Name"}),c.jsx("dd",{className:"font-medium",children:o.name})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Type"}),c.jsx("dd",{className:"font-medium capitalize",children:(u=o.algorithm_data||o.algorithm)==null?void 0:u.type})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"Algorithm For"}),c.jsx("dd",{className:"font-medium capitalize",children:o.algorithm_for})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-slate-500",children:"ID"}),c.jsx("dd",{className:"font-mono text-xs text-slate-600",children:o.id})]})]})})]})]})}function c3(){const e=ed(),{merchantId:t}=aa(),{data:r}=ar(t?`/routing/list/active/${t}`:null,()=>bt(`/routing/list/active/${t}`)),{data:n}=ar(t?["/rule/get","successRate",t]:null,()=>bt("/rule/get",{merchant_id:t,algorithm:"successRate"})),a=[{id:"sr",title:"Auth-Rate Based Routing",description:"Dynamically route to the best-performing gateway based on real-time authorization rates.",icon:BE,route:"/routing/sr",algorithmType:"successRate",checkConfigured:()=>{var i;return!!((i=n==null?void 0:n.config)!=null&&i.data)}},{id:"rules",title:"Rule-Based Routing",description:"Declarative routing rules to route payments based on conditions and attributes.",icon:zD,route:"/routing/rules",algorithmType:"advanced",checkConfigured:()=>(r||[]).some(i=>{var o;return((o=i.algorithm_data||i.algorithm)==null?void 0:o.type)==="advanced"})},{id:"volume",title:"Volume Split",description:"Distribute payment traffic across gateways by configurable percentage splits.",icon:Xf,route:"/routing/volume",algorithmType:"volume_split",checkConfigured:()=>(r||[]).some(i=>{var o;return((o=i.algorithm_data||i.algorithm)==null?void 0:o.type)==="volume_split"})},{id:"debit",title:"Network Routing",description:"Optimise debit network fees with acquirer-aware network-based routing.",icon:DD,route:"/routing/debit",algorithmType:"debitRouting",checkConfigured:()=>!1}];return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Routing Hub"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Click on any routing strategy to configure"})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(i=>{const o=i.icon,s=i.checkConfigured();return c.jsx(ke,{className:"flex flex-col hover:border-brand-300 cursor-pointer transition-all hover:shadow-md",onClick:()=>e(i.route),children:c.jsxs(Ae,{className:"flex-1 flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsx("div",{className:"p-2 bg-brand-50 rounded-lg border border-[#1c2d50]",children:c.jsx(o,{size:20,className:"text-brand-500"})}),c.jsx(_e,{variant:s?"green":"gray",children:s?"Configured":"Not Configured"})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-slate-900",children:i.title}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:i.description})]}),c.jsx("div",{className:"mt-auto pt-2",children:c.jsx("span",{className:"text-sm text-brand-600 font-medium",children:s?"Manage →":"Setup →"})})]})},i.id)})})]})}var rd=e=>e.type==="checkbox",ro=e=>e instanceof Date,Tr=e=>e==null;const rP=e=>typeof e=="object";var Mt=e=>!Tr(e)&&!Array.isArray(e)&&rP(e)&&!ro(e),d3=e=>Mt(e)&&e.target?rd(e.target)?e.target.checked:e.target.value:e,f3=(e,t)=>t.split(".").some((r,n,a)=>!isNaN(Number(r))&&e.has(a.slice(0,n).join("."))),p3=e=>{const t=e.constructor&&e.constructor.prototype;return Mt(t)&&t.hasOwnProperty("isPrototypeOf")},lb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function vt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(lb&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Mt(e)&&p3(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=vt(e[a]));return n}var Th=e=>/^\w*$/.test(e),ct=e=>e===void 0,$h=e=>Array.isArray(e)?e.filter(Boolean):[],ub=e=>$h(e.replace(/["|']|\]/g,"").split(/\.|\[/)),le=(e,t,r)=>{if(!t||!Mt(e))return r;const n=(Th(t)?[t]:ub(t)).reduce((a,i)=>Tr(a)?a:a[i],e);return ct(n)||n===e?ct(e[t])?r:e[t]:n},Hn=e=>typeof e=="boolean",In=e=>typeof e=="function",tt=(e,t,r)=>{let n=-1;const a=Th(t)?[t]:ub(t),i=a.length,o=i-1;for(;++nC.useContext(aP);var m3=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const o=i;return t._proxyFormState[o]!==pn.all&&(t._proxyFormState[o]=!n||pn.all),e[o]}});return a};const iP=typeof window<"u"?C.useLayoutEffect:C.useEffect;var Sr=e=>typeof e=="string",y3=(e,t,r,n,a)=>Sr(e)?(n&&t.watch.add(e),le(r,e,a)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),le(r,i))):(n&&(t.watchAll=!0),r),vg=e=>Tr(e)||!rP(e);function ii(e,t,r=new WeakSet){if(vg(e)||vg(t))return Object.is(e,t);if(ro(e)&&ro(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const o=e[i];if(!a.includes(i))return!1;if(i!=="ref"){const s=t[i];if(ro(o)&&ro(s)||(Mt(o)||Array.isArray(o))&&(Mt(s)||Array.isArray(s))?!ii(o,s,r):!Object.is(o,s))return!1}}return!0}const v3=C.createContext(null);v3.displayName="HookFormContext";var oP=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Rr=e=>Array.isArray(e)?e:[e],h_=()=>{let e=[];return{get observers(){return e},next:a=>{for(const i of e)i.next&&i.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(i=>i!==a)}}),unsubscribe:()=>{e=[]}}};function sP(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],i=t[n];if(a&&Mt(a)&&i){const o=sP(a,i);Mt(o)&&(r[n]=o)}else e[n]&&(r[n]=i)}return r}var pr=e=>Mt(e)&&!Object.keys(e).length,cb=e=>e.type==="file",Yf=e=>{if(!lb)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lP=e=>e.type==="select-multiple",db=e=>e.type==="radio",g3=e=>db(e)||rd(e),fy=e=>Yf(e)&&e.isConnected;function x3(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(In(e[t]))return!0;return!1};function uP(e){return Array.isArray(e)||Mt(e)&&!w3(e)}function gg(e,t={}){for(const r in e){const n=e[r];uP(n)?(t[r]=Array.isArray(n)?[]:{},gg(n,t[r])):ct(n)||(t[r]=!0)}return t}function pu(e,t,r){r||(r=gg(t));for(const n in e){const a=e[n];if(uP(a))ct(t)||vg(r[n])?r[n]=gg(a,Array.isArray(a)?[]:{}):pu(a,Tr(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!ii(a,i)}}return r}const m_={value:!1,isValid:!1},y_={value:!0,isValid:!0};var cP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ct(e[0].attributes.value)?ct(e[0].value)||e[0].value===""?y_:{value:e[0].value,isValid:!0}:y_:m_}return m_},dP=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ct(e)?e:t?e===""?NaN:e&&+e:r&&Sr(e)?new Date(e):n?n(e):e;const v_={isValid:!1,value:null};var fP=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,v_):v_;function g_(e){const t=e.ref;return cb(t)?t.files:db(t)?fP(e.refs).value:lP(t)?[...t.selectedOptions].map(({value:r})=>r):rd(t)?cP(e.refs).value:dP(ct(t.value)?e.ref.value:t.value,e)}var _3=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,S3=(e,t,r,n)=>{const a={};for(const i of e){const o=le(t,i);o&&tt(a,i,o._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},Zf=e=>e instanceof RegExp,Hl=e=>ct(e)?e:Zf(e)?e.source:Mt(e)?Zf(e.value)?e.value.source:e.value:e,cs=e=>({isOnSubmit:!e||e===pn.onSubmit,isOnBlur:e===pn.onBlur,isOnChange:e===pn.onChange,isOnAll:e===pn.all,isOnTouch:e===pn.onTouched});const x_="AsyncFunction";var j3=e=>!!e&&!!e.validate&&!!(In(e.validate)&&e.validate.constructor.name===x_||Mt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===x_)),O3=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),xg=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ss=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const i=le(e,a);if(i){const{_f:o,...s}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],a)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Ss(s,t))break}else if(Mt(s)&&Ss(s,t))break}}};function b_(e,t,r){const n=le(e,r);if(n||Th(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),o=le(t,i),s=le(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(s&&s.type)return{name:i,error:s};if(s&&s.root&&s.root.type)return{name:`${i}.root`,error:s.root};a.pop()}return{name:r}}var k3=(e,t,r,n)=>{r(e);const{name:a,...i}=e;return pr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||pn.all))},A3=(e,t,r)=>!e||!t||e===t||Rr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),E3=(e,t,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:(r?n.isOnChange:a.isOnChange)?e:!0,P3=(e,t)=>!$h(le(e,t)).length&&$t(e,t),pP=(e,t,r)=>{const n=Rr(le(e,r));return tt(n,nP,t[r]),tt(e,r,n),e};function w_(e,t,r="validate"){if(Sr(e)||Array.isArray(e)&&e.every(Sr)||Hn(e)&&!e)return{type:r,message:Sr(e)?e:"",ref:t}}var Vo=e=>Mt(e)&&!Zf(e)?e:{value:e,message:""},bg=async(e,t,r,n,a,i)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:f,min:d,max:p,pattern:h,validate:g,name:y,valueAsNumber:v,mount:x}=e._f,m=le(r,y);if(!x||t.has(y))return{};const w=s?s[0]:o,S=P=>{a&&w.reportValidity&&(w.setCustomValidity(Hn(P)?"":P||""),w.reportValidity())},b={},_=db(o),O=rd(o),k=_||O,A=(v||cb(o))&&ct(o.value)&&ct(m)||Yf(o)&&o.value===""||m===""||Array.isArray(m)&&!m.length,$=oP.bind(null,y,n,b),T=(P,R,L,z=En.maxLength,W=En.minLength)=>{const V=P?R:L;b[y]={type:P?z:W,message:V,ref:o,...$(P?z:W,V)}};if(i?!Array.isArray(m)||!m.length:l&&(!k&&(A||Tr(m))||Hn(m)&&!m||O&&!cP(s).isValid||_&&!fP(s).isValid)){const{value:P,message:R}=Sr(l)?{value:!!l,message:l}:Vo(l);if(P&&(b[y]={type:En.required,message:R,ref:w,...$(En.required,R)},!n))return S(R),b}if(!A&&(!Tr(d)||!Tr(p))){let P,R;const L=Vo(p),z=Vo(d);if(!Tr(m)&&!isNaN(m)){const W=o.valueAsNumber||m&&+m;Tr(L.value)||(P=W>L.value),Tr(z.value)||(R=Wnew Date(new Date().toDateString()+" "+q),D=o.type=="time",U=o.type=="week";Sr(L.value)&&m&&(P=D?V(m)>V(L.value):U?m>L.value:W>new Date(L.value)),Sr(z.value)&&m&&(R=D?V(m)+P.value,z=!Tr(R.value)&&m.length<+R.value;if((L||z)&&(T(L,P.message,R.message),!n))return S(b[y].message),b}if(h&&!A&&Sr(m)){const{value:P,message:R}=Vo(h);if(Zf(P)&&!m.match(P)&&(b[y]={type:En.pattern,message:R,ref:o,...$(En.pattern,R)},!n))return S(R),b}if(g){if(In(g)){const P=await g(m,r),R=w_(P,w);if(R&&(b[y]={...R,...$(En.validate,R.message)},!n))return S(R.message),b}else if(Mt(g)){let P={};for(const R in g){if(!pr(P)&&!n)break;const L=w_(await g[R](m,r),w,R);L&&(P={...L,...$(R,L.message)},S(L.message),n&&(b[y]=P))}if(!pr(P)&&(b[y]={ref:w,...P},!n))return b}}return S(!0),b};const N3={mode:pn.onSubmit,reValidateMode:pn.onChange,shouldFocusError:!0};function C3(e={}){let t={...N3,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:In(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},a=Mt(t.defaultValues)||Mt(t.values)?vt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:vt(a),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...f};let p={...d};const h={array:h_(),state:h_()},g=t.criteriaMode===pn.all,y=E=>M=>{clearTimeout(u),u=setTimeout(E,M)},v=async E=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||p.isValid||E)){let M;t.resolver?(M=pr((await A()).errors),x()):M=await P({fields:n,onlyCheckValid:!0,eventType:Uo.VALID}),M!==r.isValid&&h.state.next({isValid:M})}},x=(E,M)=>{!t.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((E||Array.from(s.mount)).forEach(N=>{N&&(M?tt(r.validatingFields,N,M):$t(r.validatingFields,N))}),h.state.next({validatingFields:r.validatingFields,isValidating:!pr(r.validatingFields)}))},m=E=>{const M=pu(a,i),N=_3(E);tt(r.dirtyFields,N,le(M,N))},w=(E,M=[],N,B,G=!0,ee=!0)=>{if(B&&N&&!t.disabled){if(o.action=!0,ee&&Array.isArray(le(n,E))){const Z=N(le(n,E),B.argA,B.argB);G&&tt(n,E,Z)}if(ee&&Array.isArray(le(r.errors,E))){const Z=N(le(r.errors,E),B.argA,B.argB);G&&tt(r.errors,E,Z),P3(r.errors,E)}if((d.touchedFields||p.touchedFields)&&ee&&Array.isArray(le(r.touchedFields,E))){const Z=N(le(r.touchedFields,E),B.argA,B.argB);G&&tt(r.touchedFields,E,Z)}(d.dirtyFields||p.dirtyFields)&&m(E),h.state.next({name:E,isDirty:L(E,M),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else tt(i,E,M)},S=(E,M)=>{tt(r.errors,E,M),h.state.next({errors:r.errors})},b=E=>{r.errors=E,h.state.next({errors:r.errors,isValid:!1})},_=(E,M,N,B)=>{const G=le(n,E);if(G){const ee=le(i,E,ct(N)?le(a,E):N);ct(ee)||B&&B.defaultChecked||M?tt(i,E,M?ee:g_(G._f)):V(E,ee),o.mount&&!o.action&&v()}},O=(E,M,N,B,G)=>{let ee=!1,Z=!1;const me={name:E};if(!t.disabled){if(!N||B){(d.isDirty||p.isDirty)&&(Z=r.isDirty,r.isDirty=me.isDirty=L(),ee=Z!==me.isDirty);const Te=ii(le(a,E),M);Z=!!le(r.dirtyFields,E),Te?$t(r.dirtyFields,E):tt(r.dirtyFields,E,!0),me.dirtyFields=r.dirtyFields,ee=ee||(d.dirtyFields||p.dirtyFields)&&Z!==!Te}if(N){const Te=le(r.touchedFields,E);Te||(tt(r.touchedFields,E,N),me.touchedFields=r.touchedFields,ee=ee||(d.touchedFields||p.touchedFields)&&Te!==N)}ee&&G&&h.state.next(me)}return ee?me:{}},k=(E,M,N,B)=>{const G=le(r.errors,E),ee=(d.isValid||p.isValid)&&Hn(M)&&r.isValid!==M;if(t.delayError&&N?(l=y(()=>S(E,N)),l(t.delayError)):(clearTimeout(u),l=null,N?tt(r.errors,E,N):$t(r.errors,E)),(N?!ii(G,N):G)||!pr(B)||ee){const Z={...B,...ee&&Hn(M)?{isValid:M}:{},errors:r.errors,name:E};r={...r,...Z},h.state.next(Z)}},A=async E=>(x(E,!0),await t.resolver(i,t.context,S3(E||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),$=async E=>{const{errors:M}=await A(E);if(x(E),E)for(const N of E){const B=le(M,N);B?tt(r.errors,N,B):$t(r.errors,N)}else r.errors=M;return M},T=async({name:E,eventType:M})=>{if(e.validate){const N=await e.validate({formValues:i,formState:r,name:E,eventType:M});if(Mt(N))for(const B in N)N[B]&&ue(`${dy}.${B}`,{message:Sr(N.message)?N.message:"",type:En.validate});else Sr(N)||!N?ue(dy,{message:N||"",type:En.validate}):be(dy);return N}return!0},P=async({fields:E,onlyCheckValid:M,name:N,eventType:B,context:G={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(G.runRootValidation=!0,!await T({name:N,eventType:B})&&(G.valid=!1,M)))return G.valid;for(const ee in E){const Z=E[ee];if(Z){const{_f:me,...Te}=Z;if(me){const Et=s.array.has(me.name),Tt=Z._f&&j3(Z._f);Tt&&d.validatingFields&&x([me.name],!0);const Xt=await bg(Z,s.disabled,i,g,t.shouldUseNativeValidation&&!M,Et);if(Tt&&d.validatingFields&&x([me.name]),Xt[me.name]&&(G.valid=!1,M)||(!M&&(le(Xt,me.name)?Et?pP(r.errors,Xt,me.name):tt(r.errors,me.name,Xt[me.name]):$t(r.errors,me.name)),e.shouldUseNativeValidation&&Xt[me.name]))break}!pr(Te)&&await P({context:G,onlyCheckValid:M,fields:Te,name:ee,eventType:B})}}return G.valid},R=()=>{for(const E of s.unMount){const M=le(n,E);M&&(M._f.refs?M._f.refs.every(N=>!fy(N)):!fy(M._f.ref))&&ie(E)}s.unMount=new Set},L=(E,M)=>!t.disabled&&(E&&M&&tt(i,E,M),!ii(ae(),a)),z=(E,M,N)=>y3(E,s,{...o.mount?i:ct(M)?a:Sr(E)?{[E]:M}:M},N,M),W=E=>$h(le(o.mount?i:a,E,t.shouldUnregister?le(a,E,[]):[])),V=(E,M,N={})=>{const B=le(n,E);let G=M;if(B){const ee=B._f;ee&&(!ee.disabled&&tt(i,E,dP(M,ee)),G=Yf(ee.ref)&&Tr(M)?"":M,lP(ee.ref)?[...ee.ref.options].forEach(Z=>Z.selected=G.includes(Z.value)):ee.refs?rd(ee.ref)?ee.refs.forEach(Z=>{(!Z.defaultChecked||!Z.disabled)&&(Array.isArray(G)?Z.checked=!!G.find(me=>me===Z.value):Z.checked=G===Z.value||!!G)}):ee.refs.forEach(Z=>Z.checked=Z.value===G):cb(ee.ref)?ee.ref.value="":(ee.ref.value=G,ee.ref.type||h.state.next({name:E,values:vt(i)})))}(N.shouldDirty||N.shouldTouch)&&O(E,G,N.shouldTouch,N.shouldDirty,!0),N.shouldValidate&&K(E)},D=(E,M,N)=>{for(const B in M){if(!M.hasOwnProperty(B))return;const G=M[B],ee=E+"."+B,Z=le(n,ee);(s.array.has(E)||Mt(G)||Z&&!Z._f)&&!ro(G)?D(ee,G,N):V(ee,G,N)}},U=(E,M,N={})=>{const B=le(n,E),G=s.array.has(E),ee=vt(M);tt(i,E,ee),G?(h.array.next({name:E,values:vt(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&N.shouldDirty&&(m(E),h.state.next({name:E,dirtyFields:r.dirtyFields,isDirty:L(E,ee)}))):B&&!B._f&&!Tr(ee)?D(E,ee,N):V(E,ee,N),xg(E,s)?h.state.next({...r,name:E,values:vt(i)}):h.state.next({name:o.mount?E:void 0,values:vt(i)})},q=async E=>{o.mount=!0;const M=E.target;let N=M.name,B=!0;const G=le(n,N),ee=Te=>{B=Number.isNaN(Te)||ro(Te)&&isNaN(Te.getTime())||ii(Te,le(i,N,Te))},Z=cs(t.mode),me=cs(t.reValidateMode);if(G){let Te,Et;const Tt=M.type?g_(G._f):d3(E),Xt=E.type===Uo.BLUR||E.type===Uo.FOCUS_OUT,zi=!O3(G._f)&&!e.validate&&!t.resolver&&!le(r.errors,N)&&!G._f.deps||E3(Xt,le(r.touchedFields,N),r.isSubmitted,me,Z),Wa=xg(N,s,Xt);tt(i,N,Tt),Xt?(!M||!M.readOnly)&&(G._f.onBlur&&G._f.onBlur(E),l&&l(0)):G._f.onChange&&G._f.onChange(E);const Bi=O(N,Tt,Xt),Ui=!pr(Bi)||Wa;if(!Xt&&h.state.next({name:N,type:E.type,values:vt(i)}),zi)return(d.isValid||p.isValid)&&(t.mode==="onBlur"?Xt&&v():Xt||v()),Ui&&h.state.next({name:N,...Wa?{}:Bi});if(!t.resolver&&e.validate&&await T({name:N,eventType:E.type}),!Xt&&Wa&&h.state.next({...r}),t.resolver){const{errors:Vi}=await A([N]);if(x([N]),ee(Tt),B){const Ml=b_(r.errors,n,N),Fo=b_(Vi,n,Ml.name||N);Te=Fo.error,N=Fo.name,Et=pr(Vi)}}else x([N],!0),Te=(await bg(G,s.disabled,i,g,t.shouldUseNativeValidation))[N],x([N]),ee(Tt),B&&(Te?Et=!1:(d.isValid||p.isValid)&&(Et=await P({fields:n,onlyCheckValid:!0,name:N,eventType:E.type})));B&&(G._f.deps&&(!Array.isArray(G._f.deps)||G._f.deps.length>0)&&K(G._f.deps),k(N,Et,Te,Bi))}},J=(E,M)=>{if(le(r.errors,M)&&E.focus)return E.focus(),1},K=async(E,M={})=>{let N,B;const G=Rr(E);if(t.resolver){const ee=await $(ct(E)?E:G);N=pr(ee),B=E?!G.some(Z=>le(ee,Z)):N}else E?(B=(await Promise.all(G.map(async ee=>{const Z=le(n,ee);return await P({fields:Z&&Z._f?{[ee]:Z}:Z,eventType:Uo.TRIGGER})}))).every(Boolean),!(!B&&!r.isValid)&&v()):B=N=await P({fields:n,name:E,eventType:Uo.TRIGGER});return h.state.next({...!Sr(E)||(d.isValid||p.isValid)&&N!==r.isValid?{}:{name:E},...t.resolver||!E?{isValid:N}:{},errors:r.errors}),M.shouldFocus&&!B&&Ss(n,J,E?G:s.mount),B},ae=(E,M)=>{let N={...o.mount?i:a};return M&&(N=sP(M.dirtyFields?r.dirtyFields:r.touchedFields,N)),ct(E)?N:Sr(E)?le(N,E):E.map(B=>le(N,B))},Q=(E,M)=>({invalid:!!le((M||r).errors,E),isDirty:!!le((M||r).dirtyFields,E),error:le((M||r).errors,E),isValidating:!!le(r.validatingFields,E),isTouched:!!le((M||r).touchedFields,E)}),be=E=>{const M=E?Rr(E):void 0;M==null||M.forEach(N=>$t(r.errors,N)),M?M.forEach(N=>{h.state.next({name:N,errors:r.errors})}):h.state.next({errors:{}})},ue=(E,M,N)=>{const B=(le(n,E,{_f:{}})._f||{}).ref,G=le(r.errors,E)||{},{ref:ee,message:Z,type:me,...Te}=G;tt(r.errors,E,{...Te,...M,ref:B}),h.state.next({name:E,errors:r.errors,isValid:!1}),N&&N.shouldFocus&&B&&B.focus&&B.focus()},Ce=(E,M)=>In(E)?h.state.subscribe({next:N=>"values"in N&&E(z(void 0,M),N)}):z(E,M,!0),Fe=E=>h.state.subscribe({next:M=>{A3(E.name,M.name,E.exact)&&k3(M,E.formState||d,Oe,E.reRenderRoot)&&E.callback({values:{...i},...r,...M,defaultValues:a})}}).unsubscribe,te=E=>(o.mount=!0,p={...p,...E.formState},Fe({...E,formState:{...f,...E.formState}})),ie=(E,M={})=>{for(const N of E?Rr(E):s.mount)s.mount.delete(N),s.array.delete(N),M.keepValue||($t(n,N),$t(i,N)),!M.keepError&&$t(r.errors,N),!M.keepDirty&&$t(r.dirtyFields,N),!M.keepTouched&&$t(r.touchedFields,N),!M.keepIsValidating&&$t(r.validatingFields,N),!t.shouldUnregister&&!M.keepDefaultValue&&$t(a,N);h.state.next({values:vt(i)}),h.state.next({...r,...M.keepDirty?{isDirty:L()}:{}}),!M.keepIsValid&&v()},he=({disabled:E,name:M})=>{if(Hn(E)&&o.mount||E||s.disabled.has(M)){const G=s.disabled.has(M)!==!!E;E?s.disabled.add(M):s.disabled.delete(M),G&&o.mount&&!o.action&&v()}},X=(E,M={})=>{let N=le(n,E);const B=Hn(M.disabled)||Hn(t.disabled),G=!s.registerName.has(E)&&N&&!N._f.mount;return tt(n,E,{...N||{},_f:{...N&&N._f?N._f:{ref:{name:E}},name:E,mount:!0,...M}}),s.mount.add(E),N&&!G?he({disabled:Hn(M.disabled)?M.disabled:t.disabled,name:E}):_(E,!0,M.value),{...B?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:Hl(M.min),max:Hl(M.max),minLength:Hl(M.minLength),maxLength:Hl(M.maxLength),pattern:Hl(M.pattern)}:{},name:E,onChange:q,onBlur:q,ref:ee=>{if(ee){s.registerName.add(E),X(E,M),s.registerName.delete(E),N=le(n,E);const Z=ct(ee.value)&&ee.querySelectorAll&&ee.querySelectorAll("input,select,textarea")[0]||ee,me=g3(Z),Te=N._f.refs||[];if(me?Te.find(Et=>Et===Z):Z===N._f.ref)return;tt(n,E,{_f:{...N._f,...me?{refs:[...Te.filter(fy),Z,...Array.isArray(le(a,E))?[{}]:[]],ref:{type:Z.type,name:E}}:{ref:Z}}}),_(E,!1,void 0,Z)}else N=le(n,E,{}),N._f&&(N._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(f3(s.array,E)&&o.action)&&s.unMount.add(E)}}},Ee=()=>t.shouldFocusError&&Ss(n,J,s.mount),ve=E=>{Hn(E)&&(h.state.next({disabled:E}),Ss(n,(M,N)=>{const B=le(n,N);B&&(M.disabled=B._f.disabled||E,Array.isArray(B._f.refs)&&B._f.refs.forEach(G=>{G.disabled=B._f.disabled||E}))},0,!1))},Pe=(E,M)=>async N=>{let B;N&&(N.preventDefault&&N.preventDefault(),N.persist&&N.persist());let G=vt(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:ee,values:Z}=await A();x(),r.errors=ee,G=vt(Z)}else await P({fields:n,eventType:Uo.SUBMIT});if(s.disabled.size)for(const ee of s.disabled)$t(G,ee);if($t(r.errors,nP),pr(r.errors)){h.state.next({errors:{}});try{await E(G,N)}catch(ee){B=ee}}else M&&await M({...r.errors},N),Ee(),setTimeout(Ee);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:pr(r.errors)&&!B,submitCount:r.submitCount+1,errors:r.errors}),B)throw B},ze=(E,M={})=>{le(n,E)&&(ct(M.defaultValue)?U(E,vt(le(a,E))):(U(E,M.defaultValue),tt(a,E,vt(M.defaultValue))),M.keepTouched||$t(r.touchedFields,E),M.keepDirty||($t(r.dirtyFields,E),r.isDirty=M.defaultValue?L(E,vt(le(a,E))):L()),M.keepError||($t(r.errors,E),d.isValid&&v()),h.state.next({...r}))},ge=(E,M={})=>{const N=E?vt(E):a,B=vt(N),G=pr(E),ee=G?a:B;if(M.keepDefaultValues||(a=N),!M.keepValues){if(M.keepDirtyValues){const Z=new Set([...s.mount,...Object.keys(pu(a,i))]);for(const me of Array.from(Z)){const Te=le(r.dirtyFields,me),Et=le(i,me),Tt=le(ee,me);Te&&!ct(Et)?tt(ee,me,Et):!Te&&!ct(Tt)&&U(me,Tt)}}else{if(lb&&ct(E))for(const Z of s.mount){const me=le(n,Z);if(me&&me._f){const Te=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(Yf(Te)){const Et=Te.closest("form");if(Et){Et.reset();break}}}}if(M.keepFieldsRef)for(const Z of s.mount)U(Z,le(ee,Z));else n={}}i=t.shouldUnregister?M.keepDefaultValues?vt(a):{}:vt(ee),h.array.next({values:{...ee}}),h.state.next({values:{...ee}})}s={mount:M.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!pr(ee),o.watch=!!t.shouldUnregister,o.keepIsValid=!!M.keepIsValid,o.action=!1,M.keepErrors||(r.errors={}),h.state.next({submitCount:M.keepSubmitCount?r.submitCount:0,isDirty:G?!1:M.keepDirty?r.isDirty:!!(M.keepDefaultValues&&!ii(E,a)),isSubmitted:M.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:G?{}:M.keepDirtyValues?M.keepDefaultValues&&i?pu(a,i):r.dirtyFields:M.keepDefaultValues&&E?pu(a,E):M.keepDirty?r.dirtyFields:{},touchedFields:M.keepTouched?r.touchedFields:{},errors:M.keepErrors?r.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},$e=(E,M)=>ge(In(E)?E(i):E,{...t.resetOptions,...M}),Le=(E,M={})=>{const N=le(n,E),B=N&&N._f;if(B){const G=B.refs?B.refs[0]:B.ref;G.focus&&setTimeout(()=>{G.focus(),M.shouldSelect&&In(G.select)&&G.select()})}},Oe=E=>{r={...r,...E}},H={control:{register:X,unregister:ie,getFieldState:Q,handleSubmit:Pe,setError:ue,_subscribe:Fe,_runSchema:A,_updateIsValidating:x,_focusError:Ee,_getWatch:z,_getDirty:L,_setValid:v,_setFieldArray:w,_setDisabledField:he,_setErrors:b,_getFieldArray:W,_reset:ge,_resetDefaultValues:()=>In(t.defaultValues)&&t.defaultValues().then(E=>{$e(E,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:R,_disableForm:ve,_subjects:h,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(E){o=E},get _defaultValues(){return a},get _names(){return s},set _names(E){s=E},get _formState(){return r},get _options(){return t},set _options(E){t={...t,...E}}},subscribe:te,trigger:K,register:X,handleSubmit:Pe,watch:Ce,setValue:U,getValues:ae,reset:$e,resetField:ze,clearErrors:be,unregister:ie,setError:ue,setFocus:Le,getFieldState:Q};return{...H,formControl:H}}var Xa=()=>{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 r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},py=(e,t,r={})=>r.shouldFocus||ct(r.shouldFocus)?r.focusName||`${e}.${ct(r.focusIndex)?t:r.focusIndex}.`:"",hy=(e,t)=>[...e,...Rr(t)],my=e=>Array.isArray(e)?e.map(()=>{}):void 0;function yy(e,t,r){return[...e.slice(0,t),...Rr(r),...e.slice(t)]}var vy=(e,t,r)=>Array.isArray(e)?(ct(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],gy=(e,t)=>[...Rr(t),...Rr(e)];function T3(e,t){let r=0;const n=[...e];for(const a of t)n.splice(a-r,1),r++;return $h(n).length?n:[]}var xy=(e,t)=>ct(t)?[]:T3(e,Rr(t).sort((r,n)=>r-n)),by=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},__=(e,t,r)=>(e[t]=r,e);function $3(e){const t=h3(),{control:r=t,name:n,keyName:a="id",shouldUnregister:i,rules:o}=e,[s,l]=C.useState(r._getFieldArray(n)),u=C.useRef(r._getFieldArray(n).map(Xa)),f=C.useRef(!1);r._names.array.add(n),C.useMemo(()=>o&&s.length>=0&&r.register(n,o),[r,n,s.length,o]),iP(()=>r._subjects.array.subscribe({next:({values:S,name:b})=>{if(b===n||!b){const _=le(S,n);Array.isArray(_)&&(l(_),u.current=_.map(Xa))}}}).unsubscribe,[r,n]);const d=C.useCallback(S=>{f.current=!0,r._setFieldArray(n,S)},[r,n]),p=(S,b)=>{const _=Rr(vt(S)),O=hy(r._getFieldArray(n),_);r._names.focus=py(n,O.length-1,b),u.current=hy(u.current,_.map(Xa)),d(O),l(O),r._setFieldArray(n,O,hy,{argA:my(S)})},h=(S,b)=>{const _=Rr(vt(S)),O=gy(r._getFieldArray(n),_);r._names.focus=py(n,0,b),u.current=gy(u.current,_.map(Xa)),d(O),l(O),r._setFieldArray(n,O,gy,{argA:my(S)})},g=S=>{const b=xy(r._getFieldArray(n),S);u.current=xy(u.current,S),d(b),l(b),!Array.isArray(le(r._fields,n))&&tt(r._fields,n,void 0),r._setFieldArray(n,b,xy,{argA:S})},y=(S,b,_)=>{const O=Rr(vt(b)),k=yy(r._getFieldArray(n),S,O);r._names.focus=py(n,S,_),u.current=yy(u.current,S,O.map(Xa)),d(k),l(k),r._setFieldArray(n,k,yy,{argA:S,argB:my(b)})},v=(S,b)=>{const _=r._getFieldArray(n);by(_,S,b),by(u.current,S,b),d(_),l(_),r._setFieldArray(n,_,by,{argA:S,argB:b},!1)},x=(S,b)=>{const _=r._getFieldArray(n);vy(_,S,b),vy(u.current,S,b),d(_),l(_),r._setFieldArray(n,_,vy,{argA:S,argB:b},!1)},m=(S,b)=>{const _=vt(b),O=__(r._getFieldArray(n),S,_);u.current=[...O].map((k,A)=>!k||A===S?Xa():u.current[A]),d(O),l([...O]),r._setFieldArray(n,O,__,{argA:S,argB:_},!0,!1)},w=S=>{const b=Rr(vt(S));u.current=b.map(Xa),d([...b]),l([...b]),r._setFieldArray(n,[...b],_=>_,{},!0,!1)};return C.useEffect(()=>{if(r._state.action=!1,xg(n,r._names)&&r._subjects.state.next({...r._formState}),f.current&&(!cs(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!cs(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{r._updateIsValidating([n]);const b=le(S.errors,n),_=le(r._formState.errors,n);(_?!b&&_.type||b&&(_.type!==b.type||_.message!==b.message):b&&b.type)&&(b?tt(r._formState.errors,n,b):$t(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=le(r._fields,n);S&&S._f&&!(cs(r._options.reValidateMode).isOnSubmit&&cs(r._options.mode).isOnSubmit)&&bg(S,r._names.disabled,r._formValues,r._options.criteriaMode===pn.all,r._options.shouldUseNativeValidation,!0).then(b=>!pr(b)&&r._subjects.state.next({errors:pP(r._formState.errors,b,n)}))}r._subjects.state.next({name:n,values:vt(r._formValues)}),r._names.focus&&Ss(r._fields,(S,b)=>{if(r._names.focus&&b.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),f.current=!1},[s,n,r]),C.useEffect(()=>(!le(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(b,_)=>{const O=le(r._fields,b);O&&O._f&&(O._f.mount=_)};r._options.shouldUnregister||i?r.unregister(n):S(n,!1)}),[n,r,a,i]),{swap:C.useCallback(v,[d,n,r]),move:C.useCallback(x,[d,n,r]),prepend:C.useCallback(h,[d,n,r]),append:C.useCallback(p,[d,n,r]),remove:C.useCallback(g,[d,n,r]),insert:C.useCallback(y,[d,n,r]),update:C.useCallback(m,[d,n,r]),replace:C.useCallback(w,[d,n,r]),fields:C.useMemo(()=>s.map((S,b)=>({...S,[a]:u.current[b]||Xa()})),[s,a])}}function I3(e={}){const t=C.useRef(void 0),r=C.useRef(void 0),[n,a]=C.useState({isDirty:!1,isValidating:!1,isLoading:In(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:In(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!In(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=C3(e);t.current={...s,formState:n}}const i=t.current.control;return i._options=e,iP(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(s=>({...s,isReady:!0})),i._formState.isReady=!0,o},[i]),C.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),C.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),C.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),C.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),C.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),C.useEffect(()=>{var o;e.values&&!ii(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((o=i._options.resetOptions)===null||o===void 0)&&o.keepIsValid||i._setValid(),r.current=e.values,a(s=>({...s}))):i._resetDefaultValues()},[i,e.values]),C.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=C.useMemo(()=>m3(n,i),[i,n]),t.current}const S_=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},hP=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?S_(n.ref,r,e):n.refs&&n.refs.forEach(a=>S_(a,r,e))}},R3=(e,t)=>{t.shouldUseNativeValidation&&hP(e,t);const r={};for(const n in e){const a=le(t.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(M3(t.names||Object.keys(e),n)){const o=Object.assign({},le(r,n));tt(o,"root",i),tt(r,n,o)}else tt(r,n,i)}return r},M3=(e,t)=>e.some(r=>r.startsWith(t+"."));var D3=function(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=oP(o,t,r,a,u?[].concat(u,n.message):n.message)}e.shift()}return r},L3=function(e,t,r){return r===void 0&&(r={}),function(n,a,i){try{return Promise.resolve(function(o,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&hP({},i),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:R3(D3(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},Qe;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Qe||(Qe={}));var j_;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(j_||(j_={}));const ye=Qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ei=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}},oe=Qe.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 Ta extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ta.create=e=>new Ta(e);const wg=(e,t)=>{let r;switch(e.code){case oe.invalid_type:e.received===ye.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Qe.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${Qe.joinValues(e.keys,", ")}`;break;case oe.invalid_union:r="Invalid input";break;case oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Qe.joinValues(e.options)}`;break;case oe.invalid_enum_value:r=`Invalid enum value. Expected ${Qe.joinValues(e.options)}, received '${e.received}'`;break;case oe.invalid_arguments:r="Invalid function arguments";break;case oe.invalid_return_type:r="Invalid function return type";break;case oe.invalid_date:r="Invalid date";break;case oe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Qe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case oe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case oe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case oe.custom:r="Invalid input";break;case oe.invalid_intersection_types:r="Intersection results could not be merged";break;case oe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case oe.not_finite:r="Number must be finite";break;default:r=t.defaultError,Qe.assertNever(e)}return{message:r}};let F3=wg;function z3(){return F3}const B3=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}};function ce(e,t){const r=z3(),n=B3({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wg?void 0:wg].filter(a=>!!a)});e.common.issues.push(n)}class Jr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return Re;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return Jr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Re;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const Re=Object.freeze({status:"aborted"}),hu=e=>({status:"dirty",value:e}),wn=e=>({status:"valid",value:e}),O_=e=>e.status==="aborted",k_=e=>e.status==="dirty",Fs=e=>e.status==="valid",Qf=e=>typeof Promise<"u"&&e instanceof Promise;var xe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(xe||(xe={}));class Ei{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,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 A_=(e,t)=>{if(Fs(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 r=new Ta(e.common.issues);return this._error=r,this._error}}};function Be(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))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:(o,s)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:a}}class Ze{get description(){return this._def.description}_getType(t){return ei(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ei(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Jr,ctx:{common:t.parent.common,data:t.data,parsedType:ei(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Qf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)},a=this._parseSync({data:t,path:n.path,parent:n});return A_(n,a)}"~validate"(t){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return Fs(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>Fs(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ei(t)},a=this._parse({data:t,path:n.path,parent:n}),i=await(Qf(a)?a:Promise.resolve(a));return A_(n,i)}refine(t,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=t(a),s=()=>i.addIssue({code:oe.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new So({schema:this,typeName:Me.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:r=>this["~validate"](r)}}optional(){return _i.create(this,this._def)}nullable(){return Us.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qn.create(this)}promise(){return rp.create(this,this._def)}or(t){return ep.create([this,t],this._def)}and(t){return tp.create(this,t,this._def)}transform(t){return new So({...Be(this._def),schema:this,typeName:Me.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Sg({...Be(this._def),innerType:this,defaultValue:r,typeName:Me.ZodDefault})}brand(){return new c4({typeName:Me.ZodBranded,type:this,...Be(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new jg({...Be(this._def),innerType:this,catchValue:r,typeName:Me.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return fb.create(this,t)}readonly(){return Og.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const U3=/^c[^\s-]{8,}$/i,V3=/^[0-9a-z]+$/,W3=/^[0-9A-HJKMNP-TV-Z]{26}$/i,H3=/^[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,G3=/^[a-z0-9_-]{21}$/i,q3=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,K3=/^[-+]?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)?)??$/,X3=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Y3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let wy;const Z3=/^(?:(?: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])$/,Q3=/^(?:(?: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])$/,J3=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}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){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])$/,t4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,r4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mP="((\\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])))",n4=new RegExp(`^${mP}$`);function yP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function a4(e){return new RegExp(`^${yP(e)}$`)}function i4(e){let t=`${mP}T${yP(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function o4(e,t){return!!((t==="v4"||!t)&&Z3.test(e)||(t==="v6"||!t)&&J3.test(e))}function s4(e,t){if(!q3.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function l4(e,t){return!!((t==="v4"||!t)&&Q3.test(e)||(t==="v6"||!t)&&e4.test(e))}class xa extends Ze{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.string,received:i.parsedType}),Re}const n=new Jr;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,s=t.data.lengtht.test(a),{validation:r,code:oe.invalid_string,...xe.errToObj(n)})}_addCheck(t){return new xa({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...xe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...xe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...xe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...xe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...xe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...xe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...xe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...xe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...xe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...xe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...xe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...xe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...xe.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==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...xe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...xe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...xe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...xe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...xe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...xe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...xe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...xe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...xe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...xe.errToObj(r)})}nonempty(t){return this.min(1,xe.errToObj(t))}trim(){return new xa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xa({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew xa({checks:[],typeName:Me.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Be(e)});function u4(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return i%o/10**a}class bo extends Ze{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 i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.number,received:i.parsedType}),Re}let n;const a=new Jr;for(const i of this._def.checks)i.kind==="int"?Qe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?u4(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_finite,message:i.message}),a.dirty()):Qe.assertNever(i);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,a){return new bo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(a)}]})}_addCheck(t){return new bo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:xe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:xe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Qe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew bo({checks:[],typeName:Me.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class wo extends Ze{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 n;const a=new Jr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Qe.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return ce(r,{code:oe.invalid_type,expected:ye.bigint,received:r.parsedType}),Re}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,a){return new wo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(a)}]})}_addCheck(t){return new wo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew wo({checks:[],typeName:Me.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Be(e)});class Jf extends Ze{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.boolean,received:n.parsedType}),Re}return wn(t.data)}}Jf.create=e=>new Jf({typeName:Me.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class zs extends Ze{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_type,expected:ye.date,received:i.parsedType}),Re}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ce(i,{code:oe.invalid_date}),Re}const n=new Jr;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Qe.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new zs({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:xe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:xe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew zs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Me.ZodDate,...Be(e)});class E_ extends Ze{_parse(t){if(this._getType(t)!==ye.symbol){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.symbol,received:n.parsedType}),Re}return wn(t.data)}}E_.create=e=>new E_({typeName:Me.ZodSymbol,...Be(e)});class P_ extends Ze{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.undefined,received:n.parsedType}),Re}return wn(t.data)}}P_.create=e=>new P_({typeName:Me.ZodUndefined,...Be(e)});class N_ extends Ze{_parse(t){if(this._getType(t)!==ye.null){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.null,received:n.parsedType}),Re}return wn(t.data)}}N_.create=e=>new N_({typeName:Me.ZodNull,...Be(e)});class C_ extends Ze{constructor(){super(...arguments),this._any=!0}_parse(t){return wn(t.data)}}C_.create=e=>new C_({typeName:Me.ZodAny,...Be(e)});class T_ extends Ze{constructor(){super(...arguments),this._unknown=!0}_parse(t){return wn(t.data)}}T_.create=e=>new T_({typeName:Me.ZodUnknown,...Be(e)});class Pi extends Ze{_parse(t){const r=this._getOrReturnCtx(t);return ce(r,{code:oe.invalid_type,expected:ye.never,received:r.parsedType}),Re}}Pi.create=e=>new Pi({typeName:Me.ZodNever,...Be(e)});class $_ extends Ze{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.void,received:n.parsedType}),Re}return wn(t.data)}}$_.create=e=>new $_({typeName:Me.ZodVoid,...Be(e)});class Qn extends Ze{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==ye.array)return ce(r,{code:oe.invalid_type,expected:ye.array,received:r.parsedType}),Re;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,s=r.data.lengtha.maxLength.value&&(ce(r,{code:oe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new Ei(r,o,r.path,s)))).then(o=>Jr.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new Ei(r,o,r.path,s)));return Jr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Qn({...this._def,minLength:{value:t,message:xe.toString(r)}})}max(t,r){return new Qn({...this._def,maxLength:{value:t,message:xe.toString(r)}})}length(t,r){return new Qn({...this._def,exactLength:{value:t,message:xe.toString(r)}})}nonempty(t){return this.min(1,t)}}Qn.create=(e,t)=>new Qn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Me.ZodArray,...Be(t)});function Yo(e){if(e instanceof Lt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=_i.create(Yo(n))}return new Lt({...e._def,shape:()=>t})}else return e instanceof Qn?new Qn({...e._def,type:Yo(e.element)}):e instanceof _i?_i.create(Yo(e.unwrap())):e instanceof Us?Us.create(Yo(e.unwrap())):e instanceof _o?_o.create(e.items.map(t=>Yo(t))):e}class Lt extends Ze{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(),r=Qe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ye.object){const u=this._getOrReturnCtx(t);return ce(u,{code:oe.invalid_type,expected:ye.object,received:u.parsedType}),Re}const{status:n,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Pi&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const f=i[u],d=a.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new Ei(a,d,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof Pi){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(u==="strict")s.length>0&&(ce(a,{code:oe.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of s){const d=a.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new Ei(a,d,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const d=await f.key,p=await f.value;u.push({key:d,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>Jr.mergeObjectSync(n,u)):Jr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return xe.errToObj,new Lt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:xe.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Lt({...this._def,unknownKeys:"strip"})}passthrough(){return new Lt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Lt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Lt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Me.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Lt({...this._def,catchall:t})}pick(t){const r={};for(const n of Qe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Lt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Qe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Lt({...this._def,shape:()=>r})}deepPartial(){return Yo(this)}partial(t){const r={};for(const n of Qe.objectKeys(this.shape)){const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new Lt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Qe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof _i;)i=i._def.innerType;r[n]=i}return new Lt({...this._def,shape:()=>r})}keyof(){return vP(Qe.objectKeys(this.shape))}}Lt.create=(e,t)=>new Lt({shape:()=>e,unknownKeys:"strip",catchall:Pi.create(),typeName:Me.ZodObject,...Be(t)});Lt.strictCreate=(e,t)=>new Lt({shape:()=>e,unknownKeys:"strict",catchall:Pi.create(),typeName:Me.ZodObject,...Be(t)});Lt.lazycreate=(e,t)=>new Lt({shape:e,unknownKeys:"strip",catchall:Pi.create(),typeName:Me.ZodObject,...Be(t)});class ep extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Ta(s.ctx.common.issues));return ce(r,{code:oe.invalid_union,unionErrors:o}),Re}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(l=>new Ta(l));return ce(r,{code:oe.invalid_union,unionErrors:s}),Re}}get options(){return this._def.options}}ep.create=(e,t)=>new ep({options:e,typeName:Me.ZodUnion,...Be(t)});function _g(e,t){const r=ei(e),n=ei(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){const a=Qe.objectKeys(t),i=Qe.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(const s of i){const l=_g(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i{if(O_(i)||O_(o))return Re;const s=_g(i.value,o.value);return s.valid?((k_(i)||k_(o))&&r.dirty(),{status:r.value,value:s.data}):(ce(n,{code:oe.invalid_intersection_types}),Re)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}tp.create=(e,t,r)=>new tp({left:e,right:t,typeName:Me.ZodIntersection,...Be(r)});class _o extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return ce(n,{code:oe.invalid_type,expected:ye.array,received:n.parsedType}),Re;if(n.data.lengththis._def.items.length&&(ce(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Ei(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>Jr.mergeArray(r,o)):Jr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new _o({...this._def,rest:t})}}_o.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _o({items:e,typeName:Me.ZodTuple,rest:null,...Be(t)})};class I_ extends Ze{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.map)return ce(n,{code:oe.invalid_type,expected:ye.map,received:n.parsedType}),Re;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:a._parse(new Ei(n,s,n.path,[u,"key"])),value:i._parse(new Ei(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return Re;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return Re;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}}I_.create=(e,t,r)=>new I_({valueType:t,keyType:e,typeName:Me.ZodMap,...Be(r)});class uc extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return ce(n,{code:oe.invalid_type,expected:ye.set,received:n.parsedType}),Re;const a=this._def;a.minSize!==null&&n.data.sizea.maxSize.value&&(ce(n,{code:oe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return Re;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>i._parse(new Ei(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new uc({...this._def,minSize:{value:t,message:xe.toString(r)}})}max(t,r){return new uc({...this._def,maxSize:{value:t,message:xe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}uc.create=(e,t)=>new uc({valueType:e,minSize:null,maxSize:null,typeName:Me.ZodSet,...Be(t)});class R_ extends Ze{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}R_.create=(e,t)=>new R_({getter:e,typeName:Me.ZodLazy,...Be(t)});class M_ extends Ze{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:oe.invalid_literal,expected:this._def.value}),Re}return{status:"valid",value:t.data}}get value(){return this._def.value}}M_.create=(e,t)=>new M_({value:e,typeName:Me.ZodLiteral,...Be(t)});function vP(e,t){return new Bs({values:e,typeName:Me.ZodEnum,...Be(t)})}class Bs extends Ze{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:Qe.joinValues(n),received:r.parsedType,code:oe.invalid_type}),Re}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:oe.invalid_enum_value,options:n}),Re}return wn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Bs.create(t,{...this._def,...r})}exclude(t,r=this._def){return Bs.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Bs.create=vP;class D_ extends Ze{_parse(t){const r=Qe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){const a=Qe.objectValues(r);return ce(n,{expected:Qe.joinValues(a),received:n.parsedType,code:oe.invalid_type}),Re}if(this._cache||(this._cache=new Set(Qe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Qe.objectValues(r);return ce(n,{received:n.data,code:oe.invalid_enum_value,options:a}),Re}return wn(t.data)}get enum(){return this._def.values}}D_.create=(e,t)=>new D_({values:e,typeName:Me.ZodNativeEnum,...Be(t)});class rp extends Ze{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return ce(r,{code:oe.invalid_type,expected:ye.promise,received:r.parsedType}),Re;const n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return wn(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}rp.create=(e,t)=>new rp({type:e,typeName:Me.ZodPromise,...Be(t)});class So extends Ze{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{ce(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return Re;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?Re:l.status==="dirty"||r.value==="dirty"?hu(l.value):l});{if(r.value==="aborted")return Re;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?Re:s.status==="dirty"||r.value==="dirty"?hu(s.value):s}}if(a.type==="refinement"){const o=s=>{const l=a.refinement(s,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Re:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?Re:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fs(o))return Re;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Fs(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):Re);Qe.assertNever(a)}}So.create=(e,t,r)=>new So({schema:e,typeName:Me.ZodEffects,effect:t,...Be(r)});So.createWithPreprocess=(e,t,r)=>new So({schema:t,effect:{type:"preprocess",transform:e},typeName:Me.ZodEffects,...Be(r)});class _i extends Ze{_parse(t){return this._getType(t)===ye.undefined?wn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_i.create=(e,t)=>new _i({innerType:e,typeName:Me.ZodOptional,...Be(t)});class Us extends Ze{_parse(t){return this._getType(t)===ye.null?wn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Us.create=(e,t)=>new Us({innerType:e,typeName:Me.ZodNullable,...Be(t)});class Sg extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Sg.create=(e,t)=>new Sg({innerType:e,typeName:Me.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Be(t)});class jg extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Qf(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ta(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ta(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}jg.create=(e,t)=>new jg({innerType:e,typeName:Me.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Be(t)});class L_ extends Ze{_parse(t){if(this._getType(t)!==ye.nan){const n=this._getOrReturnCtx(t);return ce(n,{code:oe.invalid_type,expected:ye.nan,received:n.parsedType}),Re}return{status:"valid",value:t.data}}}L_.create=e=>new L_({typeName:Me.ZodNaN,...Be(e)});class c4 extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class fb extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Re:i.status==="dirty"?(r.dirty(),hu(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Re:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new fb({in:t,out:r,typeName:Me.ZodPipeline})}}class Og extends Ze{_parse(t){const r=this._def.innerType._parse(t),n=a=>(Fs(a)&&(a.value=Object.freeze(a.value)),a);return Qf(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Og.create=(e,t)=>new Og({innerType:e,typeName:Me.ZodReadonly,...Be(t)});var Me;(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"})(Me||(Me={}));const F_=xa.create,Nu=bo.create;wo.create;Jf.create;zs.create;Pi.create;const d4=Qn.create,gP=Lt.create;ep.create;tp.create;_o.create;Bs.create;rp.create;_i.create;Us.create;const Cu=So.createWithPreprocess,xP={string:e=>xa.create({...e,coerce:!0}),number:e=>bo.create({...e,coerce:!0}),boolean:e=>Jf.create({...e,coerce:!0}),bigint:e=>wo.create({...e,coerce:!0}),date:e=>zs.create({...e,coerce:!0})},f4={primary:"bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 shadow-sm border border-transparent dark:bg-white dark:text-black dark:hover:bg-slate-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:text-slate-900 disabled:opacity-40 shadow-sm dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a] dark:hover:bg-[#18181b] dark:hover:text-white",ghost:"text-slate-500 hover:text-slate-900 hover:bg-slate-100 disabled:opacity-40 dark:text-[#a1a1aa] dark:hover:text-white dark:hover:bg-[#121214]",danger:"bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 disabled:opacity-40 dark:bg-[#2a0505] dark:text-red-500 dark:hover:bg-[#380808] dark:border-[#5c1c1c]"},p4={sm:"px-4 py-1.5 text-xs font-semibold",md:"px-5 py-2.5 text-sm font-semibold"};function Ie({variant:e="primary",size:t="md",className:r="",...n}){return c.jsx("button",{className:`relative inline-flex items-center justify-center gap-2 rounded-full transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/50 focus:ring-offset-1 focus:ring-offset-transparent focus:border-transparent ${f4[e]} ${p4[t]} ${r}`,...n,children:n.children})}function Gr({error:e}){return e?c.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/8 px-4 py-3 text-sm text-red-400 font-mono",children:e}):null}function mr({size:e=20}){return c.jsxs("svg",{className:"animate-spin text-brand-500",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}const h4={SR_SELECTION_V3_ROUTING:"bg-blue-100 text-blue-800",PRIORITY_LOGIC:"bg-purple-100 text-purple-800",NTW_BASED_ROUTING:"bg-green-100 text-green-800",SR_SELECTION_V3_ROUTING_WITH_HEDGING:"bg-orange-100 text-orange-800",HEDGING:"bg-orange-100 text-orange-800"},m4=["card","card_redirect","pay_later","wallet","bank_redirect","bank_transfer","crypto","bank_debit","reward","real_time_payment","upi","voucher","gift_card","open_banking","mobile_payment"],y4={card:["credit","debit"],bank_debit:["ach","sepa","bacs","becs"],bank_transfer:["ach","sepa","sepa_bank_transfer","bacs","multibanco","pix","pse","permata_bank_transfer","bca_bank_transfer","bni_va","bri_va","cimb_va","danamon_va","mandiri_va","local_bank_transfer","instant_bank_transfer"],wallet:["amazon_pay","apple_pay","google_pay","paypal","ali_pay","ali_pay_hk","dana","mb_way","mobile_pay","samsung_pay","twint","vipps","touch_n_go","swish","we_chat_pay","go_pay","gcash","momo","kakao_pay","cashapp","mifinity","paze"],pay_later:["affirm","alma","afterpay_clearpay","klarna","pay_bright","atome","walley"],upi:["upi_collect","upi_intent"],voucher:["boleto","efecty","pago_efectivo","red_compra","red_pagos","indomaret","alfamart","oxxo","seven_eleven","lawson","mini_stop","family_mart","seicomart","pay_easy"],bank_redirect:["giropay","ideal","sofort","eft","eps","bancontact_card","blik","local_bank_redirect","online_banking_thailand","online_banking_czech_republic","online_banking_finland","online_banking_fpx","online_banking_poland","online_banking_slovakia","przelewy24","trustly","bizum","interac","open_banking_uk","open_banking_pis"],gift_card:["givex","pay_safe_card"],card_redirect:["knet","benefit","momo_atm","card_redirect"],real_time_payment:["fps","duit_now","prompt_pay","viet_qr"],crypto:["crypto_currency"],reward:["evoucher","classic_reward"],open_banking:["open_banking_pis"],mobile_payment:["direct_carrier_billing"]},v4=gP({paymentMethodType:F_().min(1),paymentMethod:F_().min(1),bucketSize:xP.number().int().positive(),hedgingPercent:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),latencyThreshold:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable())}),g4=gP({defaultBucketSize:xP.number().int().positive(),defaultSuccessRate:Cu(e=>e===""||e===null?null:Number(e),Nu().min(0).max(1).nullable()),defaultLatencyThreshold:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),defaultHedgingPercent:Cu(e=>e===""||e===null?null:Number(e),Nu().nullable()),subLevelInputConfig:d4(v4)});function x4(){var R,L,z,W,V;const{merchantId:e}=aa(),[t,r]=j.useState(!1),[n,a]=j.useState(null),[i,o]=j.useState(!1),[s,l]=j.useState(!1),[u,f]=j.useState(!1),[d,p]=j.useState(null),{data:h,isLoading:g,mutate:y}=ar(e?["rule-sr",e]:null,()=>bt("/rule/get",{merchant_id:e,algorithm:"successRate"}),{shouldRetryOnError:!1}),{register:v,control:x,handleSubmit:m,reset:w,watch:S,formState:{errors:b}}=I3({resolver:L3(g4),defaultValues:{defaultBucketSize:200,defaultSuccessRate:.5,defaultLatencyThreshold:null,defaultHedgingPercent:null,subLevelInputConfig:[]}});j.useEffect(()=>{var D;if((D=h==null?void 0:h.config)!=null&&D.data){const U=h.config.data;w({defaultBucketSize:U.defaultBucketSize??200,defaultSuccessRate:U.defaultSuccessRate??.5,defaultLatencyThreshold:U.defaultLatencyThreshold??null,defaultHedgingPercent:U.defaultHedgingPercent??null,subLevelInputConfig:U.subLevelInputConfig??[]})}},[h,w]);const{fields:_,append:O,remove:k}=$3({control:x,name:"subLevelInputConfig"}),A=S("subLevelInputConfig");async function $(){try{await bt("/merchant-account/create",{merchant_id:e,gateway_success_rate_based_decider_input:null})}catch{}}async function T(D){if(!e){a("Set a Merchant ID first.");return}r(!0),a(null),o(!1);try{await $(),await bt(h?"/rule/update":"/rule/create",{merchant_id:e,config:{type:"successRate",data:{defaultBucketSize:D.defaultBucketSize,defaultSuccessRate:D.defaultSuccessRate,defaultLatencyThreshold:D.defaultLatencyThreshold,defaultHedgingPercent:D.defaultHedgingPercent,subLevelInputConfig:D.subLevelInputConfig.length>0?D.subLevelInputConfig:null}}}),o(!0),y()}catch(U){a(U instanceof Error?U.message:String(U))}finally{r(!1)}}async function P(){if(e){f(!0),p(null);try{await bt("/rule/delete",{merchant_id:e,algorithm:"successRate"}),y(void 0,{revalidate:!1})}catch(D){p(D instanceof Error?D.message:String(D))}finally{f(!1)}}}return c.jsxs("div",{className:"space-y-6 max-w-5xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Auth-Rate Based Routing"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure success-rate based gateway routing"})]}),!e&&c.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-800",children:"Set a Merchant ID in the top bar to load and save configuration."}),e&&!g&&c.jsxs(ke,{children:[c.jsxs(Xe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Configuration Status"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(R=h==null?void 0:h.config)!=null&&R.data?"Success Rate routing is configured and active":"No Success Rate configuration found"})]}),c.jsx(_e,{variant:(L=h==null?void 0:h.config)!=null&&L.data?"green":"gray",children:(z=h==null?void 0:h.config)!=null&&z.data?"Active":"Not Configured"})]}),((W=h==null?void 0:h.config)==null?void 0:W.data)&&c.jsxs(Ae,{className:"border-t border-slate-100 dark:border-[#222226]",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Last Modified:"}),c.jsx("span",{className:"ml-1 font-medium",children:h.modified_at?new Date(h.modified_at).toLocaleString():"Unknown"})]}),c.jsxs(Ie,{type:"button",variant:"secondary",size:"sm",onClick:()=>{confirm("Are you sure you want to clear the Success Rate configuration? This will disable SR-based routing.")&&P()},disabled:u,children:[c.jsx(Ca,{size:14,className:"mr-1"}),u?"Clearing...":"Clear Configuration"]})]}),d&&c.jsx("p",{className:"text-xs text-red-500 mt-2",children:d})]})]}),g?c.jsx("div",{className:"flex justify-center py-12",children:c.jsx(mr,{})}):c.jsxs("form",{onSubmit:m(T),className:"space-y-6",children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Default Success Rate Config"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Base settings used when there is no payment-method-specific override."})]})}),c.jsxs(Ae,{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Bucket Size"}),c.jsx("input",{type:"number",...v("defaultBucketSize"),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"}),b.defaultBucketSize&&c.jsx("p",{className:"text-xs text-red-500",children:b.defaultBucketSize.message})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Success Rate"}),c.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",...v("defaultSuccessRate"),placeholder:"0.5",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Hedging %"}),c.jsx("input",{type:"number",step:"0.1",...v("defaultHedgingPercent"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-slate-500",children:"Latency Threshold (ms)"}),c.jsx("input",{type:"number",...v("defaultLatencyThreshold"),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]})]}),c.jsxs(ke,{children:[c.jsxs(Xe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Sub-Level Overrides"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Optional overrides for specific payment method type and method combinations."})]}),c.jsxs(Ie,{type:"button",variant:"secondary",size:"sm",onClick:()=>O({paymentMethodType:"card",paymentMethod:"credit",bucketSize:20,hedgingPercent:null,latencyThreshold:null}),children:[c.jsx(ki,{size:14})," Add Level"]})]}),c.jsx(Ae,{className:"overflow-x-auto p-0",children:_.length?c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-200 dark:border-[#1c1c24] bg-slate-50 dark:bg-[#0a0a0f]",children:[c.jsx("th",{className:"px-4 py-2",children:"Payment Method Type"}),c.jsx("th",{className:"px-4 py-2",children:"Payment Method"}),c.jsx("th",{className:"px-4 py-2",children:"Bucket Size"}),c.jsx("th",{className:"px-4 py-2",children:"Hedging %"}),c.jsx("th",{className:"px-4 py-2",children:"Latency Threshold (ms)"}),c.jsx("th",{className:"px-4 py-2"})]})}),c.jsx("tbody",{children:_.map((D,U)=>{var K;const q=((K=A==null?void 0:A[U])==null?void 0:K.paymentMethodType)||"",J=y4[q]||[];return c.jsxs("tr",{className:"border-b border-slate-200 dark:border-[#1c1c24] hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsx("select",{...v(`subLevelInputConfig.${U}.paymentMethodType`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:m4.map(ae=>c.jsx("option",{value:ae,children:ae},ae))})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("select",{...v(`subLevelInputConfig.${U}.paymentMethod`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(J.length?J:["credit","debit"]).map(ae=>c.jsx("option",{value:ae,children:ae},ae))})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",...v(`subLevelInputConfig.${U}.bucketSize`),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",step:"0.1",...v(`subLevelInputConfig.${U}.hedgingPercent`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-20 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("input",{type:"number",...v(`subLevelInputConfig.${U}.latencyThreshold`),placeholder:"null",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 w-24 focus:outline-none focus:ring-1 focus:ring-brand-500"})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("button",{type:"button",onClick:()=>k(U),className:"text-slate-400 hover:text-red-500",children:c.jsx(Ca,{size:14})})})]},D.id)})})]}):c.jsx("div",{className:"px-4 py-8 text-sm text-slate-500",children:"No sub-level overrides configured. The default row above is the only active configuration."})})]}),c.jsx(Gr,{error:n}),i&&c.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-4 py-3 text-sm text-emerald-400",children:"Configuration saved successfully."}),((V=h==null?void 0:h.config)==null?void 0:V.data)&&c.jsxs(ke,{children:[c.jsxs(Xe,{className:"flex flex-row items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Current Active Configuration"}),c.jsxs(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!s),children:[c.jsx(Nh,{size:14,className:"mr-1"}),s?"Hide":"View"]})]}),s&&c.jsx(Ae,{children:c.jsxs("div",{className:"text-xs text-slate-600 space-y-4",children:[c.jsxs("div",{className:"border-b border-slate-200 dark:border-[#222226] pb-3",children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Default Settings"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultBucketSize})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Success Rate:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultSuccessRate??"Not set"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),c.jsx("p",{className:"font-medium",children:h.config.data.defaultHedgingPercent??"Not set"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),c.jsxs("p",{className:"font-medium",children:[h.config.data.defaultLatencyThreshold??"Not set"," ms"]})]})]})]}),h.config.data.subLevelInputConfig&&h.config.data.subLevelInputConfig.length>0&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Sub-Level Configurations"}),c.jsx("div",{className:"space-y-2",children:h.config.data.subLevelInputConfig.map((D,U)=>c.jsx("div",{className:"bg-slate-50 dark:bg-[#151518] rounded-lg p-3",children:c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Payment Type:"}),c.jsx("p",{className:"font-medium capitalize",children:D.paymentMethodType})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Payment Method:"}),c.jsx("p",{className:"font-medium",children:D.paymentMethod})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Bucket Size:"}),c.jsx("p",{className:"font-medium",children:D.bucketSize})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Hedging %:"}),c.jsx("p",{className:"font-medium",children:D.hedgingPercent??"Default"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Latency Threshold:"}),c.jsxs("p",{className:"font-medium",children:[D.latencyThreshold??"Default"," ms"]})]})]})},U))})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-3",children:[c.jsx("h3",{className:"font-medium text-slate-700 mb-2",children:"Raw Configuration (JSON)"}),c.jsx("pre",{className:"bg-slate-900 dark:bg-[#0f0f11] text-slate-100 border border-transparent dark:border-[#222226] rounded-lg p-3 text-xs overflow-auto max-h-64",children:JSON.stringify(h.config,null,2)})]})]})})]}),c.jsx(Ie,{type:"submit",disabled:t||!e,children:t?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Saving…"]}):"Save Configuration"})]})]})}function b4(){for(var e=arguments.length,t=new Array(e),r=0;rn=>{t.forEach(a=>a(n))},t)}const Ih=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pb(e){return"nodeType"in e}function zr(e){var t,r;return e?bl(e)?e:pb(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function hb(e){const{Document:t}=zr(e);return e instanceof t}function nd(e){return bl(e)?!1:e instanceof zr(e).HTMLElement}function bP(e){return e instanceof zr(e).SVGElement}function wl(e){return e?bl(e)?e.document:pb(e)?hb(e)?e:nd(e)||bP(e)?e.ownerDocument:document:document:document}const ra=Ih?j.useLayoutEffect:j.useEffect;function mb(e){const t=j.useRef(e);return ra(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),a=0;a{e.current=setInterval(n,a)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function cc(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return ra(()=>{r.current!==e&&(r.current=e)},t),r}function ad(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function np(e){const t=mb(e),r=j.useRef(null),n=j.useCallback(a=>{a!==r.current&&(t==null||t(a,r.current)),r.current=a},[]);return[r,n]}function kg(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let _y={};function id(e,t){return j.useMemo(()=>{if(t)return t;const r=_y[e]==null?0:_y[e]+1;return _y[e]=r,e+"-"+r},[e,t])}function wP(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a{const s=Object.entries(o);for(const[l,u]of s){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const js=wP(1),dc=wP(-1);function _4(e){return"clientX"in e&&"clientY"in e}function yb(e){if(!e)return!1;const{KeyboardEvent:t}=zr(e.target);return t&&e instanceof t}function S4(e){if(!e)return!1;const{TouchEvent:t}=zr(e.target);return t&&e instanceof t}function Ag(e){if(S4(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return _4(e)?{x:e.clientX,y:e.clientY}:null}const fc=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[fc.Translate.toString(e),fc.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),z_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function j4(e){return e.matches(z_)?e:e.querySelector(z_)}const O4={display:"none"};function k4(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:O4},r)}function A4(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:a,role:"status","aria-live":n,"aria-atomic":!0},r)}function E4(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const _P=j.createContext(null);function P4(e){const t=j.useContext(_P);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function N4(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.useCallback(n=>{let{type:a,event:i}=n;e.forEach(o=>{var s;return(s=o[a])==null?void 0:s.call(o,i)})},[e]),t]}const C4={draggable:` + To pick up a draggable item, press the space bar. + While dragging, use the arrow keys to move the item. + Press space again to drop the item in its new position, or press escape to cancel. + `},T4={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $4(e){let{announcements:t=T4,container:r,hiddenTextDescribedById:n,screenReaderInstructions:a=C4}=e;const{announce:i,announcement:o}=E4(),s=id("DndLiveRegion"),[l,u]=j.useState(!1);if(j.useEffect(()=>{u(!0)},[]),P4(j.useMemo(()=>({onDragStart(d){let{active:p}=d;i(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:h}=d;t.onDragMove&&i(t.onDragMove({active:p,over:h}))},onDragOver(d){let{active:p,over:h}=d;i(t.onDragOver({active:p,over:h}))},onDragEnd(d){let{active:p,over:h}=d;i(t.onDragEnd({active:p,over:h}))},onDragCancel(d){let{active:p,over:h}=d;i(t.onDragCancel({active:p,over:h}))}}),[i,t])),!l)return null;const f=C.createElement(C.Fragment,null,C.createElement(k4,{id:n,value:a.draggable}),C.createElement(A4,{id:s,announcement:o}));return r?us.createPortal(f,r):f}var Wt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Wt||(Wt={}));function ap(){}function B_(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function I4(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const zn=Object.freeze({x:0,y:0});function SP(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jP(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function R4(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function U_(e){let{left:t,top:r,height:n,width:a}=e;return[{x:t,y:r},{x:t+a,y:r},{x:t,y:r+n},{x:t+a,y:r+n}]}function OP(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function V_(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const M4=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=V_(t,t.left,t.top),i=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=SP(V_(l),a);i.push({id:s,data:{droppableContainer:o,value:u}})}}return i.sort(jP)},D4=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=U_(t),i=[];for(const o of n){const{id:s}=o,l=r.get(s);if(l){const u=U_(l),f=a.reduce((p,h,g)=>p+SP(u[g],h),0),d=Number((f/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:d}})}}return i.sort(jP)};function L4(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=a-n,s=i-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const a=[];for(const i of n){const{id:o}=i,s=r.get(o);if(s){const l=L4(s,t);l>0&&a.push({id:o,data:{droppableContainer:i,value:l}})}}return a.sort(R4)};function z4(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function kP(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zn}function B4(e){return function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i({...o,top:o.top+e*s.y,bottom:o.bottom+e*s.y,left:o.left+e*s.x,right:o.right+e*s.x}),{...r})}}const U4=B4(1);function V4(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function W4(e,t,r){const n=V4(t);if(!n)return e;const{scaleX:a,scaleY:i,x:o,y:s}=n,l=e.left-o-(1-a)*parseFloat(r),u=e.top-s-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),f=a?e.width/a:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const H4={ignoreTransform:!1};function _l(e,t){t===void 0&&(t=H4);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=zr(e).getComputedStyle(e);u&&(r=W4(r,u,f))}const{top:n,left:a,width:i,height:o,bottom:s,right:l}=r;return{top:n,left:a,width:i,height:o,bottom:s,right:l}}function W_(e){return _l(e,{ignoreTransform:!0})}function G4(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function q4(e,t){return t===void 0&&(t=zr(e).getComputedStyle(e)),t.position==="fixed"}function K4(e,t){t===void 0&&(t=zr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const i=t[a];return typeof i=="string"?r.test(i):!1})}function Rh(e,t){const r=[];function n(a){if(t!=null&&r.length>=t||!a)return r;if(hb(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!nd(a)||bP(a)||r.includes(a))return r;const i=zr(e).getComputedStyle(a);return a!==e&&K4(a,i)&&r.push(a),q4(a,i)?r:n(a.parentNode)}return e?n(e):r}function AP(e){const[t]=Rh(e,1);return t??null}function Sy(e){return!Ih||!e?null:bl(e)?e:pb(e)?hb(e)||e===wl(e).scrollingElement?window:nd(e)?e:null:null}function EP(e){return bl(e)?e.scrollX:e.scrollLeft}function PP(e){return bl(e)?e.scrollY:e.scrollTop}function Eg(e){return{x:EP(e),y:PP(e)}}var tr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tr||(tr={}));function NP(e){return!Ih||!e?!1:e===document.scrollingElement}function CP(e){const t={x:0,y:0},r=NP(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},a=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:a,isLeft:i,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const X4={x:.2,y:.2};function Y4(e,t,r,n,a){let{top:i,left:o,right:s,bottom:l}=r;n===void 0&&(n=10),a===void 0&&(a=X4);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=CP(e),h={x:0,y:0},g={x:0,y:0},y={height:t.height*a.y,width:t.width*a.x};return!u&&i<=t.top+y.height?(h.y=tr.Backward,g.y=n*Math.abs((t.top+y.height-i)/y.height)):!f&&l>=t.bottom-y.height&&(h.y=tr.Forward,g.y=n*Math.abs((t.bottom-y.height-l)/y.height)),!p&&s>=t.right-y.width?(h.x=tr.Forward,g.x=n*Math.abs((t.right-y.width-s)/y.width)):!d&&o<=t.left+y.width&&(h.x=tr.Backward,g.x=n*Math.abs((t.left+y.width-o)/y.width)),{direction:h,speed:g}}function Z4(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:r,right:n,bottom:a}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:a,width:e.clientWidth,height:e.clientHeight}}function TP(e){return e.reduce((t,r)=>js(t,Eg(r)),zn)}function Q4(e){return e.reduce((t,r)=>t+EP(r),0)}function J4(e){return e.reduce((t,r)=>t+PP(r),0)}function e5(e,t){if(t===void 0&&(t=_l),!e)return;const{top:r,left:n,bottom:a,right:i}=t(e);AP(e)&&(a<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const t5=[["x",["left","right"],Q4],["y",["top","bottom"],J4]];class vb{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Rh(r),a=TP(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,s]of t5)for(const l of o)Object.defineProperty(this,l,{get:()=>{const u=s(n),f=a[i]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Tu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var a;(a=this.target)==null||a.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function r5(e){const{EventTarget:t}=zr(e);return e instanceof t?e:wl(e)}function jy(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var cn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(cn||(cn={}));function H_(e){e.preventDefault()}function n5(e){e.stopPropagation()}var Ke;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ke||(Ke={}));const $P={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},a5=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ke.Right:return{...r,x:r.x+25};case Ke.Left:return{...r,x:r.x-25};case Ke.Down:return{...r,y:r.y+25};case Ke.Up:return{...r,y:r.y-25}}};class gb{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Tu(wl(r)),this.windowListeners=new Tu(zr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(cn.Resize,this.handleCancel),this.windowListeners.add(cn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(cn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&e5(n),r(zn)}handleKeyDown(t){if(yb(t)){const{active:r,context:n,options:a}=this.props,{keyboardCodes:i=$P,coordinateGetter:o=a5,scrollBehavior:s="smooth"}=a,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,f=u?{x:u.left,y:u.top}:zn;this.referenceCoordinates||(this.referenceCoordinates=f);const d=o(t,{active:r,context:n.current,currentCoordinates:f});if(d){const p=dc(d,f),h={x:0,y:0},{scrollableAncestors:g}=n.current;for(const y of g){const v=t.code,{isTop:x,isRight:m,isLeft:w,isBottom:S,maxScroll:b,minScroll:_}=CP(y),O=Z4(y),k={x:Math.min(v===Ke.Right?O.right-O.width/2:O.right,Math.max(v===Ke.Right?O.left:O.left+O.width/2,d.x)),y:Math.min(v===Ke.Down?O.bottom-O.height/2:O.bottom,Math.max(v===Ke.Down?O.top:O.top+O.height/2,d.y))},A=v===Ke.Right&&!m||v===Ke.Left&&!w,$=v===Ke.Down&&!S||v===Ke.Up&&!x;if(A&&k.x!==d.x){const T=y.scrollLeft+p.x,P=v===Ke.Right&&T<=b.x||v===Ke.Left&&T>=_.x;if(P&&!p.y){y.scrollTo({left:T,behavior:s});return}P?h.x=y.scrollLeft-T:h.x=v===Ke.Right?y.scrollLeft-b.x:y.scrollLeft-_.x,h.x&&y.scrollBy({left:-h.x,behavior:s});break}else if($&&k.y!==d.y){const T=y.scrollTop+p.y,P=v===Ke.Down&&T<=b.y||v===Ke.Up&&T>=_.y;if(P&&!p.x){y.scrollTo({top:T,behavior:s});return}P?h.y=y.scrollTop-T:h.y=v===Ke.Down?y.scrollTop-b.y:y.scrollTop-_.y,h.y&&y.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,js(dc(d,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}gb.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=$P,onActivation:a}=t,{active:i}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const s=i.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function G_(e){return!!(e&&"distance"in e)}function q_(e){return!!(e&&"delay"in e)}class xb{constructor(t,r,n){var a;n===void 0&&(n=r5(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:o}=i;this.props=t,this.events=r,this.document=wl(o),this.documentListeners=new Tu(this.document),this.listeners=new Tu(n),this.windowListeners=new Tu(zr(o)),this.initialCoordinates=(a=Ag(i))!=null?a:zn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(cn.Resize,this.handleCancel),this.windowListeners.add(cn.DragStart,H_),this.windowListeners.add(cn.VisibilityChange,this.handleCancel),this.windowListeners.add(cn.ContextMenu,H_),this.documentListeners.add(cn.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(q_(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(G_(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:a}=this.props;a(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(cn.Click,n5,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(cn.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:a,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!a)return;const l=(r=Ag(t))!=null?r:zn,u=dc(a,l);if(!n&&s){if(G_(s)){if(s.tolerance!=null&&jy(u,s.tolerance))return this.handleCancel();if(jy(u,s.distance))return this.handleStart()}if(q_(s)&&jy(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const i5={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class bb extends xb{constructor(t){const{event:r}=t,n=wl(r.target);super(t,i5,n)}}bb.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const o5={move:{name:"mousemove"},end:{name:"mouseup"}};var Pg;(function(e){e[e.RightClick=2]="RightClick"})(Pg||(Pg={}));class s5 extends xb{constructor(t){super(t,o5,wl(t.event.target))}}s5.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Pg.RightClick?!1:(n==null||n({event:r}),!0)}}];const Oy={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class l5 extends xb{constructor(t){super(t,Oy)}static setup(){return window.addEventListener(Oy.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Oy.move.name,t)};function t(){}}}l5.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:a}=r;return a.length>1?!1:(n==null||n({event:r}),!0)}}];var $u;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})($u||($u={}));var ip;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ip||(ip={}));function u5(e){let{acceleration:t,activator:r=$u.Pointer,canScroll:n,draggingRect:a,enabled:i,interval:o=5,order:s=ip.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const h=d5({delta:d,disabled:!i}),[g,y]=w4(),v=j.useRef({x:0,y:0}),x=j.useRef({x:0,y:0}),m=j.useMemo(()=>{switch(r){case $u.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case $u.DraggableRect:return a}},[r,a,l]),w=j.useRef(null),S=j.useCallback(()=>{const _=w.current;if(!_)return;const O=v.current.x*x.current.x,k=v.current.y*x.current.y;_.scrollBy(O,k)},[]),b=j.useMemo(()=>s===ip.TreeOrder?[...u].reverse():u,[s,u]);j.useEffect(()=>{if(!i||!u.length||!m){y();return}for(const _ of b){if((n==null?void 0:n(_))===!1)continue;const O=u.indexOf(_),k=f[O];if(!k)continue;const{direction:A,speed:$}=Y4(_,k,m,t,p);for(const T of["x","y"])h[T][A[T]]||($[T]=0,A[T]=0);if($.x>0||$.y>0){y(),w.current=_,g(S,o),v.current=$,x.current=A;return}}v.current={x:0,y:0},x.current={x:0,y:0},y()},[t,S,n,y,i,o,JSON.stringify(m),JSON.stringify(h),g,u,b,f,JSON.stringify(p)])}const c5={x:{[tr.Backward]:!1,[tr.Forward]:!1},y:{[tr.Backward]:!1,[tr.Forward]:!1}};function d5(e){let{delta:t,disabled:r}=e;const n=kg(t);return ad(a=>{if(r||!n||!a)return c5;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[tr.Backward]:a.x[tr.Backward]||i.x===-1,[tr.Forward]:a.x[tr.Forward]||i.x===1},y:{[tr.Backward]:a.y[tr.Backward]||i.y===-1,[tr.Forward]:a.y[tr.Forward]||i.y===1}}},[r,t,n])}function f5(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return ad(a=>{var i;return t==null?null:(i=n??a)!=null?i:null},[n,t])}function p5(e,t){return j.useMemo(()=>e.reduce((r,n)=>{const{sensor:a}=n,i=a.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...i]},[]),[e,t])}var pc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(pc||(pc={}));var Ng;(function(e){e.Optimized="optimized"})(Ng||(Ng={}));const K_=new Map;function h5(e,t){let{dragging:r,dependencies:n,config:a}=t;const[i,o]=j.useState(null),{frequency:s,measure:l,strategy:u}=a,f=j.useRef(e),d=v(),p=cc(d),h=j.useCallback(function(x){x===void 0&&(x=[]),!p.current&&o(m=>m===null?x:m.concat(x.filter(w=>!m.includes(w))))},[p]),g=j.useRef(null),y=ad(x=>{if(d&&!r)return K_;if(!x||x===K_||f.current!==e||i!=null){const m=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){m.set(w.id,w.rect.current);continue}const S=w.node.current,b=S?new vb(l(S),S):null;w.rect.current=b,b&&m.set(w.id,b)}return m}return x},[e,i,r,d,l]);return j.useEffect(()=>{f.current=e},[e]),j.useEffect(()=>{d||h()},[r,d]),j.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),j.useEffect(()=>{d||typeof s!="number"||g.current!==null||(g.current=setTimeout(()=>{h(),g.current=null},s))},[s,d,h,...n]),{droppableRects:y,measureDroppableContainers:h,measuringScheduled:i!=null};function v(){switch(u){case pc.Always:return!1;case pc.BeforeDragging:return r;default:return!r}}}function IP(e,t){return ad(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function m5(e,t){return IP(e,t)}function y5(e){let{callback:t,disabled:r}=e;const n=mb(t),a=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return j.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Mh(e){let{callback:t,disabled:r}=e;const n=mb(t),a=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return j.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function v5(e){return new vb(_l(e),e)}function X_(e,t,r){t===void 0&&(t=v5);const[n,a]=j.useState(null);function i(){a(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=y5({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),s=Mh({callback:i});return ra(()=>{i(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),n}function g5(e){const t=IP(e);return kP(e,t)}const Y_=[];function x5(e){const t=j.useRef(e),r=ad(n=>e?n&&n!==Y_&&e&&t.current&&e.parentNode===t.current.parentNode?n:Rh(e):Y_,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function b5(e){const[t,r]=j.useState(null),n=j.useRef(e),a=j.useCallback(i=>{const o=Sy(i.target);o&&r(s=>s?(s.set(o,Eg(o)),new Map(s)):null)},[]);return j.useEffect(()=>{const i=n.current;if(e!==i){o(i);const s=e.map(l=>{const u=Sy(l);return u?(u.addEventListener("scroll",a,{passive:!0}),[u,Eg(u)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{o(e),o(i)};function o(s){s.forEach(l=>{const u=Sy(l);u==null||u.removeEventListener("scroll",a)})}},[a,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>js(i,o),zn):TP(e):zn,[e,t])}function Z_(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==zn;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?dc(e,r.current):zn}function w5(e){j.useEffect(()=>{if(!Ih)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function _5(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:a,handler:i}=n;return r[a]=o=>{i(o,t)},r},{}),[e,t])}function RP(e){return j.useMemo(()=>e?G4(e):null,[e])}const Q_=[];function S5(e,t){t===void 0&&(t=_l);const[r]=e,n=RP(r?zr(r):null),[a,i]=j.useState(Q_);function o(){i(()=>e.length?e.map(l=>NP(l)?n:new vb(t(l),l)):Q_)}const s=Mh({callback:o});return ra(()=>{s==null||s.disconnect(),o(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),a}function j5(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return nd(t)?t:e}function O5(e){let{measure:t}=e;const[r,n]=j.useState(null),a=j.useCallback(u=>{for(const{target:f}of u)if(nd(f)){n(d=>{const p=t(f);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),i=Mh({callback:a}),o=j.useCallback(u=>{const f=j5(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),n(f?t(f):null)},[t,i]),[s,l]=np(o);return j.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const k5=[{sensor:bb,options:{}},{sensor:gb,options:{}}],A5={current:{}},gf={draggable:{measure:W_},droppable:{measure:W_,strategy:pc.WhileDragging,frequency:Ng.Optimized},dragOverlay:{measure:_l}};class Iu extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const E5={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Iu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ap},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:gf,measureDroppableContainers:ap,windowRect:null,measuringScheduled:!1},P5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ap,draggableNodes:new Map,over:null,measureDroppableContainers:ap},Dh=j.createContext(P5),MP=j.createContext(E5);function N5(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Iu}}}function C5(e,t){switch(t.type){case Wt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Wt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Wt.DragEnd:case Wt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wt.RegisterDroppable:{const{element:r}=t,{id:n}=r,a=new Iu(e.droppable.containers);return a.set(n,r),{...e,droppable:{...e.droppable,containers:a}}}case Wt.SetDroppableDisabled:{const{id:r,key:n,disabled:a}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new Iu(e.droppable.containers);return o.set(r,{...i,disabled:a}),{...e,droppable:{...e.droppable,containers:o}}}case Wt.UnregisterDroppable:{const{id:r,key:n}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new Iu(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function T5(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:a}=j.useContext(Dh),i=kg(n),o=kg(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&i&&o!=null){if(!yb(i)||document.activeElement===i.target)return;const s=a.get(o);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=j4(f);if(d){d.focus();break}}})}},[n,t,a,o,i]),null}function $5(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((a,i)=>i({transform:a,...n}),r):r}function I5(e){return j.useMemo(()=>({draggable:{...gf.draggable,...e==null?void 0:e.draggable},droppable:{...gf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...gf.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function R5(e){let{activeNode:t,measure:r,initialRect:n,config:a=!0}=e;const i=j.useRef(!1),{x:o,y:s}=typeof a=="boolean"?{x:a,y:a}:a;ra(()=>{if(!o&&!s||!t){i.current=!1;return}if(i.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=r(u),d=kP(f,n);if(o||(d.x=0),s||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=AP(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,o,s,n,r])}const DP=j.createContext({...zn,scaleX:1,scaleY:1});var ti;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ti||(ti={}));const M5=j.memo(function(t){var r,n,a,i;let{id:o,accessibility:s,autoScroll:l=!0,children:u,sensors:f=k5,collisionDetection:d=F4,measuring:p,modifiers:h,...g}=t;const y=j.useReducer(C5,void 0,N5),[v,x]=y,[m,w]=N4(),[S,b]=j.useState(ti.Uninitialized),_=S===ti.Initialized,{draggable:{active:O,nodes:k,translate:A},droppable:{containers:$}}=v,T=O!=null?k.get(O):null,P=j.useRef({initial:null,translated:null}),R=j.useMemo(()=>{var Yt;return O!=null?{id:O,data:(Yt=T==null?void 0:T.data)!=null?Yt:A5,rect:P}:null},[O,T]),L=j.useRef(null),[z,W]=j.useState(null),[V,D]=j.useState(null),U=cc(g,Object.values(g)),q=id("DndDescribedBy",o),J=j.useMemo(()=>$.getEnabled(),[$]),K=I5(p),{droppableRects:ae,measureDroppableContainers:Q,measuringScheduled:be}=h5(J,{dragging:_,dependencies:[A.x,A.y],config:K.droppable}),ue=f5(k,O),Ce=j.useMemo(()=>V?Ag(V):null,[V]),Fe=Fo(),te=m5(ue,K.draggable.measure);R5({activeNode:O!=null?k.get(O):null,config:Fe.layoutShiftCompensation,initialRect:te,measure:K.draggable.measure});const ie=X_(ue,K.draggable.measure,te),he=X_(ue?ue.parentElement:null),X=j.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ee=$.getNodeFor((r=X.current.over)==null?void 0:r.id),ve=O5({measure:K.dragOverlay.measure}),Pe=(n=ve.nodeRef.current)!=null?n:ue,ze=_?(a=ve.rect)!=null?a:ie:null,ge=!!(ve.nodeRef.current&&ve.rect),$e=g5(ge?null:ie),Le=RP(Pe?zr(Pe):null),Oe=x5(_?Ee??ue:null),Ge=S5(Oe),H=$5(h,{transform:{x:A.x-$e.x,y:A.y-$e.y,scaleX:1,scaleY:1},activatorEvent:V,active:R,activeNodeRect:ie,containerNodeRect:he,draggingNodeRect:ze,over:X.current.over,overlayNodeRect:ve.rect,scrollableAncestors:Oe,scrollableAncestorRects:Ge,windowRect:Le}),E=Ce?js(Ce,A):null,M=b5(Oe),N=Z_(M),B=Z_(M,[ie]),G=js(H,N),ee=ze?U4(ze,H):null,Z=R&&ee?d({active:R,collisionRect:ee,droppableRects:ae,droppableContainers:J,pointerCoordinates:E}):null,me=OP(Z,"id"),[Te,Et]=j.useState(null),Tt=ge?H:js(H,B),Xt=z4(Tt,(i=Te==null?void 0:Te.rect)!=null?i:null,ie),zi=j.useRef(null),Wa=j.useCallback((Yt,Zt)=>{let{sensor:cr,options:jn}=Zt;if(L.current==null)return;const Nr=k.get(L.current);if(!Nr)return;const ut=Yt.nativeEvent,Ue=new cr({active:L.current,activeNode:Nr,event:ut,options:jn,context:X,onAbort(ot){if(!k.get(ot))return;const{onDragAbort:Ve}=U.current,rn={id:ot};Ve==null||Ve(rn),m({type:"onDragAbort",event:rn})},onPending(ot,Pt,Ve,rn){if(!k.get(ot))return;const{onDragPending:Ha}=U.current,On={id:ot,constraint:Pt,initialCoordinates:Ve,offset:rn};Ha==null||Ha(On),m({type:"onDragPending",event:On})},onStart(ot){const Pt=L.current;if(Pt==null)return;const Ve=k.get(Pt);if(!Ve)return;const{onDragStart:rn}=U.current,nn={activatorEvent:ut,active:{id:Pt,data:Ve.data,rect:P}};us.unstable_batchedUpdates(()=>{rn==null||rn(nn),b(ti.Initializing),x({type:Wt.DragStart,initialCoordinates:ot,active:Pt}),m({type:"onDragStart",event:nn}),W(zi.current),D(ut)})},onMove(ot){x({type:Wt.DragMove,coordinates:ot})},onEnd:la(Wt.DragEnd),onCancel:la(Wt.DragCancel)});zi.current=Ue;function la(ot){return async function(){const{active:Ve,collisions:rn,over:nn,scrollAdjustedTranslate:Ha}=X.current;let On=null;if(Ve&&Ha){const{cancelDrop:Ga}=U.current;On={activatorEvent:ut,active:Ve,collisions:rn,delta:Ha,over:nn},ot===Wt.DragEnd&&typeof Ga=="function"&&await Promise.resolve(Ga(On))&&(ot=Wt.DragCancel)}L.current=null,us.unstable_batchedUpdates(()=>{x({type:ot}),b(ti.Uninitialized),Et(null),W(null),D(null),zi.current=null;const Ga=ot===Wt.DragEnd?"onDragEnd":"onDragCancel";if(On){const zo=U.current[Ga];zo==null||zo(On),m({type:Ga,event:On})}})}}},[k]),Bi=j.useCallback((Yt,Zt)=>(cr,jn)=>{const Nr=cr.nativeEvent,ut=k.get(jn);if(L.current!==null||!ut||Nr.dndKit||Nr.defaultPrevented)return;const Ue={active:ut};Yt(cr,Zt.options,Ue)===!0&&(Nr.dndKit={capturedBy:Zt.sensor},L.current=jn,Wa(cr,Zt))},[k,Wa]),Ui=p5(f,Bi);w5(f),ra(()=>{ie&&S===ti.Initializing&&b(ti.Initialized)},[ie,S]),j.useEffect(()=>{const{onDragMove:Yt}=U.current,{active:Zt,activatorEvent:cr,collisions:jn,over:Nr}=X.current;if(!Zt||!cr)return;const ut={active:Zt,activatorEvent:cr,collisions:jn,delta:{x:G.x,y:G.y},over:Nr};us.unstable_batchedUpdates(()=>{Yt==null||Yt(ut),m({type:"onDragMove",event:ut})})},[G.x,G.y]),j.useEffect(()=>{const{active:Yt,activatorEvent:Zt,collisions:cr,droppableContainers:jn,scrollAdjustedTranslate:Nr}=X.current;if(!Yt||L.current==null||!Zt||!Nr)return;const{onDragOver:ut}=U.current,Ue=jn.get(me),la=Ue&&Ue.rect.current?{id:Ue.id,rect:Ue.rect.current,data:Ue.data,disabled:Ue.disabled}:null,ot={active:Yt,activatorEvent:Zt,collisions:cr,delta:{x:Nr.x,y:Nr.y},over:la};us.unstable_batchedUpdates(()=>{Et(la),ut==null||ut(ot),m({type:"onDragOver",event:ot})})},[me]),ra(()=>{X.current={activatorEvent:V,active:R,activeNode:ue,collisionRect:ee,collisions:Z,droppableRects:ae,draggableNodes:k,draggingNode:Pe,draggingNodeRect:ze,droppableContainers:$,over:Te,scrollableAncestors:Oe,scrollAdjustedTranslate:G},P.current={initial:ze,translated:ee}},[R,ue,Z,ee,k,Pe,ze,ae,$,Te,Oe,G]),u5({...Fe,delta:A,draggingRect:ee,pointerCoordinates:E,scrollableAncestors:Oe,scrollableAncestorRects:Ge});const Vi=j.useMemo(()=>({active:R,activeNode:ue,activeNodeRect:ie,activatorEvent:V,collisions:Z,containerNodeRect:he,dragOverlay:ve,draggableNodes:k,droppableContainers:$,droppableRects:ae,over:Te,measureDroppableContainers:Q,scrollableAncestors:Oe,scrollableAncestorRects:Ge,measuringConfiguration:K,measuringScheduled:be,windowRect:Le}),[R,ue,ie,V,Z,he,ve,k,$,ae,Te,Q,Oe,Ge,K,be,Le]),Ml=j.useMemo(()=>({activatorEvent:V,activators:Ui,active:R,activeNodeRect:ie,ariaDescribedById:{draggable:q},dispatch:x,draggableNodes:k,over:Te,measureDroppableContainers:Q}),[V,Ui,R,ie,x,q,k,Te,Q]);return C.createElement(_P.Provider,{value:w},C.createElement(Dh.Provider,{value:Ml},C.createElement(MP.Provider,{value:Vi},C.createElement(DP.Provider,{value:Xt},u)),C.createElement(T5,{disabled:(s==null?void 0:s.restoreFocus)===!1})),C.createElement($4,{...s,hiddenTextDescribedById:q}));function Fo(){const Yt=(z==null?void 0:z.autoScrollEnabled)===!1,Zt=typeof l=="object"?l.enabled===!1:l===!1,cr=_&&!Yt&&!Zt;return typeof l=="object"?{...l,enabled:cr}:{enabled:cr}}}),D5=j.createContext(null),J_="button",L5="Draggable";function F5(e){let{id:t,data:r,disabled:n=!1,attributes:a}=e;const i=id(L5),{activators:o,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=j.useContext(Dh),{role:h=J_,roleDescription:g="draggable",tabIndex:y=0}=a??{},v=(l==null?void 0:l.id)===t,x=j.useContext(v?DP:D5),[m,w]=np(),[S,b]=np(),_=_5(o,t),O=cc(r);ra(()=>(d.set(t,{id:t,key:i,node:m,activatorNode:S,data:O}),()=>{const A=d.get(t);A&&A.key===i&&d.delete(t)}),[d,t]);const k=j.useMemo(()=>({role:h,tabIndex:y,"aria-disabled":n,"aria-pressed":v&&h===J_?!0:void 0,"aria-roledescription":g,"aria-describedby":f.draggable}),[n,h,y,v,g,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:k,isDragging:v,listeners:n?void 0:_,node:m,over:p,setNodeRef:w,setActivatorNodeRef:b,transform:x}}function z5(){return j.useContext(MP)}const B5="Droppable",U5={timeout:25};function V5(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:a}=e;const i=id(B5),{active:o,dispatch:s,over:l,measureDroppableContainers:u}=j.useContext(Dh),f=j.useRef({disabled:r}),d=j.useRef(!1),p=j.useRef(null),h=j.useRef(null),{disabled:g,updateMeasurementsFor:y,timeout:v}={...U5,...a},x=cc(y??n),m=j.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(x.current)?x.current:[x.current]),h.current=null},v)},[v]),w=Mh({callback:m,disabled:g||!o}),S=j.useCallback((k,A)=>{w&&(A&&(w.unobserve(A),d.current=!1),k&&w.observe(k))},[w]),[b,_]=np(S),O=cc(t);return j.useEffect(()=>{!w||!b.current||(w.disconnect(),d.current=!1,w.observe(b.current))},[b,w]),j.useEffect(()=>(s({type:Wt.RegisterDroppable,element:{id:n,key:i,disabled:r,node:b,rect:p,data:O}}),()=>s({type:Wt.UnregisterDroppable,key:i,id:n})),[n]),j.useEffect(()=>{r!==f.current.disabled&&(s({type:Wt.SetDroppableDisabled,id:n,key:i,disabled:r}),f.current.disabled=r)},[n,i,r,s]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===n,node:b,over:l,setNodeRef:_}}function wb(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function W5(e,t){return e.reduce((r,n,a)=>{const i=t.get(n);return i&&(r[a]=i),r},Array(e.length))}function Md(e){return e!==null&&e>=0}function H5(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:a}=e;const i=wb(t,n,r),o=t[a],s=i[a];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Dd={scaleX:1,scaleY:1},q5=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:a,rects:i,overIndex:o}=e;const s=(t=i[r])!=null?t:n;if(!s)return null;if(a===r){const u=i[o];return u?{x:0,y:rr&&a<=o?{x:0,y:-s.height-l,...Dd}:a=o?{x:0,y:s.height+l,...Dd}:{x:0,y:0,...Dd}};function K5(e,t,r){const n=e[t],a=e[t-1],i=e[t+1];return n?rn.map(_=>typeof _=="object"&&"id"in _?_.id:_),[n]),g=o!=null,y=o?h.indexOf(o.id):-1,v=u?h.indexOf(u.id):-1,x=j.useRef(h),m=!H5(h,x.current),w=v!==-1&&y===-1||m,S=G5(i);ra(()=>{m&&g&&f(h)},[m,h,g,f]),j.useEffect(()=>{x.current=h},[h]);const b=j.useMemo(()=>({activeIndex:y,containerId:d,disabled:S,disableTransforms:w,items:h,overIndex:v,useDragOverlay:p,sortedRects:W5(h,l),strategy:a}),[y,d,S.draggable,S.droppable,w,h,v,l,p,a]);return C.createElement(zP.Provider,{value:b},t)}const Y5=e=>{let{id:t,items:r,activeIndex:n,overIndex:a}=e;return wb(r,n,a).indexOf(t)},Z5=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:a,items:i,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!n||s!==i&&a===o?!1:r?!0:o!==a&&t===l},Q5={duration:200,easing:"ease"},BP="transform",J5=fc.Transition.toString({property:BP,duration:0,easing:"linear"}),eF={roleDescription:"sortable"};function tF(e){let{disabled:t,index:r,node:n,rect:a}=e;const[i,o]=j.useState(null),s=j.useRef(r);return ra(()=>{if(!t&&r!==s.current&&n.current){const l=a.current;if(l){const u=_l(n.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&o(f)}}r!==s.current&&(s.current=r)},[t,r,n,a]),j.useEffect(()=>{i&&o(null)},[i]),i}function rF(e){let{animateLayoutChanges:t=Z5,attributes:r,disabled:n,data:a,getNewIndex:i=Y5,id:o,strategy:s,resizeObserverConfig:l,transition:u=Q5}=e;const{items:f,containerId:d,activeIndex:p,disabled:h,disableTransforms:g,sortedRects:y,overIndex:v,useDragOverlay:x,strategy:m}=j.useContext(zP),w=nF(n,h),S=f.indexOf(o),b=j.useMemo(()=>({sortable:{containerId:d,index:S,items:f},...a}),[d,a,S,f]),_=j.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:O,node:k,isOver:A,setNodeRef:$}=V5({id:o,data:b,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...l}}),{active:T,activatorEvent:P,activeNodeRect:R,attributes:L,setNodeRef:z,listeners:W,isDragging:V,over:D,setActivatorNodeRef:U,transform:q}=F5({id:o,data:b,attributes:{...eF,...r},disabled:w.draggable}),J=b4($,z),K=!!T,ae=K&&!g&&Md(p)&&Md(v),Q=!x&&V,be=Q&&ae?q:null,Ce=ae?be??(s??m)({rects:y,activeNodeRect:R,activeIndex:p,overIndex:v,index:S}):null,Fe=Md(p)&&Md(v)?i({id:o,items:f,activeIndex:p,overIndex:v}):S,te=T==null?void 0:T.id,ie=j.useRef({activeId:te,items:f,newIndex:Fe,containerId:d}),he=f!==ie.current.items,X=t({active:T,containerId:d,isDragging:V,isSorting:K,id:o,index:S,items:f,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:u,wasDragging:ie.current.activeId!=null}),Ee=tF({disabled:!X,index:S,node:k,rect:O});return j.useEffect(()=>{K&&ie.current.newIndex!==Fe&&(ie.current.newIndex=Fe),d!==ie.current.containerId&&(ie.current.containerId=d),f!==ie.current.items&&(ie.current.items=f)},[K,Fe,d,f]),j.useEffect(()=>{if(te===ie.current.activeId)return;if(te&&!ie.current.activeId){ie.current.activeId=te;return}const Pe=setTimeout(()=>{ie.current.activeId=te},50);return()=>clearTimeout(Pe)},[te]),{active:T,activeIndex:p,attributes:L,data:b,rect:O,index:S,newIndex:Fe,items:f,isOver:A,isSorting:K,isDragging:V,listeners:W,node:k,overIndex:v,over:D,setNodeRef:J,setActivatorNodeRef:U,setDroppableNodeRef:$,setDraggableNodeRef:z,transform:Ee??Ce,transition:ve()};function ve(){if(Ee||he&&ie.current.newIndex===S)return J5;if(!(Q&&!yb(P)||!u)&&(K||X))return fc.Transition.toString({...u,property:BP})}}function nF(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function op(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const aF=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],iF=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:a,droppableContainers:i,over:o,scrollableAncestors:s}}=t;if(aF.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=a.get(d.id);if(p)switch(e.code){case Ke.Down:n.topp.top&&l.push(d);break;case Ke.Left:n.left>p.left&&l.push(d);break;case Ke.Right:n.left1&&(f=u[1].id),f!=null){const d=i.get(r.id),p=i.get(f),h=p?a.get(p.id):null,g=p==null?void 0:p.node.current;if(g&&h&&d&&p){const v=Rh(g).some((_,O)=>s[O]!==_),x=UP(d,p),m=oF(d,p),w=v||!x?{x:0,y:0}:{x:m?n.width-h.width:0,y:m?n.height-h.height:0},S={x:h.left,y:h.top};return w.x&&w.y?S:dc(S,w)}}}};function UP(e,t){return!op(e)||!op(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function oF(e,t){return!op(e)||!op(t)||!UP(e,t)?!1:e.data.current.sortable.index{if(!a||typeof a!="object")return{};const i=a.keys;return i&&typeof i=="object"?i:a},r={...t(e.keys),...t((n=e.routing_config)==null?void 0:n.keys)};return Object.keys(r).length===0?[]:Object.entries(r).map(([a,i])=>{const o=(i.type||i.data_type||"str_value").toString().toLowerCase(),s={key:a,type:o};return i.values&&(s.values=Array.isArray(i.values)?i.values.map(l=>l.trim()):i.values.split(",").map(l=>l.trim())),i.min_value!==void 0&&(s.min_value=i.min_value),i.max_value!==void 0&&(s.max_value=i.max_value),i.min_length!==void 0&&(s.min_length=i.min_length),i.max_length!==void 0&&(s.max_length=i.max_length),i.exact_length!==void 0&&(s.exact_length=i.exact_length),i.regex&&(s.regex=i.regex),s})}function VP(){const{data:e,error:t,isLoading:r}=ar("/config/routing-keys",wi,{refreshInterval:0,revalidateOnFocus:!1}),n=sF(e||null),a=n.reduce((o,s)=>(o[s.key]=s,o),{}),i={};return n.forEach(o=>{i[o.key]={type:o.type,values:o.values||[]}}),{config:e,keys:n,keysByName:a,routingKeysConfig:i,isLoading:r,error:t,getKeyValues:o=>{var s;return((s=a[o])==null?void 0:s.values)||[]},isIntegerKey:o=>{var s;return((s=a[o])==null?void 0:s.type)==="integer"},isEnumKey:o=>{var s;return((s=a[o])==null?void 0:s.type)==="enum"}}}const lF={"==":"equal","!=":"not_equal",">":"greater_than","<":"less_than",">=":"greater_than_equal","<=":"less_than_equal"};function uF({id:e,name:t,onRemove:r}){const{attributes:n,listeners:a,setNodeRef:i,transform:o,transition:s}=rF({id:e}),l={transform:fc.Transform.toString(o),transition:s};return c.jsxs("div",{ref:i,style:l,className:"flex items-center gap-2 bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] rounded-lg px-2 py-1.5",children:[c.jsx("span",{...n,...a,className:"cursor-grab text-slate-400",children:c.jsx(FD,{size:14})}),c.jsx("span",{className:"text-sm flex-1 font-mono",children:t}),c.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:c.jsx(Ca,{size:12})})]})}function WP({gateways:e,onChange:t}){const[r,n]=j.useState(""),[a,i]=j.useState(""),o=I4(B_(bb),B_(gb,{coordinateGetter:iF}));function s(u){const{active:f,over:d}=u;if(d&&f.id!==d.id){const p=e.findIndex(g=>g.id===f.id),h=e.findIndex(g=>g.id===d.id);t(wb(e,p,h))}}function l(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:a.trim()}]),n(""),i(""))}return c.jsxs("div",{className:"space-y-2",children:[c.jsx(M5,{sensors:o,collisionDetection:M4,onDragEnd:s,children:c.jsx(X5,{items:e.map(u=>u.id),strategy:q5,children:e.map((u,f)=>c.jsx(uF,{id:u.id,name:`${f+1}. ${u.gatewayName}${u.gatewayId?` (${u.gatewayId})`:""}`,onRemove:()=>t(e.filter(d=>d.id!==u.id))},u.id))})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{value:a,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&(u.preventDefault(),l()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsxs(Ie,{type:"button",size:"sm",variant:"secondary",onClick:l,children:[c.jsx(ki,{size:13})," Add"]})]})]})}function HP({gateways:e,onChange:t}){const[r,n]=j.useState(""),[a,i]=j.useState(""),o=e.reduce((l,u)=>l+u.split,0);function s(){r.trim()&&(t([...e,{id:crypto.randomUUID(),gatewayName:r.trim(),gatewayId:a.trim(),split:0}]),n(""),i(""))}return c.jsxs("div",{className:"space-y-2",children:[e.map(l=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:l.gatewayName,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayName:u.target.value}:f)),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-32 focus:outline-none"}),c.jsx("input",{value:l.gatewayId,onChange:u=>t(e.map(f=>f.id===l.id?{...f,gatewayId:u.target.value}:f)),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-28 focus:outline-none"}),c.jsx("input",{type:"range",min:0,max:100,value:l.split,onChange:u=>t(e.map(f=>f.id===l.id?{...f,split:Number(u.target.value)}:f)),className:"flex-1 accent-brand-500"}),c.jsxs("span",{className:"text-sm w-10 text-right",children:[l.split,"%"]}),c.jsx("button",{type:"button",onClick:()=>t(e.filter(u=>u.id!==l.id)),className:"text-red-400 hover:text-red-600",children:c.jsx(Ca,{size:12})})]},l.id)),c.jsxs("div",{className:`text-xs font-medium ${o===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",o,"% ",o!==100&&"(must equal 100)"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{value:r,onChange:l=>n(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_name",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{value:a,onChange:l=>i(l.target.value),onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),s()),placeholder:"gateway_id",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm flex-1 focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsxs(Ie,{type:"button",size:"sm",variant:"secondary",onClick:s,children:[c.jsx(ki,{size:13})," Add"]})]})]})}function cF({row:e,onChange:t,onRemove:r,routingKeys:n}){var l;const a=n[e.lhs],i=(a==null?void 0:a.type)==="enum",s=(a==null?void 0:a.type)==="integer"?[">","<",">=","<=","==","!="]:["==","!="];return c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("select",{value:e.lhs,onChange:u=>t({...e,lhs:u.target.value,value:"",operator:"=="}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:Object.keys(n).map(u=>c.jsx("option",{value:u,children:u},u))}),c.jsx("select",{value:e.operator,onChange:u=>t({...e,operator:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:s.map(u=>c.jsx("option",{value:u,children:u},u))}),i?c.jsxs("select",{value:e.value,onChange:u=>t({...e,value:u.target.value}),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs focus:outline-none",children:[c.jsx("option",{value:"",children:"select..."}),(((l=n[e.lhs])==null?void 0:l.values)||[]).map(u=>c.jsx("option",{value:u,children:u},u))]}):c.jsx("input",{type:"number",value:e.value,onChange:u=>t({...e,value:u.target.value}),placeholder:"value",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-xs w-24 focus:outline-none"}),c.jsx("button",{type:"button",onClick:r,className:"text-red-400 hover:text-red-600",children:c.jsx(Ca,{size:12})})]})}function dF({block:e,onChange:t,onRemove:r,routingKeys:n}){var f;const[a,i]=j.useState(!1),o=Object.keys(n)[0]||"payment_method",l=(((f=n[o])==null?void 0:f.values)||[])[0]||"";function u(){t({...e,conditions:[...e.conditions,{id:crypto.randomUUID(),lhs:o,operator:"==",value:l}]})}return c.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#0d0d12] rounded-t-xl cursor-pointer",onClick:()=>i(!a),children:[c.jsx("input",{value:e.name,onChange:d=>{d.stopPropagation(),t({...e,name:d.target.value})},onClick:d=>d.stopPropagation(),placeholder:"Rule name",className:"bg-transparent text-sm font-medium focus:outline-none border-b border-transparent focus:border-[#28282f] text-slate-900"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),r()},className:"text-red-400 hover:text-red-600",children:c.jsx(Ca,{size:14})}),a?c.jsx(du,{size:14}):c.jsx(fu,{size:14})]})]}),!a&&c.jsxs("div",{className:"px-4 py-3 space-y-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"CONDITIONS"}),c.jsxs("div",{className:"space-y-2",children:[e.conditions.map(d=>c.jsx(cF,{row:d,routingKeys:n,onChange:p=>t({...e,conditions:e.conditions.map(h=>h.id===d.id?p:h)}),onRemove:()=>t({...e,conditions:e.conditions.filter(p=>p.id!==d.id)})},d.id)),c.jsxs(Ie,{type:"button",variant:"ghost",size:"sm",onClick:u,children:[c.jsx(ki,{size:12})," Add Condition"]})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"OUTPUT"}),c.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(d=>c.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[c.jsx("input",{type:"radio",checked:e.outputType===d,onChange:()=>t({...e,outputType:d}),className:"accent-brand-500"}),d==="priority"?"Priority":"Volume Split"]},d))}),e.outputType==="priority"?c.jsx(WP,{gateways:e.priorityGateways,onChange:d=>t({...e,priorityGateways:d})}):c.jsx(HP,{gateways:e.volumeGateways,onChange:d=>t({...e,volumeGateways:d})})]})]})]})}function fF(e,t,r){function n(i,o,s){return i==="priority"?{priority:o.map(l=>({gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}))}:{volume_split:s.map(l=>({split:l.split,output:{gateway_name:l.gatewayName,gateway_id:l.gatewayId||null}}))}}function a(i){return i==="priority"?"priority":"volume_split"}return{globals:{},default_selection:n(t.type,t.priorityGateways,t.volumeGateways),rules:e.map(i=>({name:i.name,routing_type:a(i.outputType),output:n(i.outputType,i.priorityGateways,i.volumeGateways),statements:[{condition:i.conditions.map(o=>{var s,l;return{lhs:o.lhs,comparison:lF[o.operator]||o.operator,value:{type:((s=r[o.lhs])==null?void 0:s.type)==="integer"?"number":"enum_variant",value:((l=r[o.lhs])==null?void 0:l.type)==="integer"?Number(o.value):o.value},metadata:{}}})}]}))}}function pF(){const{merchantId:e}=aa(),{routingKeysConfig:t,isLoading:r,error:n}=VP(),a=t,i=Object.keys(a).length>0,o=!r&&(!i||!!n),[s,l]=j.useState(""),[u,f]=j.useState(""),[d,p]=j.useState([]),[h,g]=j.useState({type:"priority",priorityGateways:[],volumeGateways:[]}),[y,v]=j.useState(!1),[x,m]=j.useState(!1),[w,S]=j.useState(null),[b,_]=j.useState(null),[O,k]=j.useState(!1),[A,$]=j.useState(null),[T,P]=j.useState(!1),[R,L]=j.useState(new Set),{data:z,mutate:W}=ar(e?`/routing/list/${e}`:null,()=>bt(`/routing/list/${e}`)),{data:V}=ar(e?`/routing/list/active/${e}`:null,()=>bt(`/routing/list/active/${e}`)),D=new Set((V||[]).map(Q=>Q.id)),U=fF(d,h,a);async function q(Q){if(Q.preventDefault(),!e){S("Set a Merchant ID first.");return}if(o){S("Routing key config is unavailable. Ensure backend /config/routing-keys is reachable and valid.");return}if(!s.trim()){S("Rule name is required.");return}m(!0),S(null),_(null);try{const be=await bt("/routing/create",{name:s.trim(),description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:U}});_(be.id),W()}catch(be){S(String(be))}finally{m(!1)}}async function J(Q){if(e){k(!0),$(null),P(!1);try{await bt("/routing/activate",{created_by:e,routing_algorithm_id:Q}),P(!0),W()}catch(be){$(String(be))}finally{k(!1)}}}function K(Q){L(be=>{const ue=new Set(be);return ue.has(Q)?ue.delete(Q):ue.add(Q),ue})}function ae(){p(Q=>[...Q,{id:crypto.randomUUID(),name:`Rule ${Q.length+1}`,conditions:[],outputType:"priority",priorityGateways:[],volumeGateways:[]}])}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Rule-Based Routing"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Create declarative routing rules"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsxs("div",{className:"lg:col-span-1 space-y-3",children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Existing Rules"})}),c.jsx(Ae,{className:"p-0",children:e?z?z.length===0?c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"No rules yet."}):c.jsx("div",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:z.map(Q=>{const be=D.has(Q.id),ue=R.has(Q.id),Ce=Q.algorithm_data||Q.algorithm;return c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate font-medium",children:Q.name}),c.jsx("p",{className:"text-xs text-slate-400 capitalize",children:Ce==null?void 0:Ce.type})]}),c.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 sm:justify-end",children:[c.jsx(_e,{variant:be?"green":"gray",children:be?"Active":"Inactive"}),c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:()=>K(Q.id),children:[c.jsx(Nh,{size:14,className:"mr-1"}),ue?"Hide":"View"]}),!be&&c.jsx(Ie,{size:"sm",variant:"ghost",onClick:()=>J(Q.id),disabled:O,children:"Activate"})]})]}),ue&&c.jsx("div",{className:"bg-slate-50 px-4 py-3 dark:bg-[#151518]",children:c.jsxs("div",{className:"space-y-2 text-xs text-slate-600",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"ID:"})," ",Q.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Description:"})," ",Q.description||"N/A"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Algorithm For:"})," ",Q.algorithm_for]}),Q.created_at&&c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",new Date(Q.created_at).toLocaleString()]}),c.jsxs("div",{children:[c.jsx("strong",{children:"Configuration:"}),c.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-transparent bg-slate-100 p-2 text-xs dark:border-[#222226] dark:bg-[#0f0f11]",children:JSON.stringify(Ce,null,2)})]})]})})]},Q.id)})}):c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Loading..."}):c.jsx("p",{className:"px-4 py-3 text-sm text-slate-400",children:"Set merchant ID to load rules."})})]}),A&&c.jsx(Gr,{error:A}),T&&c.jsx("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400",children:"Rule activated successfully."})]}),c.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[c.jsx("form",{onSubmit:q,className:"space-y-4",children:c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Rule Builder"})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rule Name *"}),c.jsx("input",{value:s,onChange:Q=>l(Q.target.value),placeholder:"my-rule",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),c.jsx("input",{value:u,onChange:Q=>f(Q.target.value),placeholder:"Optional description",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-2 py-1 text-sm w-full focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Rules"}),r&&c.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),o&&c.jsx(Gr,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Builder is disabled until this is fixed."}),d.map(Q=>c.jsx(dF,{block:Q,routingKeys:a,onChange:be=>p(ue=>ue.map(Ce=>Ce.id===Q.id?be:Ce)),onRemove:()=>p(be=>be.filter(ue=>ue.id!==Q.id))},Q.id)),c.jsxs(Ie,{type:"button",variant:"secondary",size:"sm",onClick:ae,disabled:o,children:[c.jsx(ki,{size:14})," Add Rule Block"]})]}),c.jsxs("div",{className:"border border-slate-200 dark:border-[#1c1c24] rounded-xl px-4 py-3",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"DEFAULT SELECTION (Fallback)"}),c.jsx("div",{className:"flex gap-4 mb-3",children:["priority","volume_split"].map(Q=>c.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[c.jsx("input",{type:"radio",checked:h.type===Q,onChange:()=>g({...h,type:Q}),className:"accent-brand-500"}),Q==="priority"?"Priority":"Volume Split"]},Q))}),h.type==="priority"?c.jsx(WP,{gateways:h.priorityGateways,onChange:Q=>g({...h,priorityGateways:Q})}):c.jsx(HP,{gateways:h.volumeGateways,onChange:Q=>g({...h,volumeGateways:Q})})]}),c.jsx(Gr,{error:w}),b&&c.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/8 px-3 py-2 text-sm text-emerald-400 flex items-center justify-between",children:[c.jsxs("span",{children:["Rule created (ID: ",b,")"]}),c.jsx(Ie,{type:"button",size:"sm",onClick:()=>J(b),disabled:O,children:"Activate Now"})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx(Ie,{type:"submit",disabled:x||o,children:x?"Creating...":"Create Rule"}),c.jsx(Ie,{type:"button",variant:"secondary",size:"sm",onClick:()=>v(!y),children:y?"Hide JSON":"Preview JSON"})]})]})]})}),y&&c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"JSON Preview"})}),c.jsx(Ae,{children:c.jsx("pre",{className:"text-xs text-slate-600 overflow-auto max-h-64 bg-[#07070b] rounded-lg p-4 font-mono border border-slate-200 dark:border-[#1c1c24]",children:JSON.stringify({name:s,description:u,created_by:e,algorithm_for:"payment",algorithm:{type:"advanced",data:U}},null,2)})})]})]})]})]})}function GP(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t-1}var fB=dB,pB=Fh;function hB(e,t){var r=this.__data__,n=pB(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var mB=hB,yB=Qz,vB=oB,gB=uB,xB=fB,bB=mB;function kl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},no=function(t){return jo(t)&&t.indexOf("%")===t.length-1},re=function(t){return z8(t)&&!El(t)},W8=function(t){return Ne(t)},qt=function(t){return re(t)||jo(t)},H8=0,Ro=function(t){var r=++H8;return"".concat(t||"").concat(r)},Or=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!re(t)&&!jo(t))return n;var i;if(no(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return El(i)&&(i=n),a&&i>r&&(i=r),i},oi=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},G8=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function J8(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tg(e){"@babel/helpers - typeof";return Tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tg(e)}var dS={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ja=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},fS=null,Ey=null,$b=function e(t){if(t===fS&&Array.isArray(Ey))return Ey;var r=[];return j.Children.forEach(t,function(n){Ne(n)||(R8.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Ey=r,fS=t,r};function Zr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return ja(a)}):n=[ja(t)],$b(e).forEach(function(a){var i=Yr(a,"type.displayName")||Yr(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Hr(e,t){var r=Zr(e,t);return r&&r[0]}var pS=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!re(n)||n<=0||!re(a)||a<=0)},e6=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],t6=function(t){return t&&t.type&&jo(t.type)&&e6.indexOf(t.type)>=0},iN=function(t){return t&&Tg(t)==="object"&&"clipDot"in t},r6=function(t,r,n,a){var i,o=(i=Ay==null?void 0:Ay[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!je(t)&&(a&&o.includes(r)||X8.includes(r))||n&&Tb.includes(r)},we=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(j.isValidElement(t)&&(a=t.props),!jl(a))return null;var i={};return Object.keys(a).forEach(function(o){var s;r6((s=a)===null||s===void 0?void 0:s[o],o,r,n)&&(i[o]=a[o])}),i},$g=function e(t,r){if(t===r)return!0;var n=j.Children.count(t);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return hS(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function s6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Rg(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,s=e.title,l=e.desc,u=o6(e,i6),f=a||{width:r,height:n,x:0,y:0},d=De("recharts-surface",i);return C.createElement("svg",Ig({},we(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),C.createElement("title",null,s),C.createElement("desc",null,l),t)}var l6=["children","className"];function Mg(){return Mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var We=C.forwardRef(function(e,t){var r=e.children,n=e.className,a=u6(e,l6),i=De("recharts-layer",n);return C.createElement("g",Mg({className:i},we(a,!0),{ref:t}),r)}),Ln=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;ia?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n=n?e:p6(e,t,r)}var m6=h6,y6="\\ud800-\\udfff",v6="\\u0300-\\u036f",g6="\\ufe20-\\ufe2f",x6="\\u20d0-\\u20ff",b6=v6+g6+x6,w6="\\ufe0e\\ufe0f",_6="\\u200d",S6=RegExp("["+_6+y6+b6+w6+"]");function j6(e){return S6.test(e)}var oN=j6;function O6(e){return e.split("")}var k6=O6,sN="\\ud800-\\udfff",A6="\\u0300-\\u036f",E6="\\ufe20-\\ufe2f",P6="\\u20d0-\\u20ff",N6=A6+E6+P6,C6="\\ufe0e\\ufe0f",T6="["+sN+"]",Dg="["+N6+"]",Lg="\\ud83c[\\udffb-\\udfff]",$6="(?:"+Dg+"|"+Lg+")",lN="[^"+sN+"]",uN="(?:\\ud83c[\\udde6-\\uddff]){2}",cN="[\\ud800-\\udbff][\\udc00-\\udfff]",I6="\\u200d",dN=$6+"?",fN="["+C6+"]?",R6="(?:"+I6+"(?:"+[lN,uN,cN].join("|")+")"+fN+dN+")*",M6=fN+dN+R6,D6="(?:"+[lN+Dg+"?",Dg,uN,cN,T6].join("|")+")",L6=RegExp(Lg+"(?="+Lg+")|"+D6+M6,"g");function F6(e){return e.match(L6)||[]}var z6=F6,B6=k6,U6=oN,V6=z6;function W6(e){return U6(e)?V6(e):B6(e)}var H6=W6,G6=m6,q6=oN,K6=H6,X6=JP;function Y6(e){return function(t){t=X6(t);var r=q6(t)?K6(t):void 0,n=r?r[0]:t.charAt(0),a=r?G6(r,1).join(""):t.slice(1);return n[e]()+a}}var Z6=Y6,Q6=Z6,J6=Q6("toUpperCase"),eU=J6;const Jh=rt(eU);function pt(e){return function(){return e}}const pN=Math.cos,up=Math.sin,Un=Math.sqrt,cp=Math.PI,em=2*cp,Fg=Math.PI,zg=2*Fg,Xi=1e-6,tU=zg-Xi;function hN(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hN;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;aXi)if(!(Math.abs(d*l-u*f)>Xi)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,g=a-s,y=l*l+u*u,v=h*h+g*g,x=Math.sqrt(y),m=Math.sqrt(p),w=i*Math.tan((Fg-Math.acos((y+p-v)/(2*x*m)))/2),S=w/m,b=w/x;Math.abs(S-1)>Xi&&this._append`L${t+S*f},${r+S*d}`,this._append`A${i},${i},0,0,${+(d*h>f*g)},${this._x1=t+b*l},${this._y1=r+b*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(a),l=n*Math.sin(a),u=t+s,f=r+l,d=1^o,p=o?a-i:i-a;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Xi||Math.abs(this._y1-f)>Xi)&&this._append`L${u},${f}`,n&&(p<0&&(p=p%zg+zg),p>tU?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:p>Xi&&this._append`A${n},${n},0,${+(p>=Fg)},${d},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function Ib(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new nU(t)}function Rb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mN(e){this._context=e}mN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function tm(e){return new mN(e)}function yN(e){return e[0]}function vN(e){return e[1]}function gN(e,t){var r=pt(!0),n=null,a=tm,i=null,o=Ib(s);e=typeof e=="function"?e:e===void 0?yN:pt(e),t=typeof t=="function"?t:t===void 0?vN:pt(t);function s(l){var u,f=(l=Rb(l)).length,d,p=!1,h;for(n==null&&(i=a(h=o())),u=0;u<=f;++u)!(u=h;--g)s.point(w[g],S[g]);s.lineEnd(),s.areaEnd()}x&&(w[p]=+e(v,p,d),S[p]=+t(v,p,d),s.point(n?+n(v,p,d):w[p],r?+r(v,p,d):S[p]))}if(m)return s=null,m+""||null}function f(){return gN().defined(a).curve(o).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:pt(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:pt(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(a=typeof d=="function"?d:pt(!!d),u):a},u.curve=function(d){return arguments.length?(o=d,i!=null&&(s=o(i)),u):o},u.context=function(d){return arguments.length?(d==null?i=s=null:s=o(i=d),u):i},u}class xN{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function aU(e){return new xN(e,!0)}function iU(e){return new xN(e,!1)}const Mb={draw(e,t){const r=Un(t/cp);e.moveTo(r,0),e.arc(0,0,r,0,em)}},oU={draw(e,t){const r=Un(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},bN=Un(1/3),sU=bN*2,lU={draw(e,t){const r=Un(t/sU),n=r*bN;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},uU={draw(e,t){const r=Un(t),n=-r/2;e.rect(n,n,r,r)}},cU=.8908130915292852,wN=up(cp/10)/up(7*cp/10),dU=up(em/10)*wN,fU=-pN(em/10)*wN,pU={draw(e,t){const r=Un(t*cU),n=dU*r,a=fU*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=em*i/5,s=pN(o),l=up(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*a,l*n+s*a)}e.closePath()}},Py=Un(3),hU={draw(e,t){const r=-Un(t/(Py*3));e.moveTo(0,r*2),e.lineTo(-Py*r,-r),e.lineTo(Py*r,-r),e.closePath()}},an=-.5,on=Un(3)/2,Bg=1/Un(12),mU=(Bg/2+1)*3,yU={draw(e,t){const r=Un(t/mU),n=r/2,a=r*Bg,i=n,o=r*Bg+r,s=-i,l=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(s,l),e.lineTo(an*n-on*a,on*n+an*a),e.lineTo(an*i-on*o,on*i+an*o),e.lineTo(an*s-on*l,on*s+an*l),e.lineTo(an*n+on*a,an*a-on*n),e.lineTo(an*i+on*o,an*o-on*i),e.lineTo(an*s+on*l,an*l-on*s),e.closePath()}};function vU(e,t){let r=null,n=Ib(a);e=typeof e=="function"?e:pt(e||Mb),t=typeof t=="function"?t:pt(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:pt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:pt(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function dp(){}function fp(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function _N(e){this._context=e}_N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:fp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:fp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gU(e){return new _N(e)}function SN(e){this._context=e}SN.prototype={areaStart:dp,areaEnd:dp,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:fp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xU(e){return new SN(e)}function jN(e){this._context=e}jN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:fp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bU(e){return new jN(e)}function ON(e){this._context=e}ON.prototype={areaStart:dp,areaEnd:dp,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function wU(e){return new ON(e)}function yS(e){return e<0?-1:1}function vS(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(yS(i)+yS(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function gS(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ny(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,a+s*t,i-s,o-s*r,i,o)}function pp(e){this._context=e}pp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ny(this,this._t0,gS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ny(this,gS(this,r=vS(this,e,t)),r);break;default:Ny(this,this._t0,r=vS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function kN(e){this._context=new AN(e)}(kN.prototype=Object.create(pp.prototype)).point=function(e,t){pp.prototype.point.call(this,t,e)};function AN(e){this._context=e}AN.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function _U(e){return new pp(e)}function SU(e){return new kN(e)}function EN(e){this._context=e}EN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=xS(e),a=xS(t),i=0,o=1;o=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function OU(e){return new rm(e,.5)}function kU(e){return new rm(e,0)}function AU(e){return new rm(e,1)}function Vs(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,s=i.length;r=0;)r[t]=t;return r}function EU(e,t){return e[t]}function PU(e){const t=[];return t.key=e,t}function NU(){var e=pt([]),t=Ug,r=Vs,n=EU;function a(i){var o=Array.from(e.apply(this,arguments),PU),s,l=o.length,u=-1,f;for(const d of i)for(s=0,++u;s0){for(var r,n,a=0,i=e[0].length,o;a0){for(var r=0,n=e[t[0]],a,i=n.length;r0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var PN={symbolCircle:Mb,symbolCross:oU,symbolDiamond:lU,symbolSquare:uU,symbolStar:pU,symbolTriangle:hU,symbolWye:yU},zU=Math.PI/180,BU=function(t){var r="symbol".concat(Jh(t));return PN[r]||Mb},UU=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*zU;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},VU=function(t,r){PN["symbol".concat(Jh(t))]=r},Db=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,s=o===void 0?"area":o,l=LU(t,IU),u=wS(wS({},l),{},{type:n,size:i,sizeType:s}),f=function(){var v=BU(n),x=vU().type(v).size(UU(i,s,n));return x()},d=u.className,p=u.cx,h=u.cy,g=we(u,!0);return p===+p&&h===+h&&i===+i?C.createElement("path",Vg({},g,{className:De("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(h,")"),d:f()})):null};Db.registerSymbol=VU;function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}function Wg(){return Wg=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var m=h.inactive?u:h.color;return C.createElement("li",Wg({className:v,style:d,key:"legend-item-".concat(g)},Oo(n.props,h,g)),C.createElement(Rg,{width:o,height:o,viewBox:f,style:p},n.renderIcon(h)),C.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},y?y(x,h,g):x))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var s={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return C.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(j.PureComponent);mc(Lb,"displayName","Legend");mc(Lb,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var JU=zh;function e9(){this.__data__=new JU,this.size=0}var t9=e9;function r9(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var n9=r9;function a9(e){return this.__data__.get(e)}var i9=a9;function o9(e){return this.__data__.has(e)}var s9=o9,l9=zh,u9=Ob,c9=kb,d9=200;function f9(e,t){var r=this.__data__;if(r instanceof l9){var n=r.__data__;if(!u9||n.lengths))return!1;var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var d=-1,p=!0,h=r&I9?new N9:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=LV}var Ub=FV,zV=Ba,BV=Ub,UV=Ua,VV="[object Arguments]",WV="[object Array]",HV="[object Boolean]",GV="[object Date]",qV="[object Error]",KV="[object Function]",XV="[object Map]",YV="[object Number]",ZV="[object Object]",QV="[object RegExp]",JV="[object Set]",eW="[object String]",tW="[object WeakMap]",rW="[object ArrayBuffer]",nW="[object DataView]",aW="[object Float32Array]",iW="[object Float64Array]",oW="[object Int8Array]",sW="[object Int16Array]",lW="[object Int32Array]",uW="[object Uint8Array]",cW="[object Uint8ClampedArray]",dW="[object Uint16Array]",fW="[object Uint32Array]",gt={};gt[aW]=gt[iW]=gt[oW]=gt[sW]=gt[lW]=gt[uW]=gt[cW]=gt[dW]=gt[fW]=!0;gt[VV]=gt[WV]=gt[rW]=gt[HV]=gt[nW]=gt[GV]=gt[qV]=gt[KV]=gt[XV]=gt[YV]=gt[ZV]=gt[QV]=gt[JV]=gt[eW]=gt[tW]=!1;function pW(e){return UV(e)&&BV(e.length)&&!!gt[zV(e)]}var hW=pW;function mW(e){return function(t){return e(t)}}var zN=mW,vp={exports:{}};vp.exports;(function(e,t){var r=qP,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,s=function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(vp,vp.exports);var yW=vp.exports,vW=hW,gW=zN,ES=yW,PS=ES&&ES.isTypedArray,xW=PS?gW(PS):vW,BN=xW,bW=SV,wW=zb,_W=Br,SW=FN,jW=Bb,OW=BN,kW=Object.prototype,AW=kW.hasOwnProperty;function EW(e,t){var r=_W(e),n=!r&&wW(e),a=!r&&!n&&SW(e),i=!r&&!n&&!a&&OW(e),o=r||n||a||i,s=o?bW(e.length,String):[],l=s.length;for(var u in e)(t||AW.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||jW(u,l)))&&s.push(u);return s}var PW=EW,NW=Object.prototype;function CW(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||NW;return e===r}var TW=CW;function $W(e,t){return function(r){return e(t(r))}}var UN=$W,IW=UN,RW=IW(Object.keys,Object),MW=RW,DW=TW,LW=MW,FW=Object.prototype,zW=FW.hasOwnProperty;function BW(e){if(!DW(e))return LW(e);var t=[];for(var r in Object(e))zW.call(e,r)&&r!="constructor"&&t.push(r);return t}var UW=BW,VW=Sb,WW=Ub;function HW(e){return e!=null&&WW(e.length)&&!VW(e)}var sd=HW,GW=PW,qW=UW,KW=sd;function XW(e){return KW(e)?GW(e):qW(e)}var nm=XW,YW=dV,ZW=wV,QW=nm;function JW(e){return YW(e,QW,ZW)}var eH=JW,NS=eH,tH=1,rH=Object.prototype,nH=rH.hasOwnProperty;function aH(e,t,r,n,a,i){var o=r&tH,s=NS(e),l=s.length,u=NS(t),f=u.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var p=s[d];if(!(o?p in t:nH.call(t,p)))return!1}var h=i.get(e),g=i.get(t);if(h&&g)return h==t&&g==e;var y=!0;i.set(e,t),i.set(t,e);for(var v=o;++d-1}var rG=tG;function nG(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=gG){var u=t?null:yG(e);if(u)return vG(u);o=!1,a=mG,l=new fG}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function IG(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function RG(e){return e.value}function MG(e,t){if(C.isValidElement(e))return C.cloneElement(e,t);if(typeof e=="function")return C.createElement(e,t);t.ref;var r=$G(t,OG);return C.createElement(Lb,r)}var GS=1,Oa=function(e){function t(){var r;kG(this,t);for(var n=arguments.length,a=new Array(n),i=0;iGS||Math.abs(a.height-this.lastBoundingBox.height)>GS)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ca({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,s=a.verticalAlign,l=a.margin,u=a.chartWidth,f=a.chartHeight,d,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var h=this.getBBoxSnapshot();d={left:((u||0)-h.width)/2}}else d=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var g=this.getBBoxSnapshot();p={top:((f||0)-g.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return ca(ca({},d),p)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,s=a.height,l=a.wrapperStyle,u=a.payloadUniqBy,f=a.payload,d=ca(ca({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return C.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(h){n.wrapperNode=h}},MG(i,ca(ca({},this.props),{},{payload:XN(f,u,RG)})))}}],[{key:"getWithHeight",value:function(n,a){var i=ca(ca({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&re(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(j.PureComponent);am(Oa,"displayName","Legend");am(Oa,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var qS=od,DG=zb,LG=Br,KS=qS?qS.isConcatSpreadable:void 0;function FG(e){return LG(e)||DG(e)||!!(KS&&e&&e[KS])}var zG=FG,BG=DN,UG=zG;function QN(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=UG),a||(a=[]);++i0&&r(s)?t>1?QN(s,t-1,r,n,a):BG(a,s):n||(a[a.length]=s)}return a}var JN=QN;function VG(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++a];if(r(i[l],l,i)===!1)break}return t}}var WG=VG,HG=WG,GG=HG(),qG=GG,KG=qG,XG=nm;function YG(e,t){return e&&KG(e,t,XG)}var eC=YG,ZG=sd;function QG(e,t){return function(r,n){if(r==null)return r;if(!ZG(r))return e(r,n);for(var a=r.length,i=t?a:-1,o=Object(r);(t?i--:++it||i&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!a)return 1;if(!n&&!i&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var fq=dq,Iy=Eb,pq=Pb,hq=oa,mq=tC,yq=sq,vq=zN,gq=fq,xq=Cl,bq=Br;function wq(e,t,r){t.length?t=Iy(t,function(i){return bq(i)?function(o){return pq(o,i.length===1?i[0]:i)}:i}):t=[xq];var n=-1;t=Iy(t,vq(hq));var a=mq(e,function(i,o,s){var l=Iy(t,function(u){return u(i)});return{criteria:l,index:++n,value:i}});return yq(a,function(i,o){return gq(i,o,r)})}var _q=wq;function Sq(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var jq=Sq,Oq=jq,YS=Math.max;function kq(e,t,r){return t=YS(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=YS(n.length-t,0),o=Array(i);++a0){if(++t>=Mq)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var zq=Fq,Bq=Rq,Uq=zq,Vq=Uq(Bq),Wq=Vq,Hq=Cl,Gq=Aq,qq=Wq;function Kq(e,t){return qq(Gq(e,t,Hq),e+"")}var Xq=Kq,Yq=jb,Zq=sd,Qq=Bb,Jq=Ii;function eK(e,t,r){if(!Jq(r))return!1;var n=typeof t;return(n=="number"?Zq(r)&&Qq(t,r.length):n=="string"&&t in r)?Yq(r[t],e):!1}var im=eK,tK=JN,rK=_q,nK=Xq,QS=im,aK=nK(function(e,t){if(e==null)return[];var r=t.length;return r>1&&QS(e,t[0],t[1])?t=[]:r>2&&QS(t[0],t[1],t[2])&&(t=[t[0]]),rK(e,tK(t,1),[])}),iK=aK;const Hb=rt(iK);function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function Qg(){return Qg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(ql,"-left"),re(r)&&t&&re(t.x)&&r=t.y),"".concat(ql,"-top"),re(n)&&t&&re(t.y)&&ny?Math.max(f,l[n]):Math.max(d,l[n])}function bK(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function wK(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=tj({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),d=tj({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=bK({translateX:f,translateY:d,useTranslate3d:s})):u=gK,{cssProperties:u,cssClasses:xK({translateX:f,translateY:d,coordinate:r})}}function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function rj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nj(e){for(var t=1;taj||Math.abs(n.height-this.state.lastBoundingBox.height)>aj)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,s=a.animationDuration,l=a.animationEasing,u=a.children,f=a.coordinate,d=a.hasPayload,p=a.isAnimationActive,h=a.offset,g=a.position,y=a.reverseDirection,v=a.useTranslate3d,x=a.viewBox,m=a.wrapperStyle,w=wK({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:g,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:x}),S=w.cssClasses,b=w.cssProperties,_=nj(nj({transition:p&&i?"transform ".concat(s,"ms ").concat(l):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},m);return C.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(k){n.wrapperNode=k}},u)}}])}(j.PureComponent),CK=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ri={isSsr:CK()};function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function ij(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oj(e){for(var t=1;t0;return C.createElement(NK,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:i,coordinate:f,hasPayload:_,offset:h,position:v,reverseDirection:x,useTranslate3d:m,viewBox:w,wrapperStyle:S},BK(u,oj(oj({},this.props),{},{payload:b})))}}])}(j.PureComponent);Gb(_r,"displayName","Tooltip");Gb(_r,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ri.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var UK=ia,VK=function(){return UK.Date.now()},WK=VK,HK=/\s/;function GK(e){for(var t=e.length;t--&&HK.test(e.charAt(t)););return t}var qK=GK,KK=qK,XK=/^\s+/;function YK(e){return e&&e.slice(0,KK(e)+1).replace(XK,"")}var ZK=YK,QK=ZK,sj=Ii,JK=Sl,lj=NaN,eX=/^[-+]0x[0-9a-f]+$/i,tX=/^0b[01]+$/i,rX=/^0o[0-7]+$/i,nX=parseInt;function aX(e){if(typeof e=="number")return e;if(JK(e))return lj;if(sj(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=sj(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=QK(e);var r=tX.test(e);return r||rX.test(e)?nX(e.slice(2),r?2:8):eX.test(e)?lj:+e}var sC=aX,iX=Ii,My=WK,uj=sC,oX="Expected a function",sX=Math.max,lX=Math.min;function uX(e,t,r){var n,a,i,o,s,l,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(oX);t=uj(t)||0,iX(r)&&(f=!!r.leading,d="maxWait"in r,i=d?sX(uj(r.maxWait)||0,t):i,p="trailing"in r?!!r.trailing:p);function h(_){var O=n,k=a;return n=a=void 0,u=_,o=e.apply(k,O),o}function g(_){return u=_,s=setTimeout(x,t),f?h(_):o}function y(_){var O=_-l,k=_-u,A=t-O;return d?lX(A,i-k):A}function v(_){var O=_-l,k=_-u;return l===void 0||O>=t||O<0||d&&k>=i}function x(){var _=My();if(v(_))return m(_);s=setTimeout(x,y(_))}function m(_){return s=void 0,p&&n?h(_):(n=a=void 0,o)}function w(){s!==void 0&&clearTimeout(s),u=0,n=l=a=s=void 0}function S(){return s===void 0?o:m(My())}function b(){var _=My(),O=v(_);if(n=arguments,a=this,l=_,O){if(s===void 0)return g(l);if(d)return clearTimeout(s),s=setTimeout(x,t),h(l)}return s===void 0&&(s=setTimeout(x,t)),o}return b.cancel=w,b.flush=S,b}var cX=uX,dX=cX,fX=Ii,pX="Expected a function";function hX(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(pX);return fX(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),dX(e,t,{leading:n,maxWait:t,trailing:a})}var mX=hX;const lC=rt(mX);function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function cj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bd(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(R=lC(R,y,{trailing:!0,leading:!1}));var L=new ResizeObserver(R),z=b.current.getBoundingClientRect(),W=z.width,V=z.height;return T(W,V),L.observe(b.current),function(){L.disconnect()}},[T,y]);var P=j.useMemo(function(){var R=A.containerWidth,L=A.containerHeight;if(R<0||L<0)return null;Ln(no(o)||no(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),Ln(!r||r>0,"The aspect(%s) must be greater than zero.",r);var z=no(o)?R:o,W=no(l)?L:l;r&&r>0&&(z?W=z/r:W&&(z=W*r),p&&W>p&&(W=p)),Ln(z>0||W>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,z,W,o,l,f,d,r);var V=!Array.isArray(h)&&ja(h.type).endsWith("Chart");return C.Children.map(h,function(D){return C.isValidElement(D)?j.cloneElement(D,Bd({width:z,height:W},V?{style:Bd({height:"100%",width:"100%",maxHeight:W,maxWidth:z},D.props.style)}:{})):D})},[r,h,l,p,d,f,A,o]);return C.createElement("div",{id:v?"".concat(v):void 0,className:De("recharts-responsive-container",x),style:Bd(Bd({},S),{},{width:o,height:l,minWidth:f,minHeight:d,maxHeight:p}),ref:b},P)}),co=function(t){return null};co.displayName="Cell";function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}function fj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function r0(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ri.isSsr)return{width:0,height:0};var n=PX(r),a=JSON.stringify({text:t,copyStyle:n});if(Wo.widthCache[a])return Wo.widthCache[a];try{var i=document.getElementById(pj);i||(i=document.createElement("span"),i.setAttribute("id",pj),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=r0(r0({},EX),n);Object.assign(i.style,o),i.textContent="".concat(t);var s=i.getBoundingClientRect(),l={width:s.width,height:s.height};return Wo.widthCache[a]=l,++Wo.cacheCount>AX&&(Wo.cacheCount=0,Wo.widthCache={}),l}catch{return{width:0,height:0}}},NX=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function wp(e,t){return IX(e)||$X(e,t)||TX(e,t)||CX()}function CX(){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 TX(e,t){if(e){if(typeof e=="string")return hj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hj(e,t)}}function hj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bj(e,t){return QX(e)||ZX(e,t)||YX(e,t)||XX()}function XX(){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 YX(e,t){if(e){if(typeof e=="string")return wj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wj(e,t)}}function wj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(W,V){var D=V.word,U=V.width,q=W[W.length-1];if(q&&(a==null||i||q.width+U+nV.width?W:V})};if(!f)return h;for(var y="…",v=function(z){var W=d.slice(0,z),V=fC({breakAll:u,style:l,children:W+y}).wordsWithComputedWidth,D=p(V),U=D.length>o||g(D).width>Number(a);return[U,D]},x=0,m=d.length-1,w=0,S;x<=m&&w<=d.length-1;){var b=Math.floor((x+m)/2),_=b-1,O=v(_),k=bj(O,2),A=k[0],$=k[1],T=v(b),P=bj(T,1),R=P[0];if(!A&&!R&&(x=b+1),A&&R&&(m=b-1),!A&&R){S=$;break}w++}return S||h},_j=function(t){var r=Ne(t)?[]:t.toString().split(dC);return[{words:r}]},eY=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Ri.isSsr){var l,u,f=fC({breakAll:o,children:a,style:i});if(f){var d=f.wordsWithComputedWidth,p=f.spaceWidth;l=d,u=p}else return _j(a);return JX({breakAll:o,children:a,maxLines:s,style:i},l,u,r,n)}return _j(a)},Sj="#808080",ko=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,d=f===void 0?!1:f,p=t.textAnchor,h=p===void 0?"start":p,g=t.verticalAnchor,y=g===void 0?"end":g,v=t.fill,x=v===void 0?Sj:v,m=xj(t,GX),w=j.useMemo(function(){return eY({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),S=m.dx,b=m.dy,_=m.angle,O=m.className,k=m.breakAll,A=xj(m,qX);if(!qt(n)||!qt(i))return null;var $=n+(re(S)?S:0),T=i+(re(b)?b:0),P;switch(y){case"start":P=Dy("calc(".concat(u,")"));break;case"middle":P=Dy("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:P=Dy("calc(".concat(w.length-1," * -").concat(s,")"));break}var R=[];if(d){var L=w[0].width,z=m.width;R.push("scale(".concat((re(z)?z/L:1)/L,")"))}return _&&R.push("rotate(".concat(_,", ").concat($,", ").concat(T,")")),R.length&&(A.transform=R.join(" ")),C.createElement("text",n0({},we(A,!0),{x:$,y:T,className:De("recharts-text",O),textAnchor:h,fill:x.includes("url")?Sj:x}),w.map(function(W,V){var D=W.words.join(k?"":" ");return C.createElement("tspan",{x:$,dy:V===0?P:s,key:"".concat(D,"-").concat(V)},D)}))};function Si(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function tY(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function qb(e){let t,r,n;e.length!==2?(t=Si,r=(s,l)=>Si(e(s),l),n=(s,l)=>e(s)-l):(t=e===Si||e===tY?e:rY,r=e,n=e);function a(s,l,u=0,f=s.length){if(u>>1;r(s[d],l)<0?u=d+1:f=d}while(u>>1;r(s[d],l)<=0?u=d+1:f=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:a,center:o,right:i}}function rY(){return 0}function pC(e){return e===null?NaN:+e}function*nY(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const aY=qb(Si),ld=aY.right;qb(pC).center;class jj extends Map{constructor(t,r=sY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(Oj(this,t))}has(t){return super.has(Oj(this,t))}set(t,r){return super.set(iY(this,t),r)}delete(t){return super.delete(oY(this,t))}}function Oj({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function iY({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function oY({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function sY(e){return e!==null&&typeof e=="object"?e.valueOf():e}function lY(e=Si){if(e===Si)return hC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function hC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const uY=Math.sqrt(50),cY=Math.sqrt(10),dY=Math.sqrt(2);function _p(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=uY?10:i>=cY?5:i>=dY?2:1;let s,l,u;return a<0?(u=Math.pow(10,-a)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,a)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=a))return[];const s=i-a+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function Aj(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function mC(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?hC:lY(a);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(l-d)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*d/l+p)),g=Math.min(n,Math.floor(t+(l-u)*d/l+p));mC(e,t,h,g,a)}const i=e[t];let o=r,s=n;for(Kl(e,r,t),a(e[n],i)>0&&Kl(e,r,n);o0;)--s}a(e[r],i)===0?Kl(e,r,s):(++s,Kl(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Kl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function fY(e,t,r){if(e=Float64Array.from(nY(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Aj(e);if(t>=1)return kj(e);var n,a=(n-1)*t,i=Math.floor(a),o=kj(mC(e,i).subarray(0,i+1)),s=Aj(e.subarray(i+1));return o+(s-o)*(a-i)}}function pY(e,t,r=pC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),s=+r(e[i+1],i+1,e);return o+(s-o)*(a-i)}}function hY(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Vd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Vd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=yY.exec(e))?new Mr(t[1],t[2],t[3],1):(t=vY.exec(e))?new Mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gY.exec(e))?Vd(t[1],t[2],t[3],t[4]):(t=xY.exec(e))?Vd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bY.exec(e))?Ij(t[1],t[2]/100,t[3]/100,1):(t=wY.exec(e))?Ij(t[1],t[2]/100,t[3]/100,t[4]):Ej.hasOwnProperty(e)?Cj(Ej[e]):e==="transparent"?new Mr(NaN,NaN,NaN,0):null}function Cj(e){return new Mr(e>>16&255,e>>8&255,e&255,1)}function Vd(e,t,r,n){return n<=0&&(e=t=r=NaN),new Mr(e,t,r,n)}function jY(e){return e instanceof ud||(e=jc(e)),e?(e=e.rgb(),new Mr(e.r,e.g,e.b,e.opacity)):new Mr}function l0(e,t,r,n){return arguments.length===1?jY(e):new Mr(e,t,r,n??1)}function Mr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Xb(Mr,l0,vC(ud,{brighter(e){return e=e==null?Sp:Math.pow(Sp,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_c:Math.pow(_c,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mr(fo(this.r),fo(this.g),fo(this.b),jp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Tj,formatHex:Tj,formatHex8:OY,formatRgb:$j,toString:$j}));function Tj(){return`#${ao(this.r)}${ao(this.g)}${ao(this.b)}`}function OY(){return`#${ao(this.r)}${ao(this.g)}${ao(this.b)}${ao((isNaN(this.opacity)?1:this.opacity)*255)}`}function $j(){const e=jp(this.opacity);return`${e===1?"rgb(":"rgba("}${fo(this.r)}, ${fo(this.g)}, ${fo(this.b)}${e===1?")":`, ${e})`}`}function jp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ao(e){return e=fo(e),(e<16?"0":"")+e.toString(16)}function Ij(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Rn(e,t,r,n)}function gC(e){if(e instanceof Rn)return new Rn(e.h,e.s,e.l,e.opacity);if(e instanceof ud||(e=jc(e)),!e)return new Rn;if(e instanceof Rn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,s=i-a,l=(i+a)/2;return s?(t===i?o=(r-n)/s+(r0&&l<1?0:o,new Rn(o,s,l,e.opacity)}function kY(e,t,r,n){return arguments.length===1?gC(e):new Rn(e,t,r,n??1)}function Rn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Xb(Rn,kY,vC(ud,{brighter(e){return e=e==null?Sp:Math.pow(Sp,e),new Rn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_c:Math.pow(_c,e),new Rn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Mr(Ly(e>=240?e-240:e+120,a,n),Ly(e,a,n),Ly(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new Rn(Rj(this.h),Wd(this.s),Wd(this.l),jp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=jp(this.opacity);return`${e===1?"hsl(":"hsla("}${Rj(this.h)}, ${Wd(this.s)*100}%, ${Wd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Rj(e){return e=(e||0)%360,e<0?e+360:e}function Wd(e){return Math.max(0,Math.min(1,e||0))}function Ly(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Yb=e=>()=>e;function AY(e,t){return function(r){return e+r*t}}function EY(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function PY(e){return(e=+e)==1?xC:function(t,r){return r-t?EY(t,r,e):Yb(isNaN(t)?r:t)}}function xC(e,t){var r=t-e;return r?AY(e,r):Yb(isNaN(e)?t:e)}const Mj=function e(t){var r=PY(t);function n(a,i){var o=r((a=l0(a)).r,(i=l0(i)).r),s=r(a.g,i.g),l=r(a.b,i.b),u=xC(a.opacity,i.opacity);return function(f){return a.r=o(f),a.g=s(f),a.b=l(f),a.opacity=u(f),a+""}}return n.gamma=e,n}(1);function NY(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;ar&&(i=t.slice(r,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,l.push({i:o,x:Op(n,a)})),r=Fy.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function BY(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a2?UY:BY,l=u=null,d}function d(p){return p==null||isNaN(p=+p)?i:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return d.invert=function(p){return o(a((u||(u=s(t,e.map(n),Op)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,kp),f()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),r=Zb,f()},d.clamp=function(p){return arguments.length?(o=p?!0:kr,f()):o!==kr},d.interpolate=function(p){return arguments.length?(r=p,f()):r},d.unknown=function(p){return arguments.length?(i=p,d):i},function(p,h){return n=p,a=h,f()}}function Qb(){return om()(kr,kr)}function VY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ap(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ks(e){return e=Ap(Math.abs(e)),e?e[1]:NaN}function WY(e,t){return function(r,n){for(var a=r.length,i=[],o=0,s=e[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),i.push(r.substring(a-=s,a+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function HY(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var GY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Oc(e){if(!(t=GY.exec(e)))throw new Error("invalid format: "+e);var t;return new Jb({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Oc.prototype=Jb.prototype;function Jb(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Jb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function qY(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var Ep;function KY(e,t){var r=Ap(e,t);if(!r)return Ep=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(Ep=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Ap(e,Math.max(0,t+i-1))[0]}function Lj(e,t){var r=Ap(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const Fj={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:VY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Lj(e*100,t),r:Lj,s:KY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function zj(e){return e}var Bj=Array.prototype.map,Uj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XY(e){var t=e.grouping===void 0||e.thousands===void 0?zj:WY(Bj.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?zj:HY(Bj.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d,p){d=Oc(d);var h=d.fill,g=d.align,y=d.sign,v=d.symbol,x=d.zero,m=d.width,w=d.comma,S=d.precision,b=d.trim,_=d.type;_==="n"?(w=!0,_="g"):Fj[_]||(S===void 0&&(S=12),b=!0,_="g"),(x||h==="0"&&g==="=")&&(x=!0,h="0",g="=");var O=(p&&p.prefix!==void 0?p.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),k=(v==="$"?n:/[%p]/.test(_)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),A=Fj[_],$=/[defgprs%]/.test(_);S=S===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function T(P){var R=O,L=k,z,W,V;if(_==="c")L=A(P)+L,P="";else{P=+P;var D=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),S),b&&(P=qY(P)),D&&+P==0&&y!=="+"&&(D=!1),R=(D?y==="("?y:s:y==="-"||y==="("?"":y)+R,L=(_==="s"&&!isNaN(P)&&Ep!==void 0?Uj[8+Ep/3]:"")+L+(D&&y==="("?")":""),$){for(z=-1,W=P.length;++zV||V>57){L=(V===46?a+P.slice(z+1):P.slice(z))+L,P=P.slice(0,z);break}}}w&&!x&&(P=t(P,1/0));var U=R.length+P.length+L.length,q=U>1)+R+P+L+q.slice(U);break;default:P=q+R+P+L;break}return i(P)}return T.toString=function(){return d+""},T}function f(d,p){var h=Math.max(-8,Math.min(8,Math.floor(Ks(p)/3)))*3,g=Math.pow(10,-h),y=u((d=Oc(d),d.type="f",d),{suffix:Uj[8+h/3]});return function(v){return y(g*v)}}return{format:u,formatPrefix:f}}var Hd,ew,bC;YY({thousands:",",grouping:[3],currency:["$",""]});function YY(e){return Hd=XY(e),ew=Hd.format,bC=Hd.formatPrefix,Hd}function ZY(e){return Math.max(0,-Ks(Math.abs(e)))}function QY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ks(t)/3)))*3-Ks(Math.abs(e)))}function JY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ks(t)-Ks(e))+1}function wC(e,t,r,n){var a=o0(e,t,r),i;switch(n=Oc(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=QY(a,o))&&(n.precision=i),bC(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=JY(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=ZY(a))&&(n.precision=i-(n.type==="%")*2);break}}return ew(n)}function Mi(e){var t=e.domain;return e.ticks=function(r){var n=t();return a0(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return wC(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],s=n[i],l,u,f=10;for(s0;){if(u=i0(o,s,r),u===l)return n[a]=o,n[i]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Pp(){var e=Qb();return e.copy=function(){return cd(e,Pp())},Sn.apply(e,arguments),Mi(e)}function _C(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,kp),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return _C(e).unknown(t)},e=arguments.length?Array.from(e,kp):[0,1],Mi(r)}function SC(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return iMath.pow(e,t)}function aZ(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Hj(e){return(t,r)=>-e(-t,r)}function tw(e){const t=e(Vj,Wj),r=t.domain;let n=10,a,i;function o(){return a=aZ(n),i=nZ(n),r()[0]<0?(a=Hj(a),i=Hj(i),e(eZ,tZ)):e(Vj,Wj),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const d=f0){for(;p<=h;++p)for(g=1;gf)break;x.push(y)}}else for(;p<=h;++p)for(g=n-1;g>=1;--g)if(y=p>0?g/i(-p):g*i(p),!(yf)break;x.push(y)}x.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Oc(l)).precision==null&&(l.trim=!0),l=ew(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let d=f/i(Math.round(a(f)));return d*nr(SC(r(),{floor:s=>i(Math.floor(a(s))),ceil:s=>i(Math.ceil(a(s)))})),t}function jC(){const e=tw(om()).domain([1,10]);return e.copy=()=>cd(e,jC()).base(e.base()),Sn.apply(e,arguments),e}function Gj(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qj(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rw(e){var t=1,r=e(Gj(t),qj(t));return r.constant=function(n){return arguments.length?e(Gj(t=+n),qj(t)):t},Mi(r)}function OC(){var e=rw(om());return e.copy=function(){return cd(e,OC()).constant(e.constant())},Sn.apply(e,arguments)}function Kj(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iZ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oZ(e){return e<0?-e*e:e*e}function nw(e){var t=e(kr,kr),r=1;function n(){return r===1?e(kr,kr):r===.5?e(iZ,oZ):e(Kj(r),Kj(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Mi(t)}function aw(){var e=nw(om());return e.copy=function(){return cd(e,aw()).exponent(e.exponent())},Sn.apply(e,arguments),e}function sZ(){return aw.apply(null,arguments).exponent(.5)}function Xj(e){return Math.sign(e)*e*e}function lZ(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function kC(){var e=Qb(),t=[0,1],r=!1,n;function a(i){var o=lZ(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(Xj(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,kp)).map(Xj)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return kC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Sn.apply(a,arguments),Mi(a)}function AC(){var e=[],t=[],r=[],n;function a(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(i=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return EC().domain([e,t]).range(a).unknown(i)},Sn.apply(Mi(o),arguments)}function PC(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[ld(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return PC().domain(e).range(t).unknown(r)},Sn.apply(a,arguments)}const zy=new Date,By=new Date;function Kt(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),s=a.ceil(i);return i-o(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,s)=>{const l=[];if(i=a.ceil(i),s=s==null?1:Math.floor(s),!(i0))return l;let u;do l.push(u=new Date(+i)),t(i,s),e(i);while(uKt(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!i(o););else for(;--s>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(zy.setTime(+i),By.setTime(+o),e(zy),e(By),Math.floor(r(zy,By))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Np=Kt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Np.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Np);Np.range;const ba=1e3,yn=ba*60,wa=yn*60,$a=wa*24,iw=$a*7,Yj=$a*30,Uy=$a*365,io=Kt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ba)},(e,t)=>(t-e)/ba,e=>e.getUTCSeconds());io.range;const ow=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ba)},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getMinutes());ow.range;const sw=Kt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getUTCMinutes());sw.range;const lw=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ba-e.getMinutes()*yn)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getHours());lw.range;const uw=Kt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getUTCHours());uw.range;const dd=Kt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*yn)/$a,e=>e.getDate()-1);dd.range;const sm=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>e.getUTCDate()-1);sm.range;const NC=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>Math.floor(e/$a));NC.range;function Mo(e){return Kt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*yn)/iw)}const lm=Mo(0),Cp=Mo(1),uZ=Mo(2),cZ=Mo(3),Xs=Mo(4),dZ=Mo(5),fZ=Mo(6);lm.range;Cp.range;uZ.range;cZ.range;Xs.range;dZ.range;fZ.range;function Do(e){return Kt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/iw)}const um=Do(0),Tp=Do(1),pZ=Do(2),hZ=Do(3),Ys=Do(4),mZ=Do(5),yZ=Do(6);um.range;Tp.range;pZ.range;hZ.range;Ys.range;mZ.range;yZ.range;const cw=Kt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());cw.range;const dw=Kt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());dw.range;const Ia=Kt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ia.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ia.range;const Ra=Kt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ra.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ra.range;function CC(e,t,r,n,a,i){const o=[[io,1,ba],[io,5,5*ba],[io,15,15*ba],[io,30,30*ba],[i,1,yn],[i,5,5*yn],[i,15,15*yn],[i,30,30*yn],[a,1,wa],[a,3,3*wa],[a,6,6*wa],[a,12,12*wa],[n,1,$a],[n,2,2*$a],[r,1,iw],[t,1,Yj],[t,3,3*Yj],[e,1,Uy]];function s(u,f,d){const p=fv).right(o,p);if(h===o.length)return e.every(o0(u/Uy,f/Uy,d));if(h===0)return Np.every(Math.max(o0(u,f,d),1));const[g,y]=o[p/o[h-1][2]53)return null;"w"in X||(X.w=1),"Z"in X?(ve=Wy(Xl(X.y,0,1)),Pe=ve.getUTCDay(),ve=Pe>4||Pe===0?Tp.ceil(ve):Tp(ve),ve=sm.offset(ve,(X.V-1)*7),X.y=ve.getUTCFullYear(),X.m=ve.getUTCMonth(),X.d=ve.getUTCDate()+(X.w+6)%7):(ve=Vy(Xl(X.y,0,1)),Pe=ve.getDay(),ve=Pe>4||Pe===0?Cp.ceil(ve):Cp(ve),ve=dd.offset(ve,(X.V-1)*7),X.y=ve.getFullYear(),X.m=ve.getMonth(),X.d=ve.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),Pe="Z"in X?Wy(Xl(X.y,0,1)).getUTCDay():Vy(Xl(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(Pe+5)%7:X.w+X.U*7-(Pe+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,Wy(X)):Vy(X)}}function k(te,ie,he,X){for(var Ee=0,ve=ie.length,Pe=he.length,ze,ge;Ee=Pe)return-1;if(ze=ie.charCodeAt(Ee++),ze===37){if(ze=ie.charAt(Ee++),ge=b[ze in Zj?ie.charAt(Ee++):ze],!ge||(X=ge(te,he,X))<0)return-1}else if(ze!=he.charCodeAt(X++))return-1}return X}function A(te,ie,he){var X=u.exec(ie.slice(he));return X?(te.p=f.get(X[0].toLowerCase()),he+X[0].length):-1}function $(te,ie,he){var X=h.exec(ie.slice(he));return X?(te.w=g.get(X[0].toLowerCase()),he+X[0].length):-1}function T(te,ie,he){var X=d.exec(ie.slice(he));return X?(te.w=p.get(X[0].toLowerCase()),he+X[0].length):-1}function P(te,ie,he){var X=x.exec(ie.slice(he));return X?(te.m=m.get(X[0].toLowerCase()),he+X[0].length):-1}function R(te,ie,he){var X=y.exec(ie.slice(he));return X?(te.m=v.get(X[0].toLowerCase()),he+X[0].length):-1}function L(te,ie,he){return k(te,t,ie,he)}function z(te,ie,he){return k(te,r,ie,he)}function W(te,ie,he){return k(te,n,ie,he)}function V(te){return o[te.getDay()]}function D(te){return i[te.getDay()]}function U(te){return l[te.getMonth()]}function q(te){return s[te.getMonth()]}function J(te){return a[+(te.getHours()>=12)]}function K(te){return 1+~~(te.getMonth()/3)}function ae(te){return o[te.getUTCDay()]}function Q(te){return i[te.getUTCDay()]}function be(te){return l[te.getUTCMonth()]}function ue(te){return s[te.getUTCMonth()]}function Ce(te){return a[+(te.getUTCHours()>=12)]}function Fe(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var ie=_(te+="",w);return ie.toString=function(){return te},ie},parse:function(te){var ie=O(te+="",!1);return ie.toString=function(){return te},ie},utcFormat:function(te){var ie=_(te+="",S);return ie.toString=function(){return te},ie},utcParse:function(te){var ie=O(te+="",!0);return ie.toString=function(){return te},ie}}}var Zj={"-":"",_:" ",0:"0"},ir=/^\s*\d+/,_Z=/^%/,SZ=/[\\^$*+?|[\]().{}]/g;function Je(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i[t.toLowerCase(),r]))}function OZ(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function kZ(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function AZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function EZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function PZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Qj(e,t,r){var n=ir.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Jj(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function NZ(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function CZ(e,t,r){var n=ir.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function TZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function eO(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function $Z(e,t,r){var n=ir.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function tO(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function IZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function RZ(e,t,r){var n=ir.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function MZ(e,t,r){var n=ir.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function DZ(e,t,r){var n=ir.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function LZ(e,t,r){var n=_Z.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function FZ(e,t,r){var n=ir.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function zZ(e,t,r){var n=ir.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function rO(e,t){return Je(e.getDate(),t,2)}function BZ(e,t){return Je(e.getHours(),t,2)}function UZ(e,t){return Je(e.getHours()%12||12,t,2)}function VZ(e,t){return Je(1+dd.count(Ia(e),e),t,3)}function TC(e,t){return Je(e.getMilliseconds(),t,3)}function WZ(e,t){return TC(e,t)+"000"}function HZ(e,t){return Je(e.getMonth()+1,t,2)}function GZ(e,t){return Je(e.getMinutes(),t,2)}function qZ(e,t){return Je(e.getSeconds(),t,2)}function KZ(e){var t=e.getDay();return t===0?7:t}function XZ(e,t){return Je(lm.count(Ia(e)-1,e),t,2)}function $C(e){var t=e.getDay();return t>=4||t===0?Xs(e):Xs.ceil(e)}function YZ(e,t){return e=$C(e),Je(Xs.count(Ia(e),e)+(Ia(e).getDay()===4),t,2)}function ZZ(e){return e.getDay()}function QZ(e,t){return Je(Cp.count(Ia(e)-1,e),t,2)}function JZ(e,t){return Je(e.getFullYear()%100,t,2)}function eQ(e,t){return e=$C(e),Je(e.getFullYear()%100,t,2)}function tQ(e,t){return Je(e.getFullYear()%1e4,t,4)}function rQ(e,t){var r=e.getDay();return e=r>=4||r===0?Xs(e):Xs.ceil(e),Je(e.getFullYear()%1e4,t,4)}function nQ(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Je(t/60|0,"0",2)+Je(t%60,"0",2)}function nO(e,t){return Je(e.getUTCDate(),t,2)}function aQ(e,t){return Je(e.getUTCHours(),t,2)}function iQ(e,t){return Je(e.getUTCHours()%12||12,t,2)}function oQ(e,t){return Je(1+sm.count(Ra(e),e),t,3)}function IC(e,t){return Je(e.getUTCMilliseconds(),t,3)}function sQ(e,t){return IC(e,t)+"000"}function lQ(e,t){return Je(e.getUTCMonth()+1,t,2)}function uQ(e,t){return Je(e.getUTCMinutes(),t,2)}function cQ(e,t){return Je(e.getUTCSeconds(),t,2)}function dQ(e){var t=e.getUTCDay();return t===0?7:t}function fQ(e,t){return Je(um.count(Ra(e)-1,e),t,2)}function RC(e){var t=e.getUTCDay();return t>=4||t===0?Ys(e):Ys.ceil(e)}function pQ(e,t){return e=RC(e),Je(Ys.count(Ra(e),e)+(Ra(e).getUTCDay()===4),t,2)}function hQ(e){return e.getUTCDay()}function mQ(e,t){return Je(Tp.count(Ra(e)-1,e),t,2)}function yQ(e,t){return Je(e.getUTCFullYear()%100,t,2)}function vQ(e,t){return e=RC(e),Je(e.getUTCFullYear()%100,t,2)}function gQ(e,t){return Je(e.getUTCFullYear()%1e4,t,4)}function xQ(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ys(e):Ys.ceil(e),Je(e.getUTCFullYear()%1e4,t,4)}function bQ(){return"+0000"}function aO(){return"%"}function iO(e){return+e}function oO(e){return Math.floor(+e/1e3)}var Ho,MC,DC;wQ({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wQ(e){return Ho=wZ(e),MC=Ho.format,Ho.parse,DC=Ho.utcFormat,Ho.utcParse,Ho}function _Q(e){return new Date(e)}function SQ(e){return e instanceof Date?+e:+new Date(+e)}function fw(e,t,r,n,a,i,o,s,l,u){var f=Qb(),d=f.invert,p=f.domain,h=u(".%L"),g=u(":%S"),y=u("%I:%M"),v=u("%I %p"),x=u("%a %d"),m=u("%b %d"),w=u("%B"),S=u("%Y");function b(_){return(l(_)<_?h:s(_)<_?g:o(_)<_?y:i(_)<_?v:n(_)<_?a(_)<_?x:m:r(_)<_?w:S)(_)}return f.invert=function(_){return new Date(d(_))},f.domain=function(_){return arguments.length?p(Array.from(_,SQ)):p().map(_Q)},f.ticks=function(_){var O=p();return e(O[0],O[O.length-1],_??10)},f.tickFormat=function(_,O){return O==null?b:u(O)},f.nice=function(_){var O=p();return(!_||typeof _.range!="function")&&(_=t(O[0],O[O.length-1],_??10)),_?p(SC(O,_)):f},f.copy=function(){return cd(f,fw(e,t,r,n,a,i,o,s,l,u))},f}function jQ(){return Sn.apply(fw(xZ,bZ,Ia,cw,lm,dd,lw,ow,io,MC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function OQ(){return Sn.apply(fw(vZ,gZ,Ra,dw,um,sm,uw,sw,io,DC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function cm(){var e=0,t=1,r,n,a,i,o=kr,s=!1,l;function u(d){return d==null||isNaN(d=+d)?l:o(a===0?.5:(d=(i(d)-r)*a,s?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(s=!!d,u):s},u.interpolator=function(d){return arguments.length?(o=d,u):o};function f(d){return function(p){var h,g;return arguments.length?([h,g]=p,o=d(h,g),u):[o(0),o(1)]}}return u.range=f(Tl),u.rangeRound=f(Zb),u.unknown=function(d){return arguments.length?(l=d,u):l},function(d){return i=d,r=d(e),n=d(t),a=r===n?0:1/(n-r),u}}function Di(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function LC(){var e=Mi(cm()(kr));return e.copy=function(){return Di(e,LC())},Va.apply(e,arguments)}function FC(){var e=tw(cm()).domain([1,10]);return e.copy=function(){return Di(e,FC()).base(e.base())},Va.apply(e,arguments)}function zC(){var e=rw(cm());return e.copy=function(){return Di(e,zC()).constant(e.constant())},Va.apply(e,arguments)}function pw(){var e=nw(cm());return e.copy=function(){return Di(e,pw()).exponent(e.exponent())},Va.apply(e,arguments)}function kQ(){return pw.apply(null,arguments).exponent(.5)}function BC(){var e=[],t=kr;function r(n){if(n!=null&&!isNaN(n=+n))return t((ld(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Si),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>fY(e,i/n))},r.copy=function(){return BC(t).domain(e)},Va.apply(r,arguments)}function dm(){var e=0,t=.5,r=1,n=1,a,i,o,s,l,u=kr,f,d=!1,p;function h(y){return isNaN(y=+y)?p:(y=.5+((y=+f(y))-i)*(n*yt}var HC=NQ,CQ=fm,TQ=HC,$Q=Cl;function IQ(e){return e&&e.length?CQ(e,$Q,TQ):void 0}var RQ=IQ;const ci=rt(RQ);function MQ(e,t){return ee.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};pe.decimalPlaces=pe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};pe.dividedBy=pe.div=function(e){return ka(this,new this.constructor(e))};pe.dividedToIntegerBy=pe.idiv=function(e){var t=this,r=t.constructor;return dt(ka(t,new r(e),0,1),r.precision)};pe.equals=pe.eq=function(e){return!this.cmp(e)};pe.exponent=function(){return zt(this)};pe.greaterThan=pe.gt=function(e){return this.cmp(e)>0};pe.greaterThanOrEqualTo=pe.gte=function(e){return this.cmp(e)>=0};pe.isInteger=pe.isint=function(){return this.e>this.d.length-2};pe.isNegative=pe.isneg=function(){return this.s<0};pe.isPositive=pe.ispos=function(){return this.s>0};pe.isZero=function(){return this.s===0};pe.lessThan=pe.lt=function(e){return this.cmp(e)<0};pe.lessThanOrEqualTo=pe.lte=function(e){return this.cmp(e)<1};pe.logarithm=pe.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(qr))throw Error(bn+"NaN");if(r.s<1)throw Error(bn+(r.s?"NaN":"-Infinity"));return r.eq(qr)?new n(0):(St=!1,t=ka(kc(r,i),kc(e,i),i),St=!0,dt(t,a))};pe.minus=pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?YC(t,e):KC(t,(e.s=-e.s,e))};pe.modulo=pe.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(bn+"NaN");return r.s?(St=!1,t=ka(r,e,0,1).times(e),St=!0,r.minus(t)):dt(new n(r),a)};pe.naturalExponential=pe.exp=function(){return XC(this)};pe.naturalLogarithm=pe.ln=function(){return kc(this)};pe.negated=pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};pe.plus=pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KC(t,e):YC(t,(e.s=-e.s,e))};pe.precision=pe.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(po+e);if(t=zt(a)+1,n=a.d.length-1,r=n*xt+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};pe.squareRoot=pe.sqrt=function(){var e,t,r,n,a,i,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(bn+"NaN")}for(e=zt(s),St=!1,a=Math.sqrt(+s),a==0||a==1/0?(t=Kn(s.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Il((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(a.toString()),r=l.precision,a=o=r+3;;)if(i=n,n=i.plus(ka(s,i,o+2)).times(.5),Kn(i.d).slice(0,o)===(t=Kn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(dt(i,r+1,0),i.times(i).eq(s)){n=i;break}}else if(t!="9999")break;o+=4}return St=!0,dt(n,r)};pe.times=pe.mul=function(e){var t,r,n,a,i,o,s,l,u,f=this,d=f.constructor,p=f.d,h=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,l=p.length,u=h.length,l=0;){for(t=0,a=l+n;a>n;)s=i[a]+h[n]*p[a-n-1]+t,i[a--]=s%Jt|0,t=s/Jt|0;i[a]=(i[a]+t)%Jt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,St?dt(e,d.precision):e};pe.toDecimalPlaces=pe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(na(e,0,$l),t===void 0?t=n.rounding:na(t,0,8),dt(r,e+zt(r)+1,t))};pe.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=Eo(n,!0):(na(e,0,$l),t===void 0?t=a.rounding:na(t,0,8),n=dt(new a(n),e+1,t),r=Eo(n,!0,e+1)),r};pe.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?Eo(a):(na(e,0,$l),t===void 0?t=i.rounding:na(t,0,8),n=dt(new i(a),e+zt(a)+1,t),r=Eo(n.abs(),!1,e+zt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};pe.toInteger=pe.toint=function(){var e=this,t=e.constructor;return dt(new t(e),zt(e)+1,t.rounding)};pe.toNumber=function(){return+this};pe.toPower=pe.pow=function(e){var t,r,n,a,i,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(qr);if(s=new l(s),!s.s){if(e.s<1)throw Error(bn+"Infinity");return s}if(s.eq(qr))return s;if(n=l.precision,e.eq(qr))return dt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=s.s,o){if((r=f<0?-f:f)<=qC){for(a=new l(qr),t=Math.ceil(n/xt+4),St=!1;r%2&&(a=a.times(s),uO(a.d,t)),r=Il(r/2),r!==0;)s=s.times(s),uO(s.d,t);return St=!0,e.s<0?new l(qr).div(a):dt(a,n)}}else if(i<0)throw Error(bn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,St=!1,a=e.times(kc(s,n+u)),St=!0,a=XC(a),a.s=i,a};pe.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=zt(a),n=Eo(a,r<=i.toExpNeg||r>=i.toExpPos)):(na(e,1,$l),t===void 0?t=i.rounding:na(t,0,8),a=dt(new i(a),e,t),r=zt(a),n=Eo(a,e<=r||r<=i.toExpNeg,e)),n};pe.toSignificantDigits=pe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(na(e,1,$l),t===void 0?t=n.rounding:na(t,0,8)),dt(new n(r),e,t)};pe.toString=pe.valueOf=pe.val=pe.toJSON=pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=zt(e),r=e.constructor;return Eo(e,t<=r.toExpNeg||t>=r.toExpPos)};function KC(e,t){var r,n,a,i,o,s,l,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),St?dt(t,d):t;if(l=e.d,u=t.d,o=e.e,a=t.e,l=l.slice(),i=o-a,i){for(i<0?(n=l,i=-i,s=u.length):(n=u,a=o,s=l.length),o=Math.ceil(d/xt),s=o>s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,n=u,u=l,l=n),r=0;i;)r=(l[--i]=l[i]+u[i]+r)/Jt|0,l[i]%=Jt;for(r&&(l.unshift(r),++a),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=a,St?dt(t,d):t}function na(e,t,r){if(e!==~~e||er)throw Error(po+e)}function Kn(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;to?1:-1;else for(s=l=0;sa[s]?1:-1;break}return l}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]1;)n.shift()}return function(n,a,i,o){var s,l,u,f,d,p,h,g,y,v,x,m,w,S,b,_,O,k,A=n.constructor,$=n.s==a.s?1:-1,T=n.d,P=a.d;if(!n.s)return new A(n);if(!a.s)throw Error(bn+"Division by zero");for(l=n.e-a.e,O=P.length,b=T.length,h=new A($),g=h.d=[],u=0;P[u]==(T[u]||0);)++u;if(P[u]>(T[u]||0)&&--l,i==null?m=i=A.precision:o?m=i+(zt(n)-zt(a))+1:m=i,m<0)return new A(0);if(m=m/xt+2|0,u=0,O==1)for(f=0,P=P[0],m++;(u1&&(P=e(P,f),T=e(T,f),O=P.length,b=T.length),S=O,y=T.slice(0,O),v=y.length;v=Jt/2&&++_;do f=0,s=t(P,y,O,v),s<0?(x=y[0],O!=v&&(x=x*Jt+(y[1]||0)),f=x/_|0,f>1?(f>=Jt&&(f=Jt-1),d=e(P,f),p=d.length,v=y.length,s=t(d,y,p,v),s==1&&(f--,r(d,O16)throw Error(mw+zt(e));if(!e.s)return new f(qr);for(St=!1,s=d,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Zi(2,u))/Math.LN10*2+5|0,s+=n,r=a=i=new f(qr),f.precision=s;;){if(a=dt(a.times(e),s),r=r.times(++l),o=i.plus(ka(a,r,s)),Kn(o.d).slice(0,s)===Kn(i.d).slice(0,s)){for(;u--;)i=dt(i.times(i),s);return f.precision=d,t==null?(St=!0,dt(i,d)):i}i=o}}function zt(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function Hy(e,t,r){if(t>e.LN10.sd())throw St=!0,r&&(e.precision=r),Error(bn+"LN10 precision limit exceeded");return dt(new e(e.LN10),t)}function ri(e){for(var t="";e--;)t+="0";return t}function kc(e,t){var r,n,a,i,o,s,l,u,f,d=1,p=10,h=e,g=h.d,y=h.constructor,v=y.precision;if(h.s<1)throw Error(bn+(h.s?"NaN":"-Infinity"));if(h.eq(qr))return new y(0);if(t==null?(St=!1,u=v):u=t,h.eq(10))return t==null&&(St=!0),Hy(y,u);if(u+=p,y.precision=u,r=Kn(g),n=r.charAt(0),i=zt(h),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Kn(h.d),n=r.charAt(0),d++;i=zt(h),n>1?(h=new y("0."+r),i++):h=new y(n+"."+r.slice(1))}else return l=Hy(y,u+2,v).times(i+""),h=kc(new y(n+"."+r.slice(1)),u-p).plus(l),y.precision=v,t==null?(St=!0,dt(h,v)):h;for(s=o=h=ka(h.minus(qr),h.plus(qr),u),f=dt(h.times(h),u),a=3;;){if(o=dt(o.times(f),u),l=s.plus(ka(o,new y(a),u)),Kn(l.d).slice(0,u)===Kn(s.d).slice(0,u))return s=s.times(2),i!==0&&(s=s.plus(Hy(y,u+2,v).times(i+""))),s=ka(s,new y(d),u),y.precision=v,t==null?(St=!0,dt(s,v)):s;s=l,a+=2}}function lO(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Il(r/xt),e.d=[],n=(r+1)%xt,r<0&&(n+=xt),n$p||e.e<-$p))throw Error(mw+r)}else e.s=0,e.e=0,e.d=[0];return e}function dt(e,t,r){var n,a,i,o,s,l,u,f,d=e.d;for(o=1,i=d[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=xt,a=t,u=d[f=0];else{if(f=Math.ceil((n+1)/xt),i=d.length,f>=i)return e;for(u=i=d[f],o=1;i>=10;i/=10)o++;n%=xt,a=n-xt+o}if(r!==void 0&&(i=Zi(10,o-a-1),s=u/i%10|0,l=t<0||d[f+1]!==void 0||u%i,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?a>0?u/Zi(10,o-a):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(i=zt(e),d.length=1,t=t-i-1,d[0]=Zi(10,(xt-t%xt)%xt),e.e=Il(-t/xt)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,i=1,f--):(d.length=f+1,i=Zi(10,xt-n),d[f]=a>0?(u/Zi(10,o-a)%Zi(10,a)|0)*i:0),l)for(;;)if(f==0){(d[0]+=i)==Jt&&(d[0]=1,++e.e);break}else{if(d[f]+=i,d[f]!=Jt)break;d[f--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(St&&(e.e>$p||e.e<-$p))throw Error(mw+zt(e));return e}function YC(e,t){var r,n,a,i,o,s,l,u,f,d,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),St?dt(t,h):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=d.length):(r=d,n=u,s=l.length),a=Math.max(Math.ceil(h/xt),s)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=l.length,s=d.length,f=a0;--a)l[s++]=0;for(a=d.length;a>o;){if(l[--a]0?i=i.charAt(0)+"."+i.slice(1)+ri(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+ri(-a-1)+i,r&&(n=r-o)>0&&(i+=ri(n))):a>=o?(i+=ri(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+ri(n))):((n=a+1)0&&(a+1===o&&(i+="."),i+=ri(n))),e.s<0?"-"+i:i}function uO(e,t){if(e.length>t)return e.length=t,!0}function ZC(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(po+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return lO(o,i.toString())}else if(typeof i!="string")throw Error(po+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,nJ.test(i))lO(o,i);else throw Error(po+i)}if(a.prototype=pe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=ZC,a.config=a.set=aJ,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(po+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(po+r+": "+n);return this}var yw=ZC(rJ);qr=new yw(1);const lt=yw;function iJ(e){return uJ(e)||lJ(e)||sJ(e)||oJ()}function oJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sJ(e,t){if(e){if(typeof e=="string")return d0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d0(e,t)}}function lJ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function uJ(e){if(Array.isArray(e))return d0(e)}function d0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-o,cO(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){a=!0,i=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function jJ(e){if(Array.isArray(e))return e}function rT(e){var t=Ac(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function nT(e,t,r){if(e.lte(0))return new lt(0);var n=mm.getDigitCount(e.toNumber()),a=new lt(10).pow(n),i=e.div(a),o=n!==1?.05:.1,s=new lt(Math.ceil(i.div(o).toNumber())).add(r).mul(o),l=s.mul(a);return t?l:new lt(Math.ceil(l))}function OJ(e,t,r){var n=1,a=new lt(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new lt(10).pow(mm.getDigitCount(e)-1),a=new lt(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new lt(Math.floor(e)))}else e===0?a=new lt(Math.floor((t-1)/2)):r||(a=new lt(Math.floor(e)));var o=Math.floor((t-1)/2),s=pJ(fJ(function(l){return a.add(new lt(l-o).mul(n)).toNumber()}),f0);return s(0,t)}function aT(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new lt(0),tickMin:new lt(0),tickMax:new lt(0)};var i=nT(new lt(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new lt(0):(o=new lt(e).add(t).div(2),o=o.sub(new lt(o).mod(i)));var s=Math.ceil(o.sub(e).div(i).toNumber()),l=Math.ceil(new lt(t).sub(o).div(i).toNumber()),u=s+l+1;return u>r?aT(e,t,r,n,a+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:i,tickMin:o.sub(new lt(s).mul(i)),tickMax:o.add(new lt(l).mul(i))})}function kJ(e){var t=Ac(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),s=rT([r,n]),l=Ac(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(h0(f0(0,a-1).map(function(){return 1/0}))):[].concat(h0(f0(0,a-1).map(function(){return-1/0})),[f]);return r>n?p0(d):d}if(u===f)return OJ(u,a,i);var p=aT(u,f,o,i),h=p.step,g=p.tickMin,y=p.tickMax,v=mm.rangeStep(g,y.add(new lt(.1).mul(h)),h);return r>n?p0(v):v}function AJ(e,t){var r=Ac(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=rT([n,a]),s=Ac(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,a];if(l===u)return[l];var f=Math.max(t,2),d=nT(new lt(u).sub(l).div(f-1),i,0),p=[].concat(h0(mm.rangeStep(new lt(l),new lt(u).sub(new lt(.99).mul(d)),d)),[u]);return n>a?p0(p):p}var EJ=eT(kJ),PJ=eT(AJ),NJ="Invariant failed";function Po(e,t){throw new Error(NJ)}var CJ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Zs(e){"@babel/helpers - typeof";return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs(e)}function Ip(){return Ip=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function FJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zJ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var l=i.range,u=0;u0?a[u-1].coordinate:a[s-1].coordinate,d=a[u].coordinate,p=u>=s-1?a[0].coordinate:a[u+1].coordinate,h=void 0;if(jr(d-f)!==jr(p-d)){var g=[];if(jr(p-d)===jr(l[1]-l[0])){h=p;var y=d+l[1]-l[0];g[0]=Math.min(y,(y+f)/2),g[1]=Math.max(y,(y+f)/2)}else{h=f;var v=p+l[1]-l[0];g[0]=Math.min(d,(v+d)/2),g[1]=Math.max(d,(v+d)/2)}var x=[Math.min(d,(h+d)/2),Math.max(d,(h+d)/2)];if(t>x[0]&&t<=x[1]||t>=g[0]&&t<=g[1]){o=a[u].index;break}}else{var m=Math.min(f,p),w=Math.max(f,p);if(t>(m+d)/2&&t<=(w+d)/2){o=a[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},vw=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,o=i.stroke,s=i.fill,l;switch(a){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},nee=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},s=Object.keys(i),l=0,u=s.length;l=0});if(x&&x.length){var m=x[0].type.defaultProps,w=m!==void 0?Ct(Ct({},m),x[0].props):x[0].props,S=w.barSize,b=w[v];o[b]||(o[b]=[]);var _=Ne(S)?r:S;o[b].push({item:x[0],stackList:x.slice(1),barSize:Ne(_)?void 0:Or(_,n,0)})}}return o},aee=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=Or(r,a,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=a/l,g=o.reduce(function(S,b){return S+b.barSize||0},0);g+=(l-1)*u,g>=a&&(g-=(l-1)*u,u=0),g>=a&&h>0&&(p=!0,h*=.9,g=l*h);var y=(a-g)/2>>0,v={offset:y-u,size:0};f=o.reduce(function(S,b){var _={item:b.item,position:{offset:v.offset+v.size+u,size:p?h:b.barSize}},O=[].concat(pO(S),[_]);return v=O[O.length-1].position,b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:v})}),O},d)}else{var x=Or(n,a,0,!0);a-2*x-(l-1)*u<=0&&(u=0);var m=(a-2*x-(l-1)*u)/l;m>1&&(m>>=0);var w=s===+s?Math.min(m,s):m;f=o.reduce(function(S,b,_){var O=[].concat(pO(S),[{item:b.item,position:{offset:x+(m+u)*_+(m-w)/2,size:w}}]);return b.stackList&&b.stackList.length&&b.stackList.forEach(function(k){O.push({item:k,position:O[O.length-1].position})}),O},d)}return f},iee=function(t,r,n,a){var i=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=lT({children:i,legendWidth:l});if(u){var f=a||{},d=f.width,p=f.height,h=u.align,g=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&g==="middle")&&h!=="center"&&re(t[h]))return Ct(Ct({},t),{},Es({},h,t[h]+(d||0)));if((y==="horizontal"||y==="vertical"&&h==="center")&&g!=="middle"&&re(t[g]))return Ct(Ct({},t),{},Es({},g,t[g]+(p||0)))}return t},oee=function(t,r,n){return Ne(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},uT=function(t,r,n,a,i){var o=r.props.children,s=Zr(o,fd).filter(function(u){return oee(a,i,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Rt(f,n);if(Ne(d))return u;var p=Array.isArray(d)?[pm(d),ci(d)]:[d,d],h=l.reduce(function(g,y){var v=Rt(f,y,0),x=p[0]-Math.abs(Array.isArray(v)?v[0]:v),m=p[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,g[0]),Math.max(m,g[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},see=function(t,r,n,a,i){var o=r.map(function(s){return uT(t,s,n,i,a)}).filter(function(s){return!Ne(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},cT=function(t,r,n,a,i){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&uT(t,l,u,a)||Du(t,u,n,i)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,d=u.length;f=2?jr(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var p=i?i.indexOf(d):d;return{coordinate:a(p)+u,value:d,offset:u}});return f.filter(function(d){return!El(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,p){return{coordinate:a(d)+u,value:d,index:p,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(d){return{coordinate:a(d)+u,value:d,offset:u}}):a.domain().map(function(d,p){return{coordinate:a(d)+u,value:i?i[d]:d,index:p,offset:u}})},Gy=new WeakMap,Gd=function(t,r){if(typeof r!="function")return t;Gy.has(t)||Gy.set(t,new WeakMap);var n=Gy.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},pT=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,s=t.axisType;if(a==="auto")return o==="radial"&&s==="radiusAxis"?{scale:wc(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Pp(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Mu(),realScaleType:"point"}:i==="category"?{scale:wc(),realScaleType:"band"}:{scale:Pp(),realScaleType:"linear"};if(jo(a)){var l="scale".concat(Jh(a));return{scale:(sO[l]||Mu)(),realScaleType:sO[l]?l:"point"}}return je(a)?{scale:a}:{scale:Mu(),realScaleType:"point"}},mO=1e-4,hT=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-mO,o=Math.max(a[0],a[1])+mO,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},lee=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},dee=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[o][n][0]=i,t[o][n][1]=i+s,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},fee={sign:cee,expand:CU,none:Vs,silhouette:TU,wiggle:$U,positive:dee},pee=function(t,r,n){var a=r.map(function(s){return s.props.dataKey}),i=fee[n],o=NU().keys(a).value(function(s,l){return+Rt(s,l,0)}).order(Ug).offset(i);return o(t)},hee=function(t,r,n,a,i,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(d,p){var h,g=(h=p.type)!==null&&h!==void 0&&h.defaultProps?Ct(Ct({},p.type.defaultProps),p.props):p.props,y=g.stackId,v=g.hide;if(v)return d;var x=g[n],m=d[x]||{hasStack:!1,stackGroups:{}};if(qt(y)){var w=m.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};w.items.push(p),m.hasStack=!0,m.stackGroups[y]=w}else m.stackGroups[Ro("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[p]};return Ct(Ct({},d),{},Es({},x,m))},l),f={};return Object.keys(u).reduce(function(d,p){var h=u[p];if(h.hasStack){var g={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(y,v){var x=h.stackGroups[v];return Ct(Ct({},y),{},Es({},v,{numericAxisId:n,cateAxisId:a,items:x.items,stackedData:pee(t,x.items,i)}))},g)}return Ct(Ct({},d),{},Es({},p,h))},f)},mT=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=EJ(u,i,s);return t.domain([pm(f),ci(f)]),{niceTicks:f}}if(i&&a==="number"){var d=t.domain(),p=PJ(d,i,s);return{niceTicks:p}}return null};function Mp(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ne(a[t.dataKey])){var s=sp(r,"value",a[t.dataKey]);if(s)return s.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var l=Rt(a,Ne(o)?t.dataKey:o);return Ne(l)?null:t.scale(l)}var yO=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+a:null;var l=Rt(o,r.dataKey,r.domain[s]);return Ne(l)?null:r.scale(l)-i/2+a},mee=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},yee=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(qt(i)){var o=r[i];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},vee=function(t){return t.reduce(function(r,n){return[pm(n.concat([r[0]]).filter(re)),ci(n.concat([r[1]]).filter(re))]},[1/0,-1/0])},yT=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],s=o.stackedData,l=s.reduce(function(u,f){var d=vee(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],a[0]),Math.max(l[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},vO=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gO=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,g0=function(t,r,n){if(je(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(re(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(vO.test(t[0])){var i=+vO.exec(t[0])[1];a[0]=r[0]-i}else je(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(re(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(gO.test(t[1])){var o=+gO.exec(t[1])[1];a[1]=r[1]+o}else je(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Dp=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=Hb(r,function(d){return d.coordinate}),o=1/0,s=1,l=i.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},kee=function(t,r,n,a,i){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=Or(t.cx,o,o/2),d=Or(t.cy,s,s/2),p=xT(o,s,n),h=Or(t.innerRadius,p,0),g=Or(t.outerRadius,p,p*.8),y=Object.keys(r);return y.reduce(function(v,x){var m=r[x],w=m.domain,S=m.reversed,b;if(Ne(m.range))a==="angleAxis"?b=[l,u]:a==="radiusAxis"&&(b=[h,g]),S&&(b=[b[1],b[0]]);else{b=m.range;var _=b,O=bee(_,2);l=O[0],u=O[1]}var k=pT(m,i),A=k.realScaleType,$=k.scale;$.domain(w).range(b),hT($);var T=mT($,pa(pa({},m),{},{realScaleType:A})),P=pa(pa(pa({},m),T),{},{range:b,radius:g,realScaleType:A,scale:$,cx:f,cy:d,innerRadius:h,outerRadius:g,startAngle:l,endAngle:u});return pa(pa({},v),{},gT({},x,P))},{})},Aee=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},Eee=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,s=Aee({x:n,y:a},{x:i,y:o});if(s<=0)return{radius:s};var l=(n-i)/s,u=Math.acos(l);return a>o&&(u=2*Math.PI-u),{radius:s,angle:Oee(u),angleInRadian:u}},Pee=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},Nee=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),s=Math.min(i,o);return t+s*360},_O=function(t,r){var n=t.x,a=t.y,i=Eee({x:n,y:a},r),o=i.radius,s=i.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=Pee(r),d=f.startAngle,p=f.endAngle,h=s,g;if(d<=p){for(;h>p;)h-=360;for(;h=d&&h<=p}else{for(;h>d;)h-=360;for(;h=p&&h<=d}return g?pa(pa({},r),{},{radius:o,angle:Nee(h,r)}):null},bT=function(t){return!j.isValidElement(t)&&!je(t)&&typeof t!="boolean"?t.className:""};function Cc(e){"@babel/helpers - typeof";return Cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cc(e)}var Cee=["offset"];function Tee(e){return Mee(e)||Ree(e)||Iee(e)||$ee()}function $ee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iee(e,t){if(e){if(typeof e=="string")return x0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x0(e,t)}}function Ree(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mee(e){if(Array.isArray(e))return x0(e)}function x0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function SO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ut(e){for(var t=1;t=0?1:-1,w,S;a==="insideStart"?(w=h+m*o,S=y):a==="insideEnd"?(w=g-m*o,S=!y):a==="end"&&(w=g+m*o,S=y),S=x<=0?S:!S;var b=mt(u,f,v,w),_=mt(u,f,v,w+(S?1:-1)*359),O="M".concat(b.x,",").concat(b.y,` + A`).concat(v,",").concat(v,",0,1,").concat(S?0:1,`, + `).concat(_.x,",").concat(_.y),k=Ne(t.id)?Ro("recharts-radial-line-"):t.id;return C.createElement("text",Tc({},n,{dominantBaseline:"central",className:De("recharts-radial-bar-label",s)}),C.createElement("defs",null,C.createElement("path",{id:k,d:O})),C.createElement("textPath",{xlinkHref:"#".concat(k)},r))},Hee=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,s=i.cy,l=i.innerRadius,u=i.outerRadius,f=i.startAngle,d=i.endAngle,p=(f+d)/2;if(a==="outside"){var h=mt(o,s,u+n,p),g=h.x,y=h.y;return{x:g,y,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var v=(l+u)/2,x=mt(o,s,v,p),m=x.x,w=x.y;return{x:m,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Gee=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,d=f>=0?1:-1,p=d*a,h=d>0?"end":"start",g=d>0?"start":"end",y=u>=0?1:-1,v=y*a,x=y>0?"end":"start",m=y>0?"start":"end";if(i==="top"){var w={x:s+u/2,y:l-d*a,textAnchor:"middle",verticalAnchor:h};return Ut(Ut({},w),n?{height:Math.max(l-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:s+u/2,y:l+f+p,textAnchor:"middle",verticalAnchor:g};return Ut(Ut({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(i==="left"){var b={x:s-v,y:l+f/2,textAnchor:x,verticalAnchor:"middle"};return Ut(Ut({},b),n?{width:Math.max(b.x-n.x,0),height:f}:{})}if(i==="right"){var _={x:s+u+v,y:l+f/2,textAnchor:m,verticalAnchor:"middle"};return Ut(Ut({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return i==="insideLeft"?Ut({x:s+v,y:l+f/2,textAnchor:m,verticalAnchor:"middle"},O):i==="insideRight"?Ut({x:s+u-v,y:l+f/2,textAnchor:x,verticalAnchor:"middle"},O):i==="insideTop"?Ut({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:g},O):i==="insideBottom"?Ut({x:s+u/2,y:l+f-p,textAnchor:"middle",verticalAnchor:h},O):i==="insideTopLeft"?Ut({x:s+v,y:l+p,textAnchor:m,verticalAnchor:g},O):i==="insideTopRight"?Ut({x:s+u-v,y:l+p,textAnchor:x,verticalAnchor:g},O):i==="insideBottomLeft"?Ut({x:s+v,y:l+f-p,textAnchor:m,verticalAnchor:h},O):i==="insideBottomRight"?Ut({x:s+u-v,y:l+f-p,textAnchor:x,verticalAnchor:h},O):jl(i)&&(re(i.x)||no(i.x))&&(re(i.y)||no(i.y))?Ut({x:s+Or(i.x,u),y:l+Or(i.y,f),textAnchor:"end",verticalAnchor:"end"},O):Ut({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},qee=function(t){return"cx"in t&&re(t.cx)};function rr(e){var t=e.offset,r=t===void 0?5:t,n=Dee(e,Cee),a=Ut({offset:r},n),i=a.viewBox,o=a.position,s=a.value,l=a.children,u=a.content,f=a.className,d=f===void 0?"":f,p=a.textBreakAll;if(!i||Ne(s)&&Ne(l)&&!j.isValidElement(u)&&!je(u))return null;if(j.isValidElement(u))return j.cloneElement(u,a);var h;if(je(u)){if(h=j.createElement(u,a),j.isValidElement(h))return h}else h=Uee(a);var g=qee(i),y=we(a,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Wee(a,h,y);var v=g?Hee(a):Gee(a);return C.createElement(ko,Tc({className:De("recharts-label",d)},y,v,{breakAll:p}),h)}rr.displayName="Label";var wT=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,p=t.y,h=t.top,g=t.left,y=t.width,v=t.height,x=t.clockWise,m=t.labelViewBox;if(m)return m;if(re(y)&&re(v)){if(re(d)&&re(p))return{x:d,y:p,width:y,height:v};if(re(h)&&re(g))return{x:h,y:g,width:y,height:v}}return re(d)&&re(p)?{x:d,y:p,width:0,height:0}:re(r)&&re(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:x}:t.viewBox?t.viewBox:{}},Kee=function(t,r){return t?t===!0?C.createElement(rr,{key:"label-implicit",viewBox:r}):qt(t)?C.createElement(rr,{key:"label-implicit",viewBox:r,value:t}):j.isValidElement(t)?t.type===rr?j.cloneElement(t,{key:"label-implicit",viewBox:r}):C.createElement(rr,{key:"label-implicit",content:t,viewBox:r}):je(t)?C.createElement(rr,{key:"label-implicit",content:t,viewBox:r}):jl(t)?C.createElement(rr,Tc({viewBox:r},t,{key:"label-implicit"})):null:null},Xee=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=wT(t),o=Zr(a,rr).map(function(l,u){return j.cloneElement(l,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var s=Kee(t.label,r||i);return[s].concat(Tee(o))};rr.parseViewBox=wT;rr.renderCallByParent=Xee;function Yee(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Zee=Yee;const Qee=rt(Zee);function $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}var Jee=["valueAccessor"],ete=["data","dataKey","clockWise","id","textBreakAll"];function tte(e){return ite(e)||ate(e)||nte(e)||rte()}function rte(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nte(e,t){if(e){if(typeof e=="string")return b0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b0(e,t)}}function ate(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ite(e){if(Array.isArray(e))return b0(e)}function b0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ute(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var cte=function(t){return Array.isArray(t.value)?Qee(t.value):t.value};function ea(e){var t=e.valueAccessor,r=t===void 0?cte:t,n=kO(e,Jee),a=n.data,i=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=kO(n,ete);return!a||!a.length?null:C.createElement(We,{className:"recharts-label-list"},a.map(function(f,d){var p=Ne(i)?r(f,d):Rt(f&&f.payload,i),h=Ne(s)?{}:{id:"".concat(s,"-").concat(d)};return C.createElement(rr,Fp({},we(f,!0),u,h,{parentViewBox:f.parentViewBox,value:p,textBreakAll:l,viewBox:rr.parseViewBox(Ne(o)?f:OO(OO({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}ea.displayName="LabelList";function dte(e,t){return e?e===!0?C.createElement(ea,{key:"labelList-implicit",data:t}):C.isValidElement(e)||je(e)?C.createElement(ea,{key:"labelList-implicit",data:t,content:e}):jl(e)?C.createElement(ea,Fp({data:t},e,{key:"labelList-implicit"})):null:null}function fte(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=Zr(n,ea).map(function(o,s){return j.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return a;var i=dte(e.label,t);return[i].concat(tte(a))}ea.renderCallByParent=fte;function Ic(e){"@babel/helpers - typeof";return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(e)}function w0(){return w0=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, + `).concat(d.x,",").concat(d.y,` + `);if(a>0){var h=mt(r,n,a,o),g=mt(r,n,a,u);p+="L ".concat(g.x,",").concat(g.y,` + A `).concat(a,",").concat(a,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, + `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},vte=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=jr(f-u),p=qd({cx:r,cy:n,radius:i,angle:u,sign:d,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,g=p.lineTangency,y=p.theta,v=qd({cx:r,cy:n,radius:i,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:l}),x=v.circleTangency,m=v.lineTangency,w=v.theta,S=l?Math.abs(u-f):Math.abs(u-f)-y-w;if(S<0)return s?"M ".concat(g.x,",").concat(g.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):_T({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:f});var b="M ".concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(h.x,",").concat(h.y,` + A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(x.x,",").concat(x.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,` + `);if(a>0){var _=qd({cx:r,cy:n,radius:a,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=_.circleTangency,k=_.lineTangency,A=_.theta,$=qd({cx:r,cy:n,radius:a,angle:f,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),T=$.circleTangency,P=$.lineTangency,R=$.theta,L=l?Math.abs(u-f):Math.abs(u-f)-A-R;if(L<0&&o===0)return"".concat(b,"L").concat(r,",").concat(n,"Z");b+="L".concat(P.x,",").concat(P.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(T.x,",").concat(T.y,` + A`).concat(a,",").concat(a,",0,").concat(+(L>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(k.x,",").concat(k.y,"Z")}else b+="L".concat(r,",").concat(n,"Z");return b},gte={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ST=function(t){var r=EO(EO({},gte),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,p=r.className;if(o0&&Math.abs(f-d)<360?v=vte({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,g/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:d}):v=_T({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:f,endAngle:d}),C.createElement("path",w0({},we(r,!0),{className:h,d:v,role:"img"}))};function Rc(e){"@babel/helpers - typeof";return Rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rc(e)}function _0(){return _0=Object.assign?Object.assign.bind():function(e){for(var t=1;tCte.call(e,t));function Lo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Ite="__v",Rte="__o",Mte="_owner",{getOwnPropertyDescriptor:$O,keys:IO}=Object;function Dte(e,t){return e.byteLength===t.byteLength&&zp(new Uint8Array(e),new Uint8Array(t))}function Lte(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Fte(e,t){return e.byteLength===t.byteLength&&zp(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function zte(e,t){return Lo(e.getTime(),t.getTime())}function Bte(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ute(e,t){return e===t}function RO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let o,s,l=0;for(;(o=i.next())&&!o.done;){const u=t.entries();let f=!1,d=0;for(;(s=u.next())&&!s.done;){if(a[d]){d++;continue}const p=o.value,h=s.value;if(r.equals(p[0],h[0],l,d,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){f=a[d]=!0;break}d++}if(!f)return!1;l++}return!0}const Vte=Lo;function Wte(e,t,r){const n=IO(e);let a=n.length;if(IO(t).length!==a)return!1;for(;a-- >0;)if(!AT(e,t,r,n[a]))return!1;return!0}function eu(e,t,r){const n=TO(e);let a=n.length;if(TO(t).length!==a)return!1;let i,o,s;for(;a-- >0;)if(i=n[a],!AT(e,t,r,i)||(o=$O(e,i),s=$O(t,i),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Hte(e,t){return Lo(e.valueOf(),t.valueOf())}function Gte(e,t){return e.source===t.source&&e.flags===t.flags}function MO(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let o,s;for(;(o=i.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!a[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=a[f]=!0;break}f++}if(!u)return!1}return!0}function zp(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function qte(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function AT(e,t,r,n){return(n===Mte||n===Rte||n===Ite)&&(e.$$typeof||t.$$typeof)?!0:$te(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const Kte="[object ArrayBuffer]",Xte="[object Arguments]",Yte="[object Boolean]",Zte="[object DataView]",Qte="[object Date]",Jte="[object Error]",ere="[object Map]",tre="[object Number]",rre="[object Object]",nre="[object RegExp]",are="[object Set]",ire="[object String]",ore={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},sre="[object URL]",lre=Object.prototype.toString;function ure({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:g}){return function(v,x,m){if(v===x)return!0;if(v==null||x==null)return!1;const w=typeof v;if(w!==typeof x)return!1;if(w!=="object")return w==="number"?s(v,x,m):w==="function"?i(v,x,m):!1;const S=v.constructor;if(S!==x.constructor)return!1;if(S===Object)return l(v,x,m);if(Array.isArray(v))return t(v,x,m);if(S===Date)return n(v,x,m);if(S===RegExp)return f(v,x,m);if(S===Map)return o(v,x,m);if(S===Set)return d(v,x,m);const b=lre.call(v);if(b===Qte)return n(v,x,m);if(b===nre)return f(v,x,m);if(b===ere)return o(v,x,m);if(b===are)return d(v,x,m);if(b===rre)return typeof v.then!="function"&&typeof x.then!="function"&&l(v,x,m);if(b===sre)return h(v,x,m);if(b===Jte)return a(v,x,m);if(b===Xte)return l(v,x,m);if(ore[b])return p(v,x,m);if(b===Kte)return e(v,x,m);if(b===Zte)return r(v,x,m);if(b===Yte||b===tre||b===ire)return u(v,x,m);if(g){let _=g[b];if(!_){const O=Tte(v);O&&(_=g[O])}if(_)return _(v,x,m)}return!1}}function cre({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:Dte,areArraysEqual:r?eu:Lte,areDataViewsEqual:Fte,areDatesEqual:zte,areErrorsEqual:Bte,areFunctionsEqual:Ute,areMapsEqual:r?qy(RO,eu):RO,areNumbersEqual:Vte,areObjectsEqual:r?eu:Wte,arePrimitiveWrappersEqual:Hte,areRegExpsEqual:Gte,areSetsEqual:r?qy(MO,eu):MO,areTypedArraysEqual:r?qy(zp,eu):zp,areUrlsEqual:qte,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=Xd(n.areArraysEqual),i=Xd(n.areMapsEqual),o=Xd(n.areObjectsEqual),s=Xd(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:s})}return n}function dre(e){return function(t,r,n,a,i,o,s){return e(t,r,s)}}function fre({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:a})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(s,l){return t(s,l,i)}}const pre=Li();Li({strict:!0});Li({circular:!0});Li({circular:!0,strict:!0});Li({createInternalComparator:()=>Lo});Li({strict:!0,createInternalComparator:()=>Lo});Li({circular:!0,createInternalComparator:()=>Lo});Li({circular:!0,createInternalComparator:()=>Lo,strict:!0});function Li(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=cre(e),o=ure(i),s=r?r(o):dre(o);return fre({circular:t,comparator:o,createState:n,equals:s,strict:a})}function hre(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function DO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):hre(a)};requestAnimationFrame(n)}function S0(e){"@babel/helpers - typeof";return S0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S0(e)}function mre(e){return xre(e)||gre(e)||vre(e)||yre()}function yre(){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 vre(e,t){if(e){if(typeof e=="string")return LO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LO(e,t)}}function LO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:x<0?0:x},y=function(x){for(var m=x>1?1:x,w=m,S=0;S<8;++S){var b=d(w)-m,_=h(w);if(Math.abs(b-m)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,s=o===void 0?17:o,l=function(f,d,p){var h=-(f-d)*n,g=p*i,y=p+(h-g)*s/1e3,v=p*s/1e3+f;return Math.abs(v-d)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yre(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function Ky(e){return ene(e)||Jre(e)||Qre(e)||Zre()}function Zre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qre(e,t){if(e){if(typeof e=="string")return E0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E0(e,t)}}function Jre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ene(e){if(Array.isArray(e))return E0(e)}function E0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vp(e){return Vp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vp(e)}var Bn=function(e){ine(r,e);var t=one(r);function r(n,a){var i;tne(this,r),i=t.call(this,n,a);var o=i.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,d=o.steps,p=o.children,h=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(C0(i)),i.changeStyle=i.changeStyle.bind(C0(i)),!s||h<=0)return i.state={style:{}},typeof p=="function"&&(i.state={style:f}),N0(i);if(d&&d.length)i.state={style:d[0].style};else if(u){if(typeof p=="function")return i.state={style:u},N0(i);i.state={style:l?mu({},l,u):u}}else i.state={style:{}};return i}return nne(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,s=i.canBegin,l=i.attributeName,u=i.shouldReAnimate,f=i.to,d=i.from,p=this.state.style;if(s){if(!o){var h={style:l?mu({},l,f):f};this.state&&p&&(l&&p[l]!==f||!l&&p!==f)&&this.setState(h);return}if(!(pre(a.to,f)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=g||u?d:a.to;if(this.state&&p){var v={style:l?mu({},l,y):y};(l&&p[l]!==y||!l&&p!==y)&&this.setState(v)}this.runAnimation(An(An({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,s=a.to,l=a.duration,u=a.easing,f=a.begin,d=a.onAnimationEnd,p=a.onAnimationStart,h=qre(o,s,Mre(u),l,this.changeStyle),g=function(){i.stopJSAnimation=h()};this.manager.start([p,f,g,l,d])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,s=a.begin,l=a.onAnimationStart,u=o[0],f=u.style,d=u.duration,p=d===void 0?0:d,h=function(y,v,x){if(x===0)return y;var m=v.duration,w=v.easing,S=w===void 0?"ease":w,b=v.style,_=v.properties,O=v.onAnimationEnd,k=x>0?o[x-1]:v,A=_||Object.keys(b);if(typeof S=="function"||S==="spring")return[].concat(Ky(y),[i.runJSAnimation.bind(i,{from:k.style,to:b,duration:m,easing:S}),m]);var $=BO(A,m,S),T=An(An(An({},k.style),b),{},{transition:$});return[].concat(Ky(y),[T,m,O]).filter(jre)};return this.manager.start([l].concat(Ky(o.reduce(h,[f,Math.max(p,s)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=bre());var i=a.begin,o=a.duration,s=a.attributeName,l=a.to,u=a.easing,f=a.onAnimationStart,d=a.onAnimationEnd,p=a.steps,h=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(a);return}if(p.length>1){this.runStepAnimation(a);return}var y=s?mu({},s,l):l,v=BO(Object.keys(y),o,u);g.start([f,i,An(An({},y),{},{transition:v}),o,d])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var s=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var l=Xre(a,Kre),u=j.Children.count(i),f=this.state.style;if(typeof i=="function")return i(f);if(!s||u===0||o<=0)return i;var d=function(h){var g=h.props,y=g.style,v=y===void 0?{}:y,x=g.className,m=j.cloneElement(h,An(An({},l),{},{style:An(An({},v),f),className:x}));return m};return u===1?d(j.Children.only(i)):C.createElement("div",null,j.Children.map(i,function(p){return d(p)}))}}]),r}(j.PureComponent);Bn.displayName="Animate";Bn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Bn.propTypes={from:et.oneOfType([et.object,et.string]),to:et.oneOfType([et.object,et.string]),attributeName:et.string,duration:et.number,begin:et.number,easing:et.oneOfType([et.string,et.func]),steps:et.arrayOf(et.shape({duration:et.number.isRequired,style:et.object.isRequired,easing:et.oneOfType([et.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),et.func]),properties:et.arrayOf("string"),onAnimationEnd:et.func})),children:et.oneOfType([et.node,et.func]),isActive:et.bool,canBegin:et.bool,onAnimationEnd:et.func,shouldReAnimate:et.bool,onAnimationStart:et.func,onAnimationReStart:et.func};function Lc(e){"@babel/helpers - typeof";return Lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lc(e)}function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,f;if(o>0&&i instanceof Array){for(var d=[0,0,0,0],p=0,h=4;po?o:i[p];f="M".concat(t,",").concat(r+s*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+l*d[0],",").concat(r)),f+="L ".concat(t+n-l*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, + `).concat(t+n,",").concat(r+s*d[1])),f+="L ".concat(t+n,",").concat(r+a-s*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`, + `).concat(t+n-l*d[2],",").concat(r+a)),f+="L ".concat(t+l*d[3],",").concat(r+a),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`, + `).concat(t,",").concat(r+a-s*d[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var g=Math.min(o,i);f="M ".concat(t,",").concat(r+s*g,` + A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+l*g,",").concat(r,` + L `).concat(t+n-l*g,",").concat(r,` + A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*g,` + L `).concat(t+n,",").concat(r+a-s*g,` + A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n-l*g,",").concat(r+a,` + L `).concat(t+l*g,",").concat(r+a,` + A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(r+a-s*g," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return f},yne=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(i,i+s),f=Math.max(i,i+s),d=Math.min(o,o+l),p=Math.max(o,o+l);return n>=u&&n<=f&&a>=d&&a<=p}return!1},vne={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},gw=function(t){var r=XO(XO({},vne),t),n=j.useRef(),a=j.useState(-1),i=lne(a,2),o=i[0],s=i[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,d=r.height,p=r.radius,h=r.className,g=r.animationEasing,y=r.animationDuration,v=r.animationBegin,x=r.isAnimationActive,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var w=De("recharts-rectangle",h);return m?C.createElement(Bn,{canBegin:o>0,from:{width:f,height:d,x:l,y:u},to:{width:f,height:d,x:l,y:u},duration:y,animationEasing:g,isActive:m},function(S){var b=S.width,_=S.height,O=S.x,k=S.y;return C.createElement(Bn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,isActive:x,easing:g},C.createElement("path",Wp({},we(r,!0),{className:w,d:YO(O,k,b,_,p),ref:n})))}):C.createElement("path",Wp({},we(r,!0),{className:w,d:YO(l,u,f,d,p)}))},gne=["points","className","baseLinePoints","connectNulls"];function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ZO(e){return jne(e)||Sne(e)||_ne(e)||wne()}function wne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ne(e,t){if(e){if(typeof e=="string")return T0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T0(e,t)}}function Sne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jne(e){if(Array.isArray(e))return T0(e)}function T0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){QO(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),QO(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Fu=function(t,r){var n=One(t);r&&(n=[n.reduce(function(i,o){return[].concat(ZO(i),ZO(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},kne=function(t,r,n){var a=Fu(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Fu(r.reverse(),n).slice(1))},Ane=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=xne(t,gne);if(!r||!r.length)return null;var s=De("recharts-polygon",n);if(a&&a.length){var l=o.stroke&&o.stroke!=="none",u=kne(r,a,i);return C.createElement("g",{className:s},C.createElement("path",fs({},we(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?C.createElement("path",fs({},we(o,!0),{fill:"none",d:Fu(r,i)})):null,l?C.createElement("path",fs({},we(o,!0),{fill:"none",d:Fu(a,i)})):null)}var f=Fu(r,i);return C.createElement("path",fs({},we(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function $0(){return $0=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ine(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Rne=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},Mne=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,d=f===void 0?0:f,p=t.height,h=p===void 0?0:p,g=t.className,y=$ne(t,Ene),v=Pne({x:n,y:i,top:s,left:u,width:d,height:h},y);return!re(n)||!re(i)||!re(d)||!re(h)||!re(s)||!re(u)?null:C.createElement("path",I0({},we(v,!0),{className:De("recharts-cross",g),d:Rne(n,i,d,h,s,u)}))},Dne=fm,Lne=HC,Fne=oa;function zne(e,t){return e&&e.length?Dne(e,Fne(t),Lne):void 0}var Bne=zne;const Une=rt(Bne);var Vne=fm,Wne=oa,Hne=GC;function Gne(e,t){return e&&e.length?Vne(e,Wne(t),Hne):void 0}var qne=Gne;const Kne=rt(qne);var Xne=["cx","cy","angle","ticks","axisLine"],Yne=["ticks","tick","angle","tickFormatter","stroke"];function Js(e){"@babel/helpers - typeof";return Js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Js(e)}function zu(){return zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rk(e,t){for(var r=0;rik?o=a==="outer"?"start":"end":i<-ik?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=Gi(Gi({},we(this.props,!1)),{},{fill:"none"},we(s,!1));if(l==="circle")return C.createElement(pd,Qi({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var f=this.props.ticks,d=f.map(function(p){return mt(a,i,o,p.coordinate)});return C.createElement(Ane,Qi({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,s=a.tickLine,l=a.tickFormatter,u=a.stroke,f=we(this.props,!1),d=we(o,!1),p=Gi(Gi({},f),{},{fill:"none"},we(s,!1)),h=i.map(function(g,y){var v=n.getTickLineCoord(g),x=n.getTickTextAnchor(g),m=Gi(Gi(Gi({textAnchor:x},f),{},{stroke:"none",fill:u},d),{},{index:y,payload:g,x:v.x2,y:v.y2});return C.createElement(We,Qi({className:De("recharts-polar-angle-axis-tick",bT(o)),key:"tick-".concat(g.coordinate)},Oo(n.props,g,y)),s&&C.createElement("line",Qi({className:"recharts-polar-angle-axis-tick-line"},p,v)),o&&t.renderTickItem(o,m,l?l(g.value,y):g.value))});return C.createElement(We,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:C.createElement(We,{className:De("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return C.isValidElement(n)?o=C.cloneElement(n,a):je(n)?o=n(a):o=C.createElement(ko,Qi({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(j.PureComponent);gm(xm,"displayName","PolarAngleAxis");gm(xm,"axisType","angleAxis");gm(xm,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var pae=UN,hae=pae(Object.getPrototypeOf,Object),mae=hae,yae=Ba,vae=mae,gae=Ua,xae="[object Object]",bae=Function.prototype,wae=Object.prototype,LT=bae.toString,_ae=wae.hasOwnProperty,Sae=LT.call(Object);function jae(e){if(!gae(e)||yae(e)!=xae)return!1;var t=vae(e);if(t===null)return!0;var r=_ae.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&<.call(r)==Sae}var Oae=jae;const kae=rt(Oae);var Aae=Ba,Eae=Ua,Pae="[object Boolean]";function Nae(e){return e===!0||e===!1||Eae(e)&&Aae(e)==Pae}var Cae=Nae;const Tae=rt(Cae);function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:f,lowerWidth:d,height:p,x:l,y:u},duration:y,animationEasing:g,isActive:x},function(w){var S=w.upperWidth,b=w.lowerWidth,_=w.height,O=w.x,k=w.y;return C.createElement(Bn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,easing:g},C.createElement("path",qp({},we(r,!0),{className:m,d:uk(O,k,S,b,_),ref:n})))}):C.createElement("g",null,C.createElement("path",qp({},we(r,!0),{className:m,d:uk(l,u,f,d,p)})))},Vae=["option","shapeType","propTransformer","activeClassName","isActive"];function Bc(e){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bc(e)}function Wae(e,t){if(e==null)return{};var r=Hae(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ck(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Kp(e){for(var t=1;t0?Yr(w,"paddingAngle",0):0;if(b){var O=Ht(b.endAngle-b.startAngle,w.endAngle-w.startAngle),k=ft(ft({},w),{},{startAngle:m+_,endAngle:m+O(y)+_});v.push(k),m=k.endAngle}else{var A=w.endAngle,$=w.startAngle,T=Ht(0,A-$),P=T(y),R=ft(ft({},w),{},{startAngle:m+_,endAngle:m+P+_});v.push(R),m=R.endAngle}}),C.createElement(We,null,n.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Ao(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,s=a.className,l=a.label,u=a.cx,f=a.cy,d=a.innerRadius,p=a.outerRadius,h=a.isAnimationActive,g=this.state.isAnimationFinished;if(i||!o||!o.length||!re(u)||!re(f)||!re(d)||!re(p))return null;var y=De("recharts-pie",s);return C.createElement(We,{tabIndex:this.props.rootTabIndex,className:y,ref:function(x){n.pieRef=x}},this.renderSectors(),l&&this.renderLabels(o),rr.renderCallByParent(this.props,null,!1),(!h||g)&&ea.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n=360?m:m-1)*l,S=v-m*h-w,b=a.reduce(function(k,A){var $=Rt(A,x,0);return k+(re($)?$:0)},0),_;if(b>0){var O;_=a.map(function(k,A){var $=Rt(k,x,0),T=Rt(k,f,A),P=(re($)?$:0)/b,R;A?R=O.endAngle+jr(y)*l*($!==0?1:0):R=o;var L=R+jr(y)*(($!==0?h:0)+P*S),z=(R+L)/2,W=(g.innerRadius+g.outerRadius)/2,V=[{name:T,value:$,payload:k,dataKey:x,type:p}],D=mt(g.cx,g.cy,W,z);return O=ft(ft(ft({percent:P,cornerRadius:i,name:T,tooltipPayload:V,midAngle:z,middleRadius:W,tooltipPosition:D},k),g),{},{value:Rt(k,x),startAngle:R,endAngle:L,payload:k,paddingAngle:jr(y)*l}),O})}return ft(ft({},g),{},{sectors:_,data:a})});var fie=Math.ceil,pie=Math.max;function hie(e,t,r,n){for(var a=-1,i=pie(fie((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=e,e+=r;return o}var mie=hie,yie=sC,hk=1/0,vie=17976931348623157e292;function gie(e){if(!e)return e===0?e:0;if(e=yie(e),e===hk||e===-hk){var t=e<0?-1:1;return t*vie}return e===e?e:0}var UT=gie,xie=mie,bie=im,Xy=UT;function wie(e){return function(t,r,n){return n&&typeof n!="number"&&bie(t,r,n)&&(r=n=void 0),t=Xy(t),r===void 0?(r=t,t=0):r=Xy(r),n=n===void 0?t0&&n.handleDrag(a.changedTouches[0])}),Vr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,s=a.startIndex;o==null||o({endIndex:i,startIndex:s})}),n.detachDragEndListener()}),Vr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Vr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Vr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Vr(n,"handleSlideDragStart",function(a){var i=xk(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Rie(t,e),Cie(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,d=Math.min(a,i),p=Math.max(a,i),h=t.getIndexInRange(o,d),g=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:g===f?f:g-g%l}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,s=a.dataKey,l=Rt(i[n],s,n);return je(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,s=a.endX,l=this.props,u=l.x,f=l.width,d=l.travellerWidth,p=l.startIndex,h=l.endIndex,g=l.onChange,y=n.pageX-i;y>0?y=Math.min(y,u+f-d-s,u+f-d-o):y<0&&(y=Math.max(y,u-o,u-s));var v=this.getIndex({startX:o+y,endX:s+y});(v.startIndex!==p||v.endIndex!==h)&&g&&g(v),this.setState({startX:o+y,endX:s+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=xk(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,s=a.endX,l=a.startX,u=this.state[o],f=this.props,d=f.x,p=f.width,h=f.travellerWidth,g=f.onChange,y=f.gap,v=f.data,x={startX:this.state.startX,endX:this.state.endX},m=n.pageX-i;m>0?m=Math.min(m,d+p-h-u):m<0&&(m=Math.max(m,d-u)),x[o]=u+m;var w=this.getIndex(x),S=w.startIndex,b=w.endIndex,_=function(){var k=v.length-1;return o==="startX"&&(s>l?S%y===0:b%y===0)||sl?b%y===0:S%y===0)||s>l&&b===k};this.setState(Vr(Vr({},o,u+m),"brushMoveStartX",n.pageX),function(){g&&_()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[a],d=s.indexOf(f);if(d!==-1){var p=d+n;if(!(p===-1||p>=s.length)){var h=s[p];a==="startX"&&h>=u||a==="endX"&&h<=l||this.setState(Vr({},a,h),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return C.createElement("rect",{stroke:u,fill:l,x:a,y:i,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,d=j.Children.only(u);return d?C.cloneElement(d,{x:a,y:i,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,d=l.height,p=l.traveller,h=l.ariaLabel,g=l.data,y=l.startIndex,v=l.endIndex,x=Math.max(n,this.props.x),m=Yy(Yy({},we(this.props,!1)),{},{x,y:u,width:f,height:d}),w=h||"Min value: ".concat((i=g[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return C.createElement(We,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(b){["ArrowLeft","ArrowRight"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),s.handleTravellerMoveKeyboard(b.key==="ArrowRight"?1:-1,a))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,m))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,s=i.height,l=i.stroke,u=i.travellerWidth,f=Math.min(n,a)+u,d=Math.max(Math.abs(a-n)-u,0);return C.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:d,height:s})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,p=f.endX,h=5,g={pointerEvents:"none",fill:u};return C.createElement(We,{className:"recharts-brush-texts"},C.createElement(ko,Zp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-h,y:o+s/2},g),this.getTextOfTick(a)),C.createElement(ko,Zp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+l+h,y:o+s/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,d=n.alwaysShowText,p=this.state,h=p.startX,g=p.endX,y=p.isTextActive,v=p.isSlideMoving,x=p.isTravellerMoving,m=p.isTravellerFocused;if(!a||!a.length||!re(s)||!re(l)||!re(u)||!re(f)||u<=0||f<=0)return null;var w=De("recharts-brush",i),S=C.Children.count(o)===1,b=Pie("userSelect","none");return C.createElement(We,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(g,"endX"),(y||v||x||m||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(i+s/2)-1;return C.createElement(C.Fragment,null,C.createElement("rect",{x:a,y:i,width:o,height:s,fill:l,stroke:"none"}),C.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),C.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return C.isValidElement(n)?i=C.cloneElement(n,a):je(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return Yy({prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},i&&i.length?Die({data:i,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||s!==a.prevX||l!==a.prevTravellerWidth)){a.scale.range([s,s+o-l]);var p=a.scale.domain().map(function(h){return a.scale(h)});return{prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,s=i-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>a?s=l:o=l}return a>=n[s]?s:o}}])}(j.PureComponent);Vr(nl,"displayName","Brush");Vr(nl,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Lie=Wb;function Fie(e,t){var r;return Lie(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var zie=Fie,Bie=IN,Uie=oa,Vie=zie,Wie=Br,Hie=im;function Gie(e,t,r){var n=Wie(e)?Bie:Vie;return r&&Hie(e,t,r)&&(t=void 0),n(e,Uie(t))}var qie=Gie;const Kie=rt(qie);var ta=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},bk=rC;function Xie(e,t,r){t=="__proto__"&&bk?bk(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Yie=Xie,Zie=Yie,Qie=eC,Jie=oa;function eoe(e,t){var r={};return t=Jie(t),Qie(e,function(n,a,i){Zie(r,a,t(n,a,i))}),r}var toe=eoe;const roe=rt(toe);function noe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function boe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function woe(e,t){var r=e.x,n=e.y,a=xoe(e,moe),i="".concat(r),o=parseInt(i,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||a.height),f=parseInt(u,10),d="".concat(t.width||a.width),p=parseInt(d,10);return tu(tu(tu(tu(tu({},t),a),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:p,name:t.name,radius:t.radius})}function _k(e){return C.createElement(FT,F0({shapeType:"rectangle",propTransformer:woe,activeClassName:"recharts-active-bar"},e))}var _oe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=re(n)||W8(n);return i?t(n,a):(i||Po(),r)}},Soe=["value","background"],qT;function al(e){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},al(e)}function joe(e,t){if(e==null)return{};var r=Ooe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ooe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Jp(){return Jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(z)0&&Math.abs(L)0&&(R=Math.min((Q||0)-(L[be-1]||0),R))}),Number.isFinite(R)){var z=R/P,W=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(O=z*W/2),y.padding==="no-gap"){var V=Or(t.barCategoryGap,z*W),D=z*W/2;O=D-V-(D-V)/W*V}}}a==="xAxis"?k=[n.left+(w.left||0)+(O||0),n.left+n.width-(w.right||0)-(O||0)]:a==="yAxis"?k=l==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(O||0),n.top+n.height-(w.bottom||0)-(O||0)]:k=y.range,b&&(k=[k[1],k[0]]);var U=pT(y,i,p),q=U.scale,J=U.realScaleType;q.domain(x).range(k),hT(q);var K=mT(q,Cn(Cn({},y),{},{realScaleType:J}));a==="xAxis"?(T=v==="top"&&!S||v==="bottom"&&S,A=n.left,$=d[_]-T*y.height):a==="yAxis"&&(T=v==="left"&&!S||v==="right"&&S,A=d[_]-T*y.width,$=n.top);var ae=Cn(Cn(Cn({},y),K),{},{realScaleType:J,x:A,y:$,scale:q,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return ae.bandSize=Dp(ae,K),!y.hide&&a==="xAxis"?d[_]+=(T?-1:1)*ae.height:y.hide||(d[_]+=(T?-1:1)*ae.width),Cn(Cn({},h),{},_m({},g,ae))},{})},ZT=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},Moe=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return ZT({x:r,y:n},{x:a,y:i})},QT=function(){function e(t){$oe(this,e),this.scale=t}return Ioe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(a){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();_m(QT,"EPS",1e-4);var bw=function(t){var r=Object.keys(t).reduce(function(n,a){return Cn(Cn({},n),{},_m({},a,QT.create(t[a])))},{});return Cn(Cn({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,s=i.position;return roe(a,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(a){return GT(a,function(i,o){return r[o].isInRange(i)})}})};function Doe(e){return(e%180+180)%180}var Loe=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Doe(a),o=i*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?a[i?t[o]:o]:void 0}}var Voe=Uoe,Woe=UT;function Hoe(e){var t=Woe(e),r=t%1;return t===t?r?t-r:t:0}var Goe=Hoe,qoe=KN,Koe=oa,Xoe=Goe,Yoe=Math.max;function Zoe(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Xoe(r);return a<0&&(a=Yoe(n+a,0)),qoe(e,Koe(t),a)}var Qoe=Zoe,Joe=Voe,ese=Qoe,tse=Joe(ese),rse=tse;const nse=rt(rse);var ase=YB(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),ww=j.createContext(void 0),_w=j.createContext(void 0),JT=j.createContext(void 0),e$=j.createContext({}),t$=j.createContext(void 0),r$=j.createContext(0),n$=j.createContext(0),Ak=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,f=ase(i);return C.createElement(ww.Provider,{value:n},C.createElement(_w.Provider,{value:a},C.createElement(e$.Provider,{value:i},C.createElement(JT.Provider,{value:f},C.createElement(t$.Provider,{value:o},C.createElement(r$.Provider,{value:u},C.createElement(n$.Provider,{value:l},s)))))))},ise=function(){return j.useContext(t$)},a$=function(t){var r=j.useContext(ww);r==null&&Po();var n=r[t];return n==null&&Po(),n},ose=function(){var t=j.useContext(ww);return oi(t)},sse=function(){var t=j.useContext(_w),r=nse(t,function(n){return GT(n.domain,Number.isFinite)});return r||oi(t)},i$=function(t){var r=j.useContext(_w);r==null&&Po();var n=r[t];return n==null&&Po(),n},lse=function(){var t=j.useContext(JT);return t},use=function(){return j.useContext(e$)},Sw=function(){return j.useContext(n$)},jw=function(){return j.useContext(r$)};function il(e){"@babel/helpers - typeof";return il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},il(e)}function cse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dse(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Gse(e,t){return f$(e,t+1)}function qse(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,d=function(){var g=n==null?void 0:n[l];if(g===void 0)return{v:f$(n,u)};var y=l,v,x=function(){return v===void 0&&(v=r(g,y)),v},m=g.coordinate,w=l===0||ah(e,m,x,f,s);w||(l=0,f=o,u+=1),w&&(f=m+e*(x()/2+a),l+=u)},p;u<=i.length;)if(p=d(),p)return p.v;return[]}function Gc(e){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gc(e)}function Rk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t0?h.coordinate-v*e:h.coordinate})}else i[p]=h=hr(hr({},h),{},{tickCoord:h.coordinate});var x=ah(e,h.tickCoord,y,s,l);x&&(l=h.tickCoord-e*(y()/2+a),i[p]=hr(hr({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return i}function Qse(e,t,r,n,a,i){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(i){var f=n[s-1],d=r(f,s-1),p=e*(f.coordinate+e*d/2-u);o[s-1]=f=hr(hr({},f),{},{tickCoord:p>0?f.coordinate-p*e:f.coordinate});var h=ah(e,f.tickCoord,function(){return d},l,u);h&&(u=f.tickCoord-e*(d/2+a),o[s-1]=hr(hr({},f),{},{isShow:!0}))}for(var g=i?s-1:s,y=function(m){var w=o[m],S,b=function(){return S===void 0&&(S=r(w,m)),S};if(m===0){var _=e*(w.coordinate-e*b()/2-l);o[m]=w=hr(hr({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else o[m]=w=hr(hr({},w),{},{tickCoord:w.coordinate});var O=ah(e,w.tickCoord,b,l,u);O&&(l=w.tickCoord+e*(b()/2+a),o[m]=hr(hr({},w),{},{isShow:!0}))},v=0;v=2?jr(a[1].coordinate-a[0].coordinate):1,x=Hse(i,v,h);return l==="equidistantPreserveStart"?qse(v,x,y,a,o):(l==="preserveStart"||l==="preserveStartEnd"?p=Qse(v,x,y,a,o,l==="preserveStartEnd"):p=Zse(v,x,y,a,o),p.filter(function(m){return m.isShow}))}var Jse=["viewBox"],ele=["viewBox"],tle=["ticks"];function ll(e){"@babel/helpers - typeof";return ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ll(e)}function hs(){return hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dk(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!g||!g.length?null:C.createElement(We,{className:De("recharts-cartesian-axis",u),ref:function(v){n.layerReference=v}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),rr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,s=De(a.className,"recharts-cartesian-axis-tick-value");return C.isValidElement(n)?o=C.cloneElement(n,Bt(Bt({},a),{},{className:s})):je(n)?o=n(Bt(Bt({},a),{},{className:s})):o=C.createElement(ko,hs({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(j.Component);Ew(Rl,"displayName","CartesianAxis");Ew(Rl,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var cle=["x1","y1","x2","y2","key"],dle=["offset"];function No(e){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(e)}function Lk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var yle=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,s=t.height,l=t.ry;return C.createElement("rect",{x:a,y:i,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function m$(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(je(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,s=t.key,l=Fk(t,cle),u=we(l,!1);u.offset;var f=Fk(u,dle);r=C.createElement("line",oo({},f,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:s}))}return r}function vle(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=gr(gr({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return m$(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function gle(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=gr(gr({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return m$(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function xle(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var f=s.map(function(p){return Math.round(p+a-a)}).sort(function(p,h){return p-h});a!==f[0]&&f.unshift(0);var d=f.map(function(p,h){var g=!f[h+1],y=g?a+o-p:f[h+1]-p;if(y<=0)return null;var v=h%t.length;return C.createElement("rect",{key:"react-".concat(h),y:p,x:n,height:y,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function ble(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(p){return Math.round(p+i-i)}).sort(function(p,h){return p-h});i!==f[0]&&f.unshift(0);var d=f.map(function(p,h){var g=!f[h+1],y=g?i+s-p:f[h+1]-p;if(y<=0)return null;var v=h%n.length;return C.createElement("rect",{key:"react-".concat(h),x:p,y:o,width:y,height:l,stroke:"none",fill:n[v],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var wle=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return fT(Aw(gr(gr(gr({},Rl.defaultProps),n),{},{ticks:_a(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},_le=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return fT(Aw(gr(gr(gr({},Rl.defaultProps),n),{},{ticks:_a(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Go={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function K0(e){var t,r,n,a,i,o,s=Sw(),l=jw(),u=use(),f=gr(gr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Go.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Go.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Go.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Go.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Go.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Go.verticalFill,x:re(e.x)?e.x:u.left,y:re(e.y)?e.y:u.top,width:re(e.width)?e.width:u.width,height:re(e.height)?e.height:u.height}),d=f.x,p=f.y,h=f.width,g=f.height,y=f.syncWithTicks,v=f.horizontalValues,x=f.verticalValues,m=ose(),w=sse();if(!re(h)||h<=0||!re(g)||g<=0||!re(d)||d!==+d||!re(p)||p!==+p)return null;var S=f.verticalCoordinatesGenerator||wle,b=f.horizontalCoordinatesGenerator||_le,_=f.horizontalPoints,O=f.verticalPoints;if((!_||!_.length)&&je(b)){var k=v&&v.length,A=b({yAxis:w?gr(gr({},w),{},{ticks:k?v:w.ticks}):void 0,width:s,height:l,offset:u},k?!0:y);Ln(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(No(A),"]")),Array.isArray(A)&&(_=A)}if((!O||!O.length)&&je(S)){var $=x&&x.length,T=S({xAxis:m?gr(gr({},m),{},{ticks:$?x:m.ticks}):void 0,width:s,height:l,offset:u},$?!0:y);Ln(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(No(T),"]")),Array.isArray(T)&&(O=T)}return C.createElement("g",{className:"recharts-cartesian-grid"},C.createElement(yle,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),C.createElement(vle,oo({},f,{offset:u,horizontalPoints:_,xAxis:m,yAxis:w})),C.createElement(gle,oo({},f,{offset:u,verticalPoints:O,xAxis:m,yAxis:w})),C.createElement(xle,oo({},f,{horizontalPoints:_})),C.createElement(ble,oo({},f,{verticalPoints:O})))}K0.displayName="CartesianGrid";var Sle=["type","layout","connectNulls","ref"],jle=["key"];function ul(e){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ul(e)}function zk(e,t){if(e==null)return{};var r=Ole(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ole(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Bu(){return Bu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rd){h=[].concat(qo(l.slice(0,g)),[d-y]);break}var v=h.length%2===0?[0,p]:[p];return[].concat(qo(t.repeat(l,f)),qo(h),v).map(function(x){return"".concat(x,"px")}).join(", ")}),Tn(r,"id",Ro("recharts-line-")),Tn(r,"pathRef",function(o){r.mainCurve=o}),Tn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Tn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Rle(t,e),Cle(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,s=i.xAxis,l=i.yAxis,u=i.layout,f=i.children,d=Zr(f,fd);if(!d)return null;var p=function(y,v){return{x:y.x,y:y.y,value:y.value,errorVal:Rt(y.payload,v)}},h={clipPath:n?"url(#clipPath-".concat(a,")"):null};return C.createElement(We,h,d.map(function(g){return C.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:p})}))}},{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,d=we(this.props,!1),p=we(l,!0),h=u.map(function(y,v){var x=Ur(Ur(Ur({key:"dot-".concat(v),r:3},d),p),{},{index:v,cx:y.x,cy:y.y,value:y.value,dataKey:f,payload:y.payload,points:u});return t.renderDotItem(l,x)}),g={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return C.createElement(We,Bu({className:"recharts-line-dots",key:"dots"},g),h)}},{key:"renderCurveStatically",value:function(n,a,i,o){var s=this.props,l=s.type,u=s.layout,f=s.connectNulls;s.ref;var d=zk(s,Sle),p=Ur(Ur(Ur({},we(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:f});return C.createElement(ho,Bu({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,p=o.animationEasing,h=o.animationId,g=o.animateNewValues,y=o.width,v=o.height,x=this.state,m=x.prevPoints,w=x.totalLength;return C.createElement(Bn,{begin:f,duration:d,isActive:u,easing:p,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var b=S.t;if(m){var _=m.length/s.length,O=s.map(function(P,R){var L=Math.floor(R*_);if(m[L]){var z=m[L],W=Ht(z.x,P.x),V=Ht(z.y,P.y);return Ur(Ur({},P),{},{x:W(b),y:V(b)})}if(g){var D=Ht(y*2,P.x),U=Ht(v/2,P.y);return Ur(Ur({},P),{},{x:D(b),y:U(b)})}return Ur(Ur({},P),{},{x:P.x,y:P.y})});return i.renderCurveStatically(O,n,a)}var k=Ht(0,w),A=k(b),$;if(l){var T="".concat(l).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});$=i.getStrokeDasharray(A,w,T)}else $=i.generateSimpleStrokeDasharray(w,A);return i.renderCurveStatically(s,n,a,{strokeDasharray:$})})}},{key:"renderCurve",value:function(n,a){var i=this.props,o=i.points,s=i.isAnimationActive,l=this.state,u=l.prevPoints,f=l.totalLength;return s&&o&&o.length&&(!u&&f>0||!Ao(u,o))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(o,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.xAxis,f=a.yAxis,d=a.top,p=a.left,h=a.width,g=a.height,y=a.isAnimationActive,v=a.id;if(i||!s||!s.length)return null;var x=this.state.isAnimationFinished,m=s.length===1,w=De("recharts-line",l),S=u&&u.allowDataOverflow,b=f&&f.allowDataOverflow,_=S||b,O=Ne(v)?this.id:v,k=(n=we(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=k.r,$=A===void 0?3:A,T=k.strokeWidth,P=T===void 0?2:T,R=iN(o)?o:{},L=R.clipDot,z=L===void 0?!0:L,W=$*2+P;return C.createElement(We,{className:w},S||b?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(O)},C.createElement("rect",{x:S?p:p-h/2,y:b?d:d-g/2,width:S?h:h*2,height:b?g:g*2})),!z&&C.createElement("clipPath",{id:"clipPath-dots-".concat(O)},C.createElement("rect",{x:p-W/2,y:d-W/2,width:h+W,height:g+W}))):null,!m&&this.renderCurve(_,O),this.renderErrorBar(_,O),(m||o)&&this.renderDots(_,z,O),(!y||x)&&ea.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(qo(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Ao(f,o)||!Ao(d,s))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(o,s,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.top,f=a.left,d=a.xAxis,p=a.yAxis,h=a.width,g=a.height,y=a.isAnimationActive,v=a.id;if(i||!s||!s.length)return null;var x=this.state.isAnimationFinished,m=s.length===1,w=De("recharts-area",l),S=d&&d.allowDataOverflow,b=p&&p.allowDataOverflow,_=S||b,O=Ne(v)?this.id:v,k=(n=we(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=k.r,$=A===void 0?3:A,T=k.strokeWidth,P=T===void 0?2:T,R=iN(o)?o:{},L=R.clipDot,z=L===void 0?!0:L,W=$*2+P;return C.createElement(We,{className:w},S||b?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(O)},C.createElement("rect",{x:S?f:f-h/2,y:b?u:u-g/2,width:S?h:h*2,height:b?g:g*2})),!z&&C.createElement("clipPath",{id:"clipPath-dots-".concat(O)},C.createElement("rect",{x:f-W/2,y:u-W/2,width:h+W,height:g+W}))):null,m?null:this.renderArea(_,O),(o||m)&&this.renderDots(_,z,O),(!y||x)&&ea.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(j.PureComponent);g$=Fi;Xn(Fi,"displayName","Area");Xn(Fi,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Ri.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Xn(Fi,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,o=t.props.baseValue,s=o??i;if(re(s)&&typeof s=="number")return s;var l=a==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return s==="dataMin"?d:s==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});Xn(Fi,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,p=e.offset,h=t.layout,g=u&&u.length,y=g$.getBaseValue(t,r,n,a),v=h==="horizontal",x=!1,m=d.map(function(S,b){var _;g?_=u[f+b]:(_=Rt(S,l),Array.isArray(_)?x=!0:_=[y,_]);var O=_[1]==null||g&&Rt(S,l)==null;return v?{x:Mp({axis:n,ticks:i,bandSize:s,entry:S,index:b}),y:O?null:a.scale(_[1]),value:_,payload:S}:{x:O?null:n.scale(_[1]),y:Mp({axis:a,ticks:o,bandSize:s,entry:S,index:b}),value:_,payload:S}}),w;return g||x?w=m.map(function(S){var b=Array.isArray(S.value)?S.value[0]:null;return v?{x:S.x,y:b!=null&&S.y!=null?a.scale(b):null}:{x:b!=null?n.scale(b):null,y:S.y}}):w=v?a.scale(y):n.scale(y),Za({points:m,baseLine:w,layout:h,isRange:x},p)});Xn(Fi,"renderDotItem",function(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(je(e))r=e(t);else{var n=De("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=x$(t,Lle);r=C.createElement(pd,so({},i,{key:a,className:n}))}return r});function dl(e){"@babel/helpers - typeof";return dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(e)}function qle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kle(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Iue(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Rue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mue(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&re(a)&&re(i)?t.slice(a,i+1):[]};function R$(e){return e==="number"?[0,"auto"]:void 0}var ox=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,s=Am(r,t);return n<0||!i||!i.length||n>=s.length?null:i.reduce(function(l,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=d===void 0?s:d;p=sp(h,o.dataKey,a)}else p=d&&d[n]||s[n];return p?[].concat(hl(l),[vT(u,p)]):l},[])},Yk=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=Kue(i,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=ree(o,s,u,l);if(f>=0&&u){var d=u[f]&&u[f].value,p=ox(t,r,f,d),h=Xue(n,s,f,i);return{activeTooltipIndex:f,activeLabel:d,activePayload:p,activeCoordinate:h}}return null},Yue=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,p=t.stackOffset,h=dT(f,i);return n.reduce(function(g,y){var v,x=y.type.defaultProps!==void 0?Y(Y({},y.type.defaultProps),y.props):y.props,m=x.type,w=x.dataKey,S=x.allowDataOverflow,b=x.allowDuplicatedCategory,_=x.scale,O=x.ticks,k=x.includeHidden,A=x[o];if(g[A])return g;var $=Am(t.data,{graphicalItems:a.filter(function(K){var ae,Q=o in K.props?K.props[o]:(ae=K.type.defaultProps)===null||ae===void 0?void 0:ae[o];return Q===A}),dataStartIndex:l,dataEndIndex:u}),T=$.length,P,R,L;_ue(x.domain,S,m)&&(P=g0(x.domain,null,S),h&&(m==="number"||_!=="auto")&&(L=Du($,w,"category")));var z=R$(m);if(!P||P.length===0){var W,V=(W=x.domain)!==null&&W!==void 0?W:z;if(w){if(P=Du($,w,m),m==="category"&&h){var D=G8(P);b&&D?(R=P,P=Yp(0,T)):b||(P=xO(V,P,y).reduce(function(K,ae){return K.indexOf(ae)>=0?K:[].concat(hl(K),[ae])},[]))}else if(m==="category")b?P=P.filter(function(K){return K!==""&&!Ne(K)}):P=xO(V,P,y).reduce(function(K,ae){return K.indexOf(ae)>=0||ae===""||Ne(ae)?K:[].concat(hl(K),[ae])},[]);else if(m==="number"){var U=see($,a.filter(function(K){var ae,Q,be=o in K.props?K.props[o]:(ae=K.type.defaultProps)===null||ae===void 0?void 0:ae[o],ue="hide"in K.props?K.props.hide:(Q=K.type.defaultProps)===null||Q===void 0?void 0:Q.hide;return be===A&&(k||!ue)}),w,i,f);U&&(P=U)}h&&(m==="number"||_!=="auto")&&(L=Du($,w,"category"))}else h?P=Yp(0,T):s&&s[A]&&s[A].hasStack&&m==="number"?P=p==="expand"?[0,1]:yT(s[A].stackGroups,l,u):P=cT($,a.filter(function(K){var ae=o in K.props?K.props[o]:K.type.defaultProps[o],Q="hide"in K.props?K.props.hide:K.type.defaultProps.hide;return ae===A&&(k||!Q)}),m,f,!0);if(m==="number")P=nx(d,P,A,i,O),V&&(P=g0(V,P,S));else if(m==="category"&&V){var q=V,J=P.every(function(K){return q.indexOf(K)>=0});J&&(P=q)}}return Y(Y({},g),{},Se({},A,Y(Y({},x),{},{axisType:i,domain:P,categoricalDomain:L,duplicateDomain:R,originalDomain:(v=x.domain)!==null&&v!==void 0?v:z,isCategorical:h,layout:f})))},{})},Zue=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,p=Am(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=p.length,g=dT(f,i),y=-1;return n.reduce(function(v,x){var m=x.type.defaultProps!==void 0?Y(Y({},x.type.defaultProps),x.props):x.props,w=m[o],S=R$("number");if(!v[w]){y++;var b;return g?b=Yp(0,h):s&&s[w]&&s[w].hasStack?(b=yT(s[w].stackGroups,l,u),b=nx(d,b,w,i)):(b=g0(S,cT(p,n.filter(function(_){var O,k,A=o in _.props?_.props[o]:(O=_.type.defaultProps)===null||O===void 0?void 0:O[o],$="hide"in _.props?_.props.hide:(k=_.type.defaultProps)===null||k===void 0?void 0:k.hide;return A===w&&!$}),"number",f),a.defaultProps.allowDataOverflow),b=nx(d,b,w,i)),Y(Y({},v),{},Se({},w,Y(Y({axisType:i},a.defaultProps),{},{hide:!0,orientation:Yr(Gue,"".concat(i,".").concat(y%2),null),domain:b,originalDomain:S,isCategorical:g,layout:f})))}return v},{})},Que=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(a,"Id"),p=Zr(f,i),h={};return p&&p.length?h=Yue(t,{axes:p,graphicalItems:o,axisType:a,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=Zue(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Jue=function(t){var r=oi(t),n=_a(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Hb(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Dp(r,n)}},Zk=function(t){var r=t.children,n=t.defaultShowTooltip,a=Hr(r,nl),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},ece=function(t){return!t||!t.length?!1:t.some(function(r){var n=ja(r&&r.type);return n&&n.indexOf("Bar")>=0})},Qk=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},tce=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,d=n.children,p=n.margin||{},h=Hr(d,nl),g=Hr(d,Oa),y=Object.keys(l).reduce(function(b,_){var O=l[_],k=O.orientation;return!O.mirror&&!O.hide?Y(Y({},b),{},Se({},k,b[k]+O.width)):b},{left:p.left||0,right:p.right||0}),v=Object.keys(o).reduce(function(b,_){var O=o[_],k=O.orientation;return!O.mirror&&!O.hide?Y(Y({},b),{},Se({},k,Yr(b,"".concat(k))+O.height)):b},{top:p.top||0,bottom:p.bottom||0}),x=Y(Y({},v),y),m=x.bottom;h&&(x.bottom+=h.props.height||nl.defaultProps.height),g&&r&&(x=iee(x,a,n,r));var w=u-x.left-x.right,S=f-x.top-x.bottom;return Y(Y({brushBottom:m},x),{},{width:Math.max(w,0),height:Math.max(S,0)})},rce=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Em=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,p=function(x,m){var w=m.graphicalItems,S=m.stackGroups,b=m.offset,_=m.updateId,O=m.dataStartIndex,k=m.dataEndIndex,A=x.barSize,$=x.layout,T=x.barGap,P=x.barCategoryGap,R=x.maxBarSize,L=Qk($),z=L.numericAxisName,W=L.cateAxisName,V=ece(w),D=[];return w.forEach(function(U,q){var J=Am(x.data,{graphicalItems:[U],dataStartIndex:O,dataEndIndex:k}),K=U.type.defaultProps!==void 0?Y(Y({},U.type.defaultProps),U.props):U.props,ae=K.dataKey,Q=K.maxBarSize,be=K["".concat(z,"Id")],ue=K["".concat(W,"Id")],Ce={},Fe=l.reduce(function(Ge,H){var E=m["".concat(H.axisType,"Map")],M=K["".concat(H.axisType,"Id")];E&&E[M]||H.axisType==="zAxis"||Po();var N=E[M];return Y(Y({},Ge),{},Se(Se({},H.axisType,N),"".concat(H.axisType,"Ticks"),_a(N)))},Ce),te=Fe[W],ie=Fe["".concat(W,"Ticks")],he=S&&S[be]&&S[be].hasStack&&yee(U,S[be].stackGroups),X=ja(U.type).indexOf("Bar")>=0,Ee=Dp(te,ie),ve=[],Pe=V&&nee({barSize:A,stackGroups:S,totalSize:rce(Fe,W)});if(X){var ze,ge,$e=Ne(Q)?R:Q,Le=(ze=(ge=Dp(te,ie,!0))!==null&&ge!==void 0?ge:$e)!==null&&ze!==void 0?ze:0;ve=aee({barGap:T,barCategoryGap:P,bandSize:Le!==Ee?Le:Ee,sizeList:Pe[ue],maxBarSize:$e}),Le!==Ee&&(ve=ve.map(function(Ge){return Y(Y({},Ge),{},{position:Y(Y({},Ge.position),{},{offset:Ge.position.offset-Le/2})})}))}var Oe=U&&U.type&&U.type.getComposedData;Oe&&D.push({props:Y(Y({},Oe(Y(Y({},Fe),{},{displayedData:J,props:x,dataKey:ae,item:U,bandSize:Ee,barPosition:ve,offset:b,stackedData:he,layout:$,dataStartIndex:O,dataEndIndex:k}))),{},Se(Se(Se({key:U.key||"item-".concat(q)},z,Fe[z]),W,Fe[W]),"animationId",_)),childIndex:a6(U,x.children),item:U})}),D},h=function(x,m){var w=x.props,S=x.dataStartIndex,b=x.dataEndIndex,_=x.updateId;if(!pS({props:w}))return null;var O=w.children,k=w.layout,A=w.stackOffset,$=w.data,T=w.reverseStackOrder,P=Qk(k),R=P.numericAxisName,L=P.cateAxisName,z=Zr(O,n),W=hee($,z,"".concat(R,"Id"),"".concat(L,"Id"),A,T),V=l.reduce(function(K,ae){var Q="".concat(ae.axisType,"Map");return Y(Y({},K),{},Se({},Q,Que(w,Y(Y({},ae),{},{graphicalItems:z,stackGroups:ae.axisType===R&&W,dataStartIndex:S,dataEndIndex:b}))))},{}),D=tce(Y(Y({},V),{},{props:w,graphicalItems:z}),m==null?void 0:m.legendBBox);Object.keys(V).forEach(function(K){V[K]=f(w,V[K],D,K.replace("Map",""),r)});var U=V["".concat(L,"Map")],q=Jue(U),J=p(w,Y(Y({},V),{},{dataStartIndex:S,dataEndIndex:b,updateId:_,graphicalItems:z,stackGroups:W,offset:D}));return Y(Y({formattedGraphicalItems:J,graphicalItems:z,offset:D,stackGroups:W},q),V)},g=function(v){function x(m){var w,S,b;return Rue(this,x),b=Lue(this,x,[m]),Se(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Se(b,"accessibilityManager",new wue),Se(b,"handleLegendBBoxUpdate",function(_){if(_){var O=b.state,k=O.dataStartIndex,A=O.dataEndIndex,$=O.updateId;b.setState(Y({legendBBox:_},h({props:b.props,dataStartIndex:k,dataEndIndex:A,updateId:$},Y(Y({},b.state),{},{legendBBox:_}))))}}),Se(b,"handleReceiveSyncEvent",function(_,O,k){if(b.props.syncId===_){if(k===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(O)}}),Se(b,"handleBrushChange",function(_){var O=_.startIndex,k=_.endIndex;if(O!==b.state.dataStartIndex||k!==b.state.dataEndIndex){var A=b.state.updateId;b.setState(function(){return Y({dataStartIndex:O,dataEndIndex:k},h({props:b.props,dataStartIndex:O,dataEndIndex:k,updateId:A},b.state))}),b.triggerSyncEvent({dataStartIndex:O,dataEndIndex:k})}}),Se(b,"handleMouseEnter",function(_){var O=b.getMouseInfo(_);if(O){var k=Y(Y({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseEnter;je(A)&&A(k,_)}}),Se(b,"triggeredAfterMouseMove",function(_){var O=b.getMouseInfo(_),k=O?Y(Y({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseMove;je(A)&&A(k,_)}),Se(b,"handleItemMouseEnter",function(_){b.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Se(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Se(b,"handleMouseMove",function(_){_.persist(),b.throttleTriggeredAfterMouseMove(_)}),Se(b,"handleMouseLeave",function(_){b.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};b.setState(O),b.triggerSyncEvent(O);var k=b.props.onMouseLeave;je(k)&&k(O,_)}),Se(b,"handleOuterEvent",function(_){var O=n6(_),k=Yr(b.props,"".concat(O));if(O&&je(k)){var A,$;/.*touch.*/i.test(O)?$=b.getMouseInfo(_.changedTouches[0]):$=b.getMouseInfo(_),k((A=$)!==null&&A!==void 0?A:{},_)}}),Se(b,"handleClick",function(_){var O=b.getMouseInfo(_);if(O){var k=Y(Y({},O),{},{isTooltipActive:!0});b.setState(k),b.triggerSyncEvent(k);var A=b.props.onClick;je(A)&&A(k,_)}}),Se(b,"handleMouseDown",function(_){var O=b.props.onMouseDown;if(je(O)){var k=b.getMouseInfo(_);O(k,_)}}),Se(b,"handleMouseUp",function(_){var O=b.props.onMouseUp;if(je(O)){var k=b.getMouseInfo(_);O(k,_)}}),Se(b,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Se(b,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseDown(_.changedTouches[0])}),Se(b,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseUp(_.changedTouches[0])}),Se(b,"handleDoubleClick",function(_){var O=b.props.onDoubleClick;if(je(O)){var k=b.getMouseInfo(_);O(k,_)}}),Se(b,"handleContextMenu",function(_){var O=b.props.onContextMenu;if(je(O)){var k=b.getMouseInfo(_);O(k,_)}}),Se(b,"triggerSyncEvent",function(_){b.props.syncId!==void 0&&Qy.emit(Jy,b.props.syncId,_,b.eventEmitterSymbol)}),Se(b,"applySyncEvent",function(_){var O=b.props,k=O.layout,A=O.syncMethod,$=b.state.updateId,T=_.dataStartIndex,P=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)b.setState(Y({dataStartIndex:T,dataEndIndex:P},h({props:b.props,dataStartIndex:T,dataEndIndex:P,updateId:$},b.state)));else if(_.activeTooltipIndex!==void 0){var R=_.chartX,L=_.chartY,z=_.activeTooltipIndex,W=b.state,V=W.offset,D=W.tooltipTicks;if(!V)return;if(typeof A=="function")z=A(D,_);else if(A==="value"){z=-1;for(var U=0;U=0){var he,X;if(R.dataKey&&!R.allowDuplicatedCategory){var Ee=typeof R.dataKey=="function"?ie:"payload.".concat(R.dataKey.toString());he=sp(U,Ee,z),X=q&&J&&sp(J,Ee,z)}else he=U==null?void 0:U[L],X=q&&J&&J[L];if(ue||be){var ve=_.props.activeIndex!==void 0?_.props.activeIndex:L;return[j.cloneElement(_,Y(Y(Y({},A.props),Fe),{},{activeIndex:ve})),null,null]}if(!Ne(he))return[te].concat(hl(b.renderActivePoints({item:A,activePoint:he,basePoint:X,childIndex:L,isRange:q})))}else{var Pe,ze=(Pe=b.getItemByXY(b.state.activeCoordinate))!==null&&Pe!==void 0?Pe:{graphicalItem:te},ge=ze.graphicalItem,$e=ge.item,Le=$e===void 0?_:$e,Oe=ge.childIndex,Ge=Y(Y(Y({},A.props),Fe),{},{activeIndex:Oe});return[j.cloneElement(Le,Ge),null,null]}return q?[te,null,null]:[te,null]}),Se(b,"renderCustomized",function(_,O,k){return j.cloneElement(_,Y(Y({key:"recharts-customized-".concat(k)},b.props),b.state))}),Se(b,"renderMap",{CartesianGrid:{handler:Zd,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:Zd},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:Zd},YAxis:{handler:Zd},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((w=m.id)!==null&&w!==void 0?w:Ro("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=lC(b.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),b.state={},b}return Bue(x,v),Due(x,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,b=w.data,_=w.height,O=w.layout,k=Hr(S,_r);if(k){var A=k.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,T=ox(this.state,b,A,$),P=this.state.tooltipTicks[A].coordinate,R=(this.state.offset.top+_)/2,L=O==="horizontal",z=L?{x:P,y:R}:{y:P,x:R},W=this.state.formattedGraphicalItems.find(function(D){var U=D.item;return U.type.name==="Scatter"});W&&(z=Y(Y({},z),W.props.points[A].tooltipPosition),T=W.props.points[A].tooltipPayload);var V={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:$,activePayload:T,activeCoordinate:z};this.setState(V),this.renderCursor(k),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var b,_;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){$g([Hr(w.children,_r)],[Hr(this.props.children,_r)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Hr(this.props.children,_r);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return s.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,b=S.getBoundingClientRect(),_=NX(b),O={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},k=b.width/S.offsetWidth||1,A=this.inRange(O.chartX,O.chartY,k);if(!A)return null;var $=this.state,T=$.xAxisMap,P=$.yAxisMap,R=this.getTooltipEventType(),L=Yk(this.state,this.props.data,this.props.layout,A);if(R!=="axis"&&T&&P){var z=oi(T).scale,W=oi(P).scale,V=z&&z.invert?z.invert(O.chartX):null,D=W&&W.invert?W.invert(O.chartY):null;return Y(Y({},O),{},{xValue:V,yValue:D},L)}return L?Y(Y({},O),L):null}},{key:"inRange",value:function(w,S){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,O=w/b,k=S/b;if(_==="horizontal"||_==="vertical"){var A=this.state.offset,$=O>=A.left&&O<=A.left+A.width&&k>=A.top&&k<=A.top+A.height;return $?{x:O,y:k}:null}var T=this.state,P=T.angleAxisMap,R=T.radiusAxisMap;if(P&&R){var L=oi(P);return _O({x:O,y:k},L)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),b=Hr(w,_r),_={};b&&S==="axis"&&(b.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=lp(this.props,this.handleOuterEvent);return Y(Y({},O),_)}},{key:"addListener",value:function(){Qy.on(Jy,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Qy.removeListener(Jy,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,b){for(var _=this.state.formattedGraphicalItems,O=0,k=_.length;Obt(`/routing/list/active/${e}`)),n=t==null?void 0:t.find(T=>{var P;return((P=T.algorithm_data||T.algorithm)==null?void 0:P.type)==="volume_split"}),[a,i]=j.useState([{id:ru(),name:"",split:50},{id:ru(),name:"",split:50}]),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,d]=j.useState(null),[p,h]=j.useState(null),[g,y]=j.useState(!1),[v,x]=j.useState(new Set),m=a.reduce((T,P)=>T+P.split,0);function w(T,P,R){i(L=>L.map(z=>z.id===T?{...z,[P]:R}:z))}function S(){i(T=>[...T,{id:ru(),name:"",split:0}])}function b(T){i(P=>P.filter(R=>R.id!==T))}async function _(){if(!e)return d("Set a merchant ID first");if(!o.trim())return d("Enter a rule name");if(m!==100)return d(`Splits must sum to 100 (currently ${m})`);if(a.some(T=>!T.name.trim()))return d("All gateways must have names");u(!0),d(null),h(null);try{await bt("/routing/create",{rule_id:null,name:o,description:"",created_by:e,algorithm_for:"payment",metadata:null,algorithm:{type:"volume_split",data:a.map(T=>({split:T.split,output:{gateway_name:T.name.trim(),gateway_id:null}}))}}),h(`Rule "${o}" created successfully. Find it in the list below to activate.`),r(),s(""),i([{id:ru(),name:"",split:50},{id:ru(),name:"",split:50}])}catch(T){d(T instanceof Error?T.message:"Failed to create rule")}finally{u(!1)}}async function O(T){if(e)try{await bt("/routing/activate",{created_by:e,routing_algorithm_id:T}),r(),h("Rule activated.")}catch(P){d(P instanceof Error?P.message:"Failed to activate")}}function k(T){x(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})}const A=n?n.algorithm_data||n.algorithm:null,$=A&&"data"in A?A.data.map(T=>{var P;return{name:((P=T.output)==null?void 0:P.gateway_name)??"?",value:T.split}}):[];return c.jsxs("div",{className:"space-y-6 max-w-4xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Volume Split Routing"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Distribute payment traffic across gateways by percentage."})]}),n&&c.jsxs(ke,{children:[c.jsxs(Xe,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800",children:"Active Volume Split"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n.name})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_e,{variant:"green",children:"Active"}),c.jsxs(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(!g),children:[c.jsx(Nh,{size:14,className:"mr-1"}),g?"Hide":"View"]})]})]}),g&&c.jsxs(Ae,{children:[c.jsx(ks,{width:"100%",height:220,children:c.jsxs(M$,{children:[c.jsx(sa,{data:$,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:T,value:P})=>`${T}: ${P}%`,labelLine:{stroke:"#45454f"},children:$.map((T,P)=>c.jsx(co,{fill:eA[P%eA.length]},P))}),c.jsx(_r,{formatter:T=>`${T}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),c.jsx(Oa,{wrapperStyle:{color:"#8e8ea0"}})]})}),c.jsxs("div",{className:"mt-4 text-xs text-slate-600",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Rule ID:"})," ",n.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",n.created_at?new Date(n.created_at).toLocaleString():"Unknown"]})]})]})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"Create Volume Split Rule"})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Rule Name"}),c.jsx("input",{value:o,onChange:T=>s(T.target.value),placeholder:"e.g. ab-test-split",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm w-64 focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 text-xs font-medium text-slate-500 px-1",children:[c.jsx("span",{children:"Gateway Name"}),c.jsx("span",{children:"Split %"}),c.jsx("span",{})]}),a.map(T=>c.jsxs("div",{className:"grid grid-cols-[1fr_100px_32px] gap-2 items-center",children:[c.jsx("input",{value:T.name,onChange:P=>w(T.id,"name",P.target.value),placeholder:"e.g. stripe",className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{type:"number",min:0,max:100,value:T.split,onChange:P=>w(T.id,"split",Number(P.target.value)),className:"border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>b(T.id),className:"text-slate-400 hover:text-red-500",children:c.jsx(Ca,{size:15})})]},T.id)),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-sm text-brand-500 hover:text-brand-600",children:[c.jsx(ki,{size:14})," Add Gateway"]}),c.jsxs("span",{className:`text-xs font-medium ${m===100?"text-emerald-400":"text-red-400"}`,children:["Total: ",m,"%",m!==100&&" (must be 100)"]})]})]}),c.jsx(Gr,{error:f}),p&&c.jsx("p",{className:"text-sm text-emerald-400",children:p}),c.jsx(Ie,{onClick:_,disabled:l||!e,children:l?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Creating…"]}):"Create Rule"})]})]}),c.jsx(oce,{merchantId:e,onActivate:O,expandedRuleIds:v,onToggleExpand:k})]})}function oce({merchantId:e,onActivate:t,expandedRuleIds:r,onToggleExpand:n}){const{data:a,isLoading:i}=ar(e?["routing-list",e]:null,()=>bt(`/routing/list/${e}`)),o=(a==null?void 0:a.filter(s=>{var l;return((l=s.algorithm_data||s.algorithm)==null?void 0:l.type)==="volume_split"}))??[];return e?i?c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(mr,{})}):o.length?c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"Saved Volume Split Rules"})}),c.jsx(Ae,{className:"p-0",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 uppercase tracking-wider",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2",children:"Name"}),c.jsx("th",{className:"text-left px-4 py-2",children:"Split"}),c.jsx("th",{className:"px-4 py-2"})]})}),c.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:o.map(s=>{const l=s.algorithm_data||s.algorithm,u=(l==null?void 0:l.data)||[],f=r.has(s.id);return c.jsxs(c.Fragment,{children:[c.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16] transition-colors",children:[c.jsx("td",{className:"px-4 py-2 font-medium text-slate-800",children:s.name}),c.jsx("td",{className:"px-4 py-2 text-slate-600 text-xs",children:u.map(d=>{var p;return`${(p=d.output)==null?void 0:p.gateway_name}:${d.split}%`}).join(" | ")}),c.jsx("td",{className:"px-4 py-2 text-right",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:()=>n(s.id),children:[c.jsx(Nh,{size:14,className:"mr-1"}),f?"Hide":"View"]}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>t(s.id),children:"Activate"})]})})]},s.id),f&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-3 bg-slate-50 dark:bg-[#151518]",children:c.jsxs("div",{className:"text-xs text-slate-600 space-y-2",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"ID:"})," ",s.id]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Description:"})," ",s.description||"N/A"]}),s.created_at&&c.jsxs("p",{children:[c.jsx("strong",{children:"Created:"})," ",new Date(s.created_at).toLocaleString()]}),c.jsxs("div",{children:[c.jsx("strong",{children:"Configuration:"}),c.jsx("pre",{className:"mt-1 p-2 bg-slate-100 dark:bg-[#0f0f11] border border-transparent dark:border-[#222226] rounded text-xs overflow-auto max-h-48",children:JSON.stringify(l,null,2)})]})]})})})]})})})]})})]}):null:null}function sce(){var m;const{merchantId:e}=aa(),{data:t,mutate:r,isLoading:n}=ar(e?["rule-debit",e]:null,()=>bt("/rule/get",{merchant_id:e,config:{type:"debitRouting"}})),[a,i]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(!1),[f,d]=j.useState(null),[p,h]=j.useState(null),g=(m=t==null?void 0:t.config)==null?void 0:m.data,y=a||(g==null?void 0:g.merchant_category_code)||"",v=o||(g==null?void 0:g.acquirer_country)||"";async function x(){if(!e)return d("Set a merchant ID first");const w={merchant_id:e,config:{type:"debitRouting",data:{merchant_category_code:y.trim(),acquirer_country:v.trim()}}};u(!0),d(null);try{await bt(t?"/rule/update":"/rule/create",w),h("Debit routing config saved."),r()}catch(S){d(S instanceof Error?S.message:"Failed to save")}finally{u(!1)}}return c.jsxs("div",{className:"space-y-6 max-w-2xl",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Network / Debit Routing"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Configure network-based routing to optimise processing fees for debit card transactions. The engine selects the cheapest eligible network (Visa, Mastercard, ACCEL, NYCE, PULSE, STAR)."})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(zE,{size:16,className:"text-brand-500"}),c.jsx("h2",{className:"font-medium text-slate-800",children:"Debit Routing Configuration"})]})}),c.jsx(Ae,{className:"space-y-4",children:n?c.jsx("div",{className:"flex justify-center py-6",children:c.jsx(mr,{})}):c.jsxs(c.Fragment,{children:[!e&&c.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar to load configuration."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Merchant Category Code (MCC)"}),c.jsx("input",{value:y,onChange:w=>i(w.target.value),placeholder:"e.g. 5411",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"4-digit ISO MCC for your business type"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Acquirer Country"}),c.jsx("input",{value:v,onChange:w=>s(w.target.value),placeholder:"e.g. US",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"ISO 3166-1 alpha-2 country code"})]})]}),c.jsx(Gr,{error:f}),p&&c.jsx("p",{className:"text-sm text-emerald-400",children:p}),c.jsx(Ie,{onClick:x,disabled:l||!e,children:l?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Saving…"]}):t?"Update Config":"Save Config"})]})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:"How Network Routing Works"})}),c.jsxs(Ae,{className:"text-sm text-slate-600 space-y-2",children:[c.jsx("p",{children:"For co-badged debit cards (e.g. Visa/NYCE, Mastercard/PULSE), the engine evaluates all eligible networks and routes to the one with the lowest processing fee."}),c.jsxs("p",{children:["Supported networks: ",["VISA","MASTERCARD","ACCEL","NYCE","PULSE","STAR"].map(w=>c.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md mr-1 text-slate-700",children:w},w))]}),c.jsxs("p",{children:["Use the ",c.jsx("strong",{className:"text-slate-800",children:"Decision Explorer"})," to test network routing decisions with ",c.jsx("code",{className:"text-xs bg-slate-100 dark:bg-[#111118] border border-slate-200 dark:border-[#1c1c24] px-1.5 py-0.5 rounded-md text-brand-500",children:"NtwBasedRouting"})," algorithm."]})]})]})]})}const lce=["SR_BASED_ROUTING","PL_BASED_ROUTING","NTW_BASED_ROUTING"],uce={SR_BASED_ROUTING:"Success Rate Based",PL_BASED_ROUTING:"Priority List Based",NTW_BASED_ROUTING:"Network Based"};function cce(e){for(const[t,r]of Object.entries(h4))if(e.includes(t)||t.includes(e))return r;return"bg-white/5 text-slate-600 ring-1 ring-inset ring-white/8"}const Cr=["#0069ED","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function bf(e=[]){return e.map(t=>t.trim()).filter(Boolean).map(t=>t.toUpperCase())}function tv(e=[]){return Array.from(new Set(bf(e)))}function dce(e){return function(){let r=e+=1831565813;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function fce(e,t){const r=Math.max(0,t);if(!e.length||r===0)return[];const n=[];e.forEach((l,u)=>{for(let f=0;f({connector:l.name,colorIdx:u,percentage:l.percentage})).sort((l,u)=>u.percentage-l.percentage);for(;n.lengthr&&(n.length=r);const i=e.reduce((l,u,f)=>{const d=Array.from(u.name).reduce((p,h)=>p+h.charCodeAt(0),0);return l+d+f*31+u.count*17+Math.round(u.percentage*10)},r*13),o=dce(i),s=[...n];for(let l=s.length-1;l>0;l-=1){const u=Math.floor(o()*(l+1));[s[l],s[u]]=[s[u],s[l]]}return s}function rv(e){return e==="enum"?"enum_variant":e==="integer"?"number":e==="udf"||e==="global_ref"?"metadata_variant":"str_value"}function D$(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function yu(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function un(e){return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase()):""}function vu(e){return e?e==="decision_gateway"||e==="decide_gateway"?"Decide Gateway":e==="update_gateway_score"?"Update Gateway":e==="routing_evaluate"?"Rule Evaluate":un(e):"Unknown route"}function tA(e){return e?e==="decision"?"Decide Gateway":e==="gateway_update"?"Update Gateway":e==="rule_hit"?"Rule Evaluate":e==="rule_evaluation_preview"?"Preview Result":e==="error"?"Errors":un(e):"Unknown event"}function gu(e){return e.event_stage==="gateway_decided"?"Decide Gateway":e.event_stage==="score_updated"?"Update Gateway":e.event_stage==="rule_applied"?"Rule Evaluate":e.event_stage==="preview_evaluated"||e.event_type==="rule_evaluation_preview"?"Preview Result":e.event_type==="error"?"Errors":un(e.event_stage||e.event_type)}function sx(e){return e.event_type==="decision"||e.event_stage==="gateway_decided"?"Decide Gateway":e.event_type==="rule_hit"||e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="gateway_update"||e.event_stage==="score_updated"?"Update Gateway":e.event_type==="rule_evaluation_preview"||e.event_stage==="preview_evaluated"?"Preview":"Errors"}function Qd(e){const t=(e.status||"").toUpperCase();return e.event_type==="error"||t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":e.event_type==="rule_hit"?"purple":t==="CHARGED"||t==="AUTHORIZED"||t==="SUCCESS"?"green":e.event_type==="rule_evaluation_preview"?"purple":e.event_type==="gateway_update"?"green":e.event_type==="decision"?"blue":"orange"}function rA(e){const t=(e||"").toUpperCase();return t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":t==="SUCCESS"||t==="CHARGED"||t==="AUTHORIZED"?"green":"gray"}function nA(e){return e==="Decide Gateway"?"blue":e==="Rule Evaluate"||e==="Preview"?"purple":e==="Update Gateway"?"green":e==="Errors"?"red":"gray"}function nu(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function nv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}function L$(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function pce(e,t){return`/analytics/payment-audit?${D$({scope:"current",range:"24h",page:1,page_size:25,merchant_id:e,payment_id:t})}`}function hce(e,t){return`/analytics/preview-trace?${D$({scope:"current",range:"24h",page:1,page_size:25,merchant_id:e,payment_id:t})}`}function aA(e){if(!e)return null;const t=nu(e.details_json)?e.details_json:{},r=t.response??t.response_payload??t.result??t.output??null,n=t.request??t.request_payload??t.input??t.payload??nv({payment_id:e.payment_id,request_id:e.request_id,payment_method_type:e.payment_method_type,payment_method:e.payment_method,gateway:e.gateway}),a=r??nv({event_type:e.event_type,status:e.status,error_code:e.error_code,error_message:e.error_message,score_value:e.score_value,sigma_factor:e.sigma_factor,average_latency:e.average_latency,tp99_latency:e.tp99_latency,transaction_count:e.transaction_count,rule_name:e.rule_name,routing_approach:e.routing_approach}),i=nu(r)?r:null,o=nu(i==null?void 0:i.decided_gateway)?i.decided_gateway:null,s=t.score_context??(o?o.gateway_priority_map:null)??(i?i.gateway_priority_map:null)??null,l=t.selection_reason??null,u=[{label:"Phase",value:sx(e)},{label:"Stage",value:gu(e)},{label:"Route",value:vu(e.route)},{label:"Timestamp",value:yu(e.created_at_ms)},...e.merchant_id?[{label:"Merchant",value:e.merchant_id}]:[],...e.payment_id?[{label:"Payment ID",value:e.payment_id}]:[],...e.request_id?[{label:"Request ID",value:e.request_id}]:[],...e.gateway?[{label:"Gateway",value:e.gateway}]:[],...e.status?[{label:"Status",value:un(e.status)}]:[]],f=nv(Object.fromEntries(Object.entries(t).filter(([d])=>!["request","request_payload","input","payload","response","response_payload","result","output","score_context","selection_reason"].includes(d))));return{summaryRows:u,requestPayload:nu(n)&&!Object.keys(n).length?null:n,responsePayload:nu(a)&&!Object.keys(a).length?null:a,scoreContext:s,selectionReason:l,signalRecord:Object.keys(f).length?f:null,rawEvent:{...e,details_json:e.details_json}}}function iA(e){return e?"bg-brand-600 text-white":"bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]"}function xu({title:e,body:t}){return c.jsxs("div",{className:"rounded-[22px] border border-dashed border-slate-200 bg-slate-50/80 px-6 py-12 text-center dark:border-[#1f1f26] dark:bg-[#0b0b0f]",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function oA({rows:e}){return e.length?c.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(t=>c.jsxs("div",{className:"rounded-[20px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:t.label}),c.jsx("p",{className:"mt-2 break-words text-sm text-slate-900 dark:text-white",children:t.value})]},`${t.label}-${t.value}`))}):null}function da({title:e,value:t,emptyMessage:r}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{children:c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e})}),t?c.jsx("pre",{className:"overflow-x-auto rounded-[22px] bg-slate-950 px-4 py-4 text-xs leading-6 text-slate-200",children:L$(t)}):c.jsx(xu,{title:`No ${e.toLowerCase()} captured`,body:r})]})}function mce(){var Nw,Cw,Tw,$w,Iw,Rw,Mw,Dw;const{merchantId:e}=aa(),{routingKeysConfig:t,isLoading:r,error:n}=VP(),a=Object.keys(t).length>0,i=!r&&(!a||!!n),[o,s]=j.useState("single"),[l,u]=j.useState({amount:"1000",currency:"",payment_method_type:"",payment_method:"",card_brand:"",auth_type:"",eligible_gateways:"stripe, adyen",ranking_algorithm:"SR_BASED_ROUTING",elimination_enabled:!1}),[f,d]=j.useState({totalPayments:"10",successCount:"7",failureCount:"3"}),[p,h]=j.useState([{key:"payment_method_type",type:"enum_variant",value:"",metadataKey:""},{key:"currency",type:"enum_variant",value:"",metadataKey:""}]),[g,y]=j.useState([{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}]),[v,x]=j.useState("100"),[m,w]=j.useState(null),[S,b]=j.useState(null),[_,O]=j.useState("CHARGED"),[k,A]=j.useState(null),[$,T]=j.useState([]),[P,R]=j.useState([]),[L,z]=j.useState(!1),[W,V]=j.useState(null),[D,U]=j.useState(!1),[q,J]=j.useState(!1),[K,ae]=j.useState(!1),[Q,be]=j.useState(!1),[ue,Ce]=j.useState(null),[Fe,te]=j.useState(null),[ie,he]=j.useState("summary"),[X,Ee]=j.useState(null),[ve,Pe]=j.useState(null),[ze,ge]=j.useState("summary"),[$e,Le]=j.useState("Rule Evaluation Preview"),Oe=j.useMemo(()=>Object.keys(t).sort(),[t]),Ge=j.useMemo(()=>{var I;return bf(((I=t.payment_method)==null?void 0:I.values)||[])},[t]),H=j.useMemo(()=>{var F;const I=l.payment_method_type.toLowerCase();return bf(((F=t[I])==null?void 0:F.values)||[])},[l.payment_method_type,t]),E=j.useMemo(()=>{var I;return tv(((I=t.currency)==null?void 0:I.values)||[])},[t]),M=j.useMemo(()=>{var I;return tv(((I=t.card_network)==null?void 0:I.values)||[])},[t]),N=j.useMemo(()=>{var I;return tv(((I=t.authentication_type)==null?void 0:I.values)||[])},[t]),B=e&&ue?pce(e,ue):null,G=ar(B,wi,{refreshInterval:ue?12e3:0,revalidateOnFocus:!0}),ee=e&&X?hce(e,X):null,Z=ar(ee,wi,{refreshInterval:X?12e3:0,revalidateOnFocus:!0});j.useEffect(()=>{i||r||(u(I=>{var de;const F={...I};E.length>0&&!E.includes(F.currency)&&(F.currency=E[0]),Ge.length>0&&!Ge.includes(F.payment_method_type)&&(F.payment_method_type=Ge[0]);const se=bf(((de=t[F.payment_method_type.toLowerCase()])==null?void 0:de.values)||[]);return se.length>0&&!se.includes(F.payment_method)&&(F.payment_method=se[0]),N.length>0&&!N.includes(F.auth_type)&&(F.auth_type=N[0]),M.length>0&&!M.includes(F.card_brand)&&(F.card_brand=M[0]),F}),h(I=>I.map(F=>{if(!F.key||!t[F.key])return F;const se=t[F.key],de=rv(se.type),st=se.values||[],br=de==="enum_variant"?st.includes(F.value)?F.value:st[0]||"":F.value;return{...F,type:de,value:br}})))},[i,r,t,E,Ge,N,M]),j.useEffect(()=>{if(!ue&&!X)return;const I=document.body.style.overflow,F=se=>{se.key==="Escape"&&(Ce(null),te(null),he("summary"),Ee(null),Pe(null),ge("summary"))};return document.body.style.overflow="hidden",window.addEventListener("keydown",F),()=>{document.body.style.overflow=I,window.removeEventListener("keydown",F)}},[ue,X]);function me(I,F){u(se=>({...se,[I]:F}))}function Te(){var st;if(Oe.length===0)return;const I=Oe[0],F=t[I],se=rv(F==null?void 0:F.type),de=se==="enum_variant"&&((st=F==null?void 0:F.values)==null?void 0:st[0])||"";h([...p,{key:I,type:se,value:de,metadataKey:""}])}function Et(I){h(p.filter((F,se)=>se!==I))}function Tt(I,F,se){h(p.map((de,st)=>st===I?{...de,[F]:se}:de))}function Xt(I,F){h(p.map((se,de)=>de===I?{...se,metadataKey:F}:se))}function zi(I,F){var br;const se=t[F],de=rv(se==null?void 0:se.type),st=de==="enum_variant"&&((br=se==null?void 0:se.values)==null?void 0:br[0])||"";h(p.map((Qt,qa)=>qa===I?{...Qt,key:F,type:de,value:st,metadataKey:""}:Qt))}function Wa(){y([...g,{gateway_name:"",gateway_id:""}])}function Bi(I){y(g.filter((F,se)=>se!==I))}function Ui(I,F,se){y(g.map((de,st)=>st===I?{...de,[F]:se}:de))}async function Vi(){if(!e)return V("Set a merchant ID in the top bar");if(i)return V("Routing key config unavailable. Fix /config/routing-keys and retry.");U(!0),V(null),b(null);const I=l.eligible_gateways.split(",").map(se=>se.trim()).filter(Boolean),F=`explorer_${Date.now()}`;try{const se=await bt("/decide-gateway",{merchantId:e,paymentInfo:{paymentId:F,amount:parseFloat(l.amount)||1e3,currency:l.currency,paymentType:"ORDER_PAYMENT",paymentMethodType:l.payment_method_type,paymentMethod:l.payment_method,authType:l.auth_type,cardBrand:l.card_brand},eligibleGatewayList:I,rankingAlgorithm:l.ranking_algorithm,eliminationEnabled:l.elimination_enabled});await bt("/update-gateway-score",{merchantId:e,gateway:se.decided_gateway,gatewayReferenceId:null,status:_,paymentId:F,enforceDynamicRoutingFailure:null}),w(se),b(F)}catch(se){V(se instanceof Error?se.message:"Request failed")}finally{U(!1)}}async function Ml(){if(!e)return V("Set a merchant ID in the top bar");if(i)return V("Routing key config unavailable. Fix /config/routing-keys and retry.");const I=parseInt(f.totalPayments)||0,F=parseInt(f.successCount)||0,se=parseInt(f.failureCount)||0;if(I<=0)return V("Total Payments must be greater than 0");if(F+se!==I)return V("Success + Failure count must equal Total Payments");z(!0),V(null),R([]);const de=l.eligible_gateways.split(",").map(Qt=>Qt.trim()).filter(Boolean),st=[],br=[...Array(F).fill("CHARGED"),...Array(se).fill("FAILURE")];for(let Qt=br.length-1;Qt>0;Qt--){const qa=Math.floor(Math.random()*(Qt+1));[br[Qt],br[qa]]=[br[qa],br[Qt]]}try{for(let Qt=0;Qt{de.key&&(de.type==="metadata_variant"?F[de.key]={type:de.type,value:{key:de.metadataKey||de.key,value:de.value}}:de.type==="number"?F[de.key]={type:de.type,value:parseFloat(de.value)||0}:F[de.key]={type:de.type,value:de.value})});const se=await bt("/routing/evaluate",{created_by:e||"test_user",payment_id:I,fallback_output:g.filter(de=>de.gateway_name),parameters:F});if(A(se),se.output.type==="volume_split"&&se.output.splits){const de=parseInt(v)||100,st=se.output.splits.map(br=>({name:br.connector.gateway_name,count:Math.round(br.split/100*de),percentage:br.split}));T(st)}}catch(F){V(F instanceof Error?F.message:"Request failed")}finally{U(!1)}}async function Yt(){U(!0),V(null),T([]);const I=`volume_preview_${Date.now()}`;try{const F=await bt("/routing/evaluate",{created_by:e||"test_user",payment_id:I,fallback_output:[{gateway_name:"stripe",gateway_id:"gateway_001"},{gateway_name:"adyen",gateway_id:"gateway_002"}],parameters:{}});if(A(F),F.output.type==="volume_split"&&F.output.splits){const se=parseInt(v)||100,de=F.output.splits.map(st=>({name:st.connector.gateway_name,count:Math.round(st.split/100*se),percentage:st.split}));T(de)}}catch(F){V(F instanceof Error?F.message:"Request failed")}finally{U(!1)}}const Zt=m!=null&&m.gateway_priority_map?Object.entries(m.gateway_priority_map).sort(([,I],[,F])=>F-I).map(([I,F])=>({name:I,score:Math.round(F*1e3)/10})):[],cr=P.reduce((I,F)=>(I[F.decidedGateway]||(I[F.decidedGateway]={total:0,success:0,failure:0}),I[F.decidedGateway].total++,F.status==="CHARGED"?I[F.decidedGateway].success++:I[F.decidedGateway].failure++,I),{}),jn=$.map(I=>({name:I.name,value:I.count})),Nr=j.useMemo(()=>fce($,parseInt(v)||0),[$,v]),ut=j.useMemo(()=>{var F;const I=((F=G.data)==null?void 0:F.results)||[];return I.find(se=>se.payment_id===ue)||I[0]||null},[(Nw=G.data)==null?void 0:Nw.results,ue]),Ue=j.useMemo(()=>{var F;const I=((F=G.data)==null?void 0:F.timeline)||[];return I.find(se=>se.id===Fe)||I[0]||null},[(Cw=G.data)==null?void 0:Cw.timeline,Fe]);j.useEffect(()=>{var F,se;if(Ue!=null&&Ue.id){te(Ue.id);return}const I=(se=(F=G.data)==null?void 0:F.timeline)==null?void 0:se[0];I!=null&&I.id&&te(I.id)},[(Tw=G.data)==null?void 0:Tw.timeline,Ue==null?void 0:Ue.id]);const la=j.useMemo(()=>{var F;const I=[];for(const se of((F=G.data)==null?void 0:F.timeline)||[]){const de=sx(se),st=I[I.length-1];!st||st.phase!==de?I.push({phase:de,events:[se]}):st.events.push(se)}return I},[($w=G.data)==null?void 0:$w.timeline]),ot=j.useMemo(()=>aA(Ue),[Ue]),Pt=j.useMemo(()=>{var F;const I=((F=Z.data)==null?void 0:F.results)||[];return I.find(se=>se.payment_id===X)||I[0]||null},[(Iw=Z.data)==null?void 0:Iw.results,X]),Ve=j.useMemo(()=>{var F;const I=((F=Z.data)==null?void 0:F.timeline)||[];return I.find(se=>se.id===ve)||I[0]||null},[(Rw=Z.data)==null?void 0:Rw.timeline,ve]);j.useEffect(()=>{var F,se;if(Ve!=null&&Ve.id){Pe(Ve.id);return}const I=(se=(F=Z.data)==null?void 0:F.timeline)==null?void 0:se[0];I!=null&&I.id&&Pe(I.id)},[(Mw=Z.data)==null?void 0:Mw.timeline,Ve==null?void 0:Ve.id]);const rn=j.useMemo(()=>{var F;const I=[];for(const se of((F=Z.data)==null?void 0:F.timeline)||[]){const de=sx(se),st=I[I.length-1];!st||st.phase!==de?I.push({phase:de,events:[se]}):st.events.push(se)}return I},[(Dw=Z.data)==null?void 0:Dw.timeline]),nn=j.useMemo(()=>aA(Ve),[Ve]);function Ha(I){Ee(null),Pe(null),ge("summary"),Ce(I),te(null),he("summary")}function On(){Ce(null),te(null),he("summary")}function Ga(I,F){Ce(null),te(null),he("summary"),Le(F),Ee(I),Pe(null),ge("summary")}function zo(){Ee(null),Pe(null),ge("summary")}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Decision Explorer"}),c.jsx("p",{className:"text-slate-500 mt-1 text-sm",children:"Test payment routing with different algorithms: Success Rate, Priority List, Rule-Based, or Volume Split."})]}),c.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-[#1c1c24]",children:[c.jsx("button",{onClick:()=>s("single"),className:`px-4 py-2 text-sm font-medium ${o==="single"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Single Test"}),c.jsx("button",{onClick:()=>s("batch"),className:`px-4 py-2 text-sm font-medium ${o==="batch"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Batch Simulation"}),c.jsx("button",{onClick:()=>s("rule"),className:`px-4 py-2 text-sm font-medium ${o==="rule"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Rule-Based"}),c.jsx("button",{onClick:()=>s("volume"),className:`px-4 py-2 text-sm font-medium ${o==="volume"?"text-brand-500 border-b-2 border-brand-500":"text-slate-500 hover:text-slate-700"}`,children:"Volume Split"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h2",{className:"font-medium text-slate-800",children:o==="rule"?"Rule Evaluation Parameters":o==="volume"?"Volume Split Configuration":"Payment Parameters"})}),c.jsxs(Ae,{className:"space-y-3",children:[!e&&o!=="volume"&&c.jsx("p",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2",children:"Set a merchant ID in the top bar first."}),o!=="volume"&&r&&c.jsx("p",{className:"text-xs text-slate-600 bg-slate-50 border border-slate-200 rounded px-3 py-2",children:"Loading routing config from backend..."}),o!=="volume"&&i&&c.jsx(Gr,{error:"Routing config unavailable from /config/routing-keys. Parameter forms are disabled."}),o==="rule"?c.jsxs(c.Fragment,{children:[r&&c.jsx("p",{className:"text-sm text-slate-500",children:"Loading routing keys from backend..."}),i&&c.jsx(Gr,{error:"Routing keys are unavailable from backend (/config/routing-keys). Rule Evaluation is disabled."}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Parameters"}),c.jsx("div",{className:"space-y-2",children:p.map((I,F)=>{var se;return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx("select",{value:I.key,onChange:de=>zi(F,de.target.value),disabled:i||r,className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Oe.length===0?c.jsx("option",{value:"",children:"No keys available"}):Oe.map(de=>c.jsx("option",{value:de,children:de},de))}),c.jsx("input",{value:I.type,readOnly:!0,className:"w-36 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>Et(F),className:"p-1.5 text-slate-400 hover:text-red-500",children:c.jsx(Ca,{size:14})})]}),I.type==="metadata_variant"?c.jsxs("div",{className:"flex gap-2 items-center pl-1",children:[c.jsx("input",{placeholder:"Metadata Key",value:I.metadataKey||"",onChange:de=>Xt(F,de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{placeholder:"Metadata Value",value:I.value,onChange:de=>Tt(F,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}):I.type==="enum_variant"?c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("select",{value:I.value,onChange:de=>Tt(F,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:(((se=t[I.key])==null?void 0:se.values)||[]).map(de=>c.jsx("option",{value:de,children:de},de))})}):I.type==="number"?c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("input",{type:"number",placeholder:"Value",value:I.value,onChange:de=>Tt(F,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})}):c.jsx("div",{className:"flex gap-2 items-center pl-1",children:c.jsx("input",{placeholder:"Value",value:I.value,onChange:de=>Tt(F,"value",de.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})})]},F)})}),c.jsxs("button",{onClick:Te,disabled:i||r||Oe.length===0,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[c.jsx(ki,{size:12})," Add Parameter"]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Fallback gateway_name/gateway_id"}),c.jsx("div",{className:"space-y-2",children:g.map((I,F)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx("input",{placeholder:"gateway_name",value:I.gateway_name,onChange:se=>Ui(F,"gateway_name",se.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("input",{placeholder:"gateway_id",value:I.gateway_id||"",onChange:se=>Ui(F,"gateway_id",se.target.value),className:"flex-1 border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("button",{onClick:()=>Bi(F),className:"p-1.5 text-slate-400 hover:text-red-500",children:c.jsx(Ca,{size:14})})]},F))}),c.jsxs("button",{onClick:Wa,className:"mt-2 flex items-center gap-1 text-xs text-brand-500 hover:text-brand-600",children:[c.jsx(ki,{size:12})," Add Gateway"]})]})]}):o==="volume"?c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Number of Payments"}),c.jsx("input",{type:"text",value:v,onChange:I=>x(I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"}),c.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Enter the total number of payments to visualize how they would be distributed across gateways."})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Amount"}),c.jsx("input",{value:l.amount,onChange:I=>me("amount",I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Currency"}),c.jsx("select",{value:l.currency,onChange:I=>me("currency",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:E.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method Type"}),c.jsx("select",{value:l.payment_method_type,onChange:I=>me("payment_method_type",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:Ge.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Payment Method"}),c.jsx("select",{value:l.payment_method,onChange:I=>me("payment_method",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:H.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Card Brand"}),c.jsx("select",{value:l.card_brand,onChange:I=>me("card_brand",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:M.map(I=>c.jsx("option",{children:I},I))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Auth Type"}),c.jsx("select",{value:l.auth_type,onChange:I=>me("auth_type",I.target.value),disabled:i||r,className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:N.map(I=>c.jsx("option",{children:I},I))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Eligible Gateways (comma-separated)"}),c.jsx("input",{value:l.eligible_gateways,onChange:I=>me("eligible_gateways",I.target.value),placeholder:"stripe, adyen",className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Algorithm"}),c.jsx("select",{value:l.ranking_algorithm,onChange:I=>me("ranking_algorithm",I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:lce.map(I=>c.jsx("option",{value:I,children:uce[I]},I))})]}),c.jsx("div",{className:"flex items-end pb-1",children:c.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:l.elimination_enabled,onChange:I=>me("elimination_enabled",I.target.checked),className:"rounded"}),"Elimination enabled"]})})]}),o==="single"&&c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Transaction Outcome"}),c.jsxs("select",{value:_,onChange:I=>O(I.target.value),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",children:[c.jsx("option",{value:"CHARGED",children:"Success (CHARGED)"}),c.jsx("option",{value:"FAILURE",children:"Failure (FAILURE)"})]}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"After deciding the gateway, single test will post feedback with this outcome so the payment appears in Decision Audit."})]}),o==="batch"&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-4 mt-4 space-y-3",children:[c.jsxs("h3",{className:"text-sm font-medium text-slate-800 flex items-center gap-2",children:[c.jsx(vf,{size:14}),"Simulation Configuration"]}),c.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Total Payments"}),c.jsx("input",{type:"text",value:f.totalPayments,onChange:I=>d(F=>({...F,totalPayments:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Success Count"}),c.jsx("input",{type:"text",value:f.successCount,onChange:I=>d(F=>({...F,successCount:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:"Failure Count"}),c.jsx("input",{type:"text",value:f.failureCount,onChange:I=>d(F=>({...F,failureCount:I.target.value})),className:"w-full border border-slate-200 dark:border-[#222226] bg-transparent rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-brand-500"})]})]}),c.jsxs("p",{className:"text-xs text-slate-500",children:["Will run ",f.totalPayments||0," payments: ",f.successCount||0," SUCCESS, ",f.failureCount||0," FAILURE"]})]})]}),c.jsx(Gr,{error:W}),o==="rule"?c.jsx(Ie,{onClick:Fo,disabled:D||i,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Evaluating…"]}):c.jsxs(c.Fragment,{children:[c.jsx($d,{size:14})," Evaluate Rules"]})}):o==="volume"?c.jsx(Ie,{onClick:Yt,disabled:D,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Calculating…"]}):c.jsxs(c.Fragment,{children:[c.jsx(Xf,{size:14})," Visualize Distribution"]})}):o==="batch"?c.jsx(Ie,{onClick:Ml,disabled:L||!e||i,className:"w-full justify-center",children:L?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14}),"Simulating ",P.length,"/",f.totalPayments||0,"..."]}):c.jsxs(c.Fragment,{children:[c.jsx(vf,{size:14})," Run Batch Simulation"]})}):c.jsx(Ie,{onClick:Vi,disabled:D||!e||i,className:"w-full justify-center",children:D?c.jsxs(c.Fragment,{children:[c.jsx(mr,{size:14})," Running…"]}):c.jsxs(c.Fragment,{children:[c.jsx($d,{size:14})," Run Single Transaction"]})})]})]}),c.jsx("div",{className:"space-y-4",children:o==="volume"?$.length>0?c.jsxs(c.Fragment,{children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Volume Distribution Overview"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Preview only. This uses the active routing rule and stores a trace for inspection."})]}),k!=null&&k.payment_id?c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>Ga(k.payment_id,"Volume Split Preview"),children:"View preview trace"}):null]})}),c.jsxs(Ae,{children:[c.jsxs("div",{className:"text-center mb-4",children:[c.jsx("p",{className:"text-3xl font-bold text-slate-900",children:v}),c.jsx("p",{className:"text-xs text-slate-500",children:"Total Payments"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4",children:$.map((I,F)=>c.jsxs("div",{className:"bg-slate-50 dark:bg-[#111114] rounded-lg p-3",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:Cr[F%Cr.length]}}),c.jsx("span",{className:"font-medium text-sm",children:I.name})]}),c.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[c.jsxs("span",{children:[I.percentage,"%"]}),c.jsxs("span",{className:"font-medium text-slate-700",children:[I.count," payments"]})]})]},F))})]})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Pie Chart"})}),c.jsx(Ae,{children:c.jsx(ks,{width:"100%",height:250,children:c.jsxs(M$,{children:[c.jsx(sa,{data:jn,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:I,percent:F})=>`${I} ${(F*100).toFixed(0)}%`,labelLine:!1,children:jn.map((I,F)=>c.jsx(co,{fill:Cr[F%Cr.length]},`cell-${F}`))}),c.jsx(_r,{formatter:I=>[`${I} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}})]})})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Bar Chart"})}),c.jsx(Ae,{children:c.jsx(ks,{width:"100%",height:$.length*50+40,children:c.jsxs(Jk,{data:$,layout:"vertical",margin:{left:20,right:40},children:[c.jsx(Ma,{type:"number",tick:{fontSize:12,fill:"#666"},axisLine:{stroke:"#e5e7eb"},tickLine:!1}),c.jsx(Da,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#666"},width:80,axisLine:!1,tickLine:!1}),c.jsx(_r,{formatter:I=>[`${I} payments`,"Count"],contentStyle:document.documentElement.classList.contains("dark")?{backgroundColor:"#111114",border:"1px solid #222226",borderRadius:"8px",color:"#fff"}:{backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#1f2937"}}),c.jsx(Ni,{dataKey:"count",radius:[0,6,6,0],children:$.map((I,F)=>c.jsx(co,{fill:Cr[F%Cr.length]},`cell-${F}`))})]})})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Percentage Distribution"})}),c.jsxs(Ae,{children:[c.jsx("div",{className:"h-4 rounded-full overflow-hidden flex",children:$.map((I,F)=>c.jsx("div",{style:{width:`${I.percentage}%`,backgroundColor:Cr[F%Cr.length]},className:"h-full transition-all duration-300",title:`${I.name}: ${I.percentage}%`},F))}),c.jsx("div",{className:"flex flex-wrap gap-3 mt-3",children:$.map((I,F)=>c.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:Cr[F%Cr.length]}}),c.jsx("span",{className:"text-slate-600",children:I.name}),c.jsxs("span",{className:"font-medium",children:[I.percentage,"%"]})]},F))})]})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Summary"})}),c.jsx(Ae,{className:"p-0",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"}),c.jsx("th",{className:"text-right px-4 py-2",children:"Payments"}),c.jsx("th",{className:"text-right px-4 py-2",children:"Percentage"})]})}),c.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:[$.map((I,F)=>c.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:Cr[F%Cr.length]}}),c.jsx("span",{className:"font-medium",children:I.name})]})}),c.jsx("td",{className:"px-4 py-2 text-right font-medium",children:I.count}),c.jsxs("td",{className:"px-4 py-2 text-right text-slate-500",children:[I.percentage,"%"]})]},F)),c.jsxs("tr",{className:"bg-slate-50 dark:bg-[#111114] font-medium",children:[c.jsx("td",{className:"px-4 py-2",children:"Total"}),c.jsx("td",{className:"px-4 py-2 text-right",children:v}),c.jsx("td",{className:"px-4 py-2 text-right",children:"100%"})]})]})]})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Projected Sequence"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Preview-only projection based on the configured split. This is not a live payment trail."})]})}),c.jsx(Ae,{className:"p-0 max-h-80 overflow-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#111114] text-xs text-slate-500 sticky top-0",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-4 py-2 w-20",children:"#"}),c.jsx("th",{className:"text-left px-4 py-2",children:"gateway_name"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-[#222226]",children:Nr.map((I,F)=>c.jsxs("tr",{className:"hover:bg-slate-50 dark:bg-[#111114]",children:[c.jsx("td",{className:"px-4 py-1.5 text-slate-500 font-mono text-xs",children:F+1}),c.jsx("td",{className:"px-4 py-1.5",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2 h-2 rounded",style:{backgroundColor:Cr[I.colorIdx%Cr.length]}}),c.jsx("span",{className:"font-medium",children:I.connector})]})})]},`${I.connector}-${F}`))})]})})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("button",{onClick:()=>be(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ry,{size:14}),"API Response"]}),Q?c.jsx(fu,{size:14}):c.jsx(du,{size:14})]})}),Q&&k&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(k,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx(Xf,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Enter the number of payments and click "Visualize Distribution" to see how payments are split across gateways.'})]})}):o==="rule"?k?c.jsxs(c.Fragment,{children:[c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Status"}),c.jsx("p",{className:"text-2xl font-bold text-slate-900",children:k.status}),c.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["output_type: ",k.output.type]})]}),k.payment_id?c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>Ga(k.payment_id,"Rule Evaluation Preview"),children:"View preview trace"}):null]}),k.output.type==="single"&&k.output.connector&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Selected gateway_name"}),c.jsx("p",{className:"text-lg font-semibold",children:k.output.connector.gateway_name}),k.output.connector.gateway_id&&c.jsxs("p",{className:"text-xs text-slate-500",children:["gateway_id: ",k.output.connector.gateway_id]})]}),k.output.type==="priority"&&k.output.connectors&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Priority gateway_name list"}),c.jsx("div",{className:"space-y-1",children:k.output.connectors.map((I,F)=>c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-500 text-white text-xs flex items-center justify-center",children:F+1}),c.jsx("span",{className:"font-medium",children:I.gateway_name}),I.gateway_id&&c.jsxs("span",{className:"text-xs text-slate-500",children:["(",I.gateway_id,")"]})]},F))})]}),k.output.type==="volume_split"&&c.jsxs("div",{className:"border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Volume Split Result"}),c.jsx("p",{className:"text-sm text-slate-600",children:"See Volume Split tab for detailed visualization."})]})]})}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("button",{onClick:()=>ae(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ry,{size:14}),"API Response"]}),K?c.jsx(fu,{size:14}):c.jsx(du,{size:14})]})}),K&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(k,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx($d,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Configure rule parameters and click "Evaluate Rules" to test routing.'})]})}):o==="batch"?P.length>0?c.jsxs(c.Fragment,{children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Simulation Progress"})}),c.jsxs(Ae,{children:[c.jsxs("div",{className:"mb-4",children:[c.jsxs("div",{className:"flex justify-between text-xs text-slate-600 mb-1",children:[c.jsx("span",{children:"Progress"}),c.jsxs("span",{children:[Math.round(P.length/(parseInt(f.totalPayments)||1)*100),"%"]})]}),c.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:c.jsx("div",{className:"bg-brand-500 h-2 rounded-full transition-all duration-300",style:{width:`${P.length/(parseInt(f.totalPayments)||1)*100}%`}})})]}),Object.keys(cr).length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-xs font-medium text-slate-700",children:"Gateway Selection Summary"}),Object.entries(cr).map(([I,F])=>c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"font-medium",children:I}),c.jsxs("div",{className:"flex gap-3 text-xs",children:[c.jsxs("span",{className:"text-emerald-600",children:[F.success," ✓"]}),c.jsxs("span",{className:"text-red-500",children:[F.failure," ✗"]}),c.jsxs("span",{className:"text-slate-500",children:["(",F.total," total)"]})]})]},I))]})]})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Transaction Log"})}),c.jsx(Ae,{className:"p-0 max-h-96 overflow-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-slate-50 dark:bg-[#0a0a0f] text-xs text-slate-500 sticky top-0",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-3 py-2",children:"#"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Payment ID"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Gateway"}),c.jsx("th",{className:"text-left px-3 py-2",children:"Outcome"})]})}),c.jsx("tbody",{className:"divide-y divide-[#1c1c24]",children:P.map((I,F)=>c.jsxs("tr",{className:"hover:bg-slate-100 dark:bg-[#0f0f16]",children:[c.jsx("td",{className:"px-3 py-2 text-slate-500",children:F+1}),c.jsx("td",{className:"px-3 py-2",children:c.jsxs("button",{type:"button",title:I.paymentId,onClick:()=>Ha(I.paymentId),className:"group flex items-start gap-3 text-left",children:[c.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-brand-500/10 text-[11px] font-semibold uppercase tracking-[0.16em] text-brand-600 dark:text-brand-300",children:F+1}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block truncate font-mono text-xs font-semibold text-slate-900 transition group-hover:text-brand-600 dark:text-white",children:I.paymentId}),c.jsx("span",{className:"mt-1 block text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-400 transition group-hover:text-brand-500",children:"View audit"})]})]})}),c.jsx("td",{className:"px-3 py-2 font-medium",children:I.decidedGateway}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(_e,{variant:I.status==="CHARGED"?"green":"red",children:I.status})})]},I.paymentId))})]})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx(vf,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Configure simulation parameters and click "Run Batch Simulation" to test Success Rate routing.'})]})}):m?c.jsxs(c.Fragment,{children:[c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-1",children:"Decided Gateway"}),c.jsx("p",{className:"text-3xl font-bold text-slate-900",children:m.decided_gateway})]}),c.jsxs("div",{className:"text-right space-y-2",children:[c.jsx("div",{children:c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${cce(m.routing_approach)}`,children:m.routing_approach})}),S?c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>Ha(S),children:"View audit"}):null,m.is_scheduled_outage&&c.jsx(_e,{variant:"red",children:"Scheduled Outage"}),S?c.jsx(_e,{variant:_==="CHARGED"?"green":"red",children:_}):null,m.latency!=null&&c.jsxs("p",{className:"text-xs text-slate-400",children:[m.latency,"ms"]})]})]}),S?c.jsxs("div",{className:"mb-3 rounded-[18px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Payment ID"}),c.jsx("p",{className:"mt-2 font-mono text-sm text-slate-900 dark:text-white",children:S}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:["Feedback recorded as ",_,". Open audit to inspect the full decide and update flow."]})]}):null,m.routing_dimension&&c.jsxs("div",{className:"flex gap-4 text-sm text-slate-600 border-t border-slate-200 dark:border-[#1c1c24] pt-3",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Dimension"}),c.jsx("p",{className:"font-medium",children:m.routing_dimension})]}),m.routing_dimension_level&&c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Level"}),c.jsx("p",{className:"font-medium",children:m.routing_dimension_level})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Reset"}),c.jsx("p",{className:"font-medium",children:m.reset_approach})]})]})]})}),Zt.length>0&&c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-medium text-slate-800",children:"Gateway Scores"}),c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:Vi,className:"text-xs",children:[c.jsx(ny,{size:12})," Refresh"]})]})}),c.jsx(Ae,{children:c.jsx(ks,{width:"100%",height:Zt.length*40+20,children:c.jsxs(Jk,{data:Zt,layout:"vertical",margin:{left:10,right:30},children:[c.jsx(Ma,{type:"number",domain:[0,100],tickFormatter:I=>`${I}%`,tick:{fontSize:11,fill:"#66667a"},axisLine:{stroke:"#1c1c24"},tickLine:!1}),c.jsx(Da,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#8e8ea0"},width:60,axisLine:!1,tickLine:!1}),c.jsx(_r,{formatter:I=>`${I}%`,contentStyle:{backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"8px",color:"#e8e8f4"}}),c.jsx(Ni,{dataKey:"score",radius:[0,4,4,0],children:Zt.map((I,F)=>c.jsx(co,{fill:I.name===m.decided_gateway?"#0069ED":I.score<30?"#ef4444":I.score<60?"#f59e0b":"#10b981"},F))})]})})})]}),m.filter_wise_gateways&&c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("button",{onClick:()=>J(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:["Filter Chain",q?c.jsx(fu,{size:14}):c.jsx(du,{size:14})]})}),q&&c.jsx(Ae,{className:"space-y-2",children:Object.entries(m.filter_wise_gateways).map(([I,F])=>c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:"text-xs font-mono bg-slate-100 dark:bg-[#111118] text-slate-600 rounded-md px-2 py-0.5 mt-0.5 shrink-0 border border-slate-200 dark:border-[#1c1c24]",children:I}),c.jsx("div",{className:"flex flex-wrap gap-1",children:Array.isArray(F)?F.map(se=>c.jsx("span",{className:"text-xs bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20 rounded-md px-2 py-0.5",children:se},se)):c.jsx("span",{className:"text-xs text-slate-400",children:"—"})})]},I))})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("button",{onClick:()=>ae(I=>!I),className:"flex items-center justify-between w-full text-sm font-medium text-slate-800",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ry,{size:14}),"API Response"]}),K?c.jsx(fu,{size:14}):c.jsx(du,{size:14})]})}),K&&c.jsx(Ae,{className:"p-0",children:c.jsx("pre",{className:"text-xs text-slate-600 bg-slate-50 dark:bg-[#0a0a0f] p-4 overflow-auto max-h-96 font-mono",children:JSON.stringify(m,null,2)})})]})]}):c.jsx(ke,{children:c.jsxs(Ae,{className:"py-16 text-center",children:[c.jsx($d,{size:32,className:"text-gray-300 mx-auto mb-3"}),c.jsx("p",{className:"text-slate-400 text-sm",children:'Fill in the parameters and click "Run Single Transaction" to decide a gateway, post feedback, and inspect the audit trail.'})]})})})]}),ue&&c.jsxs("div",{className:"fixed bottom-0 left-64 right-0 top-[76px] z-[130] p-8",children:[c.jsx("button",{type:"button","aria-label":"Close payment audit",className:"absolute inset-0 bg-slate-950/70 backdrop-blur-sm",onClick:On}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"decision-explorer-audit-title",className:"relative mx-auto flex h-full w-full max-w-7xl flex-col overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-2xl dark:border-[#1c1c23] dark:bg-[#09090d]",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-slate-200 bg-slate-50/90 px-6 py-5 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-[#8a8a93]",children:"Batch Simulation Audit"}),c.jsx("h2",{id:"decision-explorer-audit-title",className:"mt-2 truncate text-2xl font-semibold text-slate-900 dark:text-white",children:ue}),c.jsx("p",{className:"mt-2 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:"Inspect the exact decision trail for this simulated payment, including request payloads, API responses, score context, and the final transaction outcome."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ut!=null&&ut.latest_gateway?c.jsx(_e,{variant:"green",children:ut.latest_gateway}):null,ut!=null&&ut.latest_status?c.jsx(_e,{variant:rA(ut.latest_status),children:un(ut.latest_status)}):null,ut!=null&&ut.event_count?c.jsxs(_e,{variant:"gray",children:[ut.event_count," events"]}):null,c.jsxs(Ie,{size:"sm",variant:"secondary",onClick:()=>G.mutate(),children:[c.jsx(ny,{size:12}),"Refresh"]}),c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:On,children:[c.jsx(a_,{size:14}),"Close"]})]})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 gap-0 xl:grid-cols-[340px_minmax(0,1fr)]",children:[c.jsxs("div",{className:"flex min-h-0 flex-col border-b border-slate-200 bg-slate-50/70 xl:border-b-0 xl:border-r dark:border-[#1c1c23] dark:bg-[#08080b]",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"Audit Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Choose a step to inspect its request, response, and scoring context."})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:G.isLoading&&!G.data?c.jsxs("div",{className:"flex items-center gap-2 px-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading payment audit…"]}):G.error?c.jsx(Gr,{error:G.error.message}):la.length?c.jsx("div",{className:"space-y-4",children:la.map(I=>c.jsxs("section",{className:"space-y-2",children:[c.jsx("div",{className:"px-2",children:c.jsx(_e,{variant:nA(I.phase),children:I.phase})}),c.jsx("div",{className:"space-y-2",children:I.events.map(F=>c.jsxs("button",{type:"button",onClick:()=>{te(F.id),he("summary")},className:`w-full rounded-[22px] border px-4 py-3 text-left transition ${(Ue==null?void 0:Ue.id)===F.id?"border-brand-500/50 bg-brand-500/8":"border-slate-200 bg-white hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#0c0c10] dark:hover:border-[#2a2a31]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:gu(F)}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:yu(F.created_at_ms)})]}),c.jsx(_e,{variant:Qd(F),children:un(F.status)||tA(F.event_type)})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(_e,{variant:"gray",children:vu(F.route)}),F.gateway?c.jsx(_e,{variant:"green",children:F.gateway}):null,F.request_id?c.jsx(_e,{variant:"blue",children:"Request"}):null]})]},F.id))})]},I.phase))}):c.jsx(xu,{title:"No audit trail captured yet",body:"Run a simulated payment and gateway update first, then reopen the row once the audit payload is available."})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:Ue?gu(Ue):"Audit Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:Ue?`${vu(Ue.route)} · ${yu(Ue.created_at_ms)}`:"Select an event from the left to inspect payloads."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ue!=null&&Ue.gateway?c.jsx(_e,{variant:"green",children:Ue.gateway}):null,Ue!=null&&Ue.status?c.jsx(_e,{variant:Qd(Ue),children:un(Ue.status)}):null]})]}),c.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["summary","input","response","raw"].map(I=>c.jsx("button",{type:"button",onClick:()=>he(I),className:`rounded-full px-4 py-2 text-xs font-semibold uppercase tracking-[0.16em] transition ${iA(ie===I)}`,children:I==="raw"?"Raw JSON":un(I)},I))})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:G.isLoading&&!G.data?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading inspector…"]}):ot?c.jsxs("div",{className:"space-y-5",children:[ie==="summary"?c.jsxs(c.Fragment,{children:[c.jsx(oA,{rows:ot.summaryRows}),ot.selectionReason?c.jsxs("div",{className:"rounded-[22px] border border-slate-200 bg-slate-50/80 px-5 py-4 dark:border-[#1d1d23] dark:bg-[#0b0b10]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Selection Reason"}),c.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-700 dark:text-slate-200",children:L$(ot.selectionReason)})]}):null,c.jsx(da,{title:"Score Context",value:ot.scoreContext,emptyMessage:"No scoring context was captured for this event."}),ot.signalRecord?c.jsx(da,{title:"Additional Signals",value:ot.signalRecord,emptyMessage:"No additional signals were captured for this event."}):null]}):null,ie==="input"?c.jsx(da,{title:"Request Payload",value:ot.requestPayload,emptyMessage:"This step did not persist a request payload."}):null,ie==="response"?c.jsx(da,{title:"Response Payload",value:ot.responsePayload,emptyMessage:"This step did not persist a response payload."}):null,ie==="raw"?c.jsx(da,{title:"Raw Event JSON",value:ot.rawEvent,emptyMessage:"No raw event payload is available."}):null]}):c.jsx(xu,{title:"Select a timeline step",body:"Choose one of the audit events on the left to inspect its request, response, and score context."})})]})]})]})]}),X&&c.jsxs("div",{className:"fixed bottom-0 left-64 right-0 top-[76px] z-[130] p-8",children:[c.jsx("button",{type:"button","aria-label":"Close preview trace",className:"absolute inset-0 bg-slate-950/70 backdrop-blur-sm",onClick:zo}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"decision-explorer-preview-title",className:"relative mx-auto flex h-full w-full max-w-7xl flex-col overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-2xl dark:border-[#1c1c23] dark:bg-[#09090d]",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-slate-200 bg-slate-50/90 px-6 py-5 dark:border-[#1c1c23] dark:bg-[#0b0b10]",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-[#8a8a93]",children:"Preview Trace"}),c.jsx("h2",{id:"decision-explorer-preview-title",className:"mt-2 truncate text-2xl font-semibold text-slate-900 dark:text-white",children:X}),c.jsxs("p",{className:"mt-2 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:[$e,". This is a preview-only trace captured from ",c.jsx("code",{className:"font-mono text-xs",children:"/routing/evaluate"}),", not a transaction outcome."]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Pt!=null&&Pt.latest_gateway?c.jsx(_e,{variant:"green",children:Pt.latest_gateway}):null,Pt!=null&&Pt.latest_status?c.jsx(_e,{variant:rA(Pt.latest_status),children:un(Pt.latest_status)}):null,Pt!=null&&Pt.event_count?c.jsxs(_e,{variant:"gray",children:[Pt.event_count," events"]}):null,c.jsxs(Ie,{size:"sm",variant:"secondary",onClick:()=>Z.mutate(),children:[c.jsx(ny,{size:12}),"Refresh"]}),c.jsxs(Ie,{size:"sm",variant:"ghost",onClick:zo,children:[c.jsx(a_,{size:14}),"Close"]})]})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 gap-0 xl:grid-cols-[340px_minmax(0,1fr)]",children:[c.jsxs("div",{className:"flex min-h-0 flex-col border-b border-slate-200 bg-slate-50/70 xl:border-b-0 xl:border-r dark:border-[#1c1c23] dark:bg-[#08080b]",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"Preview Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Choose a preview step to inspect its request, response, and routing output."})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:Z.isLoading&&!Z.data?c.jsxs("div",{className:"flex items-center gap-2 px-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading preview trace…"]}):Z.error?c.jsx(Gr,{error:Z.error.message}):rn.length?c.jsx("div",{className:"space-y-4",children:rn.map(I=>c.jsxs("section",{className:"space-y-2",children:[c.jsx("div",{className:"px-2",children:c.jsx(_e,{variant:nA(I.phase),children:I.phase})}),c.jsx("div",{className:"space-y-2",children:I.events.map(F=>c.jsxs("button",{type:"button",onClick:()=>{Pe(F.id),ge("summary")},className:`w-full rounded-[22px] border px-4 py-3 text-left transition ${(Ve==null?void 0:Ve.id)===F.id?"border-brand-500/50 bg-brand-500/8":"border-slate-200 bg-white hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#0c0c10] dark:hover:border-[#2a2a31]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:gu(F)}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:yu(F.created_at_ms)})]}),c.jsx(_e,{variant:Qd(F),children:un(F.status)||tA(F.event_type)})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(_e,{variant:"gray",children:vu(F.route)}),F.gateway?c.jsx(_e,{variant:"green",children:F.gateway}):null]})]},F.id))})]},I.phase))}):c.jsx(xu,{title:"No preview trace captured yet",body:"Run Rule-Based or Volume Split evaluation first, then open the preview trace once the request has been logged."})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col",children:[c.jsxs("div",{className:"border-b border-slate-200 px-6 py-4 dark:border-[#1c1c23]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:Ve?gu(Ve):"Preview Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:Ve?`${vu(Ve.route)} · ${yu(Ve.created_at_ms)}`:"Select an event from the left to inspect the preview payload."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ve!=null&&Ve.gateway?c.jsx(_e,{variant:"green",children:Ve.gateway}):null,Ve!=null&&Ve.status?c.jsx(_e,{variant:Qd(Ve),children:un(Ve.status)}):null]})]}),c.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["summary","input","response","raw"].map(I=>c.jsx("button",{type:"button",onClick:()=>ge(I),className:`rounded-full px-4 py-2 text-xs font-semibold uppercase tracking-[0.16em] transition ${iA(ze===I)}`,children:I==="raw"?"Raw JSON":un(I)},I))})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:Z.isLoading&&!Z.data?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading preview inspector…"]}):nn?c.jsxs("div",{className:"space-y-5",children:[ze==="summary"?c.jsxs(c.Fragment,{children:[c.jsx(oA,{rows:nn.summaryRows}),c.jsx(da,{title:"Preview Signals",value:nn.signalRecord,emptyMessage:"No extra preview metadata was captured for this evaluation."})]}):null,ze==="input"?c.jsx(da,{title:"Request Payload",value:nn.requestPayload,emptyMessage:"No request payload was captured for this preview."}):null,ze==="response"?c.jsx(da,{title:"Response Payload",value:nn.responsePayload,emptyMessage:"No response payload was captured for this preview."}):null,ze==="raw"?c.jsx(da,{title:"Raw Event JSON",value:nn.rawEvent,emptyMessage:"No raw event payload is available for this preview."}):null]}):c.jsx(xu,{title:"Select a preview step",body:"Choose one of the preview events on the left to inspect its request and response payload."})})]})]})]})]})]})}const sA=[{value:"15m",label:"Last 15 mins"},{value:"1h",label:"Last 1 hour"},{value:"24h",label:"Last 1 day"},{value:"custom",label:"Custom window"}],Ya=["#0069ED","#14b8a6","#f97316","#e11d48","#8b5cf6","#22c55e"],lA={backgroundColor:"#0d0d12",border:"1px solid #1c1c24",borderRadius:"14px",color:"#e8e8f4",boxShadow:"0 16px 40px rgba(0, 0, 0, 0.35)"},uA={color:"#f8fafc",fontWeight:600,marginBottom:8},cA={color:"#e2e8f0"},dA={zIndex:30,outline:"none"},fA={dimensions:{},gateways:[]},au=3,av={hits:{title:"API call counts",purpose:"Use these cards to see how much traffic each major decision-engine API handled in the selected window.",calculation:"Each request records one lightweight API-call event. The cards count those recorded calls for `/decide_gateway`, `/update_gateway`, and `/rule_evaluate`.",source:"Counts come from analytics rows persisted in `analytics_event` in Postgres."},share:{title:"Gateway share over time",purpose:"Use this to see when traffic shifted from one connector to another for the selected merchant.",calculation:"Decision events are bucketed by time and grouped by chosen connector. The chart shows how many decisions each gateway captured in each bucket.",source:"Reads persisted `decision` rows from `analytics_event` in Postgres."},sr:{title:"Connector success rate over time",purpose:"Use this to explain why a connector won routing at a given time, based on the recorded historical score trail.",calculation:"Stored `score_snapshot` events are bucketed over the selected window and averaged per connector. The line values are displayed as percentages.",source:"Reads persisted `score_snapshot` rows from `analytics_event` in Postgres. The current score state originates from Redis-backed scoring flows."}};function yce(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function iv(e,t,r,n,a){const i={scope:"current",range:t==="custom"?"1h":t,start_ms:n==null?void 0:n.start_ms,end_ms:n==null?void 0:n.end_ms,merchant_id:r,gateway:a!=null&&a.gateways.length?a.gateways.join(","):void 0};Object.entries((a==null?void 0:a.dimensions)||{}).forEach(([s,l])=>{l&&(i[s]=l)});const o=yce(i);return o?`${e}?${o}`:e}function Pw(e,t=2){if(e==null||Number.isNaN(Number(e)))return"0";const r=Number(e);return Number.isInteger(r)?r.toString():r.toFixed(t)}function F$(e){return Number.isFinite(e)?e<=1?e*100:e:0}function pA(e,t=1){return e==null||Number.isNaN(Number(e))?"0%":`${Pw(F$(Number(e)),t)}%`}function hA(e){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function Jd(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function vce(e){const t=Date.now(),r=e==="15m"?15*60*1e3:e==="1h"?60*60*1e3:24*60*60*1e3;return{start_ms:t-r,end_ms:t}}function ef(e){const t=new Date(e),r=n=>n.toString().padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}T${r(t.getHours())}:${r(t.getMinutes())}`}function mA(e){const t=new Date(e).getTime();return Number.isFinite(t)?t:null}function tf({title:e,body:t}){return c.jsxs("div",{className:"rounded-[24px] border border-dashed border-slate-200 bg-white/60 px-6 py-12 text-center dark:border-[#222227] dark:bg-[#0b0b0d]",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function rf(){return"h-11 w-full rounded-2xl border border-slate-200 bg-white px-4 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]"}function ov({content:e}){const[t,r]=j.useState(!1),n=j.useRef(null),[a,i]=j.useState({top:0,left:0,width:320});return j.useEffect(()=>{if(!t)return;function o(s){var l;(l=n.current)!=null&&l.contains(s.target)||r(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[t]),j.useLayoutEffect(()=>{if(!t||!n.current)return;const o=320,s=280,l=16,u=12;function f(){if(!n.current)return;const d=n.current.getBoundingClientRect(),p=Math.min(o,window.innerWidth-l*2),h=Math.min(Math.max(d.right-p,l),window.innerWidth-p-l),y=d.bottom+u+s>window.innerHeight-l?Math.max(d.top-s-u,l):d.bottom+u;i({top:y,left:h,width:p})}return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0)}},[t]),c.jsxs("div",{ref:n,className:"relative shrink-0",children:[c.jsx("button",{type:"button","aria-label":`About ${e.title}`,onClick:()=>r(o=>!o),className:`flex h-7 w-7 items-center justify-center rounded-full border text-xs font-semibold transition ${t?"border-brand-500/50 bg-brand-500/10 text-brand-700 dark:text-brand-200":"border-slate-200 bg-white text-slate-500 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#8a8a93] dark:hover:text-white"}`,children:"i"}),t?c.jsxs("div",{style:{position:"fixed",top:a.top,left:a.left,width:a.width},className:"z-[120] rounded-[24px] border border-slate-200 bg-white/95 p-4 shadow-2xl backdrop-blur dark:border-[#1d1d23] dark:bg-[#09090d]/95",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e.title}),c.jsxs("div",{className:"mt-3 space-y-3 text-xs leading-6 text-slate-600 dark:text-[#b3b3bd]",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Why it matters"}),c.jsx("p",{className:"mt-1",children:e.purpose})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"How it is calculated"}),c.jsx("p",{className:"mt-1",children:e.calculation})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:"Data source"}),c.jsx("p",{className:"mt-1",children:e.source})]})]})]}):null]})}function gce({label:e,value:t,subtitle:r}){return c.jsx(ke,{className:"h-full overflow-hidden",children:c.jsxs(Ae,{className:"flex h-full min-h-[150px] flex-col justify-between",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Endpoint hits"}),c.jsx("p",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:e})]}),c.jsxs("div",{className:"flex items-end justify-between gap-4",children:[c.jsx("p",{className:"text-5xl font-semibold tracking-tight text-slate-950 dark:text-white",children:Pw(t,0)}),c.jsx(_e,{variant:"blue",children:r})]})]})})}function xce(e){return e==="/decide_gateway"?"Decide Gateway":e==="/update_gateway"?"Update Gateway":e==="/rule_evaluate"?"Rule Evaluate":e}function bce(){var Ce,Fe,te,ie,he,X,Ee,ve,Pe,ze,ge,$e,Le,Oe,Ge;const{merchantId:e}=aa(),[t,r]=j.useState("1h"),[n,a]=j.useState(fA),[i,o]=j.useState(!1),[s,l]=j.useState(()=>ef(Date.now()-2*60*60*1e3)),[u,f]=j.useState(()=>ef(Date.now())),d=!!e,p=j.useMemo(()=>{if(t!=="custom")return;const H=mA(s),E=mA(u);if(!(H===null||E===null||E<=H))return{start_ms:H,end_ms:E}},[u,s,t]),h=d&&e&&(t!=="custom"||p)?iv("/analytics/overview",t,e,p):null,g=d&&e&&(t!=="custom"||p)?iv("/analytics/routing-stats",t,e,p):null,y=d&&e&&(t!=="custom"||p)?iv("/analytics/routing-stats",t,e,p,n):null,v={refreshInterval:1e4,revalidateOnFocus:!0,revalidateIfStale:!1},x={refreshInterval:12e3,revalidateOnFocus:!0,revalidateIfStale:!1},m={...x,keepPreviousData:!0},w=ar(h,wi,v),S=ar(g,wi,x),b=ar(y,wi,m),_=!w.data&&w.isLoading||!S.data&&S.isLoading||!b.data&&b.isLoading,O=((Ce=w.error)==null?void 0:Ce.message)||((Fe=S.error)==null?void 0:Fe.message)||((te=b.error)==null?void 0:te.message)||null,k={dimensions:((he=(ie=S.data)==null?void 0:ie.available_filters)==null?void 0:he.dimensions)||((Ee=(X=b.data)==null?void 0:X.available_filters)==null?void 0:Ee.dimensions)||[],missing_dimensions:((Pe=(ve=S.data)==null?void 0:ve.available_filters)==null?void 0:Pe.missing_dimensions)||((ge=(ze=b.data)==null?void 0:ze.available_filters)==null?void 0:ge.missing_dimensions)||[],gateways:((Le=($e=S.data)==null?void 0:$e.available_filters)==null?void 0:Le.gateways)||((Ge=(Oe=b.data)==null?void 0:Oe.available_filters)==null?void 0:Ge.gateways)||[]},A=j.useMemo(()=>new Map(k.dimensions.map(H=>[H.key,H])),[k.dimensions]);j.useEffect(()=>{a(H=>{const E=Object.fromEntries(Object.entries(H.dimensions).filter(([N,B])=>{if(!B)return!1;const G=A.get(N);return G?G.values.includes(B):!1})),M=H.gateways.filter(N=>k.gateways.includes(N));return Object.keys(E).length===Object.keys(H.dimensions).length&&Object.entries(E).every(([N,B])=>H.dimensions[N]===B)&&M.length===H.gateways.length&&M.every((N,B)=>N===H.gateways[B])?H:{dimensions:E,gateways:M}})},[A,k.gateways]),j.useEffect(()=>{k.dimensions.length<=au&&i&&o(!1)},[k.dimensions.length,i]);const $=j.useMemo(()=>{var H;return t!=="custom"?((H=sA.find(E=>E.value===t))==null?void 0:H.label)||"Selected window":p?`${Jd(p.start_ms)} to ${Jd(p.end_ms)}`:"Custom window"},[p,t]),T=j.useMemo(()=>{var E,M;const H=[{route:"/decide_gateway",count:0},{route:"/update_gateway",count:0},{route:"/rule_evaluate",count:0}];return(M=(E=w.data)==null?void 0:E.route_hits)!=null&&M.length?H.map(N=>{var B,G;return{...N,count:((G=(B=w.data)==null?void 0:B.route_hits.find(ee=>ee.route===N.route))==null?void 0:G.count)||0}}):H},[w.data]),P=j.useMemo(()=>{var M,N;const H=Array.from(new Set((((M=S.data)==null?void 0:M.gateway_share)||[]).map(B=>B.gateway))).slice(0,6),E=new Map;for(const B of((N=S.data)==null?void 0:N.gateway_share)||[]){if(!H.includes(B.gateway))continue;const G=E.get(B.bucket_ms)||{bucket_ms:B.bucket_ms};G[B.gateway]=B.count,E.set(B.bucket_ms,G)}return{gateways:H,rows:Array.from(E.values()).sort((B,G)=>B.bucket_ms-G.bucket_ms)}},[S.data]),R=j.useMemo(()=>{var M,N;const H=Array.from(new Set((((M=b.data)==null?void 0:M.sr_trend)||[]).map(B=>B.gateway))).slice(0,6),E=new Map;for(const B of((N=b.data)==null?void 0:N.sr_trend)||[]){if(!H.includes(B.gateway))continue;const G=E.get(B.bucket_ms)||{bucket_ms:B.bucket_ms};G[B.gateway]=F$(B.score_value),E.set(B.bucket_ms,G)}return{gateways:H,rows:Array.from(E.values()).sort((B,G)=>B.bucket_ms-G.bucket_ms)}},[b.data]),L=j.useMemo(()=>{if(!R.rows.length)return[];const H=R.rows[R.rows.length-1];return R.gateways.map(E=>({gateway:E,value:typeof H[E]=="number"?H[E]:null})).filter(E=>E.value!==null)},[R]),z=j.useMemo(()=>{const H=R.rows.flatMap(B=>R.gateways.map(G=>B[G]).filter(G=>typeof G=="number"));if(!H.length)return[0,100];const E=Math.min(...H),M=Math.max(...H),N=E===M?5:Math.max(2,(M-E)*.35);return[Math.max(0,Math.floor(E-N)),Math.min(100,Math.ceil(M+N))]},[R]),W=j.useMemo(()=>{const H=k.dimensions.flatMap(E=>{const M=n.dimensions[E.key];return M?[`${E.label}: ${M}`]:[]});return n.gateways.length&&H.push(n.gateways.join(", ")),H.length?H.join(" / "):"All routing dimensions"},[k.dimensions,n]),V=j.useMemo(()=>i||k.dimensions.length<=au?k.dimensions:k.dimensions.slice(0,au),[k.dimensions,i]),D=k.dimensions.length>au,U=D?k.dimensions.length-au:0,q=j.useMemo(()=>{const H=k.dimensions.flatMap(M=>{const N=n.dimensions[M.key];return N?[{key:`dimension:${M.key}`,label:`${M.label}: ${N}`}]:[]}),E=n.gateways.map(M=>({key:`gateway:${M}`,label:`Connector: ${M}`}));return[...H,...E]},[k.dimensions,n]);function J(H){if(r(H),H!=="custom"){const E=vce(H);l(ef(E.start_ms)),f(ef(E.end_ms))}}function K(){w.mutate(),S.mutate(),b.mutate()}function ae(H){a(E=>{const M=E.gateways.includes(H);return{...E,gateways:M?E.gateways.filter(N=>N!==H):[...E.gateways,H]}})}function Q(){a(fA)}function be(H){if(H.startsWith("dimension:")){ue(H.replace("dimension:",""),"");return}H.startsWith("gateway:")&&ae(H.replace("gateway:",""))}function ue(H,E){a(M=>{const N={...M.dimensions};return E?N[H]=E:delete N[H],{...M,dimensions:N}})}return d?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Analytics"}),c.jsx(_e,{variant:"green",children:e||"Current merchant"})]}),c.jsx("p",{className:"text-sm text-slate-500 dark:text-[#8a8a93]",children:"One working surface for route volume, connector share, and historical connector success rate."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(Ie,{size:"sm",variant:"ghost",onClick:K,children:"Refresh"})})]}),c.jsx(ke,{className:"overflow-visible",children:c.jsxs(Ae,{className:"flex flex-wrap items-end gap-4",children:[c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Time window"}),c.jsx("select",{value:t,onChange:H=>J(H.target.value),className:rf(),children:sA.map(H=>c.jsx("option",{value:H.value,children:H.label},H.value))})]}),t==="custom"?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Start time"}),c.jsx("input",{type:"datetime-local",value:s,onChange:H=>l(H.target.value),className:rf()})]}),c.jsxs("label",{className:"min-w-[220px] flex-1 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"End time"}),c.jsx("input",{type:"datetime-local",value:u,onChange:H=>f(H.target.value),className:rf()})]})]}):null,c.jsxs("div",{className:"min-w-[220px] flex-1 rounded-[24px] border border-slate-200 bg-slate-50/80 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#0c0c0e]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Active window"}),c.jsx("p",{className:"mt-1 text-sm font-medium text-slate-900 dark:text-white",children:$}),t==="custom"&&!p?c.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Choose an end time after the start time."}):null]})]})}),c.jsx(Gr,{error:O}),_?c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading analytics…"]}):null,c.jsxs("section",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"API calls"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Counts for the three routing surfaces most operators watch first."})]}),c.jsx(ov,{content:av.hits})]}),c.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:T.map(H=>c.jsx(gce,{label:xce(H.route),value:H.count,subtitle:t==="custom"?"Custom window":$},H.route))})]}),c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Gateway share over time"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"How decision volume moved across connectors inside the selected merchant window."})]}),c.jsx(ov,{content:av.share})]})}),c.jsx(Ae,{children:P.rows.length?c.jsx("div",{className:"h-80",children:c.jsx(ks,{width:"100%",height:"100%",children:c.jsxs(ace,{data:P.rows,children:[c.jsx(K0,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),c.jsx(Ma,{dataKey:"bucket_ms",tickFormatter:hA,tick:{fontSize:11}}),c.jsx(Da,{tick:{fontSize:11}}),c.jsx(_r,{labelFormatter:H=>Jd(Number(H)),contentStyle:lA,labelStyle:uA,itemStyle:cA,wrapperStyle:dA}),c.jsx(Oa,{}),P.gateways.map((H,E)=>c.jsx(Fi,{type:"monotone",dataKey:H,stackId:"1",stroke:Ya[E%Ya.length],fill:Ya[E%Ya.length],fillOpacity:.24,name:H},H))]})})}):c.jsx(tf,{title:"No gateway share history yet",body:"Send real decide-gateway traffic in the selected window to populate connector share."})})]}),c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Connector success rate over time"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Historical connector score trend for the selected merchant window."}),c.jsxs("p",{className:"mt-2 text-xs font-medium text-slate-600 dark:text-[#b3b3bd]",children:["Active filters: ",W]})]}),c.jsx(ov,{content:av.sr})]})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-[24px] border border-slate-200 bg-slate-50/80 p-4 dark:border-[#1d1d23] dark:bg-[#0c0c0e]",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Connector filters"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Narrow the success-rate line chart by the routing dimensions present for this merchant."})]}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:Q,disabled:!Object.values(n.dimensions).some(Boolean)&&!n.gateways.length,children:"Clear filters"})]}),k.dimensions.length?c.jsxs("div",{className:"mt-4 space-y-3",children:[c.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:V.map(H=>c.jsxs("label",{className:"space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:H.label}),c.jsxs("select",{value:n.dimensions[H.key]||"",onChange:E=>ue(H.key,E.target.value),className:rf(),disabled:!H.values.length,children:[c.jsxs("option",{value:"",children:["All ",H.label.toLowerCase()]}),H.values.map(E=>c.jsx("option",{value:E,children:E},E))]})]},H.key))}),D?c.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:i?"Showing all routing dimensions available for this merchant.":`${U} more routing dimension${U===1?"":"s"} available for this merchant.`}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>o(H=>!H),children:i?"Show fewer filters":"More filters"})]}):null]}):k.missing_dimensions.length?c.jsx(tf,{title:"No populated routing dimensions in this window",body:"The merchant has score history, but none of the dynamic routing dimensions have values recorded in the selected time window yet."}):null,k.missing_dimensions.length?c.jsxs("div",{className:"mt-4 rounded-2xl border border-dashed border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"No values in this window yet"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:k.missing_dimensions.map(H=>H.label).join(", ")})]}):null,q.length?c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Active filters"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:q.map(H=>c.jsxs("button",{type:"button",onClick:()=>be(H.key),className:"inline-flex items-center gap-2 rounded-full border border-brand-500/30 bg-brand-500/10 px-3 py-1.5 text-xs font-semibold text-brand-700 transition hover:bg-brand-500/15 dark:text-brand-200",children:[c.jsx("span",{children:H.label}),c.jsx("span",{"aria-hidden":"true",children:"×"})]},H.key))})]}):null,c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-[#8a8a93]",children:"Connectors"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:k.gateways.length?k.gateways.map(H=>{const E=n.gateways.includes(H);return c.jsx("button",{type:"button",onClick:()=>ae(H),className:`rounded-full border px-3 py-1.5 text-xs font-semibold transition ${E?"border-brand-500/50 bg-brand-500/10 text-brand-700 dark:text-brand-200":"border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:text-slate-900 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#a1a1aa] dark:hover:text-white"}`,children:H},H)}):c.jsx("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:"No connector history yet for the selected window."})})]})]}),L.length?c.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(H=>c.jsxs(_e,{variant:"blue",children:[H.gateway,": ",pA(H.value)]},H.gateway))}):null,R.rows.length?c.jsx("div",{className:"h-80",children:c.jsx(ks,{width:"100%",height:"100%",children:c.jsxs(nce,{data:R.rows,children:[c.jsx(K0,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),c.jsx(Ma,{dataKey:"bucket_ms",tickFormatter:hA,tick:{fontSize:11}}),c.jsx(Da,{domain:z,tick:{fontSize:11},tickFormatter:H=>`${Pw(Number(H),0)}%`}),c.jsx(_r,{labelFormatter:H=>Jd(Number(H)),formatter:(H,E)=>[pA(H),String(E)],contentStyle:lA,labelStyle:uA,itemStyle:cA,wrapperStyle:dA}),c.jsx(Oa,{}),R.gateways.map((H,E)=>c.jsx(hd,{type:"monotone",dataKey:H,stroke:Ya[E%Ya.length],strokeWidth:3,dot:{r:3,strokeWidth:1,fill:Ya[E%Ya.length]},activeDot:{r:5},name:H},H))]})})}):c.jsx(tf,{title:"No connector score history yet",body:"Send decide-gateway and update-gateway-score traffic in the selected window to populate connector history."})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Analytics"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Set a merchant in the top bar to load merchant-scoped analytics."})]}),c.jsx(tf,{title:"Select a merchant first",body:"The analytics surface is merchant-scoped. Use the merchant selector in the top bar to load data."})]})}const wce=["15m","1h","24h"],_ce=[{value:"",label:"Any status"},{value:"success",label:"Success"},{value:"failure",label:"Failure"}],Sce=[{value:"",label:"Any route"},{value:"decide_gateway",label:"Decide Gateway"},{value:"update_gateway_score",label:"Update Gateway"},{value:"routing_evaluate",label:"Rule Evaluate"}],jce=["summary","input","response","raw"],sv={paymentId:"",requestId:"",gateway:"",route:"",status:"",eventType:"",errorCode:""};function Uu(e){const t=e.paymentId.trim(),r=t?"":e.requestId.trim();return{paymentId:t,requestId:r,gateway:e.gateway.trim(),route:e.route,status:e.status,eventType:e.eventType,errorCode:e.errorCode.trim()}}function z$(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&n!==""&&t.set(r,String(n))}),t.toString()}function yA(e,t,r,n,a){const i=Uu(a),o={scope:"current",range:e,page:r,page_size:n,merchant_id:t,payment_id:i.paymentId||void 0,request_id:i.requestId||void 0,gateway:i.gateway||void 0,route:i.route||void 0,status:i.status||void 0,event_type:i.eventType||void 0,error_code:i.errorCode||void 0},s=z$(o);return s?`/analytics/payment-audit?${s}`:"/analytics/payment-audit"}function Oce(e){return e==="15m"||e==="24h"?e:"24h"}function kce(e){return Uu({paymentId:e.get("payment_id")||"",requestId:e.get("request_id")||"",gateway:e.get("gateway")||"",route:e.get("route")||"",status:e.get("status")||"",eventType:e.get("event_type")||"",errorCode:e.get("error_code")||""})}function wf(e){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function Ace(e){const t=Math.max(0,Math.round((Date.now()-e)/6e4));if(t<1)return"just now";if(t<60)return`${t}m ago`;const r=Math.round(t/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Ps(e){return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase()):""}function B$(e){return e?e==="decision_gateway"||e==="decide_gateway"?"Decide Gateway":e==="update_gateway_score"?"Update Gateway":e==="routing_evaluate"?"Rule Evaluate":Ps(e):"Unknown route"}function Ece(e){return e?e==="decision"?"Decide Gateway":e==="gateway_update"?"Update Gateway":e==="rule_hit"?"Rule Evaluate":e==="error"?"Errors":Ps(e):"Unknown event"}function lx(e){return e.event_stage==="gateway_decided"?"Decide Gateway":e.event_stage==="score_updated"?"Update Gateway":e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="error"?"Errors":Ps(e.event_stage||e.event_type)}function _f(e){return e.event_type==="decision"||e.event_stage==="gateway_decided"?"Decide Gateway":e.event_type==="rule_hit"||e.event_stage==="rule_applied"?"Rule Evaluate":e.event_type==="gateway_update"||e.event_stage==="score_updated"?"Update Gateway":"Errors"}function iu(e){const t=(e.status||"").toUpperCase();return e.event_type==="error"||t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":e.event_type==="rule_hit"?"purple":t==="CHARGED"||t==="AUTHORIZED"||t==="SUCCESS"||e.event_type==="gateway_update"?"green":e.event_type==="decision"?"blue":"orange"}function lv(e){const t=(e||"").toUpperCase();return t==="FAILURE"||t.includes("FAILED")||t.includes("DECLINED")?"red":t==="SUCCESS"||t==="CHARGED"||t==="AUTHORIZED"?"green":t==="HIT"?"purple":"gray"}function vA(e){return e==="Decide Gateway"?"blue":e==="Rule Evaluate"?"purple":e==="Update Gateway"?"green":e==="Errors"?"red":"orange"}function ou(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function uv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}function Pce(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function Nce(e){return e?"bg-brand-600 text-white":"bg-white text-slate-600 border border-slate-200 hover:bg-slate-50 dark:bg-[#121214] dark:text-[#a1a1aa] dark:border-[#27272a]"}function Ko(){return"h-10 rounded-2xl border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm outline-none transition focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 dark:border-[#27272a] dark:bg-[#121214] dark:text-[#e5e7eb]"}function nf({label:e,value:t,helper:r}){return c.jsx(ke,{children:c.jsxs(Ae,{children:[c.jsx("p",{className:"text-xs uppercase tracking-[0.16em] text-slate-500",children:e}),c.jsx("p",{className:"mt-2 text-3xl font-semibold text-slate-900 dark:text-white",children:t}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:r})]})})}function bu({title:e,body:t}){return c.jsxs("div",{className:"rounded-2xl border border-dashed border-slate-200 dark:border-[#222227] bg-white/60 dark:bg-[#0b0b0d] px-6 py-12 text-center",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e}),c.jsx("p",{className:"mt-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:t})]})}function Cce({rows:e}){return e.length?c.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(t=>c.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white/70 px-4 py-3 dark:border-[#1d1d23] dark:bg-[#09090b]",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-[#8a8a93]",children:t.label}),c.jsx("p",{className:"mt-2 text-sm text-slate-900 dark:text-white break-words",children:t.value})]},`${t.label}-${t.value}`))}):null}function Xo({title:e,value:t,emptyMessage:r}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{children:c.jsx("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:e})}),t?c.jsx("pre",{className:"overflow-x-auto rounded-2xl bg-slate-950/90 px-4 py-4 text-xs leading-6 text-slate-200",children:Pce(t)}):c.jsx(bu,{title:`No ${e.toLowerCase()} captured`,body:r})]})}function Tce(e){if(!e)return null;const t=ou(e.details_json)?e.details_json:{},r=t.response??t.response_payload??t.result??t.output??null,n=t.request??t.request_payload??t.input??t.payload??uv({payment_id:e.payment_id,request_id:e.request_id,payment_method_type:e.payment_method_type,payment_method:e.payment_method,gateway:e.gateway}),a=r??uv({event_type:e.event_type,status:e.status,error_code:e.error_code,error_message:e.error_message,score_value:e.score_value,sigma_factor:e.sigma_factor,average_latency:e.average_latency,tp99_latency:e.tp99_latency,transaction_count:e.transaction_count,rule_name:e.rule_name,routing_approach:e.routing_approach}),i=ou(r)?r:null,o=ou(i==null?void 0:i.decided_gateway)?i.decided_gateway:null,s=t.score_context??(o?o.gateway_priority_map:null)??(i?i.gateway_priority_map:null)??null,l=t.selection_reason??null,u=[{label:"Phase",value:_f(e)},{label:"Stage",value:lx(e)},{label:"Route",value:B$(e.route)},{label:"Timestamp",value:wf(e.created_at_ms)},{label:"Merchant",value:e.merchant_id||"unknown merchant"},...e.payment_id?[{label:"Payment ID",value:e.payment_id}]:[],...e.request_id?[{label:"Request ID",value:e.request_id}]:[],...e.gateway?[{label:"Gateway",value:e.gateway}]:[],...e.status?[{label:"Status",value:e.status}]:[]],f=uv(Object.fromEntries(Object.entries(t).filter(([d])=>!["request","request_payload","input","payload","response","response_payload","result","output","score_context","selection_reason"].includes(d))));return{summaryRows:u,requestPayload:ou(n)&&!Object.keys(n).length?null:n,responsePayload:ou(a)&&!Object.keys(a).length?null:a,scoreContext:s,selectionReason:l,signalRecord:Object.keys(f).length?f:null,rawEvent:{...e,details_json:e.details_json}}}function $ce(){var ie,he,X,Ee,ve,Pe,ze,ge,$e,Le,Oe,Ge,H,E,M;const{merchantId:e}=aa(),[t,r]=kD(),n=Oce(t.get("range")),a=kce(t),i=Math.max(1,Number(t.get("page")||"1")),o=t.get("selected")||"",[s,l]=j.useState(n),[u,f]=j.useState(a),[d,p]=j.useState(a),[h,g]=j.useState(i),[y,v]=j.useState(o),[x,m]=j.useState(null),[w,S]=j.useState("summary"),b=12,_=!!e,O=_&&e?yA(s,e,h,b,d):null,k=ar(O,wi,{refreshInterval:12e3,revalidateOnFocus:!0}),A=j.useMemo(()=>{var B;const N=((B=k.data)==null?void 0:B.results)||[];return N.find(G=>G.lookup_key===y)||N[0]||null},[(ie=k.data)==null?void 0:ie.results,y]);j.useEffect(()=>{var B,G;if(A!=null&&A.lookup_key){v(A.lookup_key);return}const N=(G=(B=k.data)==null?void 0:B.results)==null?void 0:G[0];N!=null&&N.lookup_key&&v(N.lookup_key)},[(he=k.data)==null?void 0:he.results,A==null?void 0:A.lookup_key]);const $=j.useMemo(()=>{if(!A)return null;const N=A.payment_id||"";return{paymentId:N,requestId:N?"":A.request_id||"",gateway:"",route:"",status:"",eventType:"",errorCode:""}},[A]),T=_&&e&&$?yA(s,e,1,50,$):null,P=ar(T,wi,{refreshInterval:12e3,revalidateOnFocus:!0}),R=j.useMemo(()=>{var B;const N=((B=P.data)==null?void 0:B.timeline)||[];return N.find(G=>G.id===x)||N[0]||null},[(X=P.data)==null?void 0:X.timeline,x]);j.useEffect(()=>{var B,G;if(R!=null&&R.id){m(R.id);return}const N=(G=(B=P.data)==null?void 0:B.timeline)==null?void 0:G[0];N!=null&&N.id&&m(N.id)},[(Ee=P.data)==null?void 0:Ee.timeline,R==null?void 0:R.id]);const L=j.useMemo(()=>{var B;const N=[];for(const G of((B=P.data)==null?void 0:B.timeline)||[]){const ee=_f(G),Z=N[N.length-1];!Z||Z.phase!==ee?N.push({phase:ee,events:[G]}):Z.events.push(G)}return N},[(ve=P.data)==null?void 0:ve.timeline]),z=j.useMemo(()=>Tce(R),[R]),W=((Pe=k.error)==null?void 0:Pe.message)||((ze=P.error)==null?void 0:ze.message)||null,V=k.isLoading||P.isLoading,D=(($e=(ge=P.data)==null?void 0:ge.timeline)==null?void 0:$e.length)||0,U=((Le=A==null?void 0:A.gateways)==null?void 0:Le.length)||0,q=A?Ace(A.last_seen_ms):"No activity";function J(N,B,G,ee){const Z=Uu(G),me=z$({range:N,page:B>1?B:void 0,payment_id:Z.paymentId||void 0,request_id:Z.requestId||void 0,gateway:Z.gateway||void 0,route:Z.route||void 0,status:Z.status||void 0,event_type:Z.eventType||void 0,error_code:Z.errorCode||void 0,selected:ee||void 0});r(me)}function K(N,B){f(G=>Uu({...G,[N]:B}))}function ae(){const B=Uu(u);g(1),f(B),p(B),J(s,1,B)}function Q(){g(1),f(sv),p(sv),J(s,1,sv)}function be(){k.mutate(),P.mutate()}function ue(N){l(N),g(1),J(N,1,d,y)}function Ce(N){v(N),J(s,h,d,N)}async function Fe(N){if(N)try{await navigator.clipboard.writeText(N)}catch{}}function te(){if(!R)return;const N=R.payment_id||"",B={paymentId:N,requestId:N?"":R.request_id||"",gateway:R.gateway||"",route:"",status:"",eventType:"",errorCode:""};f(B),p(B),g(1),J(s,1,B,y)}return _?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Decision Audit"}),c.jsx("p",{className:"mt-1 max-w-3xl text-sm text-slate-500 dark:text-[#8a8a93]",children:"Search by payment or request, then inspect the full sequence of gateway decisions, gateway updates, rule evaluations, and errors with the exact payload captured at each step."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(Ie,{size:"sm",variant:"ghost",onClick:be,children:"Refresh"})})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[wce.map(N=>c.jsx(Ie,{size:"sm",variant:s===N?"primary":"secondary",onClick:()=>ue(N),children:N},N)),c.jsx(_e,{variant:"green",children:e||"Current merchant"})]}),c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Search Decision Trail"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:"Use payment or request IDs when you have them. Error code, gateway, route, and status narrow operational noise quickly."})]})}),c.jsxs(Ae,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[c.jsx("input",{className:Ko(),value:u.paymentId,onChange:N=>K("paymentId",N.target.value),placeholder:"Payment ID"}),c.jsx("input",{className:Ko(),value:u.requestId,onChange:N=>K("requestId",N.target.value),placeholder:"Request ID"}),c.jsx("input",{className:Ko(),value:u.gateway,onChange:N=>K("gateway",N.target.value),placeholder:"Gateway"}),c.jsx("select",{className:Ko(),value:u.route,onChange:N=>K("route",N.target.value),children:Sce.map(N=>c.jsx("option",{value:N.value,children:N.label},N.value||"all"))}),c.jsx("input",{className:Ko(),value:u.errorCode,onChange:N=>K("errorCode",N.target.value),placeholder:"Error code"}),c.jsx("select",{className:Ko(),value:u.status,onChange:N=>K("status",N.target.value),children:_ce.map(N=>c.jsx("option",{value:N.value,children:N.label},N.value||"all"))})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Ie,{size:"sm",onClick:ae,children:"Search"}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:Q,children:"Clear"})]})]})]}),c.jsx(Gr,{error:W}),V&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-[#8a8a93]",children:[c.jsx(mr,{size:16}),"Loading decision audit data…"]}),c.jsxs("section",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsx(nf,{label:"Matching payments",value:String(((Oe=k.data)==null?void 0:Oe.total_results)||0),helper:"Results within the selected time window"}),c.jsx(nf,{label:"Timeline events",value:String(D),helper:"Captured for the selected payment"}),c.jsx(nf,{label:"Active gateways",value:String(U),helper:"Distinct gateways seen on the selected payment"}),c.jsx(nf,{label:"Latest activity",value:q,helper:"Most recent event on the selected payment"})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[360px_minmax(0,1fr)]",children:[c.jsxs(ke,{children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Matching Payments"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ie,{size:"sm",variant:"secondary",disabled:h<=1,onClick:()=>{const N=Math.max(1,h-1);g(N),J(s,N,d,y)},children:"Prev"}),c.jsx(Ie,{size:"sm",variant:"secondary",disabled:(((H=(Ge=k.data)==null?void 0:Ge.results)==null?void 0:H.length)||0){const N=h+1;g(N),J(s,N,d,y)},children:"Next"})]})]})}),c.jsx(Ae,{className:"space-y-3",children:(M=(E=k.data)==null?void 0:E.results)!=null&&M.length?k.data.results.map(N=>c.jsxs("button",{type:"button",onClick:()=>Ce(N.lookup_key),className:`w-full rounded-2xl border p-4 text-left transition-all ${(A==null?void 0:A.lookup_key)===N.lookup_key?"border-brand-500/50 bg-brand-500/5":"border-slate-200 hover:border-slate-300 dark:border-[#1d1d23] dark:hover:border-[#2a2a33]"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:N.payment_id||N.request_id||N.lookup_key}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:[N.merchant_id||"unknown merchant"," · ",wf(N.last_seen_ms)]})]}),c.jsx(_e,{variant:lv(N.latest_status),children:Ps(N.latest_status)||"Unknown"})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[N.latest_stage?c.jsx(_e,{variant:"blue",children:N.latest_stage}):null,N.latest_gateway?c.jsx(_e,{variant:"green",children:N.latest_gateway}):null,c.jsxs(_e,{variant:"gray",children:[N.event_count," events"]})]}),N.request_id?c.jsxs("p",{className:"mt-3 truncate text-[11px] text-slate-500 dark:text-[#8a8a93]",children:["request ",N.request_id]}):null]},N.lookup_key)):c.jsx(bu,{title:"No matching payments found",body:"Try widening the time range or searching by a single payment ID, request ID, or error code."})})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_380px]",children:[c.jsxs(ke,{className:"overflow-visible",children:[c.jsx(Xe,{children:c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Selected Payment Timeline"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:(A==null?void 0:A.payment_id)||(A==null?void 0:A.request_id)||"Choose a payment from the result list to inspect the timeline."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[A!=null&&A.latest_gateway?c.jsx(_e,{variant:"green",children:A.latest_gateway}):null,A!=null&&A.latest_stage?c.jsx(_e,{variant:"blue",children:A.latest_stage}):null,A!=null&&A.latest_status?c.jsx(_e,{variant:lv(A.latest_status),children:Ps(A.latest_status)}):null]})]})}),c.jsx(Ae,{children:L.length?c.jsx("div",{className:"space-y-6",children:L.map(N=>c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(_e,{variant:vA(N.phase),children:N.phase}),c.jsxs("p",{className:"text-xs text-slate-500 dark:text-[#8a8a93]",children:[N.events.length," event",N.events.length===1?"":"s"]})]}),c.jsx("div",{className:"relative space-y-3 pl-6 before:absolute before:left-2 before:top-2 before:bottom-2 before:w-px before:bg-slate-200 dark:before:bg-[#23232a]",children:N.events.map(B=>{const G=(R==null?void 0:R.id)===B.id;return c.jsxs("button",{type:"button",onClick:()=>{m(B.id),S("summary")},className:`relative w-full rounded-[24px] border p-5 text-left shadow-sm transition ${G?"border-brand-500/50 bg-brand-500/5":"border-slate-200 bg-white/70 hover:border-slate-300 dark:border-[#1d1d23] dark:bg-[#09090b] dark:hover:border-[#2a2a33]"}`,children:[c.jsx("span",{className:`absolute -left-[25px] top-6 h-3 w-3 rounded-full ${iu(B)==="red"?"bg-red-400":iu(B)==="green"?"bg-emerald-400":iu(B)==="purple"?"bg-purple-400":iu(B)==="orange"?"bg-orange-400":"bg-blue-400"}`}),c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:lx(B)}),c.jsxs("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:[B$(B.route)," · ",wf(B.created_at_ms)]})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(_e,{variant:iu(B),children:Ece(B.event_type)}),B.status?c.jsx(_e,{variant:lv(B.status),children:Ps(B.status)}):null,B.gateway?c.jsx(_e,{variant:"green",children:B.gateway}):null]})]}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-slate-500 dark:text-[#8a8a93]",children:[B.request_id?c.jsxs("span",{children:["request ",B.request_id]}):null,B.routing_approach?c.jsxs("span",{children:["approach ",B.routing_approach]}):null,B.rule_name?c.jsxs("span",{children:["rule ",B.rule_name]}):null,B.payment_method_type?c.jsxs("span",{children:["PMT ",B.payment_method_type]}):null,B.payment_method?c.jsxs("span",{children:["method ",B.payment_method]}):null,B.error_code?c.jsxs("span",{children:["error ",B.error_code]}):null]}),B.error_message?c.jsx("p",{className:"mt-4 rounded-2xl border border-red-500/20 bg-red-500/5 px-4 py-3 text-sm text-red-300",children:B.error_message}):null]},B.id)})})]},N.phase))}):c.jsx(bu,{title:"No timeline selected yet",body:"Pick a payment from the left column to see the full transaction trail."})})]}),c.jsxs(ke,{className:"overflow-visible xl:sticky xl:top-6 xl:self-start",children:[c.jsx(Xe,{children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Event Inspector"}),c.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-[#8a8a93]",children:R?`${lx(R)} · ${wf(R.created_at_ms)}`:"Select a timeline event to inspect the captured payload."})]}),R?c.jsx(_e,{variant:vA(_f(R)),children:_f(R)}):null]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:jce.map(N=>c.jsx(Ie,{size:"sm",variant:"secondary",className:Nce(w===N),onClick:()=>S(N),children:N==="summary"?"Summary":N==="input"?"Input":N==="response"?"Response":"Raw JSON"},N))})]})}),c.jsx(Ae,{className:"space-y-4",children:R&&z?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Ie,{size:"sm",variant:"secondary",onClick:()=>S("raw"),children:"View payload"}),c.jsx(Ie,{size:"sm",variant:"secondary",disabled:!R.request_id,onClick:()=>Fe(R.request_id),children:"Copy request ID"}),c.jsx(Ie,{size:"sm",variant:"secondary",disabled:!R.payment_id,onClick:()=>Fe(R.payment_id),children:"Copy payment ID"}),c.jsx(Ie,{size:"sm",variant:"secondary",onClick:te,children:"Open related events"})]}),w==="summary"?c.jsxs("div",{className:"space-y-4",children:[c.jsx(Cce,{rows:z.summaryRows}),c.jsx(Xo,{title:"Connector score context",value:z.scoreContext,emptyMessage:"No connector score map was captured for this event."}),c.jsx(Xo,{title:"Selection reason",value:z.selectionReason,emptyMessage:"No explicit selection reason was captured for this event."}),c.jsx(Xo,{title:"Score / rule details",value:z.signalRecord,emptyMessage:"This event did not capture additional scoring or rule metadata."})]}):null,w==="input"?c.jsx(Xo,{title:"Input",value:z.requestPayload,emptyMessage:"No dedicated request payload was captured for this event."}):null,w==="response"?c.jsx(Xo,{title:"Response",value:z.responsePayload,emptyMessage:"No dedicated response payload was captured for this event."}):null,w==="raw"?c.jsx(Xo,{title:"Raw JSON",value:z.rawEvent,emptyMessage:"No raw payload is available for this event."}):null]}):c.jsx(bu,{title:"No event selected",body:"Pick a timeline step to see the request, response, transaction context, and raw payload."})})]})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-slate-900 dark:text-white",children:"Decision Audit"}),c.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-[#8a8a93]",children:"Search a payment and inspect gateway decisions, gateway updates, rule evaluations, and errors in one transaction trail."})]}),c.jsx(bu,{title:"Select a merchant to start auditing payments",body:"Use the merchant selector in the top bar to load the decision trail for a merchant."})]})}function Ice(){return c.jsx(cD,{children:c.jsxs(ln,{element:c.jsx(NL,{}),children:[c.jsx(ln,{index:!0,element:c.jsx(u3,{})}),c.jsx(ln,{path:"routing",element:c.jsx(c3,{})}),c.jsx(ln,{path:"routing/sr",element:c.jsx(x4,{})}),c.jsx(ln,{path:"routing/rules",element:c.jsx(pF,{})}),c.jsx(ln,{path:"routing/volume",element:c.jsx(ice,{})}),c.jsx(ln,{path:"routing/debit",element:c.jsx(sce,{})}),c.jsx(ln,{path:"decisions",element:c.jsx(mce,{})}),c.jsx(ln,{path:"analytics",element:c.jsx(bce,{})}),c.jsx(ln,{path:"audit",element:c.jsx($ce,{})}),c.jsx(ln,{path:"*",element:c.jsx(sD,{to:".",replace:!0})})]})})}class Rce extends j.Component{constructor(){super(...arguments);zw(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(r){return{error:r,errorInfo:null}}componentDidCatch(r,n){console.log(` +`+"!".repeat(80)),console.log("[ERROR BOUNDARY] Component Error Caught"),console.log(`Timestamp: ${new Date().toISOString()}`),console.log("Error Message:",r.message),console.log("Error Stack:",r.stack),console.log("Component Stack:",n.componentStack),console.log("!".repeat(80)+` +`),this.setState({errorInfo:n})}render(){return this.state.error?c.jsxs("div",{style:{padding:32,fontFamily:"monospace",color:"red"},children:[c.jsx("h2",{children:"Dashboard Error"}),c.jsx("pre",{children:this.state.error.message}),c.jsx("pre",{children:this.state.error.stack}),this.state.errorInfo&&c.jsxs("pre",{style:{marginTop:16,color:"darkred"},children:["Component Stack:",this.state.errorInfo.componentStack]})]}):this.props.children}}console.log(` +`+"=".repeat(80));console.log("[APP STARTUP] Dashboard initializing...");console.log(`Timestamp: ${new Date().toISOString()}`);console.log("Environment: production");console.log("Base URL: /dashboard");console.log("=".repeat(80)+` +`);window.onerror=(e,t,r,n,a)=>{console.log(` +`+"!".repeat(80)),console.log("[WINDOW ERROR]"),console.log("Message:",e),console.log("Source:",t),console.log("Line:",r,"Column:",n),a&&(console.log("Error:",a.message),console.log("Stack:",a.stack)),console.log("!".repeat(80)+` +`)};window.onunhandledrejection=e=>{console.log(` +`+"!".repeat(80)),console.log("[UNHANDLED PROMISE REJECTION]"),console.log("Reason:",e.reason),e.reason instanceof Error&&console.log("Stack:",e.reason.stack),console.log("!".repeat(80)+` +`)};cv.createRoot(document.getElementById("root")).render(c.jsx(C.StrictMode,{children:c.jsx(Rce,{children:c.jsx(xD,{basename:"/dashboard",children:c.jsx(Ice,{})})})})); diff --git a/website/dist/assets/index-XOTDNfmE.css b/website/dist/assets/index-XOTDNfmE.css new file mode 100644 index 00000000..f63fdc7b --- /dev/null +++ b/website/dist/assets/index-XOTDNfmE.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Menlo,Monaco,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html{color-scheme:light}html.dark{color-scheme:dark}html,body{font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark html,.dark body{color:#f1f5f9}html,body{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}html:is(.dark *),body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark p,.dark span,.dark h1,.dark h2,.dark h3,.dark h4,.dark h5,.dark h6{color:#f1f5f9}p,span,h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}p:is(.dark *),span:is(.dark *),h1:is(.dark *),h2:is(.dark *),h3:is(.dark *),h4:is(.dark *),h5:is(.dark *),h6:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark p.text-slate-500:is(.dark *),.dark span.text-slate-500:is(.dark *),.dark div.text-slate-500:is(.dark *){color:#64748b}p.text-slate-500:is(.dark *),span.text-slate-500:is(.dark *),div.text-slate-500:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}p.text-slate-600:is(.dark *),span.text-slate-600:is(.dark *),div.text-slate-600:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .text-slate-900,.dark .text-slate-800{color:#f1f5f9!important}.dark .text-slate-700{color:#e2e8f0!important}.dark .text-slate-600{color:#cbd5e1!important}.dark .text-slate-500{color:#94a3b8!important}.dark .text-slate-400{color:#64748b!important}.dark .text-blue-800,.dark .text-blue-700{color:#93c5fd!important}.dark .text-blue-600{color:#60a5fa!important}.dark .text-brand-500{color:#818cf8!important}.dark .bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .bg-slate-100{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1));-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.dark :where(input:not([type=checkbox]):not([type=radio]):not([type=range])),.dark :where(select),.dark :where(textarea){color:#f1f5f9}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){border-radius:9999px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::-moz-placeholder,:where(select)::-moz-placeholder,:where(textarea)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::placeholder,:where(select)::placeholder,:where(textarea)::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus,:where(select):focus,:where(textarea):focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(99 102 241 / .2)}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *),:where(select):is(.dark *),:where(textarea):is(.dark *){border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::-moz-placeholder,:where(select):is(.dark *)::-moz-placeholder,:where(textarea):is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::placeholder,:where(select):is(.dark *)::placeholder,:where(textarea):is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus:is(.dark *),:where(select):focus:is(.dark *),:where(textarea):focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 51 56 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){box-shadow:0 1px 2px #0000000d!important;font-family:Outfit,sans-serif}.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),.dark select,.dark textarea{box-shadow:none!important}.dark select option{color:#f1f5f9}select option{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}select option:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}input[type=range]{accent-color:#6366f1}input[type=range]:is(.dark *){accent-color:#fff}input[type=radio],input[type=checkbox]{height:1rem;width:1rem;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));accent-color:#6366f1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}input[type=radio]:is(.dark *),input[type=checkbox]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));accent-color:#fff}input[type=radio]{border-radius:50%}input[type=checkbox]{border-radius:4px}input[type=radio]:checked,input[type=checkbox]:checked{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}input[type=radio]:checked:is(.dark *),input[type=checkbox]:checked:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-left-\[25px\]{left:-25px}.bottom-0{bottom:0}.left-64{left:16rem}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.top-6{top:1.5rem}.top-\[76px\]{top:76px}.z-10{z-index:10}.z-20{z-index:20}.z-\[120\]{z-index:120}.z-\[130\]{z-index:130}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-\[76px\]{height:76px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.min-h-0{min-height:0px}.min-h-20{min-height:5rem}.min-h-\[150px\]{min-height:150px}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-32{width:8rem}.w-36{width:9rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[calc\(100\%-12px\)\]{width:calc(100% - 12px)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[220px\]{min-width:220px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.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-\[1fr_100px_32px\]{grid-template-columns:1fr 100px 32px}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#1c1c24\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(28 28 36 / var(--tw-divide-opacity, 1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[14px\]{border-radius:14px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[30px\]{border-radius:30px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1c2d50\]{--tw-border-opacity: 1;border-color:rgb(28 45 80 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-brand-500\/30{border-color:#6366f14d}.border-brand-500\/50{border-color:#6366f180}.border-emerald-500\/20{border-color:#10b98133}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-t-gray-500{--tw-border-opacity: 1;border-top-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.bg-\[\#07070b\]{--tw-bg-opacity: 1;background-color:rgb(7 7 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#f8fafc\]{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-brand-500\/10{background-color:#6366f11a}.bg-brand-500\/5{background-color:#6366f10d}.bg-brand-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-400{--tw-bg-opacity: 1;background-color:rgb(192 132 252 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/5{background-color:#ef44440d}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/70{background-color:#f8fafcb3}.bg-slate-50\/80{background-color:#f8fafccc}.bg-slate-50\/90{background-color:#f8fafce6}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-slate-950\/70{background-color:#020617b3}.bg-slate-950\/90{background-color:#020617e6}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-white\/60{background-color:#fff9}.bg-white\/70{background-color:#ffffffb3}.bg-white\/95{background-color:#fffffff2}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-3{padding-bottom:.75rem}.pl-1{padding-left:.25rem}.pl-6{padding-left:1.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Menlo,Monaco,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-6{line-height:1.5rem}.tracking-\[0\.16em\]{letter-spacing:.16em}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-brand-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.accent-brand-500{accent-color:#6366f1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.ring-emerald-500\/20{--tw-ring-color: rgb(16 185 129 / .2)}.ring-orange-500\/20{--tw-ring-color: rgb(249 115 22 / .2)}.ring-purple-500\/20{--tw-ring-color: rgb(168 85 247 / .2)}.ring-red-500\/20{--tw-ring-color: rgb(239 68 68 / .2)}.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{--tw-backdrop-blur: blur(8px);-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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.glass-panel{position:relative;overflow:hidden;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.glass-panel:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 26 29 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1));--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark .glass-panel-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.glass-panel-hover:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.glass-panel-hover:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #a855f7 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient:is(.dark *){--tw-gradient-from: #9b51e0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(155 81 224 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #4f46e5 var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-gradient-to: #0ea5e9 var(--tw-gradient-to-position)}.aurora-top{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#9b51e0,#4f46e5,#0ea5e9,transparent);opacity:.8;z-index:100}.dark .hover\:text-slate-900:hover{color:#f1f5f9!important}.dark .hover\:text-slate-700:hover{color:#e2e8f0!important}.dark .hover\:text-brand-500:hover{color:#818cf8!important}.dark .hover\:bg-slate-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .hover\:bg-slate-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}.group:hover .group-hover\:text-slate-600p:is(.dark *),.group:hover .group-hover\:text-slate-600 span:is(.dark *),.group:hover .group-hover\:text-slate-600 div:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .group:hover .group-hover\:text-slate-600{color:#cbd5e1!important}.dark .group:hover .group-hover\:text-brand-500{color:#818cf8!important}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:bottom-2:before{content:var(--tw-content);bottom:.5rem}.before\:left-2:before{content:var(--tw-content);left:.5rem}.before\:top-2:before{content:var(--tw-content);top:.5rem}.before\:w-px:before{content:var(--tw-content);width:1px}.before\:bg-slate-200:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.hover\:bg-brand-500\/15:hover{background-color:#6366f126}.hover\:bg-brand-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#28282f\]:focus{--tw-border-opacity: 1;border-color:rgb(40 40 47 / var(--tw-border-opacity, 1))}.focus\:border-brand-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.focus\:border-slate-400:focus{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-brand-500\/20:focus{--tw-ring-color: rgb(99 102 241 / .2)}.focus\:ring-brand-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-offset-1:focus{--tw-ring-offset-width: 1px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.dark\:divide-\[\#222226\]:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(34 34 38 / var(--tw-divide-opacity, 1))}.dark\:border-\[\#151515\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 21 21 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c1f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 31 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c23\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 35 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c24\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 36 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1d1d23\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 29 35 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1f1f26\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 31 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222222\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222226\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222227\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 39 / var(--tw-border-opacity, 1))}.dark\:border-\[\#27272a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:border-\[\#5c1c1c\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(92 28 28 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#000000\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#08080b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 8 11 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090d\]\/95:is(.dark *){background-color:#09090df2}.dark\:bg-\[\#0a0a0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b0d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b10\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 16 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c0e\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c10\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 16 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f11\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f16\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 22 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111114\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111118\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121214\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151515\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151518\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#2a0505\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(42 5 5 / var(--tw-bg-opacity, 1))}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:text-\[\#55555e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(85 85 94 / var(--tw-text-opacity, 1))}.dark\:text-\[\#66666e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(102 102 110 / var(--tw-text-opacity, 1))}.dark\:text-\[\#888891\]:is(.dark *){--tw-text-opacity: 1;color:rgb(136 136 145 / var(--tw-text-opacity, 1))}.dark\:text-\[\#8a8a93\]:is(.dark *){--tw-text-opacity: 1;color:rgb(138 138 147 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a1a1aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:text-\[\#b3b3bd\]:is(.dark *){--tw-text-opacity: 1;color:rgb(179 179 189 / var(--tw-text-opacity, 1))}.dark\:text-\[\#e5e7eb\]:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-slate-200:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:before\:bg-\[\#23232a\]:is(.dark *):before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(35 35 42 / var(--tw-bg-opacity, 1))}.dark\:hover\:border-\[\#2a2a31\]:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 49 / var(--tw-border-opacity, 1))}.dark\:hover\:border-\[\#2a2a33\]:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 51 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-\[\#0c0c0e\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#121214\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#18181b\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#222222\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#380808\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(56 8 8 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-slate-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:border-\[\#444444\]:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(68 68 68 / var(--tw-border-opacity, 1))}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.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: 1280px){.xl\:sticky{position:sticky}.xl\:top-6{top:1.5rem}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[340px_minmax\(0\,1fr\)\]{grid-template-columns:340px minmax(0,1fr)}.xl\:grid-cols-\[360px_minmax\(0\,1fr\)\]{grid-template-columns:360px minmax(0,1fr)}.xl\:grid-cols-\[minmax\(0\,1fr\)_380px\]{grid-template-columns:minmax(0,1fr) 380px}.xl\:self-start{align-self:flex-start}.xl\:border-b-0{border-bottom-width:0px}.xl\:border-r{border-right-width:1px}} diff --git a/website/dist/assets/index-_A3lu81S.css b/website/dist/assets/index-_A3lu81S.css deleted file mode 100644 index cf21ca85..00000000 --- a/website/dist/assets/index-_A3lu81S.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Menlo,Monaco,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html{color-scheme:light}html.dark{color-scheme:dark}html,body{font-family:Outfit,Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark html,.dark body{color:#f1f5f9}html,body{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}html:is(.dark *),body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark p,.dark span,.dark h1,.dark h2,.dark h3,.dark h4,.dark h5,.dark h6{color:#f1f5f9}p,span,h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}p:is(.dark *),span:is(.dark *),h1:is(.dark *),h2:is(.dark *),h3:is(.dark *),h4:is(.dark *),h5:is(.dark *),h6:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark p.text-slate-500:is(.dark *),.dark span.text-slate-500:is(.dark *),.dark div.text-slate-500:is(.dark *){color:#64748b}p.text-slate-500:is(.dark *),span.text-slate-500:is(.dark *),div.text-slate-500:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}p.text-slate-600:is(.dark *),span.text-slate-600:is(.dark *),div.text-slate-600:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .text-slate-900,.dark .text-slate-800{color:#f1f5f9!important}.dark .text-slate-700{color:#e2e8f0!important}.dark .text-slate-600{color:#cbd5e1!important}.dark .text-slate-500{color:#94a3b8!important}.dark .text-slate-400{color:#64748b!important}.dark .text-blue-800,.dark .text-blue-700{color:#93c5fd!important}.dark .text-blue-600{color:#60a5fa!important}.dark .text-brand-500{color:#818cf8!important}.dark .bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .bg-slate-100{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1));-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.dark :where(input:not([type=checkbox]):not([type=radio]):not([type=range])),.dark :where(select),.dark :where(textarea){color:#f1f5f9}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){border-radius:9999px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::-moz-placeholder,:where(select)::-moz-placeholder,:where(textarea)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range]))::placeholder,:where(select)::placeholder,:where(textarea)::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus,:where(select):focus,:where(textarea):focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(99 102 241 / .2)}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *),:where(select):is(.dark *),:where(textarea):is(.dark *){border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::-moz-placeholder,:where(select):is(.dark *)::-moz-placeholder,:where(textarea):is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):is(.dark *)::placeholder,:where(select):is(.dark *)::placeholder,:where(textarea):is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])):focus:is(.dark *),:where(select):focus:is(.dark *),:where(textarea):focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 51 56 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}:where(input:not([type=checkbox]):not([type=radio]):not([type=range])),:where(select),:where(textarea){box-shadow:0 1px 2px #0000000d!important;font-family:Outfit,sans-serif}.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),.dark select,.dark textarea{box-shadow:none!important}.dark select option{color:#f1f5f9}select option{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}select option:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}input[type=range]{accent-color:#6366f1}input[type=range]:is(.dark *){accent-color:#fff}input[type=radio],input[type=checkbox]{height:1rem;width:1rem;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));accent-color:#6366f1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}input[type=radio]:is(.dark *),input[type=checkbox]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1));accent-color:#fff}input[type=radio]{border-radius:50%}input[type=checkbox]{border-radius:4px}input[type=radio]:checked,input[type=checkbox]:checked{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}input[type=radio]:checked:is(.dark *),input[type=checkbox]:checked:is(.dark *){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-left-\[25px\]{left:-25px}.bottom-0{bottom:0}.left-64{left:16rem}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.top-6{top:1.5rem}.top-\[76px\]{top:76px}.z-10{z-index:10}.z-20{z-index:20}.z-\[120\]{z-index:120}.z-\[130\]{z-index:130}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-\[76px\]{height:76px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.min-h-0{min-height:0px}.min-h-20{min-height:5rem}.min-h-\[150px\]{min-height:150px}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-32{width:8rem}.w-36{width:9rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[calc\(100\%-12px\)\]{width:calc(100% - 12px)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[220px\]{min-width:220px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.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-\[1fr_100px_32px\]{grid-template-columns:1fr 100px 32px}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#1c1c24\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(28 28 36 / var(--tw-divide-opacity, 1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[14px\]{border-radius:14px}.rounded-\[20px\]{border-radius:20px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[30px\]{border-radius:30px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1c2d50\]{--tw-border-opacity: 1;border-color:rgb(28 45 80 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-brand-500\/30{border-color:#6366f14d}.border-brand-500\/50{border-color:#6366f180}.border-emerald-500\/20{border-color:#10b98133}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-t-gray-500{--tw-border-opacity: 1;border-top-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.bg-\[\#07070b\]{--tw-bg-opacity: 1;background-color:rgb(7 7 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#f8fafc\]{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-brand-500\/10{background-color:#6366f11a}.bg-brand-500\/5{background-color:#6366f10d}.bg-brand-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-400{--tw-bg-opacity: 1;background-color:rgb(192 132 252 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/5{background-color:#ef44440d}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/70{background-color:#f8fafcb3}.bg-slate-50\/80{background-color:#f8fafccc}.bg-slate-50\/90{background-color:#f8fafce6}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-slate-950\/70{background-color:#020617b3}.bg-slate-950\/90{background-color:#020617e6}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-white\/60{background-color:#fff9}.bg-white\/70{background-color:#ffffffb3}.bg-white\/95{background-color:#fffffff2}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-3{padding-bottom:.75rem}.pl-1{padding-left:.25rem}.pl-6{padding-left:1.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Menlo,Monaco,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-6{line-height:1.5rem}.tracking-\[0\.16em\]{letter-spacing:.16em}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-brand-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.accent-brand-500{accent-color:#6366f1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.ring-emerald-500\/20{--tw-ring-color: rgb(16 185 129 / .2)}.ring-orange-500\/20{--tw-ring-color: rgb(249 115 22 / .2)}.ring-purple-500\/20{--tw-ring-color: rgb(168 85 247 / .2)}.ring-red-500\/20{--tw-ring-color: rgb(239 68 68 / .2)}.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{--tw-backdrop-blur: blur(8px);-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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.glass-panel{position:relative;overflow:hidden;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.glass-panel:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 26 29 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1));--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark .glass-panel-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.glass-panel-hover:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.glass-panel-hover:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #a855f7 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient:is(.dark *){--tw-gradient-from: #9b51e0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(155 81 224 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #4f46e5 var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-gradient-to: #0ea5e9 var(--tw-gradient-to-position)}.aurora-top{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#9b51e0,#4f46e5,#0ea5e9,transparent);opacity:.8;z-index:100}.dark .hover\:text-slate-900:hover{color:#f1f5f9!important}.dark .hover\:text-slate-700:hover{color:#e2e8f0!important}.dark .hover\:text-brand-500:hover{color:#818cf8!important}.dark .hover\:bg-slate-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(26 26 29 / var(--tw-bg-opacity, 1))!important}.dark .hover\:bg-slate-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 34 38 / var(--tw-bg-opacity, 1))!important}.group:hover .group-hover\:text-slate-600p:is(.dark *),.group:hover .group-hover\:text-slate-600 span:is(.dark *),.group:hover .group-hover\:text-slate-600 div:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark .group:hover .group-hover\:text-slate-600{color:#cbd5e1!important}.dark .group:hover .group-hover\:text-brand-500{color:#818cf8!important}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:bottom-2:before{content:var(--tw-content);bottom:.5rem}.before\:left-2:before{content:var(--tw-content);left:.5rem}.before\:top-2:before{content:var(--tw-content);top:.5rem}.before\:w-px:before{content:var(--tw-content);width:1px}.before\:bg-slate-200:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.hover\:bg-brand-500\/15:hover{background-color:#6366f126}.hover\:bg-brand-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#28282f\]:focus{--tw-border-opacity: 1;border-color:rgb(40 40 47 / var(--tw-border-opacity, 1))}.focus\:border-brand-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.focus\:border-slate-400:focus{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-brand-500\/20:focus{--tw-ring-color: rgb(99 102 241 / .2)}.focus\:ring-brand-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-offset-1:focus{--tw-ring-offset-width: 1px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-brand-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-brand-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.dark\:divide-\[\#222226\]:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(34 34 38 / var(--tw-divide-opacity, 1))}.dark\:border-\[\#151515\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 21 21 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c1f\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 31 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c23\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 35 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1c1c24\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 28 36 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1d1d23\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 29 35 / var(--tw-border-opacity, 1))}.dark\:border-\[\#1f1f26\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 31 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222222\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222226\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 38 / var(--tw-border-opacity, 1))}.dark\:border-\[\#222227\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(34 34 39 / var(--tw-border-opacity, 1))}.dark\:border-\[\#27272a\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:border-\[\#5c1c1c\]:is(.dark *){--tw-border-opacity: 1;border-color:rgb(92 28 28 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#000000\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#08080b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 8 11 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090b\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#09090d\]\/95:is(.dark *){background-color:#09090df2}.dark\:bg-\[\#0a0a0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b0d\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 13 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b0f\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 15 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0b0b10\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 11 16 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c0e\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0c0c10\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 16 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f11\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 17 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#0f0f16\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 15 22 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111114\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#111118\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 17 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#121214\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151515\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#151518\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(21 21 24 / var(--tw-bg-opacity, 1))}.dark\:bg-\[\#2a0505\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(42 5 5 / var(--tw-bg-opacity, 1))}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:text-\[\#55555e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(85 85 94 / var(--tw-text-opacity, 1))}.dark\:text-\[\#66666e\]:is(.dark *){--tw-text-opacity: 1;color:rgb(102 102 110 / var(--tw-text-opacity, 1))}.dark\:text-\[\#888891\]:is(.dark *){--tw-text-opacity: 1;color:rgb(136 136 145 / var(--tw-text-opacity, 1))}.dark\:text-\[\#8a8a93\]:is(.dark *){--tw-text-opacity: 1;color:rgb(138 138 147 / var(--tw-text-opacity, 1))}.dark\:text-\[\#a1a1aa\]:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:text-\[\#b3b3bd\]:is(.dark *){--tw-text-opacity: 1;color:rgb(179 179 189 / var(--tw-text-opacity, 1))}.dark\:text-\[\#e5e7eb\]:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-black:is(.dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-slate-200:is(.dark *){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-\[\#66666e\]:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(102 102 110 / var(--tw-placeholder-opacity, 1))}.dark\:before\:bg-\[\#23232a\]:is(.dark *):before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(35 35 42 / var(--tw-bg-opacity, 1))}.dark\:hover\:border-\[\#2a2a31\]:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 49 / var(--tw-border-opacity, 1))}.dark\:hover\:border-\[\#2a2a33\]:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(42 42 51 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-\[\#0c0c0e\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(12 12 14 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#121214\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(18 18 20 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#18181b\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#222222\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-\[\#380808\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(56 8 8 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-slate-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:border-\[\#444444\]:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(68 68 68 / var(--tw-border-opacity, 1))}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.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: 1280px){.xl\:sticky{position:sticky}.xl\:top-6{top:1.5rem}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[340px_minmax\(0\,1fr\)\]{grid-template-columns:340px minmax(0,1fr)}.xl\:grid-cols-\[360px_minmax\(0\,1fr\)\]{grid-template-columns:360px minmax(0,1fr)}.xl\:grid-cols-\[minmax\(0\,1fr\)_380px\]{grid-template-columns:minmax(0,1fr) 380px}.xl\:self-start{align-self:flex-start}.xl\:border-b-0{border-bottom-width:0px}.xl\:border-r{border-right-width:1px}} diff --git a/website/dist/index.html b/website/dist/index.html index afbacf00..dd465b0b 100644 --- a/website/dist/index.html +++ b/website/dist/index.html @@ -7,8 +7,8 @@ Juspay Decision Engine Dashboard - - + +
diff --git a/website/src/components/pages/DecisionExplorerPage.tsx b/website/src/components/pages/DecisionExplorerPage.tsx index c48cbf85..48cddc4b 100644 --- a/website/src/components/pages/DecisionExplorerPage.tsx +++ b/website/src/components/pages/DecisionExplorerPage.tsx @@ -48,6 +48,8 @@ interface SimulationResult { timestamp: string } +type TransactionOutcome = 'CHARGED' | 'FAILURE' + type AuditInspectorTab = 'summary' | 'input' | 'response' | 'raw' interface RuleEvaluateParams { @@ -194,6 +196,7 @@ function eventTypeLabel(eventType?: string | null) { if (eventType === 'decision') return 'Decide Gateway' if (eventType === 'gateway_update') return 'Update Gateway' if (eventType === 'rule_hit') return 'Rule Evaluate' + if (eventType === 'rule_evaluation_preview') return 'Preview Result' if (eventType === 'error') return 'Errors' return humanizeAuditValue(eventType) } @@ -202,6 +205,7 @@ function stageLabel(event: PaymentAuditEvent) { if (event.event_stage === 'gateway_decided') return 'Decide Gateway' if (event.event_stage === 'score_updated') return 'Update Gateway' if (event.event_stage === 'rule_applied') return 'Rule Evaluate' + if (event.event_stage === 'preview_evaluated' || event.event_type === 'rule_evaluation_preview') return 'Preview Result' if (event.event_type === 'error') return 'Errors' return humanizeAuditValue(event.event_stage || event.event_type) } @@ -210,6 +214,7 @@ function eventPhase(event: PaymentAuditEvent) { if (event.event_type === 'decision' || event.event_stage === 'gateway_decided') return 'Decide Gateway' if (event.event_type === 'rule_hit' || event.event_stage === 'rule_applied') return 'Rule Evaluate' if (event.event_type === 'gateway_update' || event.event_stage === 'score_updated') return 'Update Gateway' + if (event.event_type === 'rule_evaluation_preview' || event.event_stage === 'preview_evaluated') return 'Preview' return 'Errors' } @@ -227,6 +232,7 @@ function badgeVariantForEvent(event: PaymentAuditEvent): 'blue' | 'green' | 'pur normalizedStatus === 'AUTHORIZED' || normalizedStatus === 'SUCCESS' ) return 'green' + if (event.event_type === 'rule_evaluation_preview') return 'purple' if (event.event_type === 'gateway_update') return 'green' if (event.event_type === 'decision') return 'blue' return 'orange' @@ -250,6 +256,7 @@ function summaryBadgeVariant(status?: string | null): 'blue' | 'green' | 'purple function phaseBadgeVariant(phase: string): 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' { if (phase === 'Decide Gateway') return 'blue' if (phase === 'Rule Evaluate') return 'purple' + if (phase === 'Preview') return 'purple' if (phase === 'Update Gateway') return 'green' if (phase === 'Errors') return 'red' return 'gray' @@ -282,6 +289,18 @@ function buildAuditUrl(merchantId: string, paymentId: string) { return `/analytics/payment-audit?${qs}` } +function buildPreviewTraceUrl(merchantId: string, paymentId: string) { + const qs = queryString({ + scope: 'current', + range: '24h', + page: 1, + page_size: 25, + merchant_id: merchantId, + payment_id: paymentId, + }) + return `/analytics/preview-trace?${qs}` +} + function buildInspectorModel(event: PaymentAuditEvent | null) { if (!event) return null @@ -469,6 +488,8 @@ export function DecisionExplorerPage() { const [volumePayments, setVolumePayments] = useState('100') const [result, setResult] = useState(null) + const [singleRunPaymentId, setSingleRunPaymentId] = useState(null) + const [singleRunOutcome, setSingleRunOutcome] = useState('CHARGED') const [ruleResult, setRuleResult] = useState(null) const [volumeDistribution, setVolumeDistribution] = useState<{ name: string; count: number; percentage: number }[]>([]) const [simulationResults, setSimulationResults] = useState([]) @@ -481,6 +502,10 @@ export function DecisionExplorerPage() { const [selectedAuditPaymentId, setSelectedAuditPaymentId] = useState(null) const [selectedAuditEventId, setSelectedAuditEventId] = useState(null) const [auditInspectorTab, setAuditInspectorTab] = useState('summary') + const [selectedPreviewPaymentId, setSelectedPreviewPaymentId] = useState(null) + const [selectedPreviewEventId, setSelectedPreviewEventId] = useState(null) + const [previewInspectorTab, setPreviewInspectorTab] = useState('summary') + const [previewTraceLabel, setPreviewTraceLabel] = useState('Rule Evaluation Preview') const routingKeyNames = useMemo( () => Object.keys(routingKeysConfig).sort(), @@ -521,6 +546,15 @@ export function DecisionExplorerPage() { revalidateOnFocus: true, }) + const previewTraceUrl = merchantId && selectedPreviewPaymentId + ? buildPreviewTraceUrl(merchantId, selectedPreviewPaymentId) + : null + + const previewTraceDetail = useSWR(previewTraceUrl, fetcher, { + refreshInterval: selectedPreviewPaymentId ? 12000 : 0, + revalidateOnFocus: true, + }) + useEffect(() => { if (routingConfigUnavailable || routingKeysLoading) return @@ -576,7 +610,7 @@ export function DecisionExplorerPage() { ]) useEffect(() => { - if (!selectedAuditPaymentId) return + if (!selectedAuditPaymentId && !selectedPreviewPaymentId) return const previousOverflow = document.body.style.overflow const onKeyDown = (event: KeyboardEvent) => { @@ -584,6 +618,9 @@ export function DecisionExplorerPage() { setSelectedAuditPaymentId(null) setSelectedAuditEventId(null) setAuditInspectorTab('summary') + setSelectedPreviewPaymentId(null) + setSelectedPreviewEventId(null) + setPreviewInspectorTab('summary') } } @@ -594,7 +631,7 @@ export function DecisionExplorerPage() { document.body.style.overflow = previousOverflow window.removeEventListener('keydown', onKeyDown) } - }, [selectedAuditPaymentId]) + }, [selectedAuditPaymentId, selectedPreviewPaymentId]) function set(field: keyof FormState, value: string | boolean) { setForm(f => ({ ...f, [field]: value })) @@ -646,12 +683,14 @@ export function DecisionExplorerPage() { if (!merchantId) return setError('Set a merchant ID in the top bar') if (routingConfigUnavailable) return setError('Routing key config unavailable. Fix /config/routing-keys and retry.') setLoading(true); setError(null) + setSingleRunPaymentId(null) const gateways = form.eligible_gateways.split(',').map(s => s.trim()).filter(Boolean) + const paymentId = `explorer_${Date.now()}` try { const res = await apiPost('/decide-gateway', { merchantId: merchantId, paymentInfo: { - paymentId: `explorer_${Date.now()}`, + paymentId: paymentId, amount: parseFloat(form.amount) || 1000, currency: form.currency, paymentType: 'ORDER_PAYMENT', @@ -664,7 +703,16 @@ export function DecisionExplorerPage() { rankingAlgorithm: form.ranking_algorithm, eliminationEnabled: form.elimination_enabled, }) + await apiPost('/update-gateway-score', { + merchantId: merchantId, + gateway: res.decided_gateway, + gatewayReferenceId: null, + status: singleRunOutcome, + paymentId: paymentId, + enforceDynamicRoutingFailure: null, + }) setResult(res) + setSingleRunPaymentId(paymentId) } catch (e: unknown) { setError(e instanceof Error ? e.message : 'Request failed') } finally { @@ -757,6 +805,7 @@ export function DecisionExplorerPage() { setError(null) setRuleResult(null) setVolumeDistribution([]) + const previewPaymentId = `rule_preview_${Date.now()}` try { const parameters: Record = {} @@ -777,6 +826,7 @@ export function DecisionExplorerPage() { const res = await apiPost('/routing/evaluate', { created_by: merchantId || 'test_user', + payment_id: previewPaymentId, fallback_output: fallbackConnectors.filter(c => c.gateway_name), parameters, }) @@ -803,10 +853,12 @@ export function DecisionExplorerPage() { setLoading(true) setError(null) setVolumeDistribution([]) + const previewPaymentId = `volume_preview_${Date.now()}` try { const res = await apiPost('/routing/evaluate', { created_by: merchantId || 'test_user', + payment_id: previewPaymentId, fallback_output: [ { gateway_name: 'stripe', gateway_id: 'gateway_001' }, { gateway_name: 'adyen', gateway_id: 'gateway_002' }, @@ -891,7 +943,47 @@ export function DecisionExplorerPage() { const auditInspectorModel = useMemo(() => buildInspectorModel(selectedAuditEvent), [selectedAuditEvent]) + const previewSummary = useMemo(() => { + const results = previewTraceDetail.data?.results || [] + return results.find((row) => row.payment_id === selectedPreviewPaymentId) || results[0] || null + }, [previewTraceDetail.data?.results, selectedPreviewPaymentId]) + + const selectedPreviewEvent = useMemo(() => { + const timeline = previewTraceDetail.data?.timeline || [] + return timeline.find((event) => event.id === selectedPreviewEventId) || timeline[0] || null + }, [previewTraceDetail.data?.timeline, selectedPreviewEventId]) + + useEffect(() => { + if (selectedPreviewEvent?.id) { + setSelectedPreviewEventId(selectedPreviewEvent.id) + return + } + const first = previewTraceDetail.data?.timeline?.[0] + if (first?.id) { + setSelectedPreviewEventId(first.id) + } + }, [previewTraceDetail.data?.timeline, selectedPreviewEvent?.id]) + + const groupedPreviewTimeline = useMemo(() => { + const groups: Array<{ phase: string; events: PaymentAuditEvent[] }> = [] + for (const event of previewTraceDetail.data?.timeline || []) { + const phase = eventPhase(event) + const current = groups[groups.length - 1] + if (!current || current.phase !== phase) { + groups.push({ phase, events: [event] }) + } else { + current.events.push(event) + } + } + return groups + }, [previewTraceDetail.data?.timeline]) + + const previewInspectorModel = useMemo(() => buildInspectorModel(selectedPreviewEvent), [selectedPreviewEvent]) + function openAuditModal(paymentId: string) { + setSelectedPreviewPaymentId(null) + setSelectedPreviewEventId(null) + setPreviewInspectorTab('summary') setSelectedAuditPaymentId(paymentId) setSelectedAuditEventId(null) setAuditInspectorTab('summary') @@ -903,6 +995,22 @@ export function DecisionExplorerPage() { setAuditInspectorTab('summary') } + function openPreviewModal(paymentId: string, label: string) { + setSelectedAuditPaymentId(null) + setSelectedAuditEventId(null) + setAuditInspectorTab('summary') + setPreviewTraceLabel(label) + setSelectedPreviewPaymentId(paymentId) + setSelectedPreviewEventId(null) + setPreviewInspectorTab('summary') + } + + function closePreviewModal() { + setSelectedPreviewPaymentId(null) + setSelectedPreviewEventId(null) + setPreviewInspectorTab('summary') + } + return (
@@ -1182,6 +1290,23 @@ export function DecisionExplorerPage() {
+ {activeTab === 'single' && ( +
+ + +

+ After deciding the gateway, single test will post feedback with this outcome so the payment appears in Decision Audit. +

+
+ )} + {activeTab === 'batch' && (

@@ -1250,7 +1375,7 @@ export function DecisionExplorerPage() { ) : ( )} @@ -1262,7 +1387,21 @@ export function DecisionExplorerPage() { <> -

Volume Distribution Overview

+
+
+

Volume Distribution Overview

+

Preview only. This uses the active routing rule and stores a trace for inspection.

+
+ {ruleResult?.payment_id ? ( + + ) : null} +
@@ -1418,9 +1557,9 @@ export function DecisionExplorerPage() {
-

Payment Log

+

Projected Sequence

- Simulated sequence based on the configured split, shown in shuffled order instead of connector blocks. + Preview-only projection based on the configured split. This is not a live payment trail.

@@ -1493,6 +1632,15 @@ export function DecisionExplorerPage() {

{ruleResult.status}

output_type: {ruleResult.output.type}

+ {ruleResult.payment_id ? ( + + ) : null}

{ruleResult.output.type === 'single' && ruleResult.output.connector && ( @@ -1667,18 +1815,43 @@ export function DecisionExplorerPage() {

Decided Gateway

{result.decided_gateway}

-
+
{result.routing_approach}
+ {singleRunPaymentId ? ( + + ) : null} {result.is_scheduled_outage && Scheduled Outage} + {singleRunPaymentId ? ( + + {singleRunOutcome} + + ) : null} {result.latency != null && (

{result.latency}ms

)}
+ {singleRunPaymentId ? ( +
+

+ Payment ID +

+

{singleRunPaymentId}

+

+ Feedback recorded as {singleRunOutcome}. Open audit to inspect the full decide and update flow. +

+
+ ) : null} {result.routing_dimension && (
@@ -1793,7 +1966,7 @@ export function DecisionExplorerPage() { -

Fill in the parameters and click "Run Decision" to see the routing result.

+

Fill in the parameters and click "Run Single Transaction" to decide a gateway, post feedback, and inspect the audit trail.

) @@ -2028,6 +2201,216 @@ export function DecisionExplorerPage() {
)} + + {selectedPreviewPaymentId && ( +
+ + +
+
+ +
+
+
+

Preview Timeline

+

+ Choose a preview step to inspect its request, response, and routing output. +

+
+
+ {previewTraceDetail.isLoading && !previewTraceDetail.data ? ( +
+ + Loading preview trace… +
+ ) : previewTraceDetail.error ? ( + + ) : groupedPreviewTimeline.length ? ( +
+ {groupedPreviewTimeline.map((group) => ( +
+
+ {group.phase} +
+
+ {group.events.map((event) => ( + + ))} +
+
+ ))} +
+ ) : ( + + )} +
+
+ +
+
+
+
+

+ {selectedPreviewEvent ? stageLabel(selectedPreviewEvent) : 'Preview Inspector'} +

+

+ {selectedPreviewEvent + ? `${routeLabel(selectedPreviewEvent.route)} · ${formatDateTime(selectedPreviewEvent.created_at_ms)}` + : 'Select an event from the left to inspect the preview payload.'} +

+
+
+ {selectedPreviewEvent?.gateway ? {selectedPreviewEvent.gateway} : null} + {selectedPreviewEvent?.status ? ( + + {humanizeAuditValue(selectedPreviewEvent.status)} + + ) : null} +
+
+
+ {(['summary', 'input', 'response', 'raw'] as AuditInspectorTab[]).map((tab) => ( + + ))} +
+
+ +
+ {previewTraceDetail.isLoading && !previewTraceDetail.data ? ( +
+ + Loading preview inspector… +
+ ) : previewInspectorModel ? ( +
+ {previewInspectorTab === 'summary' ? ( + <> + + + + ) : null} + + {previewInspectorTab === 'input' ? ( + + ) : null} + + {previewInspectorTab === 'response' ? ( + + ) : null} + + {previewInspectorTab === 'raw' ? ( + + ) : null} +
+ ) : ( + + )} +
+
+
+
+
+ )}

9h02}M)a+y3qL>vhNz!RLYwq5wy?ZNkPZk|(*3Cs=I zpT3SmtM!8?4}+nUk!^DJS1@v@n|Ja>dZ9@xUi0+}O)JhvYECP6 zq+C!mx8TPF;Kz_&tgvV3l{gY^6Vk0+9DUGPwKFvp#1C2*D{&dJr9U>0uRFC*Yq1u7 z$<|FaFPox1$60%kC*m-B_7?o@{I18RYgPfW|6BN=W-iC(M0$_ZG^p7UHqcwy8s!s7 zNakaz?xwMVBfxu$P}{2Jke*NAHV9`eS?BG)Esw_z?Bh};eSksds-}NSJ55!Js?kpm2 zgV%Owjgi?R!1p)L1GzKv&PtW2WW0Z1=El!Wir}3~>8r%hzu-v%$Vkbj&hajPRg8ZL zpFTb=HhnPg&CVG=9k>_?KKye)>r3nO5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b`N2ogPi1Lw*Q7Bj#YCCI9UjcFY_5y~1MrqN!x zC^a>sT@4hRXp+#bGYvIp&smj4`I2DB=mbE~G^LA_ATuW!tWS@eJxPy`MaV#QVlWh@ z3z9j&oKF#NUZwKU^*GXs%6&v2!&DduVY78lY0$;~I-rP)>W#@V;}Md%=*X0fv=uT= z$PG5TX=>02w)rByv%=7G2}47~jG_944u@ERjV~Qa@4h)ZIemM1>h62J?;Phn2@&V%JUN(~wI5-uLwEy( z4H+?{Y&$04hT&K)G;=zPZy-ZXfO*XDU>aw{V|c;$XVTUE)mL9Zcr|T$6_CZkc_5qgusZ-5F>Kk9kB`KYMO*3a6&x6u{MT<=6GMx an)CMAKHKMMJpUg60RR8)g6lm1Kn4H`xxeKA diff --git a/helm-charts/charts/postgresql-18.5.14.tgz b/helm-charts/charts/postgresql-18.5.14.tgz new file mode 100644 index 0000000000000000000000000000000000000000..41fb11aeae81c84429552fb8260d8cb7e95aa53f GIT binary patch literal 89368 zcmV)GK)$~piwFP!00000|Lnc}dfPa%H~9YTtH5!eIk9^zIUk+wne53q>$aV4pK%hc z<)mlc%sdf9LK52)$>xV0^?3H#+t}ONE7__7K!Ox0L5l2Hitx;IED|UJKNJduLZJ|a zNji*0@|%D7zwRnMe*E3zAD%yFj~_pN^275d=D#|zC(oaJ|Mp#Q)7;n_3j|L>kX z{chX;_mQUi-wDU#FjyrUEZ+amzkjmr|9eS|{hx|)b^A48mBf_8W-p_uqZj*#AF#_ayKC z?|*oLO0z+G^CNue|@iVI7{PA`TLkhD`Q8yBUdq^)t_Ry@tg-P5D3JOmXd5Qip9YD zBwTjmLB4<6Z?m_7KVe}&C9z5@5;60=K(u$-C*6fj%k6)-XC|F>&3}Vd+4Qy z^j}&1op%5C_>lgqAB={F_#gcmh1J4)9&bRI4CW8O=`4#*(9mC)MH)MU! zV=v4Sc6M?KAB^JgSK*{PZO;|_Q09Y2kk1g?tW(|hI4~IL)KOepM>Gb^VPwg>+)^$c=%vrGzXL~5D!x(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3nNFV_S&v?$=o1S z4(hk|c;usT$&wM#o>ZgrP-=pu)7 z2cgXYWJCysj-8?zlv3lbmQaI>irP!3c8r(6ir6caQuu!}x!AOvARXOV7p@24ECNCD zhxsdUGyL83FEe2k-@ zrip6&a@@evM8$N}g2n*|s9%Gl;7=bvdm@$SAPM; p?&pv&tZ4!>$yy&Uoq8&?;CJtz_s{$1{qukD`3-C#fd&973IGbxIzRvb literal 0 HcmV?d00001 diff --git a/helm-charts/charts/redis-17.11.8.tgz b/helm-charts/charts/redis-17.11.8.tgz deleted file mode 100644 index 1aed4703b543738d72b21d0c283f8819615ce0ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92279 zcmV)HK)t^oiwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0POvHcN@8}D2nHAeF|*a*_QHCQ>6Tw&BQrBjiecCjV1F+^32&c z$+DqtkVMpMbQ);MjK|;oF1)${H2T4Zr$rdAU1R1=76m0tl zGn_I}bk67b_W2IL6u<2J*lXV;9el#cc^8~P!cZ{d*l$n#|nQr>otG8kUdJ-N2= zd@BDHh~i*>fADet>9c;COt-Gl;+ABQ7#>k)E8v6+9&81oe_{^IAr_rLnK6>Tp5DR? z?Shje>~8^(XK_i?6th`=C1_Ig?WqxzZ6z`}00Lxd!#$QEw8sf4K1d+Ns1INEhr|94 zTVHxfeN#VE{>LP|z6%^J@_+F3*}#?m`!8QS$p8EJ-HnhoB=L*>U@O8?MA-afB*UZiDfBxd-!}`CE-y?8H(nW@+GiGn-kHE$F=>G<9r0y4- zL?~f+f>AaC2jhdo*T+H&+#2_K?*ZCM+{|@e^rG?LRJ7ghg0O# z7{>@wvWC~06C z-1?Qo`5bN2ohm3HO!_ILlxvk5m{7g{J44eygW}V+9#{%Kz?{vBMjtrXEeVgS`4+E6 zpx4_1;L#&++@JR4zg&ilWHCP=%on=hFK8h@pTRj26*OqGCHUJvwtzK$3Zdv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